mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 08:38:23 +01:00
vector isotope_ratio
This commit is contained in:
parent
76da4f89bc
commit
ba2601a32f
@ -980,9 +980,6 @@ void Phreeqc::init(void)
|
||||
* ---------------------------------------------------------------------- */
|
||||
initial_solution_isotopes = FALSE;
|
||||
calculate_value_hash_table = NULL;
|
||||
count_isotope_ratio = 0;
|
||||
isotope_ratio = 0;
|
||||
max_isotope_ratio = MAX_ELTS;
|
||||
isotope_ratio_hash_table = 0;
|
||||
count_isotope_alpha = 0;
|
||||
isotope_alpha = 0;
|
||||
@ -2308,7 +2305,7 @@ Phreeqc::InternalCopy(const Phreeqc *pSrc)
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < pSrc->count_isotope_ratio; i++)
|
||||
for (int i = 0; i < (int)pSrc->isotope_ratio.size(); i++)
|
||||
{
|
||||
struct isotope_ratio *isotope_ratio_ptr = isotope_ratio_store(pSrc->isotope_ratio[i]->name, FALSE);
|
||||
isotope_ratio_ptr->name = string_hsave(pSrc->isotope_ratio[i]->name);
|
||||
|
||||
@ -1729,9 +1729,7 @@ protected:
|
||||
int initial_solution_isotopes;
|
||||
std::vector<struct calculate_value*> calculate_value;
|
||||
HashTable *calculate_value_hash_table;
|
||||
int count_isotope_ratio;
|
||||
struct isotope_ratio **isotope_ratio;
|
||||
int max_isotope_ratio;
|
||||
std::vector<struct isotope_ratio*> isotope_ratio;
|
||||
HashTable *isotope_ratio_hash_table;
|
||||
int count_isotope_alpha;
|
||||
struct isotope_alpha **isotope_alpha;
|
||||
|
||||
@ -4011,7 +4011,7 @@ iso_value(const char *total_name)
|
||||
strcpy(token, "");
|
||||
strcpy(my_total_name, total_name);
|
||||
while (replace(" ","_",my_total_name));
|
||||
for (j = 0; j < count_isotope_ratio; j++)
|
||||
for (j = 0; j < (int)isotope_ratio.size(); j++)
|
||||
{
|
||||
if (isotope_ratio[j]->ratio == MISSING)
|
||||
continue;
|
||||
@ -4025,7 +4025,7 @@ iso_value(const char *total_name)
|
||||
strcat(token,"R(");
|
||||
strcat(token,my_total_name);
|
||||
strcat(token,")");
|
||||
for (j = 0; j < count_isotope_ratio; j++)
|
||||
for (j = 0; j < (int)isotope_ratio.size(); j++)
|
||||
{
|
||||
if (isotope_ratio[j]->ratio == MISSING)
|
||||
continue;
|
||||
@ -4047,7 +4047,7 @@ iso_unit(const char *total_name)
|
||||
strcpy(my_total_name, total_name);
|
||||
while (replace(" ","_",my_total_name));
|
||||
strcpy(unit, "unknown");
|
||||
for (j = 0; j < count_isotope_ratio; j++)
|
||||
for (j = 0; j < (int)isotope_ratio.size(); j++)
|
||||
{
|
||||
if (isotope_ratio[j]->ratio == MISSING)
|
||||
continue;
|
||||
@ -4066,7 +4066,7 @@ iso_unit(const char *total_name)
|
||||
strcat(token,"R(");
|
||||
strcat(token,my_total_name);
|
||||
strcat(token,")");
|
||||
for (j = 0; j < count_isotope_ratio; j++)
|
||||
for (j = 0; j < (int)isotope_ratio.size(); j++)
|
||||
{
|
||||
if (isotope_ratio[j]->ratio == MISSING)
|
||||
continue;
|
||||
|
||||
13
isotopes.cpp
13
isotopes.cpp
@ -1011,7 +1011,7 @@ print_isotope_ratios(void)
|
||||
output_msg(sformatf( "%25s\t%12s\t%15s\n\n", "Isotope Ratio",
|
||||
"Ratio", "Input Units"));
|
||||
|
||||
for (j = 0; j < count_isotope_ratio; j++)
|
||||
for (j = 0; j < (int)isotope_ratio.size(); j++)
|
||||
{
|
||||
if (isotope_ratio[j]->ratio == MISSING)
|
||||
continue;
|
||||
@ -1135,7 +1135,7 @@ calculate_values(void)
|
||||
}
|
||||
if (pr.isotope_ratios == TRUE)
|
||||
{
|
||||
for (j = 0; j < count_isotope_ratio; j++)
|
||||
for (j = 0; j < (int)isotope_ratio.size(); j++)
|
||||
{
|
||||
isotope_ratio_ptr = isotope_ratio[j];
|
||||
master_isotope_ptr =
|
||||
@ -1699,13 +1699,8 @@ isotope_ratio_store(const char *name, int replace_if_found)
|
||||
}
|
||||
else
|
||||
{
|
||||
n = count_isotope_ratio++;
|
||||
/* make sure there is space in s */
|
||||
if (count_isotope_ratio >= max_isotope_ratio)
|
||||
{
|
||||
space((void **) ((void *) &isotope_ratio), count_isotope_ratio,
|
||||
&max_isotope_ratio, sizeof(struct isotope_ratio *));
|
||||
}
|
||||
n = (int)isotope_ratio.size();
|
||||
isotope_ratio.resize((size_t)n + 1);
|
||||
/* Make new isotope_ratio structure */
|
||||
isotope_ratio[n] = isotope_ratio_alloc();
|
||||
isotope_ratio_ptr = isotope_ratio[n];
|
||||
|
||||
@ -178,11 +178,7 @@ initialize(void)
|
||||
&calculate_value_hash_table);
|
||||
|
||||
/* isotope_ratio */
|
||||
max_isotope_ratio = MAX_ELTS;
|
||||
count_isotope_ratio = 0;
|
||||
space((void **) ((void *) &isotope_ratio), INIT, &max_isotope_ratio,
|
||||
sizeof(struct isotope_ratio *));
|
||||
hcreate_multi((unsigned) max_isotope_ratio, &isotope_ratio_hash_table);
|
||||
hcreate_multi((unsigned) MAX_ELTS, &isotope_ratio_hash_table);
|
||||
|
||||
/* isotope_value */
|
||||
max_isotope_alpha = MAX_ELTS;
|
||||
|
||||
@ -243,12 +243,12 @@ clean_up(void)
|
||||
calculate_value_hash_table = NULL;
|
||||
|
||||
/* isotope_ratio */
|
||||
for (i = 0; i < count_isotope_ratio; i++)
|
||||
for (i = 0; i < (int)isotope_ratio.size(); i++)
|
||||
{
|
||||
isotope_ratio[i] =
|
||||
(struct isotope_ratio *) free_check_null(isotope_ratio[i]);
|
||||
}
|
||||
isotope_ratio = (struct isotope_ratio **) free_check_null(isotope_ratio);
|
||||
//isotope_ratio = (struct isotope_ratio **) free_check_null(isotope_ratio);
|
||||
hdestroy_multi(isotope_ratio_hash_table);
|
||||
isotope_ratio_hash_table = NULL;
|
||||
|
||||
@ -328,7 +328,6 @@ clean_up(void)
|
||||
llnl_count_bdot = 0;
|
||||
llnl_count_co2_coefs = 0;
|
||||
|
||||
count_isotope_ratio = 0;
|
||||
count_isotope_alpha = 0;
|
||||
|
||||
default_data_base = (char *) free_check_null(default_data_base);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user