diff --git a/src/Radiation.cpp b/src/Radiation.cpp index 67c7afd..28978e8 100644 --- a/src/Radiation.cpp +++ b/src/Radiation.cpp @@ -108,10 +108,12 @@ double CRadiation::EstimateLongwaveRadiation(const int iSnow, case(LW_INC_DATA): { LW_incoming=F->LW_incoming; + break; } case(LW_INC_DEFAULT): { LW_incoming=0.0; //calculated below with LW_DEFAULT, or not at all for algorithms which can calculate net LW only + break; } //-------------------------------------------------------- case(LW_INC_SICART): @@ -139,6 +141,7 @@ double CRadiation::EstimateLongwaveRadiation(const int iSnow, L_F = epsilon_s*STEFAN_BOLTZ*pow(Tair,4.0); // eqn 6 of Sicart et al (2005) LW_incoming = svf*L_0 + (1.0-svf)*L_F; + break; } //-------------------------------------------------------- case (LW_INC_SKYVIEW): @@ -162,6 +165,7 @@ double CRadiation::EstimateLongwaveRadiation(const int iSnow, LW_incoming = epsilon_s * (1 - svf) * STEFAN_BOLTZ * pow(Tair,4); LW_incoming += epsilon_air * ( svf) * STEFAN_BOLTZ * pow(Tair,4); + break; } //-------------------------------------------------------- case (LW_INC_DINGMAN): @@ -186,6 +190,7 @@ double CRadiation::EstimateLongwaveRadiation(const int iSnow, eps_at=(1-forest_cover)*eps_at+(forest_cover)*1.0; //treats forest as blackbody - neglects sky view factor LW_incoming=STEFAN_BOLTZ*eps_at*pow(Tair,4); + break; } } diff --git a/src/StateVariables.cpp b/src/StateVariables.cpp index 63e9718..31746c7 100644 --- a/src/StateVariables.cpp +++ b/src/StateVariables.cpp @@ -17,6 +17,7 @@ CStateVariable::CStateVariable() { this->Initialize(); + _pTransportModel=NULL; } ////////////////////////////////////////////////////////////////// @@ -24,9 +25,9 @@ CStateVariable::CStateVariable() // void CStateVariable::Initialize() { - this->_nAliases = 0; - this->_aAliases = NULL; - this->_aAliasReferences = NULL; + _nAliases = 0; + _aAliases = NULL; + _aAliasReferences = NULL; } ////////////////////////////////////////////////////////////////// @@ -34,17 +35,14 @@ void CStateVariable::Initialize() // CStateVariable::~CStateVariable() { - this->Destroy(); + delete [] _aAliases; + delete [] _aAliasReferences; } ////////////////////////////////////////////////////////////////// /// \brief Delete references to static alias arrays // -void CStateVariable::Destroy() -{ - delete [] _aAliases; - delete [] _aAliasReferences; -} +void CStateVariable::Destroy(){} ////////////////////////////////////////////////////////////////// /// \brief Dynamically adds additional string, s, onto dynamic array of strings, pArr. Increments size of array by one @@ -398,7 +396,7 @@ sv_type CStateVariable::StringToSVType(const string s, int &layer_index,bool str if ((typ==CONSTITUENT) && ((int)(tmp.find_first_of("|"))!=-1)) //only used if e.g., !Nitrogen|SOIL[1] (rather than CONSTITUENT[32] or !Nitrogen[32]) is used { - layer_index = this->_pTransportModel->GetLayerIndexFromName2(tmp, layer_index); + layer_index = _pTransportModel->GetLayerIndexFromName2(tmp, layer_index); if (layer_index==DOESNT_EXIST){typ=UNRECOGNIZED_SVTYPE;} }