From 7a791460a7e60a4b331f58f66ea5a3ae236887c3 Mon Sep 17 00:00:00 2001 From: Guillaume Vernieres Date: Wed, 7 Aug 2024 14:09:30 -0400 Subject: [PATCH] Marine DA updates (#2802) Companion PR to GDASApp#1226 Addresses a few issues described in: - GDASApp#1219 - GDASApp#1217 - GDASApp#1232 --- ci/cases/gfsv17/ocnanal.yaml | 2 +- jobs/rocoto/prepoceanobs.sh | 6 ++++-- parm/config/gfs/config.resources | 2 +- sorc/gdas.cd | 2 +- ush/python/pygfs/task/marine_bmat.py | 11 +++++------ ush/python/pygfs/utils/marine_da_utils.py | 23 ----------------------- versions/fix.ver | 2 +- 7 files changed, 13 insertions(+), 35 deletions(-) diff --git a/ci/cases/gfsv17/ocnanal.yaml b/ci/cases/gfsv17/ocnanal.yaml index a2d7363c18..483250db10 100644 --- a/ci/cases/gfsv17/ocnanal.yaml +++ b/ci/cases/gfsv17/ocnanal.yaml @@ -17,7 +17,7 @@ base: ACCOUNT: {{ 'HPC_ACCOUNT' | getenv }} ocnanal: - SOCA_INPUT_FIX_DIR: {{ FIXgfs }}/gdas/soca/1440x1080x75/soca + SOCA_INPUT_FIX_DIR: {{ HOMEgfs }}/fix/gdas/soca/1440x1080x75/soca SOCA_OBS_LIST: {{ HOMEgfs }}/sorc/gdas.cd/parm/soca/obs/obs_list.yaml SOCA_NINNER: 100 diff --git a/jobs/rocoto/prepoceanobs.sh b/jobs/rocoto/prepoceanobs.sh index d8626f5518..20aca4f15a 100755 --- a/jobs/rocoto/prepoceanobs.sh +++ b/jobs/rocoto/prepoceanobs.sh @@ -14,8 +14,10 @@ export jobid="${job}.$$" ############################################################### # setup python path for class defs and utils - -PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${HOMEgfs}/ush" +# shellcheck disable=SC2311 +pyiodaPATH="${HOMEgfs}/sorc/gdas.cd/build/lib/python$(detect_py_ver)/" +PYTHONPATH="${pyiodaPATH}:${PYTHONPATH}" +export PYTHONPATH ############################################################### # Execute the JJOB diff --git a/parm/config/gfs/config.resources b/parm/config/gfs/config.resources index 7b737d05f0..a596629e76 100644 --- a/parm/config/gfs/config.resources +++ b/parm/config/gfs/config.resources @@ -544,7 +544,7 @@ case ${step} in case ${OCNRES} in "025") memory="128GB" - ntasks=40;; + ntasks=16;; "050") memory="32GB" ntasks=16;; diff --git a/sorc/gdas.cd b/sorc/gdas.cd index 52f41a298b..f62b9128a9 160000 --- a/sorc/gdas.cd +++ b/sorc/gdas.cd @@ -1 +1 @@ -Subproject commit 52f41a298b4c6b7bbf6f203b6579516819fbbf36 +Subproject commit f62b9128a98cce3d800dd90ad85753b6e178665f diff --git a/ush/python/pygfs/task/marine_bmat.py b/ush/python/pygfs/task/marine_bmat.py index 9d64e621c9..4770583934 100644 --- a/ush/python/pygfs/task/marine_bmat.py +++ b/ush/python/pygfs/task/marine_bmat.py @@ -43,7 +43,7 @@ def __init__(self, config): 'MARINE_WINDOW_END': _window_end, 'MARINE_WINDOW_MIDDLE': self.task_config.current_cycle, 'BERROR_YAML_DIR': os.path.join(_home_gdas, 'parm', 'soca', 'berror'), - 'GRID_GEN_YAML': os.path.join(_home_gdas, 'parm', 'soca', 'gridgen', 'gridgen.yaml'), + 'UTILITY_YAML_TMPL': os.path.join(_home_gdas, 'parm', 'soca', 'soca_utils_stage.yaml.j2'), 'MARINE_ENSDA_STAGE_BKG_YAML_TMPL': os.path.join(_home_gdas, 'parm', 'soca', 'ensda', 'stage_ens_mem.yaml.j2'), 'MARINE_DET_STAGE_BKG_YAML_TMPL': os.path.join(_home_gdas, 'parm', 'soca', 'soca_det_bkg_stage.yaml.j2'), 'ENSPERT_RELPATH': _enspert_relpath, @@ -82,12 +82,11 @@ def initialize(self: Task) -> None: # TODO(G): Check ocean backgrounds dates for consistency bkg_list = parse_j2yaml(self.task_config.MARINE_DET_STAGE_BKG_YAML_TMPL, self.task_config) FileHandler(bkg_list).sync() - for cice_fname in ['./INPUT/cice.res.nc', './bkg/ice.bkg.f006.nc', './bkg/ice.bkg.f009.nc']: - mdau.cice_hist2fms(cice_fname, cice_fname) - # stage the grid generation yaml - FileHandler({'copy': [[self.task_config.GRID_GEN_YAML, - os.path.join(self.task_config.DATA, 'gridgen.yaml')]]}).sync() + # stage the soca utility yamls (gridgen, fields and ufo mapping yamls) + logger.info(f"Staging SOCA utility yaml files from {self.task_config.HOMEgfs}/parm/gdas/soca") + soca_utility_list = parse_j2yaml(self.task_config.UTILITY_YAML_TMPL, self.task_config) + FileHandler(soca_utility_list).sync() # generate the variance partitioning YAML file logger.debug("Generate variance partitioning YAML file") diff --git a/ush/python/pygfs/utils/marine_da_utils.py b/ush/python/pygfs/utils/marine_da_utils.py index 016551878b..2be76ac028 100644 --- a/ush/python/pygfs/utils/marine_da_utils.py +++ b/ush/python/pygfs/utils/marine_da_utils.py @@ -61,29 +61,6 @@ def prep_input_nml(task_config: AttrDict) -> None: nml.write('mom_input.nml') -@logit(logger) -def cice_hist2fms(input_filename: str, output_filename: str) -> None: - """ Reformat the CICE history file so it can be read by SOCA/FMS - Simple reformatting utility to allow soca/fms to read the CICE history files - """ - - # open the CICE history file - ds = xr.open_dataset(input_filename) - - if 'aicen' in ds.variables and 'hicen' in ds.variables and 'hsnon' in ds.variables: - logger.info(f"*** Already reformatted, skipping.") - return - - # rename the dimensions to xaxis_1 and yaxis_1 - ds = ds.rename({'ni': 'xaxis_1', 'nj': 'yaxis_1'}) - - # rename the variables - ds = ds.rename({'aice_h': 'aicen', 'hi_h': 'hicen', 'hs_h': 'hsnon'}) - - # Save the new netCDF file - ds.to_netcdf(output_filename, mode='w') - - @logit(logger) def stage_ens_mem(task_config: AttrDict) -> None: """ Copy the ensemble members to the DATA directory diff --git a/versions/fix.ver b/versions/fix.ver index c77b0a22c1..3f85a45fee 100644 --- a/versions/fix.ver +++ b/versions/fix.ver @@ -9,7 +9,7 @@ export cpl_ver=20230526 export datm_ver=20220805 export gdas_crtm_ver=20220805 export gdas_fv3jedi_ver=20220805 -export gdas_soca_ver=20240624 +export gdas_soca_ver=20240802 export gdas_gsibec_ver=20240416 export gdas_obs_ver=20240213 export glwu_ver=20220805