diff --git a/utils/SnapPy/Snappy/Resources.py b/utils/SnapPy/Snappy/Resources.py index 98f78130..09abaee5 100644 --- a/utils/SnapPy/Snappy/Resources.py +++ b/utils/SnapPy/Snappy/Resources.py @@ -61,6 +61,7 @@ class Resources(ResourcesCommon): # OUTPUTDIR = "/disk1/tmp" _OUTPUTDIR = "{LUSTREDIR}/project/fou/kl/snap/runs" + _OUTPUTDIR_AUTOMATED = "{LUSTREDIR}/project/fou/kl/snap/automated_runs" _ECINPUTDIRS = ["{LUSTREDIR}/project/metproduction/products/cwf-input/"] # ECINPUTDIRS = ["/lustre/storeB/users/heikok/Meteorology/ecdis2cwf/"] EC_FILENAME_PATTERN = "meteo{year:04d}{month:02d}{day:02d}_{dayoffset:02d}.nc" @@ -508,8 +509,21 @@ def getBSnapInputFile(self): return filename def getSnapOutputDir(self): + """Output directory of SNAP-runs for manual runs through the front-end. + This directory is available for all SnapPy users. + + :return: path as directory, adapted for LUSTREDIR + """ return self._OUTPUTDIR.format(LUSTREDIR=self.getLustreDir()) + def getSnapOutputDirAutomated(self): + """Output directory of SNAP-runs for automated runs, e.g. run through cron. + This directory is available for group snap-op. + + :return: path as directory, adapted for LUSTREDIR + """ + return self._OUTPUTDIR_AUTOMATED.format(LUSTREDIR=self.getLustreDir()) + def _findFileInPathes(self, file, pathes): for path in pathes: filename = os.path.join(path, file) diff --git a/utils/SnapPy/snapRunnerNpp b/utils/SnapPy/snapRunnerNpp index dec5f665..ca4fda34 100755 --- a/utils/SnapPy/snapRunnerNpp +++ b/utils/SnapPy/snapRunnerNpp @@ -214,7 +214,7 @@ def runsnap(npp_tag, met_model, outdir, release_dt, runtime, plot_from_file=None npp = get_tag_NPP(npp_tag) res = Resources() dirname = os.path.join( - res.getSnapOutputDir(), + res.getSnapOutputDirAutomated(), "{0}_{1}".format(npp, strftime("%Y-%m-%dT%H%M%S", tag_time)), ) diff --git a/utils/SnapPy/snapRunnerNpps b/utils/SnapPy/snapRunnerNpps index 72666874..89838477 100755 --- a/utils/SnapPy/snapRunnerNpps +++ b/utils/SnapPy/snapRunnerNpps @@ -185,7 +185,7 @@ def runsnap(npps, outdir): release_dt.timestamp() + i ) # ensure a few secs difference for tags nppdir[tag] = os.path.join( - res.getSnapOutputDir(), + res.getSnapOutputDirAutomated(), "{0}_{1}".format(tag, strftime("%Y-%m-%dT%H%M%S", tag_time)), ) runparams.append([npp_tag, release_dt, tag_time, nppdir[tag], res])