Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions ush/forecast_postdet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,20 @@ FV3_postdet() {
fi
done

# Need a coupler.res when doing IAU
# Need a coupler.res that is consistent with the model start time
if [[ "${DOIAU}" == "YES" ]]; then
rm -f "${DATA}/INPUT/coupler.res"
cat >> "${DATA}/INPUT/coupler.res" << EOF
3 (Calendar: no_calendar=0, thirty_day_months=1, julian=2, gregorian=3, noleap=4)
${previous_cycle:0:4} ${previous_cycle:4:2} ${previous_cycle:6:2} ${previous_cycle:8:2} 0 0 Model start time: year, month, day, hour, minute, second
${current_cycle_begin:0:4} ${current_cycle_begin:4:2} ${current_cycle_begin:6:2} ${current_cycle_begin:8:2} 0 0 Current model time: year, month, day, hour, minute, second
EOF
local model_start_time="${previous_cycle}"
local model_current_time="${current_cycle_begin}"
else
local model_start_time="${current_cycle}"
local model_current_time="${current_cycle}"
fi
rm -f "${DATA}/INPUT/coupler.res"
cat >> "${DATA}/INPUT/coupler.res" << EOF
3 (Calendar: no_calendar=0, thirty_day_months=1, julian=2, gregorian=3, noleap=4)
${model_start_time:0:4} ${model_start_time:4:2} ${model_start_time:6:2} ${model_start_time:8:2} 0 0 Model start time: year, month, day, hour, minute, second
${model_current_time:0:4} ${model_current_time:4:2} ${model_current_time:6:2} ${model_current_time:8:2} 0 0 Current model time: year, month, day, hour, minute, second
EOF

# Create a array of increment files
local inc_files inc_file iaufhrs iaufhr
Expand Down
10 changes: 10 additions & 0 deletions ush/forecast_predet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,18 @@ FV3_predet(){
FHCYC=${FHCYC:-24}
restart_interval=${restart_interval:-${FHMAX}}
# restart_interval = 0 implies write restart at the END of the forecast i.e. at FHMAX
# Convert restart interval into an explicit list for FV3
if (( restart_interval == 0 )); then
restart_interval=${FHMAX}
FV3_RESTART_FH=("${restart_interval}")
else
# shellcheck disable=SC2312
mapfile -t FV3_RESTART_FH < <(seq "${restart_interval}" "${restart_interval}" "${FHMAX}")
# If the last forecast hour is not in the array, add it
local nrestarts=${#FV3_RESTART_FH[@]}
if (( FV3_RESTART_FH[nrestarts-1] != FHMAX )); then
FV3_RESTART_FH+=("${FHMAX}")
fi
fi

# Convert output settings into an explicit list for FV3
Expand Down
2 changes: 1 addition & 1 deletion ush/parsing_model_configure_FV3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ local SHOUR=${model_start_date:8:2}
# FHMAX
local FHROT=${IAU_FHROT:-0}
local DT_ATMOS=${DELTIM}
local RESTART_INTERVAL="${restart_interval} -1"
local RESTART_INTERVAL="${FV3_RESTART_FH[*]}"
# QUILTING
local QUILTING_RESTART=".true."
local WRITE_GROUP=${WRITE_GROUP:-1}
Expand Down