From 7d2c539f45194cd4e5b21bfd4b83a9480189cd0f Mon Sep 17 00:00:00 2001 From: Guillaume Vernieres Date: Tue, 21 May 2024 23:50:50 -0400 Subject: [PATCH] Sea-ice analysis insertion (#2584) Allows cycling and restarting CICE with the sea-ice analysis if the marine DA is switched on. Resolves #2568 Resolves NOAA-EMC/GDASApp#1103 --- jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_POST | 3 ++- jobs/JGLOBAL_FORECAST | 2 +- parm/config/gfs/config.com | 1 + sorc/gdas.cd | 2 +- ush/forecast_postdet.sh | 15 +++++++++------ workflow/setup_expt.py | 8 ++++++-- 6 files changed, 20 insertions(+), 11 deletions(-) diff --git a/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_POST b/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_POST index ef2f07cfe5..c87dc6b34f 100755 --- a/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_POST +++ b/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_POST @@ -13,9 +13,10 @@ export CDATE=${CDATE:-${PDY}${cyc}} export GDUMP=${GDUMP:-"gdas"} # Generate COM variables from templates -YMD=${PDY} HH=${cyc} declare_from_tmpl -rx COM_OCEAN_ANALYSIS COM_ICE_RESTART +YMD=${PDY} HH=${cyc} declare_from_tmpl -rx COM_OCEAN_ANALYSIS COM_ICE_ANALYSIS COM_ICE_RESTART mkdir -p "${COM_OCEAN_ANALYSIS}" +mkdir -p "${COM_ICE_ANALYSIS}" mkdir -p "${COM_ICE_RESTART}" ############################################## diff --git a/jobs/JGLOBAL_FORECAST b/jobs/JGLOBAL_FORECAST index 8d91be8a57..9ae247cdca 100755 --- a/jobs/JGLOBAL_FORECAST +++ b/jobs/JGLOBAL_FORECAST @@ -36,7 +36,7 @@ declare -rx gcyc="${GDATE:8:2}" # Construct COM variables from templates (see config.com) YMD="${PDY}" HH="${cyc}" declare_from_tmpl -rx COM_ATMOS_RESTART COM_ATMOS_INPUT COM_ATMOS_ANALYSIS \ - COM_ATMOS_HISTORY COM_ATMOS_MASTER COM_TOP COM_CONF + COM_ICE_ANALYSIS COM_ATMOS_HISTORY COM_ATMOS_MASTER COM_TOP COM_CONF RUN="${rCDUMP}" YMD="${gPDY}" HH="${gcyc}" declare_from_tmpl -rx \ COM_ATMOS_RESTART_PREV:COM_ATMOS_RESTART_TMPL diff --git a/parm/config/gfs/config.com b/parm/config/gfs/config.com index 5d63a499ed..004ca1affb 100644 --- a/parm/config/gfs/config.com +++ b/parm/config/gfs/config.com @@ -84,6 +84,7 @@ declare -rx COM_OCEAN_NETCDF_TMPL=${COM_BASE}'/products/ocean/netcdf' declare -rx COM_OCEAN_GRIB_TMPL=${COM_BASE}'/products/ocean/grib2' declare -rx COM_OCEAN_GRIB_GRID_TMPL=${COM_OCEAN_GRIB_TMPL}'/${GRID}' +declare -rx COM_ICE_ANALYSIS_TMPL=${COM_BASE}'/analysis/ice' declare -rx COM_ICE_INPUT_TMPL=${COM_BASE}'/model_data/ice/input' declare -rx COM_ICE_HISTORY_TMPL=${COM_BASE}'/model_data/ice/history' declare -rx COM_ICE_RESTART_TMPL=${COM_BASE}'/model_data/ice/restart' diff --git a/sorc/gdas.cd b/sorc/gdas.cd index 2b2d417a96..249e242e33 160000 --- a/sorc/gdas.cd +++ b/sorc/gdas.cd @@ -1 +1 @@ -Subproject commit 2b2d417a96528527d7d3e7eedaccf150dc075d92 +Subproject commit 249e242e33a33feeb1c81bedd51198309f669de0 diff --git a/ush/forecast_postdet.sh b/ush/forecast_postdet.sh index 0257d17e23..f5a2bec07c 100755 --- a/ush/forecast_postdet.sh +++ b/ush/forecast_postdet.sh @@ -253,15 +253,15 @@ FV3_out() { # Copy the final restart files at the end of the forecast segment # The final restart written at the end of the forecast does not include the valid date # TODO: verify the above statement since RM found that it did! - # TODO: For other components, this is only for gfs/gefs - check to see if this should also have this - if [[ "${COPY_FINAL_RESTARTS}" == "YES" ]]; then + # TODO: For other components, this is only for gfs/gefs - check to see if this should also have this + if [[ "${COPY_FINAL_RESTARTS}" == "YES" ]]; then echo "Copying FV3 restarts for 'RUN=${RUN}' at the end of the forecast segment: ${forecast_end_cycle}" for fv3_restart_file in "${fv3_restart_files[@]}"; do restart_file="${forecast_end_cycle:0:8}.${forecast_end_cycle:8:2}0000.${fv3_restart_file}" ${NCP} "${DATArestart}/FV3_RESTART/${restart_file}" \ "${COM_ATMOS_RESTART}/${restart_file}" done - fi + fi echo "SUB ${FUNCNAME[0]}: Output data for FV3 copied" } @@ -499,7 +499,7 @@ MOM6_out() { ${NCP} "${DATArestart}/MOM6_RESTART/${restart_file}" \ "${COM_OCEAN_RESTART}/${restart_file}" done - fi + fi fi # Copy restarts for the next cycle for RUN=gdas|enkfgdas|enkfgfs @@ -527,6 +527,9 @@ CICE_postdet() { else # "${RERUN}" == "NO" restart_date="${model_start_date_current_cycle}" cice_restart_file="${COM_ICE_RESTART_PREV}/${restart_date:0:8}.${restart_date:8:2}0000.cice_model.res.nc" + if [[ "${DO_JEDIOCNVAR:-NO}" == "YES" ]]; then + cice_restart_file="${COM_ICE_ANALYSIS}/${restart_date:0:8}.${restart_date:8:2}0000.cice_model_anl.res.nc" + fi fi # Copy CICE ICs @@ -592,7 +595,7 @@ CICE_out() { target_file="${forecast_end_cycle:0:8}.${forecast_end_cycle:8:2}0000.cice_model.res.nc" ${NCP} "${DATArestart}/CICE_RESTART/${source_file}" \ "${COM_ICE_RESTART}/${target_file}" - fi + fi fi # Copy restarts for next cycle for RUN=gdas|enkfgdas|enkfgfs @@ -728,7 +731,7 @@ CMEPS_out() { else echo "Mediator restart '${DATArestart}/CMEPS_RESTART/${source_file}' not found." fi - fi + fi # Copy restarts for the next cycle to COM for RUN=gdas|enkfgdas|enkfgfs if [[ "${RUN}" =~ "gdas" || "${RUN}" == "enkfgfs" ]]; then diff --git a/workflow/setup_expt.py b/workflow/setup_expt.py index 9602b66b60..97d25dc15a 100755 --- a/workflow/setup_expt.py +++ b/workflow/setup_expt.py @@ -96,6 +96,7 @@ def fill_ROTDIR_cycled(host, inputs): dst_ocn_rst_dir = os.path.join('model_data', 'ocean', 'restart') dst_ocn_anl_dir = os.path.join('analysis', 'ocean') dst_ice_rst_dir = os.path.join('model_data', 'ice', 'restart') + dst_ice_anl_dir = os.path.join('analysis', 'ice') dst_atm_anl_dir = os.path.join('analysis', 'atmos') if flat_structure: @@ -111,6 +112,7 @@ def fill_ROTDIR_cycled(host, inputs): src_ocn_rst_dir = os.path.join('ocean', 'RESTART') src_ocn_anl_dir = 'ocean' src_ice_rst_dir = os.path.join('ice', 'RESTART') + src_ice_anl_dir = dst_ice_anl_dir src_atm_anl_dir = 'atmos' else: src_atm_dir = dst_atm_dir @@ -118,6 +120,7 @@ def fill_ROTDIR_cycled(host, inputs): src_ocn_rst_dir = dst_ocn_rst_dir src_ocn_anl_dir = dst_ocn_anl_dir src_ice_rst_dir = dst_ice_rst_dir + src_ice_anl_dir = dst_ice_anl_dir src_atm_anl_dir = dst_atm_anl_dir def link_files_from_src_to_dst(src_dir, dst_dir): @@ -203,8 +206,9 @@ def link_files_from_src_to_dst(src_dir, dst_dir): # Link ice files if do_ice: - dst_dir = os.path.join(rotdir, previous_cycle_dir, dst_ice_rst_dir) - src_dir = os.path.join(inputs.icsdir, previous_cycle_dir, src_ice_rst_dir) + # First 1/2 cycle needs a CICE6 analysis restart + src_dir = os.path.join(inputs.icsdir, current_cycle_dir, src_ice_anl_dir) + dst_dir = os.path.join(rotdir, current_cycle_dir, src_ice_anl_dir) makedirs_if_missing(dst_dir) link_files_from_src_to_dst(src_dir, dst_dir)