From de0a8d471dc332a4f3701a89918333da92aa349d Mon Sep 17 00:00:00 2001 From: chan-hoo Date: Mon, 2 Dec 2024 11:03:13 -0600 Subject: [PATCH] fix restart file name issue --- parm/templates/template.land_analysis.yaml | 1 + scripts/exlandda_analysis.sh | 8 ++--- scripts/exlandda_forecast.sh | 42 ++++++++++++++-------- 3 files changed, 33 insertions(+), 18 deletions(-) diff --git a/parm/templates/template.land_analysis.yaml b/parm/templates/template.land_analysis.yaml index 87270509..61a0f640 100644 --- a/parm/templates/template.land_analysis.yaml +++ b/parm/templates/template.land_analysis.yaml @@ -282,6 +282,7 @@ workflow: CCPP_SUITE: "&CCPP_SUITE;" COLDSTART: "&COLDSTART;" COMROOT: "&COMROOT;" + COUPLER_CALENDAR: "&COUPLER_CALENDAR;" cyc: "&cyc;" DATAROOT: "&DATAROOT;" DATE_FIRST_CYCLE: "&DATE_FIRST_CYCLE;" diff --git a/scripts/exlandda_analysis.sh b/scripts/exlandda_analysis.sh index fe6993c6..95e339aa 100755 --- a/scripts/exlandda_analysis.sh +++ b/scripts/exlandda_analysis.sh @@ -47,14 +47,14 @@ ln -nsf ${COMIN}/obs/GHCN_${YYYY}${MM}${DD}${HH}.nc . # update coupler.res file settings="\ 'coupler_calendar': ${COUPLER_CALENDAR} - 'yyyy': !!str ${YYYY} - 'mm': !!str ${MM} - 'dd': !!str ${DD} - 'hh': !!str ${HH} 'yyyp': !!str ${YYYP} 'mp': !!str ${MP} 'dp': !!str ${DP} 'hp': !!str ${HP} + 'yyyy': !!str ${YYYY} + 'mm': !!str ${MM} + 'dd': !!str ${DD} + 'hh': !!str ${HH} " # End of settings variable fp_template="${PARMlandda}/templates/template.coupler.res" diff --git a/scripts/exlandda_forecast.sh b/scripts/exlandda_forecast.sh index c96c2ba3..987b9590 100755 --- a/scripts/exlandda_forecast.sh +++ b/scripts/exlandda_forecast.sh @@ -228,7 +228,7 @@ sfc_fns=( "facsf" "maximum_snow_albedo" "slope_type" "snowfree_albedo" "soil_col for ifn in "${sfc_fns[@]}" ; do for itile in {1..6}; do - cp -p "${FIXlandda}/FV3_fix_tiled/C${RES}/C${RES}.${ifn}.tile${itile}.nc" . + ln -nsf "${FIXlandda}/FV3_fix_tiled/C${RES}/C${RES}.${ifn}.tile${itile}.nc" . done done @@ -278,24 +278,38 @@ if [ "${APP}" = "ATML" ]; then do r_fp="${data_dir}/RESTART/${YYYY}${MM}${DD}.${HH}0000.${ifn}.tile${itile}.nc" if [ -f "${r_fp}" ]; then - ln -nsf "${r_fp}" . + ln -nsf "${r_fp}" "${ifn}.tile${itile}.nc" else err_exit "${r_fp} file does not exist." fi done + if [ "${ifn}" = "fv_core.res" ]; then + r_fp="${data_dir}/RESTART/${YYYY}${MM}${DD}.${HH}0000.${ifn}.nc" + if [ -f "${r_fp}" ]; then + ln -nsf "${r_fp}" "${ifn}.nc" + else + err_exit "${r_fp} file does not exist." + fi + fi done - r_fp="${data_dir}/RESTART/${YYYY}${MM}${DD}.${HH}0000.fv_core.res.nc" - if [ -f "${r_fp}" ]; then - ln -nsf "${r_fp}" . - else - err_exit "${r_fp} file does not exist." - fi - r_fp="${data_dir}/RESTART/${YYYY}${MM}${DD}.${HH}0000.coupler.res" - if [ -f "${r_fp}" ]; then - ln -nsf "${r_fp}" . - else - err_exit "${r_fp} file does not exist." - fi + + # update coupler.res file + settings="\ + 'coupler_calendar': ${COUPLER_CALENDAR} + 'yyyp': !!str ${YYYY} + 'mp': !!str ${MM} + 'dp': !!str ${DD} + 'hp': !!str ${HH} + 'yyyy': !!str ${YYYY} + 'mm': !!str ${MM} + 'dd': !!str ${DD} + 'hh': !!str ${HH} +" # End of settings variable + + fp_template="${PARMlandda}/templates/template.coupler.res" + fn_namelist="coupler.res" + ${USHlandda}/fill_jinja_template.py -u "${settings}" -t "${fp_template}" -o "${fn_namelist}" + fi fi