Skip to content

Commit 2664fee

Browse files
committed
v534b - support for spaces in netCDF file path
1 parent d15c1cf commit 2664fee

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/ParseTimeSeriesFile.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,15 +1582,16 @@ bool ParseTimeSeriesFile(CModel *&pModel, const optStruct &Options)
15821582
break;
15831583
}
15841584
case (402)://----------------------------------------------
1585-
{/*:FileNameNC [filename] */
1585+
{/*:FileNameNC [filename (possibly with spaces, but no commas)] */
15861586
if (Options.noisy){cout <<" :FileNameNC"<<endl;}
15871587
#ifndef _RVNETCDF_
15881588
ExitGracefully("ParseTimeSeriesFile: :GriddedForcing and :StationForcing blocks are only allowed when NetCDF library is available!",BAD_DATA);
15891589
#else
15901590
ExitGracefullyIf(pGrid==NULL, "ParseTimeSeriesFile: :FileNameNC command must be within a :GriddedForcings or :StationForcing block",BAD_DATA);
15911591
ExitGracefullyIf(grid_initialized,"ParseTimeSeriesFile: :FileNameNC command must be before :GridWeights command",BAD_DATA);
15921592

1593-
string filename=s[1];
1593+
string filename="";
1594+
for(int i=1;i<Len;i++) { filename+=s[i]; if(i<Len-1) { filename+=' '; } }
15941595
filename =CorrectForRelativePath(filename ,Options.rvt_filename);
15951596

15961597
// check for existence

0 commit comments

Comments
 (0)