Skip to content

Commit

Permalink
fix restart file name issue
Browse files Browse the repository at this point in the history
  • Loading branch information
chan-hoo committed Dec 2, 2024
1 parent 2181730 commit de0a8d4
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 18 deletions.
1 change: 1 addition & 0 deletions parm/templates/template.land_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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;"
Expand Down
8 changes: 4 additions & 4 deletions scripts/exlandda_analysis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
42 changes: 28 additions & 14 deletions scripts/exlandda_forecast.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit de0a8d4

Please sign in to comment.