mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 08:38:23 +01:00
Used new gcc on srv2rcolkr.
Cleaned up all the const errors when using constant string in arguments to functions. removed ex1. Modified makefile to include/exclude cl1mp. git-svn-id: svn://136.177.114.72/svn_GW/phreeqcpp/trunk@2712 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
parent
b9520a207f
commit
25666df97c
@ -87,7 +87,8 @@ void cxxISolution::ConvertUnits()
|
|||||||
{
|
{
|
||||||
struct master *master_ptr = master_bsearch (iter->first);
|
struct master *master_ptr = master_bsearch (iter->first);
|
||||||
if (master_ptr != NULL && (master_ptr->minor_isotope == TRUE)) continue;
|
if (master_ptr != NULL && (master_ptr->minor_isotope == TRUE)) continue;
|
||||||
if (iter->second.get_description() == "H(1)" || iter->second.get_description() == "E") continue;
|
//if (iter->second.get_description() == "H(1)" || iter->second.get_description() == "E") continue;
|
||||||
|
if (strcmp(iter->second.get_description(),"H(1)") == 0 || strcmp(iter->second.get_description(), "E")) continue;
|
||||||
if (iter->second.get_input_conc() <= 0.0) continue;
|
if (iter->second.get_input_conc() <= 0.0) continue;
|
||||||
/*
|
/*
|
||||||
* Convert liters to kg solution
|
* Convert liters to kg solution
|
||||||
|
|||||||
@ -116,7 +116,8 @@ void cxxISolutionComp::set_gfw()
|
|||||||
input_error++;
|
input_error++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this->description == "Alkalinity" && this->as == "CaCO3")
|
//if (this->description == "Alkalinity" && this->as == "CaCO3")
|
||||||
|
if (strcmp(this->description,"Alkalinity") == 0 && strcmp(this->as, "CaCO3"))
|
||||||
{
|
{
|
||||||
gfw /= 2.;
|
gfw /= 2.;
|
||||||
}
|
}
|
||||||
|
|||||||
15
Makefile
15
Makefile
@ -24,6 +24,11 @@ endif
|
|||||||
|
|
||||||
all: release debug
|
all: release debug
|
||||||
|
|
||||||
|
Release: release
|
||||||
|
|
||||||
|
Debug: debug
|
||||||
|
|
||||||
|
|
||||||
RELEASE_DIR = Release
|
RELEASE_DIR = Release
|
||||||
DEBUG_DIR = Debug
|
DEBUG_DIR = Debug
|
||||||
MAKEFILE = Makefile
|
MAKEFILE = Makefile
|
||||||
@ -78,8 +83,10 @@ debug:
|
|||||||
# #define gmp for inverse modeling
|
# #define gmp for inverse modeling
|
||||||
# comment the following lines to remove multiprecision option
|
# comment the following lines to remove multiprecision option
|
||||||
DINVERSE_CL1MP=TRUE
|
DINVERSE_CL1MP=TRUE
|
||||||
CL1MP_LIB=/z/parkplace/usr/lib/libgmp.a
|
ifdef INVERSE_CL1MP
|
||||||
CL1MP_OBJS=cl1mp.o
|
DEFINE_INVERSE_CL1MP=-DINVERSE_CL1MP
|
||||||
|
CL1MP_OBJS=cl1mp.o
|
||||||
|
endif
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
#efence for debugging
|
#efence for debugging
|
||||||
@ -89,7 +96,7 @@ EFENCE_LIB=-L$(HOME)/packages/efence
|
|||||||
# 2 Versions
|
# 2 Versions
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
ifeq ($(CFG), RELEASE)
|
ifeq ($(CFG), RELEASE)
|
||||||
DEFINES = -DPHREEQC_CPP -DINVERSE_CL1MP
|
DEFINES = -DPHREEQC_CPP $(DEFINE_INVERSE_CL1MP)
|
||||||
VPATH = ..:../phreeqc
|
VPATH = ..:../phreeqc
|
||||||
INCLUDES = -I../phreeqc
|
INCLUDES = -I../phreeqc
|
||||||
CXX = g++
|
CXX = g++
|
||||||
@ -99,7 +106,7 @@ ifeq ($(CFG), RELEASE)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CFG), DEBUG)
|
ifeq ($(CFG), DEBUG)
|
||||||
DEFINES = -DPHREEQC_CPP -DINVERSE_CL1MP -DUSE_PHRQ_ALLOC
|
DEFINES = -DPHREEQC_CPP -DUSE_PHRQ_ALLOC $(DEFINE_INVERSE_CL1MP)
|
||||||
VPATH = ..:../phreeqc
|
VPATH = ..:../phreeqc
|
||||||
INCLUDES = -I../phreeqc
|
INCLUDES = -I../phreeqc
|
||||||
CXX = g++
|
CXX = g++
|
||||||
|
|||||||
@ -349,11 +349,14 @@ void cxxNameDouble::add_log_activities(const cxxNameDouble &addee, double f1, do
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cxxNameDouble::add(char * key, double total)
|
void cxxNameDouble::add(const char * token, double total)
|
||||||
//
|
//
|
||||||
// add to total for a specified element
|
// add to total for a specified element
|
||||||
//
|
//
|
||||||
{
|
{
|
||||||
|
char key[MAX_LENGTH];
|
||||||
|
strcpy(key, token);
|
||||||
|
|
||||||
cxxNameDouble::iterator current = (*this).find(key);
|
cxxNameDouble::iterator current = (*this).find(key);
|
||||||
if (current != (*this).end()) {
|
if (current != (*this).end()) {
|
||||||
(*this)[key] = current->second + total;
|
(*this)[key] = current->second + total;
|
||||||
|
|||||||
@ -48,7 +48,7 @@ public:
|
|||||||
void add_extensive(const cxxNameDouble &old, double factor);
|
void add_extensive(const cxxNameDouble &old, double factor);
|
||||||
void add_intensive(const cxxNameDouble &addee, double fthis, double f2);
|
void add_intensive(const cxxNameDouble &addee, double fthis, double f2);
|
||||||
void add_log_activities(const cxxNameDouble &addee, double fthis, double f2);
|
void add_log_activities(const cxxNameDouble &addee, double fthis, double f2);
|
||||||
void add(char * key, double total);
|
void add(const char * key, double total);
|
||||||
void multiply(double factor);
|
void multiply(double factor);
|
||||||
|
|
||||||
void insert(char *str, double d) {
|
void insert(char *str, double d) {
|
||||||
|
|||||||
10
System.cxx
10
System.cxx
@ -39,9 +39,13 @@ void cxxSystem::totalize(void)
|
|||||||
//add solution
|
//add solution
|
||||||
if (this->solution != NULL)
|
if (this->solution != NULL)
|
||||||
{
|
{
|
||||||
this->totals["O"] = this->solution->get_total_o();
|
char token[MAX_LENGTH];
|
||||||
this->totals["H"] = this->solution->get_total_h();
|
strcpy(token, "O");
|
||||||
this->totals["Charge"] = this->solution->get_cb();
|
this->totals[token] = this->solution->get_total_o();
|
||||||
|
strcpy(token, "H");
|
||||||
|
this->totals[token] = this->solution->get_total_h();
|
||||||
|
strcpy(token, "Charge");
|
||||||
|
this->totals[token] = this->solution->get_cb();
|
||||||
this->totals.add_extensive(this->solution->get_totals(), 1.0);
|
this->totals.add_extensive(this->solution->get_totals(), 1.0);
|
||||||
}
|
}
|
||||||
if (this->exchange != NULL)
|
if (this->exchange != NULL)
|
||||||
|
|||||||
77
ex1
77
ex1
@ -1,77 +0,0 @@
|
|||||||
PRINT
|
|
||||||
-status false
|
|
||||||
TITLE Example 1.--Add uranium and speciate seawater.
|
|
||||||
SOLUTION 1 SEAWATER FROM NORDSTROM ET AL. (1979)
|
|
||||||
units ppm
|
|
||||||
pH 8.22
|
|
||||||
pe 8.451
|
|
||||||
density 1.023
|
|
||||||
temp 25.0
|
|
||||||
redox O(0)/O(-2)
|
|
||||||
Ca 412.3
|
|
||||||
Mg 1291.8
|
|
||||||
Na 10768.0
|
|
||||||
K 399.1
|
|
||||||
Fe 0.002
|
|
||||||
Mn 0.0002 pe
|
|
||||||
Si 4.28
|
|
||||||
Cl 19353.0
|
|
||||||
Alkalinity 141.682 as HCO3
|
|
||||||
S(6) 2712.0
|
|
||||||
N(5) 0.29 gfw 62.0
|
|
||||||
N(-3) 0.03 as NH4
|
|
||||||
U 3.3 ppb N(5)/N(-3)
|
|
||||||
O(0) 1.0 O2(g) -0.7
|
|
||||||
12C 1 .1
|
|
||||||
SOLUTION_MASTER_SPECIES
|
|
||||||
U U+4 0.0 238.0290 238.0290
|
|
||||||
U(4) U+4 0.0 238.0290
|
|
||||||
U(5) UO2+ 0.0 238.0290
|
|
||||||
U(6) UO2+2 0.0 238.0290
|
|
||||||
SOLUTION_SPECIES
|
|
||||||
#primary master species for U
|
|
||||||
#is also secondary master species for U(4)
|
|
||||||
U+4 = U+4
|
|
||||||
log_k 0.0
|
|
||||||
U+4 + 4 H2O = U(OH)4 + 4 H+
|
|
||||||
log_k -8.538
|
|
||||||
delta_h 24.760 kcal
|
|
||||||
U+4 + 5 H2O = U(OH)5- + 5 H+
|
|
||||||
log_k -13.147
|
|
||||||
delta_h 27.580 kcal
|
|
||||||
#secondary master species for U(5)
|
|
||||||
U+4 + 2 H2O = UO2+ + 4 H+ + e-
|
|
||||||
log_k -6.432
|
|
||||||
delta_h 31.130 kcal
|
|
||||||
#secondary master species for U(6)
|
|
||||||
U+4 + 2 H2O = UO2+2 + 4 H+ + 2 e-
|
|
||||||
log_k -9.217
|
|
||||||
delta_h 34.430 kcal
|
|
||||||
UO2+2 + H2O = UO2OH+ + H+
|
|
||||||
log_k -5.782
|
|
||||||
delta_h 11.015 kcal
|
|
||||||
2UO2+2 + 2H2O = (UO2)2(OH)2+2 + 2H+
|
|
||||||
log_k -5.626
|
|
||||||
delta_h -36.04 kcal
|
|
||||||
3UO2+2 + 5H2O = (UO2)3(OH)5+ + 5H+
|
|
||||||
log_k -15.641
|
|
||||||
delta_h -44.27 kcal
|
|
||||||
UO2+2 + CO3-2 = UO2CO3
|
|
||||||
log_k 10.064
|
|
||||||
delta_h 0.84 kcal
|
|
||||||
UO2+2 + 2CO3-2 = UO2(CO3)2-2
|
|
||||||
log_k 16.977
|
|
||||||
delta_h 3.48 kcal
|
|
||||||
UO2+2 + 3CO3-2 = UO2(CO3)3-4
|
|
||||||
log_k 21.397
|
|
||||||
delta_h -8.78 kcal
|
|
||||||
PHASES
|
|
||||||
Uraninite
|
|
||||||
UO2 + 4 H+ = U+4 + 2 H2O
|
|
||||||
log_k -3.490
|
|
||||||
delta_h -18.630 kcal
|
|
||||||
END
|
|
||||||
USE solution 1
|
|
||||||
REACTION_TEMPERATURE
|
|
||||||
30
|
|
||||||
END
|
|
||||||
Loading…
x
Reference in New Issue
Block a user