input = "SELECTED_OUTPUT 1" // new_line(c) input = input // "-RESET FALSE" // new_line(c) input = input // "-high_precision" // new_line(c) input = input // "-user_punch" //new_line(c) input = input // 'USER_PUNCH 1'// new_line(c) DO I = 1, NELET input = input // '-Heading '//STR_ELEMENT (I)// new_line(c) ENDDO DO I = 1, NPRINTG input = input // '-Heading '//STR_PRINTG(I) // new_line(c) ENDDO DO I=1, NO_HC_GC input = input //'-Heading DELTA_'// TRIM(ADJUSTL(NAME_HC_GC(I))) // new_line(c) input = input //'-Heading SI_'//TRIM(ADJUSTL(NAME_HC_GC(I))) // new_line(c) END DO ! input = input // '-Heading Charge' // new_line(c) input = input // '-Heading Total_H' // new_line(c) input = input // '-Heading Total_O' // new_line(c) DO I=1,NELET CTR_INT = (I)*10 WRITE(CTR_STR,*) CTR_INT input = input // CTR_STR//' PUNCH TOTMOLE("'//TRIM(STR_ELEMENT (I))//'")' //new_line(c) END DO !! ------- DO I=1, NPRINTG CTR_INT=(NELET+I)*10 WRITE(CTR_STR,*) CTR_INT input = input // CTR_STR //' PUNCH '//TRIM(STR_PRINTG(I)) //new_line(c) END DO ! DO I=1, NO_HC_GC CTR_INT=(NELET+NPRINTG+2*I-1)*10 WRITE(CTR_STR,*) CTR_INT WRITE(DUMMY_STR,*) 1000.0d0 input = input // CTR_STR //' PUNCH EQUI_DELTA("'//TRIM(ADJUSTL(NAME_HC_GC(I)))//'")/'//TRIM(ADJUSTL(DUMMY_STR)) //new_line(c) CTR_INT=(NELET+NPRINTG+2*I)*10 WRITE(CTR_STR,*) CTR_INT input = input // CTR_STR//' PUNCH SI("'//TRIM(ADJUSTL(NAME_HC_GC(I)))//'")'//new_line(c) END DO !! ---- CHARGE BALANCE STARTING_EXTRA = 0 ctr_int=(NELET+NPRINTG+2*NO_HC_GC+ STARTING_EXTRA+1)* 10 WRITE(CTR_STR,*) CTR_INT input = input //CTR_STR//' PUNCH CHARGE_BALANCE' //new_line(c) ! ! C_total_H ---- ctr_int=(NELET+NPRINTG+2*NO_HC_GC+STARTING_EXTRA+2)* 10 WRITE(CTR_STR,*) CTR_INT input = input //CTR_STR//' PUNCH TOTMOLE("H")' //new_line(c) ! OR TOT ! !C_total_O ---- ctr_int=(NELET+NPRINTG+2*NO_HC_GC+ STARTING_EXTRA+3)* 10 WRITE(CTR_STR,*) CTR_INT input = input //CTR_STR//' PUNCH TOTMOLE("O")' //new_line(c) ! OR TOT input = input // 'END' //new_line(c) input = input // 'KNOBS' //new_line(c) input = input // '-convergence_tolerance 1E-8' //new_line(c) Ierr = RM_RunString(ID_PHREEQC, 1, 1, 1, input) !write(*,'(a)') input
SELECTED_OUTPUT 1-RESET FALSE-high_precision-user_punchUSER_PUNCH 1-Heading Ca-Heading Cl-Heading K-Heading N-Heading Na-Heading TOT("O")-Heading TOT("H")-Heading TOT("K")-Heading TOT("Na")-Heading -LA("H+")-Heading MOL("CaOH+")-Heading MOL("NaOH")-Heading MOL("KOH")-Heading MOL("H2O")-Heading Charge-Heading Total_H-Heading Total_O 10 PUNCH TOTMOLE("Ca") 20 PUNCH TOTMOLE("Cl") 30 PUNCH TOTMOLE("K") 40 PUNCH TOTMOLE("N") 50 PUNCH TOTMOLE("Na") 60 PUNCH TOT("O") 70 PUNCH TOT("H") 80 PUNCH TOT("K") 90 PUNCH TOT("Na") 100 PUNCH -LA("H+") 110 PUNCH MOL("CaOH+") 120 PUNCH MOL("NaOH") 130 PUNCH MOL("KOH") 140 PUNCH MOL("H2O") 150 PUNCH CHARGE_BALANCE 160 PUNCH TOTMOLE("H") 170 PUNCH TOTMOLE("O")ENDKNOBS-convergence_tolerance 1E-8
ERROR: Invalid argument.ERROR: Selected output not found.ERROR: Invalid argument.ERROR: PhreeqcRM::GetSelectedOutputColumnCount
Ierr = RM_SetSelectedOutputOn(Id_phreeqc_injection, 1)
SELECTED_OUTPUT 1-RESET FALSE-high_precisionUSER_PUNCH 1-Heading Ca-Heading Cl-Heading K-Heading N-Heading Na-Heading Charge-Heading Total_H-Heading Total_O 10 PUNCH TOTMOLE("Ca") 20 PUNCH TOTMOLE("Cl") 30 PUNCH TOTMOLE("K") 40 PUNCH TOTMOLE("N") 50 PUNCH TOTMOLE("Na") 60 PUNCH CHARGE_BALANCE 70 PUNCH TOTMOLE("H") 80 PUNCH TOTMOLE("O")ENDKNOBS-convergence_tolerance 1E-8RUN_CELLS; -CELLS 0 ;END
Ierr=RM_SetCurrentSelectedOutputUserNumber(Id_phreeqc_injection,1)WRITE(DUMMY_STR,*) Kinput3 = input3 //'RUN_CELLS; -CELLS '//DUMMY_STR// ';END'//new_line(cc)Ierr = RM_RunString(Id_phreeqc_injection,1, 1, 1, input3)! Ierr = RM_RunCells(Id_phreeqc_injection)N_COLUMN = RM_GetSelectedOutputColumnCount(Id_phreeqc_injection)N_ROW = RM_GetSelectedOutputRowCount(Id_phreeqc_injection)
GLOB_TIME 0 Cell number 1 Concentrations: 1 H: 110.6821 2 O: 55.3416 3 Charge: -0.0000 4 Ca: 0.0006 5 Cl: 0.0012 6 K: 0.0000 7 N: 0.0000 8 Na: 0.0000 Selected output: 1 Ca: 5.9821E-05 2 Cl: 1.1964E-04 3 K: 0.0000E+00 4 N: 0.0000E+00 5 Na: 0.0000E+00 6 Charge: -7.2835E-13 7 Total_H: 1.1068E+01 8 Total_O: 5.5342E+00The correct Selected output should be: GLOB_TIME 0 Cell number 1 Selected output: 1 : 6.0000E-04 2 : 1.2000E-03 3 : 0.0000E+00 4 : 0.0000E+00 5 : 0.0000E+00 6 : 4.9738E-16 7 : 1.1101E+02 8 : 5.5507E+01
nlines = 50 nlines = nlines + NELET nlines = nlines + NELET allocate (character(len=nlines * 100)::input3) input3 = 'SOLUTION_SPECIES;H2O + 0.01e- = H2O-0.01; log_k -9' // new_line(cc) input3 = input3 // "SELECTED_OUTPUT 1" // new_line(cc) input3 = input3 // "-RESET FALSE" // new_line(cc) input3 = input3 // "-high_precision" // new_line(cc) input3 = input3 // 'USER_PUNCH 1'// new_line(cc) DO I = 1, NELET input3 = input3 // '-Heading '//STR_ELEMENT (I)// new_line(cc) ENDDO ! input3 = input3 // '-Heading Charge' // new_line(cc) input3 = input3 // '-Heading Total_H' // new_line(cc) input3 = input3 // '-Heading Total_O' // new_line(cc) starting_extra=0 DO I=1, NELET ctr_int=(starting_extra+I)* 10 WRITE(CTR_STR,*) CTR_INT input3 = input3 //CTR_STR//' PUNCH TOTMOLE("'//TRIM(STR_ELEMENT (I))//'")'// new_line(cc) END DO ctr_int=(NELET+starting_extra+1)* 10 WRITE(CTR_STR,*) CTR_INT input3 = input3 //CTR_STR //' PUNCH CHARGE_BALANCE' // new_line(cc) !C_total_H ---- ctr_int=(NELET+starting_extra+2)* 10 WRITE(CTR_STR,*) CTR_INT input3 = input3 //CTR_STR //' PUNCH TOTMOLE("H")'// new_line(cc) ! OR TOT !C_total_O ---- ctr_int=(NELET+starting_extra+3)* 10 WRITE(CTR_STR,*) CTR_INT input3 = input3 //CTR_STR //' PUNCH TOTMOLE("O")'// new_line(cc) ! OR TOT input3 = input3 // 'END' // new_line(cc) input3 = input3 // 'KNOBS' // new_line(cc) input3 = input3 // '-convergence_tolerance 1E-8'// new_line(cc) !! SET TO DEFAULT Ierr = RM_RunString(Id_phreeqc_injection, 1, 1, 0, input3)
Ierr=RM_SetCurrentSelectedOutputUserNumber(Id_phreeqc_injection, 1) Ierr = RM_RunCells(Id_phreeqc_injection) Ierr = RM_GetConcentrations(Id_phreeqc_injection, concent_injet) N_COLUMN = RM_GetSelectedOutputColumnCount(Id_phreeqc_injection) N_ROW = RM_GetSelectedOutputRowCount(Id_phreeqc_injection) ALLOCATE(VECTOR_IPHREEQC_TEMP(1:N_ROW,1:N_COLUMN)) VECTOR_IPHREEQC_TEMP = 0.0D0 Ierr = RM_GetSelectedOutput(Id_phreeqc_injection, VECTOR_IPHREEQC_TEMP)
integer function RM_RunString ( integer, intent(in) id,integer, intent(in) initial_phreeqc,integer, intent(in) workers,integer, intent(in) utility,character(len=*), intent(in) input_string )
Fortran Example: string = "DELETE; -all" status = RM_RunString(id, 1, 0, 1, string) ! workers, initial_phreeqc, utility
Estimated efficiency of chemistry without communication: 99.1209 Cells shifted between threads 0 Time rebalancing load 2.7895e-05 Estimated efficiency of chemistry without communication: 99.2936 Cells shifted between threads 0 Time rebalancing load 3.8147e-05 Estimated efficiency of chemistry without communication: 99.0095 Cells shifted between threads 0 Time rebalancing load 2.81334e-05 Estimated efficiency of chemistry without communication: 98.7377 Cells shifted between threads 0 Time rebalancing load 3.00407e-05 Estimated efficiency of chemistry without communication: 98.781 Cells shifted between threads 0 Time rebalancing load 2.69413e-05 Estimated efficiency of chemistry without communication: 98.7068 Cells shifted between threads 0 Time rebalancing load 3.8147e-05 Estimated efficiency of chemistry without communication: 99.0646 Cells shifted between threads 0 Time rebalancing load 4.60148e-05
OPENMPPHREEQC = -qopenmp -I$(MKLROOT)/include$(FC) $(FAST) $(OPENMPPHREEQC) $? -c -module $(MOD) -o $@