From 8ded48b2e8c13969968137e368cbea3f0afc3abf Mon Sep 17 00:00:00 2001 From: Guillaume Vernieres Date: Thu, 9 May 2024 14:07:27 -0400 Subject: [PATCH 1/7] make seaice da work --- 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 +++++++++------ 5 files changed, 14 insertions(+), 9 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 9c8858ec3d..85338c416e 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 From 4a652f95f2728e6fcfffb4e52b2e3a8efda02c2b Mon Sep 17 00:00:00 2001 From: Guillaume Vernieres Date: Mon, 13 May 2024 15:03:35 -0400 Subject: [PATCH 2/7] fixed missing ice anl for 1/2 cycle --- ush/forecast_postdet.sh | 2 +- workflow/setup_expt.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ush/forecast_postdet.sh b/ush/forecast_postdet.sh index 85338c416e..645ed993f8 100755 --- a/ush/forecast_postdet.sh +++ b/ush/forecast_postdet.sh @@ -528,7 +528,7 @@ CICE_postdet() { 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" + cice_restart_file="${COM_ICE_ANALYSIS}/restart/${restart_date:0:8}.${restart_date:8:2}0000.cice_model_anl.res.nc" fi fi diff --git a/workflow/setup_expt.py b/workflow/setup_expt.py index 9602b66b60..05b8b83ee8 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', 'restart') dst_atm_anl_dir = os.path.join('analysis', 'atmos') if flat_structure: @@ -118,6 +119,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 +205,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) From 56f857d1af240ddb15554f00c699a8e381d8bea1 Mon Sep 17 00:00:00 2001 From: Guillaume Vernieres Date: Mon, 13 May 2024 15:13:02 -0400 Subject: [PATCH 3/7] py norm --- workflow/setup_expt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workflow/setup_expt.py b/workflow/setup_expt.py index 05b8b83ee8..5253d104a8 100755 --- a/workflow/setup_expt.py +++ b/workflow/setup_expt.py @@ -96,7 +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', 'restart') + dst_ice_anl_dir = os.path.join('analysis', 'ice', 'restart') dst_atm_anl_dir = os.path.join('analysis', 'atmos') if flat_structure: @@ -119,7 +119,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_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): From e10646b3968cdf1d29bb2121b772147b5ba1339e Mon Sep 17 00:00:00 2001 From: Guillaume Vernieres Date: Mon, 13 May 2024 15:34:59 -0400 Subject: [PATCH 4/7] testing/wip --- jobs/JGLOBAL_PREP_OCEAN_OBS | 3 ++- jobs/rocoto/prepoceanobs.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/jobs/JGLOBAL_PREP_OCEAN_OBS b/jobs/JGLOBAL_PREP_OCEAN_OBS index 339d90567e..23e5d352de 100755 --- a/jobs/JGLOBAL_PREP_OCEAN_OBS +++ b/jobs/JGLOBAL_PREP_OCEAN_OBS @@ -17,7 +17,8 @@ YMD=${PDY} HH=${cyc} declare_from_tmpl -rx COMOUT_OBS:COM_OBS_TMPL ############################################################### # Run relevant script -EXSCRIPT=${GDASPREPOCNOBSPY:-${SCRgfs}/exglobal_prep_ocean_obs.py} +#EXSCRIPT=${GDASPREPOCNOBSPY:-${SCRgfs}/exglobal_prep_ocean_obs.py} +EXSCRIPT=/home/Guillaume.Vernieres/scratch1/runs/cp2/global-workflow/sorc/gdas.cd/scripts/exglobal_prep_ocean_obs.py ${EXSCRIPT} status=$? [[ ${status} -ne 0 ]] && exit "${status}" diff --git a/jobs/rocoto/prepoceanobs.sh b/jobs/rocoto/prepoceanobs.sh index d8626f5518..37aa8ce056 100755 --- a/jobs/rocoto/prepoceanobs.sh +++ b/jobs/rocoto/prepoceanobs.sh @@ -16,7 +16,8 @@ export jobid="${job}.$$" # setup python path for class defs and utils PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${HOMEgfs}/ush" - +test="/home/Guillaume.Vernieres/scratch1/runs/cp2/global-workflow/sorc/gdas.cd/build/lib/python3.10" +PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${test}" ############################################################### # Execute the JJOB "${HOMEgfs}"/jobs/JGLOBAL_PREP_OCEAN_OBS From 7942fe20d3b16c03bc69616eb6f0c49e3ccb2a9b Mon Sep 17 00:00:00 2001 From: Guillaume Vernieres Date: Thu, 30 May 2024 19:07:56 +0000 Subject: [PATCH 5/7] added marine bufr to ioda --- sorc/link_workflow.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sorc/link_workflow.sh b/sorc/link_workflow.sh index c5d7243e8f..64b76768b6 100755 --- a/sorc/link_workflow.sh +++ b/sorc/link_workflow.sh @@ -252,9 +252,16 @@ if [[ -d "${HOMEgfs}/sorc/gdas.cd/build" ]]; then ${LINK_OR_COPY} "${HOMEgfs}/sorc/gdas.cd/ush/ioda/bufr2ioda/gen_bufr2ioda_yaml.py" . ${LINK_OR_COPY} "${HOMEgfs}/sorc/gdas.cd/ush/ioda/bufr2ioda/run_bufr2ioda.py" . ${LINK_OR_COPY} "${HOMEgfs}/sorc/gdas.cd/build/bin/imsfv3_scf2ioda.py" . + declare -a gdasapp_ocn_insitu_profile_platforms=("argo" "bathy" "glider" "marinemammal" "tesac" "xbtctd") + for platform in "${gdasapp_ocn_insitu_profile_platforms[@]}"; do + ${LINK_OR_COPY} "${HOMEgfs}/sorc/gdas.cd/ush/ioda/bufr2ioda/marine/bufr2ioda_insitu_profile_${platform}.py" . + done + declare -a gdasapp_ocn_insitu_sfc_platforms=("altkob" "trkob") + for platform in "${gdasapp_ocn_insitu_sfc_platforms[@]}"; do + ${LINK_OR_COPY} "${HOMEgfs}/sorc/gdas.cd/ush/ioda/bufr2ioda/marine/bufr2ioda_insitu_surface_${platform}.py" . + done fi - - +exit #------------------------------ #--add DA Monitor file (NOTE: ensure to use correct version) #------------------------------ From 889770b5e5c60194b979ca581aa97534e45e775d Mon Sep 17 00:00:00 2001 From: Guillaume Vernieres Date: Thu, 30 May 2024 15:59:37 -0400 Subject: [PATCH 6/7] ... --- jobs/JGLOBAL_PREP_OCEAN_OBS | 3 +-- jobs/rocoto/prepoceanobs.sh | 3 +-- sorc/link_workflow.sh | 3 ++- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/jobs/JGLOBAL_PREP_OCEAN_OBS b/jobs/JGLOBAL_PREP_OCEAN_OBS index 23e5d352de..339d90567e 100755 --- a/jobs/JGLOBAL_PREP_OCEAN_OBS +++ b/jobs/JGLOBAL_PREP_OCEAN_OBS @@ -17,8 +17,7 @@ YMD=${PDY} HH=${cyc} declare_from_tmpl -rx COMOUT_OBS:COM_OBS_TMPL ############################################################### # Run relevant script -#EXSCRIPT=${GDASPREPOCNOBSPY:-${SCRgfs}/exglobal_prep_ocean_obs.py} -EXSCRIPT=/home/Guillaume.Vernieres/scratch1/runs/cp2/global-workflow/sorc/gdas.cd/scripts/exglobal_prep_ocean_obs.py +EXSCRIPT=${GDASPREPOCNOBSPY:-${SCRgfs}/exglobal_prep_ocean_obs.py} ${EXSCRIPT} status=$? [[ ${status} -ne 0 ]] && exit "${status}" diff --git a/jobs/rocoto/prepoceanobs.sh b/jobs/rocoto/prepoceanobs.sh index 37aa8ce056..d8626f5518 100755 --- a/jobs/rocoto/prepoceanobs.sh +++ b/jobs/rocoto/prepoceanobs.sh @@ -16,8 +16,7 @@ export jobid="${job}.$$" # setup python path for class defs and utils PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${HOMEgfs}/ush" -test="/home/Guillaume.Vernieres/scratch1/runs/cp2/global-workflow/sorc/gdas.cd/build/lib/python3.10" -PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${test}" + ############################################################### # Execute the JJOB "${HOMEgfs}"/jobs/JGLOBAL_PREP_OCEAN_OBS diff --git a/sorc/link_workflow.sh b/sorc/link_workflow.sh index 7e6f8ebb72..f338f2bad3 100755 --- a/sorc/link_workflow.sh +++ b/sorc/link_workflow.sh @@ -262,7 +262,8 @@ if [[ -d "${HOMEgfs}/sorc/gdas.cd/build" ]]; then ${LINK_OR_COPY} "${HOMEgfs}/sorc/gdas.cd/ush/ioda/bufr2ioda/marine/bufr2ioda_insitu_surface_${platform}.py" . done fi -exit + + #------------------------------ #--add DA Monitor file (NOTE: ensure to use correct version) #------------------------------ From 289251e85b94246cf2138f73e8adc849dcb8a470 Mon Sep 17 00:00:00 2001 From: Guillaume Vernieres Date: Fri, 31 May 2024 20:14:02 +0000 Subject: [PATCH 7/7] updated gdas.cd --- sorc/gdas.cd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sorc/gdas.cd b/sorc/gdas.cd index 6742ec62a1..af13ff83f0 160000 --- a/sorc/gdas.cd +++ b/sorc/gdas.cd @@ -1 +1 @@ -Subproject commit 6742ec62a12d7d6f8129057bcf77cee0e2175022 +Subproject commit af13ff83f084c045e31ceade2a52fb35583c98df