Skip to content

Commit e03713d

Browse files
committed
v532 [BENCHMARKED] - LatFlush memory bug
also fixed 2D/3D issues in ForcingGrid.cpp/ModelForcingGrids.cpp proper calculation of chunksize for non-zero grid cells
1 parent 143bf38 commit e03713d

File tree

6 files changed

+138
-113
lines changed

6 files changed

+138
-113
lines changed

src/ForcingGrid.cpp

Lines changed: 32 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ CForcingGrid::CForcingGrid(string ForcingType,
5454
// -------------------------------
5555
// Additional variables initialized and eventually overwritten by ParseTimeSeries
5656
// -------------------------------
57-
_rainfall_corr = 1.0;
58-
_snowfall_corr = 1.0;
57+
_rainfall_corr = 1.0;
58+
_snowfall_corr = 1.0;
5959
_temperature_corr = 0.0;
6060

6161
_cloud_min_temp =-20.0; //ensures cloud-free status always unless overriden
@@ -102,6 +102,8 @@ CForcingGrid::CForcingGrid(string ForcingType,
102102
/// \param ForcingType [in] an existing grid
103103
CForcingGrid::CForcingGrid( const CForcingGrid &grid )
104104
{
105+
ExitGracefullyIf(grid._nNonZeroWeightedGridCells == 0, " CForcingGrid copy constructor",RUNTIME_ERR);
106+
105107
_ForcingType = grid._ForcingType ;
106108
_filename = grid._filename ;
107109
_varname = grid._varname ;
@@ -111,10 +113,6 @@ CForcingGrid::CForcingGrid( const CForcingGrid &grid )
111113
_LinTrans_a = grid._LinTrans_a ;
112114
_LinTrans_b = grid._LinTrans_b ;
113115
_period_ending = grid._period_ending ;
114-
for (int ii=0; ii<3; ii++) {_DimNames [ii]= grid._DimNames [ii]; }
115-
for (int ii=0; ii<3; ii++) {_GridDims [ii]= grid._GridDims [ii]; }
116-
for (int ii=0; ii<3; ii++) {_WinLength[ii]= grid._WinLength[ii]; }
117-
for (int ii=0; ii<3; ii++) {_WinStart [ii]= grid._WinStart [ii]; }
118116
_nCells = grid._nCells ;
119117
_nNonZeroWeightedGridCells = grid._nNonZeroWeightedGridCells ;
120118
_nHydroUnits = grid._nHydroUnits ;
@@ -128,17 +126,20 @@ CForcingGrid::CForcingGrid( const CForcingGrid &grid )
128126
_dim_order = grid._dim_order ;
129127
_is_derived = true ;
130128
_nPulses = grid._nPulses ;
131-
_pulse = grid._pulse ;
132129
_t_corr = grid._t_corr ;
133130
_rainfall_corr = grid._rainfall_corr ;
134131
_snowfall_corr = grid._snowfall_corr ;
135132
_temperature_corr = grid._temperature_corr ;
136133
_cloud_min_temp = grid._cloud_min_temp ;
137134
_cloud_max_temp = grid._cloud_max_temp ;
138-
for (int ii=0; ii<12; ii++) {_aAveTemp[ii] = grid._aAveTemp[ii];}
139-
for (int ii=0; ii<12; ii++) {_aMinTemp[ii] = grid._aMinTemp[ii];}
140-
for (int ii=0; ii<12; ii++) {_aMaxTemp[ii] = grid._aMaxTemp[ii];}
141-
for (int ii=0; ii<12; ii++) {_aAvePET [ii] = grid._aAvePET [ii];}
135+
for (int ii=0; ii<3; ii++) {_DimNames [ii] = grid._DimNames [ii]; }
136+
for (int ii=0; ii<3; ii++) {_GridDims [ii] = grid._GridDims [ii]; }
137+
for (int ii=0; ii<3; ii++) {_WinLength[ii] = grid._WinLength[ii]; }
138+
for (int ii=0; ii<3; ii++) {_WinStart [ii] = grid._WinStart [ii]; }
139+
for (int ii=0; ii<12; ii++) {_aAveTemp [ii] = grid._aAveTemp [ii]; }
140+
for (int ii=0; ii<12; ii++) {_aMinTemp [ii] = grid._aMinTemp [ii]; }
141+
for (int ii=0; ii<12; ii++) {_aMaxTemp [ii] = grid._aMaxTemp [ii]; }
142+
for (int ii=0; ii<12; ii++) {_aAvePET [ii] = grid._aAvePET [ii]; }
142143

143144
_aVal=NULL;
144145
_aVal = new double *[_ChunkSize];
@@ -230,8 +231,7 @@ CForcingGrid::~CForcingGrid()
230231
/// dimensions and buffersize (data are only initalized but not read from file)
231232
///
232233
/// \note Needs _ForcingType, _filename, _varname, _DimNames to be set already.
233-
/// Use for that either "SetForcingType", "SetFilename", "SetVarname", and "SetDimNames" \n
234-
/// or "CForcingGrid()".
234+
/// Use for that either "SetForcingType", "SetFilename", "SetVarname", and "SetDimNames" or "CForcingGrid()".
235235
void CForcingGrid::ForcingGridInit(const optStruct &Options)
236236
{
237237
#ifdef _RVNETCDF_
@@ -317,7 +317,8 @@ void CForcingGrid::ForcingGridInit(const optStruct &Options)
317317

318318
_nCells=_GridDims[0]*_GridDims[1];
319319
}
320-
else {
320+
else //2D
321+
{
321322
// dimension x = number of stations in NetCDF file
322323
retval = nc_inq_dimid(ncid,_DimNames[0].c_str(),&dimid_x); HandleNetCDFErrors(retval);
323324
retval = nc_inq_dimlen(ncid,dimid_x,&GridDim_t); HandleNetCDFErrors(retval);
@@ -335,18 +336,18 @@ void CForcingGrid::ForcingGridInit(const optStruct &Options)
335336
string varname_e=_varname;
336337
SubstringReplace(varname_e,"*",to_string(g_current_e+1));//replaces wildcard for ensemble runs
337338

338-
retval = nc_inq_varid(ncid,varname_e.c_str(),&varid_f); HandleNetCDFErrors(retval);
339+
retval = nc_inq_varid(ncid,varname_e.c_str(),&varid_f); HandleNetCDFErrors(retval);
339340

340341
// determine in which order the dimensions are in variable
341342
retval = nc_inq_vardimid(ncid,varid_f,dimids_var); HandleNetCDFErrors(retval);
342343

343344
int ndim;
344-
retval = nc_inq_varndims(ncid,varid_f,&ndim); HandleNetCDFErrors(retval);
345+
retval = nc_inq_varndims(ncid,varid_f,&ndim); HandleNetCDFErrors(retval);
345346
if ((!_is_3D) && (ndim > 2)) {
346347
ExitGracefully("ForcingGridInit: NetCDF dataset has more than 2 dimensions, but only two supplied.",BAD_DATA);
347348
}
348349
else if ((_is_3D) && (ndim > 3)){
349-
ExitGracefully("ForcingGridInit: NetCDF dataset has more than 3 dimensions. Gridded data must be read from a 2D (time x cell) or 3D (time x row x column) NetCDF variable",BAD_DATA);
350+
ExitGracefully("ForcingGridInit: NetCDF dataset has more than 3 dimensions. Gridded data must be read from a 2D (time x cell/station) or 3D (time x row x column) NetCDF variable",BAD_DATA);
350351
}
351352

352353

@@ -430,8 +431,7 @@ void CForcingGrid::ForcingGridInit(const optStruct &Options)
430431
double time_zone=0;
431432
GetTimeInfoFromNetCDF(unit_t,calendar,my_time,ntime,_filename,_interval,_start_day,_start_year,time_zone);
432433
_steps_per_day=(int)(rvn_round(1.0/_interval)); //pre-calculate for speed.
433-
delete[] unit_t;
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);
@@ -449,7 +449,7 @@ void CForcingGrid::ForcingGridInit(const optStruct &Options)
449449
JulianConvert(0.0,_start_day-_interval,_start_year,calendar,tp);
450450
printf("ForcingGrid: start string: %s %s\n",tp.date_string.c_str(),DecDaysToHours(tp.julian_day).c_str());
451451
*/
452-
452+
delete[] unit_t;
453453
delete[] my_time;
454454

455455
//QA/QC:
@@ -521,7 +521,6 @@ void CForcingGrid::ForcingGridInit(const optStruct &Options)
521521
// Set number of pulses and pulse type to be consistent with class CTimeSeries
522522
// -------------------------------
523523
_nPulses = ntime;
524-
_pulse = true;
525524
ExitGracefullyIf(_nPulses<=0,
526525
"CForcingGrid: ForcingGridInit: no time point entries in forcing grid",BAD_DATA);
527526

@@ -562,21 +561,16 @@ void CForcingGrid::ForcingGridInit(const optStruct &Options)
562561
//
563562
void CForcingGrid::ReallocateArraysInForcingGrid( )
564563
{
565-
int ntime ; // number of time steps
566-
567-
ntime = _GridDims[2]; //assumes _Is_3D
568-
//if (_is_3D) {ntime = _GridDims[2];}
569-
//else {ntime = _GridDims[1];}
570-
//
571564
// -------------------------------
572565
// Initialize data array and set all entries to NODATA value
573566
// -------------------------------
574567
_aVal = NULL;
575-
_aVal = new double *[ntime];
576-
for (int it=0; it<ntime; it++) { // loop over time points in buffer
568+
_aVal = new double *[_ChunkSize];
569+
ExitGracefullyIf(_aVal==NULL,"CForcingGrid::ReallocateArraysInForcingGrid (1)",OUT_OF_MEMORY);
570+
for (int it=0; it<_ChunkSize; it++) { // loop over time points in buffer
577571
_aVal[it]=NULL;
578572
_aVal[it] = new double [_nNonZeroWeightedGridCells];
579-
ExitGracefullyIf(_aVal[it]==NULL,"CForcingGrid::ReallocateArraysInForcingGrid",OUT_OF_MEMORY);
573+
ExitGracefullyIf(_aVal[it]==NULL,"CForcingGrid::ReallocateArraysInForcingGrid (2)",OUT_OF_MEMORY);
580574
for (int ic=0; ic<_nNonZeroWeightedGridCells;ic++){ // loop over non-zero weighted cells
581575
_aVal[it][ic]=NETCDF_BLANK_VALUE; // initialize
582576
}
@@ -1337,7 +1331,7 @@ void CForcingGrid::SetIdxNonZeroGridCells(const int nHydroUnits, const int nGrid
13371331
}
13381332

13391333
///////////////////////////////////////////////////////////////////
1340-
/// \brief calculates _ChunkSize and total number of chunks to read _nChunks, sets the id of the current chunk
1334+
/// \brief calculates _ChunkSize and total number of chunks to read (_nChunks)
13411335
/// depending upon size of grid (_nNonZeroWeightedGridCells*buffersize*8byte <= 10 MB=10*1024*1024 byte)
13421336
/// needs to be called after SetIdxNonZeroGridCells()
13431337
///
@@ -1355,22 +1349,22 @@ void CForcingGrid::CalculateChunkSize(const optStruct& Options)
13551349
else { ntime = _GridDims[1]; }
13561350

13571351
int BytesPerTimestep; // Memory requirement for one timestep of gridded forcing file [Bytes]
1358-
if(_is_3D) { BytesPerTimestep = 8 * _WinLength[0] * _WinLength[1]; }
1359-
else { BytesPerTimestep = 8 * _WinLength[0]; }
1352+
//if(_is_3D) { BytesPerTimestep = 8 * _WinLength[0] * _WinLength[1]; }
1353+
//else { BytesPerTimestep = 8 * _WinLength[0]; }
13601354

1361-
//BytesPerTimestep = 8 * _nNonZeroWeightedGridCells; //?? amount actually stored in memory?
1355+
BytesPerTimestep = 8 * _nNonZeroWeightedGridCells; //?? amount actually stored in memory?
13621356

13631357
int CHUNK_MEMORY=Options.NetCDF_chunk_mem*1024 * 1024;
13641358

13651359
int tmpChunkSize;
13661360

1367-
tmpChunkSize = (int)(max(min(CHUNK_MEMORY / BytesPerTimestep,ntime),1)); // number of timesteps per chunk - 10MB chunks
1361+
tmpChunkSize = (int)(max(min(CHUNK_MEMORY / BytesPerTimestep,ntime),1)); // number of timesteps per chunk - 10MB chunks
13681362

13691363
if(!Options.deltaresFEWS) {
13701364
tmpChunkSize = (int)((int)(tmpChunkSize*_interval)/_interval); // make sure chunks are complete days (have to relax for FEWS)
13711365
}
13721366

1373-
tmpChunkSize = max(int(rvn_round(1.0/_interval)),tmpChunkSize); // make sure at least one day is read
1367+
tmpChunkSize = max(int(rvn_round(1.0/_interval)),tmpChunkSize); // make sure at least one day is read
13741368
// support larger chunk if model duration is small
13751369
double partday=Options.julian_start_day-floor(Options.julian_start_day);
13761370
tmpChunkSize = min(tmpChunkSize,(int) ceil(ceil(Options.duration+partday)/_interval));//ensures goes to midnight of last day
@@ -1383,7 +1377,6 @@ void CForcingGrid::CalculateChunkSize(const optStruct& Options)
13831377
cout<<"Finished CalculateChunkSize routine, # of time steps per chunk: "<<_ChunkSize<<endl;
13841378
cout<<" # of time chunks: "<<_nChunk <<endl;
13851379
}
1386-
/*cout<<"ntime: "<<ntime<<endl;*/
13871380
}
13881381
///////////////////////////////////////////////////////////////////
13891382
/// \brief sets the _nHydroUnits in class CForcingGrid
@@ -1523,9 +1516,9 @@ void CForcingGrid::SetaAvePET(const double aAvePET [12]){
15231516
void CForcingGrid::SetValue( const int ic, const int it, const double aVal) {
15241517
#ifdef _STRICTCHECK_
15251518
if(it>=_ChunkSize) {
1526-
ExitGracefully("CForcingGrid::SetValue:invalid index",RUNTIME_ERR);}
1519+
ExitGracefully("CForcingGrid::SetValue:invalid time index",RUNTIME_ERR);}
15271520
if(ic>=_nNonZeroWeightedGridCells) {
1528-
ExitGracefully("CForcingGrid::SetValue:invalid index",RUNTIME_ERR);}
1521+
ExitGracefully("CForcingGrid::SetValue:invalid cell index",RUNTIME_ERR);}
15291522
#endif
15301523
_aVal[it][ic] = aVal;
15311524
}

src/ForcingGrid.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ class CForcingGrid //: public CForcingGridABC
7878
int _WinStart [3]; ///< data grid window starting point (x,y,t - defaults to 0, 0, chunksize)
7979

8080
int _nPulses; ///< number of pulses (total duration=(nPulses-1)*_interval)
81-
bool _pulse; ///< flag determining whether this is a pulse-based or
82-
/// ///< piecewise-linear time series
81+
8382
double _t_corr; ///< correction time _t_corr, i.e. distance between
8483
/// ///< current chunk start day and model start day (in days)
8584
bool _deaccumulate; ///< true if input precipitation needs to be deaccumulated from cum. mm to mm/d

src/LatFlush.cpp

Lines changed: 49 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,16 @@ CmvLatFlush::~CmvLatFlush(){
5555
void CmvLatFlush::Initialize()
5656
{
5757
int nConn;
58-
int *kFrom=new int[_pModel->GetNumHRUs()];
59-
int *kTo =new int[_pModel->GetNumHRUs()];
60-
string fromHRUGrp=_pModel->GetHRUGroup(_kk_from)->GetName();
61-
string toHRUGrp =_pModel->GetHRUGroup( _kk_to)->GetName();
58+
int *kFrom(NULL), *kTo(NULL);
59+
kFrom=new int[MAX_LAT_CONNECTIONS];
60+
kTo = new int[MAX_LAT_CONNECTIONS];
61+
ExitGracefullyIf(kTo == NULL, "LatFLush::Initialize (1)",OUT_OF_MEMORY);
62+
63+
CHRUGroup *fromHRUGrp=_pModel->GetHRUGroup(_kk_from);
64+
CHRUGroup *toHRUGrp =_pModel->GetHRUGroup(_kk_from);
65+
_aFrac=NULL;
6266
_aFrac=new double [MAX_LAT_CONNECTIONS];
67+
ExitGracefullyIf(_aFrac == NULL, "LatFLush::Initialize",OUT_OF_MEMORY);
6368
int q=0;
6469
int k;
6570

@@ -100,37 +105,44 @@ void CmvLatFlush::Initialize()
100105
double Asum,area;
101106
for(int p=0;p<_pModel->GetNumSubBasins();p++)
102107
{
103-
104-
for(int ks=0; ks<_pModel->GetSubBasin(p)->GetNumHRUs(); ks++) //sources
105-
{
106-
k1=_pModel->GetSubBasin(p)->GetHRU(ks)->GetGlobalIndex();
107-
Asum=0.0;
108-
nRecipients=0;
109-
if (_pModel->IsInHRUGroup(k1,fromHRUGrp)){
110-
for(int ks2=0; ks2<_pModel->GetSubBasin(p)->GetNumHRUs(); ks2++) //recipients
111-
{
112-
k2=_pModel->GetSubBasin(p)->GetHRU(ks2)->GetGlobalIndex();
113-
114-
if (_pModel->IsInHRUGroup(k2,toHRUGrp))
108+
if (_pModel->GetSubBasin(p)->IsEnabled()) {
109+
110+
for(int ks=0; ks<_pModel->GetSubBasin(p)->GetNumHRUs(); ks++) //sources
111+
{
112+
k1=_pModel->GetSubBasin(p)->GetHRU(ks)->GetGlobalIndex();
113+
Asum=0.0;
114+
nRecipients=0;
115+
if (fromHRUGrp->IsInGroup(k1)) {
116+
117+
for(int ks2=0; ks2<_pModel->GetSubBasin(p)->GetNumHRUs(); ks2++) //recipients
115118
{
116-
if (k1!=k2){
117-
kFrom[q]=k1;
118-
kTo [q]=k2;
119-
area=_pModel->GetSubBasin(p)->GetHRU(ks2)->GetArea();
120-
_aFrac[q]=area;
121-
Asum+=area;//sum of recipient areas
122-
nRecipients++;
123-
q++;
124-
ExitGracefullyIf(q>=MAX_LAT_CONNECTIONS,"Number of HRU connections in LateralFlush or LateralDivert exceeds MAX_LAT_CONNECTIONS limit.",BAD_DATA);
125-
}
126-
else {
127-
source_sink_issue=true;//throw warning if source is also sink
119+
k2=_pModel->GetSubBasin(p)->GetHRU(ks2)->GetGlobalIndex();
120+
121+
if (toHRUGrp->IsInGroup(k2))
122+
{
123+
if (k1!=k2){
124+
kFrom[q]=k1;
125+
kTo [q]=k2;
126+
area=_pModel->GetSubBasin(p)->GetHRU(ks2)->GetArea();
127+
_aFrac[q]=area;
128+
Asum+=area;//sum of recipient areas
129+
nRecipients++;
130+
131+
//cout << "ADDING CONNECTION " << q << " in subbasin "<< _pModel->GetSubBasin(p)->GetName() << ": "
132+
// << _pModel->GetHydroUnit(kFrom[q])->GetHRUID() << " To " <<_pModel->GetHydroUnit(kTo[q])->GetHRUID() <<" "<<_aFrac[q]<<endl;
133+
q++;
134+
ExitGracefullyIf(q>=MAX_LAT_CONNECTIONS,"Number of HRU connections in LateralFlush or LateralDivert exceeds MAX_LAT_CONNECTIONS limit.",BAD_DATA);
135+
}
136+
else {
137+
source_sink_issue=true;//throw warning if source is also sink
138+
}
128139
}
129140
}
130141
}
131-
}
132-
for (int qq = 0; qq < nRecipients; qq++) {//once sum is known for each source, calculate fraction
133-
_aFrac[q-qq-1]=_aFrac[q-qq-1]/Asum;
142+
for (int qq = 0; qq < nRecipients; qq++) {//once sum is known for each source, calculate fraction
143+
//cout << "AFRAC INDEX: "<<q-qq-1<<endl;
144+
_aFrac[q-qq-1]=_aFrac[q-qq-1]/Asum;
145+
}
134146
}
135147
}
136148
}
@@ -150,7 +162,7 @@ void CmvLatFlush::Initialize()
150162
//toHRUGrp
151163
int kToSB=DOESNT_EXIST;
152164
for(k=0;k<_pModel->GetNumHRUs();k++) {
153-
if(_pModel->IsInHRUGroup(k,toHRUGrp)) {
165+
if (toHRUGrp->IsInGroup(k)) {
154166
ExitGracefullyIf(kToSB!=DOESNT_EXIST,
155167
"LatFlush::Initialize - only one HRU in the model can recieve flush output if INTERBASIN is used. More than one recipient HRU found.",BAD_DATA_WARN);
156168
kToSB=k;
@@ -159,9 +171,9 @@ void CmvLatFlush::Initialize()
159171
//find 'from' HRUs to make connections
160172
for(k=0;k<_pModel->GetNumHRUs();k++)
161173
{
162-
if(_pModel->IsInHRUGroup(k,fromHRUGrp) && (kToSB!=DOESNT_EXIST)) {
174+
if (fromHRUGrp->IsInGroup(k) && (kToSB!=DOESNT_EXIST) && _pModel->GetHydroUnit(k)->IsEnabled()) {
163175
kFrom[q]=k;
164-
kTo[q]=kToSB;
176+
kTo [q]=kToSB;
165177
_aFrac[q]=1.0; //only a single recipient
166178
q++;
167179
}
@@ -229,14 +241,14 @@ void CmvLatFlush::GetLateralExchange( const double * const *state_vars, //ar
229241
{
230242
stor =state_vars[_kFrom[q]][_iFromLat[q]];
231243
to_stor=state_vars[_kTo [q]][_iToLat[q]];
232-
Afrom=pHRUs[_kFrom[q]]->GetArea();
233-
Ato =pHRUs[_kTo [q]]->GetArea();
244+
Afrom =pHRUs[_kFrom[q]]->GetArea();
245+
Ato =pHRUs[_kTo [q]]->GetArea();
234246
max_to_stor=pHRUs[_kTo [q]]->GetStateVarMax(_iToLat[q],state_vars[_kTo[q]],Options);
235247
max_rate =max(max_to_stor-to_stor,0.0)/Options.timestep*Ato;
236248

237249
if (_divert) {
238250
mult=pHRUs[_kFrom[q]]->GetSurfaceProps()->divert_fract;
239-
p=pHRUs[_kFrom[q]]->GetSubBasinIndex();
251+
p =pHRUs[_kFrom[q]]->GetSubBasinIndex();
240252
mult*=_pModel->GetSubBasin(p)->GetDivertFract();
241253
//cout<<" Lat Flush "<<q<<" kFrom: "<<_kFrom[q]<<" "<<_kTo[q] <<" iFrom: "<<_iFromLat[q]<<" "<< mult << " " << _aFrac[q] << " " << stor << endl;
242254
}

src/ModelForcingGrids.cpp

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,22 @@ CForcingGrid *CModel::ForcingCopyCreate(const CForcingGrid *pGrid,
3333

3434
pTout = new CForcingGrid(*pGrid); // copy everything from pGrid; matrices are deep copies
3535

36-
//following values are overwritten:
36+
//type, chunk size, and time dimension are overwritten:
3737
int GridDims[3];
38-
GridDims[0] = pGrid->GetCols();
39-
GridDims[1] = pGrid->GetRows();
40-
GridDims[2] = nVals;
38+
if (pGrid->GetIs3D()) {
39+
GridDims[0] = pGrid->GetCols();
40+
GridDims[1] = pGrid->GetRows();
41+
GridDims[2] = nVals;
42+
}
43+
else {
44+
GridDims[0] = pGrid->GetCols();
45+
GridDims[1] = nVals;
46+
}
4147
pTout->SetForcingType(typ);
4248
pTout->SetInterval(interval);
4349
pTout->SetGridDims(GridDims);
4450

45-
pTout->SetChunkSize(nVals);
46-
//pTout->CalculateChunkSize(Options);
51+
pTout->CalculateChunkSize(Options);
4752
pTout->ReallocateArraysInForcingGrid();
4853
}
4954
else
@@ -101,6 +106,7 @@ void CModel::GenerateGriddedPrecipVars(const optStruct &Options)
101106
//pGrid_pre->SetChunkSize(pGrid_pre->GetChunkSize()-1);
102107
}*/
103108
if(snow_gridded && rain_gridded && !pre_gridded) {
109+
if(Options.noisy) { cout<<"Generating precip grid from snow and rain"<<endl; }
104110
GeneratePrecipFromSnowRain(Options);
105111
}
106112
if(!rain_gridded && !snow_gridded && pre_gridded) {
@@ -194,6 +200,7 @@ void CModel::GenerateGriddedTempVars(const optStruct &Options)
194200

195201
if(Options.noisy) { cout<<"...done generating gridded temperature variables."<<endl; }
196202
}
203+
197204
//////////////////////////////////////////////////////////////////
198205
/// \brief Generates Tave and subhourly time series from daily Tmin & Tmax time series
199206
/// \note presumes existence of valid F_TEMP_DAILY_MIN and F_TEMP_DAILY_MAX time series

0 commit comments

Comments
 (0)