Index: wflow-py/wflow/wf_DynamicFramework.py =================================================================== diff -u -rced522d9cb1398cc92a7bbbcc69d23b88708d088 -rf48b5321292915b892132463b750dbda2998e3cb --- wflow-py/wflow/wf_DynamicFramework.py (.../wf_DynamicFramework.py) (revision ced522d9cb1398cc92a7bbbcc69d23b88708d088) +++ wflow-py/wflow/wf_DynamicFramework.py (.../wf_DynamicFramework.py) (revision f48b5321292915b892132463b750dbda2998e3cb) @@ -691,13 +691,17 @@ self.logger.debug("Found following input variables to get from netcdf file: " + str(varlst)) self.NcInput = netcdfinput(os.path.join(caseName, self.ncfile), self.logger, varlst) - # Setup all the netCDF files that may be used for input/output + if self.ncfilestates != "None": smaps = self._userModel().stateVariables() maps = [s + ".map" for s in smaps] self.logger.debug("Found following input states to get from netcdf file: " + str(maps)) self.NcInputStates = netcdfinputstates(os.path.join(caseName, self.ncfilestates), self.logger, maps) + + if self.ncfilestatic != "None": + self.NcInputStatic = netcdfinputstatic(os.path.join(caseName, self.ncfilestatic), self.logger) + if self.ncoutfile != 'None': # Ncoutput buffer = int(configget(self._userModel().config, 'framework', 'netcdfwritebuffer', "50")) meta = {} @@ -735,14 +739,8 @@ zlib=self.ncfilecompression,least_significant_digit=self.ncfiledigits) - if self.ncfilestatic != 'None': # Ncoutput - meta = {} - meta['caseName'] = caseName - meta['runId'] = runId - meta['wflow_version'] =__version__ - meta['wflow_release'] =__release__ - self.NcInputStatic = netcdfinput(os.path.join(caseName, self.ncfilestatic), self.logger, varlst) + # Fill the summary (stat) list from the ini file self.statslst = [] _type = wf_sumavg(None) @@ -2008,13 +2006,18 @@ self.logger.error("Required map: " + os.path.abspath(path) + " not found, exiting..") sys.exit(1) return scalar(default) + if self._userModel()._inInitial(): - if ncfilesource == self.ncfilestatic: + if self.ncfilestatic is not 'None': retval, succ = self.NcInputStatic.gettimestep(1, self.logger, var=varname) if succ: return retval else: - return scalar(default) + if fail: + self.logger.error("Required map: " + os.path.abspath(path) + " not found in " + self.ncfilestatic + " exiting..") + sys.exit(1) + else: + return scalar(default) if os.path.isfile(path): mapje = readmap(path)