Conceptual Models > Program coupling

Selected Output

(1/3) > >>

GeeqC:
I noticed that the selected output function no longer works if BMIPhreeqcRM is used instead of PhreeqcRM. This means that the user punch cannot be retrieved anymore.

Or is there a way that I can still get the selected output in BMIPhreeqcRM?

dlparkhurst:
Does it work with the test cases?

GeeqC:
Indeed, it works with the test cases. And also with my own code I get a selected output. But there, only a default selection of parameters appears. It seems the pre-defined selected output does not work anymore in BMIPhreeqcRM:

oss << "SELECTED_OUTPUT 1" << "\n";
    oss << "-user_punch true " << "\n";
    oss << "-temperature true " << "\n";
    oss << "-pH true " << "\n";
    oss << "-alkalinity true " << "\n";
... etc.

In the examples I can see that individual parameters are read by "GetValue". But is there still an option to pre-define the selected output (sel)?

dlparkhurst:
The test case AdvectBMI_cpp.cpp shows how to extract all of the selected output data. The key method is below, but the example shows how to cycle through all selected output definitions.


--- Code: ---// Get selected output
std::vector<double> so;
brm.GetValue("SelectedOutput", so);

--- End code ---

SELECTED_OUTPUT 1 is defined in advect.bmi. The results for cell 19 are found near the end of the output file AdvectBMI_cpp.chem.txt.


--- Code: ---Cell number 19
     Calculated Density: 0.99832
     Calculated Volume:  0.199758
     Components:
          0 H: 110.679
          1 O: 55.3438
          2 Charge: -3.37139e-16
          3 Ca: 0
          4 Cl: 0
          5 K: 0.000196302
          6 N: 0.0011964
          7 Na: 0.0010001
     Selected output:
          0 Na(mol/kgw): 0.00100311
          1 Cl(mol/kgw): 0
          2 K(mol/kgw): 0.000196893
          3 Ca(mol/kgw): 0
          4 Temperature: 20
          5 Pressure: 2
          6 Hyd_K: 0

--- End code ---

GeeqC:
The example AdvectBMI_cpp.cpp does not show explicitly how the selected output parameters are pre-defined. Specific parameters are extracted by GetValue. But the AddOutputVars function is inactivated. The parameters that are saved in the SelectedOutput variable "so" seem to default to some standard parameters.

It seems this works fundamentally different in BMIPhreeqcRM than in PhreeqcRM.

Navigation

[0] Message Index

[#] Next page

Go to full version