diff --git a/ush/python/pygfs/task/archive.py b/ush/python/pygfs/task/archive.py index 389075472e2..1e1a6b3c951 100644 --- a/ush/python/pygfs/task/archive.py +++ b/ush/python/pygfs/task/archive.py @@ -9,7 +9,8 @@ from wxflow import (AttrDict, FileHandler, Hsi, Htar, Task, to_timedelta, chgrp, get_gid, logit, mkdir_p, parse_j2yaml, rm_p, rmdir, - strftime, to_YMDH, which, chdir, ProcessError, save_as_yaml) + strftime, to_YMDH, which, chdir, ProcessError, save_as_yaml, + add_to_datetime) git_filename = "git_info.log" logger = getLogger(__name__.split('.')[-1]) @@ -688,7 +689,8 @@ def _arch_warm_restart_ics(self, arch_dict: Dict[str, Any]) -> bool: # Not the right cycle hour return False - days_since_sdate = (arch_dict.current_cycle - SDATE).days + ics_offset_cycle = add_to_datetime(arch_dict.current_cycle, to_timedelta(f"+{assim_freq}H")) + days_since_sdate = (ics_offset_cycle - SDATE).days if arch_dict.ARCH_WARMICFREQ > 0 and days_since_sdate % arch_dict.ARCH_WARMICFREQ == 0: # We are on the right cycle hour and the right day return True