Skip to content

Commit fae3a7c

Browse files
mkavulichdanrosen25christinaholtNOAA
authored
[develop] Add Community Fire Behavior Model (#1139)
This PR introduces the Community Fire Behavior Module (ufs-community/ufs-weather-model#2220) to the SRW App. In addition, there are a number of general improvements to the UFS SRW code and workflow: * The addition of the build_settings.yaml file that is placed in the exec directory * Improve capability to use a different set of vertical levels * Flexible configuration file name * Additional options for retrieve_data.py * Speedup of symbolic linking * Various random improvements --------- Co-authored-by: Dan Rosen <daniel.rosen@noaa.gov> Co-authored-by: Christina Holt <56881914+christinaholtNOAA@users.noreply.github.com>
1 parent be863bc commit fae3a7c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1288
-213
lines changed

.github/workflows/python_tests.yaml

+7-6
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ jobs:
3030
cache-downloads: true
3131
cache-environment: true
3232

33-
- name: Checkout externals
34-
run: |
35-
./manage_externals/checkout_externals ufs-weather-model
36-
3733
- name: Lint the python code
3834
run: |
3935
micromamba activate srw_app
@@ -44,17 +40,22 @@ jobs:
4440
pylint ush/set_fv3nml*.py
4541
pylint ush/update_input_nml.py
4642
43+
- name: Checkout externals
44+
run: |
45+
./manage_externals/checkout_externals ufs-weather-model
46+
4747
- name: Run python unittests
4848
run: |
4949
# exclude test_retrieve_data that is tested in functional test
5050
micromamba activate srw_app
5151
export UNIT_TEST=True
5252
export PYTHONPATH=$(pwd)/ush
53-
python -m unittest -b tests/test_python/*.py
53+
python -m unittest tests/test_python/*.py
5454
5555
- name: Run python functional tests
5656
run: |
5757
micromamba activate srw_app
5858
export CI=true
5959
export PYTHONPATH=${PWD}/ush
60-
python3 -m unittest -b tests/test_python/test_retrieve_data.py
60+
python3 -m unittest tests/test_python/test_retrieve_data.py
61+

CMakeLists.txt

+20-10
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,20 @@ project(ufs-srweather-app VERSION 1.0 LANGUAGES C CXX Fortran)
88
find_package(MPI REQUIRED COMPONENTS C CXX Fortran)
99

1010
# Set extended version info.
11-
SET(SRWA_VERSION_MAJOR 1)
12-
SET(SRWA_VERSION_MINOR 0)
11+
SET(SRWA_VERSION_MAJOR 2)
12+
SET(SRWA_VERSION_MINOR 2)
1313
SET(SRWA_VERSION_PATCH 0)
1414
SET(SRWA_VERSION_NOTE "-development")
1515
SET(SRWA_VERSION ${SRWA_VERSION_MAJOR}.${SRWA_VERSION_MINOR}.${SRWA_VERSION_PATCH}${SRWA_VERSION_NOTE})
1616

17+
# Get the latest abbreviated commit hash of the working branch
18+
execute_process(
19+
COMMAND git log -1 --format=%h
20+
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
21+
OUTPUT_VARIABLE GIT_HASH
22+
OUTPUT_STRIP_TRAILING_WHITESPACE
23+
)
24+
1725
# A function used to create autotools-style 'yes/no' definitions.
1826
# If a variable is set, it 'yes' is returned. Otherwise, 'no' is
1927
# returned.
@@ -55,7 +63,7 @@ if(NOT DEFINED CMAKE_INSTALL_BINDIR)
5563
endif()
5664

5765
#####
58-
# Configure and print the ufs-srweather-app.settings file.
66+
# Configure and print the build settings file.
5967
#####
6068

6169
# Determine the configure date.
@@ -92,10 +100,12 @@ SET(host_vendor "${osname}")
92100
SET(host_os "${osrel}")
93101
SET(abs_top_builddir "${CMAKE_CURRENT_BINARY_DIR}")
94102
SET(abs_top_srcdir "${CMAKE_CURRENT_SOURCE_DIR}")
103+
SET(application "${APP}")
104+
SET(machine "${BUILD_MACHINE}")
95105

96106
SET(CC_VERSION "${CMAKE_C_COMPILER}")
97107

98-
# Set values for .settings file.
108+
# Set values for build settings file.
99109
SET(CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}}")
100110
SET(CPPFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_CPP_FLAGS_${CMAKE_BUILD_TYPE}}")
101111
SET(LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS_${CMAKE_BUILD_TYPE}}")
@@ -107,27 +117,27 @@ is_enabled(BUILD_SHARED_LIBS enable_shared)
107117
is_enabled(STATUS_PARALLEL HAS_PARALLEL)
108118

109119
# Generate file from template.
110-
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/ufs_srweather_app.settings.in"
111-
"${CMAKE_CURRENT_BINARY_DIR}/ufs_srweather_app.settings"
120+
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/sorc/build_settings_template.yaml"
121+
"${CMAKE_CURRENT_BINARY_DIR}/build_settings.yaml"
112122
@ONLY)
113123

114124
# Read in settings file, print out.
115125
# Avoid using system-specific calls so that this
116126
# might also work on Windows.
117-
FILE(READ "${CMAKE_CURRENT_BINARY_DIR}/ufs_srweather_app.settings"
127+
FILE(READ "${CMAKE_CURRENT_BINARY_DIR}/build_settings.yaml"
118128
UFS-SRWEATHER-APP_SETTINGS)
119129
MESSAGE(${UFS-SRWEATHER-APP_SETTINGS})
120130

121-
# Install ufs_srweather_app.settings file into same location
131+
# Install build settings file into same location
122132
# as the app.
123-
INSTALL(FILES "${CMAKE_BINARY_DIR}/ufs_srweather_app.settings"
133+
INSTALL(FILES "${CMAKE_BINARY_DIR}/build_settings.yaml"
124134
DESTINATION ${CMAKE_INSTALL_BINDIR})
125135

126136
#####
127137
# Create 'ufs_srweather_app_meta.h' include file.
128138
#####
129139
configure_file(
130-
ufs_srweather_app_meta.h.in
140+
sorc/ufs_srweather_app_meta.h.in
131141
ufs_srweather_app_meta.h @ONLY)
132142

133143
FILE(COPY "${CMAKE_CURRENT_BINARY_DIR}/ufs_srweather_app_meta.h" DESTINATION include)

devbuild.sh

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ OPTIONS
1515
compiler to use; default depends on platform
1616
(e.g. intel | gnu | cray | gccgfortran)
1717
-a, --app=APPLICATION
18-
weather model application to build; for example, ATMAQ for Online-CMAQ
19-
(e.g. ATM | ATMAQ | ATMW | S2S | S2SW)
18+
weather model application to build; supported SRW options are
19+
ATM (default) Atmosphere only
20+
ATMAQ Online-CMAQ (air quality)
21+
ATMF UFS_FIRE (coupled Community Fire Behavior Model)
2022
--ccpp="CCPP_SUITE1,CCPP_SUITE2..."
2123
CCPP suites (CCPP_SUITES) to include in build; delimited with ','
2224
--enable-options="OPTION1,OPTION2,..."
@@ -363,6 +365,7 @@ fi
363365

364366
# cmake settings
365367
CMAKE_SETTINGS="\
368+
-DBUILD_MACHINE=${MACHINE}\
366369
-DCMAKE_BUILD_TYPE=${BUILD_TYPE}\
367370
-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}\
368371
-DCMAKE_INSTALL_BINDIR=${BIN_DIR}\

doc/UsersGuide/BuildingRunningTesting/DefaultVarsTable.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Table of Variables in ``config_defaults.yaml``
2020
TEST_VX_FCST_INPUT_BASEDIR, FIXgsm, FIXaer, FIXlut, FIXorg, FIXsfc, FIXshp, FIXcrtm, FIXcrtmupp, EXTRN_MDL_DATA_STORES
2121
* - Workflow
2222
- WORKFLOW_ID, RELATIVE_LINK_FLAG, USE_CRON_TO_RELAUNCH, CRON_RELAUNCH_INTVL_MNTS, CRONTAB_LINE, LOAD_MODULES_RUN_TASK_FP, EXPT_BASEDIR, EXPT_SUBDIR, EXEC_SUBDIR,
23-
EXPTDIR, DOT_OR_USCORE, EXPT_CONFIG_FN, CONSTANTS_FN, RGNL_GRID_NML_FN, FV3_NML_FN, FV3_NML_BASE_SUITE_FN, FV3_NML_YAML_CONFIG_FN, FV3_NML_BASE_ENS_FN,
23+
EXPTDIR, DOT_OR_USCORE, CONSTANTS_FN, RGNL_GRID_NML_FN, FV3_NML_FN, FV3_NML_BASE_SUITE_FN, FV3_NML_YAML_CONFIG_FN, FV3_NML_BASE_ENS_FN,
2424
FV3_EXEC_FN, DATA_TABLE_FN, DIAG_TABLE_FN, FIELD_TABLE_FN, DIAG_TABLE_TMPL_FN, FIELD_TABLE_TMPL_FN, MODEL_CONFIG_FN, NEMS_CONFIG_FN, AQM_RC_FN, AQM_RC_TMPL_FN,
2525
FV3_NML_BASE_SUITE_FP, FV3_NML_YAML_CONFIG_FP, FV3_NML_BASE_ENS_FP, DATA_TABLE_TMPL_FP, DIAG_TABLE_TMPL_FP, FIELD_TABLE_TMPL_FP,
2626
MODEL_CONFIG_TMPL_FP, NEMS_CONFIG_TMPL_FP, AQM_RC_TMPL_FP, DATA_TABLE_FP, FIELD_TABLE_FP, NEMS_CONFIG_FP, FV3_NML_FP,

0 commit comments

Comments
 (0)