PhreeqcRM
YAMLPhreeqcRM::yaml_phreeqcrm Type Reference

Public Member Functions

procedure CreateYAMLPhreeqcRM (self)
 
procedure DestroyYAMLPhreeqcRM (self)
 
procedure WriteYAMLDoc (self, file_name)
 
procedure YAMLClear (self)
 
procedure YAMLAddOutputVars (self, option, def)
 
procedure YAMLCloseFiles (self)
 
procedure YAMLCreateMapping (self, grid2chem)
 
procedure YAMLDumpModule (self, dump_on, append)
 
procedure YAMLFindComponents (self)
 
procedure YAMLInitialSolutions2Module (self, solutions)
 
procedure YAMLInitialEquilibriumPhases2Module (self, equilibrium_phases)
 
procedure YAMLInitialExchanges2Module (self, exchanges)
 
procedure YAMLInitialSurfaces2Module (self, surfaces)
 
procedure YAMLInitialGasPhases2Module (self, gas_phases)
 
procedure YAMLInitialSolidSolutions2Module (self, solid_solutions)
 
procedure YAMLInitialKinetics2Module (self, kinetics)
 
procedure YAMLInitialPhreeqc2Module (self, ic1)
 
procedure YAMLInitialPhreeqc2Module_mix (self, ic1, ic2, f1)
 
procedure YAMLInitialPhreeqcCell2Module (self, n, cell_numbers)
 
procedure YAMLLoadDatabase (self, file_name)
 
procedure YAMLLogMessage (self, str)
 
procedure YAMLOpenFiles (self)
 
procedure YAMLOutputMessage (self, str)
 
procedure YAMLRunCells (self)
 
procedure YAMLRunFile (self, workers, initial_phreeqc, utility, file_name)
 
procedure YAMLRunString (self, workers, initial_phreeqc, utility, input_string)
 
procedure YAMLScreenMessage (self, str)
 
procedure YAMLSetComponentH2O (self, tf)
 
procedure YAMLSetConcentrations (self, c)
 
procedure YAMLSetCurrentSelectedOutputUserNumber (self, n_user)
 
procedure YAMLSetDensityUser (self, density)
 
procedure YAMLSetDumpFileName (self, file_name)
 
procedure YAMLSetErrorHandlerMode (self, mode)
 
procedure YAMLSetErrorOn (self, tf)
 
procedure YAMLSetFilePrefix (self, prefix)
 
procedure YAMLSetGasCompMoles (self, gas_moles)
 
procedure YAMLSetGasPhaseVolume (self, gas_volume)
 
procedure YAMLSetGridCellCount (self, n)
 
procedure YAMLSetNthSelectedOutput (self, n)
 
procedure YAMLSetPartitionUZSolids (self, tf)
 
procedure YAMLSetPorosity (self, por)
 
procedure YAMLSetPressure (self, p)
 
procedure YAMLSetPrintChemistryMask (self, mask)
 
procedure YAMLSetPrintChemistryOn (self, workers, initial_phreeqc, utility)
 
procedure YAMLSetRebalanceByCell (self, tf)
 
procedure YAMLSetRebalanceFraction (self, f)
 
procedure YAMLSetRepresentativeVolume (self, rv)
 
procedure YAMLSetSaturationUser (self, sat)
 
procedure YAMLSetScreenOn (self, tf)
 
procedure YAMLSetSelectedOutputOn (self, tf)
 
procedure YAMLSetSpeciesSaveOn (self, save_on)
 
procedure YAMLSetTemperature (self, tc)
 
procedure YAMLSetTime (self, time)
 
procedure YAMLSetTimeConversion (self, conv_factor)
 
procedure YAMLSetTimeStep (self, time_step)
 
procedure YAMLSetUnitsExchange (self, option)
 
procedure YAMLSetUnitsGasPhase (self, option)
 
procedure YAMLSetUnitsKinetics (self, option)
 
procedure YAMLSetUnitsPPassemblage (self, option)
 
procedure YAMLSetUnitsSolution (self, option)
 
procedure YAMLSetUnitsSSassemblage (self, option)
 
procedure YAMLSetUnitsSurface (self, option)
 
procedure YAMLSpeciesConcentrations2Module (self, species_conc)
 
procedure YAMLStateSave (self, n)
 
procedure YAMLStateApply (self, n)
 
procedure YAMLStateDelete (self, n)
 
procedure YAMLThreadCount (self, n)
 
procedure YAMLUseSolutionDensityVolume (self, tf)
 
procedure YAMLWarningMessage (self, str)
 

Public Attributes

integer yaml_id
 

Member Function/Subroutine Documentation

◆ CreateYAMLPhreeqcRM()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::CreateYAMLPhreeqcRM ( class(yaml_phreeqcrm), intent(inout)  self)

Creates a YAMLPhreeqcRM instance with a YAML document that is ready to for writing data for initiation of a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
See also
DestroyYAMLPhreeqcRM.
Fortran Example:
 ! Create YAMLPhreeqcRM document
 type(YAML_PhreeqcRM) :: yrm
 id = yrm%CreateYAMLPhreeqcRM()
 

◆ DestroyYAMLPhreeqcRM()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::DestroyYAMLPhreeqcRM ( class(yaml_phreeqcrm), intent(inout)  self)

Deletes the YAMLPhreeqcRM instance and all data.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
Return values
IRM_RESULTZero indicates success, negative indicates failure.
See also
YAMLClear.
Fortran Example:
 YAML_filename = "AdvectBMI_f90.yaml"
 status = yrm%WriteYAMLDoc(YAML_filename)
 status = yrm%YAMLClear()
 status = yrm%DestroyYAMLPhreeqcRM()
 

◆ WriteYAMLDoc()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::WriteYAMLDoc ( class(yaml_phreeqcrm), intent(inout)  self,
character(len=*), intent(in)  file_name 
)

Writes YAML document to file.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
file_nameName of file to write YAML document.
Return values
IRM_RESULTZero indicates success, negative indicates failure.
See also
DestroyYAMLPhreeqcRM, YAMLClear.
Fortran Example:
 YAML_filename = "AdvectBMI_f90.yaml"
 status = yrm%WriteYAMLDoc(YAML_filename)
 status = yrm%YAMLClear()
 status = yrm%DestroyYAMLPhreeqcRM()
 

◆ YAMLAddOutputVars()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLAddOutputVars ( class(yaml_phreeqcrm), intent(inout)  self,
character(len=*), intent(in)  option,
character(len=*), intent(in)  def 
)

Inserts data into the YAML document to select sets of output variables. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance. Sets of variables can be included or excluded with multiple calls to this method. All calls must precede the final call to YAMLFindComponents. FindComponents generates SELECTED_OUTPUT 333 and USER_PUNCH 333 data blocks that make the variables accessible. Variables will only be accessible if the system includes the given reactant; for example, no gas variables will be created if there are no GAS_PHASEs in the model.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
optionA string value, among those listed below, that selects sets of variables that can be retieved by the bmif_get_value method.
defA string value that can be "false", "true", or a list of items to be included as accessible variables. A value of "false", excludes all variables of the given type; a value of "true" includes all variables of the given type for the current system; a list specifies a subset of items of the given type.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

Values for the the parameter option:


AddOutputVars: False excludes all variables; True causes the settings for each variable group to determine the variables that will be defined. Default True;
SolutionProperties: False excludes all solution property variables; True includes variables pH, pe, alkalinity, ionic strength, water mass, charge balance, percent error, and specific conductance. Default True.
SolutionTotalMolalities: False excludes all total element and element redox state variables; True includes all elements and element redox state variables for the system defined for the calculation; list restricts variables to the specified elements and redox states. Default True.
ExchangeMolalities: False excludes all variables related to exchange; True includes all variables related to exchange; list includes variables for the specified exchange species. Default True.
SurfaceMolalities: False excludes all variables related to surfaces; True includes all variables related to surfaces; list includes variables for the specified surface species. Default True.
EquilibriumPhases: False excludes all variables related to equilibrium phases; True includes all variables related to equilibrium phases; list includes variables for the specified equilibiurm phases. Default True.
Gases: False excludes all variables related to gases; True includes all variables related to gases; list includes variables for the specified gas components. Default True.
KineticReactants: False excludes all variables related to kinetic reactants; True includes all variables related to kinetic reactants; list includes variables for the specified kinetic reactants. Default True.
SolidSolutions: False excludes all variables related to solid solutions; True includes all variables related to solid solutions; list includes variables for the specified solid solutions components. Default True.
CalculateValues: False excludes all calculate values; True includes all calculate values; list includes the specified calculate values. CALCLUATE_VALUES can be used to calculate geochemical quantities not available in the other sets of variables. Default True.
SolutionActivities: False excludes all aqueous species; True includes all aqueous species; list includes only the specified aqueous species. Default False.
SolutionMolalities: False excludes all aqueous species; True includes all aqueous species; list includes only the specified aqueous species. Default False.
SaturationIndices: False excludes all saturation indices; True includes all saturation indices; list includes only the specified saturation indices. Default False.

Fortran Example:
 status = yrm%YAMLAddOutputVars("SolutionMolalities", "True")
 status = yrm%YAMLAddOutputVars("SaturationIndices", "Calcite Dolomite")
 

◆ YAMLClear()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLClear ( class(yaml_phreeqcrm), intent(inout)  self)

Clears all definitions from the YAML document.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
Return values
IRM_RESULTZero indicates success, negative indicates failure.
See also
DestroyYAMLPhreeqcRM.
Fortran Example:
 YAML_filename = "AdvectBMI_f90.yaml"
 status = yrm%WriteYAMLDoc(YAML_filename)
 status = yrm%YAMLClear()
 status = yrm%DestroyYAMLPhreeqcRM()
 

◆ YAMLCloseFiles()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLCloseFiles ( class(yaml_phreeqcrm), intent(inout)  self)

Inserts data into the YAML document for the PhreeqcRM method CloseFiles. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

CloseFiles closes the output and log files.

Fortran Example:
 status = yrm%YAMLCloseFiles()
 

◆ YAMLCreateMapping()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLCreateMapping ( class(yaml_phreeqcrm), intent(inout)  self,
integer, dimension(:), intent(in), allocatable  grid2chem 
)

Inserts data into the YAML document for the PhreeqcRM method CreateMapping. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
grid2chemInteger array of mapping from user's model grid to cells for which chemistry will be run.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

CreateMapping provides a mapping from grid cells in the user's model to reaction cells for which chemistry needs to be run. The mapping is used to eliminate inactive cells and to use symmetry to decrease the number of cells for which chemistry must be run. The array grid2chem of size nxyz (the number of grid cells) must contain the set of all integers 0 <= i < count_chemistry, where count_chemistry is a number less than or equal to nxyz. Inactive cells are assigned a negative integer. The mapping may be many-to-one to account for symmetry. Default is a one-to-one mapping–all user grid cells are reaction cells (equivalent to grid2chem values of 0,1,2,3,...,nxyz-1).

Fortran Example:
 ! Demonstation of mapping, two equivalent rows by symmetry
 ! zero-based indexing
 integer, allocatable, dimension(:) :: grid2chem
 allocate(grid2chem(nxyz))
 grid2chem = -1
 do i = 1, nxyz / 2
     grid2chem(i) = i - 1
     grid2chem(i + nxyz / 2) = i - 1
 enddo
 status = yrm%YAMLCreateMapping(igrid2chem)
 

◆ YAMLDumpModule()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLDumpModule ( class(yaml_phreeqcrm), intent(inout)  self,
logical, intent(in)  dump_on,
logical, intent(in)  append 
)

Inserts data into the YAML document for the PhreeqcRM method DumpModule. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
dump_onSignal for writing the dump file, true or false.
appendSignal to append to the contents of the dump file, true or false.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

DumpModule writes the contents of all workers to file in _RAW formats (see appendix of PHREEQC version 3 manual), including SOLUTIONs and all reactants.

See also
YAMLSetDumpFileName.
Fortran Example:
 logical dump_on, append
 dump_on = .true.
 append = .false.
 status = yrm%YAMLSetDumpFileName("Advect_cpp.dmp")
 status = yrm%YAMLDumpModule(dump_on, append)
 

◆ YAMLFindComponents()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLFindComponents ( class(yaml_phreeqcrm), intent(inout)  self)

Inserts data into the YAML document for the PhreeqcRM method FindComponents. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
Return values
Zeroindicates success, negative indicates failure.

FindComponents accumulates a list of elements. Elements are those that have been defined in a solution or any other reactant (EQUILIBRIUM_PHASE, KINETICS, and others), including charge imbalance. This method can be called multiple times and the list that is created is cummulative. The list is the set of components that needs to be transported. By default the list includes water, excess H and excess O (the H and O not contained in water); alternatively, the list may be set to contain total H and total O (YAMLSetComponentH2O), which requires transport results to be accurate to eight or nine significant digits. If multicomponent diffusion (MCD) is to be modeled, there is a capability to retrieve aqueous species concentrations and to set new solution concentrations after MCD by using individual species concentrations (YAMLSpeciesConcentrations2Module). To use these methods, the save-species property needs to be turned on (YAMLSetSpeciesSaveOn). If the save-species property is on, FindComponents will generate a list of aqueous species, their diffusion coefficients at 25 C, and their charge.

The FindComponents method also generates lists of reactants–equilibrium phases, exchangers, gas components, kinetic reactants, solid solution components, and surfaces. The lists are cumulative, including all reactants that were defined in the initial phreeqc instance at any time FindComponents was called. In addition, a list of phases is generated for which saturation indices may be calculated from the cumulative list of components.

See also
YAMLSetComponentH2O, YAMLSetSpeciesSaveOn, YAMLSpeciesConcentrations2Module.
Fortran Example:
 status = yrm%YAMLRunFile(yaml_file)
 status = yrm%YAMLFindComponents()
 

◆ YAMLInitialEquilibriumPhases2Module()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLInitialEquilibriumPhases2Module ( class(yaml_phreeqcrm), intent(inout)  self,
integer, dimension(:), intent(in), allocatable  equilibrium_phases 
)

Inserts data into the YAML document for the PhreeqcRM method InitialEquilibriumPhases2Module. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
equilibrium_phasesVector of EQUILIBRIUM_PHASES index numbers that is dimensioned nxyz, where nxyz is the number of grid cells in the user's model.
Return values
Zeroindicates success, negative indicates failure.

InitialEquilibriumPhases2Module transfers EQUILIBRIUM_PHASES definitions from the InitialPhreeqc instance to the reaction-module workers. equilibrium_phases is a vector of EQUILIBRIUM_PHASES index numbers that refer to definitions in the InitialPhreeqc instance.

◆ YAMLInitialExchanges2Module()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLInitialExchanges2Module ( class(yaml_phreeqcrm), intent(inout)  self,
integer, dimension(:), intent(in), allocatable  exchanges 
)

Inserts data into the YAML document for the PhreeqcRM method InitialExchanges2Module. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
exchangesVector of EXCHANGE index numbers that is dimensioned nxyz, where nxyz is the number of grid cells in the user's model.
Return values
Zeroindicates success, negative indicates failure.

InitialExchanges2Module transfers EXCHANGE definitions from the InitialPhreeqc instance to the reaction-module workers. exchanges is a vector of EXCHANGE index numbers that refer to definitions in the InitialPhreeqc instance.

◆ YAMLInitialGasPhases2Module()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLInitialGasPhases2Module ( class(yaml_phreeqcrm), intent(inout)  self,
integer, dimension(:), intent(in), allocatable  gas_phases 
)

Inserts data into the YAML document for the PhreeqcRM method InitialGasPhases2Module. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
gas_phasesVector of GAS_PHASE index numbers that is dimensioned nxyz, where nxyz is the number of grid cells in the user's model.
Return values
Zeroindicates success, negative indicates failure.

InitialGasPhases2Module transfers GAS_PHASE definitions from the InitialPhreeqc instance to the reaction-module workers. gas_phases is a vector of GAS_PHASE index numbers that refer to definitions in the InitialPhreeqc instance.

◆ YAMLInitialKinetics2Module()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLInitialKinetics2Module ( class(yaml_phreeqcrm), intent(inout)  self,
integer, dimension(:), intent(in), allocatable  kinetics 
)

Inserts data into the YAML document for the PhreeqcRM method InitialKinetics2Module. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
kineticsVector of KINETICS index numbers that is dimensioned nxyz, where nxyz is the number of grid cells in the user's model.
Return values
Zeroindicates success, negative indicates failure.

InitialKinetics2Module transfers KINETICS definitions from the InitialPhreeqc instance to the reaction-module workers. kinetics is a vector of KINETICS index numbers that refer to definitions in the InitialPhreeqc instance.

◆ YAMLInitialPhreeqc2Module()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLInitialPhreeqc2Module ( class(yaml_phreeqcrm), intent(inout)  self,
integer, dimension(:,:), intent(in), allocatable  ic1 
)

Inserts data into the YAML document for the PhreeqcRM method InitialPhreeqc2Module. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
ic1Vector of solution and reactant index numbers that refer to definitions in the InitialPhreeqc instance.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

InitialPhreeqc2Module transfers solutions and reactants from the InitialPhreeqc instance to the reaction-module workers. ic1 is used to select initial conditions, including solutions and reactants, for each cell of the model, without mixing. ic1 is dimensioned 7 times nxyz, where nxyz is the number of grid cells in the user's model. The dimension of 7 refers to solutions and reactants in the following order: (0) SOLUTIONS, (1) EQUILIBRIUM_PHASES, (2) EXCHANGE, (3) SURFACE, (4) GAS_PHASE, (5) SOLID_SOLUTIONS, and (6) KINETICS. The definition initial_solution1[3*nxyz + 99] = 2, indicates that cell 99 (0 based) contains the SURFACE definition (index 3) defined by SURFACE 2 in the InitialPhreeqc instance.

Size is 7 times nxyz. The order of definitions is given above. Negative values are ignored, resulting in no definition of that entity for that cell.

See also
YAMLInitialPhreeqcCell2Module, YAMLInitialPhreeqc2Module_mix.
Fortran Example:
 integer, allocatable, dimension(:,:) :: ic1
 allocate(ic1(nxyz,7))
 do i = 1, nxyz
    ic1(i,1) = 1     ! Solution 1
    ic1(i,2) = -1    ! Equilibrium phases none
    ic1(i,3) = 1     ! Exchange 1
    ic1(i,4) = -1    ! Surface none
    ic1(i,5) = -1    ! Gas phase none
    ic1(i,6) = -1    ! Solid solutions none
    ic1(i,7) = -1    ! Kinetics none
 enddo
 status = yrm%YAMLInitialPhreeqc2Module_mix(ic1)
 

◆ YAMLInitialPhreeqc2Module_mix()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLInitialPhreeqc2Module_mix ( class(yaml_phreeqcrm), intent(inout)  self,
integer, dimension(:,:), intent(in), allocatable  ic1,
integer, dimension(:,:), intent(in), allocatable  ic2,
real(kind=8), dimension(:,:), intent(in), allocatable  f1 
)

Inserts data into the YAML document for the PhreeqcRM method InitialPhreeqc2Module. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
ic1Vector of solution and reactant index numbers that refer to definitions in the InitialPhreeqc instance. Size is 7 times nxyz, where nxyz is the number of grid cells in the user's model. The order of reactants is given below and in the example. Negative values are ignored, resulting in no definition of that entity for that cell.
ic2Vector of solution and reactant index numbers that refer to definitions in the InitialPhreeqc instance. Nonnegative values of ic2 result in mixing with the entities defined in ic1. Negative values result in no mixing. Size is 7 times nxyz.
f1Fraction of ic1 that mixes with (1 - f1) of ic2. Size is 7 times nxyz.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

InitialPhreeqc2Module transfers solutions and reactants from the InitialPhreeqc instance to the reaction-module workers, possibly with mixing. In its simplest form, ic1 is used to select initial conditions, including solutions and reactants, for each cell of the model, without mixing. The dimension of 7 refers to solutions and reactants in the following order: (0) SOLUTIONS, (1) EQUILIBRIUM_PHASES, (2) EXCHANGE, (3) SURFACE, (4) GAS_PHASE, (5) SOLID_SOLUTIONS, and (6) KINETICS. The definition ic1[3*nxyz + 99] = 2, indicates that cell 99 (0 based) contains the SURFACE definition (index 3) defined by SURFACE 2 in the InitialPhreeqc instance (either by RunFile or RunString).

It is also possible to mix solutions and reactants to obtain the initial conditions for cells. For mixing, initials_conditions2 contains numbers for a second entity that mixes with the entity defined in ic1. f1 contains the mixing fraction for ic1, whereas (1 - f1) is the mixing fraction for ic2. The definitions ic1[3*nxyz + 99] = 2, initial_solution2[3*nxyz + 99] = 3, f1[3*nxyz + 99] = 0.25 indicates that cell 99 (0 based) contains a mixture of 0.25 SURFACE 2 and 0.75 SURFACE 3, where the surface compositions have been defined in the InitialPhreeqc instance. If the user number in ic2 is negative, no mixing occurs.

See also
YAMLInitialPhreeqcCell2Module, YAMLInitialPhreeqc2Module.
Fortran Example:
 integer, allocatable, dimension(:,:) :: ic1
 integer, allocatable, dimension(:,:) :: ic2
 real(kind=8), allocatable, dimension(:,:) :: f1
 allocate(ic1(nxyz,7), ic2(nxyz,7), f1(nxyz,7))
 ic1 = -1
 ic2 = -1
 f1 = 1.0d0
 do i = 1, nxyz
    ic1(i,1) = 1     ! Solution 1
    ic1(i,2) = -1    ! Equilibrium phases none
    ic1(i,3) = 1     ! Exchange 1
    ic1(i,4) = -1    ! Surface none
    ic1(i,5) = -1    ! Gas phase none
    ic1(i,6) = -1    ! Solid solutions none
    ic1(i,7) = -1    ! Kinetics none
 enddo
 status = yrm%YAMLInitialPhreeqc2Module_mix(ic1, ic2, f1)
 

◆ YAMLInitialPhreeqcCell2Module()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLInitialPhreeqcCell2Module ( class(yaml_phreeqcrm), intent(inout)  self,
integer, intent(in)  n,
integer, dimension(:), intent(in), allocatable  cell_numbers 
)

Inserts data into the YAML document for the PhreeqcRM method InitialPhreeqcCell2Module. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
nNumber that refers to a solution or MIX and associated reactants in the InitialPhreeqc instance.
cell_numbersA vector of grid-cell numbers (user's grid-cell numbering system) that will be populated with cell n from the InitialPhreeqc instance.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

InitialPhreeqcCell2Module uses a cell numbered n in the InitialPhreeqc instance to populate a series of transport cells. All reactants with the number n are transferred along with the solution. If MIX n exists, it is used for the definition of the solution. If n is negative, n is redefined to be the largest solution or MIX number in the InitialPhreeqc instance. All reactants for each cell in the list cell_numbers are removed before the cell definition is copied from the InitialPhreeqc instance to the workers.

See also
YAMLInitialPhreeqc2Module, YAMLInitialPhreeqc2Module_mix.
Fortran Example:
 integer, allocatable, dimension(:) :: module_cells
 allocate(module_cells(2))
 module_cells(1) = 18
 module_cells(2) = 19
 status = yrm%YAMLInitialPhreeqcCell2Module(-1, module_cells)
 

◆ YAMLInitialSolidSolutions2Module()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLInitialSolidSolutions2Module ( class(yaml_phreeqcrm), intent(inout)  self,
integer, dimension(:), intent(in), allocatable  solid_solutions 
)

Inserts data into the YAML document for the PhreeqcRM method InitialSolidSolutions2Module. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
solid_solutionsVector of SOLID_SOLUTIONS index numbers that is dimensioned nxyz, where nxyz is the number of grid cells in the user's model.
Return values
Zeroindicates success, negative indicates failure.

InitialSolidSolutions2Module transfers SOLID_SOLUTIONS definitions from the InitialPhreeqc instance to the reaction-module workers. solid_solutions is a vector of SOLID_SOLUTIONS index numbers that refer to definitions in the InitialPhreeqc instance.

◆ YAMLInitialSolutions2Module()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLInitialSolutions2Module ( class(yaml_phreeqcrm), intent(inout)  self,
integer, dimension(:), intent(in), allocatable  solutions 
)

Inserts data into the YAML document for the PhreeqcRM method InitialSolutions2Module. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
solutionsVector of SOLUTION index numbers that is dimensioned nxyz, where nxyz is the number of grid cells in the user's model.
Return values
Zeroindicates success, negative indicates failure.

InitialSolutions2Module transfers SOLUTION definitions from the InitialPhreeqc instance to the reaction-module workers. solutions is a vector of SOLUTION index numbers that refer to definitions in the InitialPhreeqc instance.

◆ YAMLInitialSurfaces2Module()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLInitialSurfaces2Module ( class(yaml_phreeqcrm), intent(inout)  self,
integer, dimension(:), intent(in), allocatable  surfaces 
)

Inserts data into the YAML document for the PhreeqcRM method InitialSurfaces2Module. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
surfacesVector of SURFACE index numbers that is dimensioned nxyz, where nxyz is the number of grid cells in the user's model.
Return values
Zeroindicates success, negative indicates failure.

InitialSurfaces2Module transfers SURFACE definitions from the InitialPhreeqc instance to the reaction-module workers. surfaces is a vector of SURFACE index numbers that refer to definitions in the InitialPhreeqc instance.

◆ YAMLLoadDatabase()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLLoadDatabase ( class(yaml_phreeqcrm), intent(inout)  self,
character(len=*), intent(in)  file_name 
)

Inserts data into the YAML document for the PhreeqcRM method LoadDatabase. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
file_nameString containing the database name.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

LoadDatabase loads a database for all IPhreeqc instances–workers, InitialPhreeqc, and Utility. All definitions of the reaction module are cleared (SOLUTION_SPECIES, PHASES, SOLUTIONs, etc.), and the database is read.

Fortran Example:
 status = yrm%YAMLLoadDatabase("phreeqc.dat")
 

◆ YAMLLogMessage()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLLogMessage ( class(yaml_phreeqcrm), intent(inout)  self,
character(len=*), intent(in)  str 
)

Inserts data into the YAML document for the PhreeqcRM method LogMessage. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
strString to be printed.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

LogMessage prints a message to the log file.

See also
YAMLOutputMessage, YAMLScreenMessage, YAMLWarningMessage.
Fortran Example:
 status = yrm%YAMLLogMessage("Finished section 1 of initialization")
 

◆ YAMLOpenFiles()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLOpenFiles ( class(yaml_phreeqcrm), intent(inout)  self)

Inserts data into the YAML document for the PhreeqcRM method OpenFiles. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

OpenFiles opens the output and log files. Files are named prefix.chem.txt and prefix.log.txt based on the prefix defined by YAMLSetFilePrefix.

See also
YAMLSetFilePrefix, YAMLCloseFiles, YAMLLogMessage, YAMLOutputMessage, and YAMLWarningMessage.
Fortran Example:
 status = yrm%YAMLSetFilePrefix("Advect_cpp")
 status = yrm%YAMLOpenFiles()
 

◆ YAMLOutputMessage()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLOutputMessage ( class(yaml_phreeqcrm), intent(inout)  self,
character(len=*), intent(in)  str 
)

Inserts data into the YAML document for the PhreeqcRM method OutputMessage. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
strString to be printed.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

OutputMessage prints a message to the output file.

See also
YAMLLogMessage, YAMLScreenMessage, YAMLWarningMessage.
Fortran Example:
 status = yrm%YAMLOutputMessage("Finished section 1 of initialization")
 

◆ YAMLRunCells()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLRunCells ( class(yaml_phreeqcrm), intent(inout)  self)

Inserts data into the YAML document for the PhreeqcRM method RunCells. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

RunCells runs reactions for all cells in the reaction module. During initialization, RunCells can be used to equilibrate each solution with all reactants in a cell while using a time step of zero (YAMLSetTimeStep) to avoid kinetic reactions. Other properties that may need to be initialized before RunCells is invoked include porosity (YAMLSetPorosity), saturation (YAMLSetSaturationUser), temperature (YAMLSetTemperature), and pressure (YAMLSetPressure).

See also
YAMLSetPorosity, YAMLSetPressure, YAMLSetSaturationUser, YAMLSetTemperature, YAMLSetTimeStep.
Fortran Example:
 status = yrm%YAMLSetTimeStep(0.0)
 status = yrm%YAMLRunCells()
 

◆ YAMLRunFile()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLRunFile ( class(yaml_phreeqcrm), intent(inout)  self,
logical, intent(in)  workers,
logical, intent(in)  initial_phreeqc,
logical, intent(in)  utility,
character(len=*), intent(in)  file_name 
)

Inserts data into the YAML document for the PhreeqcRM method RunFile. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
workersTrue, the workers will run the file; False, the workers will not run the file.
initial_phreeqcTrue, the InitialPhreeqc instance will run the file; False, the InitialPhreeqc will not run the file.
utilityTrue, the Utility instance will run the file; False, the Utility instance will not run the file.
file_nameName of the file to run.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

RunFile runs a PHREEQC input file. The first three arguments determine which IPhreeqc instances will run the file–the workers, the InitialPhreeqc instance, and (or) the Utility instance. Input files that modify the thermodynamic database should be run by all three sets of instances. Files with SELECTED_OUTPUT definitions that will be used during the time-stepping loop need to be run by the workers. Files that contain initial conditions or boundary conditions should be run by the InitialPhreeqc instance.

See also
YAMLRunString.
Fortran Example:
 status = yrm%YAMLRunFile(.true., .true., .true., "advect.pqi")
 

◆ YAMLRunString()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLRunString ( class(yaml_phreeqcrm), intent(inout)  self,
logical, intent(in)  workers,
logical, intent(in)  initial_phreeqc,
logical, intent(in)  utility,
character(len=*), intent(in)  input_string 
)

Inserts data into the YAML document for the PhreeqcRM method RunString. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
workersTrue, the workers will run the string; False, the workers will not run the string.
initial_phreeqcTrue, the InitialPhreeqc instance will run the string; False, the InitialPhreeqc will not run the string.
utilityTrue, the Utility instance will run the string; False, the Utility instance will not run the string.
input_stringString containing PHREEQC input.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

RunString runs a PHREEQC input string. The first three arguments determine which IPhreeqc instances will run the string–the workers, the InitialPhreeqc instance, and (or) the Utility instance. Input strings that modify the thermodynamic database should be run by all three sets of instances. Strings with SELECTED_OUTPUT definitions that will be used during the time-stepping loop need to be run by the workers. Strings that contain initial conditions or boundary conditions should be run by the InitialPhreeqc instance.

See also
YAMLRunFile.
Fortran Example:
 input = "DELETE; -all"
 status = yrm%YAMLRunString(.true., .true., .true., input)
 

◆ YAMLScreenMessage()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLScreenMessage ( class(yaml_phreeqcrm), intent(inout)  self,
character(len=*), intent(in)  str 
)

Inserts data into the YAML document for the PhreeqcRM method ScreenMessage. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
strString to be printed.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

ScreenMessage prints a message to the screen.

See also
YAMLLogMessage, YAMLOutputMessage, YAMLWarningMessage.
Fortran Example:
 string = "Beginning to process YAML for initial conditions"
 status = yrm%YAMLScreenMessage(string)
 

◆ YAMLSetComponentH2O()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetComponentH2O ( class(yaml_phreeqcrm), intent(inout)  self,
logical, intent(in)  tf 
)

Inserts data into the YAML document for the PhreeqcRM method SetComponentH2O. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
tfTrue (default), excess H, excess O, and water are included in the component list; False, total H and O are included in the component list.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetComponentH2O selects whether to include H2O in the component list. The concentrations of H and O must be known accurately (8 to 10 significant digits) for the numerical method of PHREEQC to produce accurate pH and pe values. Because most of the H and O are in the water species, it may be more robust (require less accuracy in transport) to transport the excess H and O (the H and O not in water) and water. The default setting (true) is to include water, excess H, and excess O as components. A setting of false will include total H and total O as components. YAMLSetComponentH2O must be called before YAMLFindComponents.

See also
YAMLFindComponents.
Fortran Example:
 status = yrm%YAMLSetComponentH2O(.false.)
 

◆ YAMLSetConcentrations()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetConcentrations ( class(yaml_phreeqcrm), intent(inout)  self,
real(kind=8), dimension(:,:), intent(in), allocatable  c 
)

Inserts data into the YAML document for the PhreeqcRM method SetConcentrations. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
cVector of component concentrations. Size of vector is ncomps times nxyz, where ncomps is the number of components as determined by FindComponents or GetComponentCount and nxyz is the number of grid cells in the user's model.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

The only way to use this method is to have pre-calculated PHREEQC solution concentrations, which is not common. Concentrations are normally initialized with YAMLInitialPhreeqc2Module or YAMLInitialPhreeqcCell2Module.

See also
YAMLSetDensityUser, YAMLSetPorosity, YAMLSetRepresentativeVolume, YAMLSetSaturationUser, YAMLSetUnitsSolution.
Fortran Example:
 status = yrm%YAMLSetConcentrations(c)
 

◆ YAMLSetCurrentSelectedOutputUserNumber()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetCurrentSelectedOutputUserNumber ( class(yaml_phreeqcrm), intent(inout)  self,
integer, intent(in)  n_user 
)

Inserts data into the YAML document for the PhreeqcRM method SetCurrentSelectedOutputUserNumber. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
n_userUser number of the SELECTED_OUTPUT data block that is to be used.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetCurrentSelectedOutputUserNumber selects the current selected output by user number. The user may define multiple SELECTED_OUTPUT data blocks for the workers. A user number is specified for each data block. The value of the argument n_user selects which of the SELECTED_OUTPUT definitions will be used for selected-output operations.

See also
YAMLSetNthSelectedOutput, YAMLSetSelectedOutputOn.
Fortran Example:
 status = yrm%YAMLSetCurrentSelectedOutputUserNumber(n_user)
 

◆ YAMLSetDensityUser()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetDensityUser ( class(yaml_phreeqcrm), intent(inout)  self,
real(kind=8), dimension(:), intent(in), allocatable  density 
)

Inserts data into the YAML document for the PhreeqcRM method SetDensityUser. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
densityVector of densities. Size of vector is nxyz, where nxyz is the number of grid cells in the user's model.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetDensityUser sets the density for each reaction cell. These density values are used when converting from transported mass-fraction concentrations (YAMLSetUnitsSolution) to produce per liter concentrations during a call to SetConcentrations. They are also used when converting from reaction-cell concentrations to transport concentrations, if UseSolutionDensityVolume is set to false.

See also
YAMLSetUnitsSolution, YAMLUseSolutionDensityVolume.
Fortran Example:
 real(kind=8), allocatable, dimension(:)   :: density
 allocate(density(nxyz))
 density = 1.0d0
 status = yrm%YAMLSetDensityUser(density)
 

◆ YAMLSetDumpFileName()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetDumpFileName ( class(yaml_phreeqcrm), intent(inout)  self,
character(len=*), intent(in)  file_name 
)

Inserts data into the YAML document for the PhreeqcRM method SetDumpFileName. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
file_nameName of dump file.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetDumpFileName sets the name of the dump file. It is the name used by the method DumpModule.

See also
YAMLDumpModule.
Fortran Example:
 logical dump_on, append
 status = yrm%YAMLSetDumpFileName("Advect_cpp.dmp")
 dump_on = .true.
 append = .false.
 status = yrm%YAMLDumpModule(dump_on, append)
 

◆ YAMLSetErrorHandlerMode()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetErrorHandlerMode ( class(yaml_phreeqcrm), intent(inout)  self,
integer, intent(in)  mode 
)

Inserts data into the YAML document for the PhreeqcRM method SetErrorHandlerMode. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
modeError handling mode: 0, 1, or 2.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetErrorHandlerMode sets the action to be taken when the reaction module encounters an error. Options are 0, return to calling program with an error return code (default); 1, throw an exception, in C++, the exception can be caught, for C and Fortran, the program will exit; or 2, attempt to exit gracefully.

Fortran Example:
 status = yrm%YAMLSetErrorHandlerMode(1)
 

◆ YAMLSetErrorOn()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetErrorOn ( class(yaml_phreeqcrm), intent(inout)  self,
logical, intent(in)  tf 
)

Inserts data into the YAML document for the PhreeqcRM method SetErrorOn. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
tfTrue, enable error messages; False, disable error messages. Default is true.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetErrorOn sets the property that controls whether error messages are generated and displayed. Messages include PHREEQC "ERROR" messages, and any messages written with the method ErrorMessage.

See also
YAMLLogMessage, YAMLOutputMessage, YAMLScreenMessage.
Fortran Example:
 status = yrm%YAMLSetErrorOn(.true.)
 

◆ YAMLSetFilePrefix()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetFilePrefix ( class(yaml_phreeqcrm), intent(inout)  self,
character(len=*), intent(in)  prefix 
)

Inserts data into the YAML document for the PhreeqcRM method SetFilePrefix. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
prefixPrefix used when opening the output and log files.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetFilePrefix sets the prefix for the output (prefix.chem.txt) and log (prefix.log.txt) files. These files are opened by the method OpenFiles.

See also
YAMLOpenFiles, YAMLCloseFiles.
Fortran Example:
 status = yrm%YAMLSetFilePrefix("Advect_cpp")
 status = yrm%YAMLOpenFiles()
 

◆ YAMLSetGasCompMoles()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetGasCompMoles ( class(yaml_phreeqcrm), intent(inout)  self,
real(kind=8), dimension(:,:), intent(in), allocatable  gas_moles 
)

Inserts data into the YAML document for the PhreeqcRM method SetGasCompMoles. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
gas_molesVector of moles of gas components.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetGasCompMoles transfers moles of gas components from the vector given in the argument list (gas_moles) to each reaction cell. Dimension of the vector is set to ngas_comps times nxyz, where, ngas_comps is the result of GetGasComponentsCount, and nxyz is the number of user grid cells. If the number of moles is set to a negative number, the gas component will not be defined for the GAS_PHASE of the reaction cell.

See also
YAMLFindComponents, YAMLSetGasPhaseVolume.
Fortran Example:
 real(kind=8), allocatable, dimension(:,:) :: gas_moles
 allocate(gas_moles(nxyz*ngas))
 status = yrm%YAMLSetGasCompMoles(gas_moles)
 

◆ YAMLSetGasPhaseVolume()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetGasPhaseVolume ( class(yaml_phreeqcrm), intent(inout)  self,
real(kind=8), dimension(:), intent(in), allocatable  gas_volume 
)

Inserts data into the YAML document for the PhreeqcRM method SetGasPhaseVolume. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
gas_volumeVector of volumes for each gas phase.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetGasPhaseVolume transfers volumes of gas phases from the vector given in the argument list (gas_volume) to each reaction cell. The gas-phase volume affects the gas-component pressures calculated for fixed-volume gas phases. If a gas-phase volume is defined with this methood for a GAS_PHASE in a cell, the gas phase is forced to be a fixed-volume gas phase. Dimension of the vector is nxyz, where nxyz is the number of user grid cells. If the volume is set to a negative number for a cell, the gas-phase volume for that cell is not changed.

See also
YAMLFindComponents, YAMLSetGasCompMoles.
Fortran Example:
 real(kind=8), allocatable, dimension(:) :: gas_volume
 allocate(gas_volume(nxyz))
 status = yrm%YAMLSetGasPhaseVolume(gas_volume)
 

◆ YAMLSetGridCellCount()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetGridCellCount ( class(yaml_phreeqcrm), intent(inout)  self,
integer, intent(in)  n 
)

Inserts data into the YAML document to define the number of cells in the user's model. Once the YAML document is written, the number of model cells can be extracted with the method GetGridCellCountYAML. GetGridCellCountYAML is NOT a PhreeqcRM method; it is a global method and must be used BEFORE the PhreeqcRM instance is created. SetGridCellCount will be ignored once the PhreeqcRM instance exists.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
nNumber of cells for the PhreeqcRM instance. The number of cells
Return values
IRM_RESULTZero indicates success, negative indicates failure

YAMLSetGridCellCount can be used in the creation of the PhreeqcRM instance. The PhreeqcRM constructor takes two arguments. GetGridCellCountYAML provides the value for the first argument. If the YAML file does not contain the node "SetGridCellCount:", GetGridCellCountYAML will return zero.

Fortran Example:
 integer nxyz
 nxyz = 40
 status = yrm%YAMLSetGridCellCount(nxyz)
 

◆ YAMLSetNthSelectedOutput()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetNthSelectedOutput ( class(yaml_phreeqcrm), intent(inout)  self,
integer, intent(in)  n 
)

Inserts data into the YAML document for the PhreeqcRM method SetNthSelectedOutput. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
nSequence number of the SELECTED_OUTPUT data block that is to be used.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetNthSelectedOutput specifies the current selected output by sequence number (one-based). The user may define multiple SELECTED_OUTPUT data blocks for the workers. A user number is specified for each data block, and the blocks are stored in user-number order. The value of the argument n selects the sequence number of the SELECTED_OUTPUT definition that will be used for selected-output operations.

See also
YAMLSetCurrentSelectedOutputUserNumber, YAMLSetSelectedOutputOn.
Fortran Example:
 status = yrm%YAMLSetCurrentSelectedOutput(1)
 

◆ YAMLSetPartitionUZSolids()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetPartitionUZSolids ( class(yaml_phreeqcrm), intent(inout)  self,
logical, intent(in)  tf 
)

Inserts data into the YAML document for the PhreeqcRM method SetPartitionUZSolids. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
tfTrue, the fraction of solids and gases available for reaction is equal to the saturation; False (default), all solids and gases are reactive regardless of saturation.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetPartitionUZSolids sets the property for partitioning solids between the saturated and unsaturated parts of a partially saturated cell.

The option is intended to be used by saturated-only flow codes that allow a variable water table. The value has meaning only when saturations less than 1.0 are encountered. The partially saturated cells may have a small water-to-rock ratio that causes reactions to proceed differently relative to fully saturated cells. By setting SetPartitionUZSolids to true, the amounts of solids and gases are partioned according to the saturation. If a cell has a saturation of 0.5, then the water interacts with only half of the solids and gases; the other half is unreactive until the water table rises. As the saturation in a cell varies, solids and gases are transferred between the saturated and unsaturated (unreactive) reservoirs of the cell. Unsaturated-zone flow and transport codes will probably use the default (false), which assumes all gases and solids are reactive regardless of saturation.

Fortran Example:
 status = yrm%YAMLSetPartitionUZSolids(.false.)
 

◆ YAMLSetPorosity()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetPorosity ( class(yaml_phreeqcrm), intent(inout)  self,
real(kind=8), dimension(:), intent(in), allocatable  por 
)

Inserts data into the YAML document for the PhreeqcRM method SetPorosity. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
porVector of porosities, unitless. Default is 0.1.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetPorosity sets the porosity for each reaction cell. The volume of water in a reaction cell is the product of porosity, saturation (SetSaturationUser), and representative volume (SetRepresentativeVolume). Size of vector is nxyz, where nxyz is the number of grid cells in the user's model.

See also
YAMLSetRepresentativeVolume, YAMLSetSaturationUser.
Fortran Example:
 real(kind=8), allocatable, dimension(:) :: por
 allocate(por(nxyz))
 por = 0.2d0
 status = yrm%YAMLSetPorosity(por)
 

◆ YAMLSetPressure()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetPressure ( class(yaml_phreeqcrm), intent(inout)  self,
real(kind=8), dimension(:), intent(in), allocatable  p 
)

Inserts data into the YAML document for the PhreeqcRM method SetPressure. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
pVector of pressures, in atm. Size of vector is nxyz, where nxyz is the number of grid cells in the user's model.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetPressure sets the pressure for each reaction cell. Pressure effects are considered only in three of the databases distributed with PhreeqcRM: phreeqc.dat, Amm.dat, and pitzer.dat.

See also
YAMLSetTemperature.
Fortran Example:
 real(kind=8), allocatable, dimension(:) :: pressure
 allocate(por(nxyz))
 pressure = 2.0d0
 status = yrm%YAMLSetPressure(pressure)
 

◆ YAMLSetPrintChemistryMask()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetPrintChemistryMask ( class(yaml_phreeqcrm), intent(inout)  self,
integer, dimension(:), intent(in), allocatable  mask 
)

Inserts data into the YAML document for the PhreeqcRM method SetPrintChemistryMask. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
maskVector of integers. Size of vector is nxyz, where nxyz is the number of grid cells in the user's model. A value of 0 will disable printing detailed output for the cell; a value of 1 will enable printing detailed output for a cell.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetPrintChemistryMask enables or disables detailed output for each reaction cell. Printing for a reaction cell will occur only when the printing is enabled with SetPrintChemistryOn and the mask value is 1.

See also
YAMLSetPrintChemistryOn.
Fortran Example:
 integer, allocatable, dimension(:) :: print_chemistry_mask;
 allocate(print_chemistry_mask(nxyz))
 print_chemistry_mask = 0
 do i = 1, nxyz / 2
    print_chemistry_mask(i) = 1
 enddo
 status = yrm%YAMLSetPrintChemistryMask(print_chemistry_mask)
 

◆ YAMLSetPrintChemistryOn()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetPrintChemistryOn ( class(yaml_phreeqcrm), intent(inout)  self,
logical, intent(in)  workers,
logical, intent(in)  initial_phreeqc,
logical, intent(in)  utility 
)

Inserts data into the YAML document for the PhreeqcRM method SetPrintChemistryOn. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
workersTrue, enable detailed printing in the worker instances; False, disable detailed printing in the worker instances.
initial_phreeqcTrue, enable detailed printing in the InitialPhreeqc instance; False, disable detailed printing in the InitialPhreeqc instance.
utilityTrue, enable detailed printing in the Utility instance; False, disable detailed printing in the Utility instance.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetPrintChemistryOn sets the property that enables or disables printing detailed output from reaction calculations to the output file for a set of cells defined by SetPrintChemistryMask. The detailed output prints all of the output typical of a PHREEQC reaction calculation, which includes solution descriptions and the compositions of all other reactants. The output can be several hundred lines per cell, which can lead to a very large output file (prefix.chem.txt opened by the method OpenFiles). For the worker instances, the output can be limited to a set of cells (method SetPrintChemistryMask) and, in general, the amount of information printed can be limited by use of options in the PRINT data block of PHREEQC (applied by using methods RunFile or RunString). Printing the detailed output for the workers is generally used only for debugging, and PhreeqcRM will run significantly faster when printing detailed output for the workers is disabled.

See also
YAMLOpenFiles, YAMLRunFile, YAMLRunString, YAMLSetPrintChemistryMask.
Fortran Example:
 status = yrm%YAMLSetPrintChemistryOn(.false., .true., .false.)
 

◆ YAMLSetRebalanceByCell()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetRebalanceByCell ( class(yaml_phreeqcrm), intent(inout)  self,
logical, intent(in)  tf 
)

Inserts data into the YAML document for the PhreeqcRM method SetRebalanceByCell. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
tfTrue, indicates individual cell times are used in rebalancing (default); False, indicates average times are used in rebalancing.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetRebalanceByCell sets the load-balancing algorithm. PhreeqcRM attempts to rebalance the load of each thread or process such that each thread or process takes the same amount of time to run its part of a RunCells calculation. Two algorithms are available; one uses individual times for each cell and accounts for cells that were not run because saturation was zero (default), and the other assigns an average time to all cells. The methods are similar, but limited testing indicates the default method performs better.

See also
YAMLSetRebalanceFraction.
Fortran Example:
 status = yrm%YAMLSetRebalanceByCell(.true.)
 

◆ YAMLSetRebalanceFraction()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetRebalanceFraction ( class(yaml_phreeqcrm), intent(inout)  self,
real(kind=8), intent(in)  f 
)

Inserts data into the YAML document for the PhreeqcRM method SetRebalanceFraction. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
fFraction from 0.0 to 1.0.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetRebalanceFraction sets the fraction of cells that are transferred among threads or processes when rebalancing. PhreeqcRM attempts to rebalance the load of each thread or process such that each thread or process takes the same amount of time to run its part of a RunCells calculation. The rebalancing transfers cell calculations among threads or processes to try to achieve an optimum balance. SetRebalanceFraction adjusts the calculated optimum number of cell transfers by a fraction from 0 to 1.0 to determine the actual number of cell transfers. A value of zero eliminates load rebalancing. A value less than 1.0 is suggested to slow the approach to the optimum cell distribution and avoid possible oscillations when too many cells are transferred at one iteration, requiring reverse transfers at the next iteration. Default is 0.5.

See also
YAMLSetRebalanceByCell.
Fortran Example:
 status = yrm%YAMLSetRebalanceFraction(0.5)
 

◆ YAMLSetRepresentativeVolume()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetRepresentativeVolume ( class(yaml_phreeqcrm), intent(inout)  self,
real(kind=8), dimension(:), intent(in), allocatable  rv 
)

Inserts data into the YAML document for the PhreeqcRM method SetRepresentativeVolume. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
rvVector of representative volumes, in liters. Default is 1.0 liter. Size of array is nxyz, where nxyz is the number of grid cells in the user's model.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetRepresentativeVolume sets the representative volume of each reaction cell. By default the representative volume of each reaction cell is 1 liter. The volume of water in a reaction cell is determined by the product of the representative volume, the porosity (SetPorosity), and the saturation (SetSaturationUser). The numerical method of PHREEQC is more robust if the water volume for a reaction cell is within a couple orders of magnitude of 1.0. Small water volumes caused by small porosities and (or) small saturations (and (or) small representative volumes) may cause non-convergence of the numerical method. In these cases, a larger representative volume may help. Note that increasing the representative volume also increases the number of moles of the reactants in the reaction cell (minerals, surfaces, exchangers, and others), which are defined as moles per representative volume. SetRepresentativeVolume should be called before initial conditions are defined for the reaction cells.

See also
YAMLSetPorosity, YAMLSetSaturationUser.
Fortran Example:
 real(kind=8), allocatable, dimension(:)   :: rv
 allocate(rv(nxyz))
 rv = 1.0d0
 status = yrm%YAMLSetRepresentativeVolume(rv)
 

◆ YAMLSetSaturationUser()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetSaturationUser ( class(yaml_phreeqcrm), intent(inout)  self,
real(kind=8), dimension(:), intent(in), allocatable  sat 
)

Inserts data into the YAML document for the PhreeqcRM method SetSaturationUser. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
satVector of saturations, unitless. Default 1.0. Size of vector is nxyz, where nxyz is the number of grid cells in the user's model.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetSaturationUser sets the saturation of each reaction cell. Saturation is a fraction ranging from 0 to 1. The volume of water in a cell is the product of porosity (SetPorosity), saturation (SetSaturationUser), and representative volume (SetRepresentativeVolume). As a result of a reaction calculation, solution properties (density and volume) will change; the databases phreeqc.dat, Amm.dat, and pitzer.dat have the molar volume data to calculate these changes. The methods GetDensityCalculated, GetSolutionVolume, and GetSaturationCalculated can be used to account for these changes in the succeeding transport calculation.

See also
YAMLSetPorosity, YAMLSetRepresentativeVolume.
Fortran Example:
 real(kind=8), allocatable, dimension(:) :: sat
 allocate(sat(nxyz))
 sat = 1.0d0
 status = yrm%YAMLSetSaturationUser(sat)
 

◆ YAMLSetScreenOn()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetScreenOn ( class(yaml_phreeqcrm), intent(inout)  self,
logical, intent(in)  tf 
)

Inserts data into the YAML document for the PhreeqcRM method SetScreenOn. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
tfTrue, enable screen messages; False, disable screen messages. Default is true.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetScreenOn sets the property that controls whether messages are written to the screen. Messages include information about rebalancing during RunCells, and any messages written with ScreenMessage.

See also
YAMLRunCells, YAMLScreenMessage.
Fortran Example:
 status = yrm%YAMLSetScreenOn(.true.)
 

◆ YAMLSetSelectedOutputOn()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetSelectedOutputOn ( class(yaml_phreeqcrm), intent(inout)  self,
logical, intent(in)  tf 
)

Inserts data into the YAML document for the PhreeqcRM method SetSelectedOutputOn. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
tfTrue, enable selected output; False, disable selected output.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetSelectedOutputOn sets the property that controls whether selected-output results are available to be retrieved with GetSelectedOutput. True indicates that selected-output results will be accumulated during RunCells and can be retrieved with GetSelectedOutput; False indicates that selected-output results will not be accumulated during RunCells.

See also
YAMLSetCurrentSelectedOutputUserNumber, YAMLSetNthSelectedOutput, YAMLSetSelectedOutputOn.
Fortran Example:
 status = yrm%YAMLSetSelectedOutputOn(.true.)
 

◆ YAMLSetSpeciesSaveOn()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetSpeciesSaveOn ( class(yaml_phreeqcrm), intent(inout)  self,
logical(kind=4), intent(in)  save_on 
)

Inserts data into the YAML document for the PhreeqcRM method SetSpeciesSaveOn. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
save_onTrue indicates species concentrations are saved; False indicates species concentrations are not saved.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetSpeciesSaveOn sets the value of the species-save property. This method enables or disables use of PhreeqcRM with multicomponent-diffusion transport calculations. By default, concentrations of aqueous species are not saved. Setting the species-save property to true allows aqueous species concentrations to be retrieved with PhreeqcRM::GetSpeciesConcentrations, and solution compositions to be set with PhreeqcRM::SpeciesConcentrations2Module. SetSpeciesSaveOn must be called before calls to FindComponents.

See also
YAMLFindComponents, YAMLSpeciesConcentrations2Module.
Fortran Example:
 status = yrm%YAMLSetSpeciesSaveOn(.true.)
 

◆ YAMLSetTemperature()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetTemperature ( class(yaml_phreeqcrm), intent(inout)  self,
real(kind=8), dimension(:), intent(in), allocatable  tc 
)

Inserts data into the YAML document for the PhreeqcRM method SetTemperature. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
tcVector of temperatures, in degrees C.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetTemperature sets the temperature for each reaction cell. If SetTemperature is not called, worker solutions will have temperatures as defined by initial conditions (InitialPhreeqc2Module and InitialPhreeqcCell2Module). Size of vector is nxyz, where nxyz is the number of grid cells in the user's model.

See also
YAMLInitialPhreeqc2Module, YAMLInitialPhreeqcCell2Module, YAMLSetPressure.
Fortran Example:
 real(kind=8), allocatable, dimension(:) :: tc
 allocate(tc(nxyz))
 por = 0.2d0
 status = yrm%YAMLSetTemperature(tc)
 

◆ YAMLSetTime()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetTime ( class(yaml_phreeqcrm), intent(inout)  self,
real(kind=8), intent(in)  time 
)

Inserts data into the YAML document for the PhreeqcRM method SetTime. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
timeCurrent simulation time, in seconds.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetTime sets current simulation time for the reaction module.

See also
YAMLSetTimeStep, YAMLSetTimeConversion.
Fortran Example:
 status = yrm%YAMLSetTime(0.0)
 

◆ YAMLSetTimeConversion()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetTimeConversion ( class(yaml_phreeqcrm), intent(inout)  self,
real(kind=8), intent(in)  conv_factor 
)

Inserts data into the YAML document for the PhreeqcRM method SetTimeConversion. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
conv_factorFactor to convert seconds to user time units.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetTimeConversion Set a factor to convert from seconds to user time units. Factor times seconds produces user time units that is used in some PhreeqcRM printing.

See also
YAMLSetTime, YAMLSetTimeStep.
Fortran Example:
 conv_factor = 1.0d0 / 86400.d0
 status = yrm%YAMLSetTimeConversion(conv_factor)
 

◆ YAMLSetTimeStep()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetTimeStep ( class(yaml_phreeqcrm), intent(inout)  self,
real(kind=8), intent(in)  time_step 
)

Inserts data into the YAML document for the PhreeqcRM method SetTimeStep. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
time_stepTime step, in seconds.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetTimeStep sets current time step for the reaction module. This is the length of time over which kinetic reactions are integrated.

See also
YAMLSetTime, YAMLSetTimeConversion.
Fortran Example:
 time_step = 86400.d0
 status = yrm%YAMLSetTimeStep(time_step)
 

◆ YAMLSetUnitsExchange()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetUnitsExchange ( class(yaml_phreeqcrm), intent(inout)  self,
integer, intent(in)  option 
)

Inserts data into the YAML document for the PhreeqcRM method SetUnitsExchange. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
optionUnits option for exchangers: 0, 1, or 2.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetUnitsExchange sets input units for exchangers. In PHREEQC input, exchangers are defined by moles of exchange sites (Mp). SetUnitsExchange specifies how the number of moles of exchange sites in a reaction cell (Mc) is calculated from the input value (Mp).

Options are 0, Mp is mol/L of RV (default), Mc = Mp*RV, where RV is the representative volume (SetRepresentativeVolume); 1, Mp is mol/L of water in the RV, Mc = Mp*P*RV, where P is porosity (SetPorosity); or 2, Mp is mol/L of rock in the RV, Mc = Mp*(1-P)*RV.

If a single EXCHANGE definition is used for cells with different initial porosity, the three options scale quite differently. For option 0, the number of moles of exchangers will be the same regardless of porosity. For option 1, the number of moles of exchangers will be vary directly with porosity and inversely with rock volume. For option 2, the number of moles of exchangers will vary directly with rock volume and inversely with porosity.

See also
YAMLInitialPhreeqc2Module, YAMLInitialPhreeqcCell2Module, YAMLSetPorosity, YAMLSetRepresentativeVolume.
Fortran Example:
 status = yrm%YAMLSetUnitsExchange(1)
 

◆ YAMLSetUnitsGasPhase()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetUnitsGasPhase ( class(yaml_phreeqcrm), intent(inout)  self,
integer, intent(in)  option 
)

Inserts data into the YAML document for the PhreeqcRM method SetUnitsGasPhase. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
optionUnits option for gas phases: 0, 1, or 2.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetUnitsGasPhase sets input units for gas phases. In PHREEQC input, gas phases are defined by moles of component gases (Mp). SetUnitsGasPhase specifies how the number of moles of component gases in a reaction cell (Mc) is calculated from the input value (Mp).

Options are 0, Mp is mol/L of RV (default), Mc = Mp*RV, where RV is the representative volume (SetRepresentativeVolume); 1, Mp is mol/L of water in the RV, Mc = Mp*P*RV, where P is porosity (SetPorosity); or 2, Mp is mol/L of rock in the RV, Mc = Mp*(1-P)*RV.

If a single GAS_PHASE definition is used for cells with different initial porosity, the three options scale quite differently. For option 0, the number of moles of a gas component will be the same regardless of porosity. For option 1, the number of moles of a gas component will be vary directly with porosity and inversely with rock volume. For option 2, the number of moles of a gas component will vary directly with rock volume and inversely with porosity.

See also
YAMLInitialPhreeqc2Module, YAMLInitialPhreeqcCell2Module, YAMLSetPorosity, YAMLSetRepresentativeVolume.
Fortran Example:
 status = yrm%YAMLSetUnitsGasPhase(1)
 

◆ YAMLSetUnitsKinetics()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetUnitsKinetics ( class(yaml_phreeqcrm), intent(inout)  self,
integer, intent(in)  option 
)

Inserts data into the YAML document for the PhreeqcRM method SetUnitsKinetics. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
optionUnits option for kinetic reactants: 0, 1, or 2.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetUnitsKinetics sets input units for kinetic reactants. In PHREEQC input, kinetics are defined by moles of kinetic reactants (Mp). SetUnitsKinetics specifies how the number of moles of kinetic reactants in a reaction cell (Mc) is calculated from the input value (Mp).

Options are 0, Mp is mol/L of RV (default), Mc = Mp*RV, where RV is the representative volume (SetRepresentativeVolume); 1, Mp is mol/L of water in the RV, Mc = Mp*P*RV, where P is porosity (SetPorosity); or 2, Mp is mol/L of rock in the RV, Mc = Mp*(1-P)*RV.

If a single KINETICS definition is used for cells with different initial porosity, the three options scale quite differently. For option 0, the number of moles of kinetic reactants will be the same regardless of porosity. For option 1, the number of moles of kinetic reactants will be vary directly with porosity and inversely with rock volume. For option 2, the number of moles of kinetic reactants will vary directly with rock volume and inversely with porosity.

Note that the volume of water in a cell in the reaction module is equal to the product of porosity (SetPorosity), the saturation (SetSaturationUser), and representative volume (SetRepresentativeVolume), which is usually less than 1 liter. It is important to write the RATES definitions for homogeneous (aqueous) kinetic reactions to account for the current volume of water, often by calculating the rate of reaction per liter of water and multiplying by the volume of water (Basic function SOLN_VOL).

Rates that depend on surface area of solids, are not dependent on the volume of water. However, it is important to get the correct surface area for the kinetic reaction. To scale the surface area with the number of moles, the specific area (m^2 per mole of reactant) can be defined as a parameter (KINETICS; -parm), which is multiplied by the number of moles of reactant (Basic function M) in RATES to obtain the surface area.

See also
YAMLInitialPhreeqc2Module, YAMLInitialPhreeqcCell2Module, YAMLSetPorosity, YAMLSetRepresentativeVolume, YAMLSetSaturationUser.
Fortran Example:
 status = yrm%YAMLSetUnitsKinetics(1)
 

◆ YAMLSetUnitsPPassemblage()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetUnitsPPassemblage ( class(yaml_phreeqcrm), intent(inout)  self,
integer, intent(in)  option 
)

Inserts data into the YAML document for the PhreeqcRM method SetUnitsPPassemblage. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
optionUnits option for equilibrium phases: 0, 1, or 2.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetUnitsPPassemblage sets input units for pure phase assemblages (equilibrium phases). In PHREEQC input, equilibrium phases are defined by moles of each phase (Mp). SetUnitsPPassemblage specifies how the number of moles of phases in a reaction cell (Mc) is calculated from the input value (Mp).

Options are 0, Mp is mol/L of RV (default), Mc = Mp*RV, where RV is the representative volume (SetRepresentativeVolume); 1, Mp is mol/L of water in the RV, Mc = Mp*P*RV, where P is porosity (SetPorosity); or 2, Mp is mol/L of rock in the RV, Mc = Mp*(1-P)*RV.

If a single EQUILIBRIUM_PHASES definition is used for cells with different initial porosity, the three options scale quite differently. For option 0, the number of moles of a mineral will be the same regardless of porosity. For option 1, the number of moles of a mineral will be vary directly with porosity and inversely with rock volume. For option 2, the number of moles of a mineral will vary directly with rock volume and inversely with porosity.

See also
YAMLInitialPhreeqc2Module, YAMLInitialPhreeqcCell2Module, YAMLSetPorosity, YAMLSetRepresentativeVolume.
Fortran Example:
 status = yrm%YAMLSetUnitsPPassemblage(1)
 

◆ YAMLSetUnitsSolution()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetUnitsSolution ( class(yaml_phreeqcrm), intent(inout)  self,
integer, intent(in)  option 
)

Inserts data into the YAML document for the PhreeqcRM method SetUnitsSolution. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
optionUnits option for solutions: 1, 2, or 3, default is 1, mg/L.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetUnitsSolution sets solution concentration units used by the transport model. Options are 1, mg/L; 2 mol/L; or 3, mass fraction, kg/kgs. PHREEQC defines solutions by the number of moles of each element in the solution.

To convert from mg/L to moles of element in the representative volume of a reaction cell, mg/L is converted to mol/L and multiplied by the solution volume, which is the product of porosity (SetPorosity), saturation (SetSaturationUser), and representative volume (SetRepresentativeVolume). To convert from mol/L to moles of element in the representative volume of a reaction cell, mol/L is multiplied by the solution volume. To convert from mass fraction to moles of element in the representative volume of a reaction cell, kg/kgs is converted to mol/kgs, multiplied by density (SetDensityUser) and multiplied by the solution volume.

To convert from moles of element in the representative volume of a reaction cell to mg/L, the number of moles of an element is divided by the solution volume resulting in mol/L, and then converted to mg/L. To convert from moles of element in a cell to mol/L, the number of moles of an element is divided by the solution volume resulting in mol/L. To convert from moles of element in a cell to mass fraction, the number of moles of an element is converted to kg and divided by the total mass of the solution. Two options are available for the volume and mass of solution that are used in converting to transport concentrations: (1) the volume and mass of solution are calculated by PHREEQC, or (2) the volume of solution is the product of porosity (SetPorosity), saturation (SetSaturationUser), and representative volume (SetRepresentativeVolume), and the mass of solution is volume times density as defined by SetDensityUser. Which option is used is determined by UseSolutionDensityVolume.

See also
YAMLSetDensityUser, YAMLSetPorosity, YAMLSetRepresentativeVolume, YAMLSetSaturationUser, YAMLUseSolutionDensityVolume.
Fortran Example:
 status = yrm%YAMLSetUnitsSolution(2)
 

◆ YAMLSetUnitsSSassemblage()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetUnitsSSassemblage ( class(yaml_phreeqcrm), intent(inout)  self,
integer, intent(in)  option 
)

Inserts data into the YAML document for the PhreeqcRM method SetUnitsSSassemblage. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
optionUnits option for solid solutions: 0, 1, or 2.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetUnitsSSassemblage sets input units for solid-solution assemblages. In PHREEQC, solid solutions are defined by moles of each component (Mp). SetUnitsSSassemblage specifies how the number of moles of solid-solution components in a reaction cell (Mc) is calculated from the input value (Mp).

Options are 0, Mp is mol/L of RV (default), Mc = Mp*RV, where RV is the representative volume (SetRepresentativeVolume); 1, Mp is mol/L of water in the RV, Mc = Mp*P*RV, where P is porosity (SetPorosity); or 2, Mp is mol/L of rock in the RV, Mc = Mp*(1-@ P)*RV.

If a single SOLID_SOLUTION definition is used for cells with different initial porosity, the three options scale quite differently. For option 0, the number of moles of a solid-solution component will be the same regardless of porosity. For option 1, the number of moles of a solid-solution component will be vary directly with porosity and inversely with rock volume. For option 2, the number of moles of a solid-solution component will vary directly with rock volume and inversely with porosity.

See also
YAMLInitialPhreeqc2Module, YAMLInitialPhreeqcCell2Module, YAMLSetPorosity, YAMLSetRepresentativeVolume.
Fortran Example:
 status = yrm%YAMLSetUnitsSSassemblage(1)
 

◆ YAMLSetUnitsSurface()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSetUnitsSurface ( class(yaml_phreeqcrm), intent(inout)  self,
integer, intent(in)  option 
)

Inserts data into the YAML document for the PhreeqcRM method SetUnitsSurface. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
optionUnits option for surfaces: 0, 1, or 2.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SetUnitsSurface sets input units for surfaces. In PHREEQC input, surfaces are defined by moles of surface sites (Mp). SetUnitsSurface specifies how the number of moles of surface sites in a reaction cell (Mc) is calculated from the input value (Mp).

Options are 0, Mp is mol/L of RV (default), Mc = Mp*RV, where RV is the representative volume (SetRepresentativeVolume); 1, Mp is mol/L of water in the RV, Mc = Mp*P*RV, where P is porosity (SetPorosity); or 2, Mp is mol/L of rock in the RV, Mc = Mp*(1-P)*RV.

If a single SURFACE definition is used for cells with different initial porosity, the three options scale quite differently. For option 0, the number of moles of surface sites will be the same regardless of porosity. For option 1, the number of moles of surface sites will be vary directly with porosity and inversely with rock volume. For option 2, the number of moles of surface sites will vary directly with rock volume and inversely with porosity.

See also
YAMLInitialPhreeqc2Module, YAMLInitialPhreeqcCell2Module, YAMLSetPorosity, YAMLSetRepresentativeVolume.
Fortran Example:
 status = yrm%YAMLSetUnitsSurface(1)
 

◆ YAMLSpeciesConcentrations2Module()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLSpeciesConcentrations2Module ( class(yaml_phreeqcrm), intent(inout)  self,
real(kind=8), dimension(:,:), intent(in), allocatable  species_conc 
)

Inserts data into the YAML document for the PhreeqcRM method SpeciesConcentrations2Module. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
species_concVector of aqueous species concentrations. Dimension of the array is nspecies times nxyz, where nspecies is the number of aqueous species, and nxyz is the number of user grid cells. Concentrations are moles per liter.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

SpeciesConcentrations2Module sets solution concentrations in the reaction cells based on the vector of aqueous species concentrations (species_conc). This method is intended for use with multicomponent-diffusion transport calculations, and SetSpeciesSaveOn must be set to true. The list of aqueous species is determined by FindComponents and includes all aqueous species that can be made from the set of components. The method determines the total concentration of a component by summing the molarities of the individual species times the stoichiometric coefficient of the element in each species. Solution compositions in the reaction cells are updated with these component concentrations. Usually, accurate concentrations will not be known to use YAMLSpeciesConcentrations2Module during initialization.

See also
YAMLFindComponents, YAMLSetSpeciesSaveOn.
Fortran Example:
 status = yrm%YAMLSpeciesConcentrations2Module(c)
 

◆ YAMLStateApply()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLStateApply ( class(yaml_phreeqcrm), intent(inout)  self,
integer, intent(in)  n 
)

Inserts data into the YAML document for the PhreeqcRM method StateApply. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
nInteger identifying the state that is to be applied.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

StateApply resets the state of the module to a state previously saved with StateSave. The chemistry of all model cells are reset, including SOLUTIONs, EQUILIBRIUM_PHASES, EXCHANGEs, GAS_PHASEs, KINETICS, SOLID_SOLUTIONs, and SURFACEs. MIXes, REACTIONs, REACTION_PRESSUREs, and REACTION_TEMPERATUREs will be reset for each cell, if they were defined in the worker IPhreeqc instances at the time the state was saved. The distribution of cells among the workers and the chemistry of fully or partially unsaturated cells are also reset to the saved state. The state to be applied is identified by an integer.

See also
YAMLStateSave and YAMLStateDelete.
Fortran Example:
 status = yrm%YAMLStateApply(1)
 

◆ YAMLStateDelete()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLStateDelete ( class(yaml_phreeqcrm), intent(inout)  self,
integer, intent(in)  n 
)

Inserts data into the YAML document for the PhreeqcRM method StateDelete. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
nInteger identifying the state that is to be deleted.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

StateDelete deletes a state previously saved with StateSave.

See also
YAMLStateSave and YAMLStateApply.
Fortran Example:
 status = yrm%YAMLStateDelete(1)
 

◆ YAMLStateSave()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLStateSave ( class(yaml_phreeqcrm), intent(inout)  self,
integer, intent(in)  n 
)

Inserts data into the YAML document for the PhreeqcRM method StateSave. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
nInteger identifying the state that is saved.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

StateSave saves the state of the chemistry in all model cells, including SOLUTIONs, EQUILIBRIUM_PHASES, EXCHANGEs, GAS_PHASEs, KINETICS, SOLID_SOLUTIONs, and SURFACEs. Although not generally used, MIXes, REACTIONs, REACTION_PRESSUREs, and REACTION_TEMPERATUREs will be saved for each cell, if they have been defined in the worker IPhreeqc instances. The distribution of cells among the workers and the chemistry of fully or partially unsaturated cells are also saved. The state is saved in memory; use DumpModule to save the state to file. PhreeqcRM can be reset to this state by using StateApply. A state is identified by an integer, and multiple states can be saved.

See also
YAMLDumpModule, YAMLStateApply, and YAMLStateDelete.
Fortran Example:
 status = yrm%YAMLStateSave(1)
 

◆ YAMLThreadCount()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLThreadCount ( class(yaml_phreeqcrm), intent(inout)  self,
integer, intent(in)  n 
)

Inserts data into the YAML document to define the number of threads to use with PhreeqcRM calculations. Once the YAML document is written, the number threads to use can be extracted when bmif_initialize is called. The data for ThreadCount will be ignored if the PhreeqcRM instance has already been initialized.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
nNumber of threads to use for multiprocessing in PhreeqcRM instance. A value of zero will cause PhreeqcRM to use the number of logical processors available on the computer.
Return values
IRM_RESULTZero indicates success, negative indicates failure.
Fortran Example:
 status = yrm%YAMLThreadCount()
 

◆ YAMLUseSolutionDensityVolume()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLUseSolutionDensityVolume ( class(yaml_phreeqcrm), intent(inout)  self,
logical, intent(in)  tf 
)

Inserts data into the YAML document for the PhreeqcRM method UseSolutionDensityVolume. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
tfTrue indicates that the solution density and volume as calculated by PHREEQC will be used to calculate concentrations. False indicates that the solution density set by SetDensityUser and the volume determined by the product of SetSaturationUser, SetPorosity, and SetRepresentativeVolume, will be used to calculate concentrations retrieved by GetConcentrations.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

UseSolutionDensityVolume determines the volume and density to use when converting from the reaction-cell concentrations to transport concentrations (GetConcentrations). Two options are available to convert concentration units: (1) the density and solution volume calculated by PHREEQC are used, or (2) the specified density (SetDensityUser) and solution volume are determined by the product of saturation (SetSaturationUser), porosity (SetPorosity), and representative volume (SetRepresentativeVolume). Transport models that consider density-dependent flow will probably use the PHREEQC-calculated density and solution volume (default), whereas transport models that assume constant-density flow will probably use specified values of density and solution volume. Only the following databases distributed with PhreeqcRM have molar-volume information needed to accurately calculate density and solution volume: phreeqc.dat, Amm.dat, and pitzer.dat. Density is only used when converting to or from transport units of mass fraction.

See also
YAMLSetDensityUser, YAMLSetPorosity, YAMLSetRepresentativeVolume, YAMLSetSaturationUser.
Fortran Example:
 status = yrm%YAMLUseSolutionDensityVolume(.false.)
 

◆ YAMLWarningMessage()

procedure YAMLPhreeqcRM::yaml_phreeqcrm::YAMLWarningMessage ( class(yaml_phreeqcrm), intent(inout)  self,
character(len=*), intent(in)  str 
)

Inserts data into the YAML document for the PhreeqcRM method WarningMessage. When the YAML document is written to file it can be processed by the method bmif_initialize or RM_InitializeYAML to initialize a PhreeqcRM instance.

Parameters
selfFortran-supplied YAML_PhreeqcRM instance.
strString to be printed.
Return values
IRM_RESULTZero indicates success, negative indicates failure.

WarningMessage prints a warning message to the screen and the log file.

See also
YAMLOpenFiles, YAMLLogMessage, YAMLOutputMessage, YAMLScreenMessage.
Fortran Example:
 status = yrm%WarningMessage("Need to check these definitions.")
 

Member Data Documentation

◆ yaml_id

integer YAMLPhreeqcRM::yaml_phreeqcrm::yaml_id

The documentation for this type was generated from the following file: