mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 16:44:49 +01:00
elt_list, moved qsort to elt_list_combine
This commit is contained in:
parent
e8c90279e6
commit
83cfb298d6
@ -1122,12 +1122,7 @@ diff_layer_total(const char *total_name, const char *surface_name)
|
|||||||
*/
|
*/
|
||||||
add_elt_list(s_x[j]->next_elt, moles_surface);
|
add_elt_list(s_x[j]->next_elt, moles_surface);
|
||||||
}
|
}
|
||||||
if (count_elts > 0)
|
elt_list_combine();
|
||||||
{
|
|
||||||
qsort(elt_list.data(), (size_t) count_elts,
|
|
||||||
sizeof(struct elt_list), Phreeqc:: elt_list_compare);
|
|
||||||
elt_list_combine();
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
* Return totals
|
* Return totals
|
||||||
*/
|
*/
|
||||||
@ -2420,12 +2415,7 @@ surf_total_no_redox(const char *total_name, const char *surface_name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (count_elts > 0)
|
elt_list_combine();
|
||||||
{
|
|
||||||
qsort(elt_list.data(), (size_t)count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
* Return totals
|
* Return totals
|
||||||
*/
|
*/
|
||||||
@ -2836,12 +2826,7 @@ kinetics_formula(std::string kin_name, cxxNameDouble &stoichiometry)
|
|||||||
}
|
}
|
||||||
formula.append(kin_name);
|
formula.append(kin_name);
|
||||||
//elt_list[count_elts].elt = NULL;
|
//elt_list[count_elts].elt = NULL;
|
||||||
if (count_elts > 0)
|
elt_list_combine();
|
||||||
{
|
|
||||||
qsort(elt_list.data(), (size_t)count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
|
||||||
}
|
|
||||||
stoichiometry = elt_list_NameDouble();
|
stoichiometry = elt_list_NameDouble();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -3270,12 +3255,7 @@ system_total_elt(const char *total_name)
|
|||||||
paren_count = 0;
|
paren_count = 0;
|
||||||
add_elt_list(s_x[i]->next_elt, s_x[i]->moles);
|
add_elt_list(s_x[i]->next_elt, s_x[i]->moles);
|
||||||
|
|
||||||
if (count_elts > 0)
|
elt_list_combine();
|
||||||
{
|
|
||||||
qsort(elt_list.data(), (size_t)count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
* Look for element
|
* Look for element
|
||||||
*/
|
*/
|
||||||
@ -3358,12 +3338,7 @@ system_total_elt(const char *total_name)
|
|||||||
*/
|
*/
|
||||||
add_elt_list(s_x[j]->next_elt, moles_surface);
|
add_elt_list(s_x[j]->next_elt, moles_surface);
|
||||||
}
|
}
|
||||||
if (count_elts > 0)
|
elt_list_combine();
|
||||||
{
|
|
||||||
qsort(elt_list.data(), (size_t)count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
* Print totals
|
* Print totals
|
||||||
*/
|
*/
|
||||||
@ -3405,12 +3380,7 @@ system_total_elt(const char *total_name)
|
|||||||
//struct phase * phase_ptr = phase_bsearch(x[i]->pp_assemblage_comp_name, &j, FALSE);
|
//struct phase * phase_ptr = phase_bsearch(x[i]->pp_assemblage_comp_name, &j, FALSE);
|
||||||
struct phase * phase_ptr = x[i]->phase;
|
struct phase * phase_ptr = x[i]->phase;
|
||||||
add_elt_list(phase_ptr->next_elt, x[i]->moles);
|
add_elt_list(phase_ptr->next_elt, x[i]->moles);
|
||||||
if (count_elts > 0)
|
elt_list_combine();
|
||||||
{
|
|
||||||
qsort(elt_list.data(), (size_t)count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
|
||||||
}
|
|
||||||
for (j = 0; j < count_elts; j++)
|
for (j = 0; j < count_elts; j++)
|
||||||
{
|
{
|
||||||
if (strcmp(elt_list[j].elt->name, total_name) == 0)
|
if (strcmp(elt_list[j].elt->name, total_name) == 0)
|
||||||
@ -3446,12 +3416,7 @@ system_total_elt(const char *total_name)
|
|||||||
paren_count = 0;
|
paren_count = 0;
|
||||||
add_elt_list(phase_ptr->next_elt,
|
add_elt_list(phase_ptr->next_elt,
|
||||||
comp_ptr->Get_moles());
|
comp_ptr->Get_moles());
|
||||||
if (count_elts > 0)
|
elt_list_combine();
|
||||||
{
|
|
||||||
qsort(elt_list.data(), (size_t)count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
|
||||||
}
|
|
||||||
for (j = 0; j < count_elts; j++)
|
for (j = 0; j < count_elts; j++)
|
||||||
{
|
{
|
||||||
if (strcmp(elt_list[j].elt->name, total_name) == 0)
|
if (strcmp(elt_list[j].elt->name, total_name) == 0)
|
||||||
@ -3486,12 +3451,7 @@ system_total_elt(const char *total_name)
|
|||||||
count_elts = 0;
|
count_elts = 0;
|
||||||
paren_count = 0;
|
paren_count = 0;
|
||||||
add_elt_list(phase_ptr->next_elt, phase_ptr->moles_x);
|
add_elt_list(phase_ptr->next_elt, phase_ptr->moles_x);
|
||||||
if (count_elts > 0)
|
elt_list_combine();
|
||||||
{
|
|
||||||
qsort(elt_list.data(), (size_t)count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
* Look for element
|
* Look for element
|
||||||
*/
|
*/
|
||||||
@ -3541,12 +3501,7 @@ system_total_elt_secondary(const char *total_name)
|
|||||||
{
|
{
|
||||||
add_elt_list(s_x[i]->next_sys_total, s_x[i]->moles);
|
add_elt_list(s_x[i]->next_sys_total, s_x[i]->moles);
|
||||||
}
|
}
|
||||||
if (count_elts > 0)
|
elt_list_combine();
|
||||||
{
|
|
||||||
qsort(elt_list.data(), (size_t)count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
* Look for element
|
* Look for element
|
||||||
*/
|
*/
|
||||||
@ -3671,12 +3626,7 @@ system_total_elt_secondary(const char *total_name)
|
|||||||
//struct phase * phase_ptr = phase_bsearch(x[i]->pp_assemblage_comp_name, &j, FALSE);
|
//struct phase * phase_ptr = phase_bsearch(x[i]->pp_assemblage_comp_name, &j, FALSE);
|
||||||
struct phase * phase_ptr = x[i]->phase;
|
struct phase * phase_ptr = x[i]->phase;
|
||||||
add_elt_list(phase_ptr->next_sys_total, x[i]->moles);
|
add_elt_list(phase_ptr->next_sys_total, x[i]->moles);
|
||||||
if (count_elts > 0)
|
elt_list_combine();
|
||||||
{
|
|
||||||
qsort(elt_list.data(), (size_t)count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
|
||||||
}
|
|
||||||
for (j = 0; j < count_elts; j++)
|
for (j = 0; j < count_elts; j++)
|
||||||
{
|
{
|
||||||
if (strcmp(elt_list[j].elt->name, total_name) == 0)
|
if (strcmp(elt_list[j].elt->name, total_name) == 0)
|
||||||
@ -3713,12 +3663,7 @@ system_total_elt_secondary(const char *total_name)
|
|||||||
paren_count = 0;
|
paren_count = 0;
|
||||||
add_elt_list(phase_ptr->next_sys_total,
|
add_elt_list(phase_ptr->next_sys_total,
|
||||||
comp_ptr->Get_moles());
|
comp_ptr->Get_moles());
|
||||||
if (count_elts > 0)
|
elt_list_combine();
|
||||||
{
|
|
||||||
qsort(elt_list.data(), (size_t)count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
|
||||||
}
|
|
||||||
for (j = 0; j < count_elts; j++)
|
for (j = 0; j < count_elts; j++)
|
||||||
{
|
{
|
||||||
if (strcmp(elt_list[j].elt->name, total_name) == 0)
|
if (strcmp(elt_list[j].elt->name, total_name) == 0)
|
||||||
@ -3755,12 +3700,7 @@ system_total_elt_secondary(const char *total_name)
|
|||||||
add_elt_list(phase_ptr->next_sys_total,
|
add_elt_list(phase_ptr->next_sys_total,
|
||||||
phase_ptr->moles_x);
|
phase_ptr->moles_x);
|
||||||
|
|
||||||
if (count_elts > 0)
|
elt_list_combine();
|
||||||
{
|
|
||||||
qsort(elt_list.data(), (size_t)count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
* Look for element
|
* Look for element
|
||||||
*/
|
*/
|
||||||
@ -3847,12 +3787,7 @@ solution_sum_secondary(const char *total_name)
|
|||||||
{
|
{
|
||||||
add_elt_list(s_x[i]->next_sys_total, s_x[i]->moles);
|
add_elt_list(s_x[i]->next_sys_total, s_x[i]->moles);
|
||||||
}
|
}
|
||||||
if (count_elts > 0)
|
elt_list_combine();
|
||||||
{
|
|
||||||
qsort(elt_list.data(), (size_t)count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
* Look for element
|
* Look for element
|
||||||
*/
|
*/
|
||||||
@ -3963,13 +3898,7 @@ system_total_solids(cxxExchange *exchange_ptr,
|
|||||||
it->second.Get_moles());
|
it->second.Get_moles());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
elt_list_combine();
|
||||||
if (count_elts > 0)
|
|
||||||
{
|
|
||||||
qsort(elt_list.data(), (size_t)count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
|
||||||
}
|
|
||||||
return (OK);
|
return (OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -723,13 +723,7 @@ sum_diffuse_layer(cxxSurfaceCharge *charge_ptr)
|
|||||||
add_elt_list(s_x[j]->next_elt, moles_surface);
|
add_elt_list(s_x[j]->next_elt, moles_surface);
|
||||||
}
|
}
|
||||||
add_elt_list(s_h2o->next_elt, mass_water_surface / gfw_water);
|
add_elt_list(s_h2o->next_elt, mass_water_surface / gfw_water);
|
||||||
|
elt_list_combine();
|
||||||
if (count_elts > 0)
|
|
||||||
{
|
|
||||||
qsort(elt_list.data(), (size_t) count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
|
||||||
}
|
|
||||||
return (OK);
|
return (OK);
|
||||||
}
|
}
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|||||||
@ -140,8 +140,8 @@ parse_eq(char *eqn, struct elt_list **elt_ptr, int association)
|
|||||||
/*
|
/*
|
||||||
* Sort elements in reaction and combine
|
* Sort elements in reaction and combine
|
||||||
*/
|
*/
|
||||||
qsort(elt_list.data(), (size_t) count_elts, sizeof(struct elt_list),
|
//qsort(elt_list.data(), (size_t) count_elts, sizeof(struct elt_list),
|
||||||
elt_list_compare);
|
// elt_list_compare);
|
||||||
if (elt_list_combine() == ERROR)
|
if (elt_list_combine() == ERROR)
|
||||||
return (ERROR);
|
return (ERROR);
|
||||||
/*
|
/*
|
||||||
@ -228,8 +228,8 @@ check_eqn(int association)
|
|||||||
/*
|
/*
|
||||||
* Sort elements in reaction and combine
|
* Sort elements in reaction and combine
|
||||||
*/
|
*/
|
||||||
qsort(elt_list.data(), (size_t) count_elts, sizeof(struct elt_list),
|
//qsort(elt_list.data(), (size_t) count_elts, sizeof(struct elt_list),
|
||||||
elt_list_compare);
|
// elt_list_compare);
|
||||||
if (elt_list_combine() == ERROR)
|
if (elt_list_combine() == ERROR)
|
||||||
return (ERROR);
|
return (ERROR);
|
||||||
/*
|
/*
|
||||||
|
|||||||
25
prep.cpp
25
prep.cpp
@ -5301,12 +5301,7 @@ write_mb_eqn_x(void)
|
|||||||
free_check_null(temp_name);
|
free_check_null(temp_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (count_elts > 0)
|
elt_list_combine();
|
||||||
{
|
|
||||||
qsort(elt_list.data(), (size_t)count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
|
||||||
}
|
|
||||||
return (OK);
|
return (OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5365,12 +5360,7 @@ write_mb_for_species_list(int n)
|
|||||||
count_elts++;
|
count_elts++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (count_elts > 0)
|
elt_list_combine();
|
||||||
{
|
|
||||||
qsort(elt_list.data(), (size_t)count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
|
||||||
}
|
|
||||||
s[n]->next_sys_total =
|
s[n]->next_sys_total =
|
||||||
(struct elt_list *) free_check_null(s[n]->next_sys_total);
|
(struct elt_list *) free_check_null(s[n]->next_sys_total);
|
||||||
s[n]->next_sys_total = elt_list_save();
|
s[n]->next_sys_total = elt_list_save();
|
||||||
@ -5427,12 +5417,7 @@ write_phase_sys_total(int n)
|
|||||||
count_elts++;
|
count_elts++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (count_elts > 0)
|
elt_list_combine();
|
||||||
{
|
|
||||||
qsort(elt_list.data(), (size_t)count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
|
||||||
}
|
|
||||||
phases[n]->next_sys_total =
|
phases[n]->next_sys_total =
|
||||||
(struct elt_list *) free_check_null(phases[n]->next_sys_total);
|
(struct elt_list *) free_check_null(phases[n]->next_sys_total);
|
||||||
phases[n]->next_sys_total = elt_list_save();
|
phases[n]->next_sys_total = elt_list_save();
|
||||||
@ -6543,8 +6528,6 @@ change_hydrogen_in_elt_list(LDBLE charge)
|
|||||||
found_o = -1;
|
found_o = -1;
|
||||||
coef_h = 0.0;
|
coef_h = 0.0;
|
||||||
coef_o = 0.0;
|
coef_o = 0.0;
|
||||||
qsort(elt_list.data(), (size_t)count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
elt_list_combine();
|
||||||
for (j = 0; j < count_elts; j++)
|
for (j = 0; j < count_elts; j++)
|
||||||
{
|
{
|
||||||
@ -6569,8 +6552,6 @@ change_hydrogen_in_elt_list(LDBLE charge)
|
|||||||
elt_list[count_elts].elt = s_hplus->primary->elt;
|
elt_list[count_elts].elt = s_hplus->primary->elt;
|
||||||
elt_list[count_elts].coef = coef;
|
elt_list[count_elts].coef = coef;
|
||||||
count_elts++;
|
count_elts++;
|
||||||
qsort(elt_list.data(), (size_t)count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
elt_list_combine();
|
||||||
return (OK);
|
return (OK);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -316,12 +316,7 @@ print_diffuse_layer(cxxSurfaceCharge *charge_ptr)
|
|||||||
ptr = &(token[0]);
|
ptr = &(token[0]);
|
||||||
get_elts_in_species (&ptr, mass_water_surface / gfw_water);
|
get_elts_in_species (&ptr, mass_water_surface / gfw_water);
|
||||||
*/
|
*/
|
||||||
if (count_elts > 0)
|
elt_list_combine();
|
||||||
{
|
|
||||||
qsort(elt_list.data(), (size_t)count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
* Print totals
|
* Print totals
|
||||||
*/
|
*/
|
||||||
|
|||||||
7
step.cpp
7
step.cpp
@ -1026,12 +1026,7 @@ add_gas_phase(cxxGasPhase *gas_phase_ptr)
|
|||||||
/*
|
/*
|
||||||
* Sort elements in reaction and combine
|
* Sort elements in reaction and combine
|
||||||
*/
|
*/
|
||||||
if (count_elts > 0)
|
elt_list_combine();
|
||||||
{
|
|
||||||
qsort(elt_list.data(), (size_t) count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
* Add gas elements to totals
|
* Add gas elements to totals
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -461,15 +461,17 @@ elt_list_combine(void)
|
|||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
if (count_elts < 1)
|
//if (count_elts < 1)
|
||||||
{
|
//{
|
||||||
output_msg("elt_list_combine: How did this happen?\n");
|
// output_msg("elt_list_combine: How did this happen?\n");
|
||||||
return (ERROR);
|
// return (ERROR);
|
||||||
}
|
//}
|
||||||
if (count_elts == 1)
|
if (count_elts <= 1)
|
||||||
{
|
{
|
||||||
return (OK);
|
return (OK);
|
||||||
}
|
}
|
||||||
|
qsort(elt_list.data(), (size_t)count_elts,
|
||||||
|
sizeof(struct elt_list), Phreeqc::elt_list_compare);
|
||||||
j = 0;
|
j = 0;
|
||||||
for (i = 1; i < count_elts; i++)
|
for (i = 1; i < count_elts; i++)
|
||||||
{
|
{
|
||||||
@ -585,18 +587,12 @@ elt_list_save(void)
|
|||||||
/*
|
/*
|
||||||
* Sort elements in reaction and combine
|
* Sort elements in reaction and combine
|
||||||
*/
|
*/
|
||||||
if (count_elts > 0)
|
elt_list_combine();
|
||||||
{
|
|
||||||
qsort(elt_list.data(), (size_t)count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
* Malloc space and store element data
|
* Malloc space and store element data
|
||||||
*/
|
*/
|
||||||
elt_list_ptr =
|
elt_list_ptr = (struct elt_list*)PHRQ_malloc((size_t)(count_elts + 1) *
|
||||||
(struct elt_list *) PHRQ_malloc((size_t) (count_elts + 1) *
|
sizeof(struct elt_list));
|
||||||
sizeof(struct elt_list));
|
|
||||||
if (elt_list_ptr == NULL)
|
if (elt_list_ptr == NULL)
|
||||||
{
|
{
|
||||||
malloc_error();
|
malloc_error();
|
||||||
|
|||||||
12
tally.cpp
12
tally.cpp
@ -550,8 +550,6 @@ fill_tally_table(int *n_user, int index_conservative, int n_buffer)
|
|||||||
{
|
{
|
||||||
add_elt_list(exchange_ptr->Get_exchange_comps()[j].Get_totals(), 1.0);
|
add_elt_list(exchange_ptr->Get_exchange_comps()[j].Get_totals(), 1.0);
|
||||||
}
|
}
|
||||||
qsort(elt_list.data(), (size_t) count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
elt_list_combine();
|
||||||
elt_list_to_tally_table(tally_table[i].total[n_buffer]);
|
elt_list_to_tally_table(tally_table[i].total[n_buffer]);
|
||||||
}
|
}
|
||||||
@ -572,8 +570,6 @@ fill_tally_table(int *n_user, int index_conservative, int n_buffer)
|
|||||||
{
|
{
|
||||||
add_elt_list(surface_ptr->Get_surface_comps()[j].Get_totals(), 1.0);
|
add_elt_list(surface_ptr->Get_surface_comps()[j].Get_totals(), 1.0);
|
||||||
}
|
}
|
||||||
qsort(elt_list.data(), (size_t) count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
elt_list_combine();
|
||||||
elt_list_to_tally_table(tally_table[i].total[n_buffer]);
|
elt_list_to_tally_table(tally_table[i].total[n_buffer]);
|
||||||
}
|
}
|
||||||
@ -643,8 +639,6 @@ fill_tally_table(int *n_user, int index_conservative, int n_buffer)
|
|||||||
|
|
||||||
add_elt_list(phase_ptr->next_elt, (*gc)[l].Get_moles());
|
add_elt_list(phase_ptr->next_elt, (*gc)[l].Get_moles());
|
||||||
}
|
}
|
||||||
qsort(elt_list.data(), (size_t) count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
elt_list_combine();
|
||||||
elt_list_to_tally_table(tally_table[i].total[n_buffer]);
|
elt_list_to_tally_table(tally_table[i].total[n_buffer]);
|
||||||
break;
|
break;
|
||||||
@ -921,8 +915,6 @@ build_tally_table(void)
|
|||||||
strcpy(token, phase_ptr->formula);
|
strcpy(token, phase_ptr->formula);
|
||||||
add_elt_list(phase_ptr->next_elt, 1.0);
|
add_elt_list(phase_ptr->next_elt, 1.0);
|
||||||
}
|
}
|
||||||
qsort(elt_list.data(), (size_t) count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
elt_list_combine();
|
||||||
tally_table[n].formula = elt_list_save();
|
tally_table[n].formula = elt_list_save();
|
||||||
}
|
}
|
||||||
@ -973,8 +965,6 @@ build_tally_table(void)
|
|||||||
paren_count = 0;
|
paren_count = 0;
|
||||||
strcpy(token, phase_ptr->formula);
|
strcpy(token, phase_ptr->formula);
|
||||||
add_elt_list(phase_ptr->next_elt, 1.0);
|
add_elt_list(phase_ptr->next_elt, 1.0);
|
||||||
qsort(elt_list.data(), (size_t)count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
elt_list_combine();
|
||||||
tally_table[n].formula = elt_list_save();
|
tally_table[n].formula = elt_list_save();
|
||||||
}
|
}
|
||||||
@ -1041,8 +1031,6 @@ build_tally_table(void)
|
|||||||
free_check_null(temp_name);
|
free_check_null(temp_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
qsort(elt_list.data(), (size_t)count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
elt_list_combine();
|
||||||
tally_table[n].formula = elt_list_save();
|
tally_table[n].formula = elt_list_save();
|
||||||
}
|
}
|
||||||
|
|||||||
22
tidy.cpp
22
tidy.cpp
@ -1285,12 +1285,7 @@ tidy_inverse(void)
|
|||||||
/*
|
/*
|
||||||
* Sort elements in reaction and combine
|
* Sort elements in reaction and combine
|
||||||
*/
|
*/
|
||||||
if (count_elts > 0)
|
elt_list_combine();
|
||||||
{
|
|
||||||
qsort(elt_list.data(), (size_t) count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
* Mark master species list
|
* Mark master species list
|
||||||
*/
|
*/
|
||||||
@ -3495,8 +3490,6 @@ tidy_min_exchange(void)
|
|||||||
error_msg(error_string, CONTINUE);
|
error_msg(error_string, CONTINUE);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
qsort(elt_list.data(), (size_t)count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
elt_list_combine();
|
||||||
for (jj = 0; jj < count_elts; jj++)
|
for (jj = 0; jj < count_elts; jj++)
|
||||||
{
|
{
|
||||||
@ -3675,8 +3668,6 @@ update_min_exchange(void)
|
|||||||
error_msg(error_string, CONTINUE);
|
error_msg(error_string, CONTINUE);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
qsort(elt_list.data(), (size_t)count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
elt_list_combine();
|
||||||
for (jj = 0; jj < count_elts; jj++)
|
for (jj = 0; jj < count_elts; jj++)
|
||||||
{
|
{
|
||||||
@ -3900,8 +3891,6 @@ tidy_min_surface(void)
|
|||||||
free_check_null(temp_formula);
|
free_check_null(temp_formula);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
qsort(elt_list.data(), (size_t)count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
elt_list_combine();
|
||||||
/* Makes no sense: sorbed species need not be in mineral structure... */
|
/* Makes no sense: sorbed species need not be in mineral structure... */
|
||||||
/* But elements that can desorb into solution must be in mineral */
|
/* But elements that can desorb into solution must be in mineral */
|
||||||
@ -4273,8 +4262,6 @@ tidy_kin_surface(void)
|
|||||||
/* save kinetics formula */
|
/* save kinetics formula */
|
||||||
if (count_elts > 0)
|
if (count_elts > 0)
|
||||||
{
|
{
|
||||||
qsort(elt_list.data(), (size_t)count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
elt_list_combine();
|
||||||
}
|
}
|
||||||
elt_list_kinetics = elt_list_save();
|
elt_list_kinetics = elt_list_save();
|
||||||
@ -4300,12 +4287,7 @@ tidy_kin_surface(void)
|
|||||||
free_check_null(temp_formula);
|
free_check_null(temp_formula);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (count_elts > 0)
|
elt_list_combine();
|
||||||
{
|
|
||||||
qsort(elt_list.data(), (size_t)count_elts,
|
|
||||||
sizeof(struct elt_list), elt_list_compare);
|
|
||||||
elt_list_combine();
|
|
||||||
}
|
|
||||||
for (int j = 0; j < count_elts; j++)
|
for (int j = 0; j < count_elts; j++)
|
||||||
{
|
{
|
||||||
if (elt_list[j].elt == NULL)
|
if (elt_list[j].elt == NULL)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user