diff --git a/src/phreeqcpp/GasPhase.h b/src/phreeqcpp/GasPhase.h index 7dde49d1..5741f10c 100644 --- a/src/phreeqcpp/GasPhase.h +++ b/src/phreeqcpp/GasPhase.h @@ -24,7 +24,8 @@ class cxxGasPhase:public cxxNumKeyword enum GP_TYPE { GP_PRESSURE = 0, - GP_VOLUME = 1 + GP_VOLUME = 1, + GP_UNKNOWN = 2 }; //void dump_xml(std::ostream& os, unsigned int indent = 0)const; diff --git a/src/phreeqcpp/Phreeqc.cpp b/src/phreeqcpp/Phreeqc.cpp index 604f7b0e..508e1d1b 100644 --- a/src/phreeqcpp/Phreeqc.cpp +++ b/src/phreeqcpp/Phreeqc.cpp @@ -453,6 +453,7 @@ void Phreeqc::init(void) last_model.count_kinetics = -1; last_model.kinetics = NULL; last_model.count_gas_phase = -1; + last_model.gas_phase_type = cxxGasPhase::GP_UNKNOWN; last_model.gas_phase = NULL; last_model.count_ss_assemblage = -1; last_model.ss_assemblage = NULL; diff --git a/src/phreeqcpp/global_structures.h b/src/phreeqcpp/global_structures.h index aec2ab56..90cb786d 100644 --- a/src/phreeqcpp/global_structures.h +++ b/src/phreeqcpp/global_structures.h @@ -1,6 +1,7 @@ #ifndef _INC_GLOBAL_STRUCTURES_H #define _INC_GLOBAL_STRUCTURES_H #include "Surface.h" +#include "GasPhase.h" /* ---------------------------------------------------------------------- * #define DEFINITIONS * ---------------------------------------------------------------------- */ @@ -246,6 +247,7 @@ struct model struct kinetics *kinetics; int count_gas_phase; + cxxGasPhase::GP_TYPE gas_phase_type; struct phase **gas_phase; int count_ss_assemblage; diff --git a/src/phreeqcpp/prep.cpp b/src/phreeqcpp/prep.cpp index e565aea6..8deef0a1 100644 --- a/src/phreeqcpp/prep.cpp +++ b/src/phreeqcpp/prep.cpp @@ -5860,6 +5860,7 @@ save_model(void) { cxxGasPhase * gas_phase_ptr = use.Get_gas_phase_ptr(); last_model.count_gas_phase = (int) gas_phase_ptr->Get_gas_comps().size(); + last_model.gas_phase_type = gas_phase_ptr->Get_type(); last_model.gas_phase = (struct phase **) PHRQ_malloc((size_t) last_model.count_gas_phase * sizeof(struct phase *)); @@ -5877,6 +5878,7 @@ save_model(void) else { last_model.count_gas_phase = 0; + last_model.gas_phase_type = cxxGasPhase::GP_UNKNOWN; last_model.gas_phase = NULL; } /* @@ -6059,6 +6061,8 @@ check_same_model(void) return (FALSE); if (last_model.count_gas_phase != (int) gas_phase_ptr->Get_gas_comps().size()) return (FALSE); + if (last_model.gas_phase_type != gas_phase_ptr->Get_type()) + return (FALSE); for (i = 0; i < (int) gas_phase_ptr->Get_gas_comps().size(); i++) { cxxGasComp *gc_ptr = &(gas_phase_ptr->Get_gas_comps()[i]); diff --git a/src/phreeqcpp/tidy.cpp b/src/phreeqcpp/tidy.cpp index d953910d..865f01c9 100644 --- a/src/phreeqcpp/tidy.cpp +++ b/src/phreeqcpp/tidy.cpp @@ -5471,6 +5471,7 @@ reset_last_model(void) last_model.exchange = (struct master **) free_check_null(last_model.exchange); last_model.count_gas_phase = 0; + last_model.gas_phase_type = cxxGasPhase::GP_UNKNOWN; last_model.gas_phase = (struct phase **) free_check_null(last_model.gas_phase); last_model.count_ss_assemblage = 0;