Skip to content

Commit fb122a1

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent e9fc8ef commit fb122a1

File tree

7 files changed

+45
-45
lines changed

7 files changed

+45
-45
lines changed

src/DemandExpressionHandling.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ bool CDemandOptimizer::ConvertToExpressionTerm(const string s, expressionTerm* t
749749
//----------------------------------------------------------------------
750750
else if (GetWorkflowVariable(s,index) != RAV_BLANK_DATA) // workflow variable
751751
{
752-
752+
753753
term->type=TERM_WORKFLOW;
754754
term->value=GetWorkflowVariable(s,index);// initially zero
755755
term->DV_ind=index;
@@ -937,13 +937,13 @@ expressionStruct *CDemandOptimizer::ParseExpression(const char **s,
937937
return tmp;
938938
}
939939
//////////////////////////////////////////////////////////////////
940-
/// \brief Parses :Condition within management goal or workflow variable definition
940+
/// \brief Parses :Condition within management goal or workflow variable definition
941941
/// \param s [in] - array of strings of [size: Len]
942942
/// \param Len [in] - length of string array
943943
/// \param lineno [in] - line number of original expression in input file filename, referenced in errors
944944
/// \param filename [in] - name of input file, referenced in errors
945945
/// \returns exp_condition: a pointer to an expression condition variable
946-
///
946+
///
947947
/// \todo[funct]: Would it be better to support @date(), @between, @day_of_year() in general expression??
948948
/// :Condition !Q32[0] < 300 + @ts(myTs,0)
949949
/// :Condition DATE IS_BETWEEN 1975-01-02 and 2010-01-02
@@ -957,13 +957,13 @@ expressionStruct *CDemandOptimizer::ParseExpression(const char **s,
957957
/// :Condition DAY_OF_YEAR IS_BETWEEN Apr-1 Aug-1 //\todo [NOT YET SUPPORTED]
958958
/// :Condition @is_between(DAY_OF_YEAR,300,20) = 1 // \todo [NOT YET SUPPORTED]
959959
//
960-
exp_condition* CDemandOptimizer::ParseCondition(const char** s, const int Len, const int lineno, const string filename) const
960+
exp_condition* CDemandOptimizer::ParseCondition(const char** s, const int Len, const int lineno, const string filename) const
961961
{
962962
bool badcond=false;
963963
exp_condition *pCond = new exp_condition();
964964
pCond->dv_name=s[1];
965965
const optStruct *Options=_pModel->GetOptStruct();
966-
966+
967967
bool is_exp=false;
968968
for (int i = 2; i < Len; i++) {
969969
if ((s[i][0]=='+') || (s[i][0]=='-') || (s[i][0]=='*') || (s[i][0]=='/') || (s[i][0]=='=') || (s[i][0]=='<') || (s[i][0]=='>')){
@@ -1000,7 +1000,7 @@ exp_condition* CDemandOptimizer::ParseCondition(const char** s, const int Len, c
10001000
char tmp =pCond->dv_name[1];
10011001
string tmp2=pCond->dv_name.substr(2);
10021002
char code=pCond->dv_name[1];
1003-
if ((code=='Q') || (code=='h') || (code=='I')) //subbasin state decision variable
1003+
if ((code=='Q') || (code=='h') || (code=='I')) //subbasin state decision variable
10041004
{
10051005
long SBID=s_to_l(tmp2.c_str());
10061006
if (_pModel->GetSubBasinByID(SBID) == NULL) {
@@ -1122,7 +1122,7 @@ bool CDemandOptimizer::CheckOpRegimeConditions(const op_regime *pOperRegime, con
11221122
}
11231123
else {//handle user specified DVs and workflow variables
11241124
int i=GetUserDVIndex(pCond->dv_name);
1125-
if (i != DOESNT_EXIST) //decision variable
1125+
if (i != DOESNT_EXIST) //decision variable
11261126
{
11271127
dv_value =_pDecisionVars[i]->value;
11281128
}

src/DemandOptimization.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ void CDemandOptimizer::AddDecisionVar(const decision_var* pDV)
316316
//////////////////////////////////////////////////////////////////
317317
/// \brief disables stage discharge curve handling for reservoir in subbasin p
318318
//
319-
void CDemandOptimizer::OverrideSDCurve(const int p)
319+
void CDemandOptimizer::OverrideSDCurve(const int p)
320320
{
321321
_aDisableSDCurve[p]=true;
322322
}
@@ -417,7 +417,7 @@ bool CDemandOptimizer::VariableNameExists(const string &name) const
417417
for (int i = 0; i < _nUserConstants; i++) {
418418
if (_aUserConstNames[i]==name){return true;}
419419
}
420-
420+
421421
if (GetUnitConversion(name)!=RAV_BLANK_DATA){return true;}
422422

423423
return false;
@@ -877,7 +877,7 @@ void CDemandOptimizer::InitializePostRVMRead(CModel* pModel, const optStruct& Op
877877
cout<<" "<<i<<" [WORKFLOWVAR]: "<<_pWorkflowVars[i]->name<<endl;
878878
for (int k=0; k<_pWorkflowVars[i]->nOperRegimes; k++)
879879
{
880-
880+
881881
cout<<" +oper regime: "<<_pWorkflowVars[i]->pOperRegimes[k]->reg_name<<endl;
882882
cout<<" +expression: "<<_pWorkflowVars[i]->pOperRegimes[k]->pExpression->origexp<<endl;
883883
comparison ctype=_pWorkflowVars[i]->pOperRegimes[k]->pExpression->compare;

src/OrographicCorrections.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,8 @@ void CModel::CorrectPET(const optStruct &Options,
399399
if(iSnow!=DOESNT_EXIST) { SWE =pHRU->GetStateVarValue(iSnow); }
400400
if(iSC !=DOESNT_EXIST) { snow_cov=pHRU->GetStateVarValue(iSC); }
401401

402-
if(SWE>0.1) {
403-
F.PET *=(1.0-snow_cov);
402+
if(SWE>0.1) {
403+
F.PET *=(1.0-snow_cov);
404404
F.OW_PET*=(1.0-snow_cov);
405405
}
406406
}

src/ParseHRUFile.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ bool ParseHRUPropsFile(CModel *&pModel, const optStruct &Options, bool terrain_r
4747

4848
ifstream INPUT2; //For Secondary input
4949
CParser* pMainParser=NULL; //for storage of main parser while reading secondary files
50-
ifstream INPUT3; //For tertiary input
51-
CParser *pSecondaryParser=NULL; //for storage of secondary parser while reading tertiary files
50+
ifstream INPUT3; //For tertiary input
51+
CParser *pSecondaryParser=NULL; //for storage of secondary parser while reading tertiary files
5252

5353
if (Options.noisy){
5454
cout <<"======================================================"<<endl;
@@ -120,26 +120,26 @@ bool ParseHRUPropsFile(CModel *&pModel, const optStruct &Options, bool terrain_r
120120
if (pSecondaryParser != NULL){
121121
ExitGracefully("ParseEnsembleFile::nested :RedirectToFile commands are not allowed to be nested more than two levels (e.g., rvm file to rvm file to rvm file to rvm file)",BAD_DATA);
122122
}
123-
if (pMainParser == NULL) { //from base .rvh file
124-
INPUT2.open(filename.c_str());
123+
if (pMainParser == NULL) { //from base .rvh file
124+
INPUT2.open(filename.c_str());
125125
if(INPUT2.fail()) {
126126
string warn;
127127
warn=":RedirectToFile (from .rvh): Cannot find file "+filename;
128128
ExitGracefully(warn.c_str(),BAD_DATA);
129129
}
130-
pMainParser=pp;
130+
pMainParser=pp;
131131
pp=new CParser(INPUT2,filename,line);//open new parser
132-
}
133-
else { //from already redirected .rvh file
134-
INPUT3.open(filename.c_str());
132+
}
133+
else { //from already redirected .rvh file
134+
INPUT3.open(filename.c_str());
135135
if(INPUT3.fail()) {
136136
string warn;
137137
warn=":RedirectToFile (from .rvh): Cannot find file "+filename;
138138
ExitGracefully(warn.c_str(),BAD_DATA);
139139
}
140140
pSecondaryParser=pp;
141141
pp=new CParser(INPUT3,filename,line);//open new parser
142-
}
142+
}
143143
break;
144144
}
145145
case(-4): //----------------------------------------------

src/ParseManagementFile.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ bool ParseManagementFile(CModel *&pModel,const optStruct &Options)
5656

5757
CDemand *pDemand=NULL;
5858
int demand_ind=0;
59-
long demandSBID;
59+
long demandSBID;
6060
int demand_ID;
6161
string demand_name;
6262

6363
ifstream INPUT2; //For Secondary input
6464
CParser *pMainParser=NULL; //for storage of main parser while reading secondary files
65-
ifstream INPUT3; //For tertiary input
66-
CParser *pSecondaryParser=NULL; //for storage of secondary parser while reading tertiary files
65+
ifstream INPUT3; //For tertiary input
66+
CParser *pSecondaryParser=NULL; //for storage of secondary parser while reading tertiary files
6767

6868
ifstream RVM;
6969
RVM.open(Options.rvm_filename.c_str(),ios::binary);
@@ -200,21 +200,21 @@ bool ParseManagementFile(CModel *&pModel,const optStruct &Options)
200200
if(Options.noisy) { cout <<"Redirect to file: "<<filename<<endl; }
201201

202202
filename=CorrectForRelativePath(filename,Options.rvm_filename);
203-
203+
204204
if (pSecondaryParser != NULL){
205205
ExitGracefully("ParseEnsembleFile::nested :RedirectToFile commands are not allowed to be nested more than two levels (e.g., rvm file to rvm file to rvm file to rvm file)",BAD_DATA);
206206
}
207-
if (pMainParser == NULL) {
207+
if (pMainParser == NULL) {
208208
INPUT2.open(filename.c_str(),ios::binary); //binary enables tellg() to work correctly for Unix files in parseLib::Peek()
209209
if(INPUT2.fail()) {
210210
string warn;
211211
warn=":RedirectToFile (from .rvm): Cannot find file "+filename;
212212
ExitGracefully(warn.c_str(),BAD_DATA);
213213
}
214-
pMainParser=pp;
214+
pMainParser=pp;
215215
pp=new CParser(INPUT2,filename,line);//open new parser
216-
} //from base .rvm file
217-
else {
216+
} //from base .rvm file
217+
else {
218218
INPUT3.open(filename.c_str(),ios::binary); //binary enables tellg() to work correctly for Unix files in parseLib::Peek()
219219
if(INPUT3.fail()) {
220220
string warn;
@@ -223,7 +223,7 @@ bool ParseManagementFile(CModel *&pModel,const optStruct &Options)
223223
}
224224
pSecondaryParser=pp;
225225
pp=new CParser(INPUT3,filename,line);//open new parser
226-
} //from already redirected .rvm file
226+
} //from already redirected .rvm file
227227
break;
228228
}
229229
case(-4): //----------------------------------------------
@@ -630,7 +630,7 @@ bool ParseManagementFile(CModel *&pModel,const optStruct &Options)
630630
}
631631
pWV->AddExpression(pExp);
632632
//pWV->pExpression=pExp;
633-
633+
634634
if (pDO->GetDebugLevel()>=1){
635635
SummarizeExpression((const char**)(s),Len,pExp);
636636
}
@@ -716,7 +716,7 @@ bool ParseManagementFile(CModel *&pModel,const optStruct &Options)
716716
else if (!strcmp(s[0], ":Condition"))
717717
{
718718
if (Options.noisy){cout<<" Condition "<<endl; }
719-
719+
720720
exp_condition *pCond;
721721
if (pWV!=NULL){
722722
pCond=pDO->ParseCondition((const char**)(s),Len,pp->GetLineNumber(),pp->GetFilename());
@@ -805,7 +805,7 @@ bool ParseManagementFile(CModel *&pModel,const optStruct &Options)
805805
else{
806806
pDO->OverrideSDCurve(pSB->GetGlobalIndex());
807807
}
808-
808+
809809
break;
810810
}
811811
case(40): //----------------------------------------------
@@ -1305,4 +1305,4 @@ bool ParseManagementFile(CModel *&pModel,const optStruct &Options)
13051305
pp=NULL;
13061306

13071307
return true;
1308-
}
1308+
}

src/ParseTimeSeriesFile.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ bool ParseTimeSeriesFile(CModel *&pModel, const optStruct &Options)
4242
ifstream RVT;
4343
ifstream INPUT2; //For Secondary input
4444
CParser* pMainParser=NULL; //for storage of main parser while reading secondary files
45-
ifstream INPUT3; //For tertiary input
46-
CParser *pSecondaryParser=NULL; //for storage of secondary parser while reading tertiary files
45+
ifstream INPUT3; //For tertiary input
46+
CParser *pSecondaryParser=NULL; //for storage of secondary parser while reading tertiary files
4747

4848
if (Options.in_bmi_mode && (strcmp(Options.rvt_filename.c_str(), "") == 0)) { // an RVT may not be specified for a BMI run
4949
return (true);
@@ -190,26 +190,26 @@ bool ParseTimeSeriesFile(CModel *&pModel, const optStruct &Options)
190190
if (pSecondaryParser != NULL){
191191
ExitGracefully("ParseEnsembleFile::nested :RedirectToFile commands are not allowed to be nested more than two levels (e.g., rvm file to rvm file to rvm file to rvm file)",BAD_DATA);
192192
}
193-
if (pMainParser == NULL) { //from base .rvt file
194-
INPUT2.open(filename.c_str());
193+
if (pMainParser == NULL) { //from base .rvt file
194+
INPUT2.open(filename.c_str());
195195
if(INPUT2.fail()) {
196196
string warn;
197197
warn=":RedirectToFile (from .rvt): Cannot find file "+filename;
198198
ExitGracefully(warn.c_str(),BAD_DATA);
199199
}
200-
pMainParser=p;
200+
pMainParser=p;
201201
p=new CParser(INPUT2,filename,line);//open new parser
202-
}
203-
else { //from already redirected .rvt file
204-
INPUT3.open(filename.c_str());
202+
}
203+
else { //from already redirected .rvt file
204+
INPUT3.open(filename.c_str());
205205
if(INPUT3.fail()) {
206206
string warn;
207207
warn=":RedirectToFile (from .rvt): Cannot find file "+filename;
208208
ExitGracefully(warn.c_str(),BAD_DATA);
209209
}
210210
pSecondaryParser=p;
211211
p=new CParser(INPUT3,filename,line);//open new parser
212-
}
212+
}
213213
break;
214214
}
215215
case(-4): //----------------------------------------------

src/StandardOutput.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,13 +1407,13 @@ void CModel::WriteMajorOutput(const time_struct &tt, string solfile, bool final)
14071407
BAS<<","<<_pSubBasins[pp]->GetBasinProperties("GAMMA_SCALE");
14081408
BAS<<","<<_pSubBasins[pp]->GetBasinProperties("CELERITY");
14091409
BAS<<","<<_pSubBasins[pp]->GetBasinProperties("DIFFUSIVITY");
1410-
//Has flow observations
1410+
//Has flow observations
14111411
for (i = 0; i < _nObservedTS; i++){
14121412
if (IsContinuousFlowObs(_pObservedTS[i],_pSubBasins[pp]->GetID())) {has_obs=true;}
14131413
}
14141414
if (has_obs){BAS<<", TRUE";}
14151415
else {BAS<<",FALSE";}
1416-
1416+
14171417
BAS<<","<<_pSubBasins[pp]->GetLatHistorySize();
14181418
for (int i = 0; i < _pSubBasins[pp]->GetLatHistorySize(); i++) {
14191419
BAS<<","<<_pSubBasins[pp]->GetUnitHydrograph()[i];

0 commit comments

Comments
 (0)