Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-base with NOAA-EMC and fix gustiness #15

Merged
merged 43 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
17a4e32
Bugfix - initialised VD and VS to zero in w3srcemd. (#1037)
ukmo-ccbunney Jul 7, 2023
2514633
More efficient test for binary files in matrix.comp (#1035)
ukmo-ccbunney Jul 7, 2023
4d8c315
Tidy up of pre-processor directives and unused variables in w3srcemd.…
ukmo-ccbunney Jul 11, 2023
02cb72f
Correct typo in w3srcemd.F90 pre-processor directive. (#1039)
ukmo-ccbunney Jul 14, 2023
1cacc43
minor bugfix for matrix grepping on keywords (#1049)
mickaelaccensi Jul 31, 2023
dcafc8c
Stop masking group 1 output where icec > icen (#1019)
benoitp-cmc Aug 4, 2023
2715a9e
Doxygen documentation added, 8th subset.(#1046)
MatthewMasarik-NOAA Aug 7, 2023
b810a89
NC4 ,F90 ,XX0 switches removed from ww3_tp2.19 regtest (#1054)
Ghazal-Mohammadpour Aug 11, 2023
991daf8
CI: Fix for Intel scripts. GNU scripts updated. (#1064)
MatthewMasarik-NOAA Sep 2, 2023
6b9edfa
correct the computation of QP parameter, add QKK output parameter, ch…
mickaelaccensi Sep 14, 2023
8589d12
correct issue with ww3_multi when requesting restart2 and using nml f…
mickaelaccensi Sep 21, 2023
7bbdaca
correct calendar for track netcdf output (#1079)
mickaelaccensi Sep 22, 2023
b1356dd
Fix missing mod_def.ww3 file in multigrid regression tests for track …
ukmo-ccbunney Oct 10, 2023
d22b7bb
STAB3: fix cmake build for ST4 or ST3 (#1086)
MatthewMasarik-NOAA Oct 10, 2023
eff6686
new feature to output out_grd.ww3, out_pnt.ww3 and mod_def.ww3 both i…
mickaelaccensi Oct 12, 2023
d148d09
Update local unit number arrays (NDS, MDS) to be same size of array d…
ukmo-ccbunney Oct 16, 2023
66262f6
Removed code referencing PHIOC in output section for PHICE in ww3_oun…
ukmo-ccbunney Oct 18, 2023
8eb3596
implementation of the GQM (Gaussian Quadrature Method) to replace the…
mickaelaccensi Oct 19, 2023
4cd995d
update logic to ensure you are not accessing uninitialized dates (#1114)
JessicaMeixner-NOAA Oct 31, 2023
c3451a9
Initialised S and D arrays in W3SDB1 before potential early return if…
ukmo-ccbunney Nov 1, 2023
f702a8f
ww3_ounp.F90: x/y units attribute corrected from 'm' to 'km' (#1088)
Biao-Zhao Nov 2, 2023
1f928aa
Bugfix: Assign unit numbers to ASCII gridded/point output in multi-gr…
ukmo-ccbunney Nov 6, 2023
d90078b
correct bugs to run correctly GQM implementation (#1127)
mickaelaccensi Nov 28, 2023
3f35df7
Adding documentation to w3iopo() in preparation for code for #682. (#…
edwardhartnett Nov 30, 2023
ff1b9e9
NCEP regtest module updates: uses spack-stack/1.5.0, includes scotch/…
MatthewMasarik-NOAA Dec 7, 2023
d3ea810
Minor update to ncep regtests (#1138)
JessicaMeixner-NOAA Dec 12, 2023
88c89be
Updated intel workflow to install oneapi compilers from new location.…
edwardhartnett Dec 26, 2023
7bec560
Add unit test for points I/O code. (#1158)
edwardhartnett Jan 4, 2024
63f8270
Update Intel CI (relocate /usr/local; ensure intel-oneapi-mpi; use ub…
AlexanderRichert-NOAA Jan 11, 2024
3952826
remove lookup table for ST4 to speed up computation and clean up the …
mickaelaccensi Jan 16, 2024
026fcdd
initialize USSP_WN for mod_def (#1165)
JessicaMeixner-NOAA Jan 22, 2024
9a718fc
Introduce IC4M8 and IC4M9 to WW3 (#1176)
ErickRogers Jan 23, 2024
ff0358a
clean up and add ST4 variables (#1181)
mickaelaccensi Jan 25, 2024
ba5cd68
w3fld1md.F90: fix divide by zero in CRIT2 parameter (#1184)
MatthewMasarik-NOAA Feb 5, 2024
fd6d559
ww3_prnc.F90: fix out-of-scope grid index write statement (#1185)
MatthewMasarik-NOAA Feb 5, 2024
6d42025
Bugfix: address potential divide-by-zero in APPENDTAIL (#1188)
MatthewMasarik-NOAA Feb 15, 2024
e085bcf
Provide initial drying of cells with depth < ZLIM for SMC grid. (#1192)
ukmo-ccbunney Feb 23, 2024
156a46d
Output OMP threading info to screen when running ww3_shel/ww3_multi c…
ukmo-ccbunney Mar 11, 2024
9d3799f
update run_cmake_test to catch build errors and exit (#1194)
JessicaMeixner-NOAA Mar 12, 2024
027ef77
Merge branch 'develop' of https://github.com/NOAA-EMC/WW3 into ct/mer…
camilleanne Mar 13, 2024
b344d66
fix merge conflicts
camilleanne Mar 13, 2024
20fc1f6
Fix gustiness bug, as suggst by Pieter
miguelsolanocordoba Mar 25, 2024
f165221
Change USTARsigma to WAM implementation
miguelsolanocordoba Mar 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/gnu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ concurrency:
cancel-in-progress: true

env:
cache_key: gnu8
cache_key: gnu11
CC: gcc-10
FC: gfortran-10
CXX: g++-10
Expand All @@ -24,14 +24,14 @@ jobs:
steps:
- name: checkout-ww3
if: steps.cache-env.outputs.cache-hit != 'true'
uses: actions/checkout@v2
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@v2
uses: actions/cache@v3
with:
path: |
spack
Expand All @@ -45,7 +45,7 @@ jobs:
run: |
# Install NetCDF, ESMF, g2, etc using Spack
sudo apt install cmake
git clone -c feature.manyFiles=true https://github.com/spack/spack.git
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
Expand Down Expand Up @@ -77,13 +77,13 @@ jobs:

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

- name: cache-env
id: cache-env
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
spack
Expand Down
41 changes: 25 additions & 16 deletions .github/workflows/intel.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# This is a GitHub actions workflow for WW3.
#
# This workflow builds with the Intel compilers.
#
# Matt Masarik, Alex Richert, Ed Hartnett
name: Intel Linux Build
on: [push, pull_request, workflow_dispatch]

Expand All @@ -8,34 +13,34 @@ concurrency:

# Set I_MPI_CC/F90 so Intel MPI wrapper uses icc/ifort instead of gcc/gfortran
env:
cache_key: intel7
cache_key: intel10-3
CC: icc
FC: ifort
CXX: icpc
I_MPI_CC: icc
I_MPI_F90: ifort

# Split into a dependency build step, and a WW3 build step which
# builds multiple switches in a matrix. The setup is run once and
# 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-20.04
runs-on: ubuntu-latest

steps:

- name: checkout-ww3
if: steps.cache-env.outputs.cache-hit != 'true'
uses: actions/checkout@v2
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@v2
uses: actions/cache@v3
with:
path: |
spack
Expand All @@ -51,26 +56,28 @@ jobs:
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
sudo apt-get install intel-oneapi-mpi-devel intel-oneapi-openmp intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
sudo apt-get install intel-oneapi-dev-utilities intel-oneapi-mpi-devel intel-oneapi-compiler-fortran-2023.2.1 intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2023.2.1 intel-oneapi-openmp

# Build WW3 spack environment
- name: install-dependencies-with-spack
if: steps.cache-env.outputs.cache-hit != 'true'
run: |
sudo mv /usr/local /usr/local_mv
# Install NetCDF, ESMF, g2, etc using Spack
. /opt/intel/oneapi/setvars.sh
sudo mv /usr/local /usrlocal_renamed
sudo apt install cmake
git clone -c feature.manyFiles=true https://github.com/spack/spack.git
git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git
source spack/share/spack/setup-env.sh
ln -s $(realpath $(which gcc)) spack/lib/spack/env/intel/gcc # spack/make bug in ESMF
spack env create ww3-intel ww3/model/ci/spack_intel.yaml
spack env activate ww3-intel
spack compiler find
spack external find cmake
spack add intel-oneapi-mpi
sudo apt install cmake
spack external find
spack config add "packages:mpi:require:'intel-oneapi-mpi'"
spack config add "packages:all:require:['%intel']"
spack concretize
spack install --dirty -v --fail-fast
spack clean --all

- name: build-oasis
if: steps.cache-env.outputs.cache-hit != 'true'
Expand All @@ -91,17 +98,17 @@ jobs:
strategy:
matrix:
switch: [Ifremer1, NCEP_st2, NCEP_st4, ite_pdlib, NCEP_st4sbs, NCEP_glwu, OASACM, UKMO, MULTI_ESMF]
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

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

- name: cache-env
id: cache-env
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
spack
Expand All @@ -112,12 +119,14 @@ jobs:

- name: build-ww3
run: |
sudo mv /usr/local /usr/local_mv
sudo apt install cmake
. /opt/intel/oneapi/setvars.sh
source spack/share/spack/setup-env.sh
spack env activate ww3-intel
cd ww3
export CC=mpicc
export FC=mpif90
export CC=mpiicc
export FC=mpiifort
export OASISDIR=${GITHUB_WORKSPACE}/work_oasis3-mct
mkdir build && cd build
if [[ ${{ matrix.switch }} == "MULTI_ESMF" ]]; then
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


6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,9 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)$")
endif()

add_subdirectory(model)

# Turn on unit testing.
include(CTest)
if(BUILD_TESTING)
add_subdirectory(regtests/unittests)
endif()
3 changes: 3 additions & 0 deletions manual/defs.tex
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@
\newcommand{\cR}{{\cal R}}
\newcommand{\cS}{{\cal S}}

\newcommand{\rd}{{\mathrm d}}


\newcommand{\marbox}[1]{\marginpar{\fbox{{\small #1}}}}

\newcommand{\proddefH}[3]{
Expand Down
16 changes: 15 additions & 1 deletion manual/eqs/ICE4.tex
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@ \subsubsection{~$S_{ice}$: Empirical/parametric damping by sea ice} \label{sec:I

{\code IC4M7}: This is a formula for dissipation from \cite{art:Dob15}, developed for a mixture of pancake and frazil ice, using data collected in the Weddell Sea (Antarctica). The formula depends on wave frequency and ice thickness:
\begin{equation}\label{eq:ice7}
{\alpha=0.2T^{-2.13}h} \:\:\: .
{\alpha=2k_i=0.2h^1f^{2.13}} \:\:\: .
\end{equation}
This method is described in \cite{rep:RPLA18}.

{\code IC4M8}: Like {\code IC4M7}, this method is in the general form of
\begin{equation}\label{eq:ice8}
{k_i=C_{hf}h^mf^n} \:\:\: .
\end{equation}
The formula is taken from \cite{Meylan2018}, where it is described as a ``Model with Order 3 Power Law''. It is applied by \cite{Liu2020}, where it is referred to as the ``M2'' model. The model specifies $m=1$ and $n=3$, and $C_{hf}$ is a user-specified calibration coefficient. \cite{Liu2020} provide calibration to two field cases and \cite{rep:RYW2021} provides a calibration to a third field case, \cite{art:RMK2021}. The third calibration is set as the default for {\code IC4M8}, $C_{hf}=0.059$, but can be changed in using the namelist parameter (constant and uniform) {\code IC4CN}, or using the spatially and/or temporally variable parameter ${C_{ice,2}}$ . Further details on the calibrations are available in the inline documentation in {\file w3sic4md.F90}. This method is functionally the same as the ``{\code M2}'' model in {\code IC5} (i.e., {\code IC5} with {\code IC5VEMOD=3}) and is redundantly included here as {\code IC4M8} because it is in the same ``family'' as {\code IC4M7} and {\code IC4M9}, being in the form of Eq. (\ref{eq:ice8}).

For an example of setting the namelist parameter, see {\file /regtests/ww3\_tic1.1/input\_IC4\_M8}.

{\code IC4M9}: This formula is taken from the ``monomial power fit'' given in section 2.2.3 of \cite{rep:RYW2021}. Like {\code IC4M7} and {\code IC4M8}, it is a specific case of the general form of Eq. (\ref{eq:ice8}). The specificity is the constraint that $m=n/2-1$. This constraint is derived by \cite{rep:RYW2021} by invoking the scaling from \cite{art:YRW2019}, which is based on Reynolds number with ice thickness as the relevant length scale. This is also given as equation 2 in \cite{art:YRW2022}. The default namelist settings are $C_{hf}=2.9$ and $n=4.5$, from calibration by \cite{rep:RYW2021} to \cite{art:RMK2021}. Further details, including alternative calibrations such as \cite{art:Yu2022}, are available in the inline documentation in {\file w3sic4md.F90}. Constant values can be set using namelist parameters, where $C_{hf}$ and $n$ are {\code IC4CN(1)} and {\code IC4CN(2)}, respectively. Spatially and/or temporally versions of the same can be specified as ${C_{ice,2}}$ and ${C_{ice,3}}$, respectively.

The namelist default $C_{hf}$ values in {\code IC4M8} and {\code IC4M9} are consistent with those of identical formulae implemented in \cite{man:SWAN4145A}.


4 changes: 2 additions & 2 deletions manual/eqs/ICE5.tex
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ \subsubsection{~$S_{ice}$: Damping by sea ice (effective medium models)} \label{
\begin{align}
k_i^{EFS} &\propto \eta h_i^3 \sigma^{11},\label{eq:fspw}\\ k_i^{RP} &\propto \frac{\eta}{\rho_w g^2} \sigma^3,\label{eq:rppw}
\end{align}
whereas previous field measurements \citep[e.g.,][]{Meylan2018, Rogers2021} support a power law $k_i \propto \sigma^n$, with $n$ between 2 and 4. Eqs.~(\ref{eq:fspw}) and (\ref{eq:rppw}) indicate at certain regimes (i.e., $k_r \approx k_0$ and low $k_i$), $k_i$ of the EFS model is too sensitive to wave frequency and $k_i$ of the RP model shows no dependence on ice thickness.
whereas previous field measurements \citep[e.g.,][]{Meylan2018, RMK21} support a power law $k_i \propto \sigma^n$, with $n$ between 2 and 4. Eqs.~(\ref{eq:fspw}) and (\ref{eq:rppw}) indicate at certain regimes (i.e., $k_r \approx k_0$ and low $k_i$), $k_i$ of the EFS model is too sensitive to wave frequency and $k_i$ of the RP model shows no dependence on ice thickness.

The third model included in the {\code IC5} module is based on the ``Model with Order 3 Power Law'' proposed by \citet[][their section 6.2; hereafter the M2 model]{Meylan2018}, which assumes the loss of wave energy is proportional to the horizontal ice velocity squared times the ice thickness. The attenuation rate is given by
\begin{equation}
Expand All @@ -52,4 +52,4 @@ \subsubsection{~$S_{ice}$: Damping by sea ice (effective medium models)} \label{
%
\cit{IC5VEMOD} {the sea ice model to be selected: 1 - {\code EFS}, 2 - {\code RP}, 3 - {\code M2}; Default=3 (i.e., \textbf{the {\code M2} model is chosen}).}
\end{clist}
The first 6 parameters were introduced to improve the stability of the numerical solver for the EFS model \citep[the solver may fail for small wave periods in some rare cases, particularly for shallow water depth $d$ and low $G$; see][]{Liu2020}. Nonetheless, since version 7.12, the M2 model becomes the default option and these limiters are therefore not used by default.
The first 6 parameters were introduced to improve the stability of the numerical solver for the EFS model \citep[the solver may fail for small wave periods in some rare cases, particularly for shallow water depth $d$ and low $G$; see][]{Liu2020}. Nonetheless, since version 7.12, the M2 model becomes the default option and these limiters are therefore not used by default.
Loading