C/Fortran Documentation.
More...
Go to the source code of this file.
Enumerations |
| enum | IPQ_RESULT {
IPQ_OK = 0,
IPQ_OUTOFMEMORY = -1,
IPQ_BADVARTYPE = -2,
IPQ_INVALIDARG = -3,
IPQ_INVALIDROW = -4,
IPQ_INVALIDCOL = -5,
IPQ_BADINSTANCE = -6
} |
| | Enumeration used to return error codes.
More...
|
Functions |
| IPQ_RESULT | AccumulateLine (int id, const char *line) |
| int | AddError (int id, const char *error_msg) |
| int | AddWarning (int id, const char *warn_msg) |
| IPQ_RESULT | ClearAccumulatedLines (int id) |
| int | CreateIPhreeqc (void) |
| IPQ_RESULT | DestroyIPhreeqc (int id) |
| const char * | GetComponent (int id, int n) |
| int | GetComponentCount (int id) |
| int | GetDumpFileOn (int id) |
| const char * | GetDumpString (int id) |
| const char * | GetDumpStringLine (int id, int n) |
| int | GetDumpStringLineCount (int id) |
| int | GetDumpStringOn (int id) |
| int | GetErrorFileOn (int id) |
| const char * | GetErrorString (int id) |
| const char * | GetErrorStringLine (int id, int n) |
| int | GetErrorStringLineCount (int id) |
| int | GetLogFileOn (int id) |
| int | GetOutputFileOn (int id) |
| int | GetSelectedOutputColumnCount (int id) |
| int | GetSelectedOutputFileOn (int id) |
| int | GetSelectedOutputRowCount (int id) |
| IPQ_RESULT | GetSelectedOutputValue (int id, int row, int col, VAR *pVAR) |
| const char * | GetWarningString (int id) |
| const char * | GetWarningStringLine (int id, int n) |
| int | GetWarningStringLineCount (int id) |
| int | LoadDatabase (int id, const char *filename) |
| int | LoadDatabaseString (int id, const char *input) |
| void | OutputAccumulatedLines (int id) |
| void | OutputErrorString (int id) |
| void | OutputWarningString (int id) |
| int | RunAccumulated (int id) |
| int | RunFile (int id, const char *filename) |
| int | RunString (int id, const char *input) |
| IPQ_RESULT | SetDumpFileOn (int id, int dump_on) |
| IPQ_RESULT | SetDumpStringOn (int id, int dump_string_on) |
| IPQ_RESULT | SetErrorFileOn (int id, int error_on) |
| IPQ_RESULT | SetLogFileOn (int id, int log_on) |
| IPQ_RESULT | SetOutputFileOn (int id, int output_on) |
| IPQ_RESULT | SetSelectedOutputFileOn (int id, int sel_on) |
Detailed Description
Enumeration Type Documentation
Enumeration used to return error codes.
- Enumerator:
| IPQ_OK |
Success
|
| IPQ_OUTOFMEMORY |
Failure, Out of memory
|
| IPQ_BADVARTYPE |
Failure, Invalid VAR type
|
| IPQ_INVALIDARG |
Failure, Invalid argument
|
| IPQ_INVALIDROW |
Failure, Invalid row
|
| IPQ_INVALIDCOL |
Failure, Invalid column
|
| IPQ_BADINSTANCE |
Failure, Invalid instance id
|
Function Documentation
| IPQ_RESULT AccumulateLine |
( |
int |
id, |
|
|
const char * |
line |
|
) |
| |
Accumlulate line(s) for input to phreeqc.
- Parameters:
-
| id | The instance id returned from CreateIPhreeqc. |
| line | The line(s) to add for input to phreeqc. |
- Return values:
-
| IPQ_OK | Success |
| IPQ_OUTOFMEMORY | Out of memory |
- See also:
- ClearAccumulatedLines, OutputAccumulatedLines, RunAccumulated
- Fortran90 Interface:
-
FUNCTION AccumulateLine(ID,LINE)
INTEGER(KIND=4), INTENT(IN) :: ID
CHARACTER(LEN=*), INTENT(IN) :: LINE
INTEGER(KIND=4) :: AccumulateLine
END FUNCTION AccumulateLine
- C Example:
- Fortran90 Example:
- see GetDumpStringLine
| int AddError |
( |
int |
id, |
|
|
const char * |
error_msg |
|
) |
| |
Appends the given error message and increments the error count. Internally used to create an error condition.
- Parameters:
-
| id | The instance id returned from CreateIPhreeqc. |
| error_msg | The error message to display. |
- Returns:
- The current error count if successful; otherwise a negative value indicates an error occured (see IPQ_RESULT).
- See also:
- GetErrorString, GetErrorStringLine, GetErrorStringLineCount, OutputErrorString
- Fortran90 Interface:
-
FUNCTION AddError(ID,ERROR_MSG)
INTEGER(KIND=4), INTENT(IN) :: ID
CHARACTER(LEN=*), INTENT(IN) :: ERROR_MSG
INTEGER(KIND=4) :: AddError
END FUNCTION AddError
| int AddWarning |
( |
int |
id, |
|
|
const char * |
warn_msg |
|
) |
| |
Appends the given warning message and increments the warning count. Internally used to create a warning condition.
- Parameters:
-
| id | The instance id returned from CreateIPhreeqc. |
| error_msg | The warning message to display. |
- Returns:
- The current warning count if successful; otherwise a negative value indicates an error occured (see IPQ_RESULT).
- See also:
- GetWarningString, GetWarningStringLine, GetWarningStringLineCount, OutputWarningString
- Fortran90 Interface:
-
FUNCTION AddWarning(ID,WARN_MSG)
INTEGER(KIND=4), INTENT(IN) :: ID
CHARACTER(LEN=*), INTENT(IN) :: WARN_MSG
INTEGER(KIND=4) :: AddWarning
END FUNCTION AddWarning
Clears the accumulated input buffer. Input buffer is accumulated from calls to AccumulateLine.
- Return values:
-
| IPQ_OK | Success. |
| IPQ_BADINSTANCE | The given id is invalid. |
- See also:
- AccumulateLine, OutputAccumulatedLines, RunAccumulated
- Fortran90 Interface:
-
FUNCTION ClearAccumulatedLines(ID)
INTEGER(KIND=4), INTENT(IN) :: ID
INTEGER(KIND=4) :: ClearAccumulatedLines
END FUNCTION ClearAccumulatedLines
| int CreateIPhreeqc |
( |
void |
| ) |
|
Create a new IPhreeqc instance.
- Returns:
- A non-negative value if successful; otherwise a negative value indicates an error occured (see IPQ_RESULT).
- See also:
- DestroyIPhreeqc
- Fortran90 Interface:
-
FUNCTION CreateIPhreeqc()
INTEGER(KIND=4) :: CreateIPhreeqc
END FUNCTION CreateIPhreeqc
- C Example:
- Fortran90 Example:
-
Release an IPhreeqc instance from memory.
- Parameters:
-
- Return values:
-
| IPQ_OK | Success |
| IPQ_BADINSTANCE | The given id is invalid. |
- See also:
- CreateIPhreeqc
- Fortran90 Interface:
-
FUNCTION DestroyIPhreeqc(ID)
INTEGER(KIND=4), INTENT(IN) :: ID
INTEGER(KIND=4) :: DestroyIPhreeqc
END FUNCTION DestroyIPhreeqc
- C Example:
- see CreateIPhreeqc
- Fortran90 Example:
- see CreateIPhreeqc
| const char* GetComponent |
( |
int |
id, |
|
|
int |
n |
|
) |
| |
Retrieves the given component.
- Parameters:
-
| id | The instance id returned from CreateIPhreeqc. |
| n | The zero-based index of the component to retrieve. |
- Returns:
- A null terminated string containing the given component. Returns an empty string if n is out of range.
- See also:
- GetComponentCount
- Fortran90 Interface:
- (Note: N is one-based for the Fortran interface)
SUBROUTINE GetComponent(ID,N,COMP)
INTEGER(KIND=4), INTENT(IN) :: ID
INTEGER(KIND=4), INTENT(IN) :: N
CHARACTER(LEN=*), INTENT(OUT) :: COMP
END SUBROUTINE GetComponent
- C Example:
- Fortran90 Example:
-
| int GetComponentCount |
( |
int |
id | ) |
|
Retrieves the number of components in the current component list .
- Parameters:
-
- Returns:
- The current count of components. A negative value indicates an error occured (see IPQ_RESULT).
- See also:
- GetComponent
- Fortran90 Interface:
-
FUNCTION GetComponentCount(ID)
INTEGER(KIND=4), INTENT(IN) :: ID
INTEGER(KIND=4) :: GetComponentCount
END FUNCTION GetComponentCount
- C Example:
- see GetComponent
- Fortran90 Example:
- see GetComponent
| int GetDumpFileOn |
( |
int |
id | ) |
|
| const char* GetDumpString |
( |
int |
id | ) |
|
| const char* GetDumpStringLine |
( |
int |
id, |
|
|
int |
n |
|
) |
| |
Retrieves the given dump line.
- Parameters:
-
| id | The instance id returned from CreateIPhreeqc. |
| n | The zero-based index of the line to retrieve. |
- Returns:
- A null terminated string containing the given line. Returns an empty string if n is out of range.
- Precondition:
- SetDumpStringOn must have been set to true (non-zero).
- See also:
- GetDumpFileOn, GetDumpString, GetDumpStringLineCount, GetDumpStringOn, SetDumpFileOn, SetDumpStringOn
- Fortran90 Interface:
-
(Note: N is one-based for the Fortran interface.)
SUBROUTINE GetDumpStringLine(ID,N,LINE)
INTEGER(KIND=4), INTENT(IN) :: ID
INTEGER(KIND=4), INTENT(IN) :: N
CHARACTER(LEN=*), INTENT(OUT) :: LINE
END SUBROUTINE GetDumpStringLine
- Fortran90 Example:
PROGRAM example
INCLUDE "IPhreeqc.f90.inc"
INTEGER(KIND=4) :: id
INTEGER(KIND=4) :: i
CHARACTER(LEN=80) :: line
id = CreateIPhreeqc()
IF (id.LT.0) THEN
STOP
END IF
IF (SetDumpStringOn(id, .TRUE.).NE.IPQ_OK) THEN
CALL OutputErrorString(id)
STOP
END IF
IF (LoadDatabase(id, "phreeqc.dat").NE.0) THEN
CALL OutputErrorString(id)
STOP
END IF
IF (AccumulateLine(id, "SOLUTION 1 Pure water").NE.IPQ_OK) THEN
CALL OutputErrorString(id)
STOP
END IF
IF (AccumulateLine(id, "EQUILIBRIUM_PHASES 1").NE.IPQ_OK) THEN
CALL OutputErrorString(id)
STOP
END IF
IF (AccumulateLine(id, " Calcite 0 10").NE.IPQ_OK) THEN
CALL OutputErrorString(id)
STOP
END IF
IF (AccumulateLine(id, "SAVE solution 1").NE.IPQ_OK) THEN
CALL OutputErrorString(id)
STOP
END IF
IF (AccumulateLine(id, "SAVE equilibrium_phases 1").NE.IPQ_OK) THEN
CALL OutputErrorString(id)
STOP
END IF
IF (AccumulateLine(id, "DUMP").NE.IPQ_OK) THEN
CALL OutputErrorString(id)
STOP
END IF
IF (AccumulateLine(id, " -solution 1").NE.IPQ_OK) THEN
CALL OutputErrorString(id)
STOP
END IF
IF (AccumulateLine(id, " -equilibrium_phases 1").NE.IPQ_OK) THEN
CALL OutputErrorString(id)
STOP
END IF
WRITE(*,*) "Input:"
CALL OutputAccumulatedLines(id)
IF (RunAccumulated(id).NE.0) THEN
CALL OutputErrorString(id)
STOP
END IF
WRITE(*,*) "Dump:"
DO i=1,GetDumpStringLineCount(id)
CALL GetDumpStringLine(id, i, line)
WRITE(*,*) TRIM(line)
END DO
IF (DestroyIPhreeqc(id).NE.IPQ_OK) THEN
CALL OutputErrorString(id)
STOP
END IF
END PROGRAM example
| int GetDumpStringLineCount |
( |
int |
id | ) |
|
| int GetDumpStringOn |
( |
int |
id | ) |
|
| int GetErrorFileOn |
( |
int |
id | ) |
|
Retrieves the current value of the error file switch.
- Parameters:
-
- Returns:
- Non-zero if errors are written to the phreeqc.err file, 0 (zero) otherwise.
- See also:
- SetErrorFileOn
- Fortran90 Interface:
-
FUNCTION GetErrorFileOn(ID)
INTEGER(KIND=4), INTENT(IN) :: ID
LOGICAL(KIND=4) :: GetErrorFileOn
END FUNCTION GetErrorFileOn
| const char* GetErrorString |
( |
int |
id | ) |
|
Retrieves the error messages from the last call to RunAccumulated, RunFile, RunString, LoadDatabase, or LoadDatabaseString.
- Parameters:
-
- Returns:
- A null terminated string containing error messages.
- See also:
- GetErrorFileOn, GetErrorStringLine, GetErrorStringLineCount, OutputErrorString, SetErrorFileOn
- Fortran90 Interface:
- Not implemented. (see GetErrorStringLineCount, GetErrorStringLine, OutputErrorString)
| const char* GetErrorStringLine |
( |
int |
id, |
|
|
int |
n |
|
) |
| |
Retrieves the given error line.
- Parameters:
-
| id | The instance id returned from CreateIPhreeqc. |
| n | The zero-based index of the line to retrieve. |
- Returns:
- A null terminated string containing the given line of the error string buffer.
- See also:
- GetErrorFileOn, GetErrorString, GetErrorStringLineCount, OutputErrorString, SetErrorFileOn
- Fortran90 Interface:
- (Note: N is one-based for the Fortran interface.)
SUBROUTINE GetErrorStringLine(ID,N,LINE)
INTEGER(KIND=4), INTENT(IN) :: ID
INTEGER(KIND=4), INTENT(IN) :: N
CHARACTER(LEN=*), INTENT(OUT) :: LINE
END SUBROUTINE GetErrorStringLine
| int GetErrorStringLineCount |
( |
int |
id | ) |
|
| int GetLogFileOn |
( |
int |
id | ) |
|
Retrieves the current value of the log file switch.
- Parameters:
-
- Returns:
- Non-zero if log messages are written to the phreeqc.log file, 0 (zero) otherwise.
- See also:
- SetLogFileOn
- Fortran90 Interface:
-
FUNCTION GetLogFileOn(ID)
INTEGER(KIND=4), INTENT(IN) :: ID
LOGICAL(KIND=4) :: GetLogFileOn
END FUNCTION GetLogFileOn
| int GetOutputFileOn |
( |
int |
id | ) |
|
Retrieves the current value of the output file switch.
- Parameters:
-
- Returns:
- Non-zero if output is written to the phreeqc.out file, 0 (zero) otherwise.
- See also:
- SetOutputFileOn
- Fortran90 Interface:
-
FUNCTION GetOutputFileOn(ID)
INTEGER(KIND=4), INTENT(IN) :: ID
LOGICAL(KIND=4) :: GetOutputFileOn
END FUNCTION GetOutputFileOn
| int GetSelectedOutputColumnCount |
( |
int |
id | ) |
|
| int GetSelectedOutputFileOn |
( |
int |
id | ) |
|
| int GetSelectedOutputRowCount |
( |
int |
id | ) |
|
| IPQ_RESULT GetSelectedOutputValue |
( |
int |
id, |
|
|
int |
row, |
|
|
int |
col, |
|
|
VAR * |
pVAR |
|
) |
| |
Returns the VAR associated with the specified row and column.
- Parameters:
-
| id | The instance id returned from CreateIPhreeqc. |
| row | The row index. |
| col | The column index. |
| pVAR | Pointer to the VAR to recieve the requested data. |
- Return values:
-
| IPQ_OK | Success. |
| IPQ_INVALIDROW | The given row is out of range. |
| IPQ_INVALIDCOL | The given column is out of range. |
| IPQ_OUTOFMEMORY | Memory could not be allocated. |
| IPQ_BADINSTANCE | The given id is invalid. |
- See also:
- GetSelectedOutputFileOn, GetSelectedOutputColumnCount, GetSelectedOutputRowCount, SetSelectedOutputFileOn
- Examples:
- The headings will include a suffix and/or prefix in order to differentiate the columns.
|
Input
|
Headings
|
SELECTED_OUTPUT
-reset false
-totals Ca Na
|
Ca(mol/kgw) Na(mol/kgw)
|
SELECTED_OUTPUT
-reset false
-molalities Fe+2 Hfo_sOZn+
|
m_Fe+2(mol/kgw) m_Hfo_sOZn+(mol/kgw)
|
SELECTED_OUTPUT
-reset false
-activities H+ Ca+2
|
la_H+ la_Ca+2
|
SELECTED_OUTPUT
-reset false
-equilibrium_phases Calcite Dolomite
|
Calcite d_Calcite Dolomite d_Dolomite
|
SELECTED_OUTPUT
-reset false
-saturation_indices CO2(g) Siderite
|
si_CO2(g) si_Siderite
|
SELECTED_OUTPUT
-reset false
-gases CO2(g) N2(g)
|
pressure "total mol" volume g_CO2(g) g_N2(g)
|
SELECTED_OUTPUT
-reset false
-kinetic_reactants CH2O Pyrite
|
k_CH2O dk_CH2O k_Pyrite dk_Pyrite
|
SELECTED_OUTPUT
-reset false
-solid_solutions CaSO4 SrSO4
|
s_CaSO4 s_SrSO4
|
- Fortran90 Interface:
- ROW is 1-based for the Fortran interface except that the column headings are stored in ROW=0. COL is 1-based for the Fortran interface.
FUNCTION GetSelectedOutputValue(ID,ROW,COL,VTYPE,DVALUE,SVALUE)
INTEGER(KIND=4), INTENT(IN) :: ID
INTEGER(KIND=4), INTENT(IN) :: ROW
INTEGER(KIND=4), INTENT(IN) :: COL
INTEGER(KIND=4), INTENT(OUT) :: VTYPE
REAL(KIND=8), INTENT(OUT) :: DVALUE
CHARACTER(LEN=*), INTENT(OUT) :: SVALUE
INTEGER(KIND=4) :: GetSelectedOutputValue
END FUNCTION GetSelectedOutputValue
- Parameters:
-
| ID | The instance id returned from CreateIPhreeqc. |
| ROW | The row index. |
| COL | The column index. |
| VTYPE | Returns the variable type. See VAR_TYPE. |
| DVALUE | Returns the numeric value when (VTYPE=TT_DOUBLE) or (VTYPE=TT_LONG). |
| SVALUE | Returns the string variable when (VTYPE=TT_STRING). When (VTYPE=TT_DOUBLE) or (VTYPE=TT_LONG) this variable is filled with a string equivalent of DVALUE. |
- C Example:
#include <stdlib.h>
#include <stdio.h>
#include <IPhreeqc.h>
int main(void)
{
int id, i, j;
id = CreateIPhreeqc();
if (id < 0) {
return EXIT_FAILURE;
}
if (LoadDatabase(id, "phreeqc.dat") != 0) {
OutputErrorString(id);
return EXIT_FAILURE;
}
if (RunFile(id, "ex2") != 0) {
OutputErrorString(id);
return EXIT_FAILURE;
}
VAR v;
VarInit(&v);
printf("selected-output:\n");
for (i = 0; i < GetSelectedOutputRowCount(id); ++i) {
for (j = 0; j < GetSelectedOutputColumnCount(id); ++j) {
if (GetSelectedOutputValue(id, i, j, &v) == VR_OK) {
switch (v.type) {
case TT_LONG:
printf("%ld ", v.lVal);
break;
case TT_DOUBLE:
printf("%g ", v.dVal);
break;
case TT_STRING:
printf("%s ", v.sVal);
break;
}
}
VarClear(&v);
}
printf("\n");
}
if (DestroyIPhreeqc(id)) {
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
- Fortran90 Example:
PROGRAM example
INCLUDE "IPhreeqc.f90.inc"
INTEGER(KIND=4) :: id
INTEGER(KIND=4) :: i
INTEGER(KIND=4) :: j
INTEGER(KIND=4) :: vt
REAL(KIND=8) :: dv
CHARACTER(LEN=40) :: sv
id = CreateIPhreeqc()
IF (id.LT.0) THEN
STOP
END IF
IF (LoadDatabase(id, "phreeqc.dat").NE.0) THEN
CALL OutputErrorString(id)
STOP
END IF
IF (RunFile(id, "ex2").NE.0) THEN
CALL OutputErrorString(id)
STOP
END IF
WRITE(*,*) "selected-output:"
DO i=0,GetSelectedOutputRowCount(id)
DO j=1,GetSelectedOutputColumnCount(id)
IF (GetSelectedOutputValue(id, i, j, vt, dv, sv).EQ.IPQ_OK) THEN
IF (vt.EQ.TT_DOUBLE) THEN
WRITE(*,"(g12.6,A1)",ADVANCE="NO") dv, " "
ELSE IF (vt.EQ.TT_STRING) THEN
WRITE(*,"(A12,A1)",ADVANCE="NO") sv, " "
END IF
END IF
END DO
WRITE(*,*)
END DO
IF (DestroyIPhreeqc(id).NE.IPQ_OK) THEN
STOP
END IF
END PROGRAM example
| const char* GetWarningString |
( |
int |
id | ) |
|
| const char* GetWarningStringLine |
( |
int |
id, |
|
|
int |
n |
|
) |
| |
Retrieves the given warning line.
- Parameters:
-
| id | The instance id returned from CreateIPhreeqc. |
| n | The zero-based index of the line to retrieve. |
- Returns:
- A null terminated string containing the given warning line message.
- See also:
- GetWarningString, GetWarningStringLineCount, OutputWarningString
- Fortran90 Interface:
- (Note: N is one-based for the Fortran interface.)
SUBROUTINE GetWarningStringLine(ID,N,LINE)
INTEGER(KIND=4), INTENT(IN) :: ID
LOGICAL(KIND=4), INTENT(IN) :: N
CHARACTER(LEN=*), INTENT(OUT) :: LINE
END SUBROUTINE GetWarningStringLine
| int GetWarningStringLineCount |
( |
int |
id | ) |
|
Retrieves the number of lines in the current warning string buffer.
- Parameters:
-
- Returns:
- The number of lines.
- See also:
- GetWarningString, GetWarningStringLine, OutputWarningString
- Fortran90 Interface:
-
FUNCTION GetWarningStringLineCount(ID)
INTEGER(KIND=4), INTENT(IN) :: ID
INTEGER(KIND=4) :: GetWarningStringLineCount
END FUNCTION GetWarningStringLineCount
| int LoadDatabase |
( |
int |
id, |
|
|
const char * |
filename |
|
) |
| |
Load the specified database file into phreeqc.
- Parameters:
-
| id | The instance id returned from CreateIPhreeqc. |
| filename | The name of the phreeqc database to load. The full path (or relative path with respect to the working directory) must be given if the file is not in the current working directory. |
- Returns:
- The number of errors encountered.
- See also:
- LoadDatabaseString
- Fortran90 Interface:
-
FUNCTION LoadDatabase(ID,FILENAME)
INTEGER(KIND=4), INTENT(IN) :: ID
CHARACTER(LEN=*), INTENT(IN) :: FILENAME
INTEGER(KIND=4) :: LoadDatabase
END FUNCTION LoadDatabase
- C Example:
- see CreateIPhreeqc
- Fortran90 Example:
- see CreateIPhreeqc
| int LoadDatabaseString |
( |
int |
id, |
|
|
const char * |
input |
|
) |
| |
Load the specified string as a database into phreeqc.
- Parameters:
-
| id | The instance id returned from CreateIPhreeqc. |
| input | String containing data to be used as the phreeqc database. |
- Returns:
- The number of errors encountered.
- See also:
- LoadDatabase
- Fortran90 Interface:
-
FUNCTION LoadDatabaseString(ID,INPUT)
INTEGER(KIND=4), INTENT(IN) :: ID
CHARACTER(LEN=*), INTENT(IN) :: INPUT
INTEGER(KIND=4) :: LoadDatabaseString
END FUNCTION LoadDatabaseString
| void OutputAccumulatedLines |
( |
int |
id | ) |
|
| void OutputErrorString |
( |
int |
id | ) |
|
| void OutputWarningString |
( |
int |
id | ) |
|
| int RunAccumulated |
( |
int |
id | ) |
|
| int RunFile |
( |
int |
id, |
|
|
const char * |
filename |
|
) |
| |
Runs the specified phreeqc input file.
- Parameters:
-
| id | The instance id returned from CreateIPhreeqc. |
| filename | The name of the phreeqc input file to run. |
- Returns:
- The number of errors encountered during the run.
- See also:
- RunAccumulated, RunString
- Precondition:
- LoadDatabase/LoadDatabaseString must have been called and returned 0 (zero) errors.
- Fortran90 Interface:
-
FUNCTION RunFile(ID,FNAME)
INTEGER(KIND=4), INTENT(IN) :: ID
CHARACTER(LEN=*), INTENT(IN) :: FNAME
INTEGER(KIND=4) :: RunFile
END FUNCTION RunFile
- C Example:
- see CreateIPhreeqc
- Fortran90 Example:
- see CreateIPhreeqc
| int RunString |
( |
int |
id, |
|
|
const char * |
input |
|
) |
| |
Runs the specified string as input to phreeqc.
- Parameters:
-
| id | The instance id returned from CreateIPhreeqc. |
| input | String containing phreeqc input. |
- Returns:
- The number of errors encountered during the run.
- See also:
- RunAccumulated, RunFile
- Precondition:
- LoadDatabase/LoadDatabaseString must have been called and returned 0 (zero) errors.
- Fortran90 Interface:
-
FUNCTION RunString(ID,INPUT)
INTEGER(KIND=4), INTENT(IN) :: ID
CHARACTER(LEN=*), INTENT(IN) :: INPUT
INTEGER(KIND=4) :: RunString
END FUNCTION RunString
- C Example:
- see GetDumpString
Sets the dump file switch on or off. This switch controls whether or not phreeqc writes to the dump file. The initial setting after calling CreateIPhreeqc is off.
- Parameters:
-
| id | The instance id returned from CreateIPhreeqc. |
| dump_on | If non-zero, turns on output to the DUMP (dump.out if unspecified) file; if zero, turns off output to the DUMP file. |
- Return values:
-
| IPQ_OK | Success. |
| IPQ_BADINSTANCE | The given id is invalid. |
- See also:
- GetDumpFileOn, GetDumpString, GetDumpStringLine, GetDumpStringOn, GetDumpStringLineCount, SetDumpStringOn
- Fortran90 Interface:
-
FUNCTION SetDumpFileOn(ID,DUMP_ON)
INTEGER(KIND=4), INTENT(IN) :: ID
LOGICAL(KIND=4), INTENT(IN) :: DUMP_ON
INTEGER(KIND=4) :: SetDumpFileOn
END FUNCTION SetDumpFileOn
| IPQ_RESULT SetDumpStringOn |
( |
int |
id, |
|
|
int |
dump_string_on |
|
) |
| |
Sets the dump string switch on or off. This switch controls whether or not the data normally sent to the dump file are stored in a buffer for retrieval. The initial setting after calling CreateIPhreeqc is off.
- Parameters:
-
| id | The instance id returned from CreateIPhreeqc. |
| dump_string_on | If non-zero, captures the output defined by the DUMP keyword into a string buffer; if zero, output defined by the DUMP keyword is not captured to a string buffer. |
- Return values:
-
| IPQ_OK | Success. |
| IPQ_BADINSTANCE | The given id is invalid. |
- See also:
- GetDumpFileOn, GetDumpStringOn, GetDumpString, GetDumpStringLine, GetDumpStringLineCount, SetDumpFileOn
- Fortran90 Interface:
-
FUNCTION SetDumpStringOn(ID,DUMP_STRING_ON)
INTEGER(KIND=4), INTENT(IN) :: ID
LOGICAL(KIND=4), INTENT(IN) :: DUMP_STRING_ON
INTEGER(KIND=4) :: SetDumpStringOn
END FUNCTION SetDumpStringOn
- C Example:
- see GetDumpString
- Fortran90 Example:
- see GetDumpStringLine
| IPQ_RESULT SetErrorFileOn |
( |
int |
id, |
|
|
int |
error_on |
|
) |
| |
Sets the error file switch on or off. This switch controls whether or not error messages are written to the phreeqc.err file. The initial setting after calling CreateIPhreeqc is off.
- Parameters:
-
| id | The instance id returned from CreateIPhreeqc. |
| error_on | If non-zero, writes errors to the error file; if zero, no errors are written to the error file. |
- Return values:
-
| IPQ_OK | Success. |
| IPQ_BADINSTANCE | The given id is invalid. |
- See also:
- GetErrorFileOn, GetErrorStringLine, GetErrorStringLineCount, OutputErrorString
- Fortran90 Interface:
-
FUNCTION SetErrorFileOn(ID,ERR_ON)
INTEGER(KIND=4), INTENT(IN) :: ID
LOGICAL(KIND=4), INTENT(IN) :: ERR_ON
INTEGER(KIND=4) :: SetErrorFileOn
END FUNCTION SetErrorFileOn
Sets the log file switch on or off. This switch controls whether or not phreeqc writes log messages to the phreeqc.log file. The initial setting after calling CreateIPhreeqc is off.
- Parameters:
-
| id | The instance id returned from CreateIPhreeqc. |
| log_on | If non-zero, log messages are written to the log file; if zero, no log messages are written to the log file. |
- Return values:
-
| IPQ_OK | Success. |
| IPQ_BADINSTANCE | The given id is invalid. |
- See also:
- GetLogFileOn
- Fortran90 Interface:
-
FUNCTION SetLogFileOn(ID,LOG_ON)
INTEGER(KIND=4), INTENT(IN) :: ID
LOGICAL(KIND=4), INTENT(IN) :: LOG_ON
INTEGER(KIND=4) :: SetLogFileOn
END FUNCTION SetLogFileOn
| IPQ_RESULT SetOutputFileOn |
( |
int |
id, |
|
|
int |
output_on |
|
) |
| |
Sets the output file switch on or off. This switch controls whether or not phreeqc writes to the phreeqc.out file. This is the output normally generated when phreeqc is run. The initial setting after calling CreateIPhreeqc is off.
- Parameters:
-
| id | The instance id returned from CreateIPhreeqc. |
| output_on | If non-zero, writes output to the output file; if zero, no output is written to the output file. |
- Return values:
-
| IPQ_OK | Success. |
| IPQ_BADINSTANCE | The given id is invalid. |
- See also:
- GetOutputFileOn
- Fortran90 Interface:
-
FUNCTION SetOutputFileOn(ID,OUT_ON)
INTEGER(KIND=4), INTENT(IN) :: ID
LOGICAL(KIND=4), INTENT(IN) :: OUT_ON
INTEGER(KIND=4) :: SetOutputFileOn
END FUNCTION SetOutputFileOn
| IPQ_RESULT SetSelectedOutputFileOn |
( |
int |
id, |
|
|
int |
sel_on |
|
) |
| |
Sets the selected-output file switch on or off. This switch controls whether or not phreeqc writes output to the SELECTED_OUTPUT (selected.out if unspecified) file. The initial setting after calling CreateIPhreeqc is off.
- Parameters:
-
| id | The instance id returned from CreateIPhreeqc. |
| sel_on | If non-zero, writes output to the selected-output file; if zero, no output is written to the selected-output file. |
- Return values:
-
| IPQ_OK | Success. |
| IPQ_BADINSTANCE | The given id is invalid. |
- See also:
- GetSelectedOutputFileOn, GetSelectedOutputColumnCount, GetSelectedOutputRowCount, GetSelectedOutputValue
- Fortran90 Interface:
-
FUNCTION SetSelectedOutputFileOn(ID,SEL_ON)
INTEGER(KIND=4), INTENT(IN) :: ID
LOGICAL(KIND=4), INTENT(IN) :: SEL_ON
INTEGER(KIND=4) :: SetSelectedOutputFileOn
END FUNCTION SetSelectedOutputFileOn