PhreeqcRM
|
Data Types | |
type | yaml_phreeqcrm |
Functions/Subroutines | |
integer function | CreateYAMLPhreeqcRM (self) |
integer function | DestroyYAMLPhreeqcRM (self) |
integer function | WriteYAMLDoc (self, file_name) |
integer function | YAMLClear (self) |
integer function | YAMLAddOutputVars (self, option, def) |
integer function | YAMLCloseFiles (self) |
integer function | YAMLCreateMapping (self, grid2chem) |
integer function | YAMLDumpModule (self, dump_on, append) |
integer function | YAMLFindComponents (self) |
integer function | YAMLInitialSolutions2Module (self, solutions) |
integer function | YAMLInitialEquilibriumPhases2Module (self, equilibrium_phases) |
integer function | YAMLInitialExchanges2Module (self, exchanges) |
integer function | YAMLInitialSurfaces2Module (self, surfaces) |
integer function | YAMLInitialGasPhases2Module (self, gas_phases) |
integer function | YAMLInitialSolidSolutions2Module (self, solid_solutions) |
integer function | YAMLInitialKinetics2Module (self, kinetics) |
integer function | YAMLInitialPhreeqc2Module (self, ic1) |
integer function | YAMLInitialPhreeqc2Module_mix (self, ic1, ic2, f1) |
integer function | YAMLInitialPhreeqcCell2Module (self, n, cell_numbers) |
integer function | YAMLLoadDatabase (self, file_name) |
integer function | YAMLLogMessage (self, str) |
integer function | YAMLOpenFiles (self) |
integer function | YAMLOutputMessage (self, str) |
integer function | YAMLRunCells (self) |
integer function | YAMLRunFile (self, workers, initial_phreeqc, utility, file_name) |
integer function | YAMLRunString (self, workers, initial_phreeqc, utility, input_string) |
integer function | YAMLScreenMessage (self, str) |
integer function | YAMLSetComponentH2O (self, tf) |
integer function | YAMLSetConcentrations (self, c) |
integer function | YAMLSetCurrentSelectedOutputUserNumber (self, n_user) |
integer function | YAMLSetDensityUser (self, density) |
integer function | YAMLSetDumpFileName (self, file_name) |
integer function | YAMLSetErrorHandlerMode (self, mode) |
integer function | YAMLSetErrorOn (self, tf) |
integer function | YAMLSetFilePrefix (self, prefix) |
integer function | YAMLSetGasCompMoles (self, gas_moles) |
integer function | YAMLSetGasPhaseVolume (self, gas_volume) |
integer function | YAMLSetGridCellCount (self, n) |
integer function | YAMLSetNthSelectedOutput (self, n) |
integer function | YAMLSetPartitionUZSolids (self, tf) |
integer function | YAMLSetPorosity (self, por) |
integer function | YAMLSetPressure (self, p) |
integer function | YAMLSetPrintChemistryMask (self, mask) |
integer function | YAMLSetPrintChemistryOn (self, workers, initial_phreeqc, utility) |
integer function | YAMLSetRebalanceByCell (self, tf) |
integer function | YAMLSetRebalanceFraction (self, f) |
integer function | YAMLSetRepresentativeVolume (self, rv) |
integer function | YAMLSetSaturationUser (self, sat) |
integer function | YAMLSetScreenOn (self, tf) |
integer function | YAMLSetSelectedOutputOn (self, tf) |
integer function | YAMLSetSpeciesSaveOn (self, save_on) |
integer function | YAMLSetTemperature (self, tc) |
integer function | YAMLSetTime (self, time) |
integer function | YAMLSetTimeConversion (self, conv_factor) |
integer function | YAMLSetTimeStep (self, time_step) |
integer function | YAMLSetUnitsExchange (self, option) |
integer function | YAMLSetUnitsGasPhase (self, option) |
integer function | YAMLSetUnitsKinetics (self, option) |
integer function | YAMLSetUnitsPPassemblage (self, option) |
integer function | YAMLSetUnitsSolution (self, option) |
integer function | YAMLSetUnitsSSassemblage (self, option) |
integer function | YAMLSetUnitsSurface (self, option) |
integer function | YAMLSpeciesConcentrations2Module (self, species_conc) |
integer function | YAMLStateSave (self, n) |
integer function | YAMLStateApply (self, n) |
integer function | YAMLStateDelete (self, n) |
integer function | YAMLThreadCount (self, n) |
integer function | YAMLUseSolutionDensityVolume (self, tf) |
integer function | YAMLWarningMessage (self, str) |
Fortran documentation for using YAML to initialize instances of BMIPhreeqcRM and PhreeqcRM.
YAML_PhreeqcRM is a Fortran type. The methods described here are type-bound methods that operate on a YAML_PhreeqcRM instance.
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
! Create YAMLPhreeqcRM document
type(YAML_PhreeqcRM) :: yrm
id = yrm%CreateYAMLPhreeqcRM()
integer function YAMLPhreeqcRM::DestroyYAMLPhreeqcRM | ( | class(yaml_phreeqcrm), intent(inout) | self | ) |
Deletes the YAMLPhreeqcRM instance and all data.
self | Fortran-supplied YAML_PhreeqcRM instance. |
IRM_RESULT | Zero indicates success, negative indicates failure. |
YAML_filename = "AdvectBMI_f90.yaml"
status = yrm%WriteYAMLDoc(YAML_filename)
status = yrm%YAMLClear()
status = yrm%DestroyYAMLPhreeqcRM()
integer function YAMLPhreeqcRM::WriteYAMLDoc | ( | class(yaml_phreeqcrm), intent(inout) | self, |
character(len=*), intent(in) | file_name | ||
) |
Writes YAML document to file.
self | Fortran-supplied YAML_PhreeqcRM instance. |
file_name | Name of file to write YAML document. |
IRM_RESULT | Zero indicates success, negative indicates failure. |
YAML_filename = "AdvectBMI_f90.yaml"
status = yrm%WriteYAMLDoc(YAML_filename)
status = yrm%YAMLClear()
status = yrm%DestroyYAMLPhreeqcRM()
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
option | A string value, among those listed below, that selects sets of variables that can be retieved by the bmif_get_value method. |
def | A 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. |
IRM_RESULT | Zero 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.
status = yrm%YAMLAddOutputVars("SolutionMolalities", "True")
status = yrm%YAMLAddOutputVars("SaturationIndices", "Calcite Dolomite")
integer function YAMLPhreeqcRM::YAMLClear | ( | class(yaml_phreeqcrm), intent(inout) | self | ) |
Clears all definitions from the YAML document.
self | Fortran-supplied YAML_PhreeqcRM instance. |
IRM_RESULT | Zero indicates success, negative indicates failure. |
YAML_filename = "AdvectBMI_f90.yaml"
status = yrm%WriteYAMLDoc(YAML_filename)
status = yrm%YAMLClear()
status = yrm%DestroyYAMLPhreeqcRM()
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
IRM_RESULT | Zero indicates success, negative indicates failure. |
CloseFiles closes the output and log files.
status = yrm%YAMLCloseFiles()
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
grid2chem | Integer array of mapping from user's model grid to cells for which chemistry will be run. |
IRM_RESULT | Zero 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).
! 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)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
dump_on | Signal for writing the dump file, true or false. |
append | Signal to append to the contents of the dump file, true or false. |
IRM_RESULT | Zero 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.
logical dump_on, append
dump_on = .true.
append = .false.
status = yrm%YAMLSetDumpFileName("Advect_cpp.dmp")
status = yrm%YAMLDumpModule(dump_on, append)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
Zero | indicates 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.
status = yrm%YAMLRunFile(yaml_file)
status = yrm%YAMLFindComponents()
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
equilibrium_phases | Vector of EQUILIBRIUM_PHASES index numbers that is dimensioned nxyz, where nxyz is the number of grid cells in the user's model. |
Zero | indicates 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.
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
exchanges | Vector of EXCHANGE index numbers that is dimensioned nxyz, where nxyz is the number of grid cells in the user's model. |
Zero | indicates 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.
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
gas_phases | Vector of GAS_PHASE index numbers that is dimensioned nxyz, where nxyz is the number of grid cells in the user's model. |
Zero | indicates 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.
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
kinetics | Vector of KINETICS index numbers that is dimensioned nxyz, where nxyz is the number of grid cells in the user's model. |
Zero | indicates 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.
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
ic1 | Vector of solution and reactant index numbers that refer to definitions in the InitialPhreeqc instance. |
IRM_RESULT | Zero 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.
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)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
ic1 | Vector 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. |
ic2 | Vector 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. |
f1 | Fraction of ic1 that mixes with (1 - f1) of ic2. Size is 7 times nxyz. |
IRM_RESULT | Zero 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.
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)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
n | Number that refers to a solution or MIX and associated reactants in the InitialPhreeqc instance. |
cell_numbers | A vector of grid-cell numbers (user's grid-cell numbering system) that will be populated with cell n from the InitialPhreeqc instance. |
IRM_RESULT | Zero 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.
integer, allocatable, dimension(:) :: module_cells
allocate(module_cells(2))
module_cells(1) = 18
module_cells(2) = 19
status = yrm%YAMLInitialPhreeqcCell2Module(-1, module_cells)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
solid_solutions | Vector of SOLID_SOLUTIONS index numbers that is dimensioned nxyz, where nxyz is the number of grid cells in the user's model. |
Zero | indicates 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.
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
solutions | Vector of SOLUTION index numbers that is dimensioned nxyz, where nxyz is the number of grid cells in the user's model. |
Zero | indicates 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.
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
surfaces | Vector of SURFACE index numbers that is dimensioned nxyz, where nxyz is the number of grid cells in the user's model. |
Zero | indicates 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.
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
file_name | String containing the database name. |
IRM_RESULT | Zero 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.
status = yrm%YAMLLoadDatabase("phreeqc.dat")
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
str | String to be printed. |
IRM_RESULT | Zero indicates success, negative indicates failure. |
LogMessage prints a message to the log file.
status = yrm%YAMLLogMessage("Finished section 1 of initialization")
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
IRM_RESULT | Zero 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.
status = yrm%YAMLSetFilePrefix("Advect_cpp")
status = yrm%YAMLOpenFiles()
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
str | String to be printed. |
IRM_RESULT | Zero indicates success, negative indicates failure. |
OutputMessage prints a message to the output file.
status = yrm%YAMLOutputMessage("Finished section 1 of initialization")
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
IRM_RESULT | Zero 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).
status = yrm%YAMLSetTimeStep(0.0)
status = yrm%YAMLRunCells()
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
workers | True, the workers will run the file; False, the workers will not run the file. |
initial_phreeqc | True, the InitialPhreeqc instance will run the file; False, the InitialPhreeqc will not run the file. |
utility | True, the Utility instance will run the file; False, the Utility instance will not run the file. |
file_name | Name of the file to run. |
IRM_RESULT | Zero 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.
status = yrm%YAMLRunFile(.true., .true., .true., "advect.pqi")
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
workers | True, the workers will run the string; False, the workers will not run the string. |
initial_phreeqc | True, the InitialPhreeqc instance will run the string; False, the InitialPhreeqc will not run the string. |
utility | True, the Utility instance will run the string; False, the Utility instance will not run the string. |
input_string | String containing PHREEQC input. |
IRM_RESULT | Zero 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.
input = "DELETE; -all"
status = yrm%YAMLRunString(.true., .true., .true., input)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
str | String to be printed. |
IRM_RESULT | Zero indicates success, negative indicates failure. |
ScreenMessage prints a message to the screen.
string = "Beginning to process YAML for initial conditions"
status = yrm%YAMLScreenMessage(string)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
tf | True (default), excess H, excess O, and water are included in the component list; False, total H and O are included in the component list. |
IRM_RESULT | Zero 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.
status = yrm%YAMLSetComponentH2O(.false.)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
c | Vector 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. |
IRM_RESULT | Zero 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.
status = yrm%YAMLSetConcentrations(c)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
n_user | User number of the SELECTED_OUTPUT data block that is to be used. |
IRM_RESULT | Zero 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.
status = yrm%YAMLSetCurrentSelectedOutputUserNumber(n_user)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
density | Vector of densities. Size of vector is nxyz, where nxyz is the number of grid cells in the user's model. |
IRM_RESULT | Zero 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.
real(kind=8), allocatable, dimension(:) :: density
allocate(density(nxyz))
density = 1.0d0
status = yrm%YAMLSetDensityUser(density)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
file_name | Name of dump file. |
IRM_RESULT | Zero indicates success, negative indicates failure. |
SetDumpFileName sets the name of the dump file. It is the name used by the method DumpModule.
logical dump_on, append
status = yrm%YAMLSetDumpFileName("Advect_cpp.dmp")
dump_on = .true.
append = .false.
status = yrm%YAMLDumpModule(dump_on, append)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
mode | Error handling mode: 0, 1, or 2. |
IRM_RESULT | Zero 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.
status = yrm%YAMLSetErrorHandlerMode(1)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
tf | True, enable error messages; False, disable error messages. Default is true. |
IRM_RESULT | Zero 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.
status = yrm%YAMLSetErrorOn(.true.)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
prefix | Prefix used when opening the output and log files. |
IRM_RESULT | Zero 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.
status = yrm%YAMLSetFilePrefix("Advect_cpp")
status = yrm%YAMLOpenFiles()
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
gas_moles | Vector of moles of gas components. |
IRM_RESULT | Zero 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.
real(kind=8), allocatable, dimension(:,:) :: gas_moles
allocate(gas_moles(nxyz*ngas))
status = yrm%YAMLSetGasCompMoles(gas_moles)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
gas_volume | Vector of volumes for each gas phase. |
IRM_RESULT | Zero 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.
real(kind=8), allocatable, dimension(:) :: gas_volume
allocate(gas_volume(nxyz))
status = yrm%YAMLSetGasPhaseVolume(gas_volume)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
n | Number of cells for the PhreeqcRM instance. The number of cells |
IRM_RESULT | Zero 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.
integer nxyz
nxyz = 40
status = yrm%YAMLSetGridCellCount(nxyz)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
n | Sequence number of the SELECTED_OUTPUT data block that is to be used. |
IRM_RESULT | Zero 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.
status = yrm%YAMLSetCurrentSelectedOutput(1)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
tf | True, 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. |
IRM_RESULT | Zero 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.
status = yrm%YAMLSetPartitionUZSolids(.false.)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
por | Vector of porosities, unitless. Default is 0.1. |
IRM_RESULT | Zero 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.
real(kind=8), allocatable, dimension(:) :: por
allocate(por(nxyz))
por = 0.2d0
status = yrm%YAMLSetPorosity(por)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
p | Vector of pressures, in atm. Size of vector is nxyz, where nxyz is the number of grid cells in the user's model. |
IRM_RESULT | Zero 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.
real(kind=8), allocatable, dimension(:) :: pressure
allocate(por(nxyz))
pressure = 2.0d0
status = yrm%YAMLSetPressure(pressure)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
mask | Vector 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. |
IRM_RESULT | Zero 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.
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)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
workers | True, enable detailed printing in the worker instances; False, disable detailed printing in the worker instances. |
initial_phreeqc | True, enable detailed printing in the InitialPhreeqc instance; False, disable detailed printing in the InitialPhreeqc instance. |
utility | True, enable detailed printing in the Utility instance; False, disable detailed printing in the Utility instance. |
IRM_RESULT | Zero 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.
status = yrm%YAMLSetPrintChemistryOn(.false., .true., .false.)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
tf | True, indicates individual cell times are used in rebalancing (default); False, indicates average times are used in rebalancing. |
IRM_RESULT | Zero 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.
status = yrm%YAMLSetRebalanceByCell(.true.)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
f | Fraction from 0.0 to 1.0. |
IRM_RESULT | Zero 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.
status = yrm%YAMLSetRebalanceFraction(0.5)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
rv | Vector 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. |
IRM_RESULT | Zero 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.
real(kind=8), allocatable, dimension(:) :: rv
allocate(rv(nxyz))
rv = 1.0d0
status = yrm%YAMLSetRepresentativeVolume(rv)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
sat | Vector of saturations, unitless. Default 1.0. Size of vector is nxyz, where nxyz is the number of grid cells in the user's model. |
IRM_RESULT | Zero 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.
real(kind=8), allocatable, dimension(:) :: sat
allocate(sat(nxyz))
sat = 1.0d0
status = yrm%YAMLSetSaturationUser(sat)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
tf | True, enable screen messages; False, disable screen messages. Default is true. |
IRM_RESULT | Zero 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.
status = yrm%YAMLSetScreenOn(.true.)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
tf | True, enable selected output; False, disable selected output. |
IRM_RESULT | Zero 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.
status = yrm%YAMLSetSelectedOutputOn(.true.)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
save_on | True indicates species concentrations are saved; False indicates species concentrations are not saved. |
IRM_RESULT | Zero 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.
status = yrm%YAMLSetSpeciesSaveOn(.true.)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
tc | Vector of temperatures, in degrees C. |
IRM_RESULT | Zero 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.
real(kind=8), allocatable, dimension(:) :: tc
allocate(tc(nxyz))
por = 0.2d0
status = yrm%YAMLSetTemperature(tc)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
time | Current simulation time, in seconds. |
IRM_RESULT | Zero indicates success, negative indicates failure. |
SetTime sets current simulation time for the reaction module.
status = yrm%YAMLSetTime(0.0)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
conv_factor | Factor to convert seconds to user time units. |
IRM_RESULT | Zero 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.
conv_factor = 1.0d0 / 86400.d0
status = yrm%YAMLSetTimeConversion(conv_factor)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
time_step | Time step, in seconds. |
IRM_RESULT | Zero 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.
time_step = 86400.d0
status = yrm%YAMLSetTimeStep(time_step)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
option | Units option for exchangers: 0, 1, or 2. |
IRM_RESULT | Zero 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.
status = yrm%YAMLSetUnitsExchange(1)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
option | Units option for gas phases: 0, 1, or 2. |
IRM_RESULT | Zero 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.
status = yrm%YAMLSetUnitsGasPhase(1)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
option | Units option for kinetic reactants: 0, 1, or 2. |
IRM_RESULT | Zero 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.
status = yrm%YAMLSetUnitsKinetics(1)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
option | Units option for equilibrium phases: 0, 1, or 2. |
IRM_RESULT | Zero 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.
status = yrm%YAMLSetUnitsPPassemblage(1)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
option | Units option for solutions: 1, 2, or 3, default is 1, mg/L. |
IRM_RESULT | Zero 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.
status = yrm%YAMLSetUnitsSolution(2)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
option | Units option for solid solutions: 0, 1, or 2. |
IRM_RESULT | Zero 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.
status = yrm%YAMLSetUnitsSSassemblage(1)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
option | Units option for surfaces: 0, 1, or 2. |
IRM_RESULT | Zero 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.
status = yrm%YAMLSetUnitsSurface(1)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
species_conc | Vector 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. |
IRM_RESULT | Zero 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.
status = yrm%YAMLSpeciesConcentrations2Module(c)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
n | Integer identifying the state that is to be applied. |
IRM_RESULT | Zero 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.
status = yrm%YAMLStateApply(1)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
n | Integer identifying the state that is to be deleted. |
IRM_RESULT | Zero indicates success, negative indicates failure. |
StateDelete deletes a state previously saved with StateSave.
status = yrm%YAMLStateDelete(1)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
n | Integer identifying the state that is saved. |
IRM_RESULT | Zero 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.
status = yrm%YAMLStateSave(1)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
n | Number 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. |
IRM_RESULT | Zero indicates success, negative indicates failure. |
status = yrm%YAMLThreadCount()
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
tf | True 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. |
IRM_RESULT | Zero 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.
status = yrm%YAMLUseSolutionDensityVolume(.false.)
integer function YAMLPhreeqcRM::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.
self | Fortran-supplied YAML_PhreeqcRM instance. |
str | String to be printed. |
IRM_RESULT | Zero indicates success, negative indicates failure. |
WarningMessage prints a warning message to the screen and the log file.
status = yrm%WarningMessage("Need to check these definitions.")