Skip to content

Commit cc6f1a3

Browse files
Merge dev/ufs-weather-model into dev/unified (#40)
2 parents 9ea1d89 + ff387d6 commit cc6f1a3

423 files changed

Lines changed: 33195 additions & 19883 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ concurrency:
88

99
env:
1010
cache_key: gnu11
11-
CC: gcc-10
12-
FC: gfortran-10
13-
CXX: g++-10
11+
CC: gcc-14
12+
FC: gfortran-14
13+
CXX: g++-14
1414

1515

1616
# Split into a steup step, and a WW3 build step which
@@ -45,7 +45,8 @@ jobs:
4545
run: |
4646
# Install NetCDF, ESMF, g2, etc using Spack
4747
sudo apt install cmake
48-
git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git
48+
#git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git
49+
git clone -c feature.manyFiles=true --depth=2 --branch=spack-stack-1.9.3 https://github.com/JCSDA/spack.git
4950
source spack/share/spack/setup-env.sh
5051
spack env create ww3-gnu ww3/model/ci/spack_gnu.yaml
5152
spack env activate ww3-gnu
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ concurrency:
1313

1414
# Set I_MPI_CC/F90 so Intel MPI wrapper uses icc/ifort instead of gcc/gfortran
1515
env:
16-
cache_key: intel12
16+
cache_key: intel10-3
1717
CC: icc
1818
FC: ifort
1919
CXX: icpc
@@ -26,7 +26,7 @@ env:
2626

2727
jobs:
2828
setup:
29-
runs-on: ubuntu-latest
29+
runs-on: ubuntu-22.04
3030

3131
steps:
3232

.github/workflows/io_gnu_yml.old

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
name: io_gnu
2+
on: [push, pull_request, workflow_dispatch]
3+
4+
# Cancel in-progress workflows when pushing to a branch
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
7+
cancel-in-progress: true
8+
9+
env:
10+
cache_key: gnu11-1
11+
CC: gcc-10
12+
FC: gfortran-10
13+
CXX: g++-10
14+
15+
16+
# Split into a steup step, and a WW3 build step which
17+
# builds multiple switches in a matrix. The setup is run once and
18+
# the environment is cached so each build of WW3 can share the dependencies.
19+
20+
jobs:
21+
setup:
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: checkout-ww3
26+
if: steps.cache-env.outputs.cache-hit != 'true'
27+
uses: actions/checkout@v3
28+
with:
29+
path: ww3
30+
# Cache spack, OASIS, and compiler
31+
# No way to flush Action cache, so key may have # appended
32+
- name: cache-env
33+
id: cache-env
34+
uses: actions/cache@v3
35+
with:
36+
path: |
37+
spack
38+
~/.spack
39+
work_oasis3-mct
40+
key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('ww3/model/ci/spack_gnu.yaml') }}
41+
42+
# Build WW3 spack environment
43+
- name: install-dependencies-with-spack
44+
if: steps.cache-env.outputs.cache-hit != 'true'
45+
run: |
46+
# Install NetCDF, ESMF, g2, etc using Spack
47+
sudo apt install cmake
48+
git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git
49+
source spack/share/spack/setup-env.sh
50+
spack env create ww3-gnu ww3/model/ci/spack_gnu.yaml
51+
spack env activate ww3-gnu
52+
spack compiler find
53+
spack external find cmake
54+
spack add mpich@3.4.2
55+
spack concretize
56+
spack install --dirty -v
57+
58+
- name: build-oasis
59+
if: steps.cache-env.outputs.cache-hit != 'true'
60+
run: |
61+
source spack/share/spack/setup-env.sh
62+
spack env activate ww3-gnu
63+
export WWATCH3_DIR=${GITHUB_WORKSPACE}/ww3/model
64+
export OASIS_INPUT_PATH=${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/oasis3-mct
65+
export OASIS_WORK_PATH=${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/work_oasis3-mct
66+
cd ww3/regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir
67+
cmake .
68+
make VERBOSE=1
69+
cp -r ${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/work_oasis3-mct ${GITHUB_WORKSPACE}
70+
71+
io_gnu:
72+
needs: setup
73+
runs-on: ubuntu-latest
74+
75+
steps:
76+
- name: install-dependencies
77+
run: |
78+
sudo apt-get update
79+
sudo apt-get install doxygen gcovr valgrind
80+
81+
- name: checkout-ww3
82+
uses: actions/checkout@v3
83+
with:
84+
path: ww3
85+
86+
- name: cache-env
87+
id: cache-env
88+
uses: actions/cache@v3
89+
with:
90+
path: |
91+
spack
92+
~/.spack
93+
work_oasis3-mct
94+
key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('ww3/model/ci/spack_gnu.yaml') }}
95+
96+
- name: build-ww3
97+
run: |
98+
source spack/share/spack/setup-env.sh
99+
spack env activate ww3-gnu
100+
set -x
101+
cd ww3
102+
export CC=mpicc
103+
export FC=mpif90
104+
export OASISDIR=${GITHUB_WORKSPACE}/work_oasis3-mct
105+
mkdir build && cd build
106+
export LD_LIBRARY_PATH="/home/runner/work/WW3/WW3/spack/var/spack/environments/ww3-gnu/.spack-env/view/:$LD_LIBRARY_PATH"
107+
cmake -DSWITCH=${GITHUB_WORKSPACE}/ww3/regtests/unittests/data/switch.io -DCMAKE_BUILD_TYPE=Debug -DCMAKE_Fortran_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -Wall -fno-omit-frame-pointer -fsanitize=address" -DCMAKE_C_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -Wall -fno-omit-frame-pointer -fsanitize=address" ..
108+
make -j2 VERBOSE=1
109+
./bin/ww3_grid
110+
mv mod_def.ww3 regtests/unittests
111+
ctest --verbose --output-on-failure --rerun-failed
112+
gcovr --root .. -v --html-details --exclude ../regtests/unittests --exclude CMakeFiles --print-summary -o test-coverage.html &> /dev/null
113+
114+
- name: upload-test-coverage
115+
uses: actions/upload-artifact@v3
116+
with:
117+
name: ww3-test-coverage
118+
path: |
119+
ww3/build/*.html
120+
ww3/build/*.css
121+
122+
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
name: regtest_gnu
2+
on: [push, pull_request, workflow_dispatch]
3+
4+
# Cancel in-progress workflows when pushing to a branch
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
7+
cancel-in-progress: true
8+
9+
env:
10+
cache_key: gnu11-1
11+
CC: gcc-14
12+
FC: gfortran-14
13+
CXX: g++-14
14+
15+
16+
# Split into a steup step, and a WW3 build step which
17+
# builds multiple switches in a matrix. The setup is run once and
18+
# the environment is cached so each build of WW3 can share the dependencies.
19+
20+
jobs:
21+
setup:
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: checkout-ww3
26+
if: steps.cache-env.outputs.cache-hit != 'true'
27+
uses: actions/checkout@v3
28+
with:
29+
path: ww3
30+
# Cache spack, OASIS, and compiler
31+
# No way to flush Action cache, so key may have # appended
32+
- name: cache-env
33+
id: cache-env
34+
uses: actions/cache@v3
35+
with:
36+
path: |
37+
spack
38+
~/.spack
39+
work_oasis3-mct
40+
key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('ww3/model/ci/spack_gnu.yaml') }}
41+
42+
# Build WW3 spack environment
43+
- name: install-dependencies-with-spack
44+
if: steps.cache-env.outputs.cache-hit != 'true'
45+
run: |
46+
# Install NetCDF, ESMF, g2, etc using Spack
47+
sudo apt install cmake
48+
git clone -c feature.manyFiles=true --depth=2 --branch=spack-stack-1.9.3 https://github.com/JCSDA/spack.git
49+
source spack/share/spack/setup-env.sh
50+
spack env create ww3-gnu ww3/model/ci/spack_gnu.yaml
51+
spack env activate ww3-gnu
52+
spack compiler find
53+
spack external find cmake
54+
spack add mpich@3.4.2
55+
spack concretize
56+
spack install --dirty -v
57+
58+
- name: build-oasis
59+
if: steps.cache-env.outputs.cache-hit != 'true'
60+
run: |
61+
source spack/share/spack/setup-env.sh
62+
spack env activate ww3-gnu
63+
export WWATCH3_DIR=${GITHUB_WORKSPACE}/ww3/model
64+
export OASIS_INPUT_PATH=${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/oasis3-mct
65+
export OASIS_WORK_PATH=${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/work_oasis3-mct
66+
cd ww3/regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir
67+
cmake .
68+
make VERBOSE=1
69+
cp -r ${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/work_oasis3-mct ${GITHUB_WORKSPACE}
70+
71+
regtest_gnu:
72+
needs: setup
73+
runs-on: ubuntu-latest
74+
75+
steps:
76+
- name: install-dependencies
77+
run: |
78+
sudo apt-get update
79+
sudo apt-get install doxygen gcovr valgrind
80+
81+
- name: checkout-ww3
82+
uses: actions/checkout@v3
83+
with:
84+
path: ww3
85+
86+
- name: cache-env
87+
id: cache-env
88+
uses: actions/cache@v3
89+
with:
90+
path: |
91+
spack
92+
~/.spack
93+
work_oasis3-mct
94+
key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('ww3/model/ci/spack_gnu.yaml') }}
95+
96+
- name: build-ww3
97+
run: |
98+
source spack/share/spack/setup-env.sh
99+
spack env activate ww3-gnu
100+
set -x
101+
cd ww3
102+
export CC=mpicc
103+
export FC=mpif90
104+
export OASISDIR=${GITHUB_WORKSPACE}/work_oasis3-mct
105+
# mkdir build && cd build
106+
export LD_LIBRARY_PATH="/home/runner/work/WW3/WW3/spack/var/spack/environments/ww3-gnu/.spack-env/view/:$LD_LIBRARY_PATH"
107+
# cmake -DSWITCH=${GITHUB_WORKSPACE}/ww3/regtests/unittests/data/switch.io -DCMAKE_BUILD_TYPE=Debug ..
108+
# make -j2 VERBOSE=1
109+
cd ${GITHUB_WORKSPACE}/ww3
110+
ls -l
111+
${GITHUB_WORKSPACE}/ww3/model/bin/ww3_from_ftp.sh -k
112+
cd regtests
113+
./bin/run_cmake_test -o all -S -T -s PR1_MPI -w work_PR1_MPI -f -p mpirun -n 24 ../model ww3_tp2.5
114+
cd ww3_tp2.5
115+
ls -l
116+
cd work_PR1_MPI
117+
pwd
118+
ls -l
119+
# ncdump -h out_pnt.ww3.nc > ncdump_out.txt
120+
# cat ncdump_out.txt
121+
# pwd
122+
# cat ${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.5/out_pnt_ncdump.txt
123+
# cmp ${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.5/out_pnt_ncdump.txt ncdump_out.txt
124+
125+
- name: cache-data
126+
id: cache-data
127+
uses: actions/cache@v3
128+
with:
129+
path: ww3/ww3_from_ftp.v7.14.1.tar.gz
130+
key: ww3_from_ftp.v7.14.1

CMakeLists.txt

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,16 @@ project(
1313

1414
get_directory_property(hasParent PARENT_DIRECTORY)
1515
if(hasParent)
16-
# Unset flags that come from Parent (ie UFS or other coupled build)
16+
# Unset flags that come from Parent (ie UFS or other coupled build)
1717
# for potential (-r8/-r4) conflict
1818
set(CMAKE_Fortran_FLAGS "")
19+
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
20+
set(CMAKE_Fortran_FLAGS_DEBUG "-check all -check noarg_temp_created -ftrapuv")
21+
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(IntelLLVM)$")
22+
set(CMAKE_Fortran_FLAGS_DEBUG "-check all -check noarg_temp_created -ftrapuv")
23+
else()
24+
message(WARNING "Fortran compiler with ID ${CMAKE_Fortran_COMPILER_ID} will be used with CMake default options")
25+
endif()
1926
set(CMAKE_C_FLAGS "")
2027
remove_definitions(-DDEBUG)
2128
endif()
@@ -24,8 +31,9 @@ set(valid_caps "MULTI_ESMF" "NUOPC_MESH")
2431

2532
set(UFS_CAP "" CACHE STRING "Valid options are ${valid_caps}")
2633
set(NETCDF ON CACHE BOOL "Build NetCDF programs (requires NetCDF)")
27-
set(ENDIAN "BIG" CACHE STRING "Endianness of unformatted output files. Valid values are 'BIG', 'LITTLE', 'NATIVE'.")
34+
set(ENDIAN "BIG" CACHE STRING "Endianness of unformatted output files. Valid values are 'BIG', 'LITTLE', 'NATIVE'.")
2835
set(EXCLUDE_FIND "" CACHE STRING "Don't try and search for these libraries (assumd to be handled by the compiler/wrapper)")
36+
set(ENABLE_DOCS OFF CACHE BOOL "Enable building of doxygen generated documentation")
2937

3038
# make sure all "exclude_find" entries are lower case
3139
list(TRANSFORM EXCLUDE_FIND TOLOWER)
@@ -66,3 +74,16 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)$")
6674
endif()
6775

6876
add_subdirectory(model)
77+
78+
# Turn on doxygen documentation
79+
if (ENABLE_DOCS)
80+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/docs/cmake")
81+
include(EnableDoxygen)
82+
add_subdirectory(docs)
83+
endif()
84+
85+
# Turn on unit testing.
86+
#include(CTest)
87+
#if(BUILD_TESTING)
88+
# add_subdirectory(regtests/unittests)
89+
#endif()

README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
# The WAVEWATCH III Framework
22

3-
WAVEWATCH III<sup>&reg;</sup> is a community wave modeling framework that includes the
3+
WAVEWATCH III<sup>&reg;</sup> is a community wave modeling framework that includes the
44
latest scientific advancements in the field of wind-wave modeling and dynamics.
55

66
## General Features
77

8-
WAVEWATCH III<sup>&reg;</sup> solves the random phase spectral action density
9-
balance equation for wavenumber-direction spectra. The model includes options
10-
for shallow-water (surf zone) applications, as well as wetting and drying of
11-
grid points. Propagation of a wave spectrum can be solved using regular
12-
(rectilinear or curvilinear) and unstructured (triangular) grids. See
13-
[About WW3](https://github.com/NOAA-EMC/WW3/wiki/About-WW3) for a
14-
detailed description of WAVEWATCH III<sup>&reg;</sup> .
8+
WAVEWATCH III<sup>&reg;</sup> solves the random phase spectral action density
9+
balance equation for wavenumber-direction spectra. The model includes options
10+
for shallow-water (surf zone) applications, as well as wetting and drying of
11+
grid points. Propagation of a wave spectrum can be solved using regular
12+
(rectilinear or curvilinear) and unstructured (triangular) grids. See
13+
[About WW3](https://github.com/NOAA-EMC/WW3/wiki/About-WW3) for a
14+
detailed description of WAVEWATCH III<sup>&reg;</sup>. For a web-based
15+
view of the WAVEWATCH III<sup>&reg;</sup> source code
16+
refer to the [WW3 doxygen documentation](https://noaa-emc.github.io/WW3).
1517

1618
## Installation
1719

18-
The WAVEWATCH III<sup>&reg;</sup> framework package has two parts that need to be combined so
19-
all runs smoothly: the GitHub repo itself, and a binary data file bundle that
20-
needs to be obtained from our ftp site. Steps to successfully acquire and install
20+
The WAVEWATCH III<sup>&reg;</sup> framework package has two parts that need to be combined so
21+
all runs smoothly: the GitHub repo itself, and a binary data file bundle that
22+
needs to be obtained from our ftp site. Steps to successfully acquire and install
2123
the framework are outlined in our [Quick Start](https://github.com/NOAA-EMC/WW3/wiki/Quick-Start)
2224
guide.
2325

@@ -35,4 +37,3 @@ endorsement, recommendation or favoring by the Department of Commerce. The
3537
Department of Commerce seal and logo, or the seal and logo of a DOC bureau,
3638
shall not be used in any manner to imply endorsement of any commercial product
3739
or activity by DOC or the United States Government.
38-

0 commit comments

Comments
 (0)