mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-15 16:18:22 +01:00
Merge commit '05d97e8baf75ee7adbef8da4511ae9b4e3e0b9df'
This commit is contained in:
commit
116b83a352
2
CVar.hxx
2
CVar.hxx
@ -12,7 +12,7 @@ public:
|
||||
{
|
||||
::VarInit(this);
|
||||
}
|
||||
~CVar(void) throw()
|
||||
~CVar(void) //throw()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
@ -1672,9 +1672,9 @@ Headings
|
||||
* FUNCTION SetBasicFortranCallback(ID,FCN)
|
||||
* INTEGER(KIND=4), INTENT(IN) :: ID
|
||||
* INTERFACE
|
||||
* DOUBLE PRECISION FUNCTION FCN(x1, x2, str)
|
||||
* DOUBLE PRECISION, INTENT(in) :: x1
|
||||
* DOUBLE PRECISION, INTENT(in) :: x2
|
||||
* real(kind=8) FUNCTION FCN(x1, x2, str)
|
||||
* real(kind=8), INTENT(in) :: x1
|
||||
* real(kind=8), INTENT(in) :: x2
|
||||
* CHARACTER(*), INTENT(in) :: str
|
||||
* END FUNCTION
|
||||
* END INTERFACE
|
||||
|
||||
@ -713,7 +713,7 @@ public:
|
||||
* Sets a Fortran callback function for Basic programs. The syntax for the Basic command is
|
||||
* 10 result = CALLBACK(x1, x2, string$)
|
||||
* The syntax for the Fortran function is
|
||||
* double precision my_callback(x1, x2, string), where x1 and x2 are double precision and string is a character variable.
|
||||
* real(kind=8) my_callback(x1, x2, string), where x1 and x2 are real(kind=8) and string is a character variable.
|
||||
* @param fcn The name of a user-defined function.
|
||||
* @see SetBasicCallback
|
||||
*/
|
||||
|
||||
@ -688,7 +688,7 @@ INTEGER FUNCTION GetSelectedOutputValue(id, row, col, vtype, dvalue, svalue, sle
|
||||
END INTERFACE
|
||||
INTEGER, INTENT(in) :: id, row, col
|
||||
INTEGER, INTENT(out) :: vtype
|
||||
DOUBLE PRECISION, INTENT(out) :: dvalue
|
||||
real(kind=8), INTENT(out) :: dvalue
|
||||
CHARACTER(len=*), INTENT(out) :: svalue
|
||||
INTEGER, INTENT(out), OPTIONAL :: slength
|
||||
INTEGER :: sz, sz_fortran
|
||||
@ -898,9 +898,9 @@ INTEGER FUNCTION SetBasicFortranCallback(id, fcn)
|
||||
IMPLICIT NONE
|
||||
INTEGER, INTENT(in) :: id
|
||||
INTERFACE
|
||||
DOUBLE PRECISION FUNCTION fcn(x1, x2, str, l)
|
||||
real(kind=8) FUNCTION fcn(x1, x2, str, l)
|
||||
INTEGER, INTENT(in) :: l
|
||||
DOUBLE PRECISION, INTENT(in) :: x1, x2
|
||||
real(kind=8), INTENT(in) :: x1, x2
|
||||
CHARACTER, INTENT(in) :: str(*)
|
||||
END FUNCTION fcn
|
||||
END INTERFACE
|
||||
@ -908,9 +908,9 @@ INTEGER FUNCTION SetBasicFortranCallback(id, fcn)
|
||||
END INTERFACE
|
||||
INTEGER, INTENT(in) :: id
|
||||
INTERFACE
|
||||
DOUBLE PRECISION FUNCTION fcn(x1, x2, str, l)
|
||||
real(kind=8) FUNCTION fcn(x1, x2, str, l)
|
||||
INTEGER, INTENT(in) :: l
|
||||
DOUBLE PRECISION, INTENT(in) :: x1, x2
|
||||
real(kind=8), INTENT(in) :: x1, x2
|
||||
CHARACTER, INTENT(in) :: str(*)
|
||||
END FUNCTION fcn
|
||||
END INTERFACE
|
||||
|
||||
@ -142,7 +142,7 @@ cl1(int k, int l, int m, int n,
|
||||
/* AT LEAST NKLMD COLUMNS USED FOR WORKSPACE. */
|
||||
/* S INTEGER ARRAY OF SIZE AT LEAST KLMD, USED FOR */
|
||||
/* WORKSPACE. */
|
||||
/* DOUBLE PRECISION DBLE */
|
||||
/* real(kind=8) DBLE */
|
||||
/* REAL */
|
||||
|
||||
/* INITIALIZATION. */
|
||||
|
||||
@ -624,7 +624,6 @@ int Phreeqc::
|
||||
calc_fixed_volume_gas_pressures(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int n_g = 0;
|
||||
LDBLE lp;
|
||||
class rxn_token *rxn_ptr;
|
||||
class phase *phase_ptr;
|
||||
@ -645,7 +644,6 @@ calc_fixed_volume_gas_pressures(void)
|
||||
{
|
||||
if (!PR && phase_ptr->t_c > 0 && phase_ptr->p_c > 0)
|
||||
PR = true;
|
||||
n_g++;
|
||||
}
|
||||
gas_phase_ptr->Set_total_moles(gas_phase_ptr->Get_total_moles() + gas_unknowns[i]->moles);
|
||||
}
|
||||
|
||||
@ -2543,7 +2543,6 @@ int Phreeqc::
|
||||
calc_gas_pressures(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int n_g = 0;
|
||||
LDBLE lp, V_m = 0;
|
||||
class rxn_token *rxn_ptr;
|
||||
std::vector<class phase *> phase_ptrs;
|
||||
@ -2576,7 +2575,6 @@ calc_gas_pressures(void)
|
||||
phase_ptrs.push_back(phase_ptr);
|
||||
if (!PR && phase_ptr->t_c > 0 && phase_ptr->p_c > 0)
|
||||
PR = true;
|
||||
n_g++;
|
||||
}
|
||||
if (iterations > 2 && gas_phase_ptr->Get_type() == cxxGasPhase::GP_VOLUME)
|
||||
{
|
||||
@ -3778,7 +3776,6 @@ residuals(void)
|
||||
int converge;
|
||||
|
||||
LDBLE l_toler;
|
||||
LDBLE sum_residual;
|
||||
LDBLE sinh_constant;
|
||||
LDBLE sum, sum1;
|
||||
class master *master_ptr, *master_ptr1, *master_ptr2;
|
||||
@ -3786,7 +3783,6 @@ residuals(void)
|
||||
int print_fail;
|
||||
std::vector<LDBLE> cd_psi;
|
||||
print_fail = FALSE;
|
||||
sum_residual = 0.0;
|
||||
sigmaddl = 0;
|
||||
sum = 0;
|
||||
/*
|
||||
@ -4530,7 +4526,6 @@ residuals(void)
|
||||
* Store residuals in array
|
||||
*/
|
||||
my_array[((size_t)i + 1) * (count_unknowns + 1) - 1] = residual[i];
|
||||
sum_residual += fabs(residual[i]);
|
||||
}
|
||||
/*
|
||||
* Return
|
||||
|
||||
@ -52,7 +52,7 @@ pitzer_tidy(void)
|
||||
const char *string1, *string2;
|
||||
int i, j, order;
|
||||
int i0, i1, i2;
|
||||
int count_pos, count_neg, count_neut, count[3], jj;
|
||||
int count_neut, count[3], jj;
|
||||
LDBLE z0, z1;
|
||||
class pitz_param *pzp_ptr;
|
||||
class theta_param *theta_param_ptr;
|
||||
@ -339,21 +339,21 @@ pitzer_tidy(void)
|
||||
i0 = pitz_params[i]->ispec[0];
|
||||
i1 = pitz_params[i]->ispec[1];
|
||||
i2 = pitz_params[i]->ispec[2];
|
||||
count_pos = count_neg = count_neut = 0;
|
||||
count_neut = 0;
|
||||
for (j = 0; j <= 2; j++)
|
||||
{
|
||||
if (spec[pitz_params[i]->ispec[j]]->z > 0)
|
||||
{
|
||||
count_pos++;
|
||||
}
|
||||
//if (spec[pitz_params[i]->ispec[j]]->z > 0)
|
||||
//{
|
||||
// count_pos++;
|
||||
//}
|
||||
if (spec[pitz_params[i]->ispec[j]]->z == 0)
|
||||
{
|
||||
count_neut++;
|
||||
}
|
||||
if (spec[pitz_params[i]->ispec[j]]->z < 0)
|
||||
{
|
||||
count_neg++;
|
||||
}
|
||||
//if (spec[pitz_params[i]->ispec[j]]->z < 0)
|
||||
//{
|
||||
// count_neg++;
|
||||
//}
|
||||
}
|
||||
/* All neutral */
|
||||
if (count_neut == 3)
|
||||
|
||||
@ -1980,14 +1980,13 @@ get_list_master_ptrs(const char* cptr, class master *master_ptr)
|
||||
* Output: space is allocated and a list of master species pointers is
|
||||
* returned.
|
||||
*/
|
||||
int j, l, count_list;
|
||||
int j, l;
|
||||
char token[MAX_LENGTH];
|
||||
std::vector<class master*> master_ptr_list;
|
||||
class master *master_ptr0;
|
||||
/*
|
||||
* Make list of master species pointers
|
||||
*/
|
||||
count_list = 0;
|
||||
//master_ptr_list = unknown_alloc_master();
|
||||
master_ptr0 = master_ptr;
|
||||
if (master_ptr0 == master_ptr->s->primary)
|
||||
@ -2147,7 +2146,7 @@ mb_for_species_aq(int n)
|
||||
* by coef, usually moles.
|
||||
* mb_unknowns.coef - coefficient of s[n] in equation or relation
|
||||
*/
|
||||
int i, j;
|
||||
int i;
|
||||
class master *master_ptr;
|
||||
class unknown *unknown_ptr;
|
||||
|
||||
@ -2223,7 +2222,6 @@ mb_for_species_aq(int n)
|
||||
*/
|
||||
if (use.Get_surface_ptr() != NULL && s[n]->type < H2O && dl_type_x != cxxSurface::NO_DL)
|
||||
{
|
||||
j = 0;
|
||||
for (i = 0; i < count_unknowns; i++)
|
||||
{
|
||||
if (x[i]->type == SURFACE_CB)
|
||||
@ -2235,7 +2233,6 @@ mb_for_species_aq(int n)
|
||||
|
||||
store_mb_unknowns(unknown_ptr, s_diff_layer[n][charge_ptr->Get_name()].Get_g_moles_address(),
|
||||
s[n]->z, s_diff_layer[n][charge_ptr->Get_name()].Get_dg_g_moles_address());
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1141,7 +1141,7 @@ copy_token_tab(std::string& token, const char **cptr)
|
||||
* EOL,
|
||||
* UNKNOWN.
|
||||
*/
|
||||
int i, return_value;
|
||||
int return_value;
|
||||
char c;
|
||||
/*
|
||||
* Strip leading spaces
|
||||
@ -1180,7 +1180,6 @@ copy_token_tab(std::string& token, const char **cptr)
|
||||
/*
|
||||
* Begin copying to token
|
||||
*/
|
||||
i = 0;
|
||||
for (;;)
|
||||
{
|
||||
c = **cptr;
|
||||
@ -1197,7 +1196,6 @@ copy_token_tab(std::string& token, const char **cptr)
|
||||
{
|
||||
token.push_back(c);
|
||||
(*cptr)++;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
return (return_value);
|
||||
|
||||
@ -13,10 +13,10 @@
|
||||
* listed here work with the type realtype as defined in *
|
||||
* sundialstypes.h. *
|
||||
* To do single precision floating point arithmetic, set the type *
|
||||
* realtype to be float. To do double precision arithmetic, set *
|
||||
* realtype to be float. To do real(kind=8) arithmetic, set *
|
||||
* the type realtype to be double. The default implementations *
|
||||
* for RPowerR and RSqrt call standard math library functions *
|
||||
* which do double precision arithmetic. If this is unacceptable *
|
||||
* which do real(kind=8) arithmetic. If this is unacceptable *
|
||||
* when realtype is float, then the user should re-implement *
|
||||
* these two routines by calling single precision routines *
|
||||
* available on his/her machine. *
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
* The types for realtype and integertype below have been set to *
|
||||
* double and long int, respectively. A user should modify these *
|
||||
* type declarations as he/she sees fit. For example, if a user *
|
||||
* wants the work with type float because double precision *
|
||||
* wants the work with type float because real(kind=8) *
|
||||
* floating point arithmetic is too expensive on the user's *
|
||||
* machine, then the definition below should be changed to: *
|
||||
* *
|
||||
|
||||
@ -798,7 +798,6 @@ build_tally_table(void)
|
||||
*/
|
||||
int j, k, l, p, save_print_use;
|
||||
size_t n;
|
||||
int count_tt_pure_phase, count_tt_ss_phase, count_tt_kinetics;
|
||||
class phase *phase_ptr;
|
||||
char token[MAX_LENGTH];
|
||||
const char* cptr;
|
||||
@ -871,7 +870,6 @@ build_tally_table(void)
|
||||
/*
|
||||
* Count pure phases
|
||||
*/
|
||||
count_tt_pure_phase = 0;
|
||||
if (Rxn_pp_assemblage_map.size() > 0)
|
||||
{
|
||||
/*
|
||||
@ -904,7 +902,6 @@ build_tally_table(void)
|
||||
/*
|
||||
* Add to table
|
||||
*/
|
||||
count_tt_pure_phase++;
|
||||
n = count_tally_table_columns;
|
||||
extend_tally_table();
|
||||
tally_table[n].name = phase_ptr->name;
|
||||
@ -931,7 +928,6 @@ build_tally_table(void)
|
||||
/*
|
||||
* Add solid-solution pure phases
|
||||
*/
|
||||
count_tt_ss_phase = 0;
|
||||
if (Rxn_ss_assemblage_map.size() > 0)
|
||||
{
|
||||
/*
|
||||
@ -964,7 +960,6 @@ build_tally_table(void)
|
||||
/*
|
||||
* Add to table
|
||||
*/
|
||||
count_tt_ss_phase++;
|
||||
n = count_tally_table_columns;
|
||||
extend_tally_table();
|
||||
tally_table[n].name = phase_ptr->name;
|
||||
@ -982,7 +977,6 @@ build_tally_table(void)
|
||||
/*
|
||||
* Add kinetic reactants
|
||||
*/
|
||||
count_tt_kinetics = 0;
|
||||
if (Rxn_kinetics_map.size() > 0)
|
||||
{
|
||||
std::map<int, cxxKinetics>::iterator it;
|
||||
@ -1006,7 +1000,6 @@ build_tally_table(void)
|
||||
/*
|
||||
* Add to table
|
||||
*/
|
||||
count_tt_kinetics++;
|
||||
n = count_tally_table_columns;
|
||||
extend_tally_table();
|
||||
tally_table[n].name = string_hsave(kinetics_comp_ptr->Get_rate_name().c_str());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user