From 0a5b1af296d2c3bf7e612144909f7d426be84510 Mon Sep 17 00:00:00 2001 From: Darth Vader Date: Tue, 8 Oct 2024 20:09:11 +0000 Subject: [PATCH] Squashed 'src/' changes from e317dd0e..c876219b c876219b Merge commit '64310ada821d1cc387af4507db7029fe3326784b' 64310ada Squashed 'common/' changes from 399aba2..648db22 7c7fafd6 Merge pull request #78 from dlparkhurst/mix_error eb0591c9 Merge pull request #74 from mwtoews/fix-typos 334df5ea Tony's fix in heat transport bf897a2b Marked old error in mix. Updated test case. 58566a60 Fix ah2o in adding a solution. Fixed bad_graph database. 75effd02 Merge branch 'viscosity' into mix_error f4708df2 account for water mass in addition to mixing fractions 70954c61 mixing by water mass times mixing fraction 84b59ab7 Fix typos git-subtree-dir: src git-subtree-split: c876219b1b064ab7c17e0bc4ad8bff13e0aeb108 --- Form1.h | 2 +- Makefile.old | 2 +- PBasic.cpp | 8 ++--- Phreeqc.cpp | 2 +- Solution.cxx | 2 +- cl1.cpp | 2 +- cl1mp.cpp | 2 +- common/Parser.h | 2 +- common/Utils.cxx | 2 +- cvode.cpp | 8 ++--- global_structures.h | 4 +-- input.cpp | 2 +- inverse.cpp | 2 +- mainsubs.cpp | 2 +- model.cpp | 2 +- nvector_serial.cpp | 2 +- nvector_serial.h | 2 +- pitzer.cpp | 2 +- prep.cpp | 4 +-- read.cpp | 4 +-- sit.cpp | 2 +- step.cpp | 77 +++++++++++++++++++++++++++++++++++++++++++++ structures.cpp | 4 +-- tally.cpp | 6 ++-- tidy.cpp | 2 +- transport.cpp | 25 ++++++++------- utilities.cpp | 2 +- 27 files changed, 128 insertions(+), 48 deletions(-) diff --git a/Form1.h b/Form1.h index 77cb90f95..df07557ad 100644 --- a/Form1.h +++ b/Form1.h @@ -673,7 +673,7 @@ namespace zdg_ui2 { // Respond to a Zoom Event void MyZoomEvent( ZedGraphControl ^control, ZoomState ^oldState, ZoomState ^newState ) { - // Here we get notification everytime the user zooms + // Here we get notification every time the user zooms } void SetChartOptions( System::Object ^sender, System::EventArgs ^e ) { diff --git a/Makefile.old b/Makefile.old index c0b66adb1..02aa81b4c 100644 --- a/Makefile.old +++ b/Makefile.old @@ -4,7 +4,7 @@ # Release # Debug # -# Serial verisons: Release Debug +# Serial versions: Release Debug # # Makefile sets CFG variable, cd's to appropriate directory, runs Makefile recursively # Recursive make sets appropriate compiler, objects, options, libraries, and compiles PHREEQC diff --git a/PBasic.cpp b/PBasic.cpp index 0b7b68dc3..6fb6f1a0c 100644 --- a/PBasic.cpp +++ b/PBasic.cpp @@ -2441,8 +2441,8 @@ factor(struct LOC_exec * LINK) require(tokcomma, LINK); varrec* area_varrec = LINK->t->UU.vp; if (LINK->t->kind != tokvar || area_varrec->stringvar != 0) - snerr(": Missing or wrong type area varaiable."); - // varaiable for thickness + snerr(": Missing or wrong type area variable."); + // variable for thickness LINK->t = LINK->t->next; require(tokcomma, LINK); varrec* thickness_varrec = LINK->t->UU.vp; @@ -5595,7 +5595,7 @@ cmdput(struct LOC_exec *LINK) /* get parentheses */ require(toklp, LINK); - /* get first argumen */ + /* get first argument */ double value = realexpr(LINK); for (;;) @@ -5628,7 +5628,7 @@ cmdput_(struct LOC_exec* LINK) /* get parentheses */ require(toklp, LINK); - /* get first argumen */ + /* get first argument */ char* str = strexpr(LINK); std::string s_value = str; PhreeqcPtr->PHRQ_free(str); diff --git a/Phreeqc.cpp b/Phreeqc.cpp index 25d903afa..672b22d2c 100644 --- a/Phreeqc.cpp +++ b/Phreeqc.cpp @@ -1966,7 +1966,7 @@ Phreeqc::InternalCopy(const Phreeqc* pSrc) //count_tally_table_rows = 0; /* transport.cpp ------------------------------- */ - /* storage is created and freed in tranport.cpp */ + /* storage is created and freed in transport.cpp */ sol_D = NULL; sol_D_dbg = NULL; J_ij = NULL; diff --git a/Solution.cxx b/Solution.cxx index a326adf56..9bf4a56ea 100644 --- a/Solution.cxx +++ b/Solution.cxx @@ -1409,7 +1409,7 @@ cxxSolution::add(const cxxSolution & addee, LDBLE extensive) this->ph = f1 * this->ph + f2 * addee.ph; this->pe = f1 * this->pe + f2 * addee.pe; this->mu = f1 * this->mu + f2 * addee.mu; - this->ah2o = f1 * this->mu + f2 * addee.ah2o; + this->ah2o = f1 * this->ah2o + f2 * addee.ah2o; this->total_h += addee.total_h * extensive; this->total_o += addee.total_o * extensive; this->cb += addee.cb * extensive; diff --git a/cl1.cpp b/cl1.cpp index 22a748e59..e3d831703 100644 --- a/cl1.cpp +++ b/cl1.cpp @@ -460,7 +460,7 @@ cl1(int k, int l, int m, int n, #endif if (kk < 0) { -/* no positive value found in L340 or bypass intermediate verticies */ +/* no positive value found in L340 or bypass intermediate vertices */ *l_kode = 2; goto L590; } diff --git a/cl1mp.cpp b/cl1mp.cpp index 797674066..c9d1a8ad5 100644 --- a/cl1mp.cpp +++ b/cl1mp.cpp @@ -603,7 +603,7 @@ cl1mp(int k, int l, int m, int n, #endif if (kk < 0) { -/* no positive value found in L340 or bypass intermediate verticies */ +/* no positive value found in L340 or bypass intermediate vertices */ *kode = 2; goto L590; } diff --git a/common/Parser.h b/common/Parser.h index ac6620bcf..d3a11c582 100644 --- a/common/Parser.h +++ b/common/Parser.h @@ -83,7 +83,7 @@ class CParser: public PHRQ_base Arguments: string Input, character string used in printing error message - allow_empty Input, True or false, if a blank line is accepable + allow_empty Input, True or false, if a blank line is acceptable if false, another line is read allow_eof Input, True or false, if EOF is acceptable allow_keyword Input, True or false, if a keyword is acceptable diff --git a/common/Utils.cxx b/common/Utils.cxx index b2585a565..060346683 100644 --- a/common/Utils.cxx +++ b/common/Utils.cxx @@ -155,7 +155,7 @@ Utilities::convert_time(double t, std::string in, std::string out) { t = t * 3600. * 24. * 365.25; } - // convert to ouput units + // convert to output units if (out.substr(0,1) == "m") { t = t / 60.; diff --git a/cvode.cpp b/cvode.cpp index 509412aac..f273c7a83 100644 --- a/cvode.cpp +++ b/cvode.cpp @@ -1672,7 +1672,7 @@ CVEwtSet(CVodeMem cv_mem, N_Vector ycur) /*********************** CVEwtSetSS ********************************* - This routine sets ewt as decribed above in the case tol_type = SS. + This routine sets ewt as described above in the case tol_type = SS. It tests for non-positive components before inverting. CVEwtSetSS returns TRUE if ewt is successfully set to a positive vector and FALSE otherwise. In the latter case, ewt is considered @@ -1698,7 +1698,7 @@ CVEwtSetSS(CVodeMem cv_mem, N_Vector ycur) /*********************** CVEwtSetSV ********************************* - This routine sets ewt as decribed above in the case tol_type = SV. + This routine sets ewt as described above in the case tol_type = SV. It tests for non-positive components before inverting. CVEwtSetSV returns TRUE if ewt is successfully set to a positive vector and FALSE otherwise. In the latter case, ewt is considered @@ -3249,7 +3249,7 @@ static void CVSetEta(CVodeMem cv_mem) { - /* If eta below the threshhold THRESH, reject a change of step size */ + /* If eta below the threshold THRESH, reject a change of step size */ if (eta < THRESH) { eta = ONE; @@ -3320,7 +3320,7 @@ CVComputeEtaqp1(CVodeMem cv_mem) corresponding value of q. If there is a tie, the preference order is to (1) keep the same order, then (2) decrease the order, and finally (3) increase the order. If the maximum eta value - is below the threshhold THRESH, the order is kept unchanged and + is below the threshold THRESH, the order is kept unchanged and eta is set to 1. ******************************************************************/ diff --git a/global_structures.h b/global_structures.h index 9eba44936..2fa43bd4e 100644 --- a/global_structures.h +++ b/global_structures.h @@ -109,7 +109,7 @@ #define TRANSPORT 8 #define PHAST 9 -/* constaints in mass balance */ +/* constants in mass balance */ #define EITHER 0 #define DISSOLVE 1 #define PRECIPITATE -1 @@ -981,7 +981,7 @@ class master alk = 0; // default gfw for species gfw = 1; - // formula from which to calcuate gfw + // formula from which to calculate gfw gfw_formula = NULL; // pointer to unknown structure unknown = NULL; diff --git a/input.cpp b/input.cpp index 7235f4ef0..1614f797c 100644 --- a/input.cpp +++ b/input.cpp @@ -55,7 +55,7 @@ check_line_impl(const char *string, int allow_empty, int allow_eof, * * Arguments: * string Input, character string used in printing error message - * allow_empty Input, True or false, if a blank line is accepable + * allow_empty Input, True or false, if a blank line is acceptable * if false, another line is read * allow_eof Input, True or false, if EOF is acceptable * allow_keyword Input, True or false, if a keyword is acceptable diff --git a/inverse.cpp b/inverse.cpp index 9e5c1ccb1..8f4a6612f 100644 --- a/inverse.cpp +++ b/inverse.cpp @@ -74,7 +74,7 @@ inverse_models(void) fprintf(netpath_file, "2.14 # File format\n"); } /* - * Fill in stucture "use". + * Fill in structure "use". */ use.Set_inverse_in(true); use.Set_inverse_ptr(&inverse[n]); diff --git a/mainsubs.cpp b/mainsubs.cpp index 051e85be0..64d655493 100644 --- a/mainsubs.cpp +++ b/mainsubs.cpp @@ -931,7 +931,7 @@ saver(void) /* ---------------------------------------------------------------------- */ { /* - * Save results of calcuations (data in variables with _x, + * Save results of calculations (data in variables with _x, * in unknown structure x, in master, or s) into structure * arrays. Structure "save" has info on whether to save * data for each entity (solution, ex, surf, pp, gas, or s_s). diff --git a/model.cpp b/model.cpp index 863ff8d05..0c85693ed 100644 --- a/model.cpp +++ b/model.cpp @@ -1964,7 +1964,7 @@ jacobian_sums(void) *sum_jacob2[k].target += *sum_jacob2[k].source * sum_jacob2[k].coef; } /* - * Make final adustments to jacobian array + * Make final adjustments to jacobian array */ /* * Ionic strength diff --git a/nvector_serial.cpp b/nvector_serial.cpp index 4227b8990..118968be3 100644 --- a/nvector_serial.cpp +++ b/nvector_serial.cpp @@ -12,7 +12,7 @@ *------------------------------------------------------------------------* * This is the implementation file for a serial implementation * * of the NVECTOR package. It contains the implementation of * - * the serial machine environment intialization and free * + * the serial machine environment initialization and free * * routines (and of the Fortran callable interfaces to them) * * and of the N_Vector kernels listed in nvector_serial.h. * * * diff --git a/nvector_serial.h b/nvector_serial.h index 8a5ecb904..fbef5df35 100644 --- a/nvector_serial.h +++ b/nvector_serial.h @@ -107,7 +107,7 @@ /**************************************************************** * PART I: * - * Serial implementaion of M_Env and N_Vector * + * Serial implementation of M_Env and N_Vector * ****************************************************************/ /* The serial implementation of the machine environment has diff --git a/pitzer.cpp b/pitzer.cpp index 35d494fc4..a0c10b4e0 100644 --- a/pitzer.cpp +++ b/pitzer.cpp @@ -737,7 +737,7 @@ PTEMP(LDBLE TK) { /* C -C SUBROUTINE TO CALUCLATE TEMPERATURE DEPENDENCE OF PITZER PARAMETER +C SUBROUTINE TO CALCULATE TEMPERATURE DEPENDENCE OF PITZER PARAMETER C */ LDBLE TR = 298.15; diff --git a/prep.cpp b/prep.cpp index 7494dfbed..fb867e087 100644 --- a/prep.cpp +++ b/prep.cpp @@ -674,7 +674,7 @@ build_ss_assemblage(void) /* include mole fraction */ store_mb(&(x[i]->phase->log10_fraction_x), &(x[i]->f), 1.0); - /* include activity coeficient */ + /* include activity coefficient */ store_mb(&(x[i]->phase->log10_lambda), &(x[i]->f), 1.0); /* * Put coefficients into mass action equations @@ -4478,7 +4478,7 @@ setup_solution(void) (ph_unknown == charge_balance_unknown) && (alkalinity_unknown != NULL)) { - error_msg("pH adustment cannot attain charge balance" + error_msg("pH adjustment cannot attain charge balance" " when alkalinity is fixed.", CONTINUE); input_error++; } diff --git a/read.cpp b/read.cpp index 9a60114c0..bb451db68 100644 --- a/read.cpp +++ b/read.cpp @@ -7477,7 +7477,7 @@ read_title(void) } /* - * Read additonal lines + * Read additional lines */ for (;;) { @@ -9161,7 +9161,7 @@ read_solid_solutions(void) if (j != 1) { error_string = sformatf( - "Expected temperature (Celcius) for parameters, assemblage %d, solid solution %s, using 25 C", + "Expected temperature (Celsius) for parameters, assemblage %d, solid solution %s, using 25 C", n_user, ss_ptr->Get_name().c_str()); warning_msg(error_string); diff --git a/sit.cpp b/sit.cpp index 8e9c4e8c0..4f3feb538 100644 --- a/sit.cpp +++ b/sit.cpp @@ -1586,7 +1586,7 @@ PTEMP_SIT(LDBLE TK) { /* C -C SUBROUTINE TO CALUCLATE TEMPERATURE DEPENDENCE OF PITZER PARAMETER +C SUBROUTINE TO CALCULATE TEMPERATURE DEPENDENCE OF PITZER PARAMETER C */ LDBLE TR = 298.15; diff --git a/step.cpp b/step.cpp index be02a1f43..d46066d21 100644 --- a/step.cpp +++ b/step.cpp @@ -620,6 +620,7 @@ add_mix(cxxMix *mix_ptr) * and other variables. */ LDBLE sum_fractions, intensive, extensive; + LDBLE sum_fractions_water=0, sum_positive_water=0, intensive_water=0, extensive_water=0; cxxSolution *solution_ptr; int count_positive; LDBLE sum_positive; @@ -634,10 +635,21 @@ add_mix(cxxMix *mix_ptr) std::map::const_iterator it; for (it = mix_ptr->Get_mixComps().begin(); it != mix_ptr->Get_mixComps().end(); it++) { + solution_ptr = Utilities::Rxn_find(Rxn_solution_map, it->first); + if (solution_ptr == NULL) + { + error_string = sformatf("Mix solution not found, %d.", + it->first); + error_msg(error_string, CONTINUE); + input_error++; + continue; + } sum_fractions += it->second; + sum_fractions_water += it->second * solution_ptr->Get_mass_water(); if (it->second > 0) { sum_positive += it->second; + sum_positive_water += it->second * solution_ptr->Get_mass_water(); count_positive++; } } @@ -653,8 +665,72 @@ add_mix(cxxMix *mix_ptr) continue; } extensive = it->second; + extensive_water = it->second * solution_ptr->Get_mass_water(); intensive = extensive / sum_fractions; + intensive_water = extensive_water / sum_fractions_water; + if (count_positive < (int) mix_ptr->Get_mixComps().size()) + { + if (it->second > 0) + { + intensive = extensive / sum_positive; + intensive_water = extensive_water / sum_positive; + } + else + { + intensive = 0; + } + } + add_solution(solution_ptr, extensive, intensive_water); + } + return (OK); +} +#ifdef SKIP_ERROR +/* ---------------------------------------------------------------------- */ +int Phreeqc:: +add_mix(cxxMix* mix_ptr) +/* ---------------------------------------------------------------------- */ +{ + /* + * calls add_solution to accumulate all data in master->totals + * and other variables. + */ + LDBLE sum_fractions, intensive, extensive; + cxxSolution* solution_ptr; + int count_positive; + LDBLE sum_positive; + + if (mix_ptr == NULL) + return (OK); + if (mix_ptr->Get_mixComps().size() == 0) + return (OK); + sum_fractions = 0.0; + sum_positive = 0.0; + count_positive = 0; + std::map::const_iterator it; + for (it = mix_ptr->Get_mixComps().begin(); it != mix_ptr->Get_mixComps().end(); it++) + { + sum_fractions += it->second; + if (it->second > 0) + { + sum_positive += it->second; + count_positive++; + } + } + for (it = mix_ptr->Get_mixComps().begin(); it != mix_ptr->Get_mixComps().end(); it++) + { + solution_ptr = Utilities::Rxn_find(Rxn_solution_map, it->first); + if (solution_ptr == NULL) + { + error_string = sformatf("Mix solution not found, %d.", + it->first); + error_msg(error_string, CONTINUE); + input_error++; + continue; + } + extensive = it->second; + intensive = extensive / sum_fractions; + if (count_positive < (int)mix_ptr->Get_mixComps().size()) { if (it->second > 0) { @@ -669,6 +745,7 @@ add_mix(cxxMix *mix_ptr) } return (OK); } +#endif /* ---------------------------------------------------------------------- */ int Phreeqc:: add_pp_assemblage(cxxPPassemblage *pp_assemblage_ptr) diff --git a/structures.cpp b/structures.cpp index c6b83ec9a..1d5851a52 100644 --- a/structures.cpp +++ b/structures.cpp @@ -2488,7 +2488,7 @@ unknown_delete(int i) /* ---------------------------------------------------------------------- */ { /* - * Delete unknow from list x + * Delete unknown from list x */ unknown_free(x[i]); x.erase(x.begin() + (size_t)i); @@ -2636,7 +2636,7 @@ logk_init(class logk *logk_ptr) */ logk_ptr->name = NULL; /* - * set varibles = 0 + * set variables = 0 */ logk_ptr->lk = 0.0; for (i = 0; i < MAX_LOG_K_INDICES; i++) diff --git a/tally.cpp b/tally.cpp index 5f703e93b..0102a6049 100644 --- a/tally.cpp +++ b/tally.cpp @@ -31,7 +31,7 @@ get_tally_table_rows_columns(int *rows, int *columns) returns number of rows and columns in table get_tally_table_row_heading(int row, char *string) row is C row number - returns row descripter for row + returns row descriptor for row get_tally_table_column_heading(int column, int *type, char *string) column is C column number returns column heading for column @@ -803,7 +803,7 @@ build_tally_table(void) char token[MAX_LENGTH]; const char* cptr; /* - * make list of all elements in all entitites + * make list of all elements in all entities * defines the number of rows in the table */ get_all_components(); @@ -811,7 +811,7 @@ build_tally_table(void) save_print_use = pr.use; pr.use = FALSE; /* - * find nuber of columns + * find number of columns */ count_tally_table_columns = 0; /* diff --git a/tidy.cpp b/tidy.cpp index 35ddce085..9449e350d 100644 --- a/tidy.cpp +++ b/tidy.cpp @@ -4661,7 +4661,7 @@ ss_prep(LDBLE t, cxxSS *ss_ptr, int print) { if (print == TRUE) output_msg(sformatf( - "\nLocal minimum in the solidus curve coresponding to a maximum\nin the minimum stoichiometric saturation curve.\n\n")); + "\nLocal minimum in the solidus curve corresponding to a maximum\nin the minimum stoichiometric saturation curve.\n\n")); } else { diff --git a/transport.cpp b/transport.cpp index 6e69e8df7..4f84778c8 100644 --- a/transport.cpp +++ b/transport.cpp @@ -28,7 +28,7 @@ struct CURRENT_CELLS LDBLE dif, ele, R; // diffusive and electric components, relative cell resistance } *current_cells; LDBLE sum_R, sum_Rd; // sum of R, sum of (current_cells[0].dif - current_cells[i].dif) * R -struct V_M // For calculating Vinograd and McBain's zero-charge, diffusive tranfer of individual solutes +struct V_M // For calculating Vinograd and McBain's zero-charge, diffusive transfer of individual solutes { LDBLE grad, D, z, c, zc, Dz, Dzc; LDBLE b_ij; // harmonic mean of cell properties, with EDL enrichment @@ -1653,14 +1653,17 @@ init_heat_mix(int l_nmix) { if (implicit) { - LDBLE viscos_f0; + LDBLE viscos_f; l_heat_nmix = l_nmix; for (i = 1; i <= count_cells + 1; i++) { heat_mix_array[i - 1] = heat_mix_array[i] / l_heat_nmix; /* for implicit, m[i] has mixf with higher cell */ - viscos_f0 = sol_D[i - 1].viscos_f0 * exp(heat_diffc / sol_D[i - 1].tk_x - heat_diffc / 298.15); - viscos_f0 += sol_D[i].viscos_f0 * exp(heat_diffc / sol_D[i].tk_x - heat_diffc / 298.15); - heat_mix_array[i - 1] *= (viscos_f0 / 2); + if (print_viscosity) + { + viscos_f = sol_D[i - 1].viscos_f * exp(heat_diffc / sol_D[i - 1].tk_x - heat_diffc / 298.15); + viscos_f += sol_D[i].viscos_f * exp(heat_diffc / sol_D[i].tk_x - heat_diffc / 298.15); + heat_mix_array[i - 1] *= (viscos_f / 2); + } } } else @@ -3871,7 +3874,7 @@ find_J(int icell, int jcell, LDBLE mixf, LDBLE DDt, int stagnant) for IL: A * por_il / por. por_il should be entered for the cell with the maximal cec. - IL water is related to X-, thus the cec (eq/L IL water) is the same for all cells if X is difined. + IL water is related to X-, thus the cec (eq/L IL water) is the same for all cells if X is defined. IL-water = (free + DL porewater) * por_il / por. for IL: A * aq_il / t_aq. */ @@ -4352,9 +4355,9 @@ find_J(int icell, int jcell, LDBLE mixf, LDBLE DDt, int stagnant) b_j *= sol_D[icell].spec[i].Dwt; else { - dum2 = sol_D[icell].spec[i].Dwt / sol_D[icell].viscos_f0; + dum2 = sol_D[icell].spec[i].Dwt / sol_D[icell].viscos_f; dum2 *= exp(sol_D[icell].spec[i].dw_t / sol_D[jcell].tk_x - sol_D[icell].spec[i].dw_t / sol_D[icell].tk_x); - dum2 *= sol_D[jcell].viscos_f0; + dum2 *= sol_D[jcell].viscos_f; b_j *= dum2; } if (sol_D[icell].spec[i].dw_a_v_dif) @@ -4463,9 +4466,9 @@ find_J(int icell, int jcell, LDBLE mixf, LDBLE DDt, int stagnant) b_i *= sol_D[jcell].spec[j].Dwt; else { - dum2 = sol_D[jcell].spec[j].Dwt / sol_D[jcell].viscos_f0; + dum2 = sol_D[jcell].spec[j].Dwt / sol_D[jcell].viscos_f; dum2 *= exp(sol_D[jcell].spec[j].dw_t / sol_D[icell].tk_x - sol_D[jcell].spec[j].dw_t / sol_D[jcell].tk_x); - dum2 *= sol_D[icell].viscos_f0; + dum2 *= sol_D[icell].viscos_f; b_i *= dum2; } if (sol_D[icell].spec[i].dw_a_v_dif) @@ -5602,7 +5605,7 @@ diff_stag_surf(int mobile_cell) * Diffuse stagnant and mobile surfaces, following the steps of disp_surf. * First the mobile/stagnant surfaces are mixed, then the stagnant surfaces * when not already done. -* If mixing factors among the cells are defined expicitly, it is assumed that +* If mixing factors among the cells are defined explicitly, it is assumed that * mixing with a lower numbered cell was done when that cell was processed: * for any cell in MCD, need only include the mixing factors for higher numbered cells. */ diff --git a/utilities.cpp b/utilities.cpp index b2ff48397..a88eda099 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -483,7 +483,7 @@ get_token(const char** eqnaddr, std::string& string, LDBLE* l_z, int* l) cptr = *eqnaddr; i = 0; /* - * Find end of token or begining of charge + * Find end of token or beginning of charge */ while (((c = *cptr) != '+') && (c != '-') && (c != '=') && (c != '\0')) {