forked from NOAA-EMC/global-workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/lnd_regrid_iau
* develop: Add echgres as a dependency only for RUN=enkfgdas, not enkfgfs (NOAA-EMC#3246) Add domain level to wave gridded COM path (NOAA-EMC#3137) CI JJOB Tests using CMake (NOAA-EMC#3214) Make assorted updates to waves (NOAA-EMC#3190) Move WCOSS2 LD_LIBRARY_PATH patches to load_ufsda_modules.sh (NOAA-EMC#3236) Adding a gefs_arch task to GEFS workflow (NOAA-EMC#3211) Add additional GEFS variables needed for AI/ML applications (NOAA-EMC#3221) Add bmat task dependency to marine LETKF task (NOAA-EMC#3224) Resolve bug with LMOD_TMOD_FIND_FIRST setting affecting build on WCOSS2 (NOAA-EMC#3229) Reinstate product groups (NOAA-EMC#3208) Additional fixes for downstream jobs (NOAA-EMC#3187) Turn IAU off during staging job for cold start experiments (NOAA-EMC#3215) Update the gdas.cd hash and enable GDASApp to run on WCOSS2 (NOAA-EMC#3220) Update upload-artifact to v4 (NOAA-EMC#3216) Prevent duplicate case generation in generate_workflows.sh (NOAA-EMC#3217) Update g-w to cycle with C1152 ATM (NOAA-EMC#3206) Separate use of initial increment/perturbation file from REPLAY/+03 ICs (NOAA-EMC#3119) Update gsi_enkf hash and gsi_ver (NOAA-EMC#3207) Remove cpus-per-task from APRUN_OCNANALECEN on WCOSS2 (NOAA-EMC#3212) Remove 5WAVH from AWIPS GRIB2 parm files (NOAA-EMC#3146) Remove multi-grid wave support (NOAA-EMC#3188) Add echgres as a dependency for earc (NOAA-EMC#3202)
- Loading branch information
Showing
189 changed files
with
2,206 additions
and
1,346 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# ------------------------------------------------------------------------- # | ||
# Global Workflow | ||
# ------------------------------------------------------------------------- # | ||
|
||
# Check for minimum cmake requirement | ||
cmake_minimum_required( VERSION 3.20 FATAL_ERROR ) | ||
|
||
project(global_workflow VERSION 1.0.0) | ||
|
||
include(GNUInstallDirs) | ||
enable_testing() | ||
|
||
# Build type. | ||
if(NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)$") | ||
message(STATUS "Setting build type to 'Release' as none was specified.") | ||
set(CMAKE_BUILD_TYPE | ||
"Release" | ||
CACHE STRING "Choose the type of build." FORCE) | ||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" | ||
"MinSizeRel" "RelWithDebInfo") | ||
endif() | ||
|
||
# Build global-workflow source codes | ||
# add_subdirectory(sorc) | ||
|
||
# Setup tests | ||
add_subdirectory(ctests) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
experiment: | ||
system: gfs | ||
mode: forecast-only | ||
|
||
arguments: | ||
pslot: {{ 'pslot' | getenv }} | ||
app: S2SW | ||
resdetatmos: 48 | ||
resdetocean: 5.0 | ||
comroot: {{ 'RUNTESTS' | getenv }}/COMROOT | ||
expdir: {{ 'RUNTESTS' | getenv }}/EXPDIR | ||
idate: 2021032312 | ||
edate: 2021032312 | ||
yaml: {{ HOMEgfs }}/ci/cases/yamls/gfs_extended_ci.yaml | ||
|
||
skip_ci_on_hosts: | ||
- hera | ||
- gaea | ||
- orion | ||
- hercules | ||
- wcoss2 # TODO run on WCOSS2 once the gfs_waveawipsbulls job is fixed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
# ------------------------------------------------------------------------- # | ||
# CTests for Global Workflow | ||
# ------------------------------------------------------------------------- # | ||
# These ctests correspond to JJOBs (individual Rocoto jobs) that can be | ||
# run independently, each requiring its own YAML definition of inputs | ||
# and configurations. By integrating with Rocoto, these jobs can be | ||
# validated, staged, and executed as self-contained tests using | ||
# their own data and test parameters. | ||
# ------------------------------------------------------------------------- # | ||
|
||
# Function to set a variable from an environment variable or default value | ||
function(set_from_env_or_default VAR_NAME ENV_VAR DEFAULT_VALUE) | ||
if (DEFINED ENV{${ENV_VAR}} AND NOT DEFINED ${VAR_NAME}) | ||
set(${VAR_NAME} $ENV{${ENV_VAR}} CACHE STRING "Set from environment variable ${ENV_VAR}") | ||
elseif(NOT DEFINED ${VAR_NAME} AND NOT ${DEFAULT_VALUE} STREQUAL "") | ||
set(${VAR_NAME} ${DEFAULT_VALUE} CACHE STRING "Default value for ${VAR_NAME}") | ||
endif() | ||
endfunction() | ||
|
||
# Set HOMEgfs | ||
if (NOT DEFINED HOMEgfs) | ||
set(HOMEgfs ${PROJECT_SOURCE_DIR}) | ||
endif() | ||
|
||
# Set RUNTESTS | ||
set_from_env_or_default(RUNTESTS RUNTESTS "${CMAKE_CURRENT_BINARY_DIR}/RUNTESTS") | ||
|
||
# Set HPC_ACCOUNT | ||
set_from_env_or_default(HPC_ACCOUNT HPC_ACCOUNT " ") | ||
if (NOT DEFINED HPC_ACCOUNT) | ||
message(WARNING "HPC_ACCOUNT must be set. CTests will not be created.") | ||
return() | ||
endif() | ||
|
||
# Set ICSDIR_ROOT | ||
set_from_env_or_default(ICSDIR_ROOT ICSDIR_ROOT "") | ||
if (NOT DEFINED ICSDIR_ROOT) | ||
message(WARNING "ICSDIR_ROOT must be set. CTests will not be created.") | ||
return() | ||
endif() | ||
|
||
# Set STAGED_TESTS_DIR | ||
set_from_env_or_default(STAGED_TESTS_DIR STAGED_TESTS_DIR "") | ||
if (NOT DEFINED STAGED_TESTS_DIR) | ||
message(WARNING "STAGED_TESTS_DIR must be set. CTests will not be created.") | ||
return() | ||
endif() | ||
|
||
message(STATUS "gw: global-workflow baselines will be used from: '${HOMEgfs}'") | ||
message(STATUS "gw: global-workflow tests will be run at: '${RUNTESTS}'") | ||
message(STATUS "gw: global-workflow tests will use the allocation: '${HPC_ACCOUNT}'") | ||
message(STATUS "gw: global-workflow tests will use ICSDIR_ROOT: '${ICSDIR_ROOT}'") | ||
message(STATUS "gw: global-workflow tests will use staged data from: '${STAGED_TESTS_DIR}'") | ||
|
||
# Prepare test scripts | ||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/setup.sh.in | ||
${CMAKE_CURRENT_BINARY_DIR}/scripts/setup.sh @ONLY) | ||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/stage.sh.in | ||
${CMAKE_CURRENT_BINARY_DIR}/scripts/stage.sh @ONLY) | ||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/execute.sh.in | ||
${CMAKE_CURRENT_BINARY_DIR}/scripts/execute.sh @ONLY) | ||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/validate.sh.in | ||
${CMAKE_CURRENT_BINARY_DIR}/scripts/validate.sh @ONLY) | ||
|
||
function(AddJJOBTest) | ||
|
||
set(prefix ARG) | ||
set(novals NOTRAPFPE NOVALGRIND) | ||
set(singlevals CASE JOB TEST_DATE) | ||
set(multivals TEST_DEPENDS) | ||
|
||
cmake_parse_arguments(${prefix} | ||
"${novals}" "${singlevals}" "${multivals}" | ||
${ARGN}) | ||
|
||
set(TEST_NAME ${ARG_CASE}_${ARG_JOB}) | ||
set(CASE_PATH ${HOMEgfs}/ci/cases/pr) | ||
set(CASE_YAML ${CASE_PATH}/${ARG_CASE}.yaml) | ||
|
||
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}") | ||
|
||
add_test(NAME test_${TEST_NAME}_stage | ||
COMMAND ./stage.sh ${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}") | ||
|
||
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}") | ||
|
||
# TODO - This is a stub for the validation step | ||
add_test(NAME test_${TEST_NAME}_validate | ||
COMMAND ./validate.sh ${TEST_NAME} ${CASE_YAML} | ||
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}") | ||
endfunction() | ||
|
||
AddJJOBTest( | ||
CASE "C48_ATM" | ||
JOB "gfs_fcst_seg0" | ||
TEST_DATE "2021032312" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# CTest Framework for NOAA Global Workflow | ||
|
||
This directory contains the CTest framework for testing Rocoto JJOBS. The framework allows you to stage, execute, and validate individual JJOBS independently from other jobs in the workflow. Each test requires its own YAML definition of inputs and configurations. | ||
|
||
## Overview | ||
|
||
The CTest framework consists of the following scripts: | ||
- **setup.sh.in**: Prepares the environment and creates the experiment. | ||
- **stage.sh.in**: Stages the input files needed to run a JJOB. | ||
- **execute.sh.in**: Executes the JJOB and monitors its status. | ||
- **validate.sh.in**: (TODO) Validates the results of the JJOB. | ||
|
||
## Usage | ||
|
||
### CMake Configuration | ||
|
||
To configure the CTest framework using CMake, you need to provide several environment variables or default values. Here is an example of how to configure and build the project: | ||
|
||
```bash | ||
# Set environment variables (may also be include at command line with -D) | ||
export HPC_ACCOUNT="your_hpc_account" | ||
export ICSDIR_ROOT="/path/to/icsdir_root" | ||
export STAGED_TESTS_DIR="/path/to/staged_tests_dir" | ||
|
||
# Run CMake to configure the ctest framework | ||
cmake -S /path/to/HOMEgfs -B /path/to/build -DRUNTESTS=/path/to/runtests | ||
|
||
``` | ||
|
||
### Running Tests with CTest | ||
|
||
Once the project is configured, you can run the tests using CTest. Here are some examples: | ||
|
||
#### Run All Tests | ||
|
||
```bash | ||
cd /path/to/build | ||
ctest | ||
``` | ||
|
||
#### Run Tests for a Specific Case | ||
|
||
You can use the `-L` option with CTest to run tests for a specific case. For example, to run tests for the `C48_ATM` case: | ||
|
||
```bash | ||
cd /path/to/build | ||
ctest -L C48_ATM | ||
``` | ||
|
||
To add a new test use the **AddJJOBTest()** function at the end of the `$HOMEgfs/ctest/CMakeLists.txt` file as follows: | ||
```cmake | ||
AddJJOBTest( | ||
CASE "C48_ATM" | ||
JOB "gfs_fcst_seg0" | ||
TEST_DATE "2021032312" | ||
) | ||
``` | ||
Then create a new YAML file with the required staged input files as is done with this example found in `$HOMEgfs/ctests/cases/C48_ATM_gfs_fcts_seg0.yaml` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
input_files: | ||
mkdir: | ||
- "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{TEST_DATE | to_YMD}}/{{TEST_DATE | strftime('%H')}}/model/atmos/input" | ||
copy: | ||
- ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gfs.{{ TEST_DATE | to_YMD }}/{{ TEST_DATE | strftime('%H') }}/model/atmos/input/gfs_ctrl.nc", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{TEST_DATE | to_YMD}}/{{TEST_DATE | strftime('%H')}}/model/atmos/input/gfs_ctrl.nc"] | ||
- ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gfs.{{ TEST_DATE | to_YMD }}/{{ TEST_DATE | strftime('%H') }}/model/atmos/input/gfs_data.tile1.nc", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{TEST_DATE | to_YMD}}/{{TEST_DATE | strftime('%H')}}/model/atmos/input/gfs_data.tile1.nc"] | ||
- ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gfs.{{ TEST_DATE | to_YMD }}/{{ TEST_DATE | strftime('%H') }}/model/atmos/input/gfs_data.tile2.nc", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{TEST_DATE | to_YMD}}/{{TEST_DATE | strftime('%H')}}/model/atmos/input/gfs_data.tile2.nc"] | ||
- ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gfs.{{ TEST_DATE | to_YMD }}/{{ TEST_DATE | strftime('%H') }}/model/atmos/input/gfs_data.tile3.nc", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{TEST_DATE | to_YMD}}/{{TEST_DATE | strftime('%H')}}/model/atmos/input/gfs_data.tile3.nc"] | ||
- ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gfs.{{ TEST_DATE | to_YMD }}/{{ TEST_DATE | strftime('%H') }}/model/atmos/input/gfs_data.tile4.nc", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{TEST_DATE | to_YMD}}/{{TEST_DATE | strftime('%H')}}/model/atmos/input/gfs_data.tile4.nc"] | ||
- ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gfs.{{ TEST_DATE | to_YMD }}/{{ TEST_DATE | strftime('%H') }}/model/atmos/input/gfs_data.tile5.nc", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{TEST_DATE | to_YMD}}/{{TEST_DATE | strftime('%H')}}/model/atmos/input/gfs_data.tile5.nc"] | ||
- ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gfs.{{ TEST_DATE | to_YMD }}/{{ TEST_DATE | strftime('%H') }}/model/atmos/input/gfs_data.tile6.nc", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{TEST_DATE | to_YMD}}/{{TEST_DATE | strftime('%H')}}/model/atmos/input/gfs_data.tile6.nc"] | ||
- ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gfs.{{ TEST_DATE | to_YMD }}/{{ TEST_DATE | strftime('%H') }}/model/atmos/input/sfc_data.tile1.nc", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{TEST_DATE | to_YMD}}/{{TEST_DATE | strftime('%H')}}/model/atmos/input/sfc_data.tile1.nc"] | ||
- ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gfs.{{ TEST_DATE | to_YMD }}/{{ TEST_DATE | strftime('%H') }}/model/atmos/input/sfc_data.tile2.nc", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{TEST_DATE | to_YMD}}/{{TEST_DATE | strftime('%H')}}/model/atmos/input/sfc_data.tile2.nc"] | ||
- ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gfs.{{ TEST_DATE | to_YMD }}/{{ TEST_DATE | strftime('%H') }}/model/atmos/input/sfc_data.tile3.nc", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{TEST_DATE | to_YMD}}/{{TEST_DATE | strftime('%H')}}/model/atmos/input/sfc_data.tile3.nc"] | ||
- ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gfs.{{ TEST_DATE | to_YMD }}/{{ TEST_DATE | strftime('%H') }}/model/atmos/input/sfc_data.tile4.nc", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{TEST_DATE | to_YMD}}/{{TEST_DATE | strftime('%H')}}/model/atmos/input/sfc_data.tile4.nc"] | ||
- ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gfs.{{ TEST_DATE | to_YMD }}/{{ TEST_DATE | strftime('%H') }}/model/atmos/input/sfc_data.tile5.nc", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{TEST_DATE | to_YMD}}/{{TEST_DATE | strftime('%H')}}/model/atmos/input/sfc_data.tile5.nc"] | ||
- ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gfs.{{ TEST_DATE | to_YMD }}/{{ TEST_DATE | strftime('%H') }}/model/atmos/input/sfc_data.tile6.nc", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{TEST_DATE | to_YMD}}/{{TEST_DATE | strftime('%H')}}/model/atmos/input/sfc_data.tile6.nc"] |
Oops, something went wrong.