Skip to content

Commit

Permalink
merge commit Nov 25 of develop to Dec 5 of UFS
Browse files Browse the repository at this point in the history
  • Loading branch information
JessicaMeixner-NOAA committed Dec 11, 2024
1 parent 4f518cf commit b6fce8b
Show file tree
Hide file tree
Showing 209 changed files with 12,419 additions and 2,322 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:

# Set I_MPI_CC/F90 so Intel MPI wrapper uses icc/ifort instead of gcc/gfortran
env:
cache_key: intel12
cache_key: intel10-3
CC: icc
FC: ifort
CXX: icpc
Expand Down
122 changes: 122 additions & 0 deletions .github/workflows/io_gnu_yml.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: io_gnu
on: [push, pull_request, workflow_dispatch]

# Cancel in-progress workflows when pushing to a branch
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
cache_key: gnu11-1
CC: gcc-10
FC: gfortran-10
CXX: g++-10


# Split into a steup step, and a WW3 build step which
# builds multiple switches in a matrix. The setup is run once and
# the environment is cached so each build of WW3 can share the dependencies.

jobs:
setup:
runs-on: ubuntu-latest

steps:
- name: checkout-ww3
if: steps.cache-env.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
path: ww3
# Cache spack, OASIS, and compiler
# No way to flush Action cache, so key may have # appended
- name: cache-env
id: cache-env
uses: actions/cache@v3
with:
path: |
spack
~/.spack
work_oasis3-mct
key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('ww3/model/ci/spack_gnu.yaml') }}

# Build WW3 spack environment
- name: install-dependencies-with-spack
if: steps.cache-env.outputs.cache-hit != 'true'
run: |
# Install NetCDF, ESMF, g2, etc using Spack
sudo apt install cmake
git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git
source spack/share/spack/setup-env.sh
spack env create ww3-gnu ww3/model/ci/spack_gnu.yaml
spack env activate ww3-gnu
spack compiler find
spack external find cmake
spack add [email protected]
spack concretize
spack install --dirty -v

- name: build-oasis
if: steps.cache-env.outputs.cache-hit != 'true'
run: |
source spack/share/spack/setup-env.sh
spack env activate ww3-gnu
export WWATCH3_DIR=${GITHUB_WORKSPACE}/ww3/model
export OASIS_INPUT_PATH=${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/oasis3-mct
export OASIS_WORK_PATH=${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/work_oasis3-mct
cd ww3/regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir
cmake .
make VERBOSE=1
cp -r ${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/work_oasis3-mct ${GITHUB_WORKSPACE}

io_gnu:
needs: setup
runs-on: ubuntu-latest

steps:
- name: install-dependencies
run: |
sudo apt-get update
sudo apt-get install doxygen gcovr valgrind

- name: checkout-ww3
uses: actions/checkout@v3
with:
path: ww3

- name: cache-env
id: cache-env
uses: actions/cache@v3
with:
path: |
spack
~/.spack
work_oasis3-mct
key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('ww3/model/ci/spack_gnu.yaml') }}

- name: build-ww3
run: |
source spack/share/spack/setup-env.sh
spack env activate ww3-gnu
set -x
cd ww3
export CC=mpicc
export FC=mpif90
export OASISDIR=${GITHUB_WORKSPACE}/work_oasis3-mct
mkdir build && cd build
export LD_LIBRARY_PATH="/home/runner/work/WW3/WW3/spack/var/spack/environments/ww3-gnu/.spack-env/view/:$LD_LIBRARY_PATH"
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" ..
make -j2 VERBOSE=1
./bin/ww3_grid
mv mod_def.ww3 regtests/unittests
ctest --verbose --output-on-failure --rerun-failed
gcovr --root .. -v --html-details --exclude ../regtests/unittests --exclude CMakeFiles --print-summary -o test-coverage.html &> /dev/null

- name: upload-test-coverage
uses: actions/upload-artifact@v3
with:
name: ww3-test-coverage
path: |
ww3/build/*.html
ww3/build/*.css


130 changes: 130 additions & 0 deletions .github/workflows/regtest_gnu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
name: regtest_gnu
on: [push, pull_request, workflow_dispatch]

# Cancel in-progress workflows when pushing to a branch
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
cache_key: gnu11-1
CC: gcc-10
FC: gfortran-10
CXX: g++-10


# Split into a steup step, and a WW3 build step which
# builds multiple switches in a matrix. The setup is run once and
# the environment is cached so each build of WW3 can share the dependencies.

jobs:
setup:
runs-on: ubuntu-latest

steps:
- name: checkout-ww3
if: steps.cache-env.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
path: ww3
# Cache spack, OASIS, and compiler
# No way to flush Action cache, so key may have # appended
- name: cache-env
id: cache-env
uses: actions/cache@v3
with:
path: |
spack
~/.spack
work_oasis3-mct
key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('ww3/model/ci/spack_gnu.yaml') }}

# Build WW3 spack environment
- name: install-dependencies-with-spack
if: steps.cache-env.outputs.cache-hit != 'true'
run: |
# Install NetCDF, ESMF, g2, etc using Spack
sudo apt install cmake
git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git
source spack/share/spack/setup-env.sh
spack env create ww3-gnu ww3/model/ci/spack_gnu.yaml
spack env activate ww3-gnu
spack compiler find
spack external find cmake
spack add [email protected]
spack concretize
spack install --dirty -v
- name: build-oasis
if: steps.cache-env.outputs.cache-hit != 'true'
run: |
source spack/share/spack/setup-env.sh
spack env activate ww3-gnu
export WWATCH3_DIR=${GITHUB_WORKSPACE}/ww3/model
export OASIS_INPUT_PATH=${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/oasis3-mct
export OASIS_WORK_PATH=${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/work_oasis3-mct
cd ww3/regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir
cmake .
make VERBOSE=1
cp -r ${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/input/work_oasis3-mct ${GITHUB_WORKSPACE}
regtest_gnu:
needs: setup
runs-on: ubuntu-latest

steps:
- name: install-dependencies
run: |
sudo apt-get update
sudo apt-get install doxygen gcovr valgrind
- name: checkout-ww3
uses: actions/checkout@v3
with:
path: ww3

- name: cache-env
id: cache-env
uses: actions/cache@v3
with:
path: |
spack
~/.spack
work_oasis3-mct
key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('ww3/model/ci/spack_gnu.yaml') }}

- name: build-ww3
run: |
source spack/share/spack/setup-env.sh
spack env activate ww3-gnu
set -x
cd ww3
export CC=mpicc
export FC=mpif90
export OASISDIR=${GITHUB_WORKSPACE}/work_oasis3-mct
# mkdir build && cd build
export LD_LIBRARY_PATH="/home/runner/work/WW3/WW3/spack/var/spack/environments/ww3-gnu/.spack-env/view/:$LD_LIBRARY_PATH"
# cmake -DSWITCH=${GITHUB_WORKSPACE}/ww3/regtests/unittests/data/switch.io -DCMAKE_BUILD_TYPE=Debug ..
# make -j2 VERBOSE=1
cd ${GITHUB_WORKSPACE}/ww3
ls -l
${GITHUB_WORKSPACE}/ww3/model/bin/ww3_from_ftp.sh -k
cd regtests
./bin/run_cmake_test -o all -S -T -s PR1_MPI -w work_PR1_MPI -f -p mpirun -n 24 ../model ww3_tp2.5
cd ww3_tp2.5
ls -l
cd work_PR1_MPI
pwd
ls -l
# ncdump -h out_pnt.ww3.nc > ncdump_out.txt
# cat ncdump_out.txt
# pwd
# cat ${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.5/out_pnt_ncdump.txt
# cmp ${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.5/out_pnt_ncdump.txt ncdump_out.txt
- name: cache-data
id: cache-data
uses: actions/cache@v3
with:
path: ww3/ww3_from_ftp.v7.14.1.tar.gz
key: ww3_from_ftp.v7.14.1
18 changes: 16 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ project(

get_directory_property(hasParent PARENT_DIRECTORY)
if(hasParent)
# Unset flags that come from Parent (ie UFS or other coupled build)
# Unset flags that come from Parent (ie UFS or other coupled build)
# for potential (-r8/-r4) conflict
set(CMAKE_Fortran_FLAGS "")
set(CMAKE_C_FLAGS "")
Expand All @@ -24,8 +24,9 @@ set(valid_caps "MULTI_ESMF" "NUOPC_MESH")

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

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

add_subdirectory(model)

# Turn on doxygen documentation
if (ENABLE_DOCS)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/docs/cmake")
include(EnableDoxygen)
add_subdirectory(docs)
endif()

# Turn on unit testing.
#include(CTest)
#if(BUILD_TESTING)
# add_subdirectory(regtests/unittests)
#endif()
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
# The WAVEWATCH III Framework

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

## General Features

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

## Installation

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

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

1 change: 1 addition & 0 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
EnableDoxygen(docs)
6 changes: 3 additions & 3 deletions docs/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.

OUTPUT_DIRECTORY = docs
OUTPUT_DIRECTORY = @doc_output@

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

INPUT = model/src
INPUT = @src_input@

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

DIA_PATH =
DIA_PATH =

# If set to YES the inheritance and collaboration graphs will hide inheritance
# and usage relations if the target is undocumented or is not a class.
Expand Down
27 changes: 27 additions & 0 deletions docs/cmake/EnableDoxygen.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Doxygen documentation- Matt Masarik 24-Jul-2024.
function(EnableDoxygen outdir)
find_package(Doxygen REQUIRED)
if (NOT DOXYGEN_FOUND)
add_custom_target(enable_docs
COMMAND false
COMMENT "Doxygen not found")
return()
endif()

set(src_input "${CMAKE_SOURCE_DIR}/model/src")
set(doc_output "${CMAKE_BINARY_DIR}/${outdir}")
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${outdir}/html)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/docs/Doxyfile.in
${CMAKE_BINARY_DIR}/${outdir}/Doxyfile @ONLY)
set(DOXYGEN_GENERATE_HTML YES)
set(DOXYGEN_QUIET YES)
add_custom_target(enable_docs
COMMAND
${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/${outdir}/Doxyfile
WORKING_DIRECTORY
${CMAKE_BINARY_DIR}/${outdir}
COMMENT
"Generate Doxygen HTML documentation")
message("-- Doxygen HTML index page: "
${CMAKE_BINARY_DIR}/${outdir}/html/index.html)
endfunction()
Loading

0 comments on commit b6fce8b

Please sign in to comment.