Skip to content

Commit

Permalink
Merge branch 'develop' into feature/ST4table
Browse files Browse the repository at this point in the history
  • Loading branch information
mickaelaccensi committed Sep 18, 2023
2 parents 283b989 + 6b9edfa commit 0aa822c
Show file tree
Hide file tree
Showing 52 changed files with 1,791 additions and 689 deletions.
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
31 changes: 16 additions & 15 deletions .github/workflows/intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,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
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-20.04

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 +51,27 @@ 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-openmp intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
# 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
. /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
sudo apt install cmake
spack external find
spack add 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 +92,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-20.04

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 @@ -116,8 +117,8 @@ jobs:
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
15 changes: 11 additions & 4 deletions manual/eqs/output.tex
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ \subsection{~Output parameters} \label{sub:outpars}
in \para\ref{sec:ww3shel}. That input file also provides a list of flags
indicating if output parameters are available in different field
output file types (ASCII, grib, igrads, NetCDF).
For any details on how these parameters are computed, the user may read the code of the {\code w3iogo} routine, in the {\code w3iogomd.ftn} module.
For any details on how these parameters are computed, the user may read the code of the {\code w3iogo} routine, in the {\code w3iogomd.F90} module.

Selection of field outputs in {\code ww3\_shel.inp} is most easily performed by providing a list of the
Selection of field outputs in {\code ww3\_shel.nml} or {\code ww3\_shel.inp} is most easily performed by providing a list of the
requested parameters, for example, {\textbf HS DIR SPR} will request the calculation of significant wave height, mean direction and directional spread. These will thus be stored in the {\code out\_grd.XX} file and can be post-processed, for example in NetCDF using {\code ww3\_ouf}. Examples are given in \para\ref{sec:ww3multi} and
\para\ref{sec:ww3ounf}. The names for these namelists are the bold names below, for
example \textbf{HS}.
Expand All @@ -26,6 +26,9 @@ \subsection{~Output parameters} \label{sub:outpars}
file extensions, NetCDF variable names and namelist-based selection (see
also \para\ref{sec:ww3ounf}), and the long parameter name/definition.

When the result is not overly sensitive to the contribution of the unresolved part of the spectrum (for $f<f_{NK}$), the contribution of the tail is parameterized assuming a power law decay of the spectrum, by default $E(f,\theta) = E(f_{NK},\theta) (f_{NK}/f)^{-5}$, for some parameters this is either unnecessary or misleading, and the integrals are computed only up to $f_{NK}$.


Finally we note that in all definitions the frequency is the \emph{relative} frequency. Thus, in the presence of currents, these can only be compared to drifting measurement data or data obtained in wavenumber and converted to frequency. Comparison to fixed instrument data requires the use of the full spectrum and proper conversion to the fixed reference frame.

\begin{list}{\Roman{outgrps})\hfill}
Expand Down Expand Up @@ -300,8 +303,12 @@ \subsection{~Output parameters} \label{sub:outpars}
\item \textbf{MSD} Direction of the maximum slope variance mss$_u$
\item \textbf{MCD} Spectral tail direction
\item \textbf{QP} Peakedness parameter \citep{art:G70}
\begin{equation} Q_p = \frac{2}{E^2} \int_0^{2\pi} \int_0^\infty
\sigma\:F(\sigma,\theta)^2\:d\sigma\:d\theta \: \label{eq:qp}
\begin{equation} Q_p = \frac{2}{E^2} \int_0^{f_{NK}} f \left( \int_0^{2\pi}
F(f,\theta) \:\rd \theta \right)^2 \: \rd f \: \label{eq:qp}
\end{equation}
\item \textbf{QKK} wavenumber peakedness \citep{art:DC23}
\begin{equation} Q_{kk} = \frac{1}{E^2} \int_0^{f_{NK}} \int_0^{2\pi}
0.5 \left[ A(k,\theta)+ A(k,\theta+\pi)\right]^2 \frac{\sigma^2}{k C_g} \:\rd \theta \: \rd \sigma \: \label{eq:qkk}
\end{equation}
\end{list}

Expand Down
10 changes: 10 additions & 0 deletions manual/manual.bib
Original file line number Diff line number Diff line change
Expand Up @@ -3654,3 +3654,13 @@ @article{vanVledder2006
volume = {53},
year = {2006}
}

@article{art:DC23,
author = {De Carlo, Marine and Fabrice Ardhuin and Annabelle Ollivier and Adrien Nigou },
journal = {Journal of Geophysical Research - Oceans},
keywords = {wave groups,altimetry},
pages = {},
title = {Wave groups and small scale variability of wave heights observed by altimeters},
volume = {},
year = {2023}
}
3 changes: 2 additions & 1 deletion model/ci/spack_gnu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ spack:
- [email protected]
- [email protected]
- [email protected]
- [email protected]~pio~pnetcdf~xerces
- [email protected]+fortran~pnetcdf
- [email protected]~debug~xerces+external-parallelio
view: true
concretizer:
unify: when_possible
11 changes: 6 additions & 5 deletions model/ci/spack_intel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ spack:
providers:
mpi: [intel-oneapi-mpi]
specs:
- [email protected]~dap
- [email protected]
- [email protected]
- [email protected]
- [email protected]~shared
- [email protected]~shared
- [email protected]+mpi+metis~shared
- [email protected]~dap
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]~pio~pnetcdf~xerces
- [email protected]+fortran~pnetcdf
- [email protected]~debug~xerces+external-parallelio
- intel-oneapi-mpi %intel
view: true
concretizer:
Expand Down
9 changes: 5 additions & 4 deletions model/inp/ww3_shel.inp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ $ T T 2 15 HMAXD SDMH St Dev of MXC (STE)
$ T T 2 16 HCMAXD SDMHC St Dev of MXHC (STE)
$ F T 2 17 WBT WBT Dominant wave breaking probability bT
$ F F 2 18 FP0 TP Peak period (from peak freq)
$ F F 2 19 WNMEAN WNM Mean wavenumber
$ -------------------------------------------------
$ 3 Spectral Parameters (first 5)
$ -------------------------------------------------
Expand Down Expand Up @@ -211,10 +212,10 @@ $ 8 Spectrum parameters
$ -------------------------------------------------
$ F F 8 1 MSS[X,Y] MSS Mean square slopes
$ F F 8 2 MSC[X,Y] MSC Spectral level at high frequency tail
$ F F 8 3 WL02[X,Y] WL02 East/X North/Y mean wavelength compon
$ F F 8 4 ALPXT AXT Correl sea surface gradients (x,t)
$ F F 8 5 ALPYT AYT Correl sea surface gradients (y,t)
$ F F 8 6 ALPXY AXY Correl sea surface gradients (x,y)
! F F 8 3 MSSD MSD Slope direction
! F F 8 4 MSCD MCD Tail slope direction
! F F 8 5 QP QP Goda peakedness parameter
! F F 8 6 QKK QKK Wavenumber peakedness
$ -------------------------------------------------
$ 9 Numerical diagnostics
$ -------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions model/nml/ww3_multi.nml
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,13 @@
!
! * the detailed list of field names is given in model/nml/ww3_shel.nml :
! DPT CUR WND AST WLV ICE IBG TAU RHO D50 IC1 IC5
! HS LM T02 T0M1 T01 FP DIR SPR DP HIG
! HS LM T02 T0M1 T01 FP DIR SPR DP HIG MXE MXES MXH MXHC SDMH SDMHC WBT TP WNM
! EF TH1M STH1M TH2M STH2M WN
! PHS PTP PLP PDIR PSPR PWS PDP PQP PPE PGW PSW PTM10 PT01 PT02 PEP TWS PNR
! UST CHA CGE FAW TAW TWA WCC WCF WCH WCM FWS
! SXY TWO BHD FOC TUS USS P2S USF P2L TWI FIC USP TOC
! ABR UBR BED FBB TBB
! MSS MSC WL02 AXT AYT AXY
! MSS MSC MSD MCD QP QKK
! DTD FC CFX CFD CFK
! U1 U2
!
Expand Down
9 changes: 5 additions & 4 deletions model/nml/ww3_shel.nml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
! T T 2 16 HCMAXD SDMHC St Dev of MXHC (STE)
! F T 2 17 WBT WBT Dominant wave breaking probability bT
! F F 2 18 FP0 TP Peak period (from peak freq)
! F F 2 19 WNMEAN WNM Mean wavenumber
! -------------------------------------------------
! 3 Spectral Parameters (first 5)
! -------------------------------------------------
Expand Down Expand Up @@ -201,10 +202,10 @@
! -------------------------------------------------
! F F 8 1 MSS[X,Y] MSS Mean square slopes
! F F 8 2 MSC[X,Y] MSC Spectral level at high frequency tail
! F F 8 3 WL02[X,Y] WL02 East/X North/Y mean wavelength compon
! F F 8 4 ALPXT AXT Correl sea surface gradients (x,t)
! F F 8 5 ALPYT AYT Correl sea surface gradients (y,t)
! F F 8 6 ALPXY AXY Correl sea surface gradients (x,y)
! F F 8 3 MSSD MSD Slope direction
! F F 8 4 MSCD MCD Tail slope direction
! F F 8 5 QP QP Goda peakedness parameter
! F F 8 6 QKK QKK Wavenumber peakedness
! -------------------------------------------------
! 9 Numerical diagnostics
! -------------------------------------------------
Expand Down
42 changes: 42 additions & 0 deletions model/src/gx_outf.F90
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
!> @file
!> @brief Generate GrADS input files from raw WAVEWATCH data file.
!>
!> @author H. L. Tolman
!> @author A. Chawla
!> @author J.H.G.M. Alves
!> @date 22-Mar-2021
!>
#include "w3macros.h"

!/ ------------------------------------------------------------------- /
!>
!> @brief Generate GrADS input files from raw WAVEWATCH data file.
!>
!> @details
!> Data is read from the grid output file out_grd.ww3 (raw data)
!> and from the file gx_outf.inp ( NDSI, output requests ).
!> Model definition and raw data files are read using WAVEWATCH III
!> subroutines.
!>
!> Output files are ww3.ctl and ww3.grads. The output files
!> contains a land-sea map, followed by requested fields. See the
!> control file for the names of the fields.
!>
!> @author H. L. Tolman
!> @author A. Chawla
!> @author J.H.G.M. Alves
!> @date 22-Mar-2021
!>
!> @copyright Copyright 2009-2022 National Weather Service (NWS),
!> National Oceanic and Atmospheric Administration. All rights
!> reserved. WAVEWATCH III is a trademark of the NWS.
!> No unauthorized use without permission.
!>
PROGRAM GXOUTF
!/
!/ +-----------------------------------+
Expand Down Expand Up @@ -740,6 +772,16 @@ PROGRAM GXOUTF
!/
CONTAINS
!/ ------------------------------------------------------------------- /
!>
!> @brief Perform actual output for GrADS postprocessing.
!>
!> @param[in] NX Grid dimensions.
!> @param[in] NY Grid dimensions.
!> @param[in] NSEA Number of sea points.
!>
!> @author H. L. Tolman
!> @date 22-Mar-2021
!>
SUBROUTINE GXEXGO ( NX, NY, NSEA )
!/
!/ +-----------------------------------+
Expand Down
28 changes: 28 additions & 0 deletions model/src/gx_outp.F90
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
!> @file
!> @brief Post-processing of point output for GrADS post-processing.
!>
!> @author H. L. Tolman
!> @author J.H. Alves
!> @author F. Ardhuin
!> @date 27-Aug-2015
!>

#include "w3macros.h"
!/ ------------------------------------------------------------------- /
!>
!> @brief Post-processing of point output for GrADS post-processing.
!>
!> @author H. L. Tolman
!> @author J.H. Alves
!> @author F. Ardhuin
!> @date 27-Aug-2015
!>
!> @copyright Copyright 2009-2022 National Weather Service (NWS),
!> National Oceanic and Atmospheric Administration. All rights
!> reserved. WAVEWATCH III is a trademark of the NWS.
!> No unauthorized use without permission.
!>
PROGRAM GXOUTP
!/
!/ +-----------------------------------+
Expand Down Expand Up @@ -539,6 +561,12 @@ PROGRAM GXOUTP
!/
CONTAINS
!/ ------------------------------------------------------------------- /
!>
!> @brief Perform actual point output.
!>
!> @author H. L. Tolman
!> @date 16-Jul-2012
!>
SUBROUTINE GXEXPO
!/
!/ +-----------------------------------+
Expand Down
Loading

0 comments on commit 0aa822c

Please sign in to comment.