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

Resolve IC filename mismatch and differentiate model component start date variables #2909

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
4 changes: 4 additions & 0 deletions parm/config/gfs/config.stage_ic
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ export BASE_IC="@BASE_IC@" # Platform home for staged ICs

export STAGE_IC_YAML_TMPL="${PARMgfs}/stage/master_gfs.yaml.j2"

if [[ "${MODE}" = "cycled" && "${SDATE}" = "${PDY}${cyc}" && ${EXP_WARM_START} = ".false." ]] || [[ "${MODE}" = "forecast-only" && ${EXP_WARM_START} = ".false." ]] ; then
export DOIAU="NO" # Force it off for cold-start
fi

# Set ICSDIR (if not defined)
if [[ -z "${ICSDIR}" ]] ; then

Expand Down
2 changes: 1 addition & 1 deletion parm/stage/atmosphere_nest.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ atmosphere_nest:
{% set imem = mem - first_mem %}
{% set COMOUT_ATMOS_RESTART_PREV_MEM = COMOUT_ATMOS_RESTART_PREV_MEM_list[imem] %}
{% for ftype in ["ca_data", "fv_core.res", "fv_srf_wnd.res", "fv_tracer.res", "phy_data", "sfc_data"] %}
- ["{{ ICSDIR }}/{{ COMOUT_ATMOS_RESTART_PREV_MEM | relpath(ROTDIR) }}/{{ m_prefix }}.{{ ftype }}.tile{{ ntile }}.nc", "{{ COMOUT_ATMOS_RESTART_PREV_MEM }}/{{ m_prefix }}.{{ ftype }}.nest0{{ ntile-5 }}.tile{{ ntile }}.nc"]
- ["{{ ICSDIR }}/{{ COMOUT_ATMOS_RESTART_PREV_MEM | relpath(ROTDIR) }}/{{ model_atmos_cur_prefix }}.{{ ftype }}.tile{{ ntile }}.nc", "{{ COMOUT_ATMOS_RESTART_PREV_MEM }}/{{ model_atmos_cur_prefix }}.{{ ftype }}.nest0{{ ntile-5 }}.tile{{ ntile }}.nc"]
{% endfor %}
{% endfor %} # mem loop
{% else %} # cold start
Expand Down
2 changes: 1 addition & 1 deletion parm/stage/atmosphere_perturbation.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ atmosphere_perturbation:
{% for mem in range(first_mem, last_mem + 1) %}
{% set imem = mem - first_mem %}
{% set COMOUT_ATMOS_ANALYSIS_MEM = COMOUT_ATMOS_ANALYSIS_MEM_list[imem] %}
- ["{{ ICSDIR }}/{{ COMOUT_ATMOS_ANALYSIS_MEM | relpath(ROTDIR) }}/{{ m_prefix }}.fv3_perturbation.nc", "{{ COMOUT_ATMOS_ANALYSIS_MEM }}/{{ RUN }}.t{{ current_cycle_HH }}z.atminc.nc"]
- ["{{ ICSDIR }}/{{ COMOUT_ATMOS_ANALYSIS_MEM | relpath(ROTDIR) }}/{{ model_atmos_cur_prefix }}.fv3_perturbation.nc", "{{ COMOUT_ATMOS_ANALYSIS_MEM }}/{{ RUN }}.t{{ current_cycle_HH }}z.atminc.nc"]
{% endfor %} # mem loop
12 changes: 6 additions & 6 deletions parm/stage/atmosphere_warm.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ atmosphere_warm:
{% for mem in range(first_mem, last_mem + 1) %}
{% set imem = mem - first_mem %}
{% set COMOUT_ATMOS_RESTART_PREV_MEM = COMOUT_ATMOS_RESTART_PREV_MEM_list[imem] %}
{% if path_exists(ICSDIR ~ "/" ~ COMOUT_ATMOS_RESTART_PREV_MEM | relpath(ROTDIR) ~ "/" ~ m_prefix ~ ".atm_stoch.res.nc") %}
- ["{{ ICSDIR }}/{{ COMOUT_ATMOS_RESTART_PREV_MEM | relpath(ROTDIR) }}/{{ m_prefix }}.atm_stoch.res.nc", "{{ COMOUT_ATMOS_RESTART_PREV_MEM }}"]
{% if path_exists(ICSDIR ~ "/" ~ COMOUT_ATMOS_RESTART_PREV_MEM | relpath(ROTDIR) ~ "/" ~ model_atmos_cur_prefix ~ ".atm_stoch.res.nc") %}
- ["{{ ICSDIR }}/{{ COMOUT_ATMOS_RESTART_PREV_MEM | relpath(ROTDIR) }}/{{ model_atmos_cur_prefix }}.atm_stoch.res.nc", "{{ COMOUT_ATMOS_RESTART_PREV_MEM }}"]
{% endif %} # path_exists
{% for ftype in ["coupler.res", "fv_core.res.nc"] %}
- ["{{ ICSDIR }}/{{ COMOUT_ATMOS_RESTART_PREV_MEM | relpath(ROTDIR) }}/{{ m_prefix }}.{{ ftype }}", "{{ COMOUT_ATMOS_RESTART_PREV_MEM }}"]
- ["{{ ICSDIR }}/{{ COMOUT_ATMOS_RESTART_PREV_MEM | relpath(ROTDIR) }}/{{ model_atmos_cur_prefix }}.{{ ftype }}", "{{ COMOUT_ATMOS_RESTART_PREV_MEM }}"]
{% endfor %}
{% for ftype in ["ca_data", "fv_core.res", "fv_srf_wnd.res", "fv_tracer.res", "phy_data", "sfc_data"] %}
{% for ntile in range(1, ntiles + 1) %}
- ["{{ ICSDIR }}/{{ COMOUT_ATMOS_RESTART_PREV_MEM | relpath(ROTDIR) }}/{{ m_prefix }}.{{ ftype }}.tile{{ ntile }}.nc", "{{ COMOUT_ATMOS_RESTART_PREV_MEM }}"]
- ["{{ ICSDIR }}/{{ COMOUT_ATMOS_RESTART_PREV_MEM | relpath(ROTDIR) }}/{{ model_atmos_cur_prefix }}.{{ ftype }}.tile{{ ntile }}.nc", "{{ COMOUT_ATMOS_RESTART_PREV_MEM }}"]
{% endfor %} # ntile
{% endfor %} # ftype
{% for ntile in range(1, ntiles + 1) %}
{% if path_exists(ICSDIR ~ "/" ~ COMOUT_ATMOS_RESTART_PREV_MEM | relpath(ROTDIR) ~ "/" ~ p_prefix ~ ".sfcanl_data.tile" ~ ntile ~ ".nc") %}
- ["{{ ICSDIR }}/{{ COMOUT_ATMOS_RESTART_PREV_MEM | relpath(ROTDIR) }}/{{ p_prefix }}.sfcanl_data.tile{{ ntile }}.nc", "{{ COMOUT_ATMOS_RESTART_PREV_MEM }}"]
{% if path_exists(ICSDIR ~ "/" ~ COMOUT_ATMOS_RESTART_PREV_MEM | relpath(ROTDIR) ~ "/" ~ model_atmos_prev_prefix ~ ".sfcanl_data.tile" ~ ntile ~ ".nc") %}
- ["{{ ICSDIR }}/{{ COMOUT_ATMOS_RESTART_PREV_MEM | relpath(ROTDIR) }}/{{ model_atmos_prev_prefix }}.sfcanl_data.tile{{ ntile }}.nc", "{{ COMOUT_ATMOS_RESTART_PREV_MEM }}"]
{% endif %} # path_exists
{% endfor %} # ntile
{% endfor %} # mem loop
4 changes: 2 additions & 2 deletions parm/stage/ice.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ice:
{% for mem in range(first_mem, last_mem + 1) %}
{% set imem = mem - first_mem %}
{% set COMOUT_ICE_ANALYSIS_MEM = COMOUT_ICE_ANALYSIS_MEM_list[imem] %}
- ["{{ ICSDIR }}/{{ COMOUT_ICE_ANALYSIS_MEM | relpath(ROTDIR) }}/{{ m_prefix }}.cice_model_anl.res.nc", "{{ COMOUT_ICE_ANALYSIS_MEM }}"]
- ["{{ ICSDIR }}/{{ COMOUT_ICE_ANALYSIS_MEM | relpath(ROTDIR) }}/{{ model_ice_cur_prefix }}.cice_model_anl.res.nc", "{{ COMOUT_ICE_ANALYSIS_MEM }}"]
{% endfor %} # mem loop
{% else %}
mkdir:
Expand All @@ -23,6 +23,6 @@ ice:
{% for mem in range(first_mem, last_mem + 1) %}
{% set imem = mem - first_mem %}
{% set COMOUT_ICE_RESTART_PREV_MEM = COMOUT_ICE_RESTART_PREV_MEM_list[imem] %}
- ["{{ ICSDIR }}/{{ COMOUT_ICE_RESTART_PREV_MEM | relpath(ROTDIR) }}/{{ m_prefix }}.cice_model.res.nc", "{{ COMOUT_ICE_RESTART_PREV_MEM }}"]
- ["{{ ICSDIR }}/{{ COMOUT_ICE_RESTART_PREV_MEM | relpath(ROTDIR) }}/{{ model_ice_cur_prefix }}.cice_model.res.nc", "{{ COMOUT_ICE_RESTART_PREV_MEM }}"]
{% endfor %} # mem loop
{% endif %}
8 changes: 6 additions & 2 deletions parm/stage/master_gefs.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@
{% set current_cycle_HH = current_cycle | strftime("%H") %}
{% set previous_cycle_YMD = previous_cycle | to_YMD %}
{% set previous_cycle_HH = previous_cycle | strftime("%H") %}
{% set p_prefix = previous_cycle | strftime("%Y%m%d.%H0000") %}
{% set m_prefix = model_start_date_current_cycle | strftime("%Y%m%d.%H0000") %}
{% set model_atmos_prev_prefix = previous_cycle | strftime("%Y%m%d.%H0000") %}
{% set model_atmos_cur_prefix = model_start_date_current_cycle | strftime("%Y%m%d.%H0000") %}
{% set model_ice_cur_prefix = model_start_date_current_cycle | strftime("%Y%m%d.%H0000") %}
{% set model_med_cur_prefix = model_start_date_current_cycle | strftime("%Y%m%d.%H0000") %}
{% set model_ocean_cur_prefix = model_start_date_current_cycle | strftime("%Y%m%d.%H0000") %}
{% set model_wave_cur_prefix = current_cycle | strftime("%Y%m%d.%H0000") %}

# Set first/last mem for loop
# ---------------------------
Expand Down
8 changes: 6 additions & 2 deletions parm/stage/master_gfs.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@
{% set current_cycle_HH = current_cycle | strftime("%H") %}
{% set previous_cycle_YMD = previous_cycle | to_YMD %}
{% set previous_cycle_HH = previous_cycle | strftime("%H") %}
{% set p_prefix = previous_cycle | strftime("%Y%m%d.%H0000") %}
{% set m_prefix = model_start_date_current_cycle | strftime("%Y%m%d.%H0000") %}
{% set model_atmos_prev_prefix = previous_cycle | strftime("%Y%m%d.%H0000") %}
{% set model_atmos_cur_prefix = model_start_date_current_cycle | strftime("%Y%m%d.%H0000") %}
{% set model_ice_cur_prefix = model_start_date_current_cycle | strftime("%Y%m%d.%H0000") %}
{% set model_med_cur_prefix = model_start_date_current_cycle | strftime("%Y%m%d.%H0000") %}
{% set model_ocean_cur_prefix = model_start_date_current_cycle | strftime("%Y%m%d.%H0000") %}
{% set model_wave_cur_prefix = current_cycle | strftime("%Y%m%d.%H0000") %}

# Determine restart RUN
# ---------------------
Expand Down
4 changes: 2 additions & 2 deletions parm/stage/ocean.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ ocean:
{% for mem in range(first_mem, last_mem + 1) %}
{% set imem = mem - first_mem %}
{% set COMOUT_OCEAN_RESTART_PREV_MEM = COMOUT_OCEAN_RESTART_PREV_MEM_list[imem] %}
- ["{{ ICSDIR }}/{{ COMOUT_OCEAN_RESTART_PREV_MEM | relpath(ROTDIR) }}/{{ m_prefix }}.MOM.res.nc", "{{ COMOUT_OCEAN_RESTART_PREV_MEM }}"]
- ["{{ ICSDIR }}/{{ COMOUT_OCEAN_RESTART_PREV_MEM | relpath(ROTDIR) }}/{{ model_ocean_cur_prefix }}.MOM.res.nc", "{{ COMOUT_OCEAN_RESTART_PREV_MEM }}"]
{% if OCNRES == "025" %}
{% for nn in range(1, 4) %}
- ["{{ ICSDIR }}/{{ COMOUT_OCEAN_RESTART_PREV_MEM | relpath(ROTDIR) }}/{{ m_prefix }}.MOM.res_{{ nn }}.nc", "{{ COMOUT_OCEAN_RESTART_PREV_MEM }}"]
- ["{{ ICSDIR }}/{{ COMOUT_OCEAN_RESTART_PREV_MEM | relpath(ROTDIR) }}/{{ model_ocean_cur_prefix }}.MOM.res_{{ nn }}.nc", "{{ COMOUT_OCEAN_RESTART_PREV_MEM }}"]
{% endfor %}
{% endif %}
{% endfor %} # mem loop
4 changes: 2 additions & 2 deletions parm/stage/ocean_mediator.yaml.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% if path_exists(ICSDIR ~ "/" ~ COMOUT_MED_RESTART_PREV_MEM_list[0] | relpath(ROTDIR) ~ "/" ~ m_prefix ~ ".ufs.cpld.cpl.r.nc") %}
{% if path_exists(ICSDIR ~ "/" ~ COMOUT_MED_RESTART_PREV_MEM_list[0] | relpath(ROTDIR) ~ "/" ~ model_med_cur_prefix ~ ".ufs.cpld.cpl.r.nc") %}
ocean_mediator:
mkdir:
{% for mem in range(first_mem, last_mem + 1) %}
Expand All @@ -10,6 +10,6 @@ ocean_mediator:
{% for mem in range(first_mem, last_mem + 1) %}
{% set imem = mem - first_mem %}
{% set COMOUT_MED_RESTART_PREV_MEM = COMOUT_MED_RESTART_PREV_MEM_list[imem] %}
- ["{{ ICSDIR }}/{{ COMOUT_MED_RESTART_PREV_MEM | relpath(ROTDIR) }}/{{ m_prefix }}.ufs.cpld.cpl.r.nc", "{{ COMOUT_MED_RESTART_PREV_MEM }}"]
- ["{{ ICSDIR }}/{{ COMOUT_MED_RESTART_PREV_MEM | relpath(ROTDIR) }}/{{ model_med_cur_prefix }}.ufs.cpld.cpl.r.nc", "{{ COMOUT_MED_RESTART_PREV_MEM }}"]
{% endfor %} # mem loop
{% endif %} # path exists
2 changes: 1 addition & 1 deletion parm/stage/ocean_replay.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ ocean_replay:
{% for mem in range(first_mem, last_mem + 1) %}
{% set imem = mem - first_mem %}
{% set COMOUT_OCEAN_ANALYSIS_MEM = COMOUT_OCEAN_ANALYSIS_MEM_list[imem] %}
- ["{{ ICSDIR }}/{{ COMOUT_OCEAN_ANALYSIS_MEM | relpath(ROTDIR) }}/{{ m_prefix }}.mom6_perturbation.nc", "{{ COMOUT_OCEAN_ANALYSIS_MEM }}/mom6_increment.nc"]
- ["{{ ICSDIR }}/{{ COMOUT_OCEAN_ANALYSIS_MEM | relpath(ROTDIR) }}/{{ model_ocean_cur_prefix }}.mom6_perturbation.nc", "{{ COMOUT_OCEAN_ANALYSIS_MEM }}/mom6_increment.nc"]
{% endfor %} # mem loop
2 changes: 1 addition & 1 deletion parm/stage/wave.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ wave:
{% for mem in range(first_mem, last_mem + 1) %}
{% set imem = mem - first_mem %}
{% set COMOUT_WAVE_RESTART_PREV_MEM = COMOUT_WAVE_RESTART_PREV_MEM_list[imem] %}
- ["{{ ICSDIR }}/{{ COMOUT_WAVE_RESTART_PREV_MEM | relpath(ROTDIR) }}/{{ m_prefix }}.restart.{{ waveGRD }}", "{{ COMOUT_WAVE_RESTART_PREV_MEM }}"]
- ["{{ ICSDIR }}/{{ COMOUT_WAVE_RESTART_PREV_MEM | relpath(ROTDIR) }}/{{ model_wave_cur_prefix }}.restart.{{ waveGRD }}", "{{ COMOUT_WAVE_RESTART_PREV_MEM }}"]
{% endfor %} # mem loop
7 changes: 5 additions & 2 deletions ush/forecast_det.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ UFS_det(){
echo "SUB ${FUNCNAME[0]}: Run type determination for UFS"

# Determine if the current cycle is a warm start (based on the availability of restarts)
if [[ -f "${COMIN_ATMOS_RESTART_PREV}/${model_start_date_current_cycle:0:8}.${model_start_date_current_cycle:8:2}0000.coupler.res" ]]; then
if [[ -f "${COMIN_ATMOS_RESTART_PREV}/${model_atmos_start_date_current_cycle:0:8}.${model_atmos_start_date_current_cycle:8:2}0000.coupler.res" ]]; then
warm_start=".true."
fi

Expand All @@ -24,7 +24,10 @@ UFS_det(){
# Since warm start is false, we cannot do IAU
DOIAU="NO"
IAU_OFFSET=0
model_start_date_current_cycle=${current_cycle}
model_atmos_start_date_current_cycle=${current_cycle}
model_ice_start_date_current_cycle=${current_cycle}
model_med_start_date_current_cycle=${current_cycle}
model_ocean_start_date_current_cycle=${current_cycle}

# It is still possible that a restart is available from a previous forecast attempt
# So we have to continue checking for restarts
Expand Down
24 changes: 12 additions & 12 deletions ush/forecast_postdet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ FV3_postdet() {
restart_date="${RERUN_DATE}"
restart_dir="${DATArestart}/FV3_RESTART"
else # "${RERUN}" == "NO"
restart_date="${model_start_date_current_cycle}"
restart_date="${model_atmos_start_date_current_cycle}"
restart_dir="${COMIN_ATMOS_RESTART_PREV}"
fi

Expand Down Expand Up @@ -131,7 +131,7 @@ FV3_postdet() {
else
local model_start_time="${current_cycle}"
fi
local model_current_time="${model_start_date_current_cycle}"
local model_current_time="${model_atmos_start_date_current_cycle}"
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)
Expand Down Expand Up @@ -291,7 +291,7 @@ FV3_out() {

# Copy restarts in the assimilation window for RUN=gdas|enkfgdas|enkfgfs
if [[ "${RUN}" =~ "gdas" || "${RUN}" == "enkfgfs" ]]; then
restart_date="${model_start_date_next_cycle}"
restart_date="${model_atmos_start_date_next_cycle}"
while (( restart_date <= forecast_end_cycle )); do
restart_dates+=("${restart_date:0:8}.${restart_date:8:2}0000")
restart_date=$(date --utc -d "${restart_date:0:8} ${restart_date:8:2} + ${restart_interval} hours" +%Y%m%d%H)
Expand Down Expand Up @@ -334,7 +334,7 @@ WW3_postdet() {
restart_date="${RERUN_DATE}"
restart_dir="${DATArestart}/WW3_RESTART"
else
restart_date="${model_start_date_current_cycle}"
restart_date="${model_wave_start_date_current_cycle}"
restart_dir="${COMIN_WAVE_RESTART_PREV}"
fi
echo "Copying WW3 restarts for 'RUN=${RUN}' at '${restart_date}' from '${restart_dir}'"
Expand Down Expand Up @@ -433,7 +433,7 @@ MOM6_postdet() {
restart_date="${RERUN_DATE}"
else # "${RERUN}" == "NO"
restart_dir="${COMIN_OCEAN_RESTART_PREV}"
restart_date="${model_start_date_current_cycle}"
restart_date="${model_ocean_start_date_current_cycle}"
fi

# Copy MOM6 ICs
Expand Down Expand Up @@ -563,7 +563,7 @@ MOM6_out() {
# Copy restarts for the next cycle for RUN=gdas|enkfgdas|enkfgfs
if [[ "${RUN}" =~ "gdas" || "${RUN}" == "enkfgfs" ]]; then
local restart_date
restart_date="${model_start_date_next_cycle}"
restart_date="${model_ocean_start_date_next_cycle}"
echo "Copying MOM6 restarts for 'RUN=${RUN}' at ${restart_date}"
for mom6_restart_file in "${mom6_restart_files[@]}"; do
restart_file="${restart_date:0:8}.${restart_date:8:2}0000.${mom6_restart_file}"
Expand All @@ -583,7 +583,7 @@ CICE_postdet() {
seconds=$(to_seconds "${restart_date:8:2}0000") # convert HHMMSS to seconds
cice_restart_file="${DATArestart}/CICE_RESTART/cice_model.res.${restart_date:0:4}-${restart_date:4:2}-${restart_date:6:2}-${seconds}.nc"
else # "${RERUN}" == "NO"
restart_date="${model_start_date_current_cycle}"
restart_date="${model_ice_start_date_current_cycle}"
cice_restart_file="${COMIN_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="${COMIN_ICE_ANALYSIS}/${restart_date:0:8}.${restart_date:8:2}0000.cice_model_anl.res.nc"
Expand All @@ -597,8 +597,8 @@ CICE_postdet() {
# Link iceh_ic file to COM. This is the initial condition file from CICE (f000)
# TODO: Is this file needed in COM? Is this going to be used for generating any products?
local vdate seconds vdatestr fhr fhr3 interval last_fhr
seconds=$(to_seconds "${model_start_date_current_cycle:8:2}0000") # convert HHMMSS to seconds
vdatestr="${model_start_date_current_cycle:0:4}-${model_start_date_current_cycle:4:2}-${model_start_date_current_cycle:6:2}-${seconds}"
seconds=$(to_seconds "${model_ice_start_date_current_cycle:8:2}0000") # convert HHMMSS to seconds
vdatestr="${model_ice_start_date_current_cycle:0:4}-${model_ice_start_date_current_cycle:4:2}-${model_ice_start_date_current_cycle:6:2}-${seconds}"
${NLN} "${COMOUT_ICE_HISTORY}/${RUN}.ice.t${cyc}z.ic.nc" "${DATA}/CICE_OUTPUT/iceh_ic.${vdatestr}.nc"

# Link CICE forecast output files from DATA/CICE_OUTPUT to COM
Expand Down Expand Up @@ -659,7 +659,7 @@ CICE_out() {
# Copy restarts for next cycle for RUN=gdas|enkfgdas|enkfgfs
if [[ "${RUN}" =~ "gdas" || "${RUN}" == "enkfgfs" ]]; then
local restart_date
restart_date="${model_start_date_next_cycle}"
restart_date="${model_ice_start_date_next_cycle}"
echo "Copying CICE restarts for 'RUN=${RUN}' at ${restart_date}"
seconds=$(to_seconds "${restart_date:8:2}0000") # convert HHMMSS to seconds
source_file="cice_model.res.${restart_date:0:4}-${restart_date:4:2}-${restart_date:6:2}-${seconds}.nc"
Expand Down Expand Up @@ -747,7 +747,7 @@ CMEPS_postdet() {
seconds=$(to_seconds "${restart_date:8:2}0000") # convert HHMMSS to seconds
cmeps_restart_file="${DATArestart}/CMEPS_RESTART/ufs.cpld.cpl.r.${restart_date:0:4}-${restart_date:4:2}-${restart_date:6:2}-${seconds}.nc"
else # "${RERUN}" == "NO"
restart_date="${model_start_date_current_cycle}"
restart_date="${model_med_start_date_current_cycle}"
cmeps_restart_file="${COMIN_MED_RESTART_PREV}/${restart_date:0:8}.${restart_date:8:2}0000.ufs.cpld.cpl.r.nc"
fi

Expand Down Expand Up @@ -794,7 +794,7 @@ CMEPS_out() {
# Copy restarts for the next cycle to COM for RUN=gdas|enkfgdas|enkfgfs
if [[ "${RUN}" =~ "gdas" || "${RUN}" == "enkfgfs" ]]; then
local restart_date
restart_date="${model_start_date_next_cycle}"
restart_date="${model_med_start_date_next_cycle}"
echo "Copying mediator restarts for 'RUN=${RUN}' at ${restart_date}"
seconds=$(to_seconds "${restart_date:8:2}"0000)
source_file="ufs.cpld.cpl.r.${restart_date:0:4}-${restart_date:4:2}-${restart_date:6:2}-${seconds}.nc"
Expand Down
22 changes: 18 additions & 4 deletions ush/forecast_predet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,30 @@

# Define model start date for current_cycle and next_cycle as the time the forecast will start
if [[ "${DOIAU:-NO}" == "YES" ]]; then
model_start_date_current_cycle="${current_cycle_begin}"
if [[ "${MODE}" = "cycled" && "${SDATE}" = "${PDY}${cyc}" && ${EXP_WARM_START} = ".false." ]] || [[ "${MODE}" = "forecast-only" && ${EXP_WARM_START} = ".false." ]] ; then

Check notice

Code scanning / shellcheck

Possible misspelling: SDATE may not be assigned. Did you mean CDATE? Note

Possible misspelling: SDATE may not be assigned. Did you mean CDATE?
model_start_date_current_cycle="${current_cycle}"
else
model_start_date_current_cycle="${current_cycle_begin}"
fi
model_start_date_next_cycle="${next_cycle_begin}"
else
if [[ "${REPLAY_ICS:-NO}" == "YES" ]]; then
model_start_date_current_cycle=${current_cycle_end}
model_start_date_current_cycle="${current_cycle_end}"
else
model_start_date_current_cycle=${current_cycle}
model_start_date_current_cycle="${current_cycle}"
fi
model_start_date_next_cycle=${next_cycle}
model_start_date_next_cycle="${next_cycle}"
fi
# Define ice/mediator/ocean/wave current_cycle and next_cycle
model_atmos_start_date_current_cycle="${model_start_date_current_cycle}"
model_atmos_start_date_next_cycle="${model_start_date_next_cycle}"
model_ice_start_date_current_cycle="${model_start_date_current_cycle}"
model_ice_start_date_next_cycle="${model_start_date_next_cycle}"
model_med_start_date_current_cycle="${model_start_date_current_cycle}"
model_med_start_date_next_cycle="${model_start_date_next_cycle}"
model_ocean_start_date_current_cycle="${model_start_date_current_cycle}"
model_ocean_start_date_next_cycle="${model_start_date_next_cycle}"
model_wave_start_date_current_cycle="${current_cycle}"

FHMIN=${FHMIN:-0}
FHMAX=${FHMAX:-9}
Expand Down
Loading