Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wave restart for cold start and add ic version file #3112

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
2 changes: 1 addition & 1 deletion parm/stage/master_gfs.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
{% set COMOUT_OCEAN_RESTART_PREV_MEM = COM_OCEAN_RESTART_TMPL | replace_tmpl(previous_cycle_dict) %}
{% set COMOUT_OCEAN_ANALYSIS_MEM = COM_OCEAN_ANALYSIS_TMPL | replace_tmpl(current_cycle_dict) %}
{% set COMOUT_MED_RESTART_PREV_MEM = COM_MED_RESTART_TMPL | replace_tmpl(previous_cycle_dict) %}
{% set COMOUT_WAVE_RESTART_PREV_MEM = COM_WAVE_RESTART_TMPL | replace_tmpl(previous_cycle_and_run_dict) %}
WalterKolczynski-NOAA marked this conversation as resolved.
Show resolved Hide resolved
{% set COMOUT_WAVE_RESTART_PREV_MEM = COM_WAVE_RESTART_TMPL | replace_tmpl(previous_cycle_dict) %}

# Append the member COM directories
{% do COMOUT_ATMOS_INPUT_MEM_list.append(COMOUT_ATMOS_INPUT_MEM)%}
Expand Down
50 changes: 22 additions & 28 deletions ush/forecast_postdet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -328,39 +328,33 @@ WW3_postdet() {

local ww3_grid first_ww3_restart_out ww3_restart_file
# Copy initial condition files:
if [[ "${warm_start}" == ".true." ]]; then
local restart_date restart_dir
if [[ "${RERUN}" == "YES" ]]; then
restart_date="${RERUN_DATE}"
restart_dir="${DATArestart}/WW3_RESTART"
else
restart_date="${model_start_date_current_cycle}"
restart_dir="${COMIN_WAVE_RESTART_PREV}"
fi
echo "Copying WW3 restarts for 'RUN=${RUN}' at '${restart_date}' from '${restart_dir}'"
ww3_restart_file="${restart_dir}/${restart_date:0:8}.${restart_date:8:2}0000.restart.ww3"
if [[ -f "${ww3_restart_file}" ]]; then
${NCP} "${ww3_restart_file}" "${DATA}/restart.ww3" \
local restart_date restart_dir
if [[ "${RERUN}" == "YES" ]]; then
restart_date="${RERUN_DATE}"
restart_dir="${DATArestart}/WW3_RESTART"
else
restart_date="${model_start_date_current_cycle}"
restart_dir="${COMIN_WAVE_RESTART_PREV}"
fi

echo "Copying WW3 restarts for 'RUN=${RUN}' at '${restart_date}' from '${restart_dir}'"
ww3_restart_file="${restart_dir}/${restart_date:0:8}.${restart_date:8:2}0000.restart.ww3"
if [[ -s "${ww3_restart_file}" ]]; then
${NCP} "${ww3_restart_file}" "${DATA}/restart.ww3" \
|| ( echo "FATAL ERROR: Unable to copy WW3 IC, ABORT!"; exit 1 )
first_ww3_restart_out=$(date --utc -d "${restart_date:0:8} ${restart_date:8:2} + ${restart_interval} hours" +%Y%m%d%H)
else
if [[ "${RERUN}" == "YES" ]]; then
# In the case of a RERUN, the WW3 restart file is required
echo "FATAL ERROR: WW3 restart file '${ww3_restart_file}' not found for RERUN='${RERUN}', ABORT!"
exit 1
else
if [[ "${RERUN}" == "YES" ]]; then
# In the case of a RERUN, the WW3 restart file is required
echo "FATAL ERROR: WW3 restart file '${ww3_restart_file}' not found for RERUN='${RERUN}', ABORT!"
exit 1
else
echo "WARNING: WW3 restart file '${ww3_restart_file}' not found for warm_start='${warm_start}', will start from rest!"
fi
echo "WARNING: WW3 restart file '${ww3_restart_file}' not found for warm_start='${warm_start}', will start from rest!"
first_ww3_restart_out=${model_start_date_current_cycle}
fi

first_ww3_restart_out=$(date --utc -d "${restart_date:0:8} ${restart_date:8:2} + ${restart_interval} hours" +%Y%m%d%H)
else # cold start
echo "WW3 will start from rest!"
first_ww3_restart_out="${model_start_date_current_cycle}"
fi # [[ "${warm_start}" == ".true." ]]
fi

# Link restart files
local ww3_restart_file
# Use restart_date if it was determined above, otherwise use initialization date
for (( vdate = first_ww3_restart_out; vdate <= forecast_end_cycle;
vdate = $(date --utc -d "${vdate:0:8} ${vdate:8:2} + ${restart_interval} hours" +%Y%m%d%H) )); do
ww3_restart_file="${vdate:0:8}.${vdate:8:2}0000.restart.ww3"
Expand Down
Loading