Skip to content

Commit 85a8936

Browse files
authored
Merge pull request #63 from CSHS-CWRA/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2 parents 971bc39 + ff1bb2b commit 85a8936

20 files changed

+52
-52
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ default_language_version:
33

44
repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks
6-
rev: v5.0.0
6+
rev: v6.0.0
77
hooks:
88
- id: check-json
99
- id: pretty-format-json
@@ -26,7 +26,7 @@ repos:
2626
# - id: include-what-you-use
2727

2828
- repo: https://github.com/python-jsonschema/check-jsonschema
29-
rev: 0.33.2
29+
rev: 0.34.0
3030
hooks:
3131
- id: check-github-workflows
3232
- repo: meta

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

0 commit comments

Comments
 (0)