Skip to content

Commit 6329bfe

Browse files
Merge branch 'develop' into syncdevtoufs20241115
Conflicts: .github/workflows/intel.yml model/inp/ww3_ounf.inp model/src/w3gridmd.F90 model/src/w3initmd.F90 model/src/w3iogomd.F90 model/src/w3ounfmetamd.F90 model/src/w3sic4md.F90
2 parents abe1e79 + 7705171 commit 6329bfe

File tree

206 files changed

+12416
-2323
lines changed

Some content is hidden

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

206 files changed

+12416
-2323
lines changed

.github/workflows/intel.yml

Lines changed: 1 addition & 1 deletion
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

.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+

.github/workflows/regtest_gnu.yml

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-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+
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: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ 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 "")
1919
set(CMAKE_C_FLAGS "")
@@ -24,8 +24,9 @@ set(valid_caps "MULTI_ESMF" "NUOPC_MESH")
2424

2525
set(UFS_CAP "" CACHE STRING "Valid options are ${valid_caps}")
2626
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'.")
27+
set(ENDIAN "BIG" CACHE STRING "Endianness of unformatted output files. Valid values are 'BIG', 'LITTLE', 'NATIVE'.")
2828
set(EXCLUDE_FIND "" CACHE STRING "Don't try and search for these libraries (assumd to be handled by the compiler/wrapper)")
29+
set(ENABLE_DOCS OFF CACHE BOOL "Enable building of doxygen generated documentation")
2930

3031
# make sure all "exclude_find" entries are lower case
3132
list(TRANSFORM EXCLUDE_FIND TOLOWER)
@@ -66,3 +67,16 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)$")
6667
endif()
6768

6869
add_subdirectory(model)
70+
71+
# Turn on doxygen documentation
72+
if (ENABLE_DOCS)
73+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/docs/cmake")
74+
include(EnableDoxygen)
75+
add_subdirectory(docs)
76+
endif()
77+
78+
# Turn on unit testing.
79+
#include(CTest)
80+
#if(BUILD_TESTING)
81+
# add_subdirectory(regtests/unittests)
82+
#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-

docs/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
EnableDoxygen(docs)

docs/Doxyfile.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ PROJECT_LOGO =
5858
# entered, it will be relative to the location where doxygen was started. If
5959
# left blank the current directory will be used.
6060

61-
OUTPUT_DIRECTORY = docs
61+
OUTPUT_DIRECTORY = @doc_output@
6262

6363
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
6464
# directories (in 2 levels) under the output directory of each output format and
@@ -829,7 +829,7 @@ WARN_LOGFILE =
829829
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
830830
# Note: If this tag is empty the current directory is searched.
831831

832-
INPUT = model/src
832+
INPUT = @src_input@
833833

834834
# This tag can be used to specify the character encoding of the source files
835835
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@@ -2285,7 +2285,7 @@ CLASS_DIAGRAMS = NO
22852285
# DIA_PATH tag allows you to specify the directory where the dia binary resides.
22862286
# If left empty dia is assumed to be found in the default search path.
22872287

2288-
DIA_PATH =
2288+
DIA_PATH =
22892289

22902290
# If set to YES the inheritance and collaboration graphs will hide inheritance
22912291
# and usage relations if the target is undocumented or is not a class.

docs/cmake/EnableDoxygen.cmake

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Doxygen documentation- Matt Masarik 24-Jul-2024.
2+
function(EnableDoxygen outdir)
3+
find_package(Doxygen REQUIRED)
4+
if (NOT DOXYGEN_FOUND)
5+
add_custom_target(enable_docs
6+
COMMAND false
7+
COMMENT "Doxygen not found")
8+
return()
9+
endif()
10+
11+
set(src_input "${CMAKE_SOURCE_DIR}/model/src")
12+
set(doc_output "${CMAKE_BINARY_DIR}/${outdir}")
13+
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${outdir}/html)
14+
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/docs/Doxyfile.in
15+
${CMAKE_BINARY_DIR}/${outdir}/Doxyfile @ONLY)
16+
set(DOXYGEN_GENERATE_HTML YES)
17+
set(DOXYGEN_QUIET YES)
18+
add_custom_target(enable_docs
19+
COMMAND
20+
${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/${outdir}/Doxyfile
21+
WORKING_DIRECTORY
22+
${CMAKE_BINARY_DIR}/${outdir}
23+
COMMENT
24+
"Generate Doxygen HTML documentation")
25+
message("-- Doxygen HTML index page: "
26+
${CMAKE_BINARY_DIR}/${outdir}/html/index.html)
27+
endfunction()

0 commit comments

Comments
 (0)