Skip to content

Commit e56c5f9

Browse files
James CraigJames Craig
authored andcommitted
v507 [BENCHMARKED] - deaccumulation; :WriteSubBasinAutoRVH, RECHARGE_CORR, RAINSNOW_CLASS, bug fixes
Support for deaccumulating any gridded input (including Recharge) -new routine Deaccumulate() (ForcingGrid.h) -removed 'ShouldDeaccumulate() (ForcingGrid,h) New command :WriteSubBasinAutoRVH (ParseInput.cpp) -changes to StandardOutput.cpp Introduced subbasin-wise recharge correction RECHARGE_CORR (SubBasin.cpp/.h;UpdateForcings.cpp) Added RAINSNOW_CLASS (ModelParamCheck.cpp;ParseInput.cpp) Default DZTR Class is Zone 3A, not zone 3B (Reservoir.cpp) [BACKWARD COMPATIBILITY] Bug fixes: -gamma_shape and gamma_scale no longer hardcoded for in-channel routing (SubBasin.cpp) [IMPORTANT FIX] -Incomplete gamma function for very large arguments (CommonFunctions.cpp) [IMPORTANT FIX] -missing parameters in GetBasinProperties() caused issues in applying SBGroupMultiply and Overrride (SubBasin.cpp) (found by A. Schoeneberg) DemandOptimization.cpp -better debugging support QA/QC - -checking for bad index (DemandExpressionHandling.cpp) -new warning for autocalc property with multiplier (ParseHRUFile.cpp)
1 parent 8af857f commit e56c5f9

19 files changed

+236
-62
lines changed

src/CommonFunctions.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -935,13 +935,13 @@ double GetSaturatedVaporPressure(const double &T)//[C]
935935
const double A3=237.3;
936936
const double A4=21.87456;
937937
const double A5=265.5;
938-
938+
939939
//0.61115*exp(22.452*T/(T+ZERO_CELSIUS)); //MESH
940940

941941
//0.611*exp(17.27*Ta/(Ta+237.3)); //Common simplification of Dingman for T>0
942942

943943
if (T>=0){return A1*exp(A2*T/(T+A3));} // Dingman/Brook90 version (Tetens equation, 1930)
944-
else {return A1*exp(A4*T/(T+A5));}
944+
else {return A1*exp(A4*T/(T+A5));} // same as in CLASSI
945945
}
946946

947947
//////////////////////////////////////////////////////////////////
@@ -1626,8 +1626,9 @@ double IncompleteGamma(const double &x, const double &a)
16261626
//cumulative distribution
16271627
/// \ref from http://algolist.manual.ru/maths/count_fast/gamma_function.php
16281628
const int N=100;
1629-
if (x<=0){return 0.0;}
1630-
double num=1;
1629+
if (x<=0 ){return 0.0;}
1630+
if (x> 50 ){return IncompleteGamma(49.9,a);}
1631+
double num=1.0;
16311632
double sum=0.0;
16321633
double prod=1.0;
16331634
for (int n=0;n<N;n++){

src/DemandExpressionHandling.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ int CDemandOptimizer::GetIndexFromDVString(string s) const //String in format !Q
256256
}
257257
else{
258258
long long SBID=s_to_ll(s.substr(2).c_str());
259+
if (SBID==0){return DOESNT_EXIST;}//if string, not number
260+
int p= _pModel->GetSubBasinIndex(SBID);
261+
if (p==INDEX_NOT_FOUND){return DOESNT_EXIST;}
259262
return _pModel->GetSubBasinIndex(SBID);
260263
}
261264
}

src/DemandOptimization.cpp

Lines changed: 65 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ void CDemandOptimizer::AddUserDecisionVar(const decision_var* pDV)
357357
void CDemandOptimizer::OverrideSDCurve(const int p)
358358
{
359359
_aDisableSDCurve[p]=true;
360-
}
360+
}
361361
//////////////////////////////////////////////////////////////////
362362
/// \brief sets bounds for user specified decision variable
363363
//
@@ -1375,6 +1375,22 @@ void CDemandOptimizer::SolveManagementProblem(CModel *pModel, const optStruct &O
13751375
int *lpsbrow=new int [_pModel->GetNumSubBasins()]; //index of constraint equation for subbasin reaches
13761376
int *lpgoalrow=new int [_nGoals]; //index of goal equation for all user-specified goals
13771377

1378+
double **aQiterHist=NULL,**ahiterHist=NULL;
1379+
1380+
aQiterHist=new double *[_pModel->GetNumSubBasins()];
1381+
ahiterHist=new double *[_pModel->GetNumSubBasins()];
1382+
ExitGracefullyIf(ahiterHist==NULL,"CDemandOptimizer::InitializePostRVMRead",OUT_OF_MEMORY);
1383+
for (int p=0;p<_pModel->GetNumSubBasins();p++){
1384+
ahiterHist[p]=NULL;
1385+
aQiterHist[p] = new double[_maxIterations];
1386+
ahiterHist[p] = new double[_maxIterations];
1387+
ExitGracefullyIf(ahiterHist[p]==NULL,"CDemandOptimizer::InitializePostRVMRead (2)",OUT_OF_MEMORY);
1388+
for (int i = 0; i < _maxIterations; i++) {
1389+
aQiterHist[p][i]=0.0;
1390+
ahiterHist[p][i]=0.0;
1391+
}
1392+
}
1393+
13781394
// instantiate linear programming solver
13791395
// ----------------------------------------------------------------
13801396
lp_lib::lprec *pLinProg;
@@ -1807,7 +1823,6 @@ void CDemandOptimizer::SolveManagementProblem(CModel *pModel, const optStruct &O
18071823

18081824
IncrementAndSetRowName(pLinProg,rowcount,"dh_def_"+to_string(pSB->GetID()));
18091825

1810-
18111826
if (!_aDisableSDCurve[p])
18121827
{
18131828
// Second goal equation (relation between Qout and h):
@@ -1852,6 +1867,12 @@ void CDemandOptimizer::SolveManagementProblem(CModel *pModel, const optStruct &O
18521867
ExitGracefullyIf(retval==0,"SolveManagementProblem::Error adding stage discharge constraint B",RUNTIME_ERR);
18531868
IncrementAndSetRowName(pLinProg,rowcount,"reserv_Q_B"+to_string(pSB->GetID()));
18541869

1870+
//------------------------------------------------------------------------
1871+
//Eqn 3 : Q^n+1 + M*(b) <= M
1872+
// M must be >> Q^n+1
1873+
// enforces Q^n+1==0 when b==1
1874+
//------------------------------------------------------------------------
1875+
18551876
col_ind[0]=GetDVColumnInd(DV_QOUTRES,_aResIndices[p]); row_val[0]=1.0/sqrt(LARGE_NUMBER);
18561877
col_ind[1]=GetDVColumnInd(DV_BINRES ,_aResIndices[p]); row_val[1]=+sqrt(LARGE_NUMBER);
18571878
RHS =+sqrt(LARGE_NUMBER);
@@ -1861,10 +1882,10 @@ void CDemandOptimizer::SolveManagementProblem(CModel *pModel, const optStruct &O
18611882
IncrementAndSetRowName(pLinProg,rowcount,"reserv_Q_D"+to_string(pSB->GetID()));
18621883

18631884
//------------------------------------------------------------------------
1864-
//Eqns 5 & 6 : Q^n+1 >= Qout_guess + dQ/dh * (h^n+1-h_guess) - M(b)
1885+
//Eqns 4 & 5 : Q^n+1 >= Qout_guess + dQ/dh * (h^n+1-h_guess) - M(b)
18651886
// Q^n+1 <= Qout_guess + dQ/dh * (h^n+1-h_guess) + M(b)
1866-
// Q^n+1 - dQdh* h^n+1 + Mb >= [Qout_guess - dQ/dh * h_guess]
1867-
// Q^n+1 - dQdh* h^n+1 - Mb <= [Qout_guess - dQ/dh * h_guess]
1887+
// Q^n+1 - dQ/dh* h^n+1 + Mb >= [Qout_guess - dQ/dh * h_guess]
1888+
// Q^n+1 - dQ/dh* h^n+1 - Mb <= [Qout_guess - dQ/dh * h_guess]
18681889
// dQ << M
18691890
//------------------------------------------------------------------------
18701891

@@ -1889,6 +1910,8 @@ void CDemandOptimizer::SolveManagementProblem(CModel *pModel, const optStruct &O
18891910
ExitGracefullyIf(retval==0,"SolveManagementProblem::Error adding stage discharge constraint F",RUNTIME_ERR);
18901911
IncrementAndSetRowName(pLinProg,rowcount,"reserv_Q_F"+to_string(pSB->GetID()));
18911912

1913+
Q_iter[p]=Q_guess;
1914+
h_iter[p]=h_guess;
18921915
}
18931916
else /* if (aDisableSDCurve[p])*/ //keep same rows - make inert equations
18941917
{
@@ -1905,6 +1928,9 @@ void CDemandOptimizer::SolveManagementProblem(CModel *pModel, const optStruct &O
19051928
retval = lp_lib::add_constraintex(pLinProg,1,row_val,col_ind,ROWTYPE_LE,RHS);
19061929
IncrementAndSetRowName(pLinProg,rowcount,"reserv_Q_F"+to_string(pSB->GetID()));
19071930

1931+
Q_iter[p]=-1;
1932+
h_iter[p]=-1;
1933+
19081934
s+=2; //to ensure EnvMin counter is working
19091935
}
19101936
res_count++;
@@ -2024,11 +2050,6 @@ void CDemandOptimizer::SolveManagementProblem(CModel *pModel, const optStruct &O
20242050
double norm;
20252051
do
20262052
{
2027-
if (_do_debug_level==2)//EXTREME OUTPUT!!
2028-
{
2029-
WriteLPSubMatrix(pLinProg,"lp_matrix.csv",Options);
2030-
}
2031-
20322053
// ----------------------------------------------------------------
20332054
// Solve the LP problem!
20342055
// ----------------------------------------------------------------
@@ -2038,6 +2059,7 @@ void CDemandOptimizer::SolveManagementProblem(CModel *pModel, const optStruct &O
20382059
//lp_lib::set_break_numeric_accuracy(pLinProg, 1e-6);
20392060
//lp_lib::set_basiscrash(pLinProg, CRASH_MOSTFEASIBLE);
20402061
//lp_lib::set_verbose(pLinProg, DETAILED); //FOR DEBUGGING - BUT THIS IS WAY WAY TOO MUCH INFO
2062+
//lp_lib::set_epspivot(pLinProg, 1e-9);
20412063
retval = lp_lib::solve(pLinProg);
20422064
if (retval!=OPTIMAL)
20432065
{
@@ -2084,34 +2106,62 @@ void CDemandOptimizer::SolveManagementProblem(CModel *pModel, const optStruct &O
20842106
cout<<" lp_lib::solve error code: "<<retval<<" ("<<code<<")"<<endl;
20852107
cout<<" lp accuracy: "<<lp_lib::get_accuracy(pLinProg)<<endl;
20862108
cout<<" date: "<<tt.date_string << endl;
2087-
cout<<" loop iteration: "<<iter<<" of "<<_maxIterations<<endl;
2109+
cout<<" loop iteration: "<<iter+1<<" of "<<_maxIterations<<endl;
20882110

20892111
cout<<" Problematic Constraints? (largest residuals): "<<endl;
20902112
for (int j=0;j<nrows;j++)
20912113
{
20922114
if (fabs(_aSolverResiduals[j])>REAL_SMALL)
2093-
cout<<" -"<<_aSolverRowNames[j] << " " << _aSolverResiduals[j] << endl;
2115+
cout<<" >"<<_aSolverRowNames[j] << " " << _aSolverResiduals[j] << endl;
20942116
}
20952117

2096-
//lp_lib::print_debugdump(pLinProg, dumpfile.c_str());
2118+
cout<<" Iteration Sequence: "<<endl;
2119+
for (int p = 0; p < pModel->GetNumSubBasins(); p++) {
2120+
if (pModel->GetSubBasin(p)->GetReservoir()!=NULL){
2121+
long long SBID=pModel->GetSubBasin(p)->GetID();
2122+
ahiterHist[p][iter]=h_iter[p];
2123+
aQiterHist[p][iter]=Q_iter[p];
2124+
cout << " >Q " << SBID << ": "; for (int i = 0; i <= iter; i++) { cout << aQiterHist[p][i] << " "; }cout << endl;
2125+
cout << " >h " << SBID << ": "; for (int i = 0; i <= iter; i++) { cout << ahiterHist[p][i] << " "; }cout << endl;
2126+
}
2127+
}
2128+
char dump[256];
2129+
dump[0] = '\0';
2130+
strcpy(dump, dumpfile.c_str());
2131+
lp_lib::print_debugdump(pLinProg,dump);
20972132
WriteLPSubMatrix(pLinProg,"overconstrained_lp_matrix.csv",Options);
2133+
2134+
lp_lib::delete_lp(pLinProg);
20982135
ExitGracefully("SolveManagementProblem: non-optimal solution found. Problem is over-constrained. Remove or adjust management constraints.",RUNTIME_ERR);
20992136
}
2137+
if (_do_debug_level==2)//EXTREME OUTPUT!! - last valid lp
2138+
{
2139+
WriteLPSubMatrix(pLinProg,"lp_matrix.csv",Options);
2140+
}
21002141

21012142
// grab and store improved estimate of reservoir stage + flow diversion
21022143
// ----------------------------------------------------------------
21032144
double value;
21042145
dv_type typ;
2146+
double relax=0.0;
21052147
for (int i=0;i<_nDecisionVars;i++)
21062148
{
21072149
p = _pDecisionVars[i]->p_index;
21082150
value = _pDecisionVars[i]->value;
21092151
typ = _pDecisionVars[i]->dvar_type;
21102152

2111-
if (typ == DV_STAGE) {h_iter[p]=value;}
2112-
else if (typ == DV_QOUT ) {Q_iter[p]=value;}
2153+
if (typ == DV_STAGE) {ahiterHist[p][iter]=h_iter[p]; h_iter[p]=(1.0-relax)*value+(relax)*h_iter[p]; }
2154+
else if (typ == DV_QOUT ) {aQiterHist[p][iter]=Q_iter[p]; Q_iter[p]=(1.0-relax)*value+(relax)*h_iter[p]; }
21132155
}
21142156

2157+
/*for (int p = 0; p < pModel->GetNumSubBasins(); p++) {
2158+
if (pModel->GetSubBasin(p)->GetReservoir()!=NULL){
2159+
long long SBID=pModel->GetSubBasin(p)->GetID();
2160+
cout << " >Q " << SBID << ": "; for (int i = 0; i <= iter; i++) { cout << aQiterHist[p][i] << " "; }cout << endl;
2161+
//break;
2162+
}
2163+
}*/
2164+
21152165
// Calculate Non-linear solver residual
21162166
// sum of squared relative changes
21172167
// ----------------------------------------------------------------

src/ForcingGrid.cpp

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,7 @@ void CForcingGrid::ReallocateArraysInForcingGrid( )
592592
/// chunk = nchunks-1 --> data[(nchunks-1)*buffersize : _nPulses] [:][:] \\
593593
/// \return Returns 'true' if new chunk was read, otherwise 'false'.
594594
/// Updates class variable _aVal containing current chunk of data
595+
/// Deaccumulates data if needed
595596
///
596597
/// \param &Options [in] Global model options information
597598
/// \param global_model_time [in] current simulation time (in days)
@@ -1002,6 +1003,9 @@ bool CForcingGrid::ReadData(const optStruct &Options,
10021003
}
10031004
}
10041005
}
1006+
// Deaccumulate
1007+
// -------------------------------
1008+
Deaccumulate();
10051009

10061010
//delete dynamic arrays
10071011
// -------------------------------
@@ -1056,7 +1060,25 @@ bool CForcingGrid::ReadData(const optStruct &Options,
10561060
return new_chunk_read;
10571061

10581062
}
1059-
1063+
///////////////////////////////////////////////////////////////////
1064+
/// \brief Deaccumulates gridded forcing
1065+
/// called from ReadData
1066+
///
1067+
void CForcingGrid::Deaccumulate()
1068+
{
1069+
int ic,it;
1070+
if(_deaccumulate)
1071+
{
1072+
for(it=0; it<_ChunkSize-1; it++) { // loop over time points in buffer
1073+
for(ic=0; ic<_nNonZeroWeightedGridCells; ic++) { // loop over non-zero grid cell indexes
1074+
_aVal[it][ic] = (_aVal[it+1][ic]-_aVal[it][ic])/_interval;
1075+
}
1076+
}
1077+
for(ic=0; ic<_nNonZeroWeightedGridCells; ic++) { // loop over non-zero grid cell indexes
1078+
_aVal[_ChunkSize-1][ic] = 0.0;
1079+
}
1080+
}
1081+
}
10601082
///////////////////////////////////////////////////////////////////
10611083
/// \brief Enables queries of time series values using model time
10621084
/// \details Calculates _t_corr, correction to global model time, checks for overlap
@@ -2090,12 +2112,6 @@ double CForcingGrid::DailyTempCorrection(const double t) const
20902112
return -cos(2.0*PI*(t-PEAK_TEMP_HR/HR_PER_DAY));
20912113
}
20922114

2093-
///////////////////////////////////////////////////////////////////
2094-
/// \brief true if the variable should be deaccumulated
2095-
/// \return true if the variable should be deaccumulated
2096-
///
2097-
bool CForcingGrid::ShouldDeaccumulate() const{return _deaccumulate;}
2098-
20992115
//////////////////////////////////////////////////////////////////
21002116
/// \brief Returns forcing type
21012117
/// \return forcing type

src/ForcingGrid.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ class CForcingGrid //: public CForcingGridABC
113113
void ReadAttGridFromNetCDF (const int ncid,const string varname,const int nrows,const int ncols,double *&values);
114114
void ReadAttGridFromNetCDF2(const int ncid,const string varname,const int nrows,const int ncols,string *values);
115115

116+
void Deaccumulate ();
117+
116118
public:/*------------------------------------------------------*/
117119
//Constructors:
118120

@@ -226,7 +228,6 @@ class CForcingGrid //: public CForcingGridABC
226228
int GetChunkSize() const; ///< Current chunk size
227229
int GetnHydroUnits() const; ///< get number of HRUs _nHydroUnits
228230
forcing_type GetForcingType() const; ///< Type of forcing data, e.g. PRECIP, TEMP
229-
bool ShouldDeaccumulate() const; ///< true if data must be deaccumulated
230231
double GetSnowfallCorr() const; ///< snowfall correction factor
231232
double GetRainfallCorr() const; ///< rainfall correction factor
232233
double GetTemperatureCorr() const; ///< temperature correction factor

src/ModelForcingGrids.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ void CModel::GenerateGriddedPrecipVars(const optStruct &Options)
8888
{
8989
WriteWarning("CModel::GenerateGriddedPrecipVars: both snowfall and rainfall data are provided at a gauge, but :RainSnowFraction method is something other than RAINSNOW_DATA. Snow fraction will be recalculated.",Options.noisy);
9090
}
91-
//deaccumulate if necessary
92-
double rainfall_rate;
91+
//deaccumulate if necessary [NOW HANDLED IN ReadData by Deaccumulate routine)
92+
/*double rainfall_rate;
9393
if((pre_gridded) && (pGrid_pre->ShouldDeaccumulate()))
9494
{
9595
for(int it=0; it<pGrid_pre->GetChunkSize()-1; it++) { // loop over time points in buffer
@@ -103,8 +103,7 @@ void CModel::GenerateGriddedPrecipVars(const optStruct &Options)
103103
pGrid_pre->SetValue(ic,pGrid_pre->GetChunkSize()-1,rainfall_rate);
104104
}
105105
//pGrid_pre->SetChunkSize(pGrid_pre->GetChunkSize()-1);
106-
}
107-
if(Options.noisy) { cout<<"SNOW="<<snow_gridded<<" RAIN="<<rain_gridded<<" PRECIP="<<pre_gridded<<endl; }
106+
}*/
108107
if(snow_gridded && rain_gridded && !pre_gridded) {
109108
GeneratePrecipFromSnowRain(Options);
110109
}

src/ModelParamCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ void CModel::GetParticipatingParamList(string *aP,class_type *aPC,int &nP,const
422422
aP[nP]="RAINSNOW_TEMP"; aPC[nP]=CLASS_GLOBAL; nP++;
423423
aP[nP]="RAINSNOW_DELTA"; aPC[nP]=CLASS_GLOBAL; nP++;
424424
}
425-
else if(Options.rainsnow==RAINSNOW_HARDER) {
425+
else if ((Options.rainsnow==RAINSNOW_HARDER) || (Options.rainsnow==RAINSNOW_CLASS)) {
426426

427427
}
428428
else if ((Options.rainsnow==RAINSNOW_WANG) || (Options.rainsnow==RAINSNOW_SNTHERM89)) {

src/OpenWaterEvap.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ CmvOWEvaporation::CmvOWEvaporation(owevap_type owtype,
3131
else { //Default
3232
CHydroProcessABC::DynamicSpecifyConnections(2);//nConnections=2
3333
iFrom[0]=i_from; iTo[0]=pModel->GetStateVarIndex(ATMOSPHERE); //rates[0]: PONDED_WATER/DEPRESSION->ATMOSPHERE
34-
iFrom[1]=pModel->GetStateVarIndex(AET); iTo[1]=iFrom[1]; //rates[1]: AET->AET
34+
iFrom[1]=pModel->GetStateVarIndex(AET); iTo[1]=iFrom[1]; //rates[1]: AET->AET
3535
}
3636
}
3737

@@ -95,9 +95,9 @@ void CmvOWEvaporation::GetParticipatingStateVarList(owevap_type owtype, sv_type
9595
if(owtype==OPEN_WATER_UWFS)
9696
{
9797
nSV=3;
98-
aSV[0] = ATMOSPHERE; aLev[0]=DOESNT_EXIST;
99-
aSV[1] = AET; aLev[1]=DOESNT_EXIST;
100-
aSV[2]=MIN_DEP_DEFICIT; aLev[2]=DOESNT_EXIST;
98+
aSV[0]=ATMOSPHERE; aLev[0]=DOESNT_EXIST;
99+
aSV[1]=AET; aLev[1]=DOESNT_EXIST;
100+
aSV[2]=MIN_DEP_DEFICIT; aLev[2]=DOESNT_EXIST;
101101
}
102102
}
103103

src/ParseHRUFile.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,10 @@ bool ParseHRUPropsFile(CModel *&pModel, const optStruct &Options, bool terrain_r
708708
WriteWarning(":SBGroupPropertyMultiplier: invalid subbasin property (" + to_string(s[2]) + ") specified", Options.noisy);
709709
}
710710
}
711+
else {
712+
string warn=":SBGroupPropertyMultiplier: because subbasin property (" + to_string(s[2]) + ") set to be computed by Raven (rather than user-supplied in :SubBasinProperties command), it cannot be adjusted with the multiplier.";
713+
WriteWarning(warn.c_str(), Options.noisy);
714+
}
711715
}
712716
}
713717
else {

src/ParseInput.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ bool ParseMainInputFile (CModel *&pModel,
306306
Options.write_reservoir =false;
307307
Options.write_reservoirMB =false;
308308
Options.write_basinfile =false;
309+
Options.write_basinauto =false;
309310
Options.write_interp_wts =false;
310311
Options.write_demandfile =false;
311312
Options.write_simpleout =false;
@@ -518,6 +519,7 @@ bool ParseMainInputFile (CModel *&pModel,
518519
else if (!strcmp(s[0],":WriteMassLoadings" )){code=183;}
519520
else if (!strcmp(s[0],":WriteLocalFlows" )){code=184;}
520521
else if (!strcmp(s[0],":WriteNetReservoirInflows" )){code=185;}
522+
else if (!strcmp(s[0],":WriteSubBasinAutoRVH" )){code=186;}
521523
//...
522524
//--------------------SYSTEM OPTIONS -----------------------
523525
else if (!strcmp(s[0],":HyporheicLayer" )){code=198;}
@@ -935,6 +937,7 @@ bool ParseMainInputFile (CModel *&pModel,
935937
else if (!strcmp(s[1],"RAINSNOW_HARDER" )){Options.rainsnow=RAINSNOW_HARDER;}
936938
else if (!strcmp(s[1],"RAINSNOW_WANG" )){Options.rainsnow=RAINSNOW_WANG;}
937939
else if (!strcmp(s[1],"RAINSNOW_SNTHERM89" )){Options.rainsnow=RAINSNOW_SNTHERM89;}
940+
else if (!strcmp(s[1],"RAINSNOW_CLASS" )){Options.rainsnow=RAINSNOW_CLASS;}
938941
else if (!strcmp(s[1],"RAINSNOW_THRESHOLD" )){Options.rainsnow=RAINSNOW_THRESHOLD;}
939942
else {ExitGracefully("ParseInput:RainSnowMethod: Unrecognized method",BAD_DATA_WARN);}
940943
break;
@@ -2094,6 +2097,12 @@ bool ParseMainInputFile (CModel *&pModel,
20942097
Options.write_netresinflow=true;
20952098
break;
20962099
}
2100+
case(186): //--------------------------------------------
2101+
{/*:WriteSubBasinAutoRVH*/
2102+
if(Options.noisy) { cout << "Write autogenerated subbasin properties to .rvh file" << endl; }
2103+
Options.write_basinauto=true;
2104+
break;
2105+
}
20972106
case(198): //--------------------------------------------
20982107
{/*:HyporheicLayer*/
20992108
if(Options.noisy) { cout << "HyporheicLayer" << endl; }

0 commit comments

Comments
 (0)