Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions ush/python/pygfs/task/snow_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ def __init__(self, config: Dict[str, Any]):
_res = int(self.task_config['CASE'][1:])

# if 00z, do SCF preprocessing
_ims_file = os.path.join(self.task_config.COMIN_OBS, f'{self.task_config.OPREFIX}imssnow96.asc')
logger.info(f"Checking for IMS file: {_ims_file}")
if self.task_config.cyc == 0 and os.path.exists(_ims_file):
_DO_IMS_SCF = True
else:
_DO_IMS_SCF = False
_imsnc_file = os.path.join(self.task_config.COMIN_OBS, f'{self.task_config.OPREFIX}imssnow96.nc')
_imsasc_file = os.path.join(self.task_config.COMIN_OBS, f'{self.task_config.OPREFIX}imssnow96.asc')
_ims_file = (
_imsnc_file if os.path.exists(_imsnc_file)
else _imsasc_file if os.path.exists(_imsasc_file)
else None
)
_DO_IMS_SCF = (self.task_config.cyc == 0 and _ims_file is not None)

# Extend task_config with variables repeatedly used across this class
self.task_config.update(AttrDict(
Expand Down
14 changes: 8 additions & 6 deletions ush/python/pygfs/task/snowens_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,14 @@ def __init__(self, config: Dict[str, Any]):
_res = int(self.task_config['CASE_ENS'][1:])

# if 00z, do SCF preprocessing
_ims_file = os.path.join(self.task_config.COMIN_OBS, f'{self.task_config.OPREFIX}imssnow96.asc')
logger.info(f"Checking for IMS file: {_ims_file}")
if self.task_config.cyc == 0 and os.path.exists(_ims_file):
_DO_IMS_SCF = True
else:
_DO_IMS_SCF = False
_imsnc_file = os.path.join(self.task_config.COMIN_OBS, f'{self.task_config.OPREFIX}imssnow96.nc')
_imsasc_file = os.path.join(self.task_config.COMIN_OBS, f'{self.task_config.OPREFIX}imssnow96.asc')
_ims_file = (
_imsnc_file if os.path.exists(_imsnc_file)
else _imsasc_file if os.path.exists(_imsasc_file)
else None
)
_DO_IMS_SCF = (self.task_config.cyc == 0 and _ims_file is not None)

# Extend task_config with variables repeatedly used across this class
self.task_config.update(AttrDict(
Expand Down
Loading