You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improved QA/QC in parsing rvm file (PArseManagementFile.cpp)
bug: fixed parse indices for :REservoirWaterDemand (ParseManagementFile.cpp)
bug: fixed references for !Dxxx[-n] (DemandExpressionHandling.cpp)
Copy file name to clipboardExpand all lines: src/DemandExpressionHandling.cpp
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -361,7 +361,7 @@ bool CDemandOptimizer::ConvertToExpressionTerm(const string s, expressionTerm* t
361
361
ExitGracefullyIf(n>=0, "ConvertToExpressionTerm:: term in square brackets must be <0 for historical variables.",BAD_DATA_WARN);
362
362
ExitGracefullyIf(n<-_nHistoryItems, "ConvertToExpressionTerm:: term in square brackets exceeds the magnitude of the :LookbackDuration", BAD_DATA_WARN);
ExitGracefullyIf(pSB->GetGlobalIndex()==DOESNT_EXIST,"ParseManagementFile: subbasin ID in :UseStageUnitsCorrection is invalid",BAD_DATA_WARN);
578
-
577
+
if (pSB==NULL){
578
+
ExitGracefully("ParseManagementFile: subbasin ID in :UseStageUnitsCorrection is invalid",BAD_DATA_WARN);
579
+
break;
580
+
}
579
581
if (pSB->GetReservoir()==NULL){
580
582
string advice="ParseManagementFile:The reservoir in subbasin "+to_string(pSB->GetID()) + " doesnt exist and cannot be used to calculate a stage units correction.";
if (Options.noisy){cout<<":EndWorkflowVarDefinition"<<endl; }
763
766
break;
764
767
}
765
768
else {
766
-
WriteWarning("ParseManagementFile: Unrecognized command in :WorkflowVarDefinition command block",Options.noisy);
769
+
string warn="ParseManagementFile: Unrecognized command "+to_string(s[0])+"in :WorkflowVarDefinition command block at line "+to_string(pp->GetLineNumber())+" of "+pp->GetFilename();
770
+
WriteWarning(warn.c_str(),Options.noisy);
767
771
}
768
772
firstword=pp->Peek();
769
773
if (firstword == ":Expression") {pp->NextIsMathExp();}
ExitGracefully(":DemandExpression must be between :WaterDemand and :EndWaterDemand commands.",BAD_DATA_WARN);
1239
+
ExitGracefully(":DemandExpression must be between :WaterDemand and :EndWaterDemand or :ReservoirWaterDemand and :EndReservoirWaterDemand commands.",BAD_DATA_WARN);
0 commit comments