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

Various wave updates: Reformat WW3 inputs; enable PIO for wave restarts; enable WW3 cycling; synchronize UFS restart writes; add uglo_15km WW3 grid #3190

Open
wants to merge 85 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 82 commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
54dd21b
updates for uglo 15km
JessicaMeixner-NOAA Jul 15, 2024
5069875
Merge branch 'NOAA-EMC:develop' into feature/uglo_15km
JessicaMeixner-NOAA Jul 17, 2024
0791f27
Merge branch 'NOAA-EMC:develop' into feature/uglo_15km
JessicaMeixner-NOAA Aug 4, 2024
dfbdf63
Merge remote-tracking branch 'EMC/develop' into feature/uglo_15km
JessicaMeixner-NOAA Aug 10, 2024
2685096
Merge branch 'NOAA-EMC:develop' into feature/uglo_15km
JessicaMeixner-NOAA Nov 7, 2024
37ae897
Merge branch 'NOAA-EMC:develop' into feature/uglo_15km
JessicaMeixner-NOAA Nov 13, 2024
fcc0979
Merge remote-tracking branch 'EMC/develop' into feature/uglo_15km
JessicaMeixner-NOAA Nov 14, 2024
ffea11d
update wave grids in gfs/config.base
JessicaMeixner-NOAA Nov 18, 2024
2b33cd5
update build and UFS model
JessicaMeixner-NOAA Nov 21, 2024
a3d9b4c
update ush_configure for wave related variables
JessicaMeixner-NOAA Nov 22, 2024
1149faf
Merge branch 'NOAA-EMC:develop' into bug/addPIOswitch
JessicaMeixner-NOAA Dec 5, 2024
67b5f54
Merge branch 'NOAA-EMC:develop' into feature/uglo_15km
JessicaMeixner-NOAA Dec 5, 2024
c470488
Merge remote-tracking branch 'EMC/develop' into bug/addPIOswitch
JessicaMeixner-NOAA Dec 6, 2024
b575ff6
update for CICE
JessicaMeixner-NOAA Dec 6, 2024
8020fc7
update ufs to version with fix for waves
JessicaMeixner-NOAA Dec 6, 2024
94f9f2a
remove output every time-step
JessicaMeixner-NOAA Dec 9, 2024
e3a1bd9
Merge branch 'NOAA-EMC:develop' into bug/addPIOswitch
JessicaMeixner-NOAA Dec 9, 2024
886e638
update link script for UPP update
JessicaMeixner-NOAA Dec 10, 2024
cf21059
compute resources when doing traditional threading
aerorahul Dec 10, 2024
32ec7b2
fix shel
JessicaMeixner-NOAA Dec 10, 2024
d5335a1
tasks_per_node should know about threads
aerorahul Dec 10, 2024
bdce86f
spacing
aerorahul Dec 10, 2024
0ee666d
add QUILTING_RESTART as an option
aerorahul Dec 10, 2024
26a0c42
update config.resources in GEFS system to allow use of traditional th…
aerorahul Dec 10, 2024
89225c5
ww3_shel.inp >> ww3_shel.nml
sbanihash Dec 11, 2024
6eb5778
Merge branch 'NOAA-EMC:develop' into feature/uglo_15km
JessicaMeixner-NOAA Dec 11, 2024
6d5eb04
Merge remote-tracking branch 'origin/feature/uglo_15km' into bug/addP…
JessicaMeixner-NOAA Dec 11, 2024
d526db6
Merge remote-tracking branch 'RM/feature/traditional_threading' into …
JessicaMeixner-NOAA Dec 11, 2024
47be8b3
testing temp files
JessicaMeixner-NOAA Dec 12, 2024
0be2ee2
update ufs
JessicaMeixner-NOAA Dec 12, 2024
bcfdd61
update ufs
JessicaMeixner-NOAA Dec 12, 2024
0943e5e
add point weight file copy
JessicaMeixner-NOAA Dec 12, 2024
b234886
waveprep should not be in xml for cycling
JessicaMeixner-NOAA Dec 12, 2024
37e5df4
Merge branch 'NOAA-EMC:develop' into develop
sbanihash Dec 13, 2024
28b5608
add ww3 restart variable
JessicaMeixner-NOAA Dec 13, 2024
6be3977
Merge remote-tracking branch 'SB/develop' into combineforww3testing
JessicaMeixner-NOAA Dec 13, 2024
e10680c
adding RSTFLDS to shel.nml
Dec 13, 2024
593fe7c
Merge remote-tracking branch 'SB/feature/wavnml' into combineforww3te…
JessicaMeixner-NOAA Dec 13, 2024
0a8dfa8
update hercules environment with variable from Gerhard
JessicaMeixner-NOAA Dec 13, 2024
83d3baa
revert to default c1152 settings
JessicaMeixner-NOAA Dec 13, 2024
69f4998
update model
JessicaMeixner-NOAA Dec 14, 2024
77a9ed5
Merge remote-tracking branch 'EMC/develop' into combineforww3testing
JessicaMeixner-NOAA Dec 14, 2024
a92fe59
fix bug
JessicaMeixner-NOAA Dec 14, 2024
5f1c12e
add restart variable for model config
JessicaMeixner-NOAA Dec 14, 2024
f317180
are able to write out netcdf WW3 files
JessicaMeixner-NOAA Dec 14, 2024
3e838b7
remove variable no longer used
JessicaMeixner-NOAA Dec 14, 2024
151d5ee
adding ww3 pio_nc confings to config.wave
Dec 16, 2024
6de3b03
adding nc restart option to wave forecast and writing restarts to COM…
Dec 16, 2024
e940cb6
taking out pio_nc parms
Dec 16, 2024
ed53409
updates for copying restarts
JessicaMeixner-NOAA Dec 16, 2024
7794784
Merge remote-tracking branch 'EMC/develop' into combineforww3testing
JessicaMeixner-NOAA Dec 17, 2024
cea2a52
define ww3 variable for netcdf or binary restart
JessicaMeixner-NOAA Dec 18, 2024
b1d31ca
fix forecast hours for gdas wave gridded output
JessicaMeixner-NOAA Dec 19, 2024
7910cbe
update for hafs downstream
JessicaMeixner-NOAA Dec 19, 2024
c1b6730
updates for restarts of non-fv3 components with IAU
JessicaMeixner-NOAA Dec 20, 2024
9094b60
update writing frequency of ww3,cmeps,cice,mom6 restarts
JessicaMeixner-NOAA Dec 20, 2024
ce91f63
remove shell templates
JessicaMeixner-NOAA Dec 20, 2024
9955dbd
adjust by half cycle not 6 hours
JessicaMeixner-NOAA Dec 20, 2024
554b017
consistent parm for gefs/gfs
JessicaMeixner-NOAA Dec 20, 2024
aeaa85a
more cleaup on namelist WW3 --- note we are writing out extra output …
JessicaMeixner-NOAA Dec 20, 2024
cacbb16
update wave for iau restart
JessicaMeixner-NOAA Dec 20, 2024
159496e
Merge branch 'NOAA-EMC:develop' into combineforww3testing
JessicaMeixner-NOAA Dec 20, 2024
8971454
cleanup for pr
JessicaMeixner-NOAA Dec 20, 2024
4097a37
Merge branch 'NOAA-EMC:develop' into enablepio_cycle_uglo15km
JessicaMeixner-NOAA Dec 30, 2024
6741814
Update parm/config/gefs/config.ufs
JessicaMeixner-NOAA Dec 30, 2024
d0d4661
Update parm/config/gfs/config.ufs
JessicaMeixner-NOAA Dec 30, 2024
4ff02a2
Update parm/config/gfs/config.ufs
JessicaMeixner-NOAA Dec 30, 2024
b74305a
Update parm/config/gfs/config.wave
JessicaMeixner-NOAA Dec 30, 2024
77e24e2
Update ush/forecast_postdet.sh
JessicaMeixner-NOAA Dec 30, 2024
b09ddff
Update ush/forecast_postdet.sh
JessicaMeixner-NOAA Dec 30, 2024
b20d9a7
Update ush/forecast_postdet.sh
JessicaMeixner-NOAA Dec 30, 2024
0ab6a40
Update ush/forecast_postdet.sh
JessicaMeixner-NOAA Dec 30, 2024
a4721c0
Update ush/forecast_predet.sh
JessicaMeixner-NOAA Dec 30, 2024
6ff0ce7
Update ush/forecast_predet.sh
JessicaMeixner-NOAA Dec 30, 2024
cb97cf6
Update ush/forecast_predet.sh
JessicaMeixner-NOAA Dec 30, 2024
300c1de
Update ush/forecast_predet.sh
JessicaMeixner-NOAA Dec 30, 2024
b1b7cd0
Update ush/forecast_predet.sh
JessicaMeixner-NOAA Dec 30, 2024
521f4d3
Update ush/forecast_predet.sh
JessicaMeixner-NOAA Dec 30, 2024
cdc5a9c
Update ush/forecast_postdet.sh
JessicaMeixner-NOAA Dec 30, 2024
a381d54
Update ush/parsing_ufs_configure.sh
JessicaMeixner-NOAA Dec 30, 2024
951a117
Update workflow/rocoto/gfs_tasks.py
JessicaMeixner-NOAA Dec 30, 2024
e889719
Update wave.rst
JessicaMeixner-NOAA Dec 30, 2024
49ff12d
Update ush/forecast_postdet.sh
JessicaMeixner-NOAA Jan 3, 2025
84989e6
Merge remote-tracking branch 'EMC/develop' into enablepio_cycle_uglo15km
JessicaMeixner-NOAA Jan 3, 2025
db8f725
move code from common to cmeps for restart variables
JessicaMeixner-NOAA Jan 3, 2025
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ parm/ufs/MOM6_data_table.IN
parm/ufs/ice_in.IN
parm/ufs/ufs.configure.*.IN
parm/ufs/post_itag_gfs
parm/ufs/ww3_shel.nml.IN
parm/wafs

# Ignore sorc and logs folders from externals
Expand Down
2 changes: 2 additions & 0 deletions docs/source/wave.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Here are several regional naming conventions:
+===========+=======================+
| glo | Global domain |
+-----------+-----------------------+
| uglo | Unstructured global |
+-----------+-----------------------+
| ak | Alaska |
+-----------+-----------------------+
| ao or aoc | Arctic Ocean |
Expand Down
6 changes: 6 additions & 0 deletions parm/config/gefs/config.ufs
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,7 @@ fi

# Set the name of the UFS (previously nems) configure template to use
# Default ufs.configure templates for supported model configurations
# WW3 restart field variable is different for slow vs fast loop. Add WW3_RSTFLDS="ice" for slow loop variables based on coupling scheme.
if [[ "${USE_ESMF_THREADING:-}" == "YES" ]]; then
tmpl_suffix="_esmf"
fi
Expand All @@ -533,9 +534,11 @@ case "${model_list}" in
;;
atm.ocean.ice.wave)
default_template="${PARMgfs}/ufs/ufs.configure.s2sw${tmpl_suffix:-}.IN"
WW3_RSTFLDS="ice"
;;
atm.ocean.ice.wave.aero)
default_template="${PARMgfs}/ufs/ufs.configure.s2swa${tmpl_suffix:-}.IN"
WW3_RSTFLDS="ice"
;;
*)
echo "FATAL ERROR: Unsupported UFSWM configuration for ${model_list}"
Expand All @@ -547,6 +550,9 @@ esac
export ufs_configure_template=${ufs_configure_template:-${default_template:-"/dev/null"}}
unset model_list default_template

#export wave restart variable:
export WW3_RSTFLDS=${WW3_RSTFLDS:-" "}

if [[ ! -r "${ufs_configure_template}" ]]; then
echo "FATAL ERROR: ${ufs_configure_template} either doesn't exist or is not readable."
exit 17
Expand Down
10 changes: 10 additions & 0 deletions parm/config/gefs/config.wave
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ export waveMULTIGRID='.false.' # .true./.false. for multi or shel
export MESH_WAV="mesh.${waveGRD}.nc" # Mesh grid for wave model for CMEPS
export waveesmfGRD=' ' # input grid for multigrid

export WW3_user_histname="false"
export WW3_historync="false"
export WW3_restartnc="true"
export WW3_PIO_FORMAT="pnetcdf"
export WW3_PIO_IOTASKS=-99
export WW3_PIO_STRIDE=4
export WW3_PIO_REARR="box"
export WW3_PIO_ROOT=-99


#Grid dependent variables for various grids
case "${waveGRD}" in
"gnh_10m;aoc_9km;gsh_15m")
Expand Down
2 changes: 1 addition & 1 deletion parm/config/gfs/config.base
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ case "${CASE}" in
export waveGRD='uglo_100km'
;;
"C768" | "C1152")
export waveGRD='uglo_m1g16'
export waveGRD='uglo_15km'
;;
*)
echo "FATAL ERROR: Unrecognized CASE ${CASE}, ABORT!"
Expand Down
12 changes: 11 additions & 1 deletion parm/config/gfs/config.ufs
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,11 @@ if [[ "${skip_ww3}" == "false" ]]; then
"mx025")
ntasks_ww3=80
;;
"uglo_100km")
"uglo_15km")
ntasks_ww3=1000
nthreads_ww3=1
;;
"uglo_100km")
ntasks_ww3=40
nthreads_ww3=1
;;
Expand All @@ -630,6 +634,7 @@ fi

# Set the name of the UFS (previously nems) configure template to use
# Default ufs.configure templates for supported model configurations
# WW3 restart field variable is different for slow vs fast loop. Add WW3_RSTFLDS="ice" for slow loop variables based on coupling scheme.
if [[ "${USE_ESMF_THREADING:-}" == "YES" ]]; then
tmpl_suffix="_esmf"
fi
Expand All @@ -651,9 +656,11 @@ case "${model_list}" in
;;
atm.ocean.ice.wave)
default_template="${PARMgfs}/ufs/ufs.configure.s2sw${tmpl_suffix:-}.IN"
WW3_RSTFLDS="ice"
;;
atm.ocean.ice.wave.aero)
default_template="${PARMgfs}/ufs/ufs.configure.s2swa${tmpl_suffix:-}.IN"
WW3_RSTFLDS="ice"
;;
*)
echo "FATAL ERROR: Unsupported UFSWM configuration for ${model_list}"
Expand All @@ -665,6 +672,9 @@ esac
export ufs_configure_template=${ufs_configure_template:-${default_template:-"/dev/null"}}
unset model_list default_template

# export wave restart variable:
export WW3_RSTFLDS=${WW3_RSTFLDS:-" "}

if [[ ! -r "${ufs_configure_template}" ]]; then
echo "FATAL ERROR: ${ufs_configure_template} either doesn't exist or is not readable."
exit 17
Expand Down
17 changes: 17 additions & 0 deletions parm/config/gfs/config.wave
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ export waveMULTIGRID='.false.' # .true./.false. for multi or shel
export MESH_WAV="mesh.${waveGRD}.nc" # Mesh grid for wave model for CMEPS
export waveesmfGRD=' ' # input grid for multigrid

export WW3_user_histname="false"
export WW3_historync="false"
export WW3_restartnc="true"
export WW3_PIO_FORMAT="pnetcdf"
export WW3_PIO_IOTASKS=-99
export WW3_PIO_STRIDE=4
export WW3_PIO_REARR="box"
export WW3_PIO_ROOT=-99



#Grid dependent variables for various grids
case "${waveGRD}" in
"gnh_10m;aoc_9km;gsh_15m")
Expand Down Expand Up @@ -74,6 +85,12 @@ case "${waveGRD}" in
export wavepostGRD='glo_500'
export waveuoutpGRD=${waveGRD}
;;
"uglo_15km")
# unstructured 15km grid
export waveinterpGRD='glo_15mxt at_10m ep_10m wc_10m glo_30m'
export wavepostGRD=''
export waveuoutpGRD=${waveGRD}
;;
"uglo_100km")
#unstructured 100km grid
export waveinterpGRD='glo_200'
Expand Down
2 changes: 1 addition & 1 deletion parm/wave/glo_15mxt_interp.inp.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $ Start Time DT NSteps
$ Total number of grids
2
$ Grid extensions
'uglo_m1g16'
'uglo_15km'
'glo_15mxt'
$
0
Expand Down
42 changes: 0 additions & 42 deletions parm/wave/ww3_shel.inp.tmpl

This file was deleted.

1 change: 1 addition & 0 deletions sorc/link_workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ declare -a ufs_templates=("model_configure.IN" "input_global_nest.nml.IN"
"ufs.configure.s2swa_esmf.IN"
"ufs.configure.leapfrog_atm_wav.IN"
"ufs.configure.leapfrog_atm_wav_esmf.IN"
"ww3_shel.nml.IN"
"post_itag_gfs")
for file in "${ufs_templates[@]}"; do
[[ -s "${file}" ]] && rm -f "${file}"
Expand Down
84 changes: 71 additions & 13 deletions ush/forecast_postdet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,9 @@ FV3_out() {
# shellcheck disable=SC2034
WW3_postdet() {
echo "SUB ${FUNCNAME[0]}: Linking input data for WW3"

local ww3_grid first_ww3_restart_out ww3_restart_file
# Copy initial condition files:
local restart_date restart_dir
local restart_date restart_dir seconds
if [[ "${RERUN}" == "YES" ]]; then
restart_date="${RERUN_DATE}"
restart_dir="${DATArestart}/WW3_RESTART"
Expand All @@ -350,27 +349,52 @@ WW3_postdet() {
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
#first check if a binary restart exists, if it does set
export WW3_restart_from_binary=true
${NCP} "${ww3_restart_file}" "${DATA}/restart.ww3" \
|| ( echo "FATAL ERROR: Unable to copy WW3 IC, ABORT!"; exit 1 )
|| ( 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)
if [[ "${DOIAU:-NO}" == "YES" ]]; then
first_ww3_restart_out=$(date --utc -d "${first_ww3_restart_out:0:8} ${first_ww3_restart_out:8:2} + ${half_window} hours" +%Y%m%d%H)
fi
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!"
first_ww3_restart_out=${model_start_date_current_cycle}
# now check to see if a NetCDF restart exists:
seconds=$(to_seconds "${restart_date:8:2}0000") # convert HHMMSS to seconds
ww3_restart_dest_file="ufs.cpld.ww3.r.${restart_date:0:4}-${restart_date:4:2}-${restart_date:6:2}-${seconds}.nc"

ww3_restart_file="${restart_dir}/${restart_date:0:8}.${restart_date:8:2}0000.restart.ww3.nc"
if [[ -s "${ww3_restart_file}" ]]; then
# NetCDF restart exists:
export WW3_restart_from_binary=false
${NCP} "${ww3_restart_file}" "${DATA}/${ww3_restart_dest_file}" \
|| ( 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)
if [[ "${DOIAU:-NO}" == "YES" ]]; then
first_ww3_restart_out=$(date --utc -d "${first_ww3_restart_out:0:8} ${first_ww3_restart_out:8:2} + ${half_window} hours" +%Y%m%d%H)
fi
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
# TODO: See if this will work still with new options... might not
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
fi
fi

# Link restart files
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"
${NLN} "${DATArestart}/WW3_RESTART/${ww3_restart_file}" "${ww3_restart_file}"
seconds=$(to_seconds "${vdate:8:2}0000") # convert HHMMSS to seconds
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
seconds=$(to_seconds "${vdate:8:2}0000") # convert HHMMSS to seconds
seconds=$(to_seconds "${vdate:8:2}0000") # convert HHMMSS to seconds

ww3_restart_ufs_file="ufs.cpld.ww3.r.${vdate:0:4}-${vdate:4:2}-${vdate:6:2}-${seconds}.nc"
ww3_restart_file="${vdate:0:8}.${vdate:8:2}0000.restart.ww3.nc"
${NLN} "${DATArestart}/WW3_RESTART/${ww3_restart_file}" "${ww3_restart_ufs_file}"
done

# Link output files
Expand Down Expand Up @@ -425,7 +449,41 @@ WW3_nml() {

WW3_out() {
echo "SUB ${FUNCNAME[0]}: Copying output data for WW3"
# TODO: Need to add logic to copy restarts from DATArestart/WW3_RESTART to COMOUT_WAVE_RESTART

# Copy wave namelist from DATA to COMOUT_CONF after the forecast is run (and successfull)
${NCP} "${DATA}/ww3_shel.nml" "${COMOUT_CONF}/ufs.ww3_shel.nml"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, but beware that in seg1 will overwrite seg0's namelist.


# Copy WW3 restarts at the end of the forecast segment to COM for RUN=gfs|gefs
if [[ "${COPY_FINAL_RESTARTS}" == "YES" ]]; then
local seconds source_file target_file
if [[ "${RUN}" == "gfs" || "${RUN}" == "gefs" ]]; then
echo "Copying WW3 restarts for 'RUN=${RUN}' at ${forecast_end_cycle}"
target_file="${forecast_end_cycle:0:8}.${forecast_end_cycle:8:2}0000.restart.ww3.nc"
${NCP} "${DATArestart}/WW3_RESTART/${target_file}" \
"${COMOUT_WAVE_RESTART}/${target_file}"
fi
fi

# Copy restarts for next cycle for RUN=gdas|gefs
if [[ "${RUN}" == "gdas" || "${RUN}" == "gefs" ]]; then
local restart_date
restart_date="${model_start_date_next_cycle}"
echo "Copying WW3 restarts for 'RUN=${RUN}' at ${restart_date}"
target_file="${restart_date:0:8}.${restart_date:8:2}0000.restart.ww3.nc"
${NCP} "${DATArestart}/WW3_RESTART/${target_file}" \
"${COMOUT_WAVE_RESTART}/${target_file}"
fi

# Copy restarts for downstream usage in HAFS
if [[ "${RUN}" =~ "gdas" ]]; then
JessicaMeixner-NOAA marked this conversation as resolved.
Show resolved Hide resolved
local restart_date
restart_date="${next_cycle}"
echo "Copying WW3 restarts for 'RUN=${RUN}' at ${restart_date}"
target_file="${restart_date:0:8}.${restart_date:8:2}0000.restart.ww3.nc"
${NCP} "${DATArestart}/WW3_RESTART/${target_file}" \
"${COMOUT_WAVE_RESTART}/${target_file}"
fi

}


Expand Down
29 changes: 29 additions & 0 deletions ush/forecast_predet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,29 @@
# Several model components share DATA/INPUT for input data
if [[ ! -d "${DATA}/INPUT" ]]; then mkdir -p "${DATA}/INPUT"; fi

# For CMEPS, CICE, MOM6 and WW3 determine restart writes
# Note FV3 has its own restart intervals
cmeps_restart_interval=${restart_interval:-${FHMAX}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a common variable if it starts w/ cmeps.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would you prefer it be called? This is for CMEPS, WW3, ICE, and MOM6

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not the name, but the place these are introduced.
The function CMEPS_predet IMO, would be appropriate to introduce these variables related to cmeps_ (and more general the coupled model since they share these concepts)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the additional explanation. I will move it to CMEPS!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

# 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 (( cmeps_restart_interval == 0 )); then
if [[ "${DOIAU:-NO}" == "YES" ]]; then
CMEPS_RESTART_FH=$(( FHMAX + half_window ))
else
CMEPS_RESTART_FH=("${FHMAX}")
fi
else
if [[ "${DOIAU:-NO}" == "YES" ]]; then
local restart_interval_start=$(( cmeps_restart_interval + half_window ))
local restart_interval_end=$(( FHMAX + half_window ))
else
local restart_interval_start=${cmeps_restart_interval}
local restart_interval_end=${FHMAX}
fi
CMEPS_RESTART_FH="$(seq -s ' ' "${restart_interval_start}" "${cmeps_restart_interval}" "${restart_interval_end}")"

Check warning

Code scanning / shellcheck

Variable was used as an array but is now assigned a string. Warning

Variable was used as an array but is now assigned a string.
fi
# TODO: For GEFS, once cycling waves "self-cycles" and therefore needs to have a restart at 6 hour

}

# shellcheck disable=SC2034
Expand Down Expand Up @@ -606,6 +629,12 @@
#if shel, only 1 waveGRD which is linked to mod_def.ww3
${NCP} "${COMIN_WAVE_PREP}/${RUN}wave.mod_def.${waveGRD}" "${DATA}/mod_def.ww3" \
|| ( echo "FATAL ERROR: Failed to copy '${RUN}wave.mod_def.${waveGRD}' from '${COMIN_WAVE_PREP}'"; exit 1 )
# copy point weights file for unstructured grid if it exists
local wavpntwghtfile=${FIXgfs}/wave/pnt_wght.${waveGRD}.nc
if [[ -f "${wavpntwghtfile}" ]]; then
${NCP} "${wavpntwghtfile}" "${DATA}/pnt_wght.ww3.nc" \
|| ( echo "FATAL ERROR: Failed to copy '${wavpntwghtfile}'"; exit 1 )
fi
fi

if [[ "${WW3ICEINP}" == "YES" ]]; then
Expand Down
1 change: 1 addition & 0 deletions ush/parsing_model_configure_FV3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ local SHOUR=${model_start_date:8:2}
local FHROT=${IAU_FHROT:-0}
local DT_ATMOS=${DELTIM}
local RESTART_INTERVAL="${FV3_RESTART_FH[*]}"
local RESTART_FH="${CMEPS_RESTART_FH:-" "}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure introducing a CMEPS variable dependency in FV3 would be clean, since that means there is a dependency on a coupled model variable for an atm-only configuration. Need to think a bit on this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RESART_FH variable is not used by FV3, however it is in the model_configure file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also - please note this is what is being done in this PR: ufs-community/ufs-weather-model#2419 so if you want changes we'll potentially need changes to ufs-weather-model

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the FV3 does not use this variable, can we just set this as:
local RESTART_FH=" "

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assumes the restarts are written according to local RESTART_INTERVAL="${FV3_RESTART_FH[*]}", correct?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I misunderstood this comment that said the FV3 does not use this variable. Does the model_configure also now use this variable to specify restart write times for all model components? (In the past, model_configure was fv3atm specific)
How does this relate to RESTART_INTERVAL that is currently specifying the FV3 restart times? Does RESTART_FH override RESTART_INTERVAL?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From @NickSzapiro-NOAA in an email:

3 restart triggers:
restart_n+restart_option: frequency-based ESMF restart trigger (via ufs.configure) *Not currently in FV3
restart_interval: just in FV3 (via model_configure) and can mean different things based on "encoding"
restart_fh: UFS wraps ESMF trigger (via model_configure). *Not currently in FV3

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aerorahul - let me know if you'd like me to run a test case and save the output showing that we're writing all restarts at the same time when using IAU for all components. I can also run an fv3 standalone ci test to ensure that we are not negatively impacting atm-only runs too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aerorahul - is there any change you'd like to see with this? Or any specific tests you'd like to see output with?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. I am ok with the movement of CMEPS_RESTART_FH into the CMEPS_predet function.

# QUILTING
local QUILTING_RESTART="${QUILTING_RESTART:-${QUILTING}}"
local WRITE_GROUP=${WRITE_GROUP:-1}
Expand Down
Loading
Loading