Skip to content

Commit ff1bb2b

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

19 files changed

+50
-50
lines changed

src/Assimilate.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ void CModel::AssimilationOverride(const int p,const optStruct& Options,const tim
8989
Qmodlast= _pSubBasins[p]->GetLastOutflowRate();
9090
if(Qmod>PRETTY_SMALL) {
9191
_aDAscale [p]=1.0+alpha*((Qobs-Qmod)/Qmod); //if alpha = 1, Q=Qobs in observation basin
92-
//_aDAQadjust[p]=alpha*(Qobs-Qmod); //Option A: end of time step flow
92+
//_aDAQadjust[p]=alpha*(Qobs-Qmod); //Option A: end of time step flow
9393
//_aDAQadjust[p]=0.5*alpha*(2.0*Qobs-Qmodlast-Qmod);//Option B: mean flow - rapidly oscillatory Q - Qmean is perfect
9494
if (Qobs2 == RAV_BLANK_DATA) { //Option C: aim for midpoint of two observation flows (this is the way)
9595
_aDAQadjust[p]=alpha*(Qobs-Qmod);
@@ -155,7 +155,7 @@ void CModel::PrepareAssimilation(const optStruct &Options,const time_struct &tt)
155155

156156
pdown=GetDownstreamBasin(p);
157157

158-
ObsExists=false;
158+
ObsExists=false;
159159

160160
if(_pSubBasins[p]->UseInFlowAssimilation())
161161
{
@@ -202,9 +202,9 @@ void CModel::PrepareAssimilation(const optStruct &Options,const time_struct &tt)
202202
else if(!ObsExists) //observations may be downstream, propagate scaling upstream
203203
{
204204
//if ((pdown!=DOESNT_EXIST) && (!_aDAoverride[pdown])){ //alternate - allow information to pass through reservoirs
205-
if( (pdown!=DOESNT_EXIST) &&
206-
(_pSubBasins[p]->GetReservoir()==NULL) &&
207-
(!_aDAoverride[p]) &&
205+
if( (pdown!=DOESNT_EXIST) &&
206+
(_pSubBasins[p]->GetReservoir()==NULL) &&
207+
(!_aDAoverride[p]) &&
208208
(_pSubBasins[p]->IsEnabled()) && (_pSubBasins[pdown]->IsEnabled())) {
209209
_aDAscale [p]= _aDAscale [pdown];
210210
_aDAlength [p]+=_pSubBasins [pdown]->GetReachLength();
@@ -291,10 +291,10 @@ void CModel::AssimilationBackPropagate(const optStruct &Options,const time_struc
291291
pdown=GetDownstreamBasin(p);
292292

293293
if(!_aDAoverride[p]) { //observations may be downstream, get scaling from downstream
294-
if( (pdown!=DOESNT_EXIST ) &&
295-
(!_aDAoverride[p] ) &&
296-
(_pSubBasins[p]->GetReservoir()==NULL) &&
297-
(_pSubBasins[p]->IsEnabled()) && (_pSubBasins[pdown]->IsEnabled()))
294+
if( (pdown!=DOESNT_EXIST ) &&
295+
(!_aDAoverride[p] ) &&
296+
(_pSubBasins[p]->GetReservoir()==NULL) &&
297+
(_pSubBasins[p]->IsEnabled()) && (_pSubBasins[pdown]->IsEnabled()))
298298
{
299299
_aDAQadjust[p]= _aDAQadjust [pdown] * (_pSubBasins[p]->GetDrainageArea() / _pSubBasins[pdown]->GetDrainageArea());
300300
}
@@ -310,7 +310,7 @@ void CModel::AssimilationBackPropagate(const optStruct &Options,const time_struc
310310
double ECCCwt;
311311
for(p=0; p<_nSubBasins; p++)
312312
{
313-
if(!_aDAoverride[p])
313+
if(!_aDAoverride[p])
314314
{
315315
pdown=GetDownstreamBasin(p);
316316
if (pdown!=DOESNT_EXIST){

src/DemandOptimization.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ class CDemandOptimizer
261261
double **_aDhist; //< history of actual delivery [size: _nEnabledSBs * _nHistoryItems]
262262
double **_aIhist; //< history of reservoir inflows [size: _nEnabledSBs * _nHistoryItems]
263263
double **_ahhist; //< history of actual reservoir stages (or 0 for non-reservoir basins) [size: _nEnabledSBs * _nHistoryItems]
264-
double **_aAhist; //< history of actual reservoir areas [size: _nEnabledSBs * _nHistoryItems]
264+
double **_aAhist; //< history of actual reservoir areas [size: _nEnabledSBs * _nHistoryItems]
265265

266266
int _nSolverResiduals; //< number of residuals of solution (equal to lp_lib::nRows)
267267
double *_aSolverResiduals; //< vector of residuals of solution [size: _nSolverResiduals]

src/EnKF.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,10 @@ EnKF_mode CEnKFEnsemble::GetEnKFMode() const
188188

189189
//////////////////////////////////////////////////////////////////
190190
/// \brief initializes EnKF assimilation run
191-
/// - performs QA/QC on inputs
191+
/// - performs QA/QC on inputs
192192
/// - gets #s and names of state variables adjusted during assimilation
193193
/// - allocate & populate _output_matrix, _obs_matrix, _noise_matrix
194-
/// - open blank EnKFOutput.csv file
194+
/// - open blank EnKFOutput.csv file
195195
/// \param &Options [out] Global model options information
196196
//
197197
void CEnKFEnsemble::Initialize(const CModel* pModel,const optStruct &Options)

src/Flush.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void CmvFlush::GetRatesOfChange( const double *storage,
7777
const optStruct &Options,
7878
const time_struct &tt,
7979
double *rates) const
80-
{
80+
{
8181
double mult=_percentage;
8282
if (_percentage==BY_SUBBASIN_FLAG){
8383
int p=pHRU->GetSubBasinIndex();

src/ForcingGrid.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ void CForcingGrid::ForcingGridInit(const optStruct &Options)
431431
double time_zone=0;
432432
GetTimeInfoFromNetCDF(unit_t,calendar,my_time,ntime,_filename,_interval,_start_day,_start_year,time_zone);
433433
_steps_per_day=(int)(rvn_round(1.0/_interval)); //pre-calculate for speed.
434-
434+
435435
/*
436436
printf("ForcingGrid: unit_t: %s\n",unit_t_str.c_str());
437437
printf("ForcingGrid: tt.julian_day: %f\n",tt.julian_day);

src/LatFlush.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,19 +106,19 @@ void CmvLatFlush::Initialize()
106106
for(int p=0;p<_pModel->GetNumSubBasins();p++)
107107
{
108108
if (_pModel->GetSubBasin(p)->IsEnabled()) {
109-
109+
110110
for(int ks=0; ks<_pModel->GetSubBasin(p)->GetNumHRUs(); ks++) //sources
111111
{
112112
k1=_pModel->GetSubBasin(p)->GetHRU(ks)->GetGlobalIndex();
113113
Asum=0.0;
114114
nRecipients=0;
115115
if (fromHRUGrp->IsInGroup(k1)) {
116-
116+
117117
for(int ks2=0; ks2<_pModel->GetSubBasin(p)->GetNumHRUs(); ks2++) //recipients
118118
{
119119
k2=_pModel->GetSubBasin(p)->GetHRU(ks2)->GetGlobalIndex();
120120

121-
if (toHRUGrp->IsInGroup(k2))
121+
if (toHRUGrp->IsInGroup(k2))
122122
{
123123
if (k1!=k2){
124124
kFrom[q]=k1;
@@ -127,7 +127,7 @@ void CmvLatFlush::Initialize()
127127
_aFrac[q]=area;
128128
Asum+=area;//sum of recipient areas
129129
nRecipients++;
130-
130+
131131
//cout << "ADDING CONNECTION " << q << " in subbasin "<< _pModel->GetSubBasin(p)->GetName() << ": "
132132
// << _pModel->GetHydroUnit(kFrom[q])->GetHRUID() << " To " <<_pModel->GetHydroUnit(kTo[q])->GetHRUID() <<" "<<_aFrac[q]<<endl;
133133
q++;

src/Model.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ CModel::CModel(const int nsoillayers,
3333
_nTransParams=0; _pTransParams=NULL;
3434
_nClassChanges=0; _pClassChanges=NULL;
3535
_nParamOverrides=0; _pParamOverrides=NULL;
36-
_nStateVarOverrides=0;_pStateVarOverrides=NULL;
36+
_nStateVarOverrides=0;_pStateVarOverrides=NULL;
3737
_nObservedTS=0; _pObservedTS=NULL; _pModeledTS=NULL; _aObsIndex=NULL;
3838
_nObsWeightTS =0; _pObsWeightTS=NULL;
3939
_nDiagnostics=0; _pDiagnostics=NULL;
@@ -2767,7 +2767,7 @@ void CModel::RecalculateHRUDerivedParams(const optStruct &Options,
27672767
void CModel::PrepareForcingPerturbation(const optStruct &Options, const time_struct &tt)
27682768
{
27692769
if (_nPerturbations==0){return;}
2770-
2770+
27712771
double partday = Options.julian_start_day-floor(Options.julian_start_day+TIME_CORRECTION);
27722772
int nn = (int)(rvn_round((tt.model_time+partday-floor(tt.model_time+partday+TIME_CORRECTION))/Options.timestep));
27732773
bool start_of_day = ((nn==0) || tt.day_changed); //nn==0 corresponds to midnight

src/Model.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class CModel: public CModelABC
8888
sv_type *_aStateVarType; ///< type of state variable in unit i [size:_nStateVars]
8989
int *_aStateVarLayer; ///< index of state variable for multilayer variables (e.g., SOIL); [size:_nStateVars] value=DOESNT_EXIST(-1) for unique variables (e.g. SURFACE_WATER)
9090
int _aStateVarIndices[MAX_STATE_VAR_TYPES][MAX_SV_LAYERS]; ///< lookup table for state variable indices; the index of SOIL[1] in a state_var[] array may be returned by aStateVarIndices[(int)(SOIL)][1]
91-
91+
9292
sv_over **_pStateVarOverrides; ///< array of pointers to state variable override time series
9393
int _nStateVarOverrides; ///< number of state variable overrides
9494

src/ModelForcingGrids.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ CForcingGrid *CModel::ForcingCopyCreate(const CForcingGrid *pGrid,
3939
GridDims[0] = pGrid->GetCols();
4040
GridDims[1] = pGrid->GetRows();
4141
GridDims[2] = nVals;
42-
}
42+
}
4343
else {
4444
GridDims[0] = pGrid->GetCols();
4545
GridDims[1] = nVals;
@@ -128,7 +128,7 @@ void CModel::GenerateGriddedPrecipVars(const optStruct &Options)
128128
/// \brief Creates all missing gridded temperature data based on gridded information available,
129129
/// e.g when only sub-daily temperature is provided estimate daily average, minimum and maximum temperature.
130130
/// data are assumed to have the same resolution and hence can be initialized together.
131-
/// called with each new chunk of data
131+
/// called with each new chunk of data
132132
///
133133
/// \param Options [in] major options of the model
134134
//
@@ -226,7 +226,7 @@ void CModel::GenerateAveSubdailyTempFromMinMax(const optStruct &Options)
226226
pTave_daily = ForcingCopyCreate(pTmin,F_TEMP_DAILY_AVE,1.0,nVals,Options);
227227

228228
double time_shift=Options.julian_start_day-floor(Options.julian_start_day+TIME_CORRECTION);
229-
double t=0.0;
229+
double t=0.0;
230230
int chunk_size =pTave_daily->GetChunkSize();
231231
int nNonZero =pTave_daily->GetNumberNonZeroGridCells();
232232
for(int it=0; it<chunk_size; it++) { // loop over time points in buffer

src/ParseFEWSRunInfo.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ void GetNetCDFStationArray(const int ncid, const string filename,int &stat_dimid
1515
///
1616
/// \param *&pModel [in/out] Reference to model object
1717
/// \param &Options [in/out] Global model options information
18-
/// \param runname_overridden [in] true if runname specified from command line
18+
/// \param runname_overridden [in] true if runname specified from command line
1919
/// \param mode_overridden [in] true if mode specified from command line
2020
/// \param optionsonly [in] true if model is not yet created and only options content should be read
2121
/// \return True if operation is successful
@@ -149,8 +149,8 @@ bool ParseNetCDFRunInfoFile(CModel *&pModel, optStruct &Options, bool runname_ov
149149
// Ingest properties =====================================================================
150150
int varid_props;
151151
retval = nc_inq_varid(ncid,"properties",&varid_props);
152-
153-
if (retval != NC_ENOTVAR)
152+
153+
if (retval != NC_ENOTVAR)
154154
{
155155
HandleNetCDFErrors(retval);
156156

@@ -174,9 +174,9 @@ bool ParseNetCDFRunInfoFile(CModel *&pModel, optStruct &Options, bool runname_ov
174174
}
175175
}
176176
// SuppressWarnings
177-
if (optionsonly) {
177+
if (optionsonly) {
178178
retval = nc_inq_attlen(ncid,varid_props,"BlockRavenWarnings",&att_len);
179-
if (retval != NC_ENOTATT)
179+
if (retval != NC_ENOTATT)
180180
{
181181
HandleNetCDFErrors(retval);
182182
char* boolean=new char[att_len+1];
@@ -192,7 +192,7 @@ bool ParseNetCDFRunInfoFile(CModel *&pModel, optStruct &Options, bool runname_ov
192192
//Block custom output
193193
if (!optionsonly) {
194194
retval = nc_inq_attlen(ncid,varid_props,"BlockRavenCustomOutput",&att_len);
195-
if (retval != NC_ENOTATT)
195+
if (retval != NC_ENOTATT)
196196
{
197197
HandleNetCDFErrors(retval);
198198
char* boolean=new char[att_len+1];
@@ -210,7 +210,7 @@ bool ParseNetCDFRunInfoFile(CModel *&pModel, optStruct &Options, bool runname_ov
210210
//NoisyMode
211211
if (optionsonly) {
212212
retval = nc_inq_attlen(ncid, varid_props, "NoisyMode", &att_len);
213-
if (retval != NC_ENOTATT)
213+
if (retval != NC_ENOTATT)
214214
{
215215
HandleNetCDFErrors(retval);
216216
char* boolean = new char[att_len + 1];
@@ -227,7 +227,7 @@ bool ParseNetCDFRunInfoFile(CModel *&pModel, optStruct &Options, bool runname_ov
227227
//SilentMode
228228
if (optionsonly) {
229229
retval = nc_inq_attlen(ncid, varid_props, "SilentMode", &att_len);
230-
if (retval != NC_ENOTATT)
230+
if (retval != NC_ENOTATT)
231231
{
232232
HandleNetCDFErrors(retval);
233233
char* boolean = new char[att_len + 1];
@@ -261,7 +261,7 @@ bool ParseNetCDFRunInfoFile(CModel *&pModel, optStruct &Options, bool runname_ov
261261
// EnKFMode
262262
if (!optionsonly) {
263263
retval = nc_inq_attlen(ncid, varid_props, "EnKFMode", &att_len);
264-
if(retval != NC_ENOTATT)
264+
if(retval != NC_ENOTATT)
265265
{
266266
HandleNetCDFErrors(retval);
267267
char* modestr = new char[att_len];
@@ -290,7 +290,7 @@ bool ParseNetCDFRunInfoFile(CModel *&pModel, optStruct &Options, bool runname_ov
290290
// AssimilateStreamflow
291291
if (optionsonly) {
292292
retval = nc_inq_attlen(ncid,varid_props,"AssimilateStreamflow",&att_len);
293-
if (retval != NC_ENOTATT)
293+
if (retval != NC_ENOTATT)
294294
{
295295
HandleNetCDFErrors(retval);
296296
char* boolean = new char[att_len + 1];

0 commit comments

Comments
 (0)