Index: examples/wflow_rhine_sbm/wflow_sbm_NC.ini =================================================================== diff -u --- examples/wflow_rhine_sbm/wflow_sbm_NC.ini (revision 0) +++ examples/wflow_rhine_sbm/wflow_sbm_NC.ini (revision 4e5a1fe8152659a68db505e39fd3aedea2dac0e9) @@ -0,0 +1,159 @@ +[API] +IF=0,1 +InwaterMM=2,4 +#FirstZoneDepth=2,1 +#Latitude=1,5 +#Longitude=1,5 + + +# Define the forcings needed for the model here +# the filename is either the name of the pcraster map-stack or the name of the +# variable in the netcdf input file +[inputmapstacks] +Precipitation = /inmaps/P +EvapoTranspiration = /inmaps/PET +Temperature = /inmaps/TEMP +# this is optional inflow (positive) or outflow (negative) of the kin-wave reservoir +Inflow = /inmaps/IF + + + +[modelparameters] +# Format: +# name=stack,type,default +# example: +# RootingDepth=monthlyclim/ROOT,monthyclim,100 + +# - name - Name of the parameter (internal variable) +# - stack - Name of the mapstack (representation on disk or in mem) relative to case +# - type - Type of parameter (default = static) +# - default - Default value if map/tbl is not present + +#Possible types are:: +# - staticmap: Read at startup from map +# - statictbl: Read at startup from tbl +# - timeseries: read map for each timestep +# - monthlyclim: read a map corresponding to the current month (12 maps in total) +# - dailyclim: read a map corresponding to the current day of the year +# - hourlyclim: read a map corresponding to the current hour of the day (24 in total) (not implemented yet) +RootingDepth=monthlyclim/ROOT,monthlyclim,75 + +[run] +# either a runinfo file or a start and end-time are required +#runinfo=runinfo.xml +starttime= 1995-01-31 00:00:00 +endtime= 1995-02-28 00:00:00 +# required, base timestep of the model +timestepsecs = 86400 +#start model with cold state +reinit=1 + +# Model parameters and settings +[model] +modeltype= sbm + +AnnualDischarge=2290 +# Alpha for wiver-width estimation 5 for mountain stream 60 for the river rhine +Alpha=120 +ModelSnow=0 +ScalarInput=0 +InterpolationMethod=inv +WIMaxScale=0.8 +Tslice=1 +# Maximum upstream distance to update the flow in metres +UpdMaxDist=300000.0 +#SubCatchFlowOnly = 1 +origTopogLateral = 1 + + +#DynamicVegetation=1 + +[misc] +#mapSaveInterval=365 + +[framework] +# outputformat for the *dynamic* mapstacks (not the states and summary maps) +# 1: pcraster +# 2: numpy +# 3: matlab + +# netcdfoutput requires also outputformat = 1 (default) and additionally the name of the file +netcdfoutput = outmaps.nc +netcdfinput= inmaps.nc +netcdfwritebuffer=100 + + + +[layout] +# if set to zero the cell-size is given in lat/long (the default) +sizeinmetres = 0 + + + + +[outputmaps] +#self.Inflow=iflow + +#self.WaterDem=wat +#self.SubCellFrac=scf +#self.Inwater=inw +#self.DistToUpdPt=dist +#self.SnowMelt=sno +#self.FirstZoneFlux=fzf +#self.TopoLdd=ldd +self.InwaterMM=iwm +#self.watbal=wat +self.PotenEvap=PET +self.Precipitation=P + +[summary] +self.MaxLeakage=MaxLeakage.map +# Save and average these per LU type + +[summary_sum] +self.Precipitation=Sumprecip.map + +[summary_max] +self.Precipitation=maxprecip.map + +[summary_min] +#self.Temperature=mintemp.map + +[summary_avg] +self.Precipitation=avgprecip.map + +[outputcsv_0] +samplemap=staticmaps/wflow_landuse.map +self.Transfer=tra_lu.csv + +# gauge output +[outputtss_0] +samplemap=staticmaps/wflow_gauges.map +self.SurfaceRunoff=run.tss +self.WaterLevel=lev.tss + +[outputtss_1] +samplemap=staticmaps/wflow_gauges.map +self.ActLeakage=lek.tss +# Save and sample these at gauge locations + +[outputcsv_1] +samplemap=staticmaps/area.map +#samplemap=staticmaps/wflow_subcatch.map + +# Alle runoff in mm +self.InwaterMM=specrun.csv + + +# Neerslag in mm +self.Precipitation=prec.csv + +# totale verdamping in mm +self.ActEvap+self.Interception=teact.csv + +# Totale storage in mm +self.UStoreDepth + self.FirstZoneDepth + self.CanopyStorage = store.csv + +# water budget not taking Delta S and GW flux into account +self.Precipitation - self.ActEvap - self.Interception - self.InwaterMM = watbalnostore.csv + Index: wflow-py/wflow/wf_DynamicFramework.py =================================================================== diff -u -r8e380ffbfaedb9df9fccee3c03ebb53e346d1a71 -r4e5a1fe8152659a68db505e39fd3aedea2dac0e9 --- wflow-py/wflow/wf_DynamicFramework.py (.../wf_DynamicFramework.py) (revision 8e380ffbfaedb9df9fccee3c03ebb53e346d1a71) +++ wflow-py/wflow/wf_DynamicFramework.py (.../wf_DynamicFramework.py) (revision 4e5a1fe8152659a68db505e39fd3aedea2dac0e9) @@ -538,7 +538,7 @@ for ms in mstacks: varlst.append(os.path.basename(configget(self._userModel().config,'inputmapstacks',ms,'None'))) self.logger.debug("Found following input variables to get from netcdf file: " + str(varlst)) - self.NcInput = netcdfinput('inmaps.nc',self.logger,varlst) + self.NcInput = netcdfinput(self.ncfile,self.logger,varlst) if self.ncoutfile != 'None': # Ncoutput buffer = int(configget(self._userModel().config,'framework','netcdfwritebuffer',"50")) Index: wflow-py/wflow/wf_netcdfio.py =================================================================== diff -u -r72f1d687460baaf44741a4b0638c18539816bdc8 -r4e5a1fe8152659a68db505e39fd3aedea2dac0e9 --- wflow-py/wflow/wf_netcdfio.py (.../wf_netcdfio.py) (revision 72f1d687460baaf44741a4b0638c18539816bdc8) +++ wflow-py/wflow/wf_netcdfio.py (.../wf_netcdfio.py) (revision 4e5a1fe8152659a68db505e39fd3aedea2dac0e9) @@ -123,6 +123,8 @@ self.bufflst={} globmetadata.update(metadata) + + prepare_nc(self.ncfile,timeList,x,y,globmetadata,logger,Format=netcdfformat) @@ -198,7 +200,13 @@ logging: python logging object vars: list of variables to get from file """ - self.dataset = netCDF4.Dataset(netcdffile,mode='r') + + if os.path.exists(netcdffile): + self.dataset = netCDF4.Dataset(netcdffile,mode='r') + else: + logging.error(netcdffile + " not found!") + exit(ValueError) + logging.info("Reading input from netCDF file: " + netcdffile + ": " + str(self.dataset).replace('\n',' ')) self.alldat ={} a = pcr2numpy(cover(0.0),0.0).flatten() Index: wflow-py/wflow/wflow_adapt.py =================================================================== diff -u -r0e398d50f19553d9ddce2b6c7ce47fb059aef5ba -r4e5a1fe8152659a68db505e39fd3aedea2dac0e9 --- wflow-py/wflow/wflow_adapt.py (.../wflow_adapt.py) (revision 0e398d50f19553d9ddce2b6c7ce47fb059aef5ba) +++ wflow-py/wflow/wflow_adapt.py (.../wflow_adapt.py) (revision 4e5a1fe8152659a68db505e39fd3aedea2dac0e9) @@ -42,7 +42,6 @@ .. todo:: rewrite and simplify - convert log to XML $Author: schelle $ $Id: wflow_adapt.py 915 2014-02-10 07:33:56Z schelle $