Skip to content
Snippets Groups Projects
Commit 7cc70ba6 authored by Peters, Wouter's avatar Peters, Wouter
Browse files

outputdir needs name change after recover from crash

parent 4f95cc96
No related branches found
No related tags found
No related merge requests found
...@@ -381,10 +381,12 @@ class CycleControl(dict): ...@@ -381,10 +381,12 @@ class CycleControl(dict):
- copying all data from the restart/one-ago folder (:meth:`~da.tools.initexit.CycleControl.MoveRestartData`), - copying all data from the restart/one-ago folder (:meth:`~da.tools.initexit.CycleControl.MoveRestartData`),
- replacing all ``rc-file`` items with those from the ``da_runtime.rc`` in the restart/current dir - replacing all ``rc-file`` items with those from the ``da_runtime.rc`` in the restart/current dir
- resetting the seed of the random number generator to the value it had before the crash (:meth:`~da.tools.initexit.CycleControl.RandomSeed`) - resetting the seed of the random number generator to the value it had before the crash (:meth:`~da.tools.initexit.CycleControl.RandomSeed`)
- replacing the output dir name, since it has the sample time in it...
""" """
import da.tools.rc as rc import da.tools.rc as rc
import shutil import shutil
from da.tools.general import CreateDirs
# Replace rc-items with those from the crashed run's last rc-file (now in restart.current dir) # Replace rc-items with those from the crashed run's last rc-file (now in restart.current dir)
...@@ -407,6 +409,12 @@ class CycleControl(dict): ...@@ -407,6 +409,12 @@ class CycleControl(dict):
msg = "Replaced randomseed file with previous cycles' last values" ; logging.debug(msg) msg = "Replaced randomseed file with previous cycles' last values" ; logging.debug(msg)
# Re-create the output dir for this time step, if needed
filtertime = self['time.start'].strftime('%Y%m%d')
self['dir.output'] = os.path.join(self['dir.da_run'],'output',filtertime)
CreateDirs(os.path.join(self['dir.output']))
return None return None
def Finalize(self): def Finalize(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment