Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 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
56 changes: 52 additions & 4 deletions dev/ctests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,26 +76,31 @@ function(AddJJOBTest)
set(CASE_PATH ${HOMEgfs}/dev/ci/cases/pr)
set(CASE_YAML ${CASE_PATH}/${ARG_CASE}.yaml)

# Labels use binomial nomenclature: CASE-JOB (e.g., C48_S2SW-gfs_fcst_seg0)
# The hyphen acts as a natural delimiter for regex matching:
# ctest -L "C48_S2SW-" → runs all C48_S2SW tests (won't match C48_S2SWA_gefs)
# ctest -L "C48_S2SW-gfs_fcst_seg0" → runs specific job tests

add_test(NAME test_${TEST_NAME}_setup
COMMAND ./setup.sh ${TEST_NAME} ${CASE_YAML} ${ARG_TEST_DATE}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/scripts)
set_tests_properties(test_${TEST_NAME}_setup PROPERTIES LABELS "${ARG_CASE}-${ARG_JOB}")
set_tests_properties(test_${TEST_NAME}_setup PROPERTIES LABELS "${TEST_NAME}")

add_test(NAME test_${TEST_NAME}_stage
COMMAND ./stage.sh ${ARG_CASE} ${TEST_NAME} ${ARG_TEST_DATE}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/scripts)
set_tests_properties(test_${TEST_NAME}_stage PROPERTIES DEPENDS test_${TEST_NAME}_setup LABELS "${ARG_CASE}-${ARG_JOB}")
set_tests_properties(test_${TEST_NAME}_stage PROPERTIES DEPENDS test_${TEST_NAME}_setup LABELS "${TEST_NAME}")

add_test(NAME test_${TEST_NAME}_execute
COMMAND ./execute.sh ${TEST_NAME} ${ARG_JOB} ${ARG_TEST_DATE}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/scripts)
set_tests_properties(test_${TEST_NAME}_execute PROPERTIES DEPENDS test_${TEST_NAME}_stage LABELS "${ARG_CASE}-${ARG_JOB}")
set_tests_properties(test_${TEST_NAME}_execute PROPERTIES DEPENDS test_${TEST_NAME}_stage LABELS "${TEST_NAME}")

# TODO - This is a stub for the validation step
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this still a TODO?

add_test(NAME test_${TEST_NAME}_validate
COMMAND ./validate.sh ${ARG_CASE} ${TEST_NAME} ${ARG_TEST_DATE}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/scripts)
set_tests_properties(test_${TEST_NAME}_validate PROPERTIES DEPENDS test_${TEST_NAME}_execute LABELS "${ARG_CASE}-${ARG_JOB}")
set_tests_properties(test_${TEST_NAME}_validate PROPERTIES DEPENDS test_${TEST_NAME}_execute LABELS "${TEST_NAME}")
endfunction()

AddJJOBTest(
Expand Down Expand Up @@ -128,6 +133,12 @@ AddJJOBTest(
TEST_DATE "2021032312"
)

AddJJOBTest(
CASE "C48_S2SW"
JOB "gfs_stage_ic"
TEST_DATE "2021032312"
)

AddJJOBTest(
CASE "C48_S2SW"
JOB "gfs_fcst_seg0"
Expand All @@ -146,6 +157,43 @@ AddJJOBTest(
TEST_DATE "2021032312"
)

# ------------------------------------------------------------------------- #
# Wave Component Tests (Phase 25 - CTest S2SW Wave Expansion)
# ------------------------------------------------------------------------- #
# These tests validate wave-specific jobs from the S2SW coupled workflow.
# See GitHub Issue: NOAA-EMC/global-workflow#4318
# ------------------------------------------------------------------------- #

AddJJOBTest(
CASE "C48_S2SW"
JOB "gfs_waveinit"
TEST_DATE "2021032312"
)

AddJJOBTest(
CASE "C48_S2SW"
JOB "gfs_wavepostpnt"
TEST_DATE "2021032312"
)

AddJJOBTest(
CASE "C48_S2SW"
JOB "gfs_wavepostsbs_f000-f002"
TEST_DATE "2021032312"
)

AddJJOBTest(
CASE "C48_S2SW"
JOB "gfs_wavepostbndpnt"
TEST_DATE "2021032312"
)

AddJJOBTest(
CASE "C48_S2SW"
JOB "gfs_wavepostbndpntbll"
TEST_DATE "2021032312"
)

AddJJOBTest(
CASE "C48_S2SWA_gefs"
JOB "gefs_fcst_mem001_seg0"
Expand Down
13 changes: 10 additions & 3 deletions dev/ctests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@ cmake -DHPC_ACCOUNT=myaccount \
# Run all tests
ctest

# Run tests for a specific configuration case
ctest -L C48_ATM
# Run tests for a specific configuration case (trailing hyphen prevents partial matches)
ctest -L "C48_ATM-"

# Run all C48_S2SW tests (excludes C48_S2SWA_gefs tests)
ctest -L "C48_S2SW-"

# Run test for a specific JJOB
cest -L C48_ATM-gfs_atmos_prod_f000-f002
ctest -L "C48_ATM-gfs_atmos_prod_f000-f002"

# Run a specific test with verbose output
ctest -R test_C48_ATM-gfs_fcst_seg0_execute -V
Expand All @@ -57,6 +60,10 @@ ctest -j 4
ctest -N
```

> **Note**: The trailing hyphen in `-L "C48_ATM-"` is important! Labels use binomial
> nomenclature (`CASE-JOB`), and the hyphen acts as a natural delimiter. Without it,
> `ctest -L C48_S2SW` would also match `C48_S2SWA_gefs` tests due to CTest's regex matching.

### Common CTest Options

| Option | Description |
Expand Down
74 changes: 74 additions & 0 deletions dev/ctests/cases/C48_S2SW-gfs_stage_ic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# CTest Case: C48_S2SW-gfs_stage_ic
#
# Purpose: Validate the staging of coupled model initial conditions (ICs)
# for the S2SW (Subseasonal-to-Seasonal with Waves) configuration. This test
# ensures that the JGLOBAL_STAGE_IC job correctly stages multi-component ICs:
# - Atmosphere ICs (13 files: gfs_ctrl + 6 gfs_data tiles + 6 sfc_data tiles)
# - Ocean restart (from previous GDAS cycle)
# - Ice restart (from previous GDAS cycle)
# - Wave restart (from previous GDAS cycle)
#
# The test validates coupled system staging coordination, restart file handling
# with 6-hour offset pattern, and component consistency checks.
#
# Source pedigree: inputs come from the nightly STAGED_CTESTS COMROOT snapshot
# for `PSLOT=C48_S2SW` (e.g., 2021032312) and are compared to the same baseline.

{% set H_offset = '-6H' %}
{% set H_timedelta = H_offset | to_timedelta %}
{% set TEST_DATE_offset = TEST_DATE | add_to_datetime(H_timedelta) %}

{% set cyc = TEST_DATE | strftime('%H') %}
{% set cyc_offset = TEST_DATE_offset | strftime('%H') %}

{% set PDY = TEST_DATE | to_YMD %}
{% set PDY_offset = TEST_DATE_offset | to_YMD %}

{% set SRC_DIR = STAGED_CTESTS + '/COMROOT/' + PSLOT %}
{% set DST_DIR = RUNTESTS + '/COMROOT/' + TEST_NAME %}

{% set SRC_ATMOS_INPUT = SRC_DIR + '/gfs.' + PDY + '/' + cyc + '/model/atmos/input' %}
{% set DST_ATMOS_INPUT = DST_DIR + '/gfs.' + PDY + '/' + cyc + '/model/atmos/input' %}

{% set SRC_GDAS_OCN_RESTART = SRC_DIR + '/gdas.' + PDY + '/' + cyc_offset + '/model/ocean/restart' %}
{% set DST_GDAS_OCN_RESTART = DST_DIR + '/gdas.' + PDY + '/' + cyc_offset + '/model/ocean/restart' %}

{% set SRC_GDAS_ICE_RESTART = SRC_DIR + '/gdas.' + PDY + '/' + cyc_offset + '/model/ice/restart' %}
{% set DST_GDAS_ICE_RESTART = DST_DIR + '/gdas.' + PDY + '/' + cyc_offset + '/model/ice/restart' %}

{% set SRC_GDAS_WAV_RESTART = SRC_DIR + '/gdas.' + PDY + '/' + cyc_offset + '/model/wave/restart' %}
{% set DST_GDAS_WAV_RESTART = DST_DIR + '/gdas.' + PDY + '/' + cyc_offset + '/model/wave/restart' %}

input_files:
# The stage_ic job stages from ICSDIR to ROTDIR.
# No input files need to be pre-staged - the job reads from ICSDIR.
mkdir:
- {{ DST_ATMOS_INPUT }}
- {{ DST_GDAS_OCN_RESTART }}
- {{ DST_GDAS_ICE_RESTART }}
- {{ DST_GDAS_WAV_RESTART }}

output_files:
# Validate that the staged ICs match the authoritative baseline copies.
# These files are the outputs of the JGLOBAL_STAGE_IC job.
cmpfiles:
# Atmosphere ICs (13 files)
- [{{ SRC_ATMOS_INPUT }}/gfs_ctrl.nc, {{ DST_ATMOS_INPUT }}/gfs_ctrl.nc]
- [{{ SRC_ATMOS_INPUT }}/gfs_data.tile1.nc, {{ DST_ATMOS_INPUT }}/gfs_data.tile1.nc]
- [{{ SRC_ATMOS_INPUT }}/gfs_data.tile2.nc, {{ DST_ATMOS_INPUT }}/gfs_data.tile2.nc]
- [{{ SRC_ATMOS_INPUT }}/gfs_data.tile3.nc, {{ DST_ATMOS_INPUT }}/gfs_data.tile3.nc]
- [{{ SRC_ATMOS_INPUT }}/gfs_data.tile4.nc, {{ DST_ATMOS_INPUT }}/gfs_data.tile4.nc]
- [{{ SRC_ATMOS_INPUT }}/gfs_data.tile5.nc, {{ DST_ATMOS_INPUT }}/gfs_data.tile5.nc]
- [{{ SRC_ATMOS_INPUT }}/gfs_data.tile6.nc, {{ DST_ATMOS_INPUT }}/gfs_data.tile6.nc]
- [{{ SRC_ATMOS_INPUT }}/sfc_data.tile1.nc, {{ DST_ATMOS_INPUT }}/sfc_data.tile1.nc]
- [{{ SRC_ATMOS_INPUT }}/sfc_data.tile2.nc, {{ DST_ATMOS_INPUT }}/sfc_data.tile2.nc]
- [{{ SRC_ATMOS_INPUT }}/sfc_data.tile3.nc, {{ DST_ATMOS_INPUT }}/sfc_data.tile3.nc]
- [{{ SRC_ATMOS_INPUT }}/sfc_data.tile4.nc, {{ DST_ATMOS_INPUT }}/sfc_data.tile4.nc]
- [{{ SRC_ATMOS_INPUT }}/sfc_data.tile5.nc, {{ DST_ATMOS_INPUT }}/sfc_data.tile5.nc]
- [{{ SRC_ATMOS_INPUT }}/sfc_data.tile6.nc, {{ DST_ATMOS_INPUT }}/sfc_data.tile6.nc]
# Ocean restart (from previous GDAS cycle - 6 hour offset)
- [{{ SRC_GDAS_OCN_RESTART }}/{{ PDY }}.{{ cyc }}0000.MOM.res.nc, {{ DST_GDAS_OCN_RESTART }}/{{ PDY }}.{{ cyc }}0000.MOM.res.nc]
# Ice restart (from previous GDAS cycle - 6 hour offset)
- [{{ SRC_GDAS_ICE_RESTART }}/{{ PDY }}.{{ cyc }}0000.cice_model.res.nc, {{ DST_GDAS_ICE_RESTART }}/{{ PDY }}.{{ cyc }}0000.cice_model.res.nc]
# Wave restart (from previous GDAS cycle - 6 hour offset)
- [{{ SRC_GDAS_WAV_RESTART }}/{{ PDY }}.{{ cyc }}0000.restart.ww3, {{ DST_GDAS_WAV_RESTART }}/{{ PDY }}.{{ cyc }}0000.restart.ww3]
49 changes: 49 additions & 0 deletions dev/ctests/cases/C48_S2SW-gfs_waveinit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{% set cyc = TEST_DATE | strftime('%H') %}
{% set PDY = TEST_DATE | to_YMD %}
{% set SRC_DIR = STAGED_CTESTS + '/COMROOT/' + PSLOT %}
{% set DST_DIR = RUNTESTS + '/COMROOT/' + TEST_NAME %}

# =============================================================================
# C48_S2SW Wave Initialization Test Case
# =============================================================================
# This test validates the gfs_waveinit task from the S2SW workflow.
# Tests wave model initialization including mod_def file generation.
#
# Workflow Context:
# - Task: waveinit (from wave metatask)
# - Job: JGLOBAL_WAVE_INIT -> exgfs_wave_init.sh
#
# Source Logic: scripts/exgfs_wave_init.sh
# - Creates model definition files for all wave grids
# - Prepares wave prep directory structure
#
# Wave Grids (C48_S2SW configuration):
# - glo_30m: Global 30-minute grid
# - uglo_100km: Unstructured global 100km
# - aoc_9km: Arctic Ocean 9km
# - at_10m, ep_10m, gnh_10m, gsh_15m, wc_10m: Regional grids
#
# Note: waveinit typically runs early in the cycle before forecast
# and generates mod_def files that subsequent wave jobs depend on.
# =============================================================================

input_files:
mkdir:
- {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep

copy:
# No input files required from COMROOT for waveinit
# The job reads from FIXgfs wave grids and creates mod_def files
# This is a generation job, not a processing job

output_files:
cmpfiles:
# Wave model definition files generated by waveinit
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.glo_30m.bin, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.glo_30m.bin]
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.uglo_100km.bin, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.uglo_100km.bin]
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.aoc_9km.bin, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.aoc_9km.bin]
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.at_10m.bin, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.at_10m.bin]
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.ep_10m.bin, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.ep_10m.bin]
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.gnh_10m.bin, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.gnh_10m.bin]
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.gsh_15m.bin, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.gsh_15m.bin]
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.wc_10m.bin, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.wc_10m.bin]
60 changes: 60 additions & 0 deletions dev/ctests/cases/C48_S2SW-gfs_wavepostbndpnt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{% set cyc = TEST_DATE | strftime('%H') %}
{% set PDY = TEST_DATE | to_YMD %}
{% set SRC_DIR = STAGED_CTESTS + '/COMROOT/' + PSLOT %}
{% set DST_DIR = RUNTESTS + '/COMROOT/' + TEST_NAME %}

# =============================================================================
# C48_S2SW Wave Post Boundary Point Test Case
# =============================================================================
# This test validates the gfs_wavepostbndpnt task from the S2SW workflow.
# Tests wave boundary point output processing (interpolated boundary points).
#
# Workflow Context:
# - Task: wavepostbndpnt (wave boundary point post-processing)
# - Job: JGLOBAL_WAVE_POST_BNDPNT -> exgfs_wave_post_pnt.sh
#
# Source Logic: scripts/exgfs_wave_post_pnt.sh
# - Produces ibp (interpolated boundary point) spectral files
# - Uses ww3_outp for boundary point data extraction
#
# Configuration:
# - DOSPC_WAV='YES' - Generate spectral post
# - DOBLL_WAV='NO' - No bulletin post (separate job: wavepostbndpntbll)
# - DOBNDPNT_WAV='YES' - Process boundary points
#
# Input Files:
# - mod_def files from waveinit/waveprep
# - points.fNNN.nc files from wave model point output
#
# Output Files:
# - ibp.tar - interpolated boundary point spectra (DOSPC_WAV=YES)
# - Note: ibpbull.tar and ibpcbull.tar created by wavepostbndpntbll task
# =============================================================================

input_files:
mkdir:
- {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep
- {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/history

copy:
# Wave model definition files
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.uglo_100km.bin, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.uglo_100km.bin]
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.glo_30m.bin, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.glo_30m.bin]
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.aoc_9km.bin, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.aoc_9km.bin]
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.at_10m.bin, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.at_10m.bin]
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.ep_10m.bin, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.ep_10m.bin]
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.wc_10m.bin, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.wc_10m.bin]
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.gnh_10m.bin, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.gnh_10m.bin]
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.gsh_15m.bin, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.gsh_15m.bin]

# Wave point output files - hourly from f000-f120 (all 121 hours)
{% for fhr in range(0, 121) %}
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/history/gfs.t{{ cyc }}z.points.f{{ '%03d'|format(fhr) }}.nc, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/history/gfs.t{{ cyc }}z.points.f{{ '%03d'|format(fhr) }}.nc]
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/history/gfs.t{{ cyc }}z.points.f{{ '%03d'|format(fhr) }}.log, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/history/gfs.t{{ cyc }}z.points.f{{ '%03d'|format(fhr) }}.log]
{% endfor %}

output_files:
cmpfiles:
# Interpolated boundary point output archive
# Note: ibpbull.tar and ibpcbull.tar are created by gfs_wavepostbndpntbll task
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/products/wave/station/gfs.t{{ cyc }}z.ibp.tar, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/products/wave/station/gfs.t{{ cyc }}z.ibp.tar]
56 changes: 56 additions & 0 deletions dev/ctests/cases/C48_S2SW-gfs_wavepostbndpntbll.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{% set cyc = TEST_DATE | strftime('%H') %}
{% set PDY = TEST_DATE | to_YMD %}
{% set SRC_DIR = STAGED_CTESTS + '/COMROOT/' + PSLOT %}
{% set DST_DIR = RUNTESTS + '/COMROOT/' + TEST_NAME %}

# =============================================================================
# C48_S2SW Wave Post Boundary Point Bulletin Test Case
# =============================================================================
# This test validates the gfs_wavepostbndpntbll task from the S2SW workflow.
# Tests wave boundary point bulletin generation (WMO bulletins).
#
# Workflow Context:
# - Task: wavepostbndpntbll (wave boundary point bulletin generation)
# - Job: JGLOBAL_WAVE_POST_BNDPNTBLL -> exgfs_wave_post_pnt.sh
#
# Source Logic: scripts/exgfs_wave_post_pnt.sh
# - DOBNDPNT_WAV='YES' - Process boundary points
# - DOBLL_WAV='YES' - Generate bulletins
# - DOSPC_WAV='NO' - No spectral output
#
# Input Files:
# - mod_def files from waveinit/waveprep
# - points.fNNN.nc files from wave model point output (f000-f120)
#
# Output Files:
# - ibpbull.tar - interpolated boundary point bulletins
# - ibpcbull.tar - combined/compressed boundary point bulletins
# =============================================================================

input_files:
mkdir:
- {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep
- {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/history

copy:
# Wave model definition files (8 grids)
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.uglo_100km.bin, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.uglo_100km.bin]
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.glo_30m.bin, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.glo_30m.bin]
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.aoc_9km.bin, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.aoc_9km.bin]
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.at_10m.bin, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.at_10m.bin]
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.ep_10m.bin, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.ep_10m.bin]
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.wc_10m.bin, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.wc_10m.bin]
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.gnh_10m.bin, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.gnh_10m.bin]
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.gsh_15m.bin, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfs.t{{ cyc }}z.mod_def.gsh_15m.bin]

# Wave point output files - hourly from f000-f120 (all 121 hours)
{% for fhr in range(0, 121) %}
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/history/gfs.t{{ cyc }}z.points.f{{ '%03d'|format(fhr) }}.nc, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/history/gfs.t{{ cyc }}z.points.f{{ '%03d'|format(fhr) }}.nc]
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/history/gfs.t{{ cyc }}z.points.f{{ '%03d'|format(fhr) }}.log, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/history/gfs.t{{ cyc }}z.points.f{{ '%03d'|format(fhr) }}.log]
{% endfor %}

output_files:
cmpfiles:
# Interpolated boundary point bulletin archives
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/products/wave/station/gfs.t{{ cyc }}z.ibpbull.tar, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/products/wave/station/gfs.t{{ cyc }}z.ibpbull.tar]
- [{{ SRC_DIR }}/gfs.{{ PDY }}/{{ cyc }}/products/wave/station/gfs.t{{ cyc }}z.ibpcbull.tar, {{ DST_DIR }}/gfs.{{ PDY }}/{{ cyc }}/products/wave/station/gfs.t{{ cyc }}z.ibpcbull.tar]
Loading
Loading