diff --git a/.github/workflows/gnu.yml b/.github/workflows/gnu.yml index d1aa0e967..d28d1bb5b 100644 --- a/.github/workflows/gnu.yml +++ b/.github/workflows/gnu.yml @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/intel.yml b/.github/workflows/intel.yml index c40f3265e..f5de65dcd 100644 --- a/.github/workflows/intel.yml +++ b/.github/workflows/intel.yml @@ -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] @@ -8,7 +13,7 @@ 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 @@ -16,18 +21,18 @@ env: 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 @@ -35,7 +40,7 @@ jobs: # 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 @@ -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' @@ -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 @@ -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 diff --git a/.github/workflows/io_gnu_yml.old b/.github/workflows/io_gnu_yml.old new file mode 100644 index 000000000..def5a1402 --- /dev/null +++ b/.github/workflows/io_gnu_yml.old @@ -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 mpich@3.4.2 + 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 + + diff --git a/CMakeLists.txt b/CMakeLists.txt index 58115b3aa..5436f9cb1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/manual/defs.tex b/manual/defs.tex index 1f67da7e7..5b8963fa5 100644 --- a/manual/defs.tex +++ b/manual/defs.tex @@ -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]{ diff --git a/manual/eqs/ICE4.tex b/manual/eqs/ICE4.tex index 7e4332ce5..1ee257d60 100644 --- a/manual/eqs/ICE4.tex +++ b/manual/eqs/ICE4.tex @@ -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}. + + diff --git a/manual/eqs/ICE5.tex b/manual/eqs/ICE5.tex index f5fac80fa..4d5ab25b0 100755 --- a/manual/eqs/ICE5.tex +++ b/manual/eqs/ICE5.tex @@ -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} @@ -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. \ No newline at end of file +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. diff --git a/manual/eqs/NL1.tex b/manual/eqs/NL1.tex index a6539dbe5..c45e9294d 100644 --- a/manual/eqs/NL1.tex +++ b/manual/eqs/NL1.tex @@ -1,65 +1,92 @@ -\vsssub -\subsubsection{~$S_{nl}$: Discrete Interaction Approximation (\dia)} \label{sec:NL1} -\vsssub - -\opthead{NL1}{\wam\ model}{H. L. Tolman} \noindent -Nonlinear wave-wave interactions can be modeled using the discrete interaction -approximation \citep[\dia,][]{art:Hea85b}. This parameterization was + + +Resonant nonlinear interactions occur between four wave components +(quadruplets) with wavenumber vector $\bk$, $\bk_1$, $\bk_2$ and $\bk_3$ are such that +% eq:resonance +\begin{equation} \left . +\begin{array}{ccc} + \bk + \bk_1 & = & \bk_2 + \bk_3 \\ + f_r + f_{r,1}& =& f_{r,2} + f_{r,3} +\end{array} \:\:\: \right \rbrace \:\:\: , \label{eq:resonance} +\end{equation} + +Nonlinear 4-wave interaction theories were originally developed for the spectrum $F(f_r ,\theta)$. To assure the conservative nature of $S_{nl}$ for this spectrum (which can be considered as the "final product" of the model), this source term is calculated for $F(f_r,\theta)$ instead of $N(k,\theta)$, using the conversion (\ref{eq:jac_fr}). -Resonant nonlinear interactions occur between four wave components -(quadruplets) with wavenumber vector $\bk_1$ through $\bk_4$. In the \dia, it -is assumed that $\bk_1 = \bk_2$. Resonance conditions then require that -%--------------------------% -% Resonance conditions DIA % -%--------------------------% +\vsssub +\subsubsection{~$S_{nl}$: Discrete Interaction Approximation (\dia)} \label{sec:NL1} +\vsssub + +\opthead{NL1}{\wam\ model}{H. L. Tolman} + + + + In the \dia, for each component $\bk$, only 2 quadruplets configuration are +used, while there should be thousands for the full integral, and the interaction caused by these 2 quadruplets +is scaled so that it gives the right order of magnitude for the flux of energy towards low frequencies. + +Both quadruplets used the DIA use % eq:resonance \begin{equation} \left . \begin{array}{ccc} - \bk_1 + \bk_2 & = & \bk_3 + \bk_4 \\ - \sigma_2 & = & \sigma_1 \\ - \sigma_3 & = & (1+\lambda_{nl})\sigma_1 \\ - \sigma_4 & = & (1-\lambda_{nl})\sigma_1 -\end{array} \:\:\: \right \rbrace \:\:\: , \label{eq:resonance} + \bk_1 & = & \bk\\ + f_{r,2} & = & (1+\lambda)f_{r} \\ + f_{r,3} & = & (1-\lambda)f_{r} +\end{array} \:\:\: \right \rbrace \:\:\: , \label{eq:DIAchoice} +\end{equation} +where $\lambda$ is a constant, usually 0.25, and they only differ by the choice of the interacting angles +taking either a plus sign or a minus sign in the following +\begin{equation} \left . +\begin{array}{ccc} + \theta_{2,\pm} & = & \theta \pm \delta_{\theta,2} \\ + \theta_{3,\pm} & = & \theta \mp \delta_{\theta,3} \\ + \end{array} \:\:\: \right \rbrace \:\:\: , \label{eq:DIAangles} \end{equation} -where $\lambda_{nl}$ is a constant. For these quadruplets, the contribution -$\delta S_{nl}$ to the interaction for each discrete $(f_r,\theta)$ -combination of the spectrum corresponding to $\bk_1$ is calculated as +where $\delta_{\theta,2}$ and $\delta_{\theta,3}$ are only a function of $\lambda$ given by the geometry of +the interacting wavenumbers along the "figure of 8", namely +\begin{eqnarray} +\cos(\delta_{\theta,2})&=&(1-\lambda)^4+4-(1+\lambda)^4)/[4(1-\lambda)^2], \\ +\sin(\delta_{\theta,3})&=&\sin(\delta_{\theta,2}) (1-\lambda)^2/(1+\lambda)^2. +\end{eqnarray} + +Hence for any $\bk$ one quadruplet selects $\bk_{2,+}$ and $\bk_{3,+}$, and the other quadruplet selects its mirror image +$\bk_{2,-}$, $\bk_{2,-}$. Because there are 3 different components interacting in the two DIA-selected quadruplets, any discrete spectral component $(f_r,\theta)$ is actually involved in 6 quadruplets and directly exchanges energy with 12 other components $(f_r',\theta')$. Because the values of $f'_r$ and $\theta'$ do not fall exacly on other discrete components, the spectral density is interpolated using a bilinear interpolation, so that each source term value +$S_{nl}(\bk)$ contains the direct exchange of energy with 48 other discrete components. +we compute the three contributions that correspond to the situation in which $\bk$ takes the role of $\bk$,$\bk_{2,+}$, $\bk_{2,-}$, $\bk_{3,+}$ and $\bk_{3,-}$ in the quadruplet, namely the full source term is, without making explicit that bilinear interpolation, +\begin{eqnarray} +S_{\mathrm{nl}}(\bk) &=& -2 \left[\delta S_{\mathrm{nl}}(\bk,\bk_{2,+},\bk_{3,+})+\delta S_{\mathrm{nl}}(\bk,\bk_{2,-},\bk_{3,-})\right] \nonumber \\ + & & + \delta S_{\mathrm{nl}}(\bk_4,\bk,\bk_5) + \delta S_{\mathrm{nl}}(\bk_6,\bk,\bk_7) \\ + & & + \delta S_{\mathrm{nl}}(\bk_8,\bk_9,\bk) + \delta S_{\mathrm{nl}}(\bk_{10},\bk_{11},\bk) . \label{eq:diasum} +\end{eqnarray} +where the geometry of the quadruplet $(\bk_4,\bk_4,\bk,\bk_5)$ is obtained from that of $(\bk,\bk,\bk_{2,+},\bk_{3,+})$ by a dilation by a factor $(1+\lambda)^2$ and rotation by the angle $\delta_{\theta,2}$; $(\bk_6,\bk_6,\bk,\bk_7)$ has the same dilation but the opposite rotation; $(\bk_8,\bk_8,\bk_9,\bk)$ is dilated by a factor $(1-\lambda)^2$ and rotated by the angle $-\delta_{\theta,3}$: and $(\bk_{10},\bk_{10},\bk_{11},\bk)$ is dilated by the same factor and rotated by the opposite angle. + + +The elementary contributions $\delta S_{\mathrm{nl}}(\bk_l,\bk_m,\bk_n)$ are given by %----------------------------% % Nonlinear interactions DIA % %----------------------------% % eq:snl_dia -\begin{eqnarray} -\left ( \begin{array}{c} - \delta S_{nl,1} \\ \delta S_{nl,3} \\ \delta S_{nl,4} -\end{array} \right ) & = & D -\left ( \begin{array}{r} -2 \\ 1 \\ 1 \end{array} \right ) -C g^{-4} f_{r,1}^{11} \times \nonumber \\ -& & \left [ F_1^2 -\left ( \frac{F_3}{(1+\lambda_{nl})^4} + - \frac{F_4}{(1-\lambda_{nl})^4} \right ) - -\frac{2 F_1 F_3 F_4}{(1-\lambda_{nl}^2)^4} -\right ] \: , \label{eq:snl_dia} -\end{eqnarray} -where $F_1 = F(f_{r,1} ,\theta_1 )$ etc. and $\delta S_{nl,1} = \delta -S_{nl}(f_{r,1} ,\theta_1 )$ etc., $C$ is a proportionality constant. The -nonlinear interactions are calculated by considering a limited number of -combinations $(\lambda_{nl},C)$. In practice, only one combination is -used. Default values for different source term packages are presented in -Table~\ref{tab:snl_par}. + +\begin{equation} +\delta S_{\mathrm{nl}}(\bk_l,\bk_m,\bk_n) = \frac{C}{g^4} f_{r,l}^{11} \left [ F_l^2 \left ( \frac{F_m}{(1+\lambda)^4} + + \frac{F_n}{(1-\lambda)^4} \right ) - \frac{2 F_l F_m F_n}{(1-\lambda^2)^4} \right] , + \label{eq:snl_dia} +\end{equation} +where the spectral densities are $F_l = F(f_{r,l} ,\theta_l)$, etc. + $C$ is a proportionality constant that was tuned to reproduce the inverse energy cascade. Default values for different source term packages are presented in Table~\ref{tab:snl_par}. % tab:snl_par \begin{table} \begin{center} \begin{tabular}{|l|c|c|} \hline - & $\lambda_{nl}$ & $C$ \\ \hline + & $\lambda$ & $C$ \\ \hline ST6 & 0.25 & $3.00 \; 10^7$ \\ \hline \wam-3 & 0.25 & $2.78 \; 10^7$ \\ \hline ST4 (Ardhuin et al.)& 0.25 & $2.50 \; 10^7$ \\ \hline @@ -68,7 +95,7 @@ \subsubsection{~$S_{nl}$: Discrete Interaction Approximation (\dia)} \label{sec: \caption{Default constants in \dia\ for input-dissipation packages.} \label{tab:snl_par} \botline \end{table} -This source term is developed for deep water, using the appropriate dispersion +This parameterization was developed for deep water, using the appropriate dispersion relation in the resonance conditions. For shallow water the expression is scaled by the factor $D$ (still using the deep-water dispersion relation, however) @@ -132,3 +159,37 @@ \subsubsection{~$S_{nl}$: Discrete Interaction Approximation (\dia)} \label{sec: above constants can be reset by the user in the input files of the model (see \para\ref{sub:ww3grid}). +\vsssub +\subsubsection{~$S_{nl}$: Gaussian Quadrature Method (\dia)} \label{sec:GQM} +\vsssub + +\opthead{NL1 , but with a negative IQTYPE}{TOMAWAC model, M. Benoit}{adaptation to WW3 by S. Siadatmousavi \& F. Ardhuin} + +\noindent +Changing the namelist parameter IQTYPE to a negative value replaces the +DIA parameterization with the possibility to perform an exact but fast cal- +culation of $S_{\mathrm{nl}}$ using the Gaussian Quadrature Method of \cite{Lavrenov2001}. +More details can be found in \cite{Gagnaire-Renou2009}. + + +The quadruplet configurations that are used correspond to the three integrals over $f_1$, $f_2$ and $\theta_1$, with all other frequencies and directions given by the resonance conditions (\ref{eq:resonance}) with only one ambiguity on the angle $\theta_2$ which can be defined by a sign index $s$, as in the DIA. Starting from eq. (A4) in \cite{Lavrenov2001} as writen in (2.25) of \cite{Gagnaire-Renou2009}, the source term is +\begin{equation} +S_{\mathrm{nl}}(\sigma,\theta) = 8 \sum_s \int_{\sigma_1=0}^\infty \int_{\theta_1=0}^{2 \pi} \int_{\sigma_2=0}^{(\sigma+\sigma_1)/2} T \frac{F_2 F_3 (F \sigma_1^4 + F_1 \sigma^4) - F F_1 (F_2 \sigma_3^4 + F_3 \sigma_2^4)}{\sqrt{B}\sqrt{((\left| \bk+\bk_1 \right|/g- \sigma_3^2)^2-\sigma_2^4} } {\mathrm d}\sigma_1 {\mathrm d}\theta_1 {\mathrm d}\sigma_2 , + \label{eq:snl_gqm} +\end{equation} +where $B$ is given by eq. (A5) of Lavrenov (2001) and +\begin{equation} +T(\bk,\bk_1,\bk_2,\bk_3) = \frac{\pi g^2 D^2(\bk,\bk_1,\bk_2,\bk_3) }{4 \sigma \sigma_1 \sigma_2 \sigma_3} +\end{equation} +where $ D(\bk,\bk_1,\bk_2,\bk_3)$ is given by \cite{Webb1978} in his eq. (A1). + +This triple integral is performed using quadrature functions to best resolve the effect of the singularities in the denominator. It is thus replaced with weighted sums over the 3 dimensions. + +Compared to the DIA, there is no bilinear interpolation and the nearest neighbor is used in frequency and direction. Also, +the source term is computed by a loop over the quadruplet configuration, which allows for filtering based on +both the value of the coupling coefficient and the energy level at the frequency corresponding to $\bk$. Within +that loop, the source term contribution is computed for all 4 interacting components, so that any filtering still +conserves energy, action, momentum ... (One may argue that this multiplies by 4 the number of calculations, but it may have the benefit of properly dealing with the high frequency boundary... this is to be verified. The same question arises for the DIA: why have the wavenumber $\bk$ play the role of the other members of the quadruplets when this will also be computed as we loop on the spectral components?). + +If a very aggressive filtering is performed, the source may need to be rescaled. + diff --git a/manual/eqs/ST3.tex b/manual/eqs/ST3.tex index 91a7fca10..b287aa2ec 100644 --- a/manual/eqs/ST3.tex +++ b/manual/eqs/ST3.tex @@ -57,16 +57,15 @@ \subsubsection{~$S_{in} + S_{ds}$: \wam\ cycle 4 (ECWAM)} \label{sec:ST3} waves that travel faster than the wind. This accounts for some gustiness in the wind and should possibly be resolution-dependent. For reference, this parameter was not properly set in early versions of the SWAN model, as -discovered by R. Lalbeharry.}. The roughness $z_1$ is defined as, - +discovered by R. Lalbeharry.}. If the friction velocity $u_\star$ is known, +it gives the roughness $z_1$ and the wind speed at altitude $z_u$ (by default $z_u=10$~m), \begin{eqnarray} -U_{10}&=&\frac{u_\star}{\kappa} \log\left(\frac{z_u}{z_1}\right) \\ -z_1&=&\alpha_0 \frac{\tau}{ \sqrt{1-\tau_w/\tau}}, +z_1&=&\alpha_0 \frac{\tau}{ \sqrt{1-\tau_w/u_\star^2}}, \\ +U(z_u)&=&\frac{u_\star}{\kappa} \log\left(\frac{z_u}{z_1}\right) \end{eqnarray} \noindent -where $\tau=u_\star^2$, and $z_u$ is the height at which the wind is -specified. These two equations provide an implicit functional dependence of +In practice these two equations provide an implicit functional dependence of $u_\star$ on $U_{10}$ and $\tau_w/\tau$. This relationship is then tabulated \citep{art:Jan91, rep:Bea07}. diff --git a/manual/eqs/ST4.tex b/manual/eqs/ST4.tex index 624ac6af8..733ec09e7 100644 --- a/manual/eqs/ST4.tex +++ b/manual/eqs/ST4.tex @@ -8,10 +8,10 @@ \subsubsection{~$S_{\mathrm{in}} + S_{\mathrm{ds}}$: Saturation-based dissipatio This family of parameterizations uses a positive part of the wind input taken from WAM cycle 4 with an ad hoc reduction of $u_\star$, implemented in order to allow a balance with a saturation-based dissipation that uses different options for -a cumulative term. There are three main options for defining the saturation and the cumulative term. Chosing one or the other is done with the {\F SDSBCHOICE} parameter, with {\F SDSBCHOICE=1} for \cite{art:Aea10}, {\F SDSBCHOICE=2} for \cite{Filipot&Ardhuin2012}, and {\F SDSBCHOICE=3} for \cite{Romero2019}. That last options uses a saturation that is defined from the local spectral density, and thus gives zero dissipation for directions where the threshold is not reached, leading to much broader directional spectra. Also the stronger bimodality is achieved by having a strong modulation effect as a cumulative term. +a cumulative term. There are three main options for defining the saturation and the cumulative term. Chosing one or the other is done with the {\F SDSBCHOICE} parameter, with {\F SDSBCHOICE=1} for \cite{art:Aea10}, {\F SDSBCHOICE=2} for \cite{Filipot&Ardhuin2012}, and {\F SDSBCHOICE=3} for \cite{Romero2019} and later adjustments including \cite{art:AA23}. That last option uses a saturation that is defined from the local spectral density, and thus gives zero dissipation for directions where the threshold is not reached, leading to much broader directional spectra. Also the stronger bimodality is achieved by having a strong modulation effect as a cumulative term. Many other adjustments can be made by changing the namelist parameters. A few successful combinations -are given by tables \ref{tab:ST4_parSIN} and \ref{tab:ST4_parSDS}, with results described by \citep{art:RA13,art:SAG16}. +are given by tables \ref{tab:ST4_parSIN} and \ref{tab:ST4_parSDS}, with results described by \citep{art:RA13,art:SAG16,art:AA23}. Further calibration to any particular wind field should be done for best performance. Guidance for this is given by \cite{Stopa2018}. %We also note that the particular %set of parameters T400 corresponds to setting IPHYS=1 in the ECWAM code cycle 45R2, with a few differences @@ -216,27 +216,15 @@ \subsubsection{~$S_{\mathrm{in}} + S_{\mathrm{ds}}$: Saturation-based dissipatio direction will typically produce less dissipation than a sea state with all the energy radiated in the same direction. -Based on recent analysis by \cite{Guimaraes2018} and \cite{Peureux&al.2019}, this saturation is enhanced by a factor $M_L$ that represents -the effect of long waves on short waves -\begin{equation} -M_l(k,\theta)=1+M_\theta \sqrt{\mathrm{mss}(k,\theta)} + N_\theta \sqrt{\mathrm{nss}(k,\theta)} \label{defFACSAT}. -\end{equation} -where $M_\theta$ is twice the modulation transfer function for short wave steepness, with -$M_\theta=8$ when following the simplified theory by \cite{art:LHS60} and using the root mean square enhancement of $B$ over a -long wave cycle. $N_\theta$ is an additional straining factor due to the instability of the wave action envelope of short waves -propagating in the direction close to that of the long wave \citep{Peureux&al.2019}. The squared slopes $\mathrm{mss}(k,\theta)$ is -the mean square slope in direction $\theta$, wheras $\mathrm{nss}(k,\theta)$ is a slope of long waves propagating in a narrow window $\pm \delta_\theta$, -around the short wave direction $\theta$. - We finally define our dissipation term as the sum of the saturation-based term and a cumulative breaking term $S_{\mathrm{bk,cu}}$, \begin{eqnarray} \cS_{ds}(k,\theta)& =& \sigma \frac{C_{\mathrm{ds}}^{\mathrm{sat}}}{B^2_r} \left[ \delta_d -\max\left\{ M_l(k,\theta) B\left(k\right) - +\max\left\{ B\left(k\right) - B_r,0\right\}^2 \right. \nonumber \\ - & & + \left(1-\delta_d \right) \left. \max\left\{ M_L(k,\theta) B'\left(k,\theta \right)- B_r + & & + \left(1-\delta_d \right) \left. \max\left\{B'\left(k,\theta \right)- B_r ,0\right\}^2\right]N(k,\theta) \nonumber \\ & & + \cS_{\mathrm{bk,cu}}(k,\theta) + \cS_{\mathrm{turb}}(k,\theta) \label{Sds_all}. \end{eqnarray} diff --git a/manual/eqs/output.tex b/manual/eqs/output.tex index 1f512b16a..bfa7e0b5a 100644 --- a/manual/eqs/output.tex +++ b/manual/eqs/output.tex @@ -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}. @@ -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 0 : no source term in IG band -$ IGMAXFREQ : maximum frequency of IG band -$ IGEMPIRICAL: constant in empirical free IG source -$ IGBCOVERWRITE: T: Replaces IG spectrum, does not add -$ IGSWELLMAX: T: activates free IG sources for all freq. +$ IGMETHOD : 1: Hasselmann, 2: Krasitskii-Janssen +$ IGADDOUTP : activation of bound wave correction +$ in ww3_outp / ww3_ounp +$ IGSOURCE : 1: uses bound waves, 2: empirical +$ IGSTERMS : > 0 : no source term in IG band +$ IGMAXFREQ : maximum frequency of IG band +$ IGEMPIRICAL : constant in empirical free IG source +$ IGBCOVERWRITE : T: Replaces IG spectrum, does not add +$ IGSWELLMAX : T: activates free IG sources for all freq. $ $ $ Propagation schemes ------------------------------------------------ $ $ First order : Namelist PRO1 -$ CFLTM : Maximum CFL number for refraction. +$ CFLTM : Maximum CFL number for refraction. $ $ UQ/UNO with diffusion : Namelist PRO2 -$ CFLTM : Maximum CFL number for refraction. -$ DTIME : Swell age (s) in garden sprinkler +$ CFLTM : Maximum CFL number for refraction. +$ DTIME : Swell age (s) in garden sprinkler $ correction. If 0., all diffusion $ switched off. If small non-zero $ (DEFAULT !!!) only wave growth @@ -274,7 +346,7 @@ $ LATMIN : Maximum latitude used in calc. of $ strength of diffusion for prop. $ $ UQ/UNO with averaging : Namelist PRO3 -$ CFLTM : Maximum CFL number for refraction. +$ CFLTM : Maximum CFL number for refraction. $ WDTHCG : Tuning factor propag. direction. $ WDTHTH : Tuning factor normal direction. $ @@ -284,54 +356,55 @@ $ limitation and the GSE alleviation. $ $ Unstructured grids ------------------------------------------------ $ $ UNST parameters : Namelist UNST -$ UGOBCAUTO : TRUE: OBC points are taken from type 15 elements -$ FALSE: OBC points must be listed in ww3_grid.inp -$ UGOBCDEPTH : Threshold ( < 0) depth for OBC points if UGOBCAUTO is TRUE -$ UGOBCFILE : Reading boundary files from a file -$ EXPFSN : Activation of N scheme (only one of the below 4, True - Active, False - not active) -$ EXPFSPSI : Activation of PSI scheme -$ EXPFSFCT : Activation of FCT scheme -$ IMPFSN : Activation of N implicit scheme -$ EXPTOTAL : Activation of the Block explicit N scheme solver -$ IMPTOTAL : Activation of fully implicit scheme | Non splitting -$ IMPREFRACTION : Turn on implicit freq. shift (only with imptotal) -$ IMPFREQSHIFT : Turn on implicit freq. shift terms (only with imptotal) -$ IMPSOURCE : Turn on implicit source terms (only with imptotal) -$ JGS_TERMINATE_MAXITER : max. Number of iterations -$ JGS_TERMINATE_DIFFERENCE : Terminate based on the total change of the unweightet sum of wave action -$ JGS_TERMINATE_NORM : Terminate based on the norm of the solution -$ JGS_USE_JACOBI : Use Jacobi solver family -$ JGS_BLOCK_GAUSS_SEIDEL : Use Block Gauss Seidel method for imptotal instead of the conservative jacobi iterator. -$ JGS_MAXITER : max. Number of solver iterations -$ JGS_PMIN : % of grid points that do not need to converge during solver iteration. -$ JGS_DIFF_THR : implicit solver threshold for JGS_TERMINATE_DIFFERENCE -$ JGS_NORM_THR : terminate based on the norm of the solution -$ JGS_LIMITER : use total (quasi-steady: limits whole equation) instead of local limiter (un-steady: limits only source terms) -$ JGS_LIMITER_FUNC : 1 - old limiter; 2 - alternatnive limiter -$ SETUP_APPLY_WLV : Compute wave setup (experimental) -$ SOLVERTHR_SETUP : Solver threshold for setup computations -$ CRIT_DEP_SETUP : Critical depths for setup computations +$ UGOBCAUTO : TRUE: OBC points are taken from type 15 elements +$ FALSE: OBC points must be listed in ww3_grid.inp +$ UGOBCDEPTH : Threshold ( < 0) depth for OBC points if UGOBCAUTO is TRUE +$ UGOBCFILE : Reading boundary files from a file +$ EXPFSN : Activation of N scheme (only one of the below 4, True - Active, False - not active) +$ EXPFSPSI : Activation of PSI scheme +$ EXPFSFCT : Activation of FCT scheme +$ IMPFSN : Activation of N implicit scheme +$ EXPTOTAL : Activation of the Block explicit N scheme solver +$ IMPTOTAL : Activation of fully implicit scheme | Non splitting +$ IMPREFRACTION : Turn on implicit freq. shift (only with imptotal) +$ IMPFREQSHIFT : Turn on implicit freq. shift terms (only with imptotal) +$ IMPSOURCE : Turn on implicit source terms (only with imptotal) +$ JGS_TERMINATE_MAXITER : max. Number of iterations +$ JGS_TERMINATE_DIFFERENCE : Terminate based on the total change of the unweightet sum of wave action +$ JGS_TERMINATE_NORM : Terminate based on the norm of the solution +$ JGS_USE_JACOBI : Use Jacobi solver family +$ JGS_BLOCK_GAUSS_SEIDEL : Use Block Gauss Seidel method for imptotal instead of the conservative jacobi iterator. +$ JGS_MAXITER : max. Number of solver iterations +$ JGS_PMIN : % of grid points that do not need to converge during solver iteration. +$ JGS_DIFF_THR : implicit solver threshold for JGS_TERMINATE_DIFFERENCE +$ JGS_NORM_THR : terminate based on the norm of the solution +$ JGS_LIMITER : use total (quasi-steady: limits whole equation) instead of local limiter (un-steady: limits only source terms) +$ JGS_LIMITER_FUNC : 1 - old limiter; 2 - alternatnive limiter +$ SETUP_APPLY_WLV : Compute wave setup (experimental) +$ SOLVERTHR_SETUP : Solver threshold for setup computations +$ CRIT_DEP_SETUP : Critical depths for setup computations $ $ SMC grid propagation : Namelist PSMC and default values -$ CFLTM : Maximum CFL no. for propagation, 0.7 -$ DTIME : Swell age for diffusion term (s), 0.0 +$ CFLTM : Maximum CFL no. for propagation, 0.7 +$ DTIME : Swell age for diffusion term (s), 0.0 $ LATMIN : Maximum latitude (deg) for GCT, 86.0 $ RFMAXD : Maximum refraction turning (deg), 80.0 -$ LvSMC : No. of refinement level, default 1 -$ ISHFT : Shift number of i-index, default 0 -$ JEQT : Shift number of j-index, default 0 +$ LvSMC : No. of refinement level, default 1 +$ ISHFT : Shift number of i-index, default 0 +$ JEQT : Shift number of j-index, default 0 $ NBISMC : No. of input boundary points, 0 -$ UNO3 : Use 3rd order advection scheme, .FALSE. -$ AVERG : Add extra spatial averaging, .FALSE. +$ UNO3 : Use 3rd order advection scheme, .FALSE. +$ AVERG : Add extra spatial averaging, .FALSE. $ SEAWND : Use sea-point only wind input. .FALSE. +$ $ &PSMC DTIME = 39600.0, LATMIN=85.0, RFMAXD = 36.0, LvSMC=3, JEQT=1344 / $ $ Rotated pole ------------------------------------------------------ $ $ Pole parameters : Namelist ROTD -$ PLAT : Rotated pole latitude -$ PLON : Rotated pole longitude -$ UNROT : Logical, un-rotate directions to -$ true north +$ PLAT : Rotated pole latitude +$ PLON : Rotated pole longitude +$ UNROT : Logical, un-rotate directions to +$ true north $ $ Compile switch /RTD required. $ @@ -351,8 +424,8 @@ $ $ Output boundary conditions to rotated pole grids ------------------ $ $ $ Pole parameters : Namelist ROTB -$ BPLAT(1:9) : Pole latitude of each destination grid -$ BPLON(1:9) : Pole longitude of each destination grid +$ BPLAT(1:9) : Pole latitude of each destination grid +$ BPLON(1:9) : Pole longitude of each destination grid $ $ Compile switch /RTD required. $ @@ -376,24 +449,24 @@ $ directional spectrum using, e.g. MEM (Lygre&Krogstad 1986). $ $ Parameters (integers) : Namelist OUTS $ For the frequency spectrum E(f) -$ E3D : <=0: not declared, > 0: declared -$ I1E3D : First frequency index of output (default is 1) -$ I2E3D : Last frequency index of output (default is NK) +$ E3D : <=0: not declared, > 0: declared +$ I1E3D : First frequency index of output (default is 1) +$ I2E3D : Last frequency index of output (default is NK) $ For the mean direction th1m(f), and spread sth1m(f) -$ TH1MF, STH1MF : <=0: not declared, > 0: declared -$ I1TH1MF, I1STH1MF: First frequency index of output (default is 1) -$ I2TH1MF, I2STH1MF: First frequency index of output (default is 1) +$ TH1MF, STH1MF : <=0: not declared, > 0: declared +$ I1TH1MF, I1STH1MF : First frequency index of output (default is 1) +$ I2TH1MF, I2STH1MF : First frequency index of output (default is 1) $ For the mean direction th2m(f), and spread sth2m(f) -$ TH2MF, STH2MF : <=0: not declared, > 0: declared -$ I1TH2MF, I1STH2MF: First frequency index of output (default is 1) -$ I2TH2MF, I2STH2MF: First frequency index of output (default is 1) +$ TH2MF, STH2MF : <=0: not declared, > 0: declared +$ I1TH2MF, I1STH2MF : First frequency index of output (default is 1) +$ I2TH2MF, I2STH2MF : First frequency index of output (default is 1) $ For 2nd order pressure at K=0 (source of microseisms & microbaroms) -$ P2SF : <=0: not declared, > 0: declared +$ P2SF : <=0: not declared, > 0: declared $ I1P2SF : First frequency index of output (default is 1) $ I2P2SF : Last frequency index of output (default is NK) $ For the surface Stokes drift partitions (USP) -$ USSP : First index (default is 1, should always be 1) -$ IUSSP : Last index (must be <= than NK and should be +$ USSP : First index (default is 1, should always be 1) +$ IUSSP : Last index (must be <= than NK and should be $ between 3 and ~10 with the tradeoff $ between accuracy and resources) $ STK_WN : List of wavenumbers (size of IUSSP) @@ -404,11 +477,10 @@ $ a climate model. $ $ Miscellaneous ------------------------------------------------------ $ $ Misc. parameters : Namelist MISC -$ CICE0 : Ice concentration cut-off. -$ CICEN : Ice concentration cut-off. -$ PMOVE : Power p in GSE aleviation for -$ moving grids in Eq. (D.4). -$ XSEED : Xseed in seeding alg. (!/SEED). +$ CICE0 : Ice concentration cut-off. +$ CICEN : Ice concentration cut-off. +$ LICE : Length scale for sea ice damping +$ XSEED : Xseed in seeding alg. (!/SEED). $ FLAGTR : Indicating presence and type of $ subgrid information : $ 0 : No subgrid information. @@ -417,67 +489,86 @@ $ daries between grid points. $ 2 : Transp. at cell centers. $ 3 : Like 1 with cont. ice. $ 4 : Like 2 with cont. ice. -$ TRCKCMPR : Logical variable (T/F). Set to F to -$ disable "compression" of track output. -$ This simplifies post-processing. -$ Default is T and will create track -$ output in the traditional manner -$ (WW3 v3, v4, v5). -$ XP, XR, XFILT -$ Xp, Xr and Xf for the dynamic +$ XP, XR, XFILT : Xp, Xr and Xf for the dynamic $ integration scheme. -$ IHMAX : Number of discrete levels in part. -$ HSPMIN : Minimum Hs in partitioning. -$ WSM : Wind speed multiplier in part. -$ WSC : Cut of wind sea fraction for +$ PMOVE : Power p in GSE aleviation for +$ moving grids in Eq. (D.4). +$ IHM : Number of discrete levels in part. +$ HSPM : Minimum Hs in partitioning. +$ WSM : Wind speed multiplier in part. +$ WSC : Cut of wind sea fraction for $ identifying wind sea in part. -$ FLC : Flag for combining wind seas in +$ FLC : Flag for combining wind seas in $ partitioning. -$ NOSW : Number of partitioned swell fields +$ FMICHE : Constant in Miche limiter. +$ RWNDC : Coefficient for current in relative wind +$ FACBERG : Multiplicative factor for iceberg mask +$ NOSW : Number of partitioned swell fields $ in field output. -$ PTM : Partioning method: +$ GSHIFT : grid offset for multi-grid boundaries +$ WCOR1 : wind correction threshold +$ WCOR2 : wind wind correction factor +$ STDX : Space-Time Extremes X-Length +$ STDY : Space-Time Extremes Y-Length +$ STDT : Space-Time Extremes Duration +$ ICEHMIN : Minimum thickness of sea ice +$ ICEHINIT : Initial value of ice thickness +$ ICEDISP : Flag for use of the ice covered dispertion relation +$ ICESLN : +$ ICEWIND : Scale factor for reduction of wind input by ice concentration +$ ICESNL : +$ ICESDS : +$ ICEHFAC : Scale factor for sea ice thickness +$ ICEHDISP : Minimum thickness of sea ice in the dispersion +$ relation before relaxing the conv. criterion +$ ICEDDISP : +$ ICEFDISP : +$ CALTYPE : Calendar type. The only accepted +$ values are 'standard' (default), +$ '365_day', or '360_day'. +$ TRCKCMPR : Logical variable (T/F). Set to F to +$ disable "compression" of track output. +$ This simplifies post-processing. +$ Default is T and will create track +$ output in the traditional manner +$ (WW3 v3, v4, v5). +$ PTM : Partioning method: $ 1 : Default WW3 $ 2 : Watershedding + wind cutoff $ 3 : Watershedding only $ 4 : Wind speed cutoff only $ 5 : High/Low band cutoff (see PTFC) -$ PTFC : Cutouf frequency for High/Low band +$ PTFC : Cutouf frequency for High/Low band $ partioning (PTM=5). Default = 0.1Hz -$ FMICHE : Constant in Miche limiter. -$ STDX : Space-Time Extremes X-Length -$ STDY : Space-Time Extremes Y-Length -$ STDT : Space-Time Extremes Duration -$ P2SF : ...... -$ CALTYPE: Calendar type. The only accepted -$ values are 'standard' (default), -$ '365_day', or '360_day'. +$ BTBET : The constant used for separating wind sea +$ and swell when we estimate WBT $ $ Diagnostic Sea-state Dependent Stress- - - - - - - - - - - - - - - - - $ Reichl et al. 2014 : Namelist FLD1 -$ TAILTYPE : High Frequency Tail Method -$ 0: Constant value (prescribed) -$ 1: Wind speed dependent -$ (Based on GFDL Hurricane -$ Model Z0 relationship) -$ TAILLEV : Level of high frequency tail -$ (if TAILTYPE==0) -$ Valid choices: -$ Capped min: 0.001, max: 0.02 -$ TAILT1 : Tail transition ratio 1 -$ TAILT1*peak input frequency -$ is the first transition point of -$ the saturation specturm -$ Default is 1.25 -$ TAILT1 : Tail transition ratio 2 -$ TAILT2*peak input frequency -$ is the second transition point of -$ the saturation specturm -$ Default is 3.00 +$ TAILTYPE : High Frequency Tail Method +$ 0: Constant value (prescribed) +$ 1: Wind speed dependent +$ (Based on GFDL Hurricane +$ Model Z0 relationship) +$ TAILLEV : Level of high frequency tail +$ (if TAILTYPE==0) +$ Valid choices: +$ Capped min: 0.001, max: 0.02 +$ TAILT1 : Tail transition ratio 1 +$ TAILT1*peak input frequency +$ is the first transition point of +$ the saturation specturm +$ Default is 1.25 +$ TAILT1 : Tail transition ratio 2 +$ TAILT2*peak input frequency +$ is the second transition point of +$ the saturation specturm +$ Default is 3.00 $ Donelan et al. 2012 : Namelist FLD2 -$ TAILTYPE : See above (FLD1) -$ TAILLEV : See above (FLD1) -$ TAILT1 : See above (FLD1) -$ TAILT2 : See above (FLD1) +$ TAILTYPE : See above (FLD1) +$ TAILLEV : See above (FLD1) +$ TAILT1 : See above (FLD1) +$ TAILT2 : See above (FLD1) $ $ In the 'Out of the box' test setup we run with sub-grid obstacles $ and with continuous ice treatment. diff --git a/model/nml/ww3_multi.nml b/model/nml/ww3_multi.nml index 6719a3510..9836884c1 100644 --- a/model/nml/ww3_multi.nml +++ b/model/nml/ww3_multi.nml @@ -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 ! diff --git a/model/nml/ww3_shel.nml b/model/nml/ww3_shel.nml index 528b35c56..97beaf6a0 100644 --- a/model/nml/ww3_shel.nml +++ b/model/nml/ww3_shel.nml @@ -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) ! ------------------------------------------------- @@ -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 ! ------------------------------------------------- @@ -318,9 +319,9 @@ ! * the number of each homogeneous input is defined by HOMOG_COUNT ! * the total number of homogeneous input is automatically calculated ! * the homogeneous input must start from index 1 to N -! * if VALUE1 is equal 0, then the homogeneous input is desactivated +! * if VALUE1 is equal 0, then the homogeneous input is deactivated ! * NAME can be IC1, IC2, IC3, IC4, IC5, MDN, MTH, MVS, LEV, CUR, WND, ICE, MOV -! * each homogeneous input is defined over a maximum of 3 values detailled below : +! * each homogeneous input is defined over a maximum of 3 values detailed below : ! - IC1 is defined by thickness ! - IC2 is defined by viscosity ! - IC3 is defined by density diff --git a/model/src/cmake/check_switches.cmake b/model/src/cmake/check_switches.cmake index 563d529e2..d09a91c5e 100644 --- a/model/src/cmake/check_switches.cmake +++ b/model/src/cmake/check_switches.cmake @@ -52,7 +52,7 @@ function(check_switches switches switch_files) message(FATAL_ERROR "Switch '${valid_opt}' requires '${required_switch}' to be set") endif() elseif(json_type STREQUAL "ARRAY") - string(JSON n_requires_any LENGTH ${vategory} valid-options ${j_options} requries ${i_requires}) + string(JSON n_requires_any LENGTH ${category} valid-options ${j_options} requires ${i_requires}) math(EXPR n_requires_any "${n_requires_any} - 1") # Loop over array and check that one of the switches is present @@ -70,7 +70,7 @@ function(check_switches switches switch_files) if(NOT found) message(FATAL_ERROR "Switch ${valid_opt} requires one of ${possible_values} to be set") endif() - + endif() endforeach() endif() @@ -98,7 +98,7 @@ function(check_switches switches switch_files) elseif(num_switches STREQUAL "upto2" AND n_switches_in_category GREATER 2) message(FATAL_ERROR "Too many ${category_name} switches found (max 2)") endif() - + endforeach() set(${switch_files} ${files} PARENT_SCOPE) diff --git a/model/src/cmake/src_list.cmake b/model/src/cmake/src_list.cmake index a73f3b72b..d745be388 100644 --- a/model/src/cmake/src_list.cmake +++ b/model/src/cmake/src_list.cmake @@ -92,5 +92,3 @@ set(scripnc_src ${CMAKE_CURRENT_SOURCE_DIR}/SCRIP/scrip_remap_write.f ${CMAKE_CURRENT_SOURCE_DIR}/SCRIP/scrip_remap_read.f ) - - diff --git a/model/src/cmake/switches.json b/model/src/cmake/switches.json index ca01708af..30eca480c 100644 --- a/model/src/cmake/switches.json +++ b/model/src/cmake/switches.json @@ -264,7 +264,7 @@ }, { "name": "STAB3", - "requires": ["ST3", "ST4"] + "requires_any": ["ST3", "ST4"] } ] }, @@ -756,16 +756,16 @@ } ] }, - { - "name": "ddlib", + { + "name": "ddlib", "num_switches": "upto1", "description": "domain decomposition library", "valid-options": [ - { + { "name": "METIS", "requires": ["PDLIB"] - }, - { + }, + { "name": "SCOTCH", "requires": ["PDLIB"] } @@ -813,5 +813,15 @@ "name": "B4B" } ] + }, + { + "name": "ascii", + "num_switches": "upto1", + "description": "ASCII output for binary .ww3 file", + "valid-options": [ + { + "name": "ASCII" + } + ] } ] diff --git a/model/src/gx_outf.F90 b/model/src/gx_outf.F90 index 4c25b4425..c8ab00e38 100644 --- a/model/src/gx_outf.F90 +++ b/model/src/gx_outf.F90 @@ -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 !/ !/ +-----------------------------------+ @@ -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 ) !/ !/ +-----------------------------------+ diff --git a/model/src/gx_outp.F90 b/model/src/gx_outp.F90 index 63b525485..d34fdbaa7 100644 --- a/model/src/gx_outp.F90 +++ b/model/src/gx_outp.F90 @@ -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 !/ !/ +-----------------------------------+ @@ -539,6 +561,12 @@ PROGRAM GXOUTP !/ CONTAINS !/ ------------------------------------------------------------------- / + !> + !> @brief Perform actual point output. + !> + !> @author H. L. Tolman + !> @date 16-Jul-2012 + !> SUBROUTINE GXEXPO !/ !/ +-----------------------------------+ diff --git a/model/src/w3adatmd.F90 b/model/src/w3adatmd.F90 index 17e6e4c24..fa174e4f8 100644 --- a/model/src/w3adatmd.F90 +++ b/model/src/w3adatmd.F90 @@ -187,6 +187,7 @@ MODULE W3ADATMD ! MSSD R.A. Public Direction of MSSX ! MSCD R.A. Public Direction of MSCX ! QP R.A. Public Goda peakedness parameter. + ! QKK R.A. Public Spectral bandwidth (De Carlo et al. 2023) ! ! DTDYN R.A. Public Mean dynamic time step (raw). ! FCUT R.A. Public Cut-off frequency for tail. @@ -488,9 +489,9 @@ MODULE W3ADATMD ! Output fields group 8) ! REAL, POINTER :: MSSX(:), MSSY(:), MSSD(:), & - MSCX(:), MSCY(:), MSCD(:) + MSCX(:), MSCY(:), MSCD(:), QKK(:) REAL, POINTER :: XMSSX(:), XMSSY(:), XMSSD(:), & - XMSCX(:), XMSCY(:), XMSCD(:) + XMSCX(:), XMSCY(:), XMSCD(:), XQKK(:) ! ! Output fields group 9) ! @@ -629,7 +630,7 @@ MODULE W3ADATMD BEDFORMS(:,:), PHIBBL(:), TAUBBL(:,:) ! REAL, POINTER :: MSSX(:), MSSY(:), MSSD(:), & - MSCX(:), MSCY(:), MSCD(:) + MSCX(:), MSCY(:), MSCD(:), QKK(:) ! REAL, POINTER :: DTDYN(:), FCUT(:), CFLXYMAX(:), & CFLTHMAX(:), CFLKMAX(:) @@ -1297,7 +1298,7 @@ SUBROUTINE W3DIMA ( IMOD, NDSE, NDST, D_ONLY ) ALLOCATE ( WADATS(IMOD)%MSSX(NSEALM), WADATS(IMOD)%MSSY(NSEALM), & WADATS(IMOD)%MSCX(NSEALM), WADATS(IMOD)%MSCY(NSEALM), & WADATS(IMOD)%MSSD(NSEALM), WADATS(IMOD)%MSCD(NSEALM), & - STAT=ISTAT ) + WADATS(IMOD)%QKK(NSEALM), STAT=ISTAT ) CHECK_ALLOC_STATUS ( ISTAT ) ! WADATS(IMOD)%MSSX = UNDEF @@ -1306,6 +1307,7 @@ SUBROUTINE W3DIMA ( IMOD, NDSE, NDST, D_ONLY ) WADATS(IMOD)%MSCX = UNDEF WADATS(IMOD)%MSCY = UNDEF WADATS(IMOD)%MSCD = UNDEF + WADATS(IMOD)%QKK = UNDEF call print_memcheck(memunit, 'memcheck_____:'//' W3DIMA 8') ! ! 9) Numerical diagnostics @@ -2363,6 +2365,12 @@ SUBROUTINE W3XDMA ( IMOD, NDSE, NDST, OUTFLAGS ) ALLOCATE ( WADATS(IMOD)%XQP(1) ) END IF ! + IF ( OUTFLAGS( 8, 6) ) THEN + ALLOCATE ( WADATS(IMOD)%XQKK(NXXX) ) + ELSE + ALLOCATE ( WADATS(IMOD)%XQKK(1) ) + END IF + ! WADATS(IMOD)%XMSSX = UNDEF WADATS(IMOD)%XMSSY = UNDEF WADATS(IMOD)%XMSSD = UNDEF @@ -2370,6 +2378,7 @@ SUBROUTINE W3XDMA ( IMOD, NDSE, NDST, OUTFLAGS ) WADATS(IMOD)%XMSCY = UNDEF WADATS(IMOD)%XMSCD = UNDEF WADATS(IMOD)%XQP(1) = UNDEF + WADATS(IMOD)%XQKK = UNDEF ! IF ( OUTFLAGS( 9, 1) ) THEN ALLOCATE ( WADATS(IMOD)%XDTDYN(NXXX), STAT=ISTAT ) @@ -2991,6 +3000,7 @@ SUBROUTINE W3SETA ( IMOD, NDSE, NDST ) MSCX => WADATS(IMOD)%MSCX MSCY => WADATS(IMOD)%MSCY MSCD => WADATS(IMOD)%MSCD + QKK => WADATS(IMOD)%QKK ! DTDYN => WADATS(IMOD)%DTDYN FCUT => WADATS(IMOD)%FCUT @@ -3337,6 +3347,7 @@ SUBROUTINE W3XETA ( IMOD, NDSE, NDST ) MSCX => WADATS(IMOD)%XMSCX MSCY => WADATS(IMOD)%XMSCY MSCD => WADATS(IMOD)%XMSCD + QKK => WADATS(IMOD)%XQKK ! DTDYN => WADATS(IMOD)%XDTDYN FCUT => WADATS(IMOD)%XFCUT diff --git a/model/src/w3canomd.F90 b/model/src/w3canomd.F90 index de287eb85..5395853f2 100644 --- a/model/src/w3canomd.F90 +++ b/model/src/w3canomd.F90 @@ -1,5 +1,25 @@ +!> @file +!> @brief Calculation of the second order correction to the surface +!> gravity wave spectrum. +!> +!> @author P.A.E.M. Janssen +!> @date 21-Aug-2014 +!> + #include "w3macros.h" !/ ------------------------------------------------------------------- / +!> +!> @brief Calculation of the second order correction to the surface +!> gravity wave spectrum. +!> +!> @author P.A.E.M. Janssen +!> @date 21-Aug-2014 +!> +!> @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. +!> MODULE W3CANOMD !/ !/ +-----------------------------------+ @@ -117,6 +137,18 @@ MODULE W3CANOMD !/ CONTAINS !/ ------------------------------------------------------------------- / + !> + !> @brief Adds second order spectrum on top of first order spectrum. + !> + !> @param[inout] E Energy density spectrum (1-D), f-theta. + !> @param[in] DEPTH Mean water depth. + !> @param[in] WN Wavenumbers. + !> @param[in] CG Group velocities. + !> @param[in] IACTION Action density spectrum (1-D). + !> + !> @author F. Ardhuin + !> @date 19-Oct-2012 + !> SUBROUTINE W3ADD2NDORDER(E,DEPTH,WN,CG,IACTION) !/ !/ +-----------------------------------+ @@ -313,6 +345,25 @@ END SUBROUTINE W3ADD2NDORDER !----------------------------------------------------------------------- ! + !> + !> @brief Determines second order spectrum. + !> + !> @param[in] F1 2-D free wave spectrum + !> @param[out] F3 2-D spectrum including 2nd-order correction + !> @param[in] NFRE number of frequencies + !> @param[in] NANG number of directions + !> @param[in] FR frequencies + !> @param[in] DFIM frequency increment + !> @param[in] TH directional array + !> @param[in] DELTH directional increment + !> @param[in] DPTH depth array + !> @param[in] SIGM mapping indicator + !> @param[in] NFREH + !> @param[in] NANGH + !> + !> @author Peter Janssen + !> @date NA + !> SUBROUTINE CAL_SEC_ORDER_SPEC(F1,F3,NFRE,NANG,FR,DFIM,TH,DELTH, & DPTH,SIGM, NFREH, NANGH) ! @@ -649,6 +700,23 @@ END SUBROUTINE CAL_SEC_ORDER_SPEC ! !-------------------------------------------------------------------- ! + !> + !> @brief Computes tables for second order spectrum in frequency space. + !> + !> @param NFRE number of frequencies + !> @param NANG number of directions + !> @param NDEPTH number of entries in the depth table + !> @param DEPTHA + !> @param OMSTART start frequency + !> @param FRAC fractional increase in frequency space + !> @param XMR inverse of thinning factor in frequency space + !> @param DFDTH product of increment in frequency and direction + !> @param OMEGA angular frequency array + !> @param TH direction array + !> + !> @author NA + !> @date NA + !> SUBROUTINE TABLES_2ND(NFRE,NANG,NDEPTH,DEPTHA,OMSTART,FRAC,XMR,& DFDTH,OMEGA,TH) ! @@ -821,6 +889,35 @@ END SUBROUTINE TABLES_2ND ! !-------------------------------------------------------------------- ! + !> + !> @brief Computes second order spectrum in frequency space. + !> + !> @param F1 2D free wave spectrum (input) + !> @param F3 bound waves spectrum (output) + !> @param NFRE number of frequencies + !> @param NANG number of directions + !> @param NMAX maximum index corresponds to twice the cut-off frequency + !> + !> @param NDEPTH number of entries in depth table + !> @param DEPTHA start value depth array + !> @param DEPTHD increment depth array + !> @param OMSTART start value angular frequency array + !> @param FRAC fractional increase in frequency space + !> @param MR thinning factor in frequency space + !> @param OMEGA angular frequency array + !> @param DEPTH depth array + !> @param AKMEAN mean wavenumber array + !> @param TA table for minus interactions + !> @param TB table for plus interactions + !> @param TC_QL table for quasi-linear interactions + !> @param TT_4M table for stokes frequency correction + !> @param TT_4P table for stokes frequency correction + !> @param IM_P table for wavenumber m2 plus + !> @param IM_M table for wavenumber m2 min + !> + !> @author NA + !> @date NA + !> SUBROUTINE SECSPOM(F1,F3,NFRE,NANG,NMAX,NDEPTH,& DEPTHA,DEPTHD,OMSTART,FRAC,MR,DFDTH,OMEGA,& DEPTH,AKMEAN,TA,TB,TC_QL,TT_4M,TT_4P,& @@ -1035,14 +1132,28 @@ SUBROUTINE SECSPOM(F1,F3,NFRE,NANG,NMAX,NDEPTH,& ! RETURN END SUBROUTINE SECSPOM + ! - ! - !----------------------------------------------------------------------- - ! - !*** *REAL FUNCTION* *A(XI,XJ,THI,THJ) - ! - !----------------------------------------------------------------------- + !> + !> @brief Gives nonlinear transfer coefficient for three wave interactions + !> interactions of gravity waves in the ideal case of no current. Determines + !> the minus interaction coefficients. + !> + !> @param XI wave number + !> @param XJ wave number + !> @param THI + !> @param THJ + !> @returns A + !> + !> @author Peter Janssen + !> @date NA + !> REAL FUNCTION A(XI,XJ,THI,THJ) + !----------------------------------------------------------------------- + ! + !*** *REAL FUNCTION* *A(XI,XJ,THI,THJ) + ! + !----------------------------------------------------------------------- ! !*** *A* DETERMINES THE MINUS INTERACTIONS. ! @@ -1100,10 +1211,24 @@ REAL FUNCTION A(XI,XJ,THI,THJ) RETURN END FUNCTION A ! - !*** *REAL FUNCTION* *B(XI,XJ,THI,THJ) - ! - !----------------------------------------------------------------------- + !> + !> @brief Gives nonlinear transfer coefficient for three wave interactions + !> interactions of gravity waves in the ideal case of no current. Determines + !> the plus interaction coefficients. + !> + !> @param XI wave number + !> @param XJ wave number + !> @param THI + !> @param THJ + !> @returns B + !> + !> @author Peter Janssen + !> @date NA + !> REAL FUNCTION B(XI,XJ,THI,THJ) + !*** *REAL FUNCTION* *B(XI,XJ,THI,THJ) + ! + !----------------------------------------------------------------------- ! !*** *B* DETERMINES THE PLUS INTERACTION COEFFICIENTS. ! @@ -1160,12 +1285,24 @@ REAL FUNCTION B(XI,XJ,THI,THJ) RETURN END FUNCTION B ! - !----------------------------------------------------------------------- - ! - !*** *REAL FUNCTION* *C_QL(XK0,XK1,TH0,TH1) - ! - !----------------------------------------------------------------------- + !> + !> @brief Determine contribution by quasi-linear terms. + !> + !> @param XK0 + !> @param XK1 + !> @param TH0 + !> @param TH1 + !> @returns C_QL + !> + !> @author Peter Janssen + !> @date NA + !> REAL FUNCTION C_QL(XK0,XK1,TH0,TH1) + !----------------------------------------------------------------------- + ! + !*** *REAL FUNCTION* *C_QL(XK0,XK1,TH0,TH1) + ! + !----------------------------------------------------------------------- ! !*** *A* DETERMINES THE QUASI-LINEAR TERM. ! @@ -1212,12 +1349,27 @@ END FUNCTION C_QL ! ! - !----------------------------------------------------------------------- - ! - !*** *REAL FUNCTION* *VPLUS(XI,XJ,XK,THI,THJ,THK) - ! - !----------------------------------------------------------------------- + !> + !> @brief Determines the second-order transfer coefficient + !> for three wave interactions of gravity waves. + !> + !> @param XI wave numbers + !> @param XJ wave numbers + !> @param XK wave numbers + !> @param THI wave direction + !> @param THJ wave direction + !> @param THK wave direction + !> @returns VPLUS + !> + !> @author Peter Janssen + !> @date NA + !> REAL FUNCTION VPLUS(XI,XJ,XK,THI,THJ,THK) + !----------------------------------------------------------------------- + ! + !*** *REAL FUNCTION* *VPLUS(XI,XJ,XK,THI,THJ,THK) + ! + !----------------------------------------------------------------------- ! !*** *VPLUS* DETERMINES THE SECOND-ORDER TRANSFER COEFFICIENT ! FOR THREE WAVE INTERACTIONS OF GRAVITY WAVES. @@ -1288,12 +1440,27 @@ REAL FUNCTION VPLUS(XI,XJ,XK,THI,THJ,THK) RETURN END FUNCTION VPLUS ! - !----------------------------------------------------------------------- - ! - !*** *REAL FUNCTION* *VMIN(XI,XJ,XK,THI,THJ,THK) - ! - !----------------------------------------------------------------------- + !> + !> @brief Determines the second-order transfer coefficient for + !> three wave interactions of gravity waves. + !> + !> @param XI wave number + !> @param XJ wave number + !> @param XK wave number + !> @param THI wave direction + !> @param THJ wave direction + !> @param THK wave direction + !> @returns VMIN + !> + !> @author Peter Janssen + !> @date NA + !> REAL FUNCTION VMIN(XI,XJ,XK,THI,THJ,THK) + !----------------------------------------------------------------------- + ! + !*** *REAL FUNCTION* *VMIN(XI,XJ,XK,THI,THJ,THK) + ! + !----------------------------------------------------------------------- ! !*** *VMIN* DETERMINES THE SECOND-ORDER TRANSFER COEFFICIENT FOR ! THREE WAVE INTERACTIONS OF GRAVITY WAVES. @@ -1364,12 +1531,29 @@ REAL FUNCTION VMIN(XI,XJ,XK,THI,THJ,THK) RETURN END FUNCTION VMIN ! - !----------------------------------------------------------------------- - ! - !*** *REAL FUNCTION* *U(XI,XJ,XK,XL,THI,THJ,THK,THL) - ! - !----------------------------------------------------------------------- + !> + !> @brief Determines the third-order transfer coefficient for four + !> wave interactions of gravity waves. + !> + !> @param XI wave number + !> @param XJ wave number + !> @param XK wave number + !> @param XL wave number + !> @param THI + !> @param THJ + !> @param THK + !> @param THL + !> @returns U + !> + !> @author Peter Janssen + !> @date NA + !> REAL FUNCTION U(XI,XJ,XK,XL,THI,THJ,THK,THL) + !----------------------------------------------------------------------- + ! + !*** *REAL FUNCTION* *U(XI,XJ,XK,XL,THI,THJ,THK,THL) + ! + !----------------------------------------------------------------------- ! !*** *U* DETERMINES THE THIRD-ORDER TRANSFER COEFFICIENT FOR FOUR ! WAVE INTERACTIONS OF GRAVITY WAVES. @@ -1438,12 +1622,29 @@ REAL FUNCTION U(XI,XJ,XK,XL,THI,THJ,THK,THL) RETURN END FUNCTION U ! - !----------------------------------------------------------------------- - ! - !*** *REAL FUNCTION* *W2(XI,XJ,XK,XL,THI,THJ,THK,THL) - ! - !----------------------------------------------------------------------- + !> + !> @brief Determines the contribution of the direct four-wave + !> interactions of gravity waves of the type A_2^*A_3A_4. + !> + !> @param XI Wave number + !> @param XJ Wave number + !> @param XK Wave number + !> @param XL Wave number + !> @param THI + !> @param THJ + !> @param THK + !> @param THL + !> @returns W2 + !> + !> @author Peter Janssen + !> @date NA + !> REAL FUNCTION W2(XI,XJ,XK,XL,THI,THJ,THK,THL) + !----------------------------------------------------------------------- + ! + !*** *REAL FUNCTION* *W2(XI,XJ,XK,XL,THI,THJ,THK,THL) + ! + !----------------------------------------------------------------------- ! !*** *W2* DETERMINES THE CONTRIBUTION OF THE DIRECT FOUR-WAVE ! INTERACTIONS OF GRAVITY WAVES OF THE TYPE @@ -1490,12 +1691,29 @@ REAL FUNCTION W2(XI,XJ,XK,XL,THI,THJ,THK,THL) RETURN END FUNCTION W2 ! - !----------------------------------------------------------------------- - ! - !*** *REAL FUNCTION* *V2(XI,XJ,XK,XL,THI,THJ,THK,THL) - ! - !----------------------------------------------------------------------- + !> + !> @brief Determines the contribution of the virtual + !> four-wave interactions of gravity waves. + !> + !> @param XI Wave number + !> @param XJ Wave number + !> @param XK Wave number + !> @param XL Wave number + !> @param THI + !> @param THJ + !> @param THK + !> @param THL + !> @returns V2 + !> + !> @author Peter Janssen + !> @date NA + !> REAL FUNCTION V2(XI,XJ,XK,XL,THI,THJ,THK,THL) + !----------------------------------------------------------------------- + ! + !*** *REAL FUNCTION* *V2(XI,XJ,XK,XL,THI,THJ,THK,THL) + ! + !----------------------------------------------------------------------- ! !*** *V2* DETERMINES THE CONTRIBUTION OF THE VIRTUAL ! FOUR-WAVE INTERACTIONS OF GRAVITY WAVES. @@ -1624,12 +1842,29 @@ REAL FUNCTION V2(XI,XJ,XK,XL,THI,THJ,THK,THL) RETURN END FUNCTION V2 ! - !----------------------------------------------------------------------- - ! - !*** *REAL FUNCTION* *W1(XI,XJ,XK,XL,THI,THJ,THK,THL) - ! - !----------------------------------------------------------------------- + !> + !> @brief Determines the nonlinear transfer coefficient for four wave + !> interactions of gravity waves of the type A_2A_3A_4. + !> + !> @param XI Wave number + !> @param XJ Wave number + !> @param XK Wave number + !> @param XL Wave number + !> @param THI + !> @param THJ + !> @param THK + !> @param THL + !> @returns W1 + !> + !> @author Peter Janssen + !> @date NA + !> REAL FUNCTION W1(XI,XJ,XK,XL,THI,THJ,THK,THL) + !----------------------------------------------------------------------- + ! + !*** *REAL FUNCTION* *W1(XI,XJ,XK,XL,THI,THJ,THK,THL) + ! + !----------------------------------------------------------------------- ! !*** *W1* DETERMINES THE NONLINEAR TRANSFER COEFFICIENT FOR FOUR ! WAVE INTERACTIONS OF GRAVITY WAVES OF THE TYPE @@ -1683,10 +1918,29 @@ REAL FUNCTION W1(XI,XJ,XK,XL,THI,THJ,THK,THL) RETURN END FUNCTION W1 ! - !*** *REAL FUNCTION* *W4(XI,XJ,XK,XL,THI,THJ,THK,THL) - ! - !----------------------------------------------------------------------- + !> + !> @brief Determines the nonlinear transfer coefficient for four wave + !> interactions of gravity waves of the type A_^*A_3^*A_4^*. + !> + !> @param XI Wave number + !> @param XJ Wave number + !> @param XK Wave number + !> @param XL Wave number + !> @param THI + !> @param THJ + !> @param THK + !> @param THL + !> @returns W4 + !> + !> @author Peter Janssen + !> @date NA + !> REAL FUNCTION W4(XI,XJ,XK,XL,THI,THJ,THK,THL) + !----------------------------------------------------------------------- + ! + !*** *REAL FUNCTION* *W4(XI,XJ,XK,XL,THI,THJ,THK,THL) + ! + !----------------------------------------------------------------------- ! !*** *W4* DETERMINES THE NONLINEAR TRANSFER COEFFICIENT FOR FOUR ! WAVE INTERACTIONS OF GRAVITY WAVES of the type @@ -1741,13 +1995,29 @@ REAL FUNCTION W4(XI,XJ,XK,XL,THI,THJ,THK,THL) RETURN END FUNCTION W4 - ! - !----------------------------------------------------------------------- - ! - !*** *REAL FUNCTION* *B3(XI,XJ,XK,XL,THI,THJ,THK,THL) - ! - !----------------------------------------------------------------------- + + !> + !> @brief Weights of the A_2^*A_3^*A_4 part of the canonical transformation. + !> + !> @param XI Wave number + !> @param XJ Wave number + !> @param XK Wave number + !> @param XL Wave number + !> @param THI + !> @param THJ + !> @param THK + !> @param THL + !> @returns B3 + !> + !> @author Peter Janssen + !> @date NA + !> REAL FUNCTION B3(XI,XJ,XK,XL,THI,THJ,THK,THL) + !----------------------------------------------------------------------- + ! + !*** *REAL FUNCTION* *B3(XI,XJ,XK,XL,THI,THJ,THK,THL) + ! + !----------------------------------------------------------------------- ! !*** *B3* WEIGHTS OF THE A_2^*A_3^*A_4 PART OF THE ! CANONICAL TRANSFORMATION. @@ -1858,12 +2128,29 @@ REAL FUNCTION B3(XI,XJ,XK,XL,THI,THJ,THK,THL) RETURN END FUNCTION B3 ! - !----------------------------------------------------------------------- - ! - !*** *REAL FUNCTION* *B4(XI,XJ,XK,XL,THI,THJ,THK,THL) - ! - !----------------------------------------------------------------------- + !> + !> @brief Weights of the A_2^*A_3^*A_4^* part of the canonical + !> transformation. + !> + !> @param XI Wave number + !> @param XJ Wave number + !> @param XK Wave number + !> @param XL Wave number + !> @param THI + !> @param THJ + !> @param THK + !> @param THL + !> @returns B4 + !> + !> @author Peter Janssen + !> @date NA + !> REAL FUNCTION B4(XI,XJ,XK,XL,THI,THJ,THK,THL) + !----------------------------------------------------------------------- + ! + !*** *REAL FUNCTION* *B4(XI,XJ,XK,XL,THI,THJ,THK,THL) + ! + !----------------------------------------------------------------------- ! !*** *B4* WEIGHTS OF THE A_2^*A_3^*A_4^* PART OF THE CANONICAL ! TRANSFORMATION. @@ -1954,12 +2241,29 @@ REAL FUNCTION B4(XI,XJ,XK,XL,THI,THJ,THK,THL) RETURN END FUNCTION B4 ! - !----------------------------------------------------------------------- - ! - !*** *REAL FUNCTION* *B1(XI,XJ,XK,XL,THI,THJ,THK,THL) - ! - !----------------------------------------------------------------------- + !> + !> @brief Weights of the A_2A_3A_4 part of the canonical + !> transformation. + !> + !> @param XI Wave number + !> @param XJ Wave number + !> @param XK Wave number + !> @param XL Wave number + !> @param THI + !> @param THJ + !> @param THK + !> @param THL + !> @returns B1 + !> + !> @author Peter Janssen + !> @date NA + !> REAL FUNCTION B1(XI,XJ,XK,XL,THI,THJ,THK,THL) + !----------------------------------------------------------------------- + ! + !*** *REAL FUNCTION* *B1(XI,XJ,XK,XL,THI,THJ,THK,THL) + ! + !----------------------------------------------------------------------- ! !*** *B1* WEIGHTS OF THE A_2A_3A_4 PART OF THE CANONICAL ! TRANSFORMATION. @@ -2055,15 +2359,30 @@ REAL FUNCTION B1(XI,XJ,XK,XL,THI,THJ,THK,THL) ) +W1(RI,RJ,RK,RL,THI,THJ,THK,THL) ) RETURN END FUNCTION B1 - ! - !----------------------------------------------------------------------- - ! - !*** *REAL FUNCTION* *B2(XI,XJ,XK,XL,THI,THJ,THK,THL) - ! - !----------------------------------------------------------------------- + !> + !> @brief Weights of the A_2^*A_3A_4 part of the canonical + !> transformation. + !> + !> @param XI Wave number + !> @param XJ Wave number + !> @param XK Wave number + !> @param XL Wave number + !> @param THI + !> @param THJ + !> @param THK + !> @param THL + !> @returns B2 + !> + !> @author Peter Janssen + !> @date NA + !> REAL FUNCTION B2(XI,XJ,XK,XL,THI,THJ,THK,THL) + !----------------------------------------------------------------------- ! + !*** *REAL FUNCTION* *B2(XI,XJ,XK,XL,THI,THJ,THK,THL) + ! + !----------------------------------------------------------------------- ! !*** *B2* WEIGHTS OF THE A_2^*A_3A_4 PART OF THE CANONICAL ! TRANSFORMATION. @@ -2155,12 +2474,26 @@ REAL FUNCTION B2(XI,XJ,XK,XL,THI,THJ,THK,THL) RETURN END FUNCTION B2 ! - !----------------------------------------------------------------------- - ! - !*** *REAL FUNCTION* *A1(XI,XJ,XK,THI,THJ,THK) - ! - !----------------------------------------------------------------------- + !> + !> @brief Auxiliary second-order coefficient. + !> + !> @param XI Wave number + !> @param XJ Wave number + !> @param XK Wave number + !> @param THI + !> @param THJ + !> @param THK + !> @returns A1 + !> + !> @author Peter Janssen + !> @date NA + !> REAL FUNCTION A1(XI,XJ,XK,THI,THJ,THK) + !----------------------------------------------------------------------- + ! + !*** *REAL FUNCTION* *A1(XI,XJ,XK,THI,THJ,THK) + ! + !----------------------------------------------------------------------- ! !*** *A1* AUXILIARY SECOND-ORDER COEFFICIENT. ! @@ -2215,12 +2548,26 @@ REAL FUNCTION A1(XI,XJ,XK,THI,THJ,THK) RETURN END FUNCTION A1 ! - !----------------------------------------------------------------------- - ! - !*** *REAL FUNCTION* *A2(XI,XJ,XK,THI,THJ,THK) - ! - !----------------------------------------------------------------------- + !> + !> @brief Auxiliary second-order function. + !> + !> @param XI Wave number + !> @param XJ Wave number + !> @param XK Wave number + !> @param THI + !> @param THJ + !> @param THK + !> @returns A2 + !> + !> @author Peter Janssen + !> @date NA + !> REAL FUNCTION A2(XI,XJ,XK,THI,THJ,THK) + !----------------------------------------------------------------------- + ! + !*** *REAL FUNCTION* *A2(XI,XJ,XK,THI,THJ,THK) + ! + !----------------------------------------------------------------------- ! !*** *A2* AUXILIARY SECOND-ORDER FUNCTION. ! @@ -2259,12 +2606,26 @@ REAL FUNCTION A2(XI,XJ,XK,THI,THJ,THK) RETURN END FUNCTION A2 ! - !----------------------------------------------------------------------- - ! - !*** *REAL FUNCTION* *A3(XI,XJ,XK,THI,THJ,THK) - ! - !----------------------------------------------------------------------- + !> + !> @brief Auxiliary second-order function. + !> + !> @param XI Wave number + !> @param XJ Wave number + !> @param XK Wave number + !> @param THI + !> @param THJ + !> @param THK + !> @returns A3 + !> + !> @author Peter Janssen + !> @date NA + !> REAL FUNCTION A3(XI,XJ,XK,THI,THJ,THK) + !----------------------------------------------------------------------- + ! + !*** *REAL FUNCTION* *A3(XI,XJ,XK,THI,THJ,THK) + ! + !----------------------------------------------------------------------- ! !*** *A3* AUXILIARY SECOND-ORDER FUNCTION. ! @@ -2317,14 +2678,23 @@ REAL FUNCTION A3(XI,XJ,XK,THI,THJ,THK) END FUNCTION A3 ! - !----------------------------------------------------------------------- - ! - ! - !*** *REAL FUNCTION* *OMEG(X)* - ! - !----------------------------------------------------------------------- - ! + !> + !> @brief Determines the dispersion relation for gravity + !> waves. + !> + !> @param X Wave number + !> @returns OMEG + !> + !> @author Peter Janssen + !> @date NA + !> REAL FUNCTION OMEG(X) + !----------------------------------------------------------------------- + ! + !*** *REAL FUNCTION* *OMEG(X)* + ! + !----------------------------------------------------------------------- + ! ! !*** *OMEG* DETERMINES THE DISPERSION RELATION FOR GRAVITY ! WAVES. @@ -2366,15 +2736,21 @@ REAL FUNCTION OMEG(X) RETURN END FUNCTION OMEG ! - ! - !----------------------------------------------------------------------- - ! - ! - !*** *REAL FUNCTION* *VG(X)* - ! - !----------------------------------------------------------------------- - ! + !> + !> @brief Determines the group velocity for gravity- waves. + !> + !> @param X Wave number + !> @returns VG + !> + !> @author Peter Janssen + !> @date NA + !> REAL FUNCTION VG(X) + !----------------------------------------------------------------------- + ! + !*** *REAL FUNCTION* *VG(X)* + ! + !----------------------------------------------------------------------- ! !*** *VG* DETERMINES THE GROUP VELOCITY FOR GRAVITY- WAVES. ! @@ -2416,6 +2792,16 @@ REAL FUNCTION VG(X) RETURN END FUNCTION VG !--------------------------------------------------------------------- + !> + !> @brief Gives the wavenumber. + !> + !> @param OM + !> @param BETA + !> @returns AKI + !> + !> @author Peter Janssen + !> @date NA + !> REAL FUNCTION AKI(OM,BETA) ! This function gives the wavenumber ... !--------------------------------------------------------------------- @@ -2444,6 +2830,18 @@ REAL FUNCTION AKI(OM,BETA) RETURN END FUNCTION AKI ! + !> + !> @brief NA. + !> + !> @param XI + !> @param XJ + !> @param THI + !> @param THJ + !> @returns VABS + !> + !> @author NA + !> @date NA + !> REAL FUNCTION VABS(XI,XJ,THI,THJ) ! !--------------------------------------------------------------------- @@ -2462,6 +2860,18 @@ REAL FUNCTION VABS(XI,XJ,THI,THJ) RETURN END FUNCTION VABS ! + !> + !> @brief NA. + !> + !> @param XI + !> @param XJ + !> @param THI + !> @param THJ + !> @returns VDIR + !> + !> @author NA + !> @date NA + !> REAL FUNCTION VDIR(XI,XJ,THI,THJ) ! !--------------------------------------------------------------------- diff --git a/model/src/w3fld1md.F90 b/model/src/w3fld1md.F90 index 960fd185a..fdd5ad230 100644 --- a/model/src/w3fld1md.F90 +++ b/model/src/w3fld1md.F90 @@ -550,9 +550,13 @@ SUBROUTINE W3FLD1( ASPC, FPI, WNDX,WNDY, ZWND, & TAUDIR=atan2(TAUY, TAUX) ! Note: add another criterion (stress direction) for iteration. CRIT1=(ABS(USTAR-USTRB)*100.0)/((USTAR+USTRB)*0.5) .GT. 0.1 - CRIT2=(ABS(TAUDIR-TAUDIRB)*100.0/(TAUDIR+TAUDIRB)*0.5) .GT. 0.1 + IF ((TAUDIR+TAUDIRB).NE.0.) THEN + CRIT2=(ABS(TAUDIR-TAUDIRB)*100.0/(TAUDIR+TAUDIRB)*0.5) .GT. 0.1 + ELSE + CRIT2=.TRUE. + ENDIF IF (CRIT1 .OR. CRIT2) THEN - ! IF ((ABS(USTAR-USTRB)*100.0)/((USTAR+USTRB)*0.5) .GT. 0.1) THEN + ! IF ((ABS(USTAR-USTRB)*100.0)/((USTAR+USTRB)*0.5) .GT. 0.1) THEN USTRB=USTAR TAUDIRB=TAUDIR CTR=CTR+1 @@ -1116,7 +1120,11 @@ SUBROUTINE APPENDTAIL(INSPC, WN2, NKT, KA1, KA2, KA3, WNDDIR,SAT) DO K=KA1, KA2-1 AVG=SUM(INSPC(K,:))/MAX(REAL(NTH),1.) DO T=1,NTH - INSPC(K,T)=BT(K)*INSPC(K,T)/TPI/(WN2(K)**3.0)/AVG + if (avg /= 0.0) then + INSPC(K,T)=BT(K)*INSPC(K,T)/TPI/(WN2(K)**3.0)/AVG + else + inspc(k,t) = 0.0 + end if ENDDO ENDDO !----------------------------------------------------------- @@ -1134,7 +1142,11 @@ SUBROUTINE APPENDTAIL(INSPC, WN2, NKT, KA1, KA2, KA3, WNDDIR,SAT) ENDDO AVG=SUM(NORMSPC)/MAX(REAL(NTH),1.) DO T=1, NTH - INSPC(K,T) = SAT * NORMSPC(T)/TPI/(WN2(K)**3.0)/AVG + if (avg /= 0.0) then + INSPC(K,T) = SAT * NORMSPC(T)/TPI/(WN2(K)**3.0)/AVG + else + inspc(k,t) = 0.0 + end if ENDDO ENDDO DO T=1, NTH @@ -1148,7 +1160,11 @@ SUBROUTINE APPENDTAIL(INSPC, WN2, NKT, KA1, KA2, KA3, WNDDIR,SAT) AVG=SUM(NORMSPC)/MAX(REAL(NTH),1.)!1./4. DO K=KA3+1, NKT DO T=1, NTH - INSPC(K,T)=NORMSPC(T)*(SAT)/TPI/(WN2(K)**3.0)/AVG + if (avg /= 0.0) then + INSPC(K,T)=NORMSPC(T)*(SAT)/TPI/(WN2(K)**3.0)/AVG + else + inspc(k,t) = 0.0 + end if ENDDO ENDDO DEALLOCATE(ANGLE1) diff --git a/model/src/w3gdatmd.F90 b/model/src/w3gdatmd.F90 index 6cd6e91d8..bde5bf999 100644 --- a/model/src/w3gdatmd.F90 +++ b/model/src/w3gdatmd.F90 @@ -199,10 +199,14 @@ MODULE W3GDATMD ! Default is 1.0, meaning that 100% ice ! concentration result in zero source term ! If set to 0.0, then ice has no direct impact on Sln / Sin / Snl / Sds - ! IC3PARS R.A. Public various parameters for use in IC4, handled as + ! IC3PARS R.A. Public various parameters for use in IC3, handled as ! an array for simplicity - ! IC4_KI R.A. Public KI (dissipation rate) values for use in IC4 - ! IC4_FC R.A. Public FC (frequency bin separators) for use in IC4 + ! IC4_KI R.A. Public KI (dissipation rate) values for use in IC4M6 + ! IC4_FC R.A. Public FC (frequency bin separators) for use in IC4M6 + ! IC4_CN R.A. Public Coefficients for use in IC4M2 + ! IC4_FMIN Real Public Minimum frequency below which ki is set to + ! some background level dissipation (for S_ice) + ! IC4_KIBK Real Public Low, background level dissipation (for S_ice) ! PFMOVE Real Public Tunable parameter in GSE correction ! for moving grids. ! GRIDSHIFT Real Public Grid offset for multi-grid w/SCRIP @@ -429,6 +433,17 @@ MODULE W3GDATMD ! KDCON Real Public Conversion factor for relative depth. ! KDMN Real Public Minimum relative depth. ! SNLSn Real Public Constants in shallow water factor. + ! IQTPE Int. Public Type of depth treatment + ! -2 : Deep water GQM with scaling + ! 1 : Deep water DIA + ! 2 : Deep water DIA with scaling + ! 3 : Finite water depth DIA + ! GQNF1 Int. Public Gaussian quadrature resolution + ! GQNT1 Int. Public Gaussian quadrature resolution + ! GQNNQ_OM2 Int. Public Gaussian quadrature resolution + ! GQTHRSAT Real Public Threshold on saturation for SNL calculation + ! GQTHRCOU Real Public Threshold for filter on coupling coefficient + ! GQAMP R.A. Public Amplification factors ! (!/NL2) ! IQTPE Int. Public Type of depth treatment ! 1 : Deep water @@ -604,7 +619,7 @@ MODULE W3GDATMD IPARS = -1, NAUXGR ! #ifdef W3_IC4 - INTEGER, PARAMETER :: NIC4=10 + INTEGER, PARAMETER :: NIC4=16 , NIC42=5 #endif INTEGER, PARAMETER :: RLGTYPE = 1 INTEGER, PARAMETER :: CLGTYPE = 2 @@ -721,6 +736,8 @@ MODULE W3GDATMD INTEGER, POINTER :: IC4PARS(:) REAL, POINTER :: IC4_KI(:) REAL, POINTER :: IC4_FC(:) + REAL, POINTER :: IC4_CN(:) + REAL :: IC4_FMIN, IC4_KIBK #endif #ifdef W3_IC5 REAL, POINTER :: IC5PARS(:) @@ -886,7 +903,7 @@ MODULE W3GDATMD REAL, POINTER :: DCKI(:,:), SATWEIGHTS(:,:),CUMULW(:,:),QBI(:,:) REAL :: AALPHA, BBETA, ZZ0MAX, ZZ0RAT, ZZALP,& SSINTHP, TTAUWSHELTER, SSWELLF(1:7), & - SSDSC(1:21), SSDSBR, & + SSDSC(1:21), SSDSBR, SINTAILPAR(1:5),& SSDSP, WWNMEANP, SSTXFTF, SSTXFTWN, & FFXPM, FFXFM, FFXFA, & SSDSBRF1, SSDSBRF2, SSDSBINT,SSDSBCK,& @@ -910,6 +927,8 @@ MODULE W3GDATMD #ifdef W3_NL1 REAL :: SNLC1, LAM, KDCON, KDMN, & SNLS1, SNLS2, SNLS3 + INTEGER :: IQTPE, GQNF1, GQNT1, GQNQ_OM2 + REAL :: NLTAIL, GQTHRSAT, GQTHRCOU, GQAMP(4) #endif #ifdef W3_NL2 INTEGER :: IQTPE, NDPTHS @@ -1131,6 +1150,8 @@ MODULE W3GDATMD INTEGER, POINTER :: IC4PARS(:) REAL, POINTER :: IC4_KI(:) REAL, POINTER :: IC4_FC(:) + REAL, POINTER :: IC4_CN(:) + REAL, POINTER :: IC4_FMIN, IC4_KIBK #endif #ifdef W3_IC5 REAL, POINTER :: IC5PARS(:) @@ -1304,7 +1325,7 @@ MODULE W3GDATMD FFXFM, FFXPM, SSDSBRF1, SSDSBRF2, & SSDSBINT, SSDSBCK, SSDSHCK, SSDSABK, & SSDSPBK, SSINBR,SSINTHP,TTAUWSHELTER,& - SSWELLF(:), SSDSC(:), SSDSBR, & + SINTAILPAR(:), SSWELLF(:), SSDSC(:), SSDSBR, & SSDSP, WWNMEANP, SSTXFTF, SSTXFTWN, & SSDSBT, SSDSCOS, SSDSDTH, SSDSBM(:) #endif @@ -1319,6 +1340,8 @@ MODULE W3GDATMD !/ Data aliasses for structure SNLP(S) !/ #ifdef W3_NL1 + INTEGER, POINTER :: IQTPE, GQNF1, GQNT1, GQNQ_OM2 + REAL, POINTER :: NLTAIL, GQTHRSAT, GQTHRCOU, GQAMP(:) REAL, POINTER :: SNLC1, LAM, KDCON, KDMN, & SNLS1, SNLS2, SNLS3 #endif @@ -1825,6 +1848,8 @@ SUBROUTINE W3DIMX ( IMOD, MX, MY, MSEA, NDSE, NDST & CHECK_ALLOC_STATUS ( ISTAT ) ALLOCATE ( GRIDS(IMOD)%IC4_FC(NIC4), STAT=ISTAT ) CHECK_ALLOC_STATUS ( ISTAT ) + ALLOCATE ( GRIDS(IMOD)%IC4_CN(NIC42), STAT=ISTAT ) + CHECK_ALLOC_STATUS ( ISTAT ) #endif #ifdef W3_IC5 ALLOCATE ( GRIDS(IMOD)%IC5PARS(9), STAT=ISTAT ) @@ -2059,12 +2084,18 @@ SUBROUTINE W3DIMS ( IMOD, MK, MTH, NDSE, NDST ) MPARS(IMOD)%SRCPS%QBI(NKHS,NKD), & STAT=ISTAT ) CHECK_ALLOC_STATUS ( ISTAT ) + MPARS(IMOD)%SRCPS%IKTAB(:,:)=0. + MPARS(IMOD)%SRCPS%DCKI(:,:)=0. + MPARS(IMOD)%SRCPS%QBI(:,:)=0. SDSNTH = MTH/2-1 !MIN(NINT(SSDSDTH/(DTH*RADE)),MTH/2-1) ALLOCATE( MPARS(IMOD)%SRCPS%SATINDICES(2*SDSNTH+1,MTH), & MPARS(IMOD)%SRCPS%SATWEIGHTS(2*SDSNTH+1,MTH), & MPARS(IMOD)%SRCPS%CUMULW(MSPEC,MSPEC), & STAT=ISTAT ) CHECK_ALLOC_STATUS ( ISTAT ) + MPARS(IMOD)%SRCPS%SATINDICES(:,:)=0. + MPARS(IMOD)%SRCPS%SATWEIGHTS(:,:)=0. + MPARS(IMOD)%SRCPS%CUMULW(:,:)=0. #endif ! SGRDS(IMOD)%SINIT = .TRUE. @@ -2293,6 +2324,9 @@ SUBROUTINE W3SETG ( IMOD, NDSE, NDST ) IC4PARS => GRIDS(IMOD)%IC4PARS IC4_KI => GRIDS(IMOD)%IC4_KI IC4_FC => GRIDS(IMOD)%IC4_FC + IC4_CN => GRIDS(IMOD)%IC4_CN + IC4_FMIN => GRIDS(IMOD)%IC4_FMIN + IC4_KIBK => GRIDS(IMOD)%IC4_KIBK #endif #ifdef W3_IC5 IC5PARS => GRIDS(IMOD)%IC5PARS @@ -2633,6 +2667,7 @@ SUBROUTINE W3SETG ( IMOD, NDSE, NDST ) ZZ0RAT => MPARS(IMOD)%SRCPS%ZZ0RAT ZZALP => MPARS(IMOD)%SRCPS%ZZALP TTAUWSHELTER => MPARS(IMOD)%SRCPS%TTAUWSHELTER + SINTAILPAR => MPARS(IMOD)%SRCPS%SINTAILPAR SSWELLFPAR => MPARS(IMOD)%SRCPS%SSWELLFPAR SSWELLF => MPARS(IMOD)%SRCPS%SSWELLF SSDSC => MPARS(IMOD)%SRCPS%SSDSC @@ -2690,6 +2725,14 @@ SUBROUTINE W3SETG ( IMOD, NDSE, NDST ) SNLS1 => MPARS(IMOD)%SNLPS%SNLS1 SNLS2 => MPARS(IMOD)%SNLPS%SNLS2 SNLS3 => MPARS(IMOD)%SNLPS%SNLS3 + IQTPE => MPARS(IMOD)%SNLPS%IQTPE + GQNF1 => MPARS(IMOD)%SNLPS%GQNF1 + GQNT1 => MPARS(IMOD)%SNLPS%GQNT1 + GQNQ_OM2 => MPARS(IMOD)%SNLPS%GQNQ_OM2 + NLTAIL => MPARS(IMOD)%SNLPS%NLTAIL + GQTHRSAT => MPARS(IMOD)%SNLPS%GQTHRSAT + GQTHRCOU=> MPARS(IMOD)%SNLPS%GQTHRCOU + GQAMP=> MPARS(IMOD)%SNLPS%GQAMP #endif #ifdef W3_NL2 IQTPE => MPARS(IMOD)%SNLPS%IQTPE diff --git a/model/src/w3gridmd.F90 b/model/src/w3gridmd.F90 index 281ed7a3f..e81c4ea91 100644 --- a/model/src/w3gridmd.F90 +++ b/model/src/w3gridmd.F90 @@ -113,6 +113,8 @@ MODULE W3GRIDMD !/ 27-May-2021 : Moved to a subroutine ( version 7.13 ) !/ 07-Jun-2021 : S_{nl} GKE NL5 (Q. Liu) ( version 7.13 ) !/ 19-Jul-2021 : Momentum and air density support ( version 7.14 ) + !/ 28-Feb-2023 : GQM as an alternative for NL1 ( version 7.15 ) + !/ 11-Jan-2024 : New namelist parameters for IC4 ( version 7.15 ) !/ !/ Copyright 2009-2013 National Weather Service (NWS), !/ National Oceanic and Atmospheric Administration. All rights @@ -439,7 +441,7 @@ MODULE W3GRIDMD ! (2006) input and Babanin et al. (2001,2010) dissipation. ! ! !/NL0 No nonlinear interactions. - ! !/NL1 Discrete interaction approximation (DIA). + ! !/NL1 Discrete interaction approximation (DIA or GQM). ! !/NL2 Exact interactions (WRT). ! !/NL3 Generalized Multiple DIA (GMD). ! !/NL4 Two Scale Approximation @@ -586,6 +588,9 @@ MODULE W3GRIDMD IY2, J, JJ, IXR(4), IYR(4), ISEAI(4),& IST, NKI, NTHI, NRIC, NRIS, I, IDFT, & NSTAT, NBT, NLAND, NOSW, NMAPB, IMAPB +#ifdef W3_ASCII + INTEGER :: NDSMA +#endif #ifdef W3_NL2 INTEGER :: IDEPTH #endif @@ -673,6 +678,7 @@ MODULE W3GRIDMD #endif ! #ifdef W3_SMC + REAL :: DVSMC REAL :: TRNMX, TRNMY INTEGER, ALLOCATABLE :: NLvCelsk(:), NLvUFcsk(:), NLvVFcsk(:) INTEGER, ALLOCATABLE :: IJKCelin(:,:),IJKUFcin(:,:),IJKVFcin(:,:) @@ -760,9 +766,10 @@ MODULE W3GRIDMD #ifdef W3_IC4 INTEGER :: IC4METHOD - REAL :: IC4KI(NIC4), IC4FC(NIC4) + REAL :: IC4KI(NIC4), IC4FC(NIC4), & + IC4CN(NIC42), IC4FMIN, IC4KIBK #endif - ! + #ifdef W3_IC5 REAL :: IC5MINIG, IC5MINWT, & IC5MAXKRATIO, IC5MAXKI, IC5MINHW, & @@ -835,7 +842,8 @@ MODULE W3GRIDMD #endif ! #ifdef W3_ST4 - INTEGER :: SWELLFPAR, SDSISO, SDSBRFDF + INTEGER :: SWELLFPAR, SDSISO, SDSBRFDF, SINTABLE,& + TAUWBUG REAL :: SDSBCHOICE REAL :: ZWND, ALPHA0, Z0MAX, BETAMAX, SINTHP,& ZALP, Z0RAT, TAUWSHELTER, SWELLF, & @@ -851,7 +859,8 @@ MODULE W3GRIDMD SDSBRF1, & SDSBM0, SDSBM1, SDSBM2, SDSBM3, & SDSBM4, SDSFACMTF, SDSCUMP, SDSNUW, & - SDSL, SDSMWD, SDSMWPOW, SPMSS, SDSNMTF + SDSL, SDSMWD, SDSMWPOW, SPMSS, SDSNMTF, SINTAIL1, SINTAIL2, & + CUMSIGP, VISCSTRESS #endif ! #ifdef W3_ST6 @@ -864,6 +873,8 @@ MODULE W3GRIDMD #ifdef W3_NL1 REAL :: LAMBDA, KDCONV, KDMIN, & SNLCS1, SNLCS2, SNLCS3 + INTEGER :: IQTYPE, GQMNF1, GQMNT1, GQMNQ_OM2 + REAL :: TAILNL, GQMTHRSAT, GQMTHRCOU, GQAMP1, GQAMP2, GQAMP3, GQAMP4 #endif #ifdef W3_NL2 INTEGER :: IQTYPE, NDEPTH @@ -962,7 +973,8 @@ MODULE W3GRIDMD IC3VISC, IC3ELAS, IC3DENS, IC3HICE #endif #ifdef W3_IC4 - NAMELIST /SIC4/ IC4METHOD, IC4KI, IC4FC + NAMELIST /SIC4/ IC4METHOD, IC4KI, IC4FC, IC4CN, IC4FMIN, & + IC4KIBK #endif #ifdef W3_IC5 NAMELIST /SIC5/ IC5MINIG, IC5MINWT, IC5MAXKRATIO, & @@ -991,11 +1003,13 @@ MODULE W3GRIDMD NAMELIST /SIN4/ ZWND, ALPHA0, Z0MAX, BETAMAX, SINTHP, ZALP, & TAUWSHELTER, SWELLFPAR, SWELLF, & SWELLF2, SWELLF3, SWELLF4, SWELLF5, SWELLF6, & - SWELLF7, Z0RAT, SINBR + SWELLF7, Z0RAT, SINBR, SINTABLE, SINTAIL1, SINTAIL2, TAUWBUG, VISCSTRESS #endif #ifdef W3_NL1 NAMELIST /SNL1/ LAMBDA, NLPROP, KDCONV, KDMIN, & - SNLCS1, SNLCS2, SNLCS3 + SNLCS1, SNLCS2, SNLCS3, & + IQTYPE, TAILNL, GQMNF1, GQMNT1, & + GQMNQ_OM2, GQMTHRSAT, GQMTHRCOU, GQAMP1, GQAMP2, GQAMP3, GQAMP4 #endif #ifdef W3_NL2 NAMELIST /SNL2/ IQTYPE, TAILNL, NDEPTH @@ -1031,7 +1045,7 @@ MODULE W3GRIDMD SDSC5, SDSC6, SDSBR, SDSBT, SDSP, SDSISO, & SDSBCK, SDSABK, SDSPBK, SDSBINT, SDSHCK, & SDSDTH, SDSCOS, SDSBRF1, SDSBRFDF, SDSNUW, & - SDSBM0, SDSBM1, SDSBM2, SDSBM3, SDSBM4, & + SDSBM0, SDSBM1, SDSBM2, SDSBM3, SDSBM4, CUMSIGP,& WHITECAPWIDTH, WHITECAPDUR, SDSMWD, SDSMWPOW, SDKOF #endif @@ -1710,6 +1724,12 @@ SUBROUTINE W3GRID() TAUWSHELTER = 0.3 ZALP = 0.006 SINBR = 0. + SINTABLE = 1 + SINTAIL1 = 0. ! TAUWSHELTER FOR TAIL (no table) + SINTAIL2 = 0. ! additional peak in capillary range + TAUWBUG = 1 ! TAUWBUG is 1 is the bug is kept: + ! initializes TAUWX/Y to zero in W3SRCE + VISCSTRESS =0 #endif ! #ifdef W3_ST6 @@ -1793,6 +1813,11 @@ SUBROUTINE W3GRID() SSWELLF(6) = SWELLF6 SSWELLF(7) = SWELLF7 SSWELLFPAR = SWELLFPAR + SINTAILPAR(1) = FLOAT(SINTABLE) + SINTAILPAR(2) = SINTAIL1 + SINTAILPAR(3) = SINTAIL2 + SINTAILPAR(4) = FLOAT(TAUWBUG) + SINTAILPAR(5) = VISCSTRESS #endif ! #ifdef W3_ST6 @@ -1828,6 +1853,18 @@ SUBROUTINE W3GRID() SNLCS1 = 5.5 SNLCS2 = 0.833 SNLCS3 = -1.25 + ! Additional parameters for GQM + IQTYPE = 1 + TAILNL = -FACHF + GQMNF1 = 14 + GQMNT1 = 8 + GQMNQ_OM2=8 + GQMTHRSAT=0. + GQMTHRCOU=0.015 + GQAMP1=1. + GQAMP2=0.002 + GQAMP3=1. + GQAMP4=1. CALL READNL ( NDSS, 'SNL1', STATUS ) WRITE (NDSO,922) STATUS WRITE (NDSO,923) LAMBDA, NLPROP, KDCONV, KDMIN, & @@ -1839,6 +1876,18 @@ SUBROUTINE W3GRID() SNLS1 = SNLCS1 SNLS2 = SNLCS2 SNLS3 = SNLCS3 + ! Additional parameters for GQM + IQTPE = IQTYPE + GQNF1 = GQMNF1 + GQNT1 = GQMNT1 + GQNQ_OM2 = GQMNQ_OM2 + GQTHRSAT = GQMTHRSAT + GQTHRCOU = GQMTHRCOU + GQAMP(1) = GQAMP1 + GQAMP(2) = GQAMP2 + GQAMP(3) = GQAMP3 + GQAMP(4) = GQAMP4 + NLTAIL = TAILNL #endif ! #ifdef W3_ST0 @@ -2074,8 +2123,8 @@ SUBROUTINE W3GRID() SDSDTH = 80. SDSCOS = 2. SDSISO = 2 - SDSBM0 = 1. - SDSBM1 = 0. + SDSBM0 = 1. ! All these parameters are related to finite depth + SDSBM1 = 0. ! scaling of breaking SDSBM2 = 0. SDSBM3 = 0. SDSBM4 = 0. @@ -2085,8 +2134,9 @@ SUBROUTINE W3GRID() SDSBINT = 0.3 SDSHCK = 1.5 WHITECAPWIDTH = 0.3 - SDSSTRAIN = 0. SDSFACMTF = 400 ! MTF factor for Lambda , Romero (2019) + CUMSIGP = 0. + SDSSTRAIN = 0. SDSSTRAINA = 15. SDSSTRAIN2 = 0. WHITECAPDUR = 0.56 ! breaking duration factor @@ -2097,7 +2147,7 @@ SUBROUTINE W3GRID() ! MTF SPMSS = 0.5 ! cmss^SPMSS SDSNMTF = 1.5 ! MTF power - SDSCUMP = 2. + SDSCUMP = 2. ! 2 for cumulative mss, 1 for cumulative orb. vel. ! MW SDSMWD = .9 ! new AFo SDSMWPOW = 1. ! (k )^pow @@ -2179,9 +2229,9 @@ SUBROUTINE W3GRID() SSDSC(7) = WHITECAPWIDTH SSDSC(8) = SDSSTRAIN ! Straining constant ... SSDSC(9) = SDSL - SSDSC(10) = SDSSTRAINA*NTH/360. ! angle Aor enhanced straining + SSDSC(10) = SDSSTRAINA*NTH/360. ! angle for enhanced straining SSDSC(11) = SDSSTRAIN2 ! straining constant for directional part - SSDSC(12) = SDSBT + SSDSC(12) = CUMSIGP SSDSC(13) = SDSMWD SSDSC(14) = SPMSS SSDSC(15) = SDSMWPOW @@ -2845,6 +2895,9 @@ SUBROUTINE W3GRID() IC4METHOD = 1 !switch for methods within IC4 IC4KI=0.0 IC4FC=0.0 + IC4CN=0.0 + IC4FMIN=0.0 + IC4KIBK=0.0 #endif ! #ifdef W3_IC5 @@ -2930,6 +2983,7 @@ SUBROUTINE W3GRID() CALL EXTCDE( 31) ENDIF + USSP_WN = 0.0 ! initialize to 0s DO J=1,USSPF(2) USSP_WN(j) = STK_WN(J) ENDDO @@ -3165,14 +3219,17 @@ SUBROUTINE W3GRID() #ifdef W3_ST4 WRITE (NDSO,2920) ZWND, ALPHA0, Z0MAX, BETAMAX, SINTHP, ZALP, & TAUWSHELTER, SWELLFPAR, SWELLF, SWELLF2, SWELLF3, SWELLF4, & - SWELLF5, SWELLF6, SWELLF7, Z0RAT, SINBR + SWELLF5, SWELLF6, SWELLF7, Z0RAT, SINBR, SINTABLE, TAUWBUG, VISCSTRESS, SINTAIL1, SINTAIL2 #endif #ifdef W3_ST6 WRITE (NDSO,2920) SINA0, SINWS, SINFC #endif #ifdef W3_NL1 WRITE (NDSO,2922) LAMBDA, NLPROP, KDCONV, KDMIN, & - SNLCS1, SNLCS2, SNLCS3 + SNLCS1, SNLCS2, SNLCS3, & + IQTYPE, TAILNL, GQMNF1, & + GQMNT1, GQMNQ_OM2, GQMTHRSAT, GQMTHRCOU,& + GQAMP1, GQAMP2, GQAMP3, GQAMP4 #endif #ifdef W3_NL2 WRITE (NDSO,2922) IQTYPE, TAILNL, NDEPTH @@ -3227,7 +3284,7 @@ SUBROUTINE W3GRID() SDSBT, SDSP, SDSISO, SDSCOS, SDSDTH, SDSBRF1, & SDSBRFDF, SDSBM0, SDSBM1, SDSBM2, SDSBM3, SDSBM4, & SPMSS, SDKOF, SDSMWD, SDSFACMTF, SDSNMTF,SDSMWPOW,& - SDSCUMP, SDSNUW, WHITECAPWIDTH, WHITECAPDUR + SDSCUMP, CUMSIGP, SDSNUW, WHITECAPWIDTH, WHITECAPDUR #endif #ifdef W3_ST6 WRITE (NDSO,2924) SDSET, SDSA1, SDSA2, SDSP1, SDSP2 @@ -3270,7 +3327,7 @@ SUBROUTINE W3GRID() JGS_TERMINATE_DIFFERENCE, & JGS_TERMINATE_NORM, & JGS_LIMITER, & - JGS_LIMITER_FUNC, & + JGS_LIMITER_FUNC, & JGS_USE_JACOBI, & JGS_BLOCK_GAUSS_SEIDEL, & JGS_MAXITER, & @@ -3607,7 +3664,7 @@ SUBROUTINE W3GRID() END SELECT IF (FSTOTALIMP .or. FSTOTALEXP) THEN - LPDLIB = .TRUE. + LPDLIB = .TRUE. ENDIF ! IF (SUM(UNSTSCHEMES).GT.1) WRITE(NDSO,1035) @@ -3888,6 +3945,12 @@ SUBROUTINE W3GRID() IF (IDFM.EQ.2) WRITE (NDSO,973) TRIM(RFORM) IF (FROM.EQ.'NAME' .AND. NDSG.NE.NDSI) & WRITE (NDSO,974) TRIM(FNAME) + +#ifdef W3_SMC + !Li Save the depth conversion factor for SMC grid use. JGLi03Nov2023 + DVSMC = VSC +#endif + ! ! 7.e Read bottom depths ! @@ -5009,14 +5072,17 @@ SUBROUTINE W3GRID() CALL EXTCDE(65) END IF - !Li Minimum DMIN depth is used as well for SMC. - ZB(ISEA)= - MAX( DMIN, FLOAT( IJKDep(ISEA) ) ) - MAPFS(IY:IY+JS-1,IX:IX+IK-1) = ISEA - MAPSTA(IY:IY+JS-1,IX:IX+IK-1) = 1 - MAPST2(IY:IY+JS-1,IX:IX+IK-1) = 0 - MAPSF(ISEA,1) = IX - MAPSF(ISEA,2) = IY - MAPSF(ISEA,3) = IY + (IX -1)*NY + !Li Allow land cell to be defined by ZLIM value and only reset + !Li MAPST* land values for sea points. JGLi03Nov2023 + ZB(ISEA) = DVSMC * FLOAT(IJKDep(ISEA)) + IF( ZB(ISEA) .LT. ZLIM ) THEN + MAPSTA(IY:IY+JS-1,IX:IX+IK-1) = 1 + MAPST2(IY:IY+JS-1,IX:IX+IK-1) = 0 + ENDIF + MAPFS(IY:IY+JS-1,IX:IX+IK-1) = ISEA + MAPSF(ISEA,1) = IX + MAPSF(ISEA,2) = IY + MAPSF(ISEA,3) = IY + (IX-1) * NY !Li New variable CLATS to hold cosine latitude at cell centre. !Li Also added CLATIS and CTHG0S for version 4.08. @@ -5263,6 +5329,9 @@ SUBROUTINE W3GRID() IC4PARS(1)=IC4METHOD IC4_KI=IC4KI IC4_FC=IC4FC + IC4_CN=IC4CN + IC4_FMIN=IC4FMIN + IC4_KIBK=IC4KIBK #endif ! #ifdef W3_IC5 @@ -5907,9 +5976,16 @@ SUBROUTINE W3GRID() !10. Write model definition file. ! WRITE (NDSO,999) - CALL W3IOGR ( 'WRITE', NDSM ) + CALL W3IOGR ( 'WRITE', NDSM & +#ifdef W3_ASCII + ,NDSA=NDSMA & +#endif + ) ! CLOSE (NDSM) +#ifdef W3_ASCII + CLOSE (NDSMA) +#endif ! GOTO 2222 ! @@ -6192,7 +6268,9 @@ SUBROUTINE W3GRID() ' SWELLF =',F8.5,', SWELLF2 =',F8.5, & ', SWELLF3 =',F8.5,', SWELLF4 =',F9.1,','/ & ' SWELLF5 =',F8.5,', SWELLF6 =',F8.5, & - ', SWELLF7 =',F12.2,', Z0RAT =',F8.5,', SINBR =',F8.5,' /') + ', SWELLF7 =',F12.2,', Z0RAT =',F8.5,', SINBR =',F8.5,','/ & + ' SINTABLE =',I2,', TAUWBUG =',I2, & + ', VISCSTRESS =',F8.5,', SINTAIL1 =',F8.5,', SINTAIL2 =',F8.5,' /') #endif ! #ifdef W3_ST6 @@ -6220,7 +6298,11 @@ SUBROUTINE W3GRID() 2922 FORMAT ( ' &SNL1 LAMBDA =',F7.3,', NLPROP =',E10.3, & ', KDCONV =',F7.3,', KDMIN =',F7.3,','/ & ' SNLCS1 =',F7.3,', SNLCS2 =',F7.3, & - ', SNLCS3 = ',F7.3,' /') + ', SNLCS3 = ',F7.3','/ & + ' IQTYPE =',I2,', TAILNL =',F5.1,','/ & + ' GQMNF1 =',I2,', GQMNT1 =',I2,',', & + ' GQMNQ_OM2 =',I2,', GQMTHRSAT =',E11.4,', GQMTHRCOU =',F4.3,','/ & + ' GQAMP1 =',F5.3,', GQAMP2 =',F5.3,', GQAMP3 =',F5.3,', GQAMP4 =',F5.3,' /') #endif ! #ifdef W3_NL2 @@ -6361,7 +6443,7 @@ SUBROUTINE W3GRID() ' SPMSS = ',F5.2, ', SDKOF =',F5.2, & ', SDSMWD =',F5.2,', SDSFACMTF =',F5.1,', '/ & ' SDSMWPOW =',F3.1,', SDSNMTF =', F5.2, & - ', SDSCUMP =', F3.1,', SDSNUW =', E8.3,', '/, & + ', SDSCUMP =', F3.1,', CUMSIGP =', F3.1,', SDSNUW =', E10.3,', '/, & ' WHITECAPWIDTH =',F5.2, ' WHITECAPDUR =',F5.2,' /') #endif ! @@ -6473,12 +6555,12 @@ SUBROUTINE W3GRID() 947 FORMAT (/' Ice scattering ',A,/ & ' --------------------------------------------------') 948 FORMAT (' IS2 Scattering ... '/& - ' scattering coefficient : ',E9.3/ & - ' 0: no back-scattering : ',E9.3/ & + ' scattering coefficient : ',E10.3/ & + ' 0: no back-scattering : ',E10.3/ & ' TRUE: istropic back-scattering : ',L3/ & ' TRUE: update of ICEDMAX : ',L3/ & ' TRUE: keeps updated ICEDMAX : ',L3/ & - ' flexural strength : ',E9.3/ & + ' flexural strength : ',E10.3/ & ' TRUE: uses Robinson-Palmer disp.: ',L3/ & ' attenuation : ',F5.2/ & ' fragility : ',F5.2/ & @@ -6486,7 +6568,7 @@ SUBROUTINE W3GRID() ' pack scattering coef 1 : ',F5.2/ & ' pack scattering coef 2 : ',F5.2/ & ' scaling by concentration : ',F5.2/ & - ' creep B coefficient : ',E9.3/ & + ' creep B coefficient : ',E10.3/ & ' creep C coefficient : ',F5.2/ & ' creep D coefficient : ',F5.2/ & ' creep N power : ',F5.2/ & @@ -6497,7 +6579,7 @@ SUBROUTINE W3GRID() ' energy of activation : ',F5.2/ & ' anelastic coefficient : ',E11.3/ & ' anelastic exponent : ',F5.2) -2948 FORMAT ( ' &SIS2 ISC1 =',E9.3,', IS2BACKSCAT =',E9.3, & +2948 FORMAT ( ' &SIS2 ISC1 =',E10.3,', IS2BACKSCAT =',E10.3, & ', IS2ISOSCAT =',L3,', IS2BREAK =',L3, & ', IS2DUPDATE =',L3,','/ & ' IS2FLEXSTR =',E11.3,', IS2DISP =',L3, & diff --git a/model/src/w3initmd.F90 b/model/src/w3initmd.F90 index f74d39aa5..d684fbfd9 100644 --- a/model/src/w3initmd.F90 +++ b/model/src/w3initmd.F90 @@ -239,6 +239,9 @@ SUBROUTINE W3INIT ( IMOD, IsMulti, FEXT, MDS, MTRACE, ODAT, FLGRD, FLGR2, FLGD, ! (first). ! 11: Track information file unit number. ! 12: Track output file unit number. + ! 13: Wave separation output file unit number. + ! 14: Grid output file unit number. + ! 15: Point output file unit number. ascii ! MTRACE I.A. I Array with subroutine tracing information. ! 1: Output unit number for trace. ! 2: Maximum number of trace prints. @@ -453,7 +456,7 @@ SUBROUTINE W3INIT ( IMOD, IsMulti, FEXT, MDS, MTRACE, ODAT, FLGRD, FLGR2, FLGD, !/ ------------------------------------------------------------------- / !/ Parameter list !/ - INTEGER, INTENT(IN) :: IMOD, MDS(13), MTRACE(2), & + INTEGER, INTENT(IN) :: IMOD, MDS(15), MTRACE(2), & ODAT(40),NPT, IPRT(6),& MPI_COMM LOGICAL, INTENT(IN) :: IsMulti @@ -639,23 +642,23 @@ SUBROUTINE W3INIT ( IMOD, IsMulti, FEXT, MDS, MTRACE, ODAT, FLGRD, FLGR2, FLGD, IF (FSTOTALIMP .and. .NOT. LPDLIB) THEN WRITE(NDSE,*) 'IMPTOTAL is selected' WRITE(NDSE,*) 'But PDLIB is not' - CALL FLUSH(NDSE) - STOP + CALL FLUSH(NDSE) + STOP ELSE IF (FSTOTALEXP .and. .NOT. LPDLIB) THEN WRITE(NDSE,*) 'EXPTOTAL is selected' WRITE(NDSE,*) 'But PDLIB is not' - CALL FLUSH(NDSE) - STOP + CALL FLUSH(NDSE) + STOP END IF #ifdef W3_PDLIB IF (B_JGS_BLOCK_GAUSS_SEIDEL .AND. .NOT. B_JGS_USE_JACOBI) THEN WRITE(NDSE,*) 'B_JGS_BLOCK_GAUSS_SEIDEL is used but the Jacobi solver is not choosen' WRITE(NDSE,*) 'Please set JGS_USE_JACOBI .eqv. .true.' - CALL FLUSH(NDSE) - STOP + CALL FLUSH(NDSE) + STOP ENDIF #endif - + ! ! 1.c Open files without unpacking MDS ,,, ! @@ -1303,10 +1306,10 @@ SUBROUTINE W3INIT ( IMOD, IsMulti, FEXT, MDS, MTRACE, ODAT, FLGRD, FLGR2, FLGD, END DO !Li END DO #ifdef W3_DEBUGSTP - WRITE(740+IAPROC,*) 'w3initmd 1: max/min(WLVeff)=', max_val, min_val - FLUSH(740+IAPROC) - max_val = 0 - min_val = 0 + WRITE(740+IAPROC,*) 'w3initmd 1: max/min(WLVeff)=', max_val, min_val + FLUSH(740+IAPROC) + max_val = 0 + min_val = 0 #endif DO JSEA=1, NSEAL CALL INIT_GET_ISEA(ISEA, JSEA) @@ -2148,7 +2151,7 @@ SUBROUTINE W3MPIO ( IMOD ) STMAXE, STMAXD, HMAXE, HCMAXE, HMAXD, & HCMAXD, QP, PTHP0, PQP, PPE, PGW, PSW, & PTM1, PT1, PT2, PEP, WBT, CX, CY, & - TAUOCX, TAUOCY, WNMEAN, & + TAUOCX, TAUOCY, WNMEAN, QKK, & PHS2, PTP2, PDIR2, PSI2, PNR2, PTHP02, & PT12 #endif @@ -3495,6 +3498,20 @@ SUBROUTINE W3MPIO ( IMOD ) #ifdef W3_MPI END IF ! + IF ( FLGRDALL( 8, 6) ) THEN + IH = IH + 1 + IT = IT + 1 + CALL MPI_SEND_INIT (QKK (1),NSEALM , MPI_REAL, IROOT, & + IT, MPI_COMM_WAVE, IRQGO(IH), IERR) +#endif +#ifdef W3_MPIT + WRITE (NDST,9011) IH, ' 8/06', IROOT, IT, IRQGO(IH), IERR +#endif +#ifdef W3_MPI + END IF +#endif + ! +#ifdef W3_MPI IF ( FLGRDALL( 9, 1) ) THEN IH = IH + 1 IT = IT + 1 @@ -4826,6 +4843,20 @@ SUBROUTINE W3MPIO ( IMOD ) #ifdef W3_MPI END IF ! + IF ( FLGRDALL( 8, 6) ) THEN + IH = IH + 1 + IT = IT + 1 + CALL MPI_RECV_INIT (QKK (I0),1,WW3_FIELD_VEC, IFROM, IT, & + MPI_COMM_WAVE, IRQGO2(IH), IERR ) +#endif +#ifdef W3_MPIT + WRITE (NDST,9011) IH, ' 8/06', IFROM, IT, IRQGO2(IH), IERR +#endif +#ifdef W3_MPI + END IF +#endif + ! +#ifdef W3_MPI IF ( FLGRDALL( 9, 1) ) THEN IH = IH + 1 IT = IT + 1 diff --git a/model/src/w3iogomd.F90 b/model/src/w3iogomd.F90 index 393d54d4a..4786ca753 100644 --- a/model/src/w3iogomd.F90 +++ b/model/src/w3iogomd.F90 @@ -1145,6 +1145,9 @@ SUBROUTINE W3FLDTOIJ(FLD, I, J, IAPROC, NAPOUT, NDSEN) CASE('QP') I = 8 J = 5 + CASE('QKK') + I = 8 + J = 6 ! ! Group 9 ! @@ -1316,8 +1319,8 @@ SUBROUTINE W3OUTG ( A, FLPART, FLOUTG, FLOUTG2 ) TH2M, STH2M, HSIG, STMAXE, STMAXD, & HCMAXE, HMAXE, HCMAXD, HMAXD, USSP, QP, PQP,& PTHP0, PPE, PGW, PSW, PTM1, PT1, PT2, PEP, & - WBT, PHS2, PTP2, PDIR2, PSI2, PTHP02, PT12, & - PNR2 + WBT, QKK, & + PHS2, PTP2, PDIR2, PSI2, PTHP02, PT12, PNR2 USE W3ODATMD, ONLY: NDST, UNDEF, IAPROC, NAPROC, NAPFLD, & ICPRT, DTPRT, WSCUT, NOSWLL, FLOGRD, FLOGR2,& NOGRP, NGRPP, ICPRT2, DTPRT2 @@ -1376,7 +1379,8 @@ SUBROUTINE W3OUTG ( A, FLPART, FLOUTG, FLOUTG2 ) STMAXDL(NSEAL), TLPHI(NSEAL), & WL02X(NSEAL), WL02Y(NSEAL), & ALPXT(NSEAL), ALPYT(NSEAL), & - ALPXY(NSEAL), SCREST(NSEAL) + ALPXY(NSEAL), SCREST(NSEAL), & + QK1(NSEAL), QK2(NSEAL) REAL USSCO, FT1 REAL, SAVE :: HSMIN = 0.01 LOGICAL :: FLOLOC(NOGRP,NGRPP) @@ -1452,6 +1456,7 @@ SUBROUTINE W3OUTG ( A, FLPART, FLOUTG, FLOUTG2 ) TLPHI = 0. STMAXEL = 0. STMAXDL = 0. + QK2 = 0. ! HS = UNDEF WLM = UNDEF @@ -1468,6 +1473,7 @@ SUBROUTINE W3OUTG ( A, FLPART, FLOUTG, FLOUTG2 ) ALPXY = UNDEF ALPXT = UNDEF ALPYT = UNDEF + QKK = UNDEF THMP = UNDEF T02P = UNDEF SCREST = UNDEF @@ -1504,6 +1510,7 @@ SUBROUTINE W3OUTG ( A, FLPART, FLOUTG, FLOUTG2 ) ABXY = 0. ABYX = 0. ABST = 0. + QK1 = 0. ! ! 2.b Integrate energy in band ! @@ -1529,6 +1536,7 @@ SUBROUTINE W3OUTG ( A, FLPART, FLOUTG, FLOUTG2 ) IF (ITH.LE.NTH/2) THEN ABST(JSEA) = ABST(JSEA) + & A(ITH,IK,JSEA)*A(ITH+NTH/2,IK,JSEA) + QK1 (JSEA) = QK1(JSEA) + (A(ITH,IK,JSEA)+A(ITH+NTH/2,IK,JSEA))**2 END IF CALL INIT_GET_ISEA(ISEA, JSEA) FACTOR = MAX ( 0.5 , CG(IK,ISEA)/SIG(IK)*WN(IK,ISEA) ) @@ -1555,8 +1563,8 @@ SUBROUTINE W3OUTG ( A, FLPART, FLOUTG, FLOUTG2 ) DO JSEA=1, NSEAL CALL INIT_GET_ISEA(ISEA, JSEA) FACTOR = DDEN(IK) / CG(IK,ISEA) - EBD(IK,JSEA) = AB(JSEA) * FACTOR - ET(JSEA) = ET(JSEA) + EBD(IK,JSEA) + EBD(IK,JSEA) = AB(JSEA) * FACTOR ! this is E(f)*df + ET (JSEA) = ET (JSEA) + EBD(IK,JSEA) #ifdef W3_IG1 IF (IK.EQ.NINT(IGPARS(5))) HSIG(JSEA) = 4*SQRT(ET(JSEA)) #endif @@ -1564,7 +1572,8 @@ SUBROUTINE W3OUTG ( A, FLPART, FLOUTG, FLOUTG2 ) EWN(JSEA) = EWN(JSEA) + EBD(IK,JSEA) / WN(IK,ISEA) ETR(JSEA) = ETR(JSEA) + EBD(IK,JSEA) / SIG(IK) ET1(JSEA) = ET1(JSEA) + EBD(IK,JSEA) * SIG(IK) - EET1(JSEA) = EET1(JSEA)+ EBD(IK,JSEA)**2 * SIG(IK) + ! EET1(JSEA) = EET1(JSEA)+ EBD(IK,JSEA)**2 * SIG(IK) + EET1(JSEA) = EET1(JSEA)+ EBD(IK,JSEA)**2 * SIG(IK)/DSII(IK) ET02(JSEA) = ET02(JSEA)+ EBD(IK,JSEA) * SIG(IK)**2 ETX(JSEA) = ETX(JSEA) + ABX(JSEA) * FACTOR ETY(JSEA) = ETY(JSEA) + ABY(JSEA) * FACTOR @@ -1573,6 +1582,8 @@ SUBROUTINE W3OUTG ( A, FLPART, FLOUTG, FLOUTG2 ) TUSY(JSEA) = TUSY(JSEA) + ABY(JSEA)*FACTOR & *GRAV*WN(IK,ISEA)/SIG(IK) ETXX(JSEA) = ETXX(JSEA) + ABX2(JSEA) * FACTOR* WN(IK,ISEA)**2 + ! NB: QK1 (JSEA) = QK1(JSEA) + A(ITH,IK,JSEA)**2 + QK2 (JSEA) = QK2 (JSEA) + QK1(JSEA) * FACTOR* SIG(IK) /WN(IK,ISEA) ETYY(JSEA) = ETYY(JSEA) + ABY2(JSEA) * FACTOR* WN(IK,ISEA)**2 ETXY(JSEA) = ETXY(JSEA) + ABYX(JSEA) * FACTOR* WN(IK,ISEA)**2 IF (SIG(IK)*0.5*(1+XFR).LT.0.4*TPI) THEN @@ -1955,13 +1966,13 @@ SUBROUTINE W3OUTG ( A, FLPART, FLOUTG, FLOUTG2 ) ! 3.b Add tail ! ( DTH * SIG absorbed in FTxx ) - EBAND = AB(JSEA) / CG(NK,ISEA) + EBAND = AB(JSEA) / CG(NK,ISEA) ! EBAND is E(sigma)/sigma for the last frequency band ET (JSEA) = ET (JSEA) + FTE * EBAND EWN(JSEA) = EWN(JSEA) + FTWL * EBAND ETF(JSEA) = ETF(JSEA) + GRAV * FTTR * EBAND ! this is the integral of CgE in deep water ETR(JSEA) = ETR(JSEA) + FTTR * EBAND ET1(JSEA) = ET1(JSEA) + FT1 * EBAND - EET1(JSEA)= ET1(JSEA) + FT1 * EBAND**2 + ! EET1(JSEA)= EET1(JSEA) + FT1 * EBAND**2 : this was not correct. Actually tail may not be needed for Qp. ET02(JSEA)= ET02(JSEA)+ EBAND* 0.5 * SIG(NK)**4 * DTH ETX(JSEA) = ETX(JSEA) + FTE * ABX(JSEA) / CG(NK,ISEA) ETY(JSEA) = ETY(JSEA) + FTE * ABY(JSEA) / CG(NK,ISEA) @@ -2003,12 +2014,15 @@ SUBROUTINE W3OUTG ( A, FLPART, FLOUTG, FLOUTG2 ) END IF #endif IF ( ET(JSEA) .GT. 1.E-7 ) THEN - QP(JSEA) = ( 2. / ET(JSEA)**2 ) * EET1(JSEA) * TPIINV**2 + QP(JSEA) = ( 2. / ET(JSEA)**2 ) * EET1(JSEA) WLM(JSEA) = EWN(JSEA) / ET(JSEA) * TPI T0M1(JSEA) = ETR(JSEA) / ET(JSEA) * TPI THS(JSEA) = RADE * SQRT ( MAX ( 0. , 2. * ( 1. - SQRT ( & MAX(0.,(ETX(JSEA)**2+ETY(JSEA)**2)/ET(JSEA)**2) ) ) ) ) IF ( THS(JSEA) .LT. 0.01*RADE*DTH ) THS(JSEA) = 0. + ! NB: QK1 (JSEA) = QK1(JSEA) + A(ITH,IK,JSEA)**2 + ! QK2 (JSEA) = QK2 (JSEA) + QK1(JSEA) * FACTOR* SIG(IK) /WN(IK,ISEA) + QKK (JSEA) = SQRT(0.5*QK2 (JSEA))/ET(JSEA) ELSE WLM(JSEA) = 0. T0M1(JSEA) = TPI / SIG(NK) @@ -2438,7 +2452,11 @@ END SUBROUTINE W3OUTG !> !> @author H. L. Tolman @date 22-Mar-2021 !> - SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) + SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD & +#ifdef W3_ASCII + ,NDSOA & +#endif + ) !/ !/ +-----------------------------------+ !/ | WAVEWATCH III NOAA/NCEP | @@ -2571,8 +2589,8 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) CFLXYMAX, CFLTHMAX, CFLKMAX, P2SMS, US3D, & TH1M, STH1M, TH2M, STH2M, HSIG, PHICE, TAUICE,& STMAXE, STMAXD, HMAXE, HCMAXE, HMAXD, HCMAXD,& - USSP, TAUOCX, TAUOCY, PHS2, PTP2, PDIR2, PSI2,& - PNR2, PT12, PTHP02 + USSP, TAUOCX, TAUOCY, QKK, & + PHS2, PTP2, PDIR2, PSI2, PNR2, PT12, PTHP02 !/ USE W3ODATMD, ONLY: NOGRP, NGRPP, IDOUT, UNDEF, NDST, NDSE, & FLOGRD, IPASS => IPASS1, WRITE => WRITE1, & @@ -2598,6 +2616,9 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) INTEGER, INTENT(IN), OPTIONAL :: IMOD CHARACTER, INTENT(IN) :: INXOUT*(*) CHARACTER(LEN=15) :: TIMETAG +#ifdef W3_ASCII + INTEGER, INTENT(IN), OPTIONAL :: NDSOA +#endif !/ !/ ------------------------------------------------------------------- / !/ Local parameters @@ -2673,7 +2694,11 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) #endif IF ( WRITE ) THEN OPEN (NDSOG,FILE=FNMPRE(:J)//'out_grd.'//FILEXT(:I), & - form='UNFORMATTED', convert=file_endian,ERR=800,IOSTAT=IERR) + form ='UNFORMATTED', convert=file_endian,ERR=800,IOSTAT=IERR) +#ifdef W3_ASCII + OPEN (NDSOA,FILE=FNMPRE(:J)//'out_grd.'//FILEXT(:I)//'.txt', & + form ='FORMATTED',ERR=800,IOSTAT=IERR) +#endif ELSE OPEN (NDSOG,FILE=FNMPRE(:J)//'out_grd.'//FILEXT(:I), & form='UNFORMATTED', convert=file_endian,ERR=800,IOSTAT=IERR,STATUS='OLD') @@ -2688,6 +2713,13 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) WRITE (NDSOG) & IDSTR, VEROGR, GNAME, NOGRP, NGRPP, NSEA, NX, NY, & UNDEF, NOSWLL +#ifdef W3_ASCII + WRITE (NDSOA,*) & + 'IDSTR, VEROGR, GNAME, NOGRP, NGRPP, NSEA, NX, NY, & + UNDEF, NOSWLL:', & + IDSTR, VEROGR, GNAME, NOGRP, NGRPP, NSEA, NX, NY, & + UNDEF, NOSWLL +#endif ELSE READ (NDSOG,END=801,ERR=802,IOSTAT=IERR) & IDTST, VERTST, TNAME, MOGRP, MGRPP, NSEA, NX, NY, & @@ -2748,6 +2780,10 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) IF ( WRITE ) THEN OPEN (NDSOG,FILE=FNMPRE(:J)//TIMETAG//'.out_grd.' & //FILEXT(:I),form='UNFORMATTED', convert=file_endian,ERR=800,IOSTAT=IERR) +#ifdef W3_ASCII + OPEN (NDSOA,FILE=FNMPRE(:J)//TIMETAG//'.out_grd.' & + //FILEXT(:I)//'.txt',form='FORMATTED',ERR=800,IOSTAT=IERR) +#endif ELSE OPEN (NDSOG,FILE=FNMPRE(:J)//'out_grd.'//FILEXT(:I), & form='UNFORMATTED', convert=file_endian,ERR=800,IOSTAT=IERR,STATUS='OLD') @@ -2762,6 +2798,13 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) WRITE (NDSOG) & IDSTR, VEROGR, GNAME, NOGRP, NGRPP, NSEA, NX, NY, & UNDEF, NOSWLL +#ifdef W3_ASCII + WRITE (NDSOA,*) & + 'IDSTR, VEROGR, GNAME, NOGRP, NGRPP, NSEA, NX, NY, & + UNDEF, NOSWLL:', & + IDSTR, VEROGR, GNAME, NOGRP, NGRPP, NSEA, NX, NY, & + UNDEF, NOSWLL +#endif ELSE READ (NDSOG,END=801,ERR=802,IOSTAT=IERR) & IDTST, VERTST, TNAME, MOGRP, MGRPP, NSEA, NX, NY, & @@ -2800,6 +2843,10 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) ! IF ( WRITE ) THEN WRITE (NDSOG) TIME, FLOGRD +#ifdef W3_ASCII + WRITE (NDSOA,*) 'TIME, FLOGRD:', & + TIME, FLOGRD +#endif ELSE READ (NDSOG,END=803,ERR=802,IOSTAT=IERR) TIME, FLOGRD END IF @@ -2815,6 +2862,10 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) MAPTMP = MAPSTA + 8*MAPST2 WRITE (NDSOG) & ((MAPTMP(IY,IX),IX=1,NX),IY=1,NY) +#ifdef W3_ASCII + WRITE (NDSOA,*) 'MAPSTA:', & + ((MAPTMP(IY,IX),IX=1,NX),IY=1,NY) +#endif ELSE READ (NDSOG,END=801,ERR=802,IOSTAT=IERR) & ((MAPTMP(IY,IX),IX=1,NX),IY=1,NY) @@ -2956,6 +3007,7 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) IF ( FLOGRD( 8, 3) ) MSSD (ISEA) = UNDEF IF ( FLOGRD( 8, 4) ) MSCD (ISEA) = UNDEF IF ( FLOGRD( 8, 5) ) QP (ISEA) = UNDEF + IF ( FLOGRD( 8, 6) ) QKK (ISEA) = UNDEF ! IF ( FLOGRD( 9, 1) ) DTDYN (ISEA) = UNDEF IF ( FLOGRD( 9, 2) ) FCUT (ISEA) = UNDEF @@ -3016,9 +3068,18 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) ! IF ( IFI .EQ. 1 .AND. IFJ .EQ. 1 ) THEN WRITE ( NDSOG ) DW(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'DW:', DW(1:NSEA) +#endif ELSE IF ( IFI .EQ. 1 .AND. IFJ .EQ. 2 ) THEN WRITE ( NDSOG ) CX(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'CX:', CX(1:NSEA) +#endif WRITE ( NDSOG ) CY(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'CY:', CY(1:NSEA) +#endif ELSE IF ( IFI .EQ. 1 .AND. IFJ .EQ. 3 ) THEN DO ISEA=1, NSEA #ifdef W3_SMC @@ -3037,15 +3098,33 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) END IF END DO WRITE ( NDSOG ) AUX1 +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'AUX1 (UA*cos(UD)):', AUX1 +#endif WRITE ( NDSOG ) AUX2 +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'AUX2 (UA*sin(UD)):', AUX2 +#endif ELSE IF ( IFI .EQ. 1 .AND. IFJ .EQ. 4 ) THEN WRITE ( NDSOG ) AS(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'AS:', AS(1:NSEA) +#endif ELSE IF ( IFI .EQ. 1 .AND. IFJ .EQ. 5 ) THEN WRITE ( NDSOG ) WLV(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'WLV:', WLV(1:NSEA) +#endif ELSE IF ( IFI .EQ. 1 .AND. IFJ .EQ. 6 ) THEN WRITE ( NDSOG ) ICE(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'ICE:', ICE(1:NSEA) +#endif ELSE IF ( IFI .EQ. 1 .AND. IFJ .EQ. 7 ) THEN WRITE ( NDSOG ) BERG(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'BERG:', BERG(1:NSEA) +#endif ELSE IF ( IFI .EQ. 1 .AND. IFJ .EQ. 8 ) THEN DO ISEA=1, NSEA #ifdef W3_SMC @@ -3064,22 +3143,43 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) END IF END DO WRITE ( NDSOG ) AUX1 +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'AUX1 (TAUA*cos(TAUADIR)):', AUX1 +#endif WRITE ( NDSOG ) AUX2 +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'AUX2 (TAUA*sin(TAUADIR)):', AUX2 +#endif ELSE IF ( IFI .EQ. 1 .AND. IFJ .EQ. 9 ) THEN WRITE ( NDSOG ) RHOAIR(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'RHOAIR:', RHOAIR(1:NSEA) +#endif #ifdef W3_BT4 ELSE IF ( IFI .EQ. 1 .AND. IFJ .EQ. 10 ) THEN WRITE ( NDSOG ) SED_D50(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'SED_D50:', SED_D50(1:NSEA) +#endif #endif #ifdef W3_IS2 ELSE IF (IFI .EQ. 1 .AND. IFJ .EQ. 11 ) THEN WRITE (NDSOG ) ICEH(1:NSEA) +#ifdef W3_ASCII + WRITE (NDSOA,* ) 'ICEH:', ICEH(1:NSEA) +#endif ELSE IF (IFI .EQ. 1 .AND. IFJ .EQ. 12 ) THEN WRITE (NDSOG ) ICEF(1:NSEA) +#ifdef W3_ASCII + WRITE (NDSOA,* ) 'ICEF:', ICEF(1:NSEA) +#endif #endif #ifdef W3_SETUP ELSE IF ( IFI .EQ. 1 .AND. IFJ .EQ. 13 ) THEN WRITE ( NDSOG ) ZETA_SETUP(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'ZETA_SETUP:', ZETA_SETUP(1:NSEA) +#endif #endif ! @@ -3087,92 +3187,212 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) ! ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 1 ) THEN WRITE ( NDSOG ) HS(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'HS:', HS(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 2 ) THEN WRITE ( NDSOG ) WLM(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'WLM:', WLM(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 3 ) THEN WRITE ( NDSOG ) T02(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'T02:', T02(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 4 ) THEN WRITE ( NDSOG ) T0M1(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'T0M1:', T0M1(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 5 ) THEN WRITE ( NDSOG ) T01(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'T01:', T01(1:NSEA) +#endif ELSE IF ( (IFI .EQ. 2 .AND. IFJ .EQ. 6) .OR. & (IFI .EQ. 2 .AND. IFJ .EQ. 18) ) THEN ! Note: TP output is derived from FP field. WRITE ( NDSOG ) FP0(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'FP0:', FP0(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 7 ) THEN WRITE ( NDSOG ) THM(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'THM:', THM(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 8 ) THEN WRITE ( NDSOG ) THS(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'THS:', THS(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 9 ) THEN WRITE ( NDSOG ) THP0(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'THP0:', THP0(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 10 ) THEN WRITE ( NDSOG ) HSIG(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'HSIG:', HSIG(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 11 ) THEN WRITE ( NDSOG ) STMAXE(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'STMAXE:', STMAXE(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 12 ) THEN WRITE ( NDSOG ) STMAXD(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'STMAXD:', STMAXD(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 13 ) THEN WRITE ( NDSOG ) HMAXE(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'HMAXE:', HMAXE(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 14 ) THEN WRITE ( NDSOG ) HCMAXE(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'HCMAXE:', HCMAXE(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 15 ) THEN WRITE ( NDSOG ) HMAXD(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'HMAXD:', HMAXD(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 16 ) THEN WRITE ( NDSOG ) HCMAXD(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'HCMAXD:', HCMAXD(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 17 ) THEN WRITE ( NDSOG ) WBT(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'WBT:', WBT(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 19 ) THEN WRITE ( NDSOG ) WNMEAN(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'WNMEAN:', WNMEAN(1:NSEA) +#endif ! ! Section 3) ! ELSE IF ( IFI .EQ. 3 .AND. IFJ .EQ. 1 ) THEN WRITE ( NDSOG ) EF(1:NSEA,E3DF(2,1):E3DF(3,1)) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'EF:', EF(1:NSEA,E3DF(2,1):E3DF(3,1)) +#endif ELSE IF ( IFI .EQ. 3 .AND. IFJ .EQ. 2 ) THEN WRITE ( NDSOG ) TH1M(1:NSEA,E3DF(2,2):E3DF(3,2)) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TH1M:', TH1M(1:NSEA,E3DF(2,2):E3DF(3,2)) +#endif ELSE IF ( IFI .EQ. 3 .AND. IFJ .EQ. 3 ) THEN WRITE ( NDSOG ) STH1M(1:NSEA,E3DF(2,3):E3DF(3,3)) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'STH1M:', STH1M(1:NSEA,E3DF(2,3):E3DF(3,3)) +#endif ELSE IF ( IFI .EQ. 3 .AND. IFJ .EQ. 4 ) THEN WRITE ( NDSOG ) TH2M(1:NSEA,E3DF(2,4):E3DF(3,4)) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TH2M:', TH2M(1:NSEA,E3DF(2,4):E3DF(3,4)) +#endif ELSE IF ( IFI .EQ. 3 .AND. IFJ .EQ. 5 ) THEN WRITE ( NDSOG ) STH2M(1:NSEA,E3DF(2,5):E3DF(3,5)) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'STH2M:', STH2M(1:NSEA,E3DF(2,5):E3DF(3,5)) +#endif ELSE IF ( IFI .EQ. 3 .AND. IFJ .EQ. 6) THEN WRITE ( NDSOG ) WN(1:NK,1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'WN:', WN(1:NK,1:NSEA) +#endif ! ! Section 4) ! ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 1 ) THEN WRITE ( NDSOG ) PHS(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PHS:', PHS(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 2 ) THEN WRITE ( NDSOG ) PTP(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PTP:', PTP(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 3 ) THEN WRITE ( NDSOG ) PLP(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PLP:', PLP(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 4 ) THEN WRITE ( NDSOG ) PDIR(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PDIR:', PDIR(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 5 ) THEN WRITE ( NDSOG ) PSI(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PSI:', PSI(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 6 ) THEN WRITE ( NDSOG ) PWS(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PWS:', PWS(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 7 ) THEN WRITE ( NDSOG ) PTHP0(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PTHP0:', PTHP0(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 8 ) THEN WRITE ( NDSOG ) PQP(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PQP:', PQP(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 9 ) THEN WRITE ( NDSOG ) PPE(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PPE:', PPE(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 10 ) THEN WRITE ( NDSOG ) PGW(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PGW:', PGW(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 11 ) THEN WRITE ( NDSOG ) PSW(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PSW:', PSW(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 12 ) THEN WRITE ( NDSOG ) PTM1(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PTM1:', PTM1(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 13 ) THEN WRITE ( NDSOG ) PT1(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PT1:', PT1(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 14 ) THEN WRITE ( NDSOG ) PT2(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PT2:', PT2(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 15 ) THEN WRITE ( NDSOG ) PEP(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PEP:', PEP(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 16 ) THEN WRITE ( NDSOG ) PWST(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PWST:', PWST(1:NSEA) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 17 ) THEN WRITE ( NDSOG ) PNR(1:NSEA) ! CAH: second partitioning scheme @@ -3190,6 +3410,9 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) WRITE ( NDSOG ) PT12(1:NSEA,0:1) ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 24 ) THEN WRITE ( NDSOG ) PNR2(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PNR:', PNR(1:NSEA) +#endif ! ! Section 5) ! @@ -3208,68 +3431,179 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) END IF END DO WRITE ( NDSOG ) AUX1 +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'AUX1 (UST*ASF*cos(USTDIR)):', AUX1 +#endif WRITE ( NDSOG ) AUX2 +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'AUX2 (UST*ASF*sin(USTDIR)):', AUX2 +#endif ELSE IF ( IFI .EQ. 5 .AND. IFJ .EQ. 2 ) THEN WRITE ( NDSOG ) CHARN(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'CHARN:', CHARN(1:NSEA) +#endif ELSE IF ( IFI .EQ. 5 .AND. IFJ .EQ. 3 ) THEN WRITE ( NDSOG ) CGE(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'CGE:', CGE(1:NSEA) +#endif ELSE IF ( IFI .EQ. 5 .AND. IFJ .EQ. 4 ) THEN WRITE ( NDSOG ) PHIAW(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PHIAW:', PHIAW(1:NSEA) +#endif ELSE IF ( IFI .EQ. 5 .AND. IFJ .EQ. 5 ) THEN WRITE ( NDSOG ) TAUWIX(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TAUWIX:', TAUWIX(1:NSEA) +#endif WRITE ( NDSOG ) TAUWIY(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TAUWIY:', TAUWIY(1:NSEA) +#endif ELSE IF ( IFI .EQ. 5 .AND. IFJ .EQ. 6 ) THEN WRITE ( NDSOG ) TAUWNX(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TAUWNX:', TAUWNX(1:NSEA) +#endif WRITE ( NDSOG ) TAUWNY(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TAUWNY:', TAUWNY(1:NSEA) +#endif ELSE IF ( IFI .EQ. 5 .AND. IFJ .EQ. 7 ) THEN WRITE ( NDSOG ) WHITECAP(1:NSEA,1) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'WHITECAP(1):', WHITECAP(1:NSEA,1) +#endif ELSE IF ( IFI .EQ. 5 .AND. IFJ .EQ. 8 ) THEN WRITE ( NDSOG ) WHITECAP(1:NSEA,2) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'WHITECAP(2):', WHITECAP(1:NSEA,2) +#endif ELSE IF ( IFI .EQ. 5 .AND. IFJ .EQ. 9 ) THEN WRITE ( NDSOG ) WHITECAP(1:NSEA,3) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'WHITECAP(3):', WHITECAP(1:NSEA,3) +#endif ELSE IF ( IFI .EQ. 5 .AND. IFJ .EQ. 10 ) THEN WRITE ( NDSOG ) WHITECAP(1:NSEA,4) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'WHITECAP(4):', WHITECAP(1:NSEA,4) +#endif ELSE IF ( IFI .EQ. 5 .AND. IFJ .EQ. 11 ) THEN WRITE ( NDSOG ) TWS(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TWS:', TWS(1:NSEA) +#endif ! ! Section 6) ! ELSE IF ( IFI .EQ. 6 .AND. IFJ .EQ. 1 ) THEN WRITE ( NDSOG ) SXX(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'SXX:', SXX(1:NSEA) +#endif WRITE ( NDSOG ) SYY(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'SYY:', SYY(1:NSEA) +#endif WRITE ( NDSOG ) SXY(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'SXY:', SXY(1:NSEA) +#endif ELSE IF ( IFI .EQ. 6 .AND. IFJ .EQ. 2 ) THEN WRITE ( NDSOG ) TAUOX(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TAUOX:', TAUOX(1:NSEA) +#endif WRITE ( NDSOG ) TAUOY(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TAUOY:', TAUOY(1:NSEA) +#endif ELSE IF ( IFI .EQ. 6 .AND. IFJ .EQ. 3 ) THEN WRITE ( NDSOG ) BHD(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'BHD:', BHD(1:NSEA) +#endif ELSE IF ( IFI .EQ. 6 .AND. IFJ .EQ. 4 ) THEN WRITE ( NDSOG ) PHIOC(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PHIOC:', PHIOC(1:NSEA) +#endif ELSE IF ( IFI .EQ. 6 .AND. IFJ .EQ. 5 ) THEN WRITE ( NDSOG ) TUSX(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TUSX:', TUSX(1:NSEA) +#endif WRITE ( NDSOG ) TUSY(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TUSY:', TUSY(1:NSEA) +#endif ELSE IF ( IFI .EQ. 6 .AND. IFJ .EQ. 6 ) THEN WRITE ( NDSOG ) USSX(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'USSX:', USSX(1:NSEA) +#endif WRITE ( NDSOG ) USSY(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'USSY:', USSY(1:NSEA) +#endif ELSE IF ( IFI .EQ. 6 .AND. IFJ .EQ. 7 ) THEN WRITE ( NDSOG ) PRMS(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PRMS:', PRMS(1:NSEA) +#endif WRITE ( NDSOG ) TPMS(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TPMS:', TPMS(1:NSEA) +#endif ELSE IF ( IFI .EQ. 6 .AND. IFJ .EQ. 8 ) THEN WRITE ( NDSOG ) US3D(1:NSEA, US3DF(2):US3DF(3)) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'US3D:', US3D(1:NSEA, US3DF(2):US3DF(3)) +#endif WRITE ( NDSOG ) US3D(1:NSEA,NK+US3DF(2):NK+US3DF(3)) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'US3D+NK:', US3D(1:NSEA,NK+US3DF(2):NK+US3DF(3)) +#endif ELSE IF ( IFI .EQ. 6 .AND. IFJ .EQ. 9 ) THEN WRITE ( NDSOG ) P2SMS(1:NSEA,P2MSF(2):P2MSF(3)) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'P2SMS:', P2SMS(1:NSEA,P2MSF(2):P2MSF(3)) +#endif ELSE IF ( IFI .EQ. 6 .AND. IFJ .EQ. 10 ) THEN WRITE ( NDSOG ) TAUICE(1:NSEA,1) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TAUICE(1):', TAUICE(1:NSEA,1) +#endif WRITE ( NDSOG ) TAUICE(1:NSEA,2) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TAUICE(2):', TAUICE(1:NSEA,2) +#endif ELSE IF ( IFI .EQ. 6 .AND. IFJ .EQ. 11 ) THEN WRITE ( NDSOG ) PHICE(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PHICE:', PHICE(1:NSEA) +#endif ELSE IF ( IFI .EQ. 6 .AND. IFJ .EQ. 12 ) THEN WRITE ( NDSOG ) USSP(1:NSEA, 1:USSPF(2)) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'USSP:', USSP(1:NSEA, 1:USSPF(2)) +#endif WRITE ( NDSOG ) USSP(1:NSEA,NK+1:NK+USSPF(2)) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'USSP:', USSP(1:NSEA,NK+1:NK+USSPF(2)) +#endif ELSE IF ( IFI .EQ. 6 .AND. IFJ .EQ. 13 ) THEN WRITE ( NDSOG ) TAUOCX(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TAUOCX:', TAUOCX(1:NSEA) +#endif WRITE ( NDSOG ) TAUOCY(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TAUOCY:', TAUOCY(1:NSEA) +#endif ! ! Section 7) ! @@ -3284,7 +3618,13 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) END IF END DO WRITE ( NDSOG ) AUX1 +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'AUX1 (ABA*cos(ABD)):', AUX1 +#endif WRITE ( NDSOG ) AUX2 +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'AUX2 (ABA*sin(ABD)):', AUX2 +#endif !WRITE ( NDSOG ) ABA(1:NSEA) !WRITE ( NDSOG ) ABD(1:NSEA) ELSE IF ( IFI .EQ. 7 .AND. IFJ .EQ. 2 ) THEN @@ -3298,51 +3638,119 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) END IF END DO WRITE ( NDSOG ) AUX1 +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'AUX1 (UBA*cos(UBD)):', AUX1 +#endif WRITE ( NDSOG ) AUX2 +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'AUX2 (UBA*sin(UBD)):', AUX2 +#endif ! WRITE ( NDSOG ) UBA(1:NSEA) ! WRITE ( NDSOG ) UBD(1:NSEA) ELSE IF ( IFI .EQ. 7 .AND. IFJ .EQ. 3 ) THEN WRITE ( NDSOG ) BEDFORMS(1:NSEA,1) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'BEDFORMS(1):', BEDFORMS(1:NSEA,1) +#endif WRITE ( NDSOG ) BEDFORMS(1:NSEA,2) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'BEDFORMS(2):', BEDFORMS(1:NSEA,2) +#endif WRITE ( NDSOG ) BEDFORMS(1:NSEA,3) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'BEDFORMS(3):', BEDFORMS(1:NSEA,3) +#endif ELSE IF ( IFI .EQ. 7 .AND. IFJ .EQ. 4 ) THEN WRITE ( NDSOG ) PHIBBL(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PHIBBL:', PHIBBL(1:NSEA) +#endif ELSE IF ( IFI .EQ. 7 .AND. IFJ .EQ. 5 ) THEN WRITE ( NDSOG ) TAUBBL(1:NSEA,1) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TAUBBL(1):', TAUBBL(1:NSEA,1) +#endif WRITE ( NDSOG ) TAUBBL(1:NSEA,2) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TAUBBL(2):', TAUBBL(1:NSEA,2) +#endif ! ! Section 8) ! ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 1 ) THEN WRITE ( NDSOG ) MSSX(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'MSSX:', MSSX(1:NSEA) +#endif WRITE ( NDSOG ) MSSY(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'MSSY:', MSSY(1:NSEA) +#endif ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 2 ) THEN WRITE ( NDSOG ) MSCX(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'MSCX:', MSCX(1:NSEA) +#endif WRITE ( NDSOG ) MSCY(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'MSCY:', MSCY(1:NSEA) +#endif ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 3 ) THEN WRITE ( NDSOG ) MSSD(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'MSSD:', MSSD(1:NSEA) +#endif ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 4 ) THEN WRITE ( NDSOG ) MSCD(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'MSCD:', MSCD(1:NSEA) +#endif ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 5 ) THEN WRITE ( NDSOG ) QP(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'QP:', QP(1:NSEA) +#endif + ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 6 ) THEN + WRITE ( NDSOG ) QKK(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'QKK:', QKK(1:NSEA) +#endif ! ! Section 9) ! ELSE IF ( IFI .EQ. 9 .AND. IFJ .EQ. 1 ) THEN WRITE ( NDSOG ) DTDYN(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'DTDYN:', DTDYN(1:NSEA) +#endif ELSE IF ( IFI .EQ. 9 .AND. IFJ .EQ. 2 ) THEN WRITE ( NDSOG ) FCUT(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'FCUT:', FCUT(1:NSEA) +#endif ELSE IF ( IFI .EQ. 9 .AND. IFJ .EQ. 3 ) THEN WRITE ( NDSOG ) CFLXYMAX(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'CFLXYMAX:', CFLXYMAX(1:NSEA) +#endif ELSE IF ( IFI .EQ. 9 .AND. IFJ .EQ. 4 ) THEN WRITE ( NDSOG ) CFLTHMAX(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'CFLTHMAX:', CFLTHMAX(1:NSEA) +#endif ELSE IF ( IFI .EQ. 9 .AND. IFJ .EQ. 5 ) THEN WRITE ( NDSOG ) CFLKMAX(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'CFLMAX:', CFLKMAX(1:NSEA) +#endif ! ! Section 10) ! ELSE IF ( IFI .EQ. 10 ) THEN WRITE ( NDSOG ) USERO(1:NSEA,IFJ) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'USER0:', USERO(1:NSEA,IFJ) +#endif ! END IF ! @@ -3678,6 +4086,8 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) MSCD(1:NSEA) ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 5 ) THEN READ (NDSOG,END=801,ERR=802,IOSTAT=IERR) QP(1:NSEA) + ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 6 ) THEN + READ (NDSOG,END=801,ERR=802,IOSTAT=IERR) QKK(1:NSEA) ! ! Section 9) ! diff --git a/model/src/w3iogrmd.F90 b/model/src/w3iogrmd.F90 index 3aa2688ab..ce4403ba3 100644 --- a/model/src/w3iogrmd.F90 +++ b/model/src/w3iogrmd.F90 @@ -112,7 +112,11 @@ MODULE W3IOGRMD !> @author F. Ardhuin !> @date 19-Oct-2020 - SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) + SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT & +#ifdef W3_ASCII + ,NDSA & +#endif + ) !/ !/ +-----------------------------------+ !/ | WAVEWATCH III NOAA/NCEP | @@ -209,6 +213,7 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) ! INXOUT C*(*) I Test string for read/write, valid are: ! 'READ', 'WRITE' and 'GRID'. ! NDSM Int. I File unit number. + ! NDSA Int. I File unit number. ascii ! IMOD Int. I Model number for W3GDAT etc. ! FEXT C*(*) I File extension to be used. ! ---------------------------------------------------------------- @@ -279,7 +284,7 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) DIKCUMUL #endif #ifdef W3_NL1 - USE W3SNL1MD, ONLY: INSNL1 + USE W3SNL1MD, ONLY: INSNL1, INSNLGQM #endif #ifdef W3_NL2 USE W3SNL2MD, ONLY: INSNL2 @@ -317,6 +322,9 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) INTEGER, INTENT(IN), OPTIONAL :: IMOD CHARACTER, INTENT(IN) :: INXOUT*(*) CHARACTER, INTENT(IN), OPTIONAL :: FEXT*(*) +#ifdef W3_ASCII + INTEGER, INTENT(IN), OPTIONAL :: NDSA +#endif !/ !/ ------------------------------------------------------------------- / !/ Local parameters @@ -563,6 +571,10 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) IF ( WRITE ) THEN OPEN (NDSM,FILE=FNMPRE(:IPRE)//'mod_def.'//FILEXT(:IEXT), & form='UNFORMATTED', convert=file_endian,ERR=800,IOSTAT=IERR) +#ifdef W3_ASCII + OPEN (NDSA,FILE=FNMPRE(:IPRE)//'mod_def.'//FILEXT(:IEXT)//'.txt', & + form='FORMATTED',ERR=800,IOSTAT=IERR) +#endif ELSE OPEN (NDSM,FILE=FNMPRE(:IPRE)//'mod_def.'//FILEXT(:IEXT), & form='UNFORMATTED', convert=file_endian,STATUS='OLD',ERR=800,IOSTAT=IERR) @@ -578,14 +590,38 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) NBI, NFBPO, GNAME, FNAME0, FNAME1, FNAME2, FNAME3, & FNAME4, FNAME5, FNAME6, FNAMEP, FNAMEG, & FNAMEF, FNAMEI +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'IDSTR, VERGRD, NX, NY, NSEA, NTH, NK, & + NBI, NFBPO, GNAME, FNAME0, FNAME1, FNAME2, FNAME3, & + FNAME4, FNAME5, FNAME6, FNAMEP, FNAMEG, & + FNAMEF, FNAMEI:', & + IDSTR, VERGRD, NX, NY, NSEA, NTH, NK, & + NBI, NFBPO, GNAME, FNAME0, FNAME1, FNAME2, FNAME3, & + FNAME4, FNAME5, FNAME6, FNAMEP, FNAMEG, & + FNAMEF, FNAMEI +#endif ! #ifdef W3_SMC WRITE (NDSM) NCel, NUFc, NVFc, NRLv, MRFct +#ifdef W3_ASCII + WRITE (NDSA,*) 'NCel, NUFc, NVFc, NRLv, MRFct:', & + NCel, NUFc, NVFc, NRLv, MRFct +#endif WRITE (NDSM) NGLO, NARC, NBGL, NBAC, NBSMC +#ifdef W3_ASCII + WRITE (NDSA,*) 'NGLO, NARC, NBGL, NBAC, NBSMC:', & + NGLO, NARC, NBGL, NBAC, NBSMC +#endif #endif ! WRITE (NDSM) & (NBO(I),I=0,NFBPO), (NBO2(I),I=0,NFBPO) +#ifdef W3_ASCII + WRITE (NDSA,*) & + '(NBO(I),I=0,NFBPO), (NBO2(I),I=0,NFBPO):', & + (NBO(I),I=0,NFBPO), (NBO2(I),I=0,NFBPO) +#endif #ifdef W3_T WRITE (NDST,9001) IDSTR, VERGRD, NX, NY, NSEA, NTH, NK, & NBI, NFBPO, 9, GNAME, FNAME0, FNAME1, FNAME2, FNAME3, & @@ -717,6 +753,11 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) MAPTMP = MAPSTA + 8*MAPST2 WRITE (NDSM) & GTYPE, FLAGLL, ICLOSE +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'GTYPE, FLAGLL, ICLOSE:', & + GTYPE, FLAGLL, ICLOSE +#endif ! ! Writes different kind of information depending on grid type ! @@ -725,9 +766,19 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) CASE ( RLGTYPE, SMCTYPE ) WRITE (NDSM) & SX, SY, X0, Y0 +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'SX, SY, X0, Y0:', & + SX, SY, X0, Y0 +#endif CASE ( CLGTYPE ) WRITE (NDSM) & REAL(XGRD), REAL(YGRD) +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'REAL(XGRD), REAL(YGRD):', & + REAL(XGRD), REAL(YGRD) +#endif CASE (UNGTYPE) WRITE (NDSM) & FSN, FSPSI,FSFCT,FSNIMP,FSTOTALIMP,FSTOTALEXP, & @@ -746,6 +797,41 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) B_JGS_NORM_THR, & B_JGS_NLEVEL, & B_JGS_SOURCE_NONLINEAR +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'FSN, FSPSI,FSFCT,FSNIMP,FSTOTALIMP,FSTOTALEXP, & + FSBCCFL, FSREFRACTION, FSFREQSHIFT, FSSOURCE, & + DO_CHANGE_WLV, SOLVERTHR_STP, CRIT_DEP_STP, & + NTRI,COUNTOT, COUNTRI, NNZ, & + B_JGS_TERMINATE_MAXITER, & + B_JGS_TERMINATE_DIFFERENCE, & + B_JGS_TERMINATE_NORM, & + B_JGS_LIMITER, & + B_JGS_BLOCK_GAUSS_SEIDEL, & + B_JGS_USE_JACOBI, & + B_JGS_MAXITER, & + B_JGS_PMIN, & + B_JGS_DIFF_THR, & + B_JGS_NORM_THR, & + B_JGS_NLEVEL, & + B_JGS_SOURCE_NONLINEAR:', & + FSN, FSPSI,FSFCT,FSNIMP,FSTOTALIMP,FSTOTALEXP, & + FSBCCFL, FSREFRACTION, FSFREQSHIFT, FSSOURCE, & + DO_CHANGE_WLV, SOLVERTHR_STP, CRIT_DEP_STP, & + NTRI,COUNTOT, COUNTRI, NNZ, & + B_JGS_TERMINATE_MAXITER, & + B_JGS_TERMINATE_DIFFERENCE, & + B_JGS_TERMINATE_NORM, & + B_JGS_LIMITER, & + B_JGS_BLOCK_GAUSS_SEIDEL, & + B_JGS_USE_JACOBI, & + B_JGS_MAXITER, & + B_JGS_PMIN, & + B_JGS_DIFF_THR, & + B_JGS_NORM_THR, & + B_JGS_NLEVEL, & + B_JGS_SOURCE_NONLINEAR +#endif !Init COUNTCON and IOBDP to zero, it needs to be set somewhere or !removed COUNTCON=0 @@ -755,10 +841,26 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) LEN, IEN, ANGLE0, ANGLE, SI, MAXX, MAXY, & DXYMAX, INDEX_CELL, CCON, COUNTCON, IE_CELL, & POS_CELL, IOBP, IOBPA, IOBDP, IOBPD, IAA, JAA, POSI +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'X0, Y0, SX, SY, DXYMAX, XGRD, YGRD, TRIGP, TRIA, & + LEN, IEN, ANGLE0, ANGLE, SI, MAXX, MAXY, & + DXYMAX, INDEX_CELL, CCON, COUNTCON, IE_CELL, & + POS_CELL, IOBP, IOBPA, IOBDP, IOBPD, IAA, JAA, POSI:', & + X0, Y0, SX, SY, DXYMAX, XGRD, YGRD, TRIGP, TRIA, & + LEN, IEN, ANGLE0, ANGLE, SI, MAXX, MAXY, & + DXYMAX, INDEX_CELL, CCON, COUNTCON, IE_CELL, & + POS_CELL, IOBP, IOBPA, IOBDP, IOBPD, IAA, JAA, POSI +#endif END SELECT !GTYPE ! WRITE (NDSM) & ZB, MAPTMP, MAPFS, MAPSF, TRFLAG +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'ZB, MAPTMP, MAPFS, MAPSF, TRFLAG:', & + ZB, MAPTMP, MAPFS, MAPSF, TRFLAG +#endif ! #ifdef W3_SMC IF( GTYPE .EQ. SMCTYPE ) THEN @@ -767,6 +869,18 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) WRITE (NDSM) ICLBAC WRITE (NDSM) ANGARC WRITE (NDSM) CTRNX, CTRNY, CLATF +#ifdef W3_ASCII + WRITE (NDSA,*) 'NLvCel, NLvUFc, NLvVFc:', & + NLvCel, NLvUFc, NLvVFc + WRITE (NDSA,*) 'IJKCel, IJKUFc, IJKVFc, ISMCBP:', & + IJKCel, IJKUFc, IJKVFc, ISMCBP + WRITE (NDSA,*) 'ICLBAC:', & + ICLBAC + WRITE (NDSA,*) 'ANGARC:', & + ANGARC + WRITE (NDSA,*) 'CTRNX, CTRNY, CLATF:', & + CTRNX, CTRNY, CLATF +#endif IF ( FLTEST ) THEN WRITE (NDSE,"(' NRLv, MRFct and NBSMC values are',3I9)") NRLv, MRFct, NBSMC WRITE (NDSE,"(' IJKCel, IJKUFc, IJKVFc Write for',3I9)") NCel, NUFc, NVFc @@ -776,6 +890,9 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #endif ! IF ( TRFLAG .NE. 0 ) WRITE (NDSM) TRNX, TRNY +#ifdef W3_ASCII + IF ( TRFLAG .NE. 0 ) WRITE (NDSA,*) 'TRNX, TRNY:', TRNX, TRNY +#endif WRITE (NDSM) & DTCFL, DTCFLI, DTMAX, DTMIN, DMIN, CTMAX, & FICE0, FICEN, FICEL, PFMOVE, FLDRY, FLCX, FLCY, FLCTH, & @@ -784,14 +901,43 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) ICESCALES(1:4), CALTYPE, CMPRTRCK, IICEHFAC, IICEHDISP,& IICEDDISP, IICEFDISP, BTBETA, & AAIRCMIN, AAIRGB +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'DTCFL, DTCFLI, DTMAX, DTMIN, DMIN, CTMAX, & + FICE0, FICEN, FICEL, PFMOVE, FLDRY, FLCX, FLCY, FLCTH, & + FLCK, FLSOU, FLBPI, FLBPO, CLATS, CLATIS, CTHG0S, & + STEXU, STEYU, STEDU, IICEHMIN, IICEHINIT, IICEDISP, & + ICESCALES(1:4), CALTYPE, CMPRTRCK, IICEHFAC, IICEHDISP,& + IICEDDISP, IICEFDISP, BTBETA, & + AAIRCMIN, AAIRGB:', & + DTCFL, DTCFLI, DTMAX, DTMIN, DMIN, CTMAX, & + FICE0, FICEN, FICEL, PFMOVE, FLDRY, FLCX, FLCY, FLCTH, & + FLCK, FLSOU, FLBPI, FLBPO, CLATS, CLATIS, CTHG0S, & + STEXU, STEYU, STEDU, IICEHMIN, IICEHINIT, IICEDISP, & + ICESCALES(1:4), CALTYPE, CMPRTRCK, IICEHFAC, IICEHDISP,& + IICEDDISP, IICEFDISP, BTBETA, & + AAIRCMIN, AAIRGB +#endif WRITE(NDSM)GRIDSHIFT +#ifdef W3_ASCII + WRITE(NDSA,*)'GRIDSHIFT:', & + GRIDSHIFT +#endif #ifdef W3_SEC1 WRITE (NDSM) NITERSEC1 +#ifdef W3_ASCII + WRITE (NDSA,*) 'NITERSEC1:', & + NITERSEC1 +#endif #endif #ifdef W3_RTD !! Add rotated Polat/lon and AnglD to mod_def JGLi12Jun2012 WRITE (NDSM) PoLat, PoLon, AnglD, FLAGUNR +#ifdef W3_ASCII + WRITE (NDSA,*) 'PoLat, PoLon, AnglD, FLAGUNR:', & + PoLat, PoLon, AnglD, FLAGUNR +#endif #endif !! WRITE(NDSM) & @@ -919,12 +1065,12 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) READ(NDSM,END=801,ERR=802,IOSTAT=IERR)GRIDSHIFT #ifdef W3_SEC1 - READ (NDSM) NITERSEC1 + READ (NDSM,END=801,ERR=802,IOSTAT=IERR) NITERSEC1 #endif ! #ifdef W3_RTD !! Read rotated Polat/lon and AnglD from mod_def JGLi12Jun2012 - READ (NDSM) PoLat, PoLon, AnglD, FLAGUNR + READ (NDSM,END=801,ERR=802,IOSTAT=IERR) PoLat, PoLon, AnglD, FLAGUNR #endif ! @@ -977,6 +1123,15 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) MAPWN, MAPTH, DTH, TH, ESIN, ECOS, ES2, ESC, EC2, & XFR, FR1, SIG, SIG2, DSIP, DSII, DDEN, DDEN2, FTE, & FTF, FTWN, FTTR, FTWL, FACTI1, FACTI2, FACHFA, FACHFE +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'MAPWN, MAPTH, DTH, TH, ESIN, ECOS, ES2, ESC, EC2, & + XFR, FR1, SIG, SIG2, DSIP, DSII, DDEN, DDEN2, FTE, & + FTF, FTWN, FTTR, FTWL, FACTI1, FACTI2, FACHFA, FACHFE:', & + MAPWN, MAPTH, DTH, TH, ESIN, ECOS, ES2, ESC, EC2, & + XFR, FR1, SIG, SIG2, DSIP, DSII, DDEN, DDEN2, FTE, & + FTF, FTWN, FTTR, FTWL, FACTI1, FACTI2, FACHFA, FACHFE +#endif ELSE IF (.NOT.SINIT) CALL W3DIMS ( IGRD, NK, NTH, NDSE, NDST ) READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & @@ -999,6 +1154,11 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) IF ( WRITE ) THEN WRITE (NDSM) & E3DF, P2MSF, US3DF,USSPF, USSP_WN +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'E3DF, P2MSF, US3DF,USSPF, USSP_WN:', & + E3DF, P2MSF, US3DF,USSPF, USSP_WN +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & E3DF, P2MSF, US3DF,USSPF, USSP_WN @@ -1015,6 +1175,11 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) IF ( WRITE ) THEN WRITE (NDSM) & XBPO, YBPO, RDBPO, IPBPO, ISBPO +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'XBPO, YBPO, RDBPO, IPBPO, ISBPO:', & + XBPO, YBPO, RDBPO, IPBPO, ISBPO +#endif ELSE CALL W3DMO5 ( IGRD, NDSE, NDST, 2 ) READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & @@ -1040,6 +1205,13 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) WRITE (NDSM) & IHMAX, HSPMIN, WSMULT, WSCUT, FLCOMB, NOSWLL, & PTMETH, PTFCUT +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'IHMAX, HSPMIN, WSMULT, WSCUT, FLCOMB, NOSWLL, & + PTMETH, PTFCUT:', & + IHMAX, HSPMIN, WSMULT, WSCUT, FLCOMB, NOSWLL, & + PTMETH, PTFCUT +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & IHMAX, HSPMIN, WSMULT, WSCUT, FLCOMB, NOSWLL, & @@ -1057,72 +1229,119 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) WRITE (NDSM) & FACP, XREL, XFLT, FXFM, FXPM, XFT, XFC, FACSD, FHMAX, & FFACBERG, DELAB, FWTABLE +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'FACP, XREL, XFLT, FXFM, FXPM, XFT, XFC, FACSD, FHMAX, & + FFACBERG, DELAB, FWTABLE:', & + FACP, XREL, XFLT, FXFM, FXPM, XFT, XFC, FACSD, FHMAX, & + FFACBERG, DELAB, FWTABLE +#endif #ifdef W3_RWND WRITE (NDSM) & RWINDC +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'RWINDC:', & + RWINDC +#endif #endif #ifdef W3_WCOR WRITE (NDSM) & WWCOR +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'WWCOR:', & + WWCOR +#endif #endif #ifdef W3_REF1 WRITE (NDSM) & RREF, REFPARS, REFLC, REFLD +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'RREF, REFPARS, REFLC, REFLD:', & + RREF, REFPARS, REFLC, REFLD +#endif #endif #ifdef W3_IG1 WRITE (NDSM) & IGPARS(1:12) +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'IGPARS(1:12):', & + IGPARS(1:12) +#endif #endif #ifdef W3_IC2 WRITE (NDSM) & IC2PARS(1:8) +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'IC2PARS(1:8):', & + IC2PARS(1:8) +#endif #endif #ifdef W3_IC3 WRITE (NDSM) & IC3PARS +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'IC3PARS:', & + IC3PARS +#endif #endif #ifdef W3_IC4 WRITE (NDSM) & - IC4PARS,IC4_KI,IC4_FC + IC4PARS,IC4_KI,IC4_FC,IC4_CN,IC4_FMIN,IC4_KIBK +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'IC4PARS,IC4_KI,IC4_FC,IC4_CN,IC4_FMIN,IC4_KIBK:', & + IC4PARS,IC4_KI,IC4_FC,IC4_CN,IC4_FMIN,IC4_KIBK +#endif #endif #ifdef W3_IC5 WRITE (NDSM) & IC5PARS +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'IC5PARS:', & + IC5PARS +#endif #endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & FACP, XREL, XFLT, FXFM, FXPM, XFT, XFC, FACSD, FHMAX, & FFACBERG, DELAB, FWTABLE #ifdef W3_RWND - READ (NDSM) & + READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & RWINDC #endif #ifdef W3_WCOR - READ (NDSM) & + READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & WWCOR #endif #ifdef W3_REF1 - READ (NDSM) & + READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & RREF, REFPARS, REFLC, REFLD #endif #ifdef W3_IG1 - READ (NDSM) & + READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & IGPARS(1:12) #endif #ifdef W3_IC2 - READ (NDSM) & + READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & IC2PARS(1:8) #endif #ifdef W3_IC3 - READ (NDSM) & + READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & IC3PARS #endif #ifdef W3_IC4 - READ (NDSM) & - IC4PARS,IC4_KI,IC4_FC + READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & + IC4PARS,IC4_KI,IC4_FC,IC4_CN,IC4_FMIN,IC4_KIBK #endif #ifdef W3_IC5 - READ (NDSM) & + READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & IC5PARS #endif END IF @@ -1142,6 +1361,10 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #ifdef W3_FLX2 IF ( WRITE ) THEN WRITE (NDSM) NITTIN, CINXSI +#ifdef W3_ASCII + WRITE (NDSA,*)' NITTIN, CINXSI:', & + NITTIN, CINXSI +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) NITTIN, CINXSI END IF @@ -1152,6 +1375,11 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) IF ( WRITE ) THEN WRITE (NDSM) & NITTIN, CINXSI, CD_MAX, CAP_ID +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'NITTIN, CINXSI, CD_MAX, CAP_ID:', & + NITTIN, CINXSI, CD_MAX, CAP_ID +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & NITTIN, CINXSI, CD_MAX, CAP_ID @@ -1162,6 +1390,10 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #ifdef W3_FLX4 IF ( WRITE ) THEN WRITE (NDSM) FLX4A0 +#ifdef W3_ASCII + WRITE (NDSA,*)' FLX4A0:', & + FLX4A0 +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) FLX4A0 END IF @@ -1171,6 +1403,10 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #ifdef W3_LN1 IF ( WRITE ) THEN WRITE (NDSM) SLNC1, FSPM, FSHF +#ifdef W3_ASCII + WRITE (NDSA,*)' SLNC1, FSPM, FSHF:', & + SLNC1, FSPM, FSHF +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) SLNC1, FSPM, FSHF END IF @@ -1180,6 +1416,10 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #ifdef W3_ST1 IF ( WRITE ) THEN WRITE (NDSM) SINC1, SDSC1 +#ifdef W3_ASCII + WRITE (NDSA,*)' SINC1, SDSC1:', & + SINC1, SDSC1 +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) SINC1, SDSC1 END IF @@ -1193,6 +1433,17 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) SHSTAB, OFSTAB, CCNG, CCPS, FFNG, FFPS, & CDSA0, CDSA1, CDSA2, SDSALN, & CDSB0, CDSB1, CDSB2, CDSB3, FPIMIN, XFH, XF1, XF2 +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'ZWIND, FSWELL, & + SHSTAB, OFSTAB, CCNG, CCPS, FFNG, FFPS, & + CDSA0, CDSA1, CDSA2, SDSALN, & + CDSB0, CDSB1, CDSB2, CDSB3, FPIMIN, XFH, XF1, XF2:',& + ZWIND, FSWELL, & + SHSTAB, OFSTAB, CCNG, CCPS, FFNG, FFPS, & + CDSA0, CDSA1, CDSA2, SDSALN, & + CDSB0, CDSB1, CDSB2, CDSB3, FPIMIN, XFH, XF1, XF2 +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & ZWIND, FSWELL, & @@ -1216,6 +1467,19 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) SSTXFTFTAIL, SSTXFTWN, & DDELTA1, DDELTA2, SSTXFTF, SSTXFTWN, & FFXPM, FFXFM +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'ZZWND, AALPHA, ZZ0MAX, BBETA, SSINTHP, ZZALP, & + SSWELLF, SSDSC1, WWNMEANP, WWNMEANPTAIL, SSTXFTF, & + SSTXFTFTAIL, SSTXFTWN, & + DDELTA1, DDELTA2, SSTXFTF, SSTXFTWN, & + FFXPM, FFXFM:', & + ZZWND, AALPHA, ZZ0MAX, BBETA, SSINTHP, ZZALP, & + SSWELLF, SSDSC1, WWNMEANP, WWNMEANPTAIL, SSTXFTF, & + SSTXFTFTAIL, SSTXFTWN, & + DDELTA1, DDELTA2, SSTXFTF, SSTXFTWN, & + FFXPM, FFXFM +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & ZZWND, AALPHA, ZZ0MAX, BBETA, SSINTHP, ZZALP, & @@ -1242,10 +1506,46 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) SSTXFTFTAIL, SSTXFTWN, SSTXFTF, SSTXFTWN, & SSDSBRF1, SSDSBRF2, SSDSBRFDF,SSDSBCK, SSDSABK, & SSDSPBK, SSDSBINT, FFXPM, FFXFM, FFXFA, & - SSDSHCK, DELUST, DELTAIL, DELTAUW, & - DELU, DELALP, TAUT, TAUHFT, TAUHFT2, & + SSDSHCK, & IKTAB, DCKI, QBI, SATINDICES, SATWEIGHTS, & - DIKCUMUL, CUMULW + DIKCUMUL, CUMULW, SINTAILPAR +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'ZZWND, AALPHA, ZZ0MAX, BBETA, SSINTHP, ZZALP, & + TTAUWSHELTER, SSWELLFPAR, SSWELLF, SSINBR, & + ZZ0RAT, SSDSC, & + SSDSISO, SSDSBR, SSDSBT, SSDSBM, SSDSP, & + SSDSCOS, SSDSDTH, WWNMEANP, WWNMEANPTAIL,SSTXFTF, & + SSTXFTFTAIL, SSTXFTWN, SSTXFTF, SSTXFTWN, & + SSDSBRF1, SSDSBRF2, SSDSBRFDF,SSDSBCK, SSDSABK, & + SSDSPBK, SSDSBINT, FFXPM, FFXFM, FFXFA, & + SSDSHCK, & + IKTAB, DCKI, QBI, SATINDICES, SATWEIGHTS, & + DIKCUMUL, CUMULW, SINTAILPAR:', & + ZZWND, AALPHA, ZZ0MAX, BBETA, SSINTHP, ZZALP, & + TTAUWSHELTER, SSWELLFPAR, SSWELLF, SSINBR, & + ZZ0RAT, SSDSC, & + SSDSISO, SSDSBR, SSDSBT, SSDSBM, SSDSP, & + SSDSCOS, SSDSDTH, WWNMEANP, WWNMEANPTAIL,SSTXFTF, & + SSTXFTFTAIL, SSTXFTWN, SSTXFTF, SSTXFTWN, & + SSDSBRF1, SSDSBRF2, SSDSBRFDF,SSDSBCK, SSDSABK, & + SSDSPBK, SSDSBINT, FFXPM, FFXFM, FFXFA, & + SSDSHCK, & + IKTAB, DCKI, QBI, SATINDICES, SATWEIGHTS, & + DIKCUMUL, CUMULW, SINTAILPAR +#endif + IF (SINTAILPAR(1).GT.0.5) THEN + WRITE (NDSM) DELUST, DELTAIL, DELTAUW, DELU, DELALP, & + TAUT, TAUHFT + IF (TTAUWSHELTER.GT.0) WRITE (NDSM) TAUHFT2 +#ifdef W3_ASCII + WRITE (NDSA,*) 'DELUST, DELTAIL, DELTAUW, DELU, DELALP,& + TAUT, TAUHFT:', & + DELUST, DELTAIL, DELTAUW, DELU, DELALP, & + TAUT, TAUHFT + IF (TTAUWSHELTER.GT.0) WRITE (NDSA,*) 'TAUHFT2:', TAUHFT2 +#endif + END IF ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & ZZWND, AALPHA, ZZ0MAX, BBETA, SSINTHP, ZZALP, & @@ -1256,10 +1556,16 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) SSTXFTFTAIL, SSTXFTWN, SSTXFTF, SSTXFTWN, & SSDSBRF1, SSDSBRF2, SSDSBRFDF,SSDSBCK, SSDSABK, & SSDSPBK, SSDSBINT, FFXPM, FFXFM, FFXFA, & - SSDSHCK, DELUST, DELTAIL, DELTAUW, & - DELU, DELALP, TAUT, TAUHFT, TAUHFT2, & + SSDSHCK, & IKTAB, DCKI, QBI, SATINDICES, SATWEIGHTS, & - DIKCUMUL, CUMULW + DIKCUMUL, CUMULW, SINTAILPAR + IF (SINTAILPAR(1).GT.0.5) THEN + CALL INSIN4(.FALSE.) + READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & + DELUST, DELTAIL, DELTAUW, DELU, DELALP, & + TAUT, TAUHFT + IF (TTAUWSHELTER.GT.0) READ(NDSM,END=801,ERR=802,IOSTAT=IERR) TAUHFT2 + END IF END IF #endif ! @@ -1268,6 +1574,14 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) WRITE (NDSM) SIN6A0, SDS6ET, SDS6A1, SDS6A2, & SDS6P1, SDS6P2, SWL6S6, SWL6B1, SWL6CSTB1, & SIN6WS, SIN6FC +#ifdef W3_ASCII + WRITE (NDSA,*) 'SIN6A0, SDS6ET, SDS6A1, SDS6A2, & + SDS6P1, SDS6P2, SWL6S6, SWL6B1, SWL6CSTB1, & + SIN6WS, SIN6FC:', & + SIN6A0, SDS6ET, SDS6A1, SDS6A2, & + SDS6P1, SDS6P2, SWL6S6, SWL6B1, SWL6CSTB1, & + SIN6WS, SIN6FC +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & SIN6A0, SDS6ET, SDS6A1, SDS6A2, & @@ -1281,19 +1595,40 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #ifdef W3_NL1 IF ( WRITE ) THEN WRITE (NDSM) & - SNLC1, LAM, KDCON, KDMN, SNLS1, SNLS2, SNLS3 + SNLC1, LAM, KDCON, KDMN, SNLS1, SNLS2, SNLS3, & + IQTPE, NLTAIL, GQNF1, GQNT1, & + GQNQ_OM2, GQTHRSAT, GQTHRCOU, GQAMP +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'SNLC1, LAM, KDCON, KDMN, SNLS1, SNLS2, SNLS3, & + IQTPE, NLTAIL, GQNF1, GQNT1, & + GQNQ_OM2, GQTHRSAT, GQTHRCOU, GQAMP:', & + SNLC1, LAM, KDCON, KDMN, SNLS1, SNLS2, SNLS3, & + IQTPE, NLTAIL, GQNF1, GQNT1, & + GQNQ_OM2, GQTHRSAT, GQTHRCOU, GQAMP +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & - SNLC1, LAM, KDCON, KDMN, SNLS1, SNLS2, SNLS3 + SNLC1, LAM, KDCON, KDMN, SNLS1, SNLS2, SNLS3, & + IQTPE, NLTAIL, GQNF1, GQNT1, & + GQNQ_OM2, GQTHRSAT, GQTHRCOU, GQAMP END IF IF ( FLTEST ) WRITE (NDST,9051) SNLC1, LAM, & - KDCON, KDMN, SNLS1, SNLS2, SNLS3 + KDCON, KDMN, SNLS1, SNLS2, SNLS3, & + IQTPE, NLTAIL, GQNF1, GQNT1, GQNQ_OM2, & + GQTHRSAT, GQTHRCOU, GQAMP #endif ! #ifdef W3_NL2 IF ( WRITE ) THEN WRITE (NDSM) IQTPE, NLTAIL, NDPTHS WRITE (NDSM) DPTHNL +#ifdef W3_ASCII + WRITE (NDSA,*) 'IQTPE, NLTAIL, NDPTHS:', & + IQTPE, NLTAIL, NDPTHS + WRITE (NDSA,*) 'DPTHNL:', & + DPTHNL +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & IQTPE, NLTAIL, NDPTHS @@ -1312,6 +1647,16 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) WRITE (NDSM) SNLL(1:SNLNQ), SNLM(1:SNLNQ), & SNLT(1:SNLNQ), SNLCD(1:SNLNQ), & SNLCS(1:SNLNQ) +#ifdef W3_ASCII + WRITE (NDSA,*) 'SNLNQ, SNLMSC, SNLNSC, SNLSFD, SNLSFS:',& + SNLNQ, SNLMSC, SNLNSC, SNLSFD, SNLSFS + WRITE (NDSA,*) 'SNLL(1:SNLNQ), SNLM(1:SNLNQ), & + SNLT(1:SNLNQ), SNLCD(1:SNLNQ), & + SNLCS(1:SNLNQ):', & + SNLL(1:SNLNQ), SNLM(1:SNLNQ), & + SNLT(1:SNLNQ), SNLCD(1:SNLNQ), & + SNLCS(1:SNLNQ) +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & SNLNQ, SNLMSC, SNLNSC, SNLSFD, SNLSFS @@ -1342,6 +1687,10 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #ifdef W3_NL4 IF ( WRITE ) THEN WRITE (NDSM) ITSA, IALT +#ifdef W3_ASCII + WRITE (NDSA,*) 'ITSA, IALT:', & + ITSA, IALT +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & ITSA, IALT @@ -1355,6 +1704,12 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) CALL INSNL5 WRITE (NDSM) QR5DPT, QR5OML, QI5DIS, QI5KEV, & QI5NNZ, QI5IPL, QI5PMX +#ifdef W3_ASCII + WRITE (NDSA,*) 'QR5DPT, QR5OML, QI5DIS, QI5KEV, & + QI5NNZ, QI5IPL, QI5PMX:', & + QR5DPT, QR5OML, QI5DIS, QI5KEV, & + QI5NNZ, QI5IPL, QI5PMX +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & QR5DPT, QR5OML, QI5DIS, QI5KEV, & @@ -1369,6 +1724,11 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) IF ( WRITE ) THEN WRITE (NDSM) & CNLSA, CNLSC, CNLSFM, CNLSC1, CNLSC2, CNLSC3 +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'CNLSA, CNLSC, CNLSFM, CNLSC1, CNLSC2, CNLSC3:', & + CNLSA, CNLSC, CNLSFM, CNLSC1, CNLSC2, CNLSC3 +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & CNLSA, CNLSC, CNLSFM, CNLSC1, CNLSC2, CNLSC3 @@ -1378,7 +1738,13 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #endif ! #ifdef W3_NL1 - IF ( .NOT. WRITE ) CALL INSNL1 ( IGRD ) + IF ( .NOT. WRITE ) THEN + IF (IQTPE.GT.0) THEN + CALL INSNL1 ( IGRD ) + ELSE + CALL INSNLGQM + END IF + END IF #endif #ifdef W3_NL3 IF ( .NOT. WRITE ) CALL INSNL3 @@ -1412,6 +1778,9 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #ifdef W3_BT1 IF ( WRITE ) THEN WRITE (NDSM) SBTC1 +#ifdef W3_ASCII + WRITE (NDSA,*) 'SBTC1:', SBTC1 +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) SBTC1 END IF @@ -1423,6 +1792,11 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) IF ( WRITE ) THEN WRITE (NDSM) & SBTCX, SED_D50, SED_PSIC +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'SBTCX, SED_D50, SED_PSIC:', & + SBTCX, SED_D50, SED_PSIC +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & SBTCX, SED_D50, SED_PSIC @@ -1436,6 +1810,11 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) IF ( WRITE ) THEN WRITE (NDSM) & SDBC1, SDBC2, FDONLY +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'SDBC1, SDBC2, FDONLY:', & + SDBC1, SDBC2, FDONLY +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & SDBC1, SDBC2, FDONLY @@ -1448,6 +1827,12 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) IF ( WRITE ) THEN WRITE (NDSM) UOSTFILELOCAL, UOSTFILESHADOW, & UOSTFACTORLOCAL, UOSTFACTORSHADOW +#ifdef W3_ASCII + WRITE (NDSA,*) 'UOSTFILELOCAL, UOSTFILESHADOW, & + UOSTFACTORLOCAL, UOSTFACTORSHADOW:', & + UOSTFILELOCAL, UOSTFILESHADOW, & + UOSTFACTORLOCAL, UOSTFACTORSHADOW +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & UOSTFILELOCAL, UOSTFILESHADOW, & @@ -1464,6 +1849,9 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #ifdef W3_IS1 IF ( WRITE ) THEN WRITE (NDSM) IS1C1, IS1C2 +#ifdef W3_ASCII + WRITE (NDSA,*) 'IS1C1, IS1C2:', IS1C1, IS1C2 +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) IS1C1, IS1C2 END IF @@ -1472,6 +1860,9 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #ifdef W3_IS2 IF ( WRITE ) THEN WRITE (NDSM) IS2PARS +#ifdef W3_ASCII + WRITE (NDSA,*) 'IS3PARS:', IS2PARS +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) IS2PARS IF ( .NOT. FLIS ) THEN @@ -1487,6 +1878,9 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #ifdef W3_PR2 IF ( WRITE ) THEN WRITE (NDSM) DTME, CLATMN +#ifdef W3_ASCII + WRITE (NDSA,*) 'DTME, CLATMN:', DTME, CLATMN +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & DTME, CLATMN @@ -1498,6 +1892,9 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #ifdef W3_PR3 IF ( WRITE ) THEN WRITE (NDSM) WDCG, WDTH +#ifdef W3_ASCII + WRITE (NDSA,*) 'WDCG, WDTH:', WDCG, WDTH +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & WDCG, WDTH @@ -1509,6 +1906,10 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #ifdef W3_SMC IF ( WRITE ) THEN WRITE(NDSM) DTMS, Refran, FUNO3, FVERG, FSWND, ARCTC +#ifdef W3_ASCII + WRITE(NDSA,*) 'DTMS, Refran, FUNO3, FVERG, FSWND, ARCTC:', & + DTMS, Refran, FUNO3, FVERG, FSWND, ARCTC +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & DTMS, Refran, FUNO3, FVERG, FSWND, ARCTC @@ -1520,6 +1921,10 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #ifdef W3_FLD1 IF ( WRITE ) THEN WRITE (NDSM) TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2 +#ifdef W3_ASCII + WRITE (NDSA,*) 'TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2:', & + TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2 +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2 @@ -1528,6 +1933,10 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #ifdef W3_FLD2 IF ( WRITE ) THEN WRITE (NDSM) TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2 +#ifdef W3_ASCII + WRITE (NDSA,*) 'TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2:', & + TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2 +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2 @@ -1546,6 +1955,11 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) END IF ! CLOSE ( NDSM ) +#ifdef W3_ASCII + IF ( WRITE ) THEN + CLOSE ( NDSA ) + END IF +#endif call print_memcheck(memunit, 'memcheck_____:'//' WIOGR SECTION 9') ! RETURN diff --git a/model/src/w3iopomd.F90 b/model/src/w3iopomd.F90 index 802685869..0c15ea8c6 100644 --- a/model/src/w3iopomd.F90 +++ b/model/src/w3iopomd.F90 @@ -1023,18 +1023,86 @@ SUBROUTINE W3IOPE ( A ) !/ End of W3IOPE ----------------------------------------------------- / !/ END SUBROUTINE W3IOPE - !/ ------------------------------------------------------------------- / + + !> Read or write point output. !> - !> @brief Read/write point output. + !> This subroutine can either read or write the point output file, + !> depending on the value of the first parameter. !> - !> @param[in] INXOUT Test string for read/write. - !> @param[in] NDSOP File unit number. - !> @param[out] IOTST Test indictor for reading. - !> @param[in] IMOD Model number for W3GDAT etc. + !> When reading, the entire file is read with one call to this + !> subroutine. !> - !> @author H. L. Tolman @date 25-Jul-2006 + !> When writing, this subroutine can either write one timestep or + !> the whole model run. This is an option in the input file. If the + !> entire model run is to be written, then OFILES(2) is 0. If only + !> one timestep is to be written, then OFILES(2) is 1. + !> + !> If OFILES(2) is 0, the output file is names out_pnt.ww3. If + !> OFILES(2) is 1, the output file is named TIMETAG.out_pnt.ww3. + !> + !> The format of the point output file is: + !> Size (bytes) | Type | Variable | Meaning + !> -------------|------|----------|-------- + !> 40 | character*40 | IDTST | ID string + !> 4 | integer | VERTST | Model definition file version number + !> 4 | integer | NK | Dimension of frequency + !> 4 | integer | MTH | Directionality of the frequency + !> 4 | integer | NOPTS | Number of output points. + !> 8*NOPTS | integer(2,NOPTS) | PTLOC | Point locations + !> 7*NOPTS | character*7 | PTNME | Point names + !> 8 | integer(2) | TIME | Time + !> reclen*NOPTS | * | * | records + !> + !> Each record contains: + !> Size (bytes) | Type | Variable | Meaning + !> -------------|------|----------|-------- + !> 4 | integer | IW | Number of water points in interpolation box for output point. + !> 4 | integer | II | Number of ice points in interpolation box for output point. + !> 4 | integer | IL | Number of land points in interpolation box for output point. + !> 4 | real | DPO | Interpolated depths. + !> 4 | real | WAO | Interpolated wind speeds. + !> 4 | real | WDO | Interpolated wind directions. + !> 4 | real | TAUAO | (W3_FLX5 only) Interpolated atmospheric stresses. + !> 4 | real | TAUDO | (W3_FLX5 only) Interpolated atmospheric stress directions. + !> 4 | real | DAIRO | (W3_FLX5 only) Interpolated rho atmosphere. + !> 4 | real | ZET_SETO | (W3_SETUP only) Used for wave setup. + !> 4 | real | ASO | Interpolated air-sea temperature difference + !> 4 | real | CAO | Interpolated current speeds. + !> 4 | real | CDO | Interpolated current directions. + !> 4 | real | ICEO | Interpolated ice concentration. + !> 4 | real | ICEHO | Interpolated ice thickness. + !> 4 | real | ICEFO | Interpolated ice floe. + !> 13 | char | GRDID | Originating grid ID + !> 4 | real | SPCO(J,I),J=1,NSPEC | Output spectra + !> + !> In the event of error, EXTCDE() will be called with the following exit codes: + !> - 1 INXOUT must be 'READ' or 'WRITE'. + !> - 2 Unexpectedly changed from WRITE to READ in subsequent call. + !> - 10 Unexpected IDSTR + !> - 11 Unexpected VEROPT + !> - 12 Unexpected MK or MTH + !> - 20 Error opening file. + !> - 21 Unexpected end of file during read. + !> - 22 Error reading file. + !> - 23 Unexpected end of file during read. + !> + !> @param[in] INXOUT String indicating read/write. Must be 'READ' or + !> 'WRITE'. + !> @param[in] NDSOP File unit number. + !> @param[out] IOTST Error code: + !> - 0 No error. + !> - -1 Unexpected end of file when reading. + !> @param[in] IMOD Model number for W3GDAT etc. +#ifdef W3_ASCII + !> @param[in] NDSOA File unit number for ASCII output. +#endif !> - SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD ) + !> @author H. L. Tolman @date 25-Jul-2006 + SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD & +#ifdef W3_ASCII + ,NDSOA & +#endif + ) !/ !/ +-----------------------------------+ !/ | WAVEWATCH III NOAA/NCEP | @@ -1062,7 +1130,8 @@ SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD ) ! ---------------------------------------------------------------- ! INXOUT C*(*) I Test string for read/write, valid are: ! 'READ' and 'WRITE'. - ! NDSOP Int. I File unit number. + ! NDSOP Int. I File unit number. for binary + ! NDSOA Int. I File unit number. for ASCII ! IOTST Int. O Test indictor for reading. ! 0 : Data read. ! -1 : Past end of file. @@ -1140,6 +1209,9 @@ SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD ) !/ Parameter list !/ INTEGER, INTENT(IN) :: NDSOP +#ifdef W3_ASCII + INTEGER, INTENT(IN), OPTIONAL :: NDSOA +#endif INTEGER, INTENT(OUT) :: IOTST INTEGER, INTENT(IN), OPTIONAL :: IMOD CHARACTER, INTENT(IN) :: INXOUT*(*) @@ -1205,6 +1277,10 @@ SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD ) IF ( WRITE ) THEN OPEN (NDSOP,FILE=FNMPRE(:J)//'out_pnt.'//FILEXT(:I), & form='UNFORMATTED', convert=file_endian,ERR=800,IOSTAT=IERR) +#ifdef W3_ASCII + OPEN (NDSOA,FILE=FNMPRE(:J)//'out_pnt.'//FILEXT(:I)//'.txt', & + form='FORMATTED', ERR=800,IOSTAT=IERR) +#endif ELSE OPEN (NDSOP,FILE=FNMPRE(:J)//'out_pnt.'//FILEXT(:I), & form='UNFORMATTED', convert=file_endian,ERR=800,IOSTAT=IERR,STATUS='OLD') @@ -1218,6 +1294,11 @@ SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD ) IF ( WRITE ) THEN WRITE (NDSOP) & IDSTR, VEROPT, NK, NTH, NOPTS +#ifdef W3_ASCII + WRITE (NDSOA,*) & + 'IDSTR, VEROPT, NK, NTH, NOPTS:', & + IDSTR, VEROPT, NK, NTH, NOPTS +#endif ELSE READ (NDSOP,END=801,ERR=802,IOSTAT=IERR) & IDTST, VERTST, MK, MTH, NOPTS @@ -1248,6 +1329,11 @@ SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD ) IF ( WRITE ) THEN WRITE (NDSOP) & ((PTLOC(J,I),J=1,2),I=1,NOPTS), (PTNME(I),I=1,NOPTS) +#ifdef W3_ASCII + WRITE (NDSOA,*) & + '((PTLOC(J,I),J=1,2),I=1,NOPTS), (PTNME(I),I=1,NOPTS):', & + ((PTLOC(J,I),J=1,2),I=1,NOPTS), (PTNME(I),I=1,NOPTS) +#endif ELSE READ (NDSOP,END=801,ERR=802,IOSTAT=IERR) & ((PTLOC(J,I),J=1,2),I=1,NOPTS), (PTNME(I),I=1,NOPTS) @@ -1289,6 +1375,10 @@ SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD ) IF ( WRITE ) THEN OPEN (NDSOP,FILE=FNMPRE(:J)//TIMETAG//'.out_pnt.' & //FILEXT(:I),form='UNFORMATTED', convert=file_endian,ERR=800,IOSTAT=IERR) +#ifdef W3_ASCII + OPEN (NDSOA,FILE=FNMPRE(:J)//TIMETAG//'.out_pnt.' & + //FILEXT(:I)//'.txt',form='FORMATTED', ERR=800,IOSTAT=IERR) +#endif END IF ! REWIND ( NDSOP ) @@ -1300,6 +1390,11 @@ SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD ) IF ( WRITE ) THEN WRITE (NDSOP) & IDSTR, VEROPT, NK, NTH, NOPTS +#ifdef W3_ASCII + WRITE (NDSOA,*) & + 'IDSTR, VEROPT, NK, NTH, NOPTS:', & + IDSTR, VEROPT, NK, NTH, NOPTS +#endif ELSE READ (NDSOP,END=801,ERR=802,IOSTAT=IERR) & IDTST, VERTST, MK, MTH, NOPTS @@ -1330,6 +1425,11 @@ SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD ) IF ( WRITE ) THEN WRITE (NDSOP) & ((PTLOC(J,I),J=1,2),I=1,NOPTS), (PTNME(I),I=1,NOPTS) +#ifdef W3_ASCII + WRITE (NDSOA,*) & + '((PTLOC(J,I),J=1,2),I=1,NOPTS), (PTNME(I),I=1,NOPTS):', & + ((PTLOC(J,I),J=1,2),I=1,NOPTS), (PTNME(I),I=1,NOPTS) +#endif ELSE READ (NDSOP,END=801,ERR=802,IOSTAT=IERR) & ((PTLOC(J,I),J=1,2),I=1,NOPTS), (PTNME(I),I=1,NOPTS) @@ -1349,6 +1449,9 @@ SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD ) ! IF ( WRITE ) THEN WRITE (NDSOP) TIME +#ifdef W3_ASCII + WRITE (NDSOA,*) 'TIME:', TIME +#endif ELSE READ (NDSOP,END=803,ERR=802,IOSTAT=IERR) TIME END IF @@ -1378,6 +1481,23 @@ SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD ) #endif ASO(I), CAO(I), CDO(I), ICEO(I), ICEHO(I), & ICEFO(I), GRDID(I), (SPCO(J,I),J=1,NSPEC) +#ifdef W3_ASCII + WRITE (NDSOA,*) & + 'IW(I), II(I), IL(I), DPO(I), WAO(I), WDO(I):', & + IW(I), II(I), IL(I), DPO(I), WAO(I), WDO(I), & +#ifdef W3_FLX5 + 'TAUAO(I), TAUDO(I), DAIRO(I):', & + TAUAO(I), TAUDO(I), DAIRO(I), & +#endif +#ifdef W3_SETUP + 'ZET_SETO(I):', & + ZET_SETO(I), & +#endif + 'ASO(I), CAO(I), CDO(I), ICEO(I), ICEHO(I):', & + ASO(I), CAO(I), CDO(I), ICEO(I), ICEHO(I), & + 'ICEFO(I), GRDID(I), (SPCO(J,I),J=1,NSPEC):', & + ICEFO(I), GRDID(I), (SPCO(J,I),J=1,NSPEC) +#endif ELSE READ (NDSOP,END=801,ERR=802,IOSTAT=IERR) & IW(I), II(I), IL(I), DPO(I), WAO(I), WDO(I), & diff --git a/model/src/w3iorsmd.F90 b/model/src/w3iorsmd.F90 index 3bd2aa4ea..05f7e9163 100644 --- a/model/src/w3iorsmd.F90 +++ b/model/src/w3iorsmd.F90 @@ -628,7 +628,7 @@ SUBROUTINE W3IORS ( INXOUT, NDSR, DUMFPI, IMOD, FLRSTRT ) ! Original non-server version writing of spectra ! IF ( .NOT.IOSFLG .OR. (NAPROC.EQ.1.AND.NAPRST.EQ.1) ) THEN -#ifdef W3_MPI +#ifdef W3_MPI DO JSEA=1, NSEAL CALL INIT_GET_ISEA(ISEA, JSEA) NREC = ISEA + 2 @@ -637,7 +637,7 @@ SUBROUTINE W3IORS ( INXOUT, NDSR, DUMFPI, IMOD, FLRSTRT ) WRITEBUFF(1:NSPEC) = VA(1:NSPEC,JSEA) WRITE (NDSR,POS=RPOS,ERR=803,IOSTAT=IERR) WRITEBUFF END DO -#else +#else DO JSEA=1, NSEA ISEA = JSEA NREC = ISEA + 2 @@ -646,7 +646,7 @@ SUBROUTINE W3IORS ( INXOUT, NDSR, DUMFPI, IMOD, FLRSTRT ) WRITEBUFF(1:NSPEC) = VA(1:NSPEC,JSEA) WRITE (NDSR,POS=RPOS,ERR=803,IOSTAT=IERR) WRITEBUFF END DO -#endif +#endif ! ! I/O server version writing of spectra ( !/MPI ) ! diff --git a/model/src/w3odatmd.F90 b/model/src/w3odatmd.F90 index 927de88c5..b3da6aa2f 100644 --- a/model/src/w3odatmd.F90 +++ b/model/src/w3odatmd.F90 @@ -440,7 +440,7 @@ MODULE W3ODATMD INTEGER :: TOSNL5(2) #endif INTEGER :: TOFRST(2), TONEXT(2,8), TOLAST(2,8), & - TBPI0(2), TBPIN(2), NDS(13), OFILES(7) + TBPI0(2), TBPIN(2), NDS(15), OFILES(7) REAL :: DTOUT(8) LOGICAL :: FLOUT(8) TYPE(OTYPE1) :: OUT1 @@ -899,13 +899,14 @@ SUBROUTINE W3NOUT ( NDSERR, NDSTST ) ! ! 8) Spectrum parameters ! - NOGE(8) = 5 + NOGE(8) = 6 ! IDOUT( 8, 1) = 'Mean square slopes ' IDOUT( 8, 2) = 'Phillips tail const' IDOUT( 8, 3) = 'Slope direction ' IDOUT( 8, 4) = 'Tail slope direction' IDOUT( 8, 5) = 'Goda peakedness parm' + IDOUT( 8, 6) = 'kxky-peakdness ' ! IDOUT( 8, 3) = 'Lx-Ly mean wvlength' ! IDOUT( 8, 4) = 'Surf grad correl XT' ! IDOUT( 8, 5) = 'Surf grad correl YT' diff --git a/model/src/w3ounfmetamd.F90 b/model/src/w3ounfmetamd.F90 index e600b311b..2afd16686 100644 --- a/model/src/w3ounfmetamd.F90 +++ b/model/src/w3ounfmetamd.F90 @@ -3381,7 +3381,7 @@ SUBROUTINE DEFAULT_META() ! IFI=5, IFJ=1, UST META => GROUP(5)%FIELD(1)%META ! First component - META(1)%FSC = 0.01 + META(1)%FSC = 0.001 META(1)%ENAME = '.ust' META(1)%UNITS = 'm s-1' META(1)%VARNM='uust' @@ -4046,6 +4046,19 @@ SUBROUTINE DEFAULT_META() META(1)%VARNC='Goda wave peakedness parameter' META(1)%VMIN = 0 META(1)%VMAX = 32 + ! IFI=8, IFJ=6, QKK + META => GROUP(8)%FIELD(6)%META + META(1)%FSC = 0.05 + META(1)%UNITS = 'm/rad' + META(1)%ENAME = '.qkk' + META(1)%VARNM='qkk' + META(1)%VARNL='k-peakedness' + !META(1)%VARNS='sea_surface_wave_peakedness' + META(1)%VARNS='' + META(1)%VARNG='wavenumber_peakedness' + META(1)%VARNC='2D wavenumber peakedness' + META(1)%VMIN = 0 + META(1)%VMAX = 1600 ! !---------- GROUP 9 ---------------- ! diff --git a/model/src/w3parall.F90 b/model/src/w3parall.F90 index 798e989cb..e2aba9b52 100644 --- a/model/src/w3parall.F90 +++ b/model/src/w3parall.F90 @@ -1,3 +1,24 @@ +!> @file +!> @brief Parallel routines for implicit solver. +!> +!> @author Aron Roland +!> @author Mathieu Dutour-Sikiric +!> @date 01-Jun-2018 +!> + +!/ ------------------------------------------------------------------- / +!> +!> @brief Parallel routines for implicit solver. +!> +!> @author Aron Roland +!> @author Mathieu Dutour-Sikiric +!> @date 01-Jun-2018 +!> +!> @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. +!> MODULE W3PARALL !/ !/ +-----------------------------------+ @@ -76,6 +97,15 @@ MODULE W3PARALL REAL, PARAMETER :: THR = TINY(1.0) CONTAINS !/ ------------------------------------------------------------------- / + !> + !> @brief NA + !> + !> @param[out] eTime + !> + !> @author Aron Roland + !> @author Mathieu Dutour-Sikiric + !> @date 01-Jun-2018 + !> SUBROUTINE WAV_MY_WTIME(eTime) !/ ------------------------------------------------------------------- / !/ @@ -157,6 +187,15 @@ SUBROUTINE WAV_MY_WTIME(eTime) !/ END SUBROUTINE WAV_MY_WTIME !/ ------------------------------------------------------------------- / + !> + !> @brief Print timings. + !> + !> @param[in] string + !> + !> @author Aron Roland + !> @author Mathieu Dutour-Sikiric + !> @date 01-Jun-2018 + !> SUBROUTINE PRINT_MY_TIME(string) !/ !/ +-----------------------------------+ @@ -232,6 +271,17 @@ SUBROUTINE PRINT_MY_TIME(string) !/ END SUBROUTINE PRINT_MY_TIME !/ ------------------------------------------------------------------- / + !> + !> @brief Compute refraction part in matrix. + !> + !> @param[in] ISEA + !> @param[in] DTG + !> @param[out] CAD + !> + !> @author Aron Roland + !> @author Mathieu Dutour-Sikiric + !> @date 01-Jun-2018 + !> SUBROUTINE PROP_REFRACTION_PR1(ISEA,DTG, CAD) !/ !/ +-----------------------------------+ @@ -382,6 +432,19 @@ SUBROUTINE PROP_REFRACTION_PR1(ISEA,DTG, CAD) END SUBROUTINE PROP_REFRACTION_PR1 !/ ------------------------------------------------------------------- / ! + !> + !> @brief Compute refraction part in matrix alternative approach. + !> + !> @param[in] IP + !> @param[in] ISEA + !> @param[in] DTG + !> @param[out] CAD + !> @param[in] DoLimiter + !> + !> @author Aron Roland + !> @author Mathieu Dutour-Sikiric + !> @date 01-Jun-2018 + !> SUBROUTINE PROP_REFRACTION_PR3(IP, ISEA, DTG, CAD, DoLimiter) !/ !/ +-----------------------------------+ @@ -529,6 +592,19 @@ SUBROUTINE PROP_REFRACTION_PR3(IP, ISEA, DTG, CAD, DoLimiter) !/ END SUBROUTINE PROP_REFRACTION_PR3 !/ ------------------------------------------------------------------- / + !> + !> @brief Compute frequency shift in matrix. + !> + !> @param[in] IP + !> @param[in] ISEA + !> @param[out] CAS + !> @param[out] DMM + !> @param[in] DTG + !> + !> @author Aron Roland + !> @author Mathieu Dutour-Sikiric + !> @date 01-Jun-2018 + !> SUBROUTINE PROP_FREQ_SHIFT(IP, ISEA, CAS, DMM, DTG) !/ !/ +-----------------------------------+ @@ -668,6 +744,19 @@ SUBROUTINE PROP_FREQ_SHIFT(IP, ISEA, CAS, DMM, DTG) !/ END SUBROUTINE PROP_FREQ_SHIFT !/ ------------------------------------------------------------------- / + !> + !> @brief Compute frequency shift alternative approach. + !> + !> @param[in] IP + !> @param[in] ISEA + !> @param[out] CWNB_M2 + !> @param[out] DWNI_M2 + !> @param[in] DTG + !> + !> @author Aron Roland + !> @author Mathieu Dutour-Sikiric + !> @date 01-Jun-2018 + !> SUBROUTINE PROP_FREQ_SHIFT_M2(IP, ISEA, CWNB_M2, DWNI_M2, DTG) !/ !/ +-----------------------------------+ @@ -813,6 +902,16 @@ SUBROUTINE PROP_FREQ_SHIFT_M2(IP, ISEA, CWNB_M2, DWNI_M2, DTG) !/ END SUBROUTINE PROP_FREQ_SHIFT_M2 !/ ------------------------------------------------------------------- / + !> + !> @brief Sync global local arrays. + !> + !> @param[in] IMOD + !> @param[in] IsMulti + !> + !> @author Aron Roland + !> @author Mathieu Dutour-Sikiric + !> @date 01-Jun-2018 + !> SUBROUTINE SYNCHRONIZE_IPGL_ETC_ARRAY(IMOD, IsMulti) !/ !/ +-----------------------------------+ @@ -927,6 +1026,16 @@ SUBROUTINE SYNCHRONIZE_IPGL_ETC_ARRAY(IMOD, IsMulti) !/ END SUBROUTINE SYNCHRONIZE_IPGL_ETC_ARRAY !/ ....................----------------------------------------------- / + !> + !> @brief Setup NSEAL, NSEALM in context of PDLIB. + !> + !> @param[out] NSEALout + !> @param[out] NSEALMout + !> + !> @author Aron Roland + !> @author Mathieu Dutour-Sikiric + !> @date 01-Jun-2018 + !> SUBROUTINE SET_UP_NSEAL_NSEALM(NSEALout, NSEALMout) !/ !/ +-----------------------------------+ @@ -1039,6 +1148,17 @@ SUBROUTINE SET_UP_NSEAL_NSEALM(NSEALout, NSEALMout) !/ END SUBROUTINE SET_UP_NSEAL_NSEALM !/ ------------------------------------------------------------------- / + !> + !> @brief Set JSEA for all schemes. + !> + !> @param[in] ISEA + !> @param[out] JSEA + !> @param[out] ISPROC + !> + !> @author Aron Roland + !> @author Mathieu Dutour-Sikiric + !> @date 01-Jun-2018 + !> SUBROUTINE INIT_GET_JSEA_ISPROC(ISEA, JSEA, ISPROC) !/ ------------------------------------------------------------------- / !/ @@ -1136,6 +1256,17 @@ SUBROUTINE INIT_GET_JSEA_ISPROC(ISEA, JSEA, ISPROC) !/ END SUBROUTINE INIT_GET_JSEA_ISPROC !/ ------------------------------------------------------------------- / + !> + !> @brief Set belongings of JSEA in context of PDLIB. + !> + !> @param[in] ISEA + !> @param[out] JSEA + !> @param[out] IBELONG + !> + !> @author Aron Roland + !> @author Mathieu Dutour-Sikiric + !> @date 01-Jun-2018 + !> SUBROUTINE GET_JSEA_IBELONG(ISEA, JSEA, IBELONG) !/ ------------------------------------------------------------------- / !/ @@ -1253,6 +1384,16 @@ SUBROUTINE GET_JSEA_IBELONG(ISEA, JSEA, IBELONG) !/ END SUBROUTINE GET_JSEA_IBELONG !/ ------------------------------------------------------------------- / + !> + !> @brief Set ISEA for all schemes. + !> + !> @param[out] ISEA + !> @param[in] JSEA + !> + !> @author Aron Roland + !> @author Mathieu Dutour-Sikiric + !> @date 01-Jun-2018 + !> SUBROUTINE INIT_GET_ISEA(ISEA, JSEA) !/ ------------------------------------------------------------------- / !/ @@ -1359,12 +1500,25 @@ SUBROUTINE INIT_GET_ISEA(ISEA, JSEA) !/ End of INIT_GET_ISEA ------------------------------------------------ / !/ END SUBROUTINE INIT_GET_ISEA - !********************************************************************** - !* An array of size (NSEA) is send but only the (1:NSEAL) values * - !* are correct. The program synchonizes everything on all nodes. * - !********************************************************************** + + !> + !> @brief Sync global array in context of PDLIB. + !> + !> @details An array of size (NSEA) is send but only the (1:NSEAL) values + !> are correct. The program synchonizes everything on all nodes. + !> + !> @param[inout] TheVar + !> + !> @author Aron Roland + !> @author Mathieu Dutour-Sikiric + !> @date 01-Jun-2018 + !> SUBROUTINE SYNCHRONIZE_GLOBAL_ARRAY(TheVar) !/ ------------------------------------------------------------------- / + !********************************************************************** + !* An array of size (NSEA) is send but only the (1:NSEAL) values * + !* are correct. The program synchonizes everything on all nodes. * + !********************************************************************** !/ !/ +-----------------------------------+ !/ | WAVEWATCH III NOAA/NCEP | diff --git a/model/src/w3pro1md.F90 b/model/src/w3pro1md.F90 index 16db90356..f8b498833 100644 --- a/model/src/w3pro1md.F90 +++ b/model/src/w3pro1md.F90 @@ -1,5 +1,25 @@ +!> @file +!> @brief Bundles routines for first order propagation scheme in single +!> module. +!> +!> @author H. L. Tolman +!> @date 05-Jun-2018 +!> + #include "w3macros.h" !/ ------------------------------------------------------------------- / +!> +!> @brief Bundles routines for first order propagation scheme in single +!> module. +!> +!> @author H. L. Tolman +!> @date 05-Jun-2018 +!> +!> @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. +!> MODULE W3PRO1MD !/ !/ +-----------------------------------+ @@ -76,6 +96,14 @@ MODULE W3PRO1MD !/ ------------------------------------------------------------------- / CONTAINS !/ ------------------------------------------------------------------- / + !> + !> @brief Generate 'map' arrays for the first order upstream scheme. + !> + !> @param MAPSTA Status map + !> + !> @author H. L. Tolman + !> @date 06-Dec-2010 + !> SUBROUTINE W3MAP1 ( MAPSTA ) !/ !/ +-----------------------------------+ @@ -258,6 +286,19 @@ SUBROUTINE W3MAP1 ( MAPSTA ) !/ END SUBROUTINE W3MAP1 !/ ------------------------------------------------------------------- / + !> + !> @brief Propagation in physical space for a given spectral component. + !> + !> @param[in] ISP Number of spectral bin (IK-1)*NTH+ITH + !> @param[in] DTG Total time step. + !> @param[in] MAPSTA Grid point status map. + !> @param[inout] FIELD Wave action spectral densities on full grid. + !> @param[in] VGX Speed of grid. + !> @param[in] VGY Speed of grid. + !> + !> @author H. L. Tolman + !> @date 29-May-2014 + !> SUBROUTINE W3XYP1 ( ISP, DTG, MAPSTA, FIELD, VGX, VGY ) !/ !/ +-----------------------------------+ @@ -828,6 +869,31 @@ SUBROUTINE W3XYP1 ( ISP, DTG, MAPSTA, FIELD, VGX, VGY ) !/ END SUBROUTINE W3XYP1 !/ ------------------------------------------------------------------- / + !> + !> @brief Propagation in spectral space. + !> + !> @param[inout] ISEA Number of sea points. + !> @param[inout] FACTH Factor in propagation velocity. + !> @param[inout] FACK Factor in propagation velocity. + !> @param[inout] CTHG0 Factor in great circle refracftion term. + !> @param[inout] CG Local group velocities. + !> @param[inout] WN Local wavenumbers. + !> @param[inout] DEPTH Depth. + !> @param[inout] DDDX Depth gradients. + !> @param[inout] DDDY Depth gradients. + !> @param[inout] CX Local group velocities. + !> @param[inout] CY Local group velocities. + !> @param[inout] DCXDX Current gradients. + !> @param[inout] DCXDY Current gradients. + !> @param[inout] DCYDX Current gradients. + !> @param[inout] DCYDY Current gradients. + !> @param[inout] DCDX Phase speed gradients. + !> @param[inout] DCDY Phase speed gradients. + !> @param[inout] VA Spectrum. + !> + !> @author H. L. Tolman + !> @date 20-Dec-2004 + !> SUBROUTINE W3KTP1 ( ISEA, FACTH, FACK, CTHG0, CG, WN, DEPTH, & DDDX, DDDY, CX, CY, DCXDX, DCXDY, DCYDX, & DCYDY, DCDX, DCDY, VA ) diff --git a/model/src/w3pro2md.F90 b/model/src/w3pro2md.F90 index 4ae31f242..a23f893ef 100644 --- a/model/src/w3pro2md.F90 +++ b/model/src/w3pro2md.F90 @@ -1,5 +1,26 @@ +!> @file +!> @brief Bundles routines for third order porpagation scheme in single +!> module. +!> +!> @author H. L. Tolman +!> @date 29-May-2014 +!> + #include "w3macros.h" !/ ------------------------------------------------------------------- / + +!> +!> @brief Bundles routines for third order porpagation scheme in single +!> module. +!> +!> @author H. L. Tolman +!> @date 29-May-2014 +!> +!> @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. +!> MODULE W3PRO2MD !/ !/ +-----------------------------------+ @@ -105,6 +126,12 @@ MODULE W3PRO2MD !/ CONTAINS !/ ------------------------------------------------------------------- / + !> + !> @brief Generate 'map' arrays for the ULTIMATE QUICKEST scheme. + !> + !> @author H. L. Tolman + !> @date 09-Nov-2005 + !> SUBROUTINE W3MAP2 !/ !/ @@ -464,6 +491,20 @@ SUBROUTINE W3MAP2 !/ END SUBROUTINE W3MAP2 !/ ------------------------------------------------------------------- / + !> + !> @brief Propagation in physical space for a given spectral component. + !> + !> @param[in] ISP Number of spectral bin (IK-1)*NTH+ITH. + !> @param[in] DTG Total time step. + !> @param[in] MAPSTA Grid point status map. + !> @param[in] MAPFS Storage map. + !> @param[inout] VQ Field to propagate. + !> @param[in] VGX + !> @param[in] VGY + !> + !> @author H. L. Tolman + !> @date 29-May-2014 + !> SUBROUTINE W3XYP2 ( ISP, DTG, MAPSTA, MAPFS, VQ, VGX, VGY ) !/ !/ +-----------------------------------+ @@ -1219,6 +1260,45 @@ SUBROUTINE W3XYP2 ( ISP, DTG, MAPSTA, MAPFS, VQ, VGX, VGY ) END SUBROUTINE W3XYP2 !/ !/ ------------------------------------------------------------------- / + !> + !> @brief Propagation in spectral space. + !> + !> @details Third order QUICKEST scheme with ULTIMATE limiter. + !> + !> + !> As with the spatial propagation, the two spaces are considered + !> independently, but the propagation is performed in a 2-D space. + !> Compared to the propagation in physical space, the directions + !> represent a closed space and are therefore comparable to the + !> longitudinal or 'X' propagation. The wavenumber space has to be + !> extended to allow for boundary treatment. Using a simple first + !> order boundary treatment at both sided, two points need to + !> be added. This implies that the spectrum needs to be extended, + !> shifted and rotated, as is performed using MAPTH2 as set + !> in W3MAP3. + !> + !> @param[in] ISEA Number of sea point. + !> @param[in] FACTH Factor in propagation velocity. + !> @param[in] FACK Factor in propagation velocity. + !> @param[in] CTHG0 Factor in great circle refracftion term. + !> @param[in] CG Local group velocities. + !> @param[in] WN Local wavenumbers. + !> @param[in] DEPTH Depth. + !> @param[in] DDDX Depth gradient. + !> @param[in] DDDY Depth gradient. + !> @param[in] CX Current component. + !> @param[in] CY Current component. + !> @param[in] DCXDX Current gradients. + !> @param[in] DCXDY Current gradients. + !> @param[in] DCYDX Current gradients. + !> @param[in] DCYDY Current gradients. + !> @param[in] DCDX Phase speed gradient. + !> @param[in] DCDY Phase speed gradient. + !> @param[inout] VA Spectrum. + !> + !> @author H. L. Tolman + !> @date 01-Jul-2013 + !> SUBROUTINE W3KTP2 ( ISEA, FACTH, FACK, CTHG0, CG, WN, DEPTH, & DDDX, DDDY, CX, CY, DCXDX, DCXDY, & DCYDX, DCYDY, DCDX, DCDY, VA ) diff --git a/model/src/w3pro3md.F90 b/model/src/w3pro3md.F90 index 157b9be09..96396a7a4 100644 --- a/model/src/w3pro3md.F90 +++ b/model/src/w3pro3md.F90 @@ -1,5 +1,25 @@ +!> @file +!> @brief Bundles routines for third order propagation scheme in single +!> module. +!> +!> @author H. L. Tolman +!> @date 27-May-2014 +!> + #include "w3macros.h" !/ ------------------------------------------------------------------- / +!> +!> @brief Bundles routines for third order propagation scheme in single +!> module. +!> +!> @author H. L. Tolman +!> @date 27-May-2014 +!> +!> @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. +!> MODULE W3PRO3MD !/ !/ +-----------------------------------+ @@ -110,6 +130,12 @@ MODULE W3PRO3MD !/ CONTAINS !/ ------------------------------------------------------------------- / + !> + !> @brief Generate 'map' arrays for the ULTIMATE QUICKEST scheme. + !> + !> @author H. L. Tolman + !> @date 01-Apr-2008 + !> SUBROUTINE W3MAP3 !/ !/ +-----------------------------------+ @@ -488,6 +514,13 @@ SUBROUTINE W3MAP3 !/ END SUBROUTINE W3MAP3 !/ ------------------------------------------------------------------- / + !> + !> @brief Generate 'map' arrays for the ULTIMATE QUICKEST scheme to combine + !> GSE alleviation with obstructions. + !> + !> @author H. L. Tolman + !> @date 17-Dec-2004 + !> SUBROUTINE W3MAPT !/ !/ +-----------------------------------+ @@ -588,6 +621,20 @@ SUBROUTINE W3MAPT !/ END SUBROUTINE W3MAPT !/ ------------------------------------------------------------------- / + !> + !> @brief Propagation in phyiscal space for a given spectral component. + !> + !> @param[in] ISP Number of spectral bin (IK-1)*NTH+ITH. + !> @param[in] DTG Total time step. + !> @param[in] MAPSTA Grid point status map. + !> @param[in] MAPFS Storage map. + !> @param[inout] VQ Field to propagate. + !> @param[in] VGX Speed of grid. + !> @param[in] VGY Speed of grid. + !> + !> @author H. L. Tolman + !> @date 27-May-2014 + !> SUBROUTINE W3XYP3 ( ISP, DTG, MAPSTA, MAPFS, VQ, VGX, VGY ) !/ !/ +-----------------------------------+ @@ -1419,6 +1466,46 @@ SUBROUTINE W3XYP3 ( ISP, DTG, MAPSTA, MAPFS, VQ, VGX, VGY ) !/ END SUBROUTINE W3XYP3 !/ ------------------------------------------------------------------- / +!> +!> @brief Propagation in spectral space. +!> +!> @details Third order QUICKEST scheme with ULTIMATE limiter. +!> +!> As with the spatial propagation, the two spaces are considered +!> independently, but the propagation is performed in a 2-D space. +!> Compared to the propagation in physical space, the directions +!> represent a closed space and are therefore comparable to the +!> longitudinal or 'X' propagation. The wavenumber space has to be +!> extended to allow for boundary treatment. Using a simple first +!> order boundary treatment at both sided, two points need to +!> be added. This implies that the spectrum needs to be extended, +!> shifted and rotated, as is performed using MAPTH2 as set +!> in W3MAP3. +!> +!> @param[in] ISEA Number of sea point. +!> @param[in] FACTH Factor in propagation velocity. +!> @param[in] FACK Factor in propagation velocity. +!> @param[in] CTHG0 Factor in great circle refracftion term. +!> @param[in] CG Local group velocities. +!> @param[in] WN Local wavenumbers. +!> @param[in] DW Depth. +!> @param[in] DDDX Depth gradients. +!> @param[in] DDDY Depth gradients. +!> @param[in] CX Current components. +!> @param[in] CY Current components. +!> @param[in] DCXDX Current gradients. +!> @param[in] DCXDY Current gradients. +!> @param[in] DCYDX Current gradients. +!> @param[in] DCYDY Current gradients. +!> @param[in] DCDX Phase speed gradients. +!> @param[in] DCDY Phase speed gradients. +!> @param[inout] VA Spectrum. +!> @param[out] CFLTHMAX +!> @param[out] CFLKMAX +!> +!> @author H. L. Tolman +!> @date 01-Jul-2013 +!> SUBROUTINE W3KTP3 ( ISEA, FACTH, FACK, CTHG0, CG, WN, DW, & DDDX, DDDY, CX, CY, DCXDX, DCXDY, & DCYDX, DCYDY, DCDX, DCDY, VA, CFLTHMAX, CFLKMAX ) @@ -1863,6 +1950,23 @@ SUBROUTINE W3KTP3 ( ISEA, FACTH, FACK, CTHG0, CG, WN, DW, & !/ END SUBROUTINE W3KTP3 !/ ------------------------------------------------------------------- / + !> + !> @brief Computes the maximum CFL number for spatial advection. + !> + !> @details Used for diagnostic purposes (Could be used to define a + !> local time step ...). + !> + !> @param[in] ISEA Index of grid point. + !> @param[in] DTG Total time step. + !> @param[in] MAPSTA Grid point status map. + !> @param[in] MAPFS Storage map. + !> @param[inout] CFLXYMAX Maximum CFL number for XY propagation. + !> @param[in] VGX Speed of grid. + !> @param[in] VGY Speed of grid. + !> + !> @author F. Ardhuin + !> @date 31-Oct-2010 + !> SUBROUTINE W3CFLXY ( ISEA, DTG, MAPSTA, MAPFS, CFLXYMAX, VGX, VGY ) !/ !/ +-----------------------------------+ diff --git a/model/src/w3ref1md.F90 b/model/src/w3ref1md.F90 index 795bdce20..df184faf1 100644 --- a/model/src/w3ref1md.F90 +++ b/model/src/w3ref1md.F90 @@ -1,4 +1,24 @@ +!> @file +!> @brief This module computes shoreline reflection, and +!> unresolved islands and iceberg reflections. +!> +!> @author F. Ardhuin +!> @date 27-Jun-2014 +!> + !/ ------------------------------------------------------------------- / +!> +!> @brief This module computes shoreline reflection, and +!> unresolved islands and iceberg reflections. +!> +!> @author F. Ardhuin +!> @date 27-Jun-2014 +!> +!> @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. +!> MODULE W3REF1MD !/ !/ +-----------------------------------+ @@ -64,6 +84,30 @@ MODULE W3REF1MD !/ CONTAINS !/ ------------------------------------------------------------------- / + !> + !> @brief Computes coastal and iceberg/island reflections and adds free IG energy. + !> + !> @param[inout] A Action density spectrum (1-D). + !> @param[in] CG Group velocities. + !> @param[in] WN Wavenumbers. + !> @param[in] EMEAN + !> @param[in] FMEAN + !> @param[in] DEPTH Mean water depth. + !> @param[in] CX1 + !> @param[in] CY1 + !> @param[in] REFLC + !> @param[in] REFLD + !> @param[in] TRNX + !> @param[in] TRNY + !> @param[in] BERG + !> @param[in] DT + !> @param[in] IX + !> @param[in] IY + !> @param[out] S Source term (1-D version). + !> + !> @author F. Ardhuin + !> @date 11-Jun-2014 + !> SUBROUTINE W3SREF(A, CG, WN, EMEAN, FMEAN, DEPTH, CX1, CY1, REFLC, REFLD, & TRNX, TRNY, BERG, DT, IX, IY, JSEA, S) !/ @@ -104,7 +148,7 @@ SUBROUTINE W3SREF(A, CG, WN, EMEAN, FMEAN, DEPTH, CX1, CY1, REFLC, REFLD, & ! ! Parameter list ! ---------------------------------------------------------------- - ! A R.A. I Action density spectrum (1-D) + ! A R.A. I Action density spectrum (1-D) ! CG R.A. I Group velocities. ! WN R.A. I Wavenumbers. ! DEPTH Real I Mean water depth. diff --git a/model/src/w3sbt1md.F90 b/model/src/w3sbt1md.F90 index fdc675ff3..bf17eafa1 100644 --- a/model/src/w3sbt1md.F90 +++ b/model/src/w3sbt1md.F90 @@ -1,5 +1,23 @@ +!> @file +!> @brief JONSWAP bottom friction routine. +!> +!> @author H. L. Tolman +!> @date 29-May-2009 +!> + #include "w3macros.h" !/ ------------------------------------------------------------------- / +!> +!> @brief JONSWAP bottom friction routine. +!> +!> @author H. L. Tolman +!> @date 29-May-2009 +!> +!> @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. +!> MODULE W3SBT1MD !/ !/ +-----------------------------------+ @@ -42,6 +60,31 @@ MODULE W3SBT1MD !/ CONTAINS !/ ------------------------------------------------------------------- / + !> + !> @brief Bottom friction source term according to the empirical JONSWAP + !> formulation. + !> + !> @verbatim + !> 2 GAMMA / CG \ SBTC1 / \ . + !> Sbt = ---------- | ------- - 0.5 | E = ----- | ... | E (1) + !> GRAV DEPTH \ SI/WN / DEPTH \ / + !> + !> Where GAMMA = -0.038 m2/s3 (JONSWAP) + !> = -0.067 m2/s3 (Bouws and Komen 1983) + !> + !> In the routine, the constant 2 GAMMA / GRAV = SBTC1. + !> @endverbatim + !> + !> @param[in] A Action density spectrum (1-D). + !> @param[in] CG Group velocities. + !> @param[in] WN Wavenumbers. + !> @param[in] DEPTH Mean water depth. + !> @param[out] S Source term (1-D version). + !> @param[out] D Diagonal term of derivative (1-D version). + !> + !> @author H. L. Tolman + !> @date 29-May-2009 + !> SUBROUTINE W3SBT1 (A, CG, WN, DEPTH, S, D) !/ !/ +-----------------------------------+ diff --git a/model/src/w3sbt4md.F90 b/model/src/w3sbt4md.F90 index 3291930f1..1d0e3a8d7 100644 --- a/model/src/w3sbt4md.F90 +++ b/model/src/w3sbt4md.F90 @@ -1,5 +1,27 @@ +!> @file +!> @brief SHOWEX bottom friction source term (Ardhuin et al 2003). +!> +!> @author F. Ardhuin +!> @author J. Lepesqueur +!> @date 14-Mar-2012 +!> + #include "w3macros.h" !/ ------------------------------------------------------------------- / +!> +!> @brief SHOWEX bottom friction source term (Ardhuin et al. 2003). +!> +!> @details Using a subgrid depth parameterization based on Tolman (CE 1995). +!> +!> @author F. Ardhuin +!> @author J. Lepesqueur +!> @date 14-Mar-2012 +!> +!> @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. +!> MODULE W3SBT4MD !/ !/ +-----------------------------------+ @@ -114,6 +136,12 @@ MODULE W3SBT4MD !/ ------------------------------------------------------------------- / + !> + !> @brief Initialization for bottom friction source term routine. + !> + !> @author F. Ardhuin + !> @date 14-Mar-2012 + !> SUBROUTINE INSBT4 !/ !/ +-----------------------------------+ @@ -202,6 +230,15 @@ SUBROUTINE INSBT4 !/ END SUBROUTINE INSBT4 ! ---------------------------------------------------------------------- + + !> + !> @brief Tabulation of ERF function, which is used in bottom friction subgrid modeling. + !> + !> @details Initialization for source term routine. + !> + !> @author J. Lepesqueur + !> @date 14-Mar-2012 + !> SUBROUTINE TABU_ERF !/ !/ +-----------------------------------+ @@ -276,6 +313,30 @@ END SUBROUTINE TABU_ERF !/ ------------------------------------------------------------------- / !/ ------------------------------------------------------------------- / + !> + !> @brief Computes the SHOWEX bottom friction with movable bed effects. + !> + !> @details Uses a Gaussian distribution for friction factors, and estimates + !> the contribution of rippled and non-rippled fractions based on the + !> bayesian approach of Tolman (1995). + !> + !> @param[in] A Action density spectrum. + !> @param[in] CG Group velocities. + !> @param[in] WN Wavenumbers. + !> @param[in] DEPTH Water depth. + !> @param[in] D50 Median grain size. + !> @param[in] PSIC Critical Shields parameter. + !> @param[out] TAUBBL Components of stress leaking to the bottom. + !> @param[inout] BEDFORM Ripple parameters (roughness and wavelength). + !> @param[out] S Source term (1-D version). + !> @param[out] D Diagonal term of derivative. + !> @param[in] IX Spatial grid index. + !> @param[in] IY Spatial grid index. + !> + !> @author F. Ardhuin + !> @author J. Lepesqueur + !> @date 15-Mar-2012 + !> SUBROUTINE W3SBT4 (A, CG, WN, DEPTH, D50, PSIC, TAUBBL, BEDFORM, S, D, IX, IY ) !/ !/ +-----------------------------------+ diff --git a/model/src/w3sbt8md.F90 b/model/src/w3sbt8md.F90 index f598c2fbe..c56b57f0e 100644 --- a/model/src/w3sbt8md.F90 +++ b/model/src/w3sbt8md.F90 @@ -1,5 +1,27 @@ +!> @file +!> @brief Contains routines for computing dissipation by viscous fluid mud using +!> Dalrymple and Liu (1978) "Thin Model". +!> +!> @author M. Orzech +!> @author W. E. Rogers +!> @date 21-Nov-2013 +!> + #include "w3macros.h" !/ ------------------------------------------------------------------- / +!> +!> @brief Contains routines for computing dissipation by viscous fluid mud using +!> Dalrymple and Liu (1978) "Thin Model". +!> +!> @author M. Orzech +!> @author W. E. Rogers +!> @date 21-Nov-2013 +!> +!> @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. +!> MODULE W3SBT8MD !/ !/ +-----------------------------------+ @@ -70,6 +92,22 @@ MODULE W3SBT8MD !/ CONTAINS !/ ------------------------------------------------------------------- / + !> + !> @brief Compute dissipation by viscous fluid mud using Dalrymple and Liu (1978). + !> + !> @details "Thin Model" (adapted from Erick Rogers code by Mark Orzech, NRL). + !> + !> @param[in] AC Action density spectrum (1-D). + !> @param[in] H_WDEPTH Mean water depth. + !> @param[out] S Source term (1-D version). + !> @param[out] D Diagonal term of derivative (1-D version). + !> @param[in] IX + !> @param[in] IY + !> + !> @author M. Orzech + !> @author W. E. Rogers + !> @date 21-Nov-2013 + !> SUBROUTINE W3SBT8(AC,H_WDEPTH,S,D,IX,IY) !/ !/ +-----------------------------------+ @@ -454,7 +492,15 @@ SUBROUTINE W3SBT8(AC,H_WDEPTH,S,D,IX,IY) END SUBROUTINE W3SBT8 !/ ------------------------------------------------------------------- / - + !> + !> @brief Complex hyperbolic sin (sinh). + !> + !> @param[in] C + !> @param[out] CS + !> + !> @author NA + !> @date NA + !> SUBROUTINE CSINH(C,CS) COMPLEX, INTENT(IN) :: C COMPLEX, INTENT(OUT) :: CS @@ -465,7 +511,15 @@ SUBROUTINE CSINH(C,CS) END SUBROUTINE CSINH !/ ------------------------------------------------------------------- / - + !> + !> @brief Complex hyperbolic cos (cosh). + !> + !> @param[in] C + !> @param[out] CC + !> + !> @author NA + !> @date NA + !> SUBROUTINE CCOSH(C,CC) COMPLEX, INTENT(IN) :: C COMPLEX, INTENT(OUT) :: CC diff --git a/model/src/w3sbt9md.F90 b/model/src/w3sbt9md.F90 index 217a54977..9ad6fd345 100644 --- a/model/src/w3sbt9md.F90 +++ b/model/src/w3sbt9md.F90 @@ -1,5 +1,27 @@ +!> @file +!> @brief Contains routines for computing dissipation by viscous fluid mud using +!> Ng (2000). +!> +!> @author M. Orzech +!> @author W. E. Rogers +!> @date 21-Nov-2013 +!> + #include "w3macros.h" !/ ------------------------------------------------------------------- / +!> +!> @brief Contains routines for computing dissipation by viscous fluid +!> mud using Ng (2000). +!> +!> @author M. Orzech +!> @author W. E. Rogers +!> @date 21-Nov-2013 +!> +!> @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. +!> MODULE W3SBT9MD !/ !/ +-----------------------------------+ @@ -78,6 +100,21 @@ MODULE W3SBT9MD !/ CONTAINS !/ ------------------------------------------------------------------- / + !> + !> @brief Compute dissipation by viscous fluid mud using Ng (2000) + !> (adapted from Erick Rogers code by Mark Orzech, NRL). + !> + !> @param[in] AC Action density. + !> @param[in] H_WDEPTH Mean water depth. + !> @param[out] S Source term (1-D version). + !> @param[out] D Diagonal term of derivative (1-D version). + !> @param[in] IX + !> @param[in] IY + !> + !> @author M. Orzech + !> @author W. E. Rogers + !> @date 21-Nov-2013 + !> SUBROUTINE W3SBT9(AC,H_WDEPTH,S,D,IX,IY) !/ !/ +-----------------------------------+ @@ -369,6 +406,26 @@ SUBROUTINE W3SBT9(AC,H_WDEPTH,S,D,IX,IY) END SUBROUTINE W3SBT9 !/ ------------------------------------------------------------------- / + !> + !> @brief Compute dissipation by viscous fluid mud using Ng (2000). + !> + !> @details Adapted from Erick Rogers code by Mark Orzech, NRL. + !> + !> @param[in] SIGMA Radian frequency (rad). + !> @param[in] H_WDEPTH Water depth, denoted "h" in Ng (m). + !> @param[in] DTILDE Normalized mud depth. + !> @param[in] ZETA The ratio of stokes' boundary layer. + !> @param[in] SBLTM Sbltm is what you get if you calculate sblt using + !> the viscosity of the mud + !> @param[in] GAMMA The gamma used in Ng page 238, density(water)/density(mud). + !> @param[in] WK Unmuddy wavenumber. + !> @param[out] WKDR Muddy wavenumber. + !> @param[out] DISS Dissipation rate. + !> + !> @author E. Rogers + !> @author M. Orzech + !> @date 21-Nov-2013 + !> SUBROUTINE NG(SIGMA,H_WDEPTH,DTILDE,ZETA,SBLTM,GAMMA,WK,WKDR,DISS) !/ !/ +-----------------------------------+ @@ -500,6 +557,17 @@ SUBROUTINE NG(SIGMA,H_WDEPTH,DTILDE,ZETA,SBLTM,GAMMA,WK,WKDR,DISS) END SUBROUTINE NG !/ ------------------------------------------------------------------- / + !> + !> @brief NA + !> + !> @param[in] KWAVE + !> @param[in] H_WDEPTH + !> @param[in] SND2 + !> @param[out] ND + !> + !> @author NA + !> @date NA + !> SUBROUTINE CALC_ND(KWAVE,H_WDEPTH,SND2,ND) !/ ------------------------------------------------------------------- / diff --git a/model/src/w3sdb1md.F90 b/model/src/w3sdb1md.F90 index af3e65c7a..34c7ec3bf 100644 --- a/model/src/w3sdb1md.F90 +++ b/model/src/w3sdb1md.F90 @@ -1,5 +1,26 @@ +!> @file +!> @brief Dummy slot for bottom friction source term. +!> +!> @author J. H. Alves +!> @author H. L. Tolman +!> @date 29-May-2009 +!> + #include "w3macros.h" !/ ------------------------------------------------------------------- / +!> +!> @brief Dummy slot for bottom friction source term. +!> +!> @author J. H. Alves +!> @author H. L. Tolman +!> @date 29-May-2009 +!> +!> +!> @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. +!> MODULE W3SDB1MD !/ !/ +-----------------------------------+ @@ -50,6 +71,28 @@ MODULE W3SDB1MD !/ CONTAINS !/ ------------------------------------------------------------------- / + !> + !> @brief Compute depth-induced breaking using Battjes and Janssen bore + !> model approach. + !> + !> @details Note that the Miche criterion can influence wave growth. + !> + !> @param[in] IX Local grid number + !> @param[in] A Action density spectrum (1-D). + !> @param[inout] DEPTH Mean water depth. + !> @param[inout] EMEAN Mean wave energy. + !> @param[inout] FMEAN Mean wave frequency. + !> @param[inout] WNMEAN Mean wave number. + !> @param[in] CG + !> @param[out] LBREAK + !> @param[out] S Source term (1-D version). + !> @param[out] D Diagonal term of derivative (1-D version). + !> + !> @author J. H. Alves + !> @author H. L. Tolman + !> @author A. Roland + !> @date 08-Jun-2018 + !> SUBROUTINE W3SDB1 (IX, A, DEPTH, EMEAN, FMEAN, WNMEAN, CG, LBREAK, S, D ) !/ !/ +-----------------------------------+ @@ -189,12 +232,12 @@ SUBROUTINE W3SDB1 (IX, A, DEPTH, EMEAN, FMEAN, WNMEAN, CG, LBREAK, S, D ) ! ! 0. Initialzations ------------------------------------------------- / ! Never touch this 4 lines below ... otherwise my exceptionhandling will not work. + S = 0. + D = 0. THR = DBLE(1.E-15) IF (SUM(A) .LT. THR) RETURN - S = 0. - D = 0. IWB = 1 ! #ifdef W3_T diff --git a/model/src/w3sic4md.F90 b/model/src/w3sic4md.F90 index 7b1c9c67a..3cc7da357 100644 --- a/model/src/w3sic4md.F90 +++ b/model/src/w3sic4md.F90 @@ -58,13 +58,6 @@ MODULE W3SIC4MD ! ! 5. Remarks : ! - ! Source material : - ! 1) Wadhams et al. JGR 1988 - ! 2) Meylan et al. GRL 2014 - ! 3) Kohout & Meylan JGR 2008 in Horvat & Tziperman Cryo. 2015 - ! 4) Kohout et al. Nature 2014 - ! 5) Doble et al. GRL 2015 - ! 6) Rogers et al. JGR 2016 ! Documentation of IC4: ! 1) Collins and Rogers, NRL Memorandum report 2017 ! ---> "A Source Term for Wave Attenuation by Sea @@ -82,6 +75,21 @@ MODULE W3SIC4MD ! ---> New recommendations for IC4 Method 2 (polynomial fit) ! and IC4 Method 6 (step function via namelist) ! + ! Other source material : + ! *** Wadhams et al. JGR 1988 + ! *** Meylan et al. GRL 2014 + ! *** Kohout & Meylan JGR 2008 in Horvat & Tziperman Cryo. 2015 + ! *** Kohout et al. Nature 2014 + ! *** Doble et al. GRL 2015 + ! *** Rogers et al. JGR 2016 + ! *** Meylan et al. JGR 2018 + ! *** Yu et al. JGR 2019 + ! *** Liu et al. JPO 2020 + ! *** Rogers et al. CRST 2021 (RMK2021) + ! *** Rogers et al. tech. rep. 2021 (RYW2021) + ! *** Yu et al. CRST 2022 + ! *** Yu JMSE 2022 + ! ! 6. Switches : ! ! See subroutine documentation. @@ -127,6 +135,9 @@ SUBROUTINE W3SIC4 (A, DEPTH, CG, IX, IY, S, D) !/ 08-Apr-2016 : Method 6 added (namelist step funct.) (E. Rogers) !/ 24-Feb-2017 : Corrections to Methods 1,2,3,4 (E. Rogers) !/ 13-Apr-2017 : Method 7 added (Doble et al. 2015) (E. Rogers) + !/ 11-Jan-2024 : Method 8 added (Meylan et al. 2018) (E. Rogers) + !/ 11-Jan-2024 : Method 9 added (Rogers et al., 2021) + !/ denoted "RYW2021" (E. Rogers) !/ !/ FIXME : Move field input to W3SRCE and provide !/ (S.Zieger) input parameter to W3SIC1 to make the subroutine @@ -155,7 +166,24 @@ SUBROUTINE W3SIC4 (A, DEPTH, CG, IX, IY, S, D) ! 2) Polynomial fit, Eq. 3 from Meylan et al. 2014 ! 3) Quadratic fit to Kohout & Meylan'08 in Horvat & Tziperman'15 ! Here, note that their eqn is given as ln(alpha)=blah, so we - ! have alpha=exp(blah) + ! have alpha=exp(blah). + ! Note from ER: + ! This implementation has two things to keep in mind: + ! 1) This is a scattering model, applied as dissipation, + ! which is not correct. + ! 2) This is not actually HT15! The alpha of HT15 has + ! different meaning from alpha of CR17, as follows: + ! HT15: decay is exp(-alpha*Lambda) where Lambda + ! is the number of floes encountered. + ! CR17: decay is exp(-alpha*x) + ! Thus, CR17's implementation of HT15 is equivalent to + ! the actual HT15 only if one assumes one floe encountered + ! per meter. This is very strong attenuation, as shown in + ! Figure 3 of CR17! This problem might be fixed by computing + ! an encounter interval length scale from an a_ice and d_ice + ! provided by the user...or a length scale provided by the + ! user. + ! See also: page 3 of Rogers et al. (RYW2021). ! 4) Eq. 1 from Kohout et al. 2014 ! ! 5) Simple step function for ki as a function of frequency @@ -208,9 +236,10 @@ SUBROUTINE W3SIC4 (A, DEPTH, CG, IX, IY, S, D) ! 'MTH' 19680606 000000 0.16 ! ! 6) Simple step function for ki as a function of frequency - ! with up to 10 "steps". Controlling parameters KIx and FCx are + ! with up to 16 "steps". Controlling parameters KIx and FCx are ! read in as namelist parameters, so they are stationary and - ! uniform. + ! uniform. (If 16 steps is not enough, the number of steps can be + ! increased at compile time by changing NIC4 in w3gdatmd.ftn.) ! The last non-zero FCx value should be a large number, e.g. 99 Hz ! ! 4444444444 <--- ki=ic4_ki(4) @@ -237,6 +266,62 @@ SUBROUTINE W3SIC4 (A, DEPTH, CG, IX, IY, S, D) ! ALPHA = 0.2*(T^(-2.13)*HICE or ! ALPHA = 0.2*(FREQ^2.13)*HICE ! + ! 8) Meylan et al. (JGR 2018), eq. 48. "Model with Order 3 Power + ! Law". The is denoted as the "M2" model by Liu et al. (JPO 2020) + ! It is a function of ice thickness and wave period. + ! ki = ChfM2*h_ice*freq^3 + ! where ChfM2 is a coefficient of proportionality which formally + ! includes viscosity, density, and gravity parameters, see + ! Meylan et al. (JGR 2018) for details. + ! ChfM2 has units of s3/m2 + ! It is equation 53 in Meylan et al. (2018) and equation 16 in + ! Liu et al. (2020). + ! This method is functionally the same as the "M2" model in IC5 + ! in WW3 (IC5 w/IC5VEMOD=3) and is redundantly included here as + ! IC4M8 because it is in the same "family" as IC4M7 and IC4M9, + ! being in the form of: + ! ki=Chf * h_ice^m * freq^n . + ! Calibrations: + ! * Liu et al. has ChfM2=eta*(2*pi)^3/(1025*9.81^2) + ! ** eta=14.0 for "Sikuliaq" case of Liu et al., so ChfM2=0.035 + ! ** eta=3.0 for "SIPEX" case of Liu et al., so ChfM2=0.0075 + ! * Rogers et al. (tech rep. 2021, "RYW2021") : + ! ** Fit to Rogers et al. (CRST 2021 "RMK2021") ChfM2=0.059 (*SD*) + ! suggested default is marked with "(*SD*)", for consistency + ! with SWAN (v41.31AB or later) + ! + ! 9) Rogers et al. (tech. rep. 2021, "RYW2021"): the "monomial power + ! fit" described in section 2.2.3. It is the general form above, + ! ki=Chf * h_ice^m * freq^n but is constrained such that m=n/2-1. + ! This constraint is derived by RYW2021 by invoking the scaling from + ! Yu et al. (2019), which is based on Reynolds number with ice + ! thickness as the relevant length scale. + ! This is also given as equation 2 in Yu et al. (CRST 2022). + ! Some calibrations are as follows: + ! * RYW2021, calibration to RMK2021: Chf=2.9 and n=4.5 (*SD*) + ! * Yu et al. (2022) calibration to RMK2021 : Chf=2.4 and n=4.46 + ! (noting that c_n=0.108 and Chf=c_n*(2*pi/sqrt(g))^n) + ! * Yu (2022) adjusted the prior calibration to get better fit + ! to higher frequency lab measurements and got: + ! Chf=7.89 and n=4.8 + ! suggested default is marked with "(*SD*)", for consistency + ! with SWAN (v41.31AB or later) + ! + ! ------------------------------------------------------------------ + ! + ! For all methods, the user can specify namelist + ! variables IC4FMIN and IC4KIBK such as: + ! &SIC4 IC4METHOD = [...], IC4FMIN=0.08, IC4KIBK=1.0e-7, [...] + ! This accomodates the situation where the empirically-derived + ! dissipation is uncertain for the lowest frequencies, which can be + ! the case if estimated dissipation rate is so small that it falls + ! in the noise level for the estimation method. (This is common, + ! since some ice types cause only very weak dissipation + ! to low frequencies.) In the example above, the amplitude + ! dissipation rate ki is set to some low background level + ! dissipation IC4KIBK=1.0e-7 1/m when model frequency is less than + ! 0.08 Hz. + ! ! More verbose description of implementation of Sice in WW3: ! See documentation for IC1 ! @@ -315,9 +400,10 @@ SUBROUTINE W3SIC4 (A, DEPTH, CG, IX, IY, S, D) USE W3ODATMD, ONLY: NDSE USE W3SERVMD, ONLY: EXTCDE USE W3GDATMD, ONLY: NK, NTH, NSPEC, SIG, MAPWN, IC4PARS, DDEN, & - IC4_KI, IC4_FC, NIC4 + IC4_KI, IC4_FC, IC4_CN, NIC4, IC4_FMIN, & + IC4_KIBK USE W3IDATMD, ONLY: ICEP1, ICEP2, ICEP3, ICEP4, ICEP5, & - MUDT, MUDV, MUDD, INFLAGS2 + MUDT, MUDV, MUDD, INFLAGS2 #ifdef W3_T USE W3ODATMD, ONLY: NDST @@ -353,14 +439,18 @@ SUBROUTINE W3SIC4 (A, DEPTH, CG, IX, IY, S, D) INTEGER :: IKTH, IK, ITH, IC4METHOD, IFC REAL :: D1D(NK), EB(NK) REAL :: ICECOEF1, ICECOEF2, ICECOEF3, & - ICECOEF4, ICECOEF5, ICECOEF6, & - ICECOEF7, ICECOEF8 - REAL :: KI1,KI2,KI3,KI4,FC5,FC6,FC7,FREQ + ICECOEF4, ICECOEF5, ICECOEF6, & + ICECOEF7, ICECOEF8 + REAL :: CICE1,CICE2,CICE3,CICE4,CICE5 ! temporary variables + REAL :: KI1,KI2,KI3,KI4,FC5,FC6,FC7 REAL :: HS, EMEAN, HICE + REAL :: Chf,mpow,npow REAL, ALLOCATABLE :: WN_I(:) ! exponential decay rate for amplitude REAL, ALLOCATABLE :: ALPHA(:) ! exponential decay rate for energy + REAL, ALLOCATABLE :: FREQ(:) ! wave frequency REAL, ALLOCATABLE :: MARG1(:), MARG2(:) ! Arguments for M2 REAL, ALLOCATABLE :: KARG1(:), KARG2(:), KARG3(:) !Arguments for M3 + LOGICAL :: NML_INPUT ! if using namelist input for M2 !/ !/ ------------------------------------------------------------------- / @@ -380,6 +470,7 @@ SUBROUTINE W3SIC4 (A, DEPTH, CG, IX, IY, S, D) ALLOCATE(KARG1(0:NK+1)) ALLOCATE(KARG2(0:NK+1)) ALLOCATE(KARG3(0:NK+1)) + ALLOCATE(FREQ(0:NK+1)) MARG1 = 0.0 MARG2 = 0.0 KARG1 = 0.0 @@ -398,12 +489,12 @@ SUBROUTINE W3SIC4 (A, DEPTH, CG, IX, IY, S, D) HS = 0.0 HICE = 0.0 EMEAN = 0.0 + FREQ=SIG/TPI ! ! IF (.NOT.INFLAGS2(-7))THEN ! WRITE (NDSE,1001) 'ICE PARAMETER 1' ! CALL EXTCDE(201) ! ENDIF - ! ! We cannot remove the other use of INFLAGS below, ! because we would get 'array not allocated' error for the methods @@ -430,20 +521,8 @@ SUBROUTINE W3SIC4 (A, DEPTH, CG, IX, IY, S, D) IC4METHOD = IC4PARS(1) ! - ! x. No ice --------------------------------------------------------- / - ! - ! IF ( ICECOEF1==0. ) THEN - ! D = 0. - ! WRITE(*,*) '!!!No Ice!!!' - ! - ! x. Ice ------------------------------------------------------------ / - ! ELSE - ! - ! x.x Set constant(s) and write test output -------------------------- / - ! - ! (none) - ! #ifdef W3_T38 + ! Write test output ---------------------------------------------- / WRITE (NDST,9000) DEPTH,ICECOEF1,ICECOEF2,ICECOEF3,ICECOEF4 #endif ! @@ -461,8 +540,32 @@ SUBROUTINE W3SIC4 (A, DEPTH, CG, IX, IY, S, D) !NB: Eq. 3 only includes T^2 and T^4 terms, ! which correspond to ICECOEF3, ICECOEF5, so in ! regtest: ICECOEF1=ICECOEF2=ICECOEF4=0 - MARG1 = ICECOEF1 + ICECOEF2*(SIG/TPI) + ICECOEF3*(SIG/TPI)**2 - MARG2 = ICECOEF4*(SIG/TPI)**3 + ICECOEF5*(SIG/TPI)**4 + + NML_INPUT=.TRUE. + IF (INFLAGS2(-7).OR.INFLAGS2(-6).OR.INFLAGS2(-5).OR. & + INFLAGS2(-4).OR.INFLAGS2(-3)) NML_INPUT=.FALSE. + + IF(NML_INPUT)THEN ! get from namelist array + + CICE1=IC4_CN(1) + CICE2=IC4_CN(2) + CICE3=IC4_CN(3) + CICE4=IC4_CN(4) + CICE5=IC4_CN(5) + + ELSE ! get from input-field array (ICEP1 etc.) + + CICE1=ICECOEF1 + CICE2=ICECOEF2 + CICE3=ICECOEF3 + CICE4=ICECOEF4 + CICE5=ICECOEF5 + + ENDIF + + ! CICE1 is C_{ice,1} in Collins and Rogers (2017), for example. + MARG1 = CICE1 + CICE2*FREQ + CICE3*FREQ**2 + MARG2 = CICE4*FREQ**3 + CICE5*FREQ**4 ALPHA = MARG1 + MARG2 WN_I = 0.5 * ALPHA @@ -510,13 +613,12 @@ SUBROUTINE W3SIC4 (A, DEPTH, CG, IX, IY, S, D) CALL EXTCDE(201) END IF DO IK=1, NK - FREQ=SIG(IK)/TPI ! select ki - IF(FREQ.LT.FC5)THEN + IF(FREQ(IK).LT.FC5)THEN WN_I(IK)=KI1 - ELSEIF(FREQ.LT.FC6)THEN + ELSEIF(FREQ(IK).LT.FC6)THEN WN_I(IK)=KI2 - ELSEIF(FREQ.LT.FC7)THEN + ELSEIF(FREQ(IK).LT.FC7)THEN WN_I(IK)=KI3 ELSE WN_I(IK)=KI4 @@ -534,10 +636,9 @@ SUBROUTINE W3SIC4 (A, DEPTH, CG, IX, IY, S, D) END IF DO IK=1, NK - FREQ=SIG(IK)/TPI ! select ki DO IFC=1,NIC4 - IF(FREQ.LT.IC4_FC(IFC))THEN + IF(FREQ(IK).LT.IC4_FC(IFC))THEN WN_I(IK)=IC4_KI(IFC) EXIT END IF @@ -548,11 +649,57 @@ SUBROUTINE W3SIC4 (A, DEPTH, CG, IX, IY, S, D) HICE=ICECOEF1 ! For this method, ICECOEF1=ice thickness DO IK=1,NK - FREQ=SIG(IK)/TPI - ALPHA(IK) = 0.2*(FREQ**2.13)*HICE + ALPHA(IK) = 0.2*(FREQ(IK)**2.13)*HICE END DO WN_I= 0.5 * ALPHA + CASE (8) ! Meylan et al. (JGR 2018), Liu et al. (JPO 2020) + + NML_INPUT=.TRUE. + IF (INFLAGS2(-6)) NML_INPUT=.FALSE. + + IF(NML_INPUT)THEN ! get from namelist array + + Chf=IC4_CN(1) ! Denoted "ChfM2" in documentation + + ELSE ! get from input-field array (ICEP1 etc.) + + Chf=ICECOEF2 ! Denoted "ChfM2" in documentation + + ENDIF + + ! Rename variable, for clarity + hice=ICECOEF1 ! For this method, ICECOEF1 is ice thickness + + DO IK=1,NK + WN_I(IK) = Chf*hice*(FREQ(IK)**3) + END DO + + CASE (9) ! Rogers et al. (2021) (RYW2021), Yu et al. (JGR 2022) + + NML_INPUT=.TRUE. + IF (INFLAGS2(-6).OR.INFLAGS2(-5)) NML_INPUT=.FALSE. + + IF(NML_INPUT)THEN ! get from namelist array + + Chf=IC4_CN(1) ! Denoted as same in documentation + npow=IC4_CN(2) ! Denoted "n" in documentation + + ELSE ! get from input-field array (ICEP1 etc.) + + Chf=ICECOEF2 ! Denoted as same in documentation + npow=ICECOEF3 ! Denoted "n" in documentation + + ENDIF + + ! Rename variable, for clarity + hice=ICECOEF1 ! For this method, ICECOEF1 is ice thickness + ! Compute + mpow=0.5*npow-1.0 ! Denoted "m" in documentation + DO IK=1,NK + WN_I(IK) = Chf*(hice**mpow)*(FREQ(IK)**npow) + END DO + CASE DEFAULT WN_I = ICECOEF1 !Default to IC1: Uniform in k @@ -564,6 +711,8 @@ SUBROUTINE W3SIC4 (A, DEPTH, CG, IX, IY, S, D) DO IK=1, NK ! SBT1 has: D1D(IK) = FACTOR * MAX(0., (CG(IK)*WN(IK)/SIG(IK)-0.5) ) ! recall that D=S/E=-2*Cg*k_i + IF(FREQ(IK).LT.IC4_FMIN)WN_I(IK)=IC4_KIBK + ! write(*,*)freq(ik),wn_i(ik),ICECOEF1,' % :: freq,ki,hice' ! temporary code: do not commit to repo uncommented D1D(IK) = -2. * CG(IK) * WN_I(IK) END DO @@ -598,7 +747,7 @@ SUBROUTINE W3SIC4 (A, DEPTH, CG, IX, IY, S, D) ! Formats ! 1001 FORMAT (/' *** WAVEWATCH III ERROR IN W3SIC4 : '/ & - ' ',A,' REQUIRED BUT NOT SELECTED'/) + ' ',A,' REQUIRED BUT NOT SELECTED'/) ! #ifdef W3_T 9000 FORMAT (' TEST W3SIC4 : DEPTH,ICECOEF1 : ',2E10.3) diff --git a/model/src/w3snl1md.F90 b/model/src/w3snl1md.F90 index e21349ede..09c096d2b 100644 --- a/model/src/w3snl1md.F90 +++ b/model/src/w3snl1md.F90 @@ -28,7 +28,7 @@ MODULE W3SNL1MD !/ | WAVEWATCH III NOAA/NCEP | !/ | H. L. Tolman | !/ | FORTRAN 90 | - !/ | Last update : 03-Sep-2012 | + !/ | Last update : 28-Feb-2023 | !/ +-----------------------------------+ !/ !/ 04-Feb-2000 : Origination. ( version 2.00 ) @@ -36,6 +36,7 @@ MODULE W3SNL1MD !/ 24-Dec-2004 : Multiple grid version. ( version 3.06 ) !/ 29-May-2009 : Preparing distribution version. ( version 3.14 ) !/ 03-Sep-2012 : Clean up of test output T0, T1 ( version 4.07 ) + !/ 28-Feb-2023 : Adds GQM separate routines ( version 7.07 ) !/ !/ Copyright 2009 National Weather Service (NWS), !/ National Oceanic and Atmospheric Administration. All rights @@ -77,8 +78,22 @@ MODULE W3SNL1MD ! !/ ------------------------------------------------------------------- / !/ + !/ PUBLIC !/ + !/ These are the arrays and variables used for GQM method + !/ + INTEGER :: NCONF + INTEGER, ALLOCATABLE :: K_IF2 (:,:,:) , K_IF3 (:,:,:) , K_1P2P(:,:,:) , & + K_1P3M(:,:,:) , K_1P2M(:,:,:) , K_1P3P(:,:,:) , & + K_1M2P(:,:,:) , K_1M3M(:,:,:) , K_1M2M(:,:,:) , & + K_1M3P(:,:,:) + INTEGER, ALLOCATABLE :: F_POIN(:) , T_POIN(:) , K_IF1(:) , K_1P(:,:) , & + K_1M(:,:) , IDCONF(:,:) + DOUBLE PRECISION, ALLOCATABLE :: F_COEF(:) , F_PROJ(:) , TB_SCA(:) , TB_V14(:) + DOUBLE PRECISION, ALLOCATABLE :: TB_V24(:,:,:) , TB_V34(:,:,:) , & + TB_TPM(:,:,:) , TB_TMP(:,:,:) , TB_FAC(:,:,:) + !/ CONTAINS !/ ------------------------------------------------------------------- / @@ -768,6 +783,1359 @@ SUBROUTINE INSNL1 ( IMOD ) !/ End of INSNL1 ----------------------------------------------------- / !/ END SUBROUTINE INSNL1 + + !/ ------------------------------------------------------------------- / + SUBROUTINE W3SNLGQM(A,CG,WN,DEPTH,TSTOTn,TSDERn) + ! This and the following routines are adapted to WW3 from TOMAWAC qnlin3.f + !*********************************************************************** + ! TOMAWAC V6P1 24/06/2011 + !*********************************************************************** + ! + !brief COMPUTES THE CONTRIBUTION OF THE NON-LINEAR INTERACTIONS + !+ SOURCE TERM BETWEEN QUADRUPLETS USING THE GQM METHOD + !+ ("GAUSSIAN QUADRATURE METHOD") PROPOSED BY LAVRENOV + !+ (2001) + !+ + !+ PROCEDURE SPECIFIC TO THE CASE WHERE THE FREQUENCIES + !+ FOLLOW A GEOMETRICAL PROGRESSION AND THE DIRECTIONS + !+ ARE EVENLY DISTRIBUTED OVER [0;2.PI]. + ! + !note THIS SUBROUTINE USES THE OUTPUT FROM 'PRENL3' TO OPTIMISE + !+ THE COMPUTATIONS FOR DIA. + ! + !reference LAVRENOV, I.V. (2001): + !+ "EFFECT OF WIND WAVE PARAMETER FLUCTUATION ON THE NONLINEAR + !+ SPECTRUM EVOLUTION". J. PHYS. OCEANOGR. 31, 861-873. + ! + !history E. GAGNAIRE-RENOU + !+ 04/2011 + !+ V6P1 + !+ CREATED + ! + !history G.MATTAROLO (EDF - LNHE) + !+ 24/06/2011 + !+ V6P1 + !+ Translation of French names of the variables in argument + + ! + !/ Warning, contrary to the DIA routine, there is no extension to frequencies below IK=1 + !/ as a result the first two frequencies are not fully treated. + !================================================================================== + ! This subroutine is same as qnlin3 in TOMWAC + USE CONSTANTS, ONLY: TPI + USE W3GDATMD, ONLY: SIG, NK , NTH , DTH, XFR, FR1, GQTHRSAT, GQAMP + + IMPLICIT NONE + + REAL, intent(in) :: A(NTH,NK), CG(NK), WN(NK) + REAL, intent(in) :: DEPTH + REAL, intent(out) :: TSTOTn(NTH,NK), TSDERn(NTH,NK) + + INTEGER :: ITH,IK,NT,NF + REAL :: q_dfac, SATVAL(NK), SUME, ACCVAL, ACCMAX, AMPFAC + DOUBLE PRECISION :: RAISF, FREQ(NK) + DOUBLE PRECISION :: TSTOT(NTH,NK) , TSDER(NTH,NK), F(NTH,NK) + DOUBLE PRECISION :: TEMP + + !.....LOCAL VARIABLES + INTEGER JF , JT , JF1 , JT1 , IQ_OM2 & + , JFM0 , JFM1 , JFM2 , JFM3 , IXF1 , IXF2 & + , IXF3 , JFMIN , JFMAX , ICONF , LBUF + INTEGER KT1P , KT1M , JT1P , JT1M , KT1P2P, KT1P2M & + , KT1P3P, KT1P3M, KT1M2P, KT1M2M, KT1M3P, KT1M3M & + , JT1P2P, JT1P2M, JT1P3P, JT1P3M, JT1M2P, JT1M2M & + , JT1M3P, JT1M3M + DOUBLE PRECISION V1_4 , V2_4 , V3_4 , Q_2P3M, Q_2M3P, FACTOR & + , T_2P3M, T_2M3P, S_2P3M, S_2M3P, SCAL_T, T2P3M & + , T2M3P , SP0 , SP1P , SP1M , SP1P2P, SP1P2M & + , SP1P3P, SP1P3M, SP1M2P, SP1M2M, SP1M3P, SP1M3M & + , CF0 , CP0 , CF1 , CP1 , CF2 , CP2 & + , CF3 , CP3 , Q2PD0 , Q2PD1 , Q2PD2P, Q2PD3M & + , Q2MD0 , Q2MD1 , Q2MD2M, Q2MD3P ,AUX00 , AUX01 & + , AUX02 , AUX03 , AUX04 , AUX05 , SEUIL & + , AUX06 , AUX07 , AUX08 , AUX09 , AUX10 , FSEUIL + + NT = NTH + NF = NK + LBUF = 500 + SEUIL = 0. + RAISF = XFR + + DO IK = 1,NK + FREQ(IK) = FR1*RAISF**(IK-1) + ENDDO + + DO ITH = 1,NTH + DO IK = 1,NK + ! F is the E(f,theta) spectrum ... + F(ITH,IK) = DBLE(A(ITH,IK)*SIG(IK))*DBLE(TPI)/DBLE(CG(IK)) + ENDDO + ENDDO + ! CALL INSNLGQM + ! it returns: F_POIN , T_POIN , F_COEF , F_PROJ, TB_SCA , K_IF1, K_1P, k_1M , K_IF2 + ! K_IF3, K_1P2P , K_1P3M , K_1P2M , K_1P3P , K_1M2P , K_1M3M , K_1M2M + ! K_1M3P , TB_V14 , TB_FAC , TB_V24 , TB_V34 , TB_TMP , TB_TPM , IDCONF, NCONF + !======================================================================= + ! COMPUTES THE GENERALIZED MIN AND MAX FREQUENCIES : INSTEAD OF GOING + ! FROM 1 TO NF IN FREQ(JF) FOR THE MAIN FREQUENCY, IT GOES FROM JFMIN + ! TO JFMAX + ! JFMIN IS GIVEN BY Fmin=FREQ(1) /Gamma_min + ! JFMAX IS GIVEN BY Fmax=FREQ(NF)*Gamma_max + ! TESTS HAVE SHOWN THAT IT CAN BE ASSUMED Gamma_min=1. (JFMIN=1) AND + ! Gamma_max=1.3 (JFMAX>NF) TO OBTAIN IMPROVED RESULTS + ! Note by Fabrice Ardhuin: this appears to give the difference in tail benaviour with Gerbrant's WRT + !======================================================================= + JFMIN=MAX(1-INT(LOG(1.0D0)/LOG(RAISF)),1) + JFMAX=MIN(NF+INT(LOG(1.3D0)/LOG(RAISF)),NK) + ! + !======================================================================= + ! COMPUTES THE SPECTRUM THRESHOLD VALUES (BELOW WHICH QNL4 IS NOT + ! CALCULATED). THE THRESHOLD IS SET WITHIN 0 AND 1. + ! This was commented by FA + !======================================================================= + ! AUX00=0.0D0 + ! DO JF=1,NF + ! DO JT=1,NT + ! IF (F(JT,JF).GT.AUX00) AUX00=F(JT,JF) + ! ENDDO + ! ENDDO + ! FSEUIL=AUX00*SEUIL + + TSTOT = 0. + TSDER = 0. + !======================================================================= + ACCMAX=0. + DO JF=JFMIN,JFMAX + SUME=SUM(F(:,JF))*DTH + SATVAL(JF) = SUME*FREQ(JF)**5 + ACCVAL = SUME*FREQ(JF)**4 + IF (ACCVAL.GT.ACCMAX) ACCMAX=ACCVAL + END DO + + + ! ================================================== + ! STARTS LOOP 1 OVER THE SELECTED CONFIGURATIONS + ! ================================================== + DO ICONF=1,NCONF + ! ---------selected configuration characteristics + JF1 =IDCONF(ICONF,1) + JT1 =IDCONF(ICONF,2) + IQ_OM2=IDCONF(ICONF,3) + ! + ! ---------Recovers V1**4=(f1/f0)**4 + V1_4 =TB_V14(JF1) + ! ---------Recovers the shift of the frequency index on f1 + IXF1 =K_IF1(JF1) + ! ---------Recovers the direction indexes for Delat1 + KT1P =K_1P(JT1,JF1) + KT1M =K_1M(JT1,JF1) + ! ---------Recovers V2**4=(f2/f0)**4 and V3**4=(f3/f0)**4 + V2_4 =TB_V24(IQ_OM2,JT1,JF1) + V3_4 =TB_V34(IQ_OM2,JT1,JF1) + ! ---------Recovers the frequency indexes shift on f2 and f3 + IXF2 =K_IF2 (IQ_OM2,JT1,JF1) + IXF3 =K_IF3 (IQ_OM2,JT1,JF1) + ! ---------Recovers the direction indexes shift + KT1P2P=K_1P2P(IQ_OM2,JT1,JF1) + KT1P2M=K_1P2M(IQ_OM2,JT1,JF1) + KT1P3P=K_1P3P(IQ_OM2,JT1,JF1) + KT1P3M=K_1P3M(IQ_OM2,JT1,JF1) + KT1M2P=K_1M2P(IQ_OM2,JT1,JF1) + KT1M2M=K_1M2M(IQ_OM2,JT1,JF1) + KT1M3P=K_1M3P(IQ_OM2,JT1,JF1) + KT1M3M=K_1M3M(IQ_OM2,JT1,JF1) + ! ---------Recovers the coupling coefficients + T2P3M =TB_TPM(IQ_OM2,JT1,JF1) + T2M3P =TB_TMP(IQ_OM2,JT1,JF1) + ! ---------Recovers the multiplicative factor of QNL4 + FACTOR=TB_FAC(IQ_OM2,JT1,JF1) + + ! = = = = = = = = = = = = = = = = = = = = = = = = = + ! STARTS LOOP 2 OVER THE SPECTRUM FREQUENCIES + ! = = = = = = = = = = = = = = = = = = = = = = = = = + DO JF=JFMIN,JFMAX + IF (SATVAL(JF).GT.GQTHRSAT) THEN + ! + !.........Recovers the coefficient for the coupling factor + !.........Computes the coupling coefficients for the case +Delta1 (SIG=1) + SCAL_T=TB_SCA(LBUF+JF)*FACTOR + T_2P3M=T2P3M*SCAL_T + T_2M3P=T2M3P*SCAL_T + ! + !.........Frequency indexes and coefficients + JFM0=F_POIN(JF+LBUF) + CF0 =F_COEF(JF+LBUF) + CP0 =F_PROJ(JF+LBUF) + JFM1=F_POIN(JF+IXF1) + CF1 =F_COEF(JF+IXF1) + CP1 =F_PROJ(JF+IXF1) + JFM2=F_POIN(JF+IXF2) + CF2 =F_COEF(JF+IXF2) + CP2 =F_PROJ(JF+IXF2) + JFM3=F_POIN(JF+IXF3) + CF3 =F_COEF(JF+IXF3) + CP3 =F_PROJ(JF+IXF3) + ! + ! ------------------------------------------------- + ! STARTS LOOP 3 OVER THE SPECTRUM DIRECTIONS + ! ------------------------------------------------- + DO JT=1,NT + ! + !...........Direction indexes + ! direct config (+delta1) (sig =1) + JT1P =T_POIN(JT+KT1P) + JT1P2P=T_POIN(JT+KT1P2P) + JT1P2M=T_POIN(JT+KT1P2M) + JT1P3P=T_POIN(JT+KT1P3P) + JT1P3M=T_POIN(JT+KT1P3M) + ! image config (-delta1) + JT1M =T_POIN(JT+KT1M) + JT1M2P=T_POIN(JT+KT1M2P) + JT1M2M=T_POIN(JT+KT1M2M) + JT1M3P=T_POIN(JT+KT1M3P) + JT1M3M=T_POIN(JT+KT1M3M) + ! + ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + ! STARTS LOOP 4 OVER THE MESH NODES + ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + ! + SP0=F(JT,JFM0)*CF0 + ! + ! IF (SP0.GT.FSEUIL) THEN + ! + ! Config. +Delta1 (SIG=1) + ! ======================= + !...............Computes the spectrum values in 1, 2, 3 + SP1P =F(JT1P ,JFM1)*CF1 + SP1P2P=F(JT1P2P,JFM2)*CF2 + SP1P3M=F(JT1P3M,JFM3)*CF3 + SP1P2M=F(JT1P2M,JFM2)*CF2 + SP1P3P=F(JT1P3P,JFM3)*CF3 + ! + !...............Computes auxiliary products and variables + AUX01=SP0*V1_4+SP1P + AUX02=SP0*SP1P + AUX03=SP1P2P*SP1P3M + AUX04=SP1P2P*V3_4+SP1P3M*V2_4 + AUX05=SP1P2M*SP1P3P + AUX06=SP1P2M*V3_4+SP1P3P*V2_4 + AUX07=AUX02*V3_4 + AUX08=AUX02*V2_4 + ! + !...............Computes the components of the transfer term + S_2P3M=AUX03*AUX01-AUX02*AUX04 + S_2M3P=AUX05*AUX01-AUX02*AUX06 + Q_2P3M=T_2P3M*S_2P3M + Q_2M3P=T_2M3P*S_2M3P + AUX00 =Q_2P3M+Q_2M3P + ! + !...............Computes the components of the derived terms (dQ/dF) + Q2PD0 =T_2P3M*(AUX03*V1_4 - SP1P*AUX04)*CF0 + Q2PD1 =T_2P3M*(AUX03 - SP0 *AUX04)*CF1 + Q2PD2P=T_2P3M*(AUX01*SP1P3M - AUX07 )*CF2 + Q2PD3M=T_2P3M*(AUX01*SP1P2P - AUX08 )*CF3 + Q2MD0 =T_2M3P*(AUX05*V1_4 - SP1P*AUX06)*CF0 + Q2MD1 =T_2M3P*(AUX03 - SP0 *AUX06)*CF1 + Q2MD2M=T_2M3P*(AUX01*SP1P3P - AUX07 )*CF2 + Q2MD3P=T_2M3P*(AUX01*SP1P2M - AUX08 )*CF3 + AUX09=Q2PD0+Q2MD0 + AUX10=Q2PD1+Q2MD1 + ! + !...............Sum of Qnl4 term in the table TSTOT + TSTOT(JT,JFM0 )=TSTOT(JT,JFM0 )+AUX00 *CP0 + TSTOT(JT1P,JFM1 )=TSTOT(JT1P,JFM1 )+AUX00 *CP1 + TSTOT(JT1P2P,JFM2)=TSTOT(JT1P2P,JFM2)-Q_2P3M*CP2 + TSTOT(JT1P2M,JFM2)=TSTOT(JT1P2M,JFM2)-Q_2M3P*CP2 + TSTOT(JT1P3M,JFM3)=TSTOT(JT1P3M,JFM3)-Q_2P3M*CP3 + TSTOT(JT1P3P,JFM3)=TSTOT(JT1P3P,JFM3)-Q_2M3P*CP3 + ! + !...............Sum of the term dQnl4/dF in the table TSDER + TSDER(JT,JFM0)=TSDER(JT,JFM0)+AUX09 *CP0 + TSDER(JT1P,JFM1)=TSDER(JT1P,JFM1)+AUX10 *CP1 + TSDER(JT1P2P,JFM2)=TSDER(JT1P2P,JFM2)-Q2PD2P*CP2 + TSDER(JT1P2M,JFM2)=TSDER(JT1P2M,JFM2)-Q2MD2M*CP2 + TSDER(JT1P3M,JFM3)=TSDER(JT1P3M,JFM3)-Q2PD3M*CP3 + TSDER(JT1P3P,JFM3)=TSDER(JT1P3P,JFM3)-Q2MD3P*CP3 +#ifdef W3_TGQM + ! Test output to set up triplet method ... + WRITE(994,'(5I3,3E12.3)') ICONF,JF,JT,JT, JFM0,AUX00 *CP0, F(JT,JFM0),TSTOT(JT ,JFM0) + WRITE(994,'(5I3,3E12.3)') ICONF,JF,JT,JT1P, JFM1,AUX00 *CP1, F(JT1P,JFM1),TSTOT(JT1P,JFM1) + WRITE(994,'(5I3,3E12.3)') ICONF,JF,JT,JT1P2P,JFM2,-Q_2P3M*CP2,F(JT1P2P,JFM2),TSTOT(JT1P2P,JFM2) + WRITE(994,'(5I3,3E12.3)') ICONF,JF,JT,JT1P2M,JFM2,-Q_2M3P*CP2,F(JT1P2M,JFM2),TSTOT(JT1P2M,JFM2) + WRITE(994,'(5I3,3E12.3)') ICONF,JF,JT,JT1P3M,JFM2,-Q_2P3M*CP3,F(JT1P3M,JFM3),TSTOT(JT1P3M,JFM3) + WRITE(994,'(5I3,3E12.3)') ICONF,JF,JT,JT1P3P,JFM2,-Q_2M3P*CP3,F(JT1P3P,JFM3),TSTOT(JT1P3P,JFM3) + TEMP=(TB_TPM(IQ_OM2,JT1,JF1)*(( F(JT1P2P,JFM2)*CF2 *F(JT1P3M,JFM3)*CF3)* & + (F(JT,JFM0 )*CF0*TB_V14(JF1)+F(JT1P ,JFM1)*CF1) & + -SP0*SP1P*(SP1P2P*V3_4+SP1P3M*V2_4))+T_2M3P*(AUX05*AUX01-AUX02*AUX06)) *CP0 + WRITE(995,'(3I3,3E12.3)') ICONF,JF,JT, F(JT,JFM0) + TEMP=(Q_2P3M+Q_2M3P) *CP1 + WRITE(995,'(5I3,3E12.3)') ICONF,JF,JT,JT1P, JFM1,AUX00 *CP1, F(JT1P,JFM1),TSTOT(JT1P,JFM1) + WRITE(995,'(5I3,3E12.3)') ICONF,JF,JT,JT1P2P,JFM2,-Q_2P3M*CP2,F(JT1P2P,JFM2),TSTOT(JT1P2P,JFM2) + WRITE(995,'(5I3,3E12.3)') ICONF,JF,JT,JT1P2M,JFM2,-Q_2M3P*CP2,F(JT1P2M,JFM2),TSTOT(JT1P2M,JFM2) + WRITE(995,'(5I3,3E12.3)') ICONF,JF,JT,JT1P3M,JFM2,-Q_2P3M*CP3,F(JT1P3M,JFM3),TSTOT(JT1P3M,JFM3) + WRITE(995,'(5I3,3E12.3)') ICONF,JF,JT,JT1P3P,JFM2,-Q_2M3P*CP3,F(JT1P3P,JFM3),TSTOT(JT1P3P,JFM3) +#endif + ! + ! Config. -Delta1 (SIG=-1) + ! ======================== + !...............Computes the spectrum values in 1, 2, 3 + SP1M =F(JT1M ,JFM1)*CF1 + SP1M2P=F(JT1M2P,JFM2)*CF2 + SP1M3M=F(JT1M3M,JFM3)*CF3 + SP1M2M=F(JT1M2M,JFM2)*CF2 + SP1M3P=F(JT1M3P,JFM3)*CF3 + ! + !...............Computes auxiliary products and variables + AUX01=SP0*V1_4+SP1M + AUX02=SP0*SP1M + AUX03=SP1M2P*SP1M3M + AUX04=SP1M2P*V3_4+SP1M3M*V2_4 + AUX05=SP1M2M*SP1M3P + AUX06=SP1M2M*V3_4+SP1M3P*V2_4 + AUX07=AUX02*V3_4 + AUX08=AUX02*V2_4 + ! + !...............Computes the transfer term components + S_2P3M=AUX03*AUX01-AUX02*AUX04 + S_2M3P=AUX05*AUX01-AUX02*AUX06 + Q_2P3M=T_2M3P*S_2P3M + Q_2M3P=T_2P3M*S_2M3P + AUX00 =Q_2P3M+Q_2M3P ! Same as in +Delta1, can be commented out + ! + !...............Computes the derived terms components (dQ/dF) + Q2PD0 =T_2P3M*(AUX03*V1_4 - SP1M*AUX04)*CF0 + Q2PD1 =T_2P3M*(AUX03 - SP0 *AUX04)*CF1 + Q2PD2P=T_2P3M*(AUX01*SP1M3M - AUX07 )*CF2 + Q2PD3M=T_2P3M*(AUX01*SP1M2P - AUX08 )*CF3 + Q2MD0 =T_2M3P*(AUX05*V1_4 - SP1M*AUX06)*CF0 + Q2MD1 =T_2M3P*(AUX03 - SP0 *AUX06)*CF1 + Q2MD2M=T_2M3P*(AUX01*SP1M3P - AUX07 )*CF2 + Q2MD3P=T_2M3P*(AUX01*SP1M2M - AUX08 )*CF3 + AUX09=Q2PD0+Q2MD0 + AUX10=Q2PD1+Q2MD1 + ! + !...............Sum of Qnl4 term in the table TSTOT + TSTOT(JT ,JFM0)=TSTOT(JT ,JFM0)+AUX00 *CP0 + TSTOT(JT1M ,JFM1)=TSTOT(JT1M ,JFM1)+AUX00 *CP1 + TSTOT(JT1M2P,JFM2)=TSTOT(JT1M2P,JFM2)-Q_2P3M*CP2 + TSTOT(JT1M2M,JFM2)=TSTOT(JT1M2M,JFM2)-Q_2M3P*CP2 + TSTOT(JT1M3M,JFM3)=TSTOT(JT1M3M,JFM3)-Q_2P3M*CP3 + TSTOT(JT1M3P,JFM3)=TSTOT(JT1M3P,JFM3)-Q_2M3P*CP3 + ! + !...............Sum of the term dQnl4/dF in the table TSDER + TSDER(JT ,JFM0)=TSDER(JT ,JFM0)+AUX09 *CP0 + TSDER(JT1M ,JFM1)=TSDER(JT1M ,JFM1)+AUX10 *CP1 + TSDER(JT1M2P,JFM2)=TSDER(JT1M2P,JFM2)-Q2PD2P*CP2 + TSDER(JT1M2M,JFM2)=TSDER(JT1M2M,JFM2)-Q2MD2M*CP2 + TSDER(JT1M3M,JFM3)=TSDER(JT1M3M,JFM3)-Q2PD3M*CP3 + TSDER(JT1M3P,JFM3)=TSDER(JT1M3P,JFM3)-Q2MD3P*CP3 + ! +#ifdef W3_TGQM + WRITE(994,'(5I3,3E12.3)') ICONF,JF,JT,JT, JFM0,AUX00 *CP0, F(JT,JFM0),TSTOT(JT ,JFM0) + WRITE(994,'(5I3,3E12.3)') ICONF,JF,JT,JT1M, JFM1,AUX00 *CP1, F(JT1M,JFM1),TSTOT(JT1M,JFM1) + WRITE(994,'(5I3,3E12.3)') ICONF,JF,JT,JT1M2P,JFM2,-Q_2P3M*CP2,F(JT1M2P,JFM2),TSTOT(JT1M2P,JFM2) + WRITE(994,'(5I3,3E12.3)') ICONF,JF,JT,JT1M2M,JFM2,-Q_2M3P*CP2,F(JT1M2M,JFM2),TSTOT(JT1M2M,JFM2) + WRITE(994,'(5I3,3E12.3)') ICONF,JF,JT,JT1M3M,JFM2,-Q_2P3M*CP3,F(JT1M3M,JFM3),TSTOT(JT1M3M,JFM3) + WRITE(994,'(5I3,3E12.3)') ICONF,JF,JT,JT1M3P,JFM2,-Q_2M3P*CP3,F(JT1M3P,JFM3),TSTOT(JT1M3P,JFM3) +#endif + ! + ! ENDIF ! this was the test on SEUIL + ! + ENDDO + ! ------------------------------------------------- + ! END OF LOOP 3 OVER THE SPECTRUM DIRECTIONS + ! ------------------------------------------------- + ! + ENDIF ! End of test on saturation level + ENDDO + ! = = = = = = = = = = = = = = = = = = = = = = = = = + ! END OF LOOP 2 OVER THE SPECTRUM FREQUENCIES + ! = = = = = = = = = = = = = = = = = = = = = = = = = + ! + ENDDO + ! ================================================== + ! END OF LOOP 1 OVER THE SELECTED CONFIGURATIONS + ! ================================================== + ! Applying WAM DEPTH SCALING ! to be added later ... + ! CALL q_dscale(F,WN,SIG,DTH,NK,NTH,DEPTH,q_dfac) + q_dfac=1 + + ! Amplification inspired by Lavrenov 2001, eq 10. + AMPFAC=GQAMP(4)*MIN(MAX(ACCMAX/GQAMP(2),1.)**GQAMP(1),GQAMP(3)) + !WRITE(991,*) ACCMAX,q_dfac,AMPFAC,GQAMP(1:3),SATVAL(10),SATVAL(30) + + ! Replacing Double Precision with Simple Real and scaling + TSTOTn = TSTOT*q_dfac*AMPFAC + TSDERn = TSDER*q_dfac*AMPFAC + + + ! Converting Snl(theta,f) to Snl(theta,k)/sigma + DO ITH = 1,NT + DO IK = 1,NF + TSTOTn(ITH,IK) = TSTOTn(ITH,IK)*CG(IK)/(TPI*SIG(IK)) + ENDDO + ENDDO + !CLOSE(994) + !STOP + END SUBROUTINE W3SNLGQM + + !/ ------------------------------------------------------------------- / + FUNCTION COUPLE(XK1 ,YK1 ,XK2 ,YK2 ,XK3 ,YK3 ,XK4 ,YK4) + !/ + !/ +-----------------------------------+ + !/ | WAVEWATCH III NOAA/NCEP | + !/ | M. Benoit & E. Gagnaire-Renou | + !/ | Last update : 20-Nov-2022 | + !/ +-----------------------------------+ + !/ + !/ 19-Nov-2022 : Transfer from TOMAWAC code ( version 7.xx ) + !/ + ! 1. Purpose : + ! + ! Computes the 4-wave coupling coefficient used in Snl4 + ! + ! 2. Method : + ! + ! Uses theoretical expression by Webb (1978) + ! + ! 3. Parameters : + ! + ! Parameter list + ! ---------------------------------------------------------------- + ! XK1 Real I x component of k1 wavenumber ... + ! ---------------------------------------------------------------- + ! + ! 5. Called by : + ! + ! Name Type Module Description + ! ---------------------------------------------------------------- + ! INNSLGQM Subr. W3SNL2 Prepares source term integration. + ! ---------------------------------------------------------------- + ! + ! 6. Error messages : + ! + ! None. + ! + ! 10. Source code : + ! + !/ ------------------------------------------------------------------- / + USE CONSTANTS, ONLY: GRAV + ! + IMPLICIT NONE + + DOUBLE PRECISION, INTENT(IN) :: XK1 , YK1 , XK2 , YK2 + DOUBLE PRECISION, INTENT(IN) :: XK3 , YK3 + DOUBLE PRECISION, INTENT(IN) :: XK4 , YK4 + DOUBLE PRECISION COUPLE + ! + !.....LOCAL VARIABLES + ! """""""""""""""""" + DOUBLE PRECISION RK1 , RK2 , RK3 , RK4 , WK1 , WK2 + DOUBLE PRECISION WK3 , WK4 , S12 , S13 , S14 , S23 + DOUBLE PRECISION S24 , S34 , W1P2 , Q12 , W1M3 , Q13 + DOUBLE PRECISION W1M4 , Q14 , DDD , COEF , DENO13, NUME13 + DOUBLE PRECISION DENO14, NUME14, ZERO, PI + + ! + PI = ACOS(-1.) + COEF=PI*GRAV*GRAV/4.D0 + ZERO=1.D-10 + ! + RK1=SQRT(XK1*XK1+YK1*YK1) + RK2=SQRT(XK2*XK2+YK2*YK2) + RK3=SQRT(XK3*XK3+YK3*YK3) + RK4=SQRT(XK4*XK4+YK4*YK4) + ! + WK1=SQRT(RK1) + WK2=SQRT(RK2) + WK3=SQRT(RK3) + WK4=SQRT(RK4) + ! + S12=XK1*XK2+YK1*YK2 + S13=XK1*XK3+YK1*YK3 + S14=XK1*XK4+YK1*YK4 + S23=XK2*XK3+YK2*YK3 + S24=XK2*XK4+YK2*YK4 + S34=XK3*XK4+YK3*YK4 + ! + W1P2=SQRT((XK1+XK2)*(XK1+XK2)+(YK1+YK2)*(YK1+YK2)) + W1M3=SQRT((XK1-XK3)*(XK1-XK3)+(YK1-YK3)*(YK1-YK3)) + W1M4=SQRT((XK1-XK4)*(XK1-XK4)+(YK1-YK4)*(YK1-YK4)) + Q12=(WK1+WK2)*(WK1+WK2) + Q13=(WK1-WK3)*(WK1-WK3) + Q14=(WK1-WK4)*(WK1-WK4) + ! + !.....COMPUTES THE D COEFFICIENT OF WEBB (1978) + ! """""""""""""""""""""""""""""""""""""" + DDD=2.00D0*Q12*(RK1*RK2-S12)*(RK3*RK4-S34)/(W1P2-Q12) & + +0.50D0*(S12*S34+S13*S24+S14*S23) & + +0.25D0*(S13+S24)*Q13*Q13 & + -0.25D0*(S12+S34)*Q12*Q12 & + +0.25D0*(S14+S23)*Q14*Q14 & + +2.50D0*RK1*RK2*RK3*RK4 & + +Q12*Q13*Q14*(RK1+RK2+RK3+RK4) + + DENO13=W1M3-Q13 + NUME13=2.00D0*Q13*(RK1*RK3+S13)*(RK2*RK4+S24) + IF (ABS(DENO13).LT.ZERO) THEN + IF (ABS(NUME13).LT.ZERO) THEN + WRITE(*,*) 'W3SNL2 error for coupling coefficient : (1-3) 0/0 !' + ELSE + WRITE(*,*) 'W3SNL2 error for coupling coefficient : (1-3) inifinte value' + ENDIF + WRITE(*,*) 'W3SNL2 error for coupling coefficient : (1-3) term not used' + ELSE + DDD=DDD+NUME13/DENO13 + ENDIF + DENO14=W1M4-Q14 + NUME14=2.00D0*Q14*(RK1*RK4+S14)*(RK2*RK3+S23) + IF (ABS(DENO14).LT.ZERO) THEN + IF (ABS(NUME14).LT.ZERO) THEN + WRITE(*,*) 'W3SNL2 error for coupling coefficient : (1-4) 0/0 !' + ELSE + WRITE(*,*) 'W3SNL2 error for coupling coefficient : (1-4) inifinte value' + ENDIF + WRITE(*,*) 'W3SNL2 error for coupling coefficient : (1-4) term not used' + ELSE + DDD=DDD+NUME14/DENO14 + ENDIF + + COUPLE=COEF*DDD*DDD/(WK1*WK2*WK3*WK4) + ! RETURN + END FUNCTION COUPLE + + !/ ------------------------------------------------------------------- / + SUBROUTINE GAULEG (W_LEG ,X_LEG ,NPOIN) + !/ ------------------------------------------------------------------- / + !.....VARIABLES IN ARGUMENT + ! """""""""""""""""""" + IMPLICIT NONE + INTEGER , INTENT(IN) :: NPOIN + DOUBLE PRECISION ,INTENT(INOUT) :: W_LEG(NPOIN) , X_LEG(NPOIN) + ! + !.....LOCAL VARIABLES + ! """"""""""""""""" + INTEGER I, M, J + DOUBLE PRECISION EPS, Z, P1, P2, P3, PP, Z1, PI + PARAMETER (EPS=3.D-14) + ! + PI = ACOS(-1.) + M=(NPOIN+1)/2 + DO I=1,M + Z=COS(PI*(DBLE(I)-0.25D0)/(DBLE(NPOIN)+0.5D0)) +1 CONTINUE + P1=1.0D0 + P2=0.0D0 + DO J=1,NPOIN + P3=P2 + P2=P1 + P1=((2.D0*DBLE(J)-1.D0)*Z*P2-(DBLE(J)-1.D0)*P3)/DBLE(J) + ENDDO + PP=DBLE(NPOIN)*(Z*P1-P2)/(Z*Z-1.D0) + Z1=Z + Z=Z-P1/PP + IF (ABS(Z-Z1).GT.EPS) GOTO 1 + X_LEG(I)=-Z + X_LEG(NPOIN+1-I)=Z + W_LEG(I)=2.D0/((1.D0-Z**2)*PP**2) + W_LEG(NPOIN+1-I)=W_LEG(I) + ENDDO + END SUBROUTINE GAULEG + + !/ ------------------------------------------------------------------- / + SUBROUTINE F1F1F1(F1SF,NF1,IQ_OM1) + ! TOMAWAC V6P3 15/06/2011 + !*********************************************************************** + ! + !brief SUBROUTINE CALLED BY PRENL3 + !+ COMPUTES VALUES OF RATIO F1/F AS FUNCTION OF THE IQ_OM1 + !+ INDICATOR + ! + !history E. GAGNAIRE-RENOU + !+ 04/2011 + !+ V6P1 + !+ CREATED + ! + !history G.MATTAROLO (EDF - LNHE) + !+ 15/06/2011 + !+ V6P1 + !+ Translation of French names of the variables in argument + ! + !history E. GAGNAIRE-RENOU + !+ 12/03/2013 + !+ V6P3 + !+ Better formatted: WRITE(LU,*), etc. + !/ ------------------------------------------------------------------- / + IMPLICIT NONE + INTEGER, INTENT(IN) :: IQ_OM1 + INTEGER, INTENT(INOUT) :: NF1 + DOUBLE PRECISION, INTENT(INOUT) :: F1SF(*) + ! + INTEGER I,M + DOUBLE PRECISION RAISON + ! + IF(IQ_OM1.EQ.1) THEN + IF(NF1.NE.14) THEN + WRITE(*,*) '#1 Incorrect value for NF1',NF1 + ENDIF + F1SF( 1)=0.30D0 + F1SF( 2)=0.40D0 + F1SF( 3)=0.50D0 + F1SF( 4)=0.60D0 + F1SF( 5)=0.70D0 + F1SF( 6)=0.80D0 + F1SF( 7)=0.90D0 + F1SF( 8)=1.00D0 + F1SF( 9)=1.11D0 + F1SF(10)=1.25D0 + F1SF(11)=1.42D0 + F1SF(12)=1.67D0 + F1SF(13)=2.00D0 + F1SF(14)=2.50D0 + F1SF(15)=3.30D0 + ELSEIF(IQ_OM1.EQ.2) THEN + IF (NF1.NE.26) THEN + WRITE(*,*) '#2 Incorrect value for NF1', NF1 + ENDIF + F1SF( 1)=0.32D0 + F1SF( 2)=0.35D0 + F1SF( 3)=0.39D0 + F1SF( 4)=0.44D0 + F1SF( 5)=0.50D0 + F1SF( 6)=0.56D0 + F1SF( 7)=0.63D0 + F1SF( 8)=0.70D0 + F1SF( 9)=0.78D0 + F1SF(10)=0.86D0 + F1SF(11)=0.92D0 + F1SF(12)=0.97D0 + F1SF(13)=1.00D0 + F1SF(14)=1.03D0 + F1SF(15)=1.08D0 + F1SF(16)=1.13D0 + F1SF(17)=1.20D0 + F1SF(18)=1.28D0 + F1SF(19)=1.37D0 + F1SF(20)=1.48D0 + F1SF(21)=1.50D0 + F1SF(22)=1.65D0 + F1SF(23)=1.85D0 + F1SF(24)=2.10D0 + F1SF(25)=2.40D0 + F1SF(26)=2.70D0 + F1SF(27)=3.20D0 + ELSEIF(IQ_OM1.EQ.3) THEN + IF(NF1.NE.11) THEN + WRITE(*,*) 'Incorrect value for NF1', NF1 + ENDIF + F1SF( 1)=0.30D0 + F1SF( 2)=0.48D0 + F1SF( 3)=0.64D0 + F1SF( 4)=0.78D0 + F1SF( 5)=0.90D0 + F1SF( 6)=1.00D0 + F1SF( 7)=1.12D0 + F1SF( 8)=1.28D0 + F1SF( 9)=1.50D0 + F1SF(10)=1.80D0 + F1SF(11)=2.40D0 + F1SF(12)=3.40D0 + ELSEIF(IQ_OM1.EQ.4) THEN + IF(NF1.NE.40) THEN + WRITE(*,*) 'Incorrect value for NF1', NF1 + ENDIF + NF1=20 + M=10 + RAISON=9.D0**(1.D0/DBLE(NF1)) + F1SF(M+1)=1.0D0/3.0D0 + NF1=2*M+NF1 + DO I=M+2,NF1+1 + F1SF(I)=F1SF(I-1)*RAISON + ENDDO + DO I=M,1,-1 + F1SF(I)=F1SF(I+1)/RAISON + ENDDO + ELSEIF(IQ_OM1.EQ.5) THEN + RAISON=9.D0**(1.D0/DBLE(NF1)) + F1SF(1)=1.D0/3.D0 + DO I=2,NF1+1 + F1SF(I)=F1SF(I-1)*RAISON + ENDDO + ELSEIF(IQ_OM1.EQ.6) THEN + RAISON=(3.D0-1.D0/3.D0)/DBLE(NF1) + F1SF(1)=1.D0/3.D0 + DO I=2,NF1+1 + F1SF(I)=F1SF(I-1)+RAISON + ENDDO + ELSEIF(IQ_OM1.EQ.7) THEN + IF(NF1.NE.20) THEN + WRITE(*,*) 'Incorrect value for NF1', NF1 + ENDIF + F1SF( 1)=1.D0/3.D0 + F1SF( 2)=0.40D0 + F1SF( 3)=0.46D0 + F1SF( 4)=0.52D0 + F1SF( 5)=0.60D0 + F1SF( 6)=0.70D0 + F1SF( 7)=0.79D0 + F1SF( 8)=0.86D0 + F1SF( 9)=0.92D0 + F1SF(10)=0.97D0 + F1SF(11)=1.00D0 + F1SF(12)=1.04D0 + F1SF(13)=1.10D0 + F1SF(14)=1.18D0 + F1SF(15)=1.28D0 + F1SF(16)=1.42D0 + F1SF(17)=1.60D0 + F1SF(18)=1.84D0 + F1SF(19)=2.14D0 + F1SF(20)=2.52D0 + F1SF(21)=3.00D0 + ENDIF + ! + END SUBROUTINE F1F1F1 + !/ ------------------------------------------------------------------- / + SUBROUTINE INSNLGQM + !/ + !/ +-----------------------------------+ + !/ | WAVEWATCH III NOAA/NCEP | + !/ | E. Gagnaire-Renou & | + !/ | M. Benoit | + !/ | S. Mostafa Siadatamousavi | + !/ | M. Beyramzadeh | + !/ | FORTRAN 90 | + !/ | Last update : 20-Nov-2022 | + !/ +-----------------------------------+ + !/ + !/ 20-Nov-2022 : Merging with NL2 in WW3. ( version 7.00 ) + !/ + ! 1. Purpose : + ! + ! Preprocessing for nonlinear interactions (Xnl). + ! + ! 2. Method : + ! + ! See Xnl documentation. + ! + ! 3. Parameters : + ! + ! 4. Subroutines used : + ! + ! Name Type Module Description + ! ---------------------------------------------------------------- + ! STRACE Subr. W3SERVMD Subroutine tracing. + ! Subr. GAULEG Gauss-Legendre weights + ! xnl_init Subr. m_constants Xnl initialization routine. + ! ---------------------------------------------------------------- + ! + ! 5. Called by : + ! + ! Name Type Module Description + ! ---------------------------------------------------------------- + ! W3IOGR Subr. W3IOGRMD Model definition file management. + ! ---------------------------------------------------------------- + ! + ! 6. Error messages : + ! + ! 7. Remarks : + ! + ! 8. Structure : + ! + ! - See source code. + ! + ! 9. Switches : + ! + ! !/S Enable subroutine tracing. + ! + ! 10. Source code : + ! + !/ ------------------------------------------------------------------- / + USE CONSTANTS, ONLY: GRAV + USE W3GDATMD, ONLY: NK , NTH , XFR , FR1, GQNF1, GQNT1, GQNQ_OM2, NLTAIL, GQTHRCOU + +#ifdef W3_S + CALL STRACE (IENT, 'INSNLGQM') +#endif + IMPLICIT NONE + !.....LOCAL VARIABLES + INTEGER JF , JT , JF1 , JT1 , NF1P1 , IAUX , NT , NF , IK + INTEGER IQ_TE1 , IQ_OM2 , LBUF , DIMBUF , IQ_OM1 , NQ_TE1 , NCONFM + + DOUBLE PRECISION EPSI_A, AUX , CCC , DENO , AAA , DP2SG , TAILF + DOUBLE PRECISION V1 , V1_4 , DV1 , DTETAR , ELIM , RAISF + DOUBLE PRECISION V2 , V2_4 , V3 , V3_4 + DOUBLE PRECISION W2 , W2_M , W2_1 , W_MIL , W_RAD + DOUBLE PRECISION RK0 , XK0 , YK0 , RK1 , XK1 , YK1 + DOUBLE PRECISION RK2 , XK2P , YK2P , XK2M , YK2M + DOUBLE PRECISION RK3 , XK3P , YK3P , XK3M , YK3M + DOUBLE PRECISION D01P , C_D01P, S_D01P, D0AP , C_D0AP, S_D0AP + DOUBLE PRECISION GA2P , C_GA2P, S_GA2P, GA3P , C_GA3P, S_GA3P, TWOPI, PI, SEUIL1 , SEUIL2 , SEUIL + ! + !.....Variables related to the Gaussian quadratures + DOUBLE PRECISION W_CHE_TE1, W_CHE_OM2, C_LEG_OM2 + ! + !.....Variables related to the configuration selection + DOUBLE PRECISION TEST1 , TEST2 + DOUBLE PRECISION :: FREQ(NK) + DOUBLE PRECISION, ALLOCATABLE :: F1SF(:) , X_CHE_TE1(:) , X_CHE_OM2(:) , X_LEG_OM2(:) , W_LEG_OM2(:) & + , MAXCLA(:) + + PI = Acos(-1.) + LBUF = 500 + DIMBUF = 2*LBUF+200 + TWOPI = 2.*PI + ! + ! Defines some threshold values for filtering (See Gagnaire-Renou Thesis, p 52) + ! + SEUIL1 = 1E10 + SEUIL2 = GQTHRCOU + + IF(GQNF1.EQ.14) IQ_OM1=1 + IF(GQNF1.EQ.26) IQ_OM1=2 + IF(GQNF1.EQ.11) IQ_OM1=3 + IF(GQNF1.EQ.40) IQ_OM1=4 + IF(GQNF1.EQ.11) IQ_OM1=3 + IF(GQNF1.EQ.40) IQ_OM1=4 + IF(GQNF1.EQ.20) IQ_OM1=7 + ! + ! Note by FA: not sure what the 5 and 6 cases correspond to + ! + NQ_TE1 = GQNT1/2 + NCONFM = GQNF1*GQNT1*GQNQ_OM2 + + RAISF = XFR + NT = NTH + NF = NK + DTETAR = TWOPI/DBLE(NT) + + DO IK = 1,NK + FREQ(IK) = FR1*RAISF**(IK-1) + ENDDO + + TAILF = -NLTAIL + + !===============ALLOCATE MATRICES============================================= + if (Allocated(K_IF2) ) then + deallocate(K_IF2) + endif + ALLOCATE(K_IF2(GQNQ_OM2,GQNT1,GQNF1)) + + if (Allocated(K_IF3) ) then + deallocate(K_IF3) + endif + ALLOCATE(K_IF3(GQNQ_OM2,GQNT1,GQNF1)) + + if (Allocated(K_1P2P) ) then + deallocate(K_1P2P) + endif + ALLOCATE(K_1P2P(GQNQ_OM2,GQNT1,GQNF1)) + + if (Allocated(K_1P3M) ) then + deallocate(K_1P3M) + endif + ALLOCATE(K_1P3M(GQNQ_OM2,GQNT1,GQNF1)) + + if (Allocated(K_1P2M) ) then + deallocate(K_1P2M) + endif + ALLOCATE(K_1P2M(GQNQ_OM2,GQNT1,GQNF1)) + + if (Allocated(K_1P3P) ) then + deallocate(K_1P3P) + endif + ALLOCATE(K_1P3P(GQNQ_OM2,GQNT1,GQNF1)) + + if (Allocated(K_1M2P) ) then + deallocate(K_1M2P) + endif + ALLOCATE(K_1M2P(GQNQ_OM2,GQNT1,GQNF1)) + + if (Allocated(K_1M3M) ) then + deallocate(K_1M3M) + endif + ALLOCATE(K_1M3M(GQNQ_OM2,GQNT1,GQNF1)) + + if (Allocated(K_1M2M) ) then + deallocate(K_1M2M) + endif + ALLOCATE(K_1M2M(GQNQ_OM2,GQNT1,GQNF1)) + + if (Allocated(K_1M3P) ) then + deallocate(K_1M3P) + endif + ALLOCATE(K_1M3P(GQNQ_OM2,GQNT1,GQNF1)) + + if (Allocated(TB_V24) ) then + deallocate(TB_V24) + endif + ALLOCATE(TB_V24(GQNQ_OM2,GQNT1,GQNF1)) + + if (Allocated(TB_V34) ) then + deallocate(TB_V34) + endif + ALLOCATE(TB_V34(GQNQ_OM2,GQNT1,GQNF1)) + + if (Allocated(TB_TPM) ) then + deallocate(TB_TPM) + endif + ALLOCATE(TB_TPM(GQNQ_OM2,GQNT1,GQNF1)) + + if (Allocated(TB_TMP) ) then + deallocate(TB_TMP) + endif + ALLOCATE(TB_TMP(GQNQ_OM2,GQNT1,GQNF1)) + + if (Allocated(TB_FAC) ) then + deallocate(TB_FAC) + endif + ALLOCATE(TB_FAC(GQNQ_OM2,GQNT1,GQNF1)) + + if (Allocated(K_IF1) ) then + deallocate(K_IF1) + endif + ALLOCATE(K_IF1(GQNF1)) + + if (Allocated(K_1P) ) then + deallocate(K_1P) + endif + ALLOCATE(K_1P(GQNT1,GQNF1)) + + if (Allocated(K_1M) ) then + deallocate(K_1M) + endif + ALLOCATE(K_1M(GQNT1,GQNF1)) + + if (Allocated(TB_V14) ) then + deallocate(TB_V14) + endif + ALLOCATE(TB_V14(GQNF1)) + + if (Allocated(IDCONF) ) then + deallocate(IDCONF) + endif + ALLOCATE(IDCONF(NCONFM,3)) + + !======================================================================= + ! INITIALISATION OF AUXILIAIRY TABLES FOR SPECTRUM INTERPOLATION + !======================================================================= + if (Allocated(F_POIN) ) then + deallocate(F_POIN) + endif + ALLOCATE(F_POIN(DIMBUF)) + + if (Allocated(T_POIN) ) then + deallocate(T_POIN) + endif + ALLOCATE(T_POIN(DIMBUF)) + + if (Allocated(F_COEF) ) then + deallocate(F_COEF) + endif + ALLOCATE(F_COEF(DIMBUF)) + + if (Allocated(F_PROJ) ) then + deallocate(F_PROJ) + endif + ALLOCATE(F_PROJ(DIMBUF)) + + if (Allocated(TB_SCA) ) then + deallocate(TB_SCA) + endif + ALLOCATE(TB_SCA(DIMBUF)) + + + F_POIN(:)=0 + T_POIN(:)=0 + F_COEF(:)=0.D0 + F_PROJ(:)=0.D0 + TB_SCA(:)=0.0D0 + + DO JF=1,LBUF + F_POIN(JF)=1 + F_COEF(JF)=0.0D0 + F_PROJ(JF)=0.0D0 + ENDDO + DO JF=1,NF + IAUX=LBUF+JF + F_POIN(IAUX)=JF + F_COEF(IAUX)=1.0D0 + F_PROJ(IAUX)=1.0D0 + ENDDO + AUX=1.D0/RAISF**TAILF + DO JF=1,LBUF + IAUX=LBUF+NF+JF + F_POIN(IAUX)=NF + F_COEF(IAUX)=AUX**JF + F_PROJ(IAUX)=0.0D0 + ENDDO + ! + DO JT=LBUF,1,-1 + T_POIN(JT)=NT-MOD(LBUF-JT,NT) + ENDDO + DO JT=1,NT + T_POIN(LBUF+JT)=JT + ENDDO + DO JT=1,LBUF + T_POIN(LBUF+NT+JT)=MOD(JT-1,NT)+1 + ENDDO + !====================================================================== + ! + !======================================================================= + ! COMPUTES SCALE COEFFICIENTS FOR THE COUPLING COEFFICIENT + ! Would be easier to pass these on from W3SRCE ??? + !======================================================================= + DP2SG=TWOPI*TWOPI/GRAV + DO JF=1,LBUF + AUX=FREQ(1)/RAISF**(LBUF-JF+1) + TB_SCA(JF)=(DP2SG*AUX**2)**6/(TWOPI**3*AUX) + ENDDO + DO JF=1,NF + TB_SCA(LBUF+JF)=(DP2SG*FREQ(JF)**2)**6/(TWOPI**3*FREQ(JF)) + ENDDO + DO JF=1,LBUF + IAUX=LBUF+NF+JF + AUX=FREQ(NF)*RAISF**JF + TB_SCA(IAUX)=(DP2SG*AUX**2)**6/(TWOPI**3*AUX) + ENDDO + !======================================================================= + ! + !======================================================================= + ! COMPUTES VALUES FOR GAUSSIAN QUADRATURES + !======================================================================= + if (Allocated(X_CHE_TE1) ) then + deallocate(X_CHE_TE1) + endif + ALLOCATE(X_CHE_TE1(1:NQ_TE1),X_CHE_OM2(1:GQNQ_OM2)) + + if (Allocated(X_LEG_OM2) ) then + deallocate(X_LEG_OM2) + endif + ALLOCATE(X_LEG_OM2(1:GQNQ_OM2),W_LEG_OM2(1:GQNQ_OM2)) + ! + !.....Abscissa and weight (constant) for Gauss-Chebyshev + DO IQ_TE1=1,NQ_TE1 + X_CHE_TE1(IQ_TE1)=COS(PI*(DBLE(IQ_TE1)-0.5D0)/DBLE(NQ_TE1)) + ENDDO + W_CHE_TE1=PI/DBLE(NQ_TE1) + DO IQ_OM2=1,GQNQ_OM2 + X_CHE_OM2(IQ_OM2)=COS(PI*(DBLE(IQ_OM2)-0.5D0)/DBLE(GQNQ_OM2)) + ENDDO + W_CHE_OM2=PI/DBLE(GQNQ_OM2) + ! + !.....Abscissa et weight for Gauss-Legendre + CALL GAULEG( W_LEG_OM2 , X_LEG_OM2 , GQNQ_OM2 ) + DO IQ_OM2=1,GQNQ_OM2 + X_LEG_OM2(IQ_OM2)=0.25D0*(1.D0+X_LEG_OM2(IQ_OM2))**2 + ENDDO + !======================================================================= + ! + ! + !======================================================================= + ! COMPUTES VALUES OF RATIO F1/F AS FUNCTION OF THE IQ_OM1 INDICATOR + !======================================================================= + NF1P1=GQNF1+1 + if (Allocated(F1SF) ) then + deallocate(F1SF) + endif + ALLOCATE(F1SF(1:NF1P1)) + + CALL F1F1F1 ( F1SF , GQNF1 , IQ_OM1) + !======================================================================= + ! + ! ================================================== + ! STARTS LOOP 1 OVER THE RATIOS F1/F0 + ! ================================================== + DO JF1=1,GQNF1 + ! ---------Computes and stores v1=f1/f0 and v1**4 + V1=(F1SF(JF1+1)+F1SF(JF1))/2.D0 + K_IF1(JF1)=NINT(DBLE(LBUF)+LOG(V1)/LOG(RAISF)) + V1_4=V1**4 + TB_V14(JF1)=V1_4 + ! ---------Computes and stores dv1=df1/f0 + DV1=F1SF(JF1+1)-F1SF(JF1) + ! ---------Computes the A parameter + AAA=((1.D0+V1)**4-4.D0*(1.D0+V1_4))/(8.D0*V1**2) + ! + ! ================================================= + ! STARTS LOOP 2 OVER THE DELTA_1+ VALUES + ! ================================================= + DO JT1=1,GQNT1 + ! + !......Computes the Delta1+ values (=Theta_1-Theta_0) between 0 and Pi. + IF (JT1.LE.NQ_TE1) THEN + ! ---------First interval : X from -1 to A + IQ_TE1=JT1 + C_D01P=(-1.D0+AAA)/2.D0+(1.D0+AAA)/2.D0*X_CHE_TE1(IQ_TE1) + CCC=DV1*SQRT((AAA-C_D01P)/(1.D0-C_D01P))*W_CHE_TE1 + ELSE + ! ---------Second interval : X from A to 1 + IQ_TE1=JT1-NQ_TE1 + C_D01P=( 1.D0+AAA)/2.D0+(1.D0-AAA)/2.D0*X_CHE_TE1(IQ_TE1) + CCC=DV1*SQRT((C_D01P-AAA)/(1.D0+C_D01P))*W_CHE_TE1 + ENDIF + S_D01P=SQRT(1.D0-C_D01P*C_D01P) + D01P =ACOS(C_D01P) + K_1P(JT1,JF1)=LBUF+NINT(D01P/DTETAR) + K_1M(JT1,JF1)=LBUF-NINT(D01P/DTETAR) + ! + ! ---------Computes Epsilon_a + EPSI_A=2.D0*SQRT(1.D0+V1_4+2.D0*V1*V1*C_D01P)/(1.D0+V1)**2 + ! ---------Computes Delta_A+ and its cosinus + C_D0AP=(1.D0-V1_4+0.25D0*EPSI_A**2*(1.D0+V1)**4) & + /(EPSI_A*(1.D0+V1)**2) + S_D0AP=SQRT(1.0D0-C_D0AP*C_D0AP) + D0AP = ACOS(C_D0AP) + ! + !.......Integration over OMEGA2 depending on EPS_A + IF (EPSI_A.LT.1.D0) THEN + ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - + !........Case of a single singularity (in OMEGA2-) + ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - + W2_M=0.5D0*(1.D0-EPSI_A/2.D0) + W2_1=0.5D0 + ! + W_RAD=W2_1-W2_M + C_LEG_OM2=SQRT(W_RAD) + ! + ! ---------------------------------------------------- + !........STARTS LOOP 3 OVER OMEGA_2 (CASE Epsilon_A < 1) + !........Case of a single singularity (in OMEGA2-) + !........Integration over OMEGA2 via GAUSS-LEGENDRE quadrature + ! ---------------------------------------------------- + DO IQ_OM2=1,GQNQ_OM2 + ! ---------Computes W2, V2, and V3 + W2=W2_M+W_RAD*X_LEG_OM2(IQ_OM2) + V2=W2*(1.D0+V1) + V2_4=V2**4 + TB_V24(IQ_OM2,JT1,JF1)=V2_4 + K_IF2 (IQ_OM2,JT1,JF1) = NINT(DBLE(LBUF) & + + LOG(V2)/LOG(RAISF)) + V3=1.D0+V1-V2 + V3_4=V3**4 + TB_V34(IQ_OM2,JT1,JF1)=V3_4 + K_IF3 (IQ_OM2,JT1,JF1) = NINT(DBLE(LBUF) & + + LOG(V3)/LOG(RAISF)) + ! ---------Computes Gamma_2+ et Gamma_3+ angles + C_GA2P=(EPSI_A**2/4.D0+W2**4-(1.D0-W2)**4)/(EPSI_A*W2*W2) + C_GA2P=MAX(MIN(C_GA2P,1.D0),-1.D0) + S_GA2P=SQRT(1.D0-C_GA2P*C_GA2P) + GA2P =ACOS(C_GA2P) + C_GA3P=(EPSI_A**2/4.D0-W2**4+(1.D0-W2)**4)/EPSI_A & + /(1.D0-W2)**2 + C_GA3P=MAX(MIN(C_GA3P,1.D0),-1.D0) + S_GA3P=SQRT(1.D0-C_GA3P*C_GA3P) + GA3P =ACOS(C_GA3P) + ! Shifting of the direction indexes - Config. +Delta1 (SIG=1) + K_1P2P(IQ_OM2,JT1,JF1)=NINT(( D0AP+GA2P)/DTETAR & + +DBLE(LBUF)) + K_1P3M(IQ_OM2,JT1,JF1)=NINT(( D0AP-GA3P)/DTETAR & + +DBLE(LBUF)) + K_1P2M(IQ_OM2,JT1,JF1)=NINT(( D0AP-GA2P)/DTETAR & + +DBLE(LBUF)) + K_1P3P(IQ_OM2,JT1,JF1)=NINT(( D0AP+GA3P)/DTETAR & + +DBLE(LBUF)) + ! Shifting of the direction indexes - Config. -Delta1 (SIG=-1) + K_1M2P(IQ_OM2,JT1,JF1)=NINT((-D0AP+GA2P)/DTETAR & + +DBLE(LBUF)) + K_1M3M(IQ_OM2,JT1,JF1)=NINT((-D0AP-GA3P)/DTETAR & + +DBLE(LBUF)) + K_1M2M(IQ_OM2,JT1,JF1)=NINT((-D0AP-GA2P)/DTETAR & + +DBLE(LBUF)) + K_1M3P(IQ_OM2,JT1,JF1)=NINT((-D0AP+GA3P)/DTETAR & + +DBLE(LBUF)) + ! + !.........Computes the coupling coefficients (only for Delta_1+ ) + RK0=1.D0 + RK1=V1*V1 + RK2=V2*V2 + RK3=(1.D0+V1-V2)**2 + XK0 = RK0 + YK0 = 0.0D0 + XK1 = RK1*C_D01P + YK1 = RK1*S_D01P + XK2P = RK2*(C_D0AP*C_GA2P-S_D0AP*S_GA2P) + YK2P = RK2*(S_D0AP*C_GA2P+C_D0AP*S_GA2P) + XK2M = RK2*(C_D0AP*C_GA2P+S_D0AP*S_GA2P) + YK2M = RK2*(S_D0AP*C_GA2P-C_D0AP*S_GA2P) + XK3P = RK3*(C_D0AP*C_GA3P-S_D0AP*S_GA3P) + YK3P = RK3*(S_D0AP*C_GA3P+C_D0AP*S_GA3P) + XK3M = RK3*(C_D0AP*C_GA3P+S_D0AP*S_GA3P) + YK3M = RK3*(S_D0AP*C_GA3P-C_D0AP*S_GA3P) + TB_TPM(IQ_OM2,JT1,JF1)=COUPLE( XK0 , YK0 , XK1 , YK1 , XK2P , YK2P , XK3M , YK3M) + TB_TMP(IQ_OM2,JT1,JF1)=COUPLE( XK0 , YK0 , XK1 , YK1 , XK2M , YK2M , XK3P , YK3P) + ! + !.........Computes the multiplicative coefficient for QNL4 + DENO=2.D0*SQRT( (0.5D0*(1.D0+EPSI_A/2.D0)-W2) & + *((W2-0.5D0)**2+0.25D0*(1.D0+EPSI_A)) & + *((W2-0.5D0)**2+0.25D0*(1.D0-EPSI_A)) ) + TB_FAC(IQ_OM2,JT1,JF1)=1.D0/(DENO*V1*W2*(1.D0-W2)) & + /(1.D0+V1)**5 * W_LEG_OM2(IQ_OM2)*C_LEG_OM2* CCC + ENDDO + ! ----------------------------------------------- + !........END OF THE LOOP 3 OVER OMEGA_2 (CASE Epsilon_A < 1) + ! ----------------------------------------------- + ! + ELSE + ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - + !........STARTS LOOP 3 OVER OMEGA_2 (CASE Epsilon_A > 1) + !........Case of two singularities (in OMEGA2- and OMEGA2_1) + !........Integration over OMEGA2 via GAUSS-CHEBYSCHEV quadrature + ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - + W2_M=0.5D0*(1.D0-EPSI_A/2.D0) + W2_1=0.5D0*(1.D0-SQRT(EPSI_A-1.D0)) + ! + W_MIL=(W2_M+W2_1)/2.D0 + W_RAD=(W2_1-W2_M)/2.D0 + ! + DO IQ_OM2=1,GQNQ_OM2 + ! ---------Computes W2, V2, and V3 + W2=W_MIL+W_RAD*X_CHE_OM2(IQ_OM2) + V2=W2*(1.D0+V1) + V2_4=V2**4 + TB_V24(IQ_OM2,JT1,JF1)=V2_4 + K_IF2 (IQ_OM2,JT1,JF1)=NINT(DBLE(LBUF) & + +LOG(V2)/LOG(RAISF)) + V3=1.D0+V1-V2 + V3_4=V3**4 + TB_V34(IQ_OM2,JT1,JF1)=V3_4 + K_IF3 (IQ_OM2,JT1,JF1)=NINT(DBLE(LBUF) & + +LOG(V3)/LOG(RAISF)) + ! ---------Computes Gamma_2+ et Gamma_3+ angles + C_GA2P=(EPSI_A**2/4.D0+W2**4-(1.D0-W2)**4)/(EPSI_A*W2*W2) + C_GA2P=MAX(MIN(C_GA2P,1.D0),-1.D0) + S_GA2P=SQRT(1.D0-C_GA2P*C_GA2P) + GA2P =ACOS(C_GA2P) + C_GA3P=(EPSI_A**2/4.D0-W2**4+(1.D0-W2)**4)/EPSI_A & + /(1.D0-W2)**2 + C_GA3P=MAX(MIN(C_GA3P,1.D0),-1.D0) + S_GA3P=SQRT(1.D0-C_GA3P*C_GA3P) + GA3P =ACOS(C_GA3P) + ! Shifts the direction indexes - Config. +Delta1 (SIG=1) + K_1P2P(IQ_OM2,JT1,JF1)=NINT(( D0AP+GA2P)/DTETAR & + +DBLE(LBUF)) + K_1P3M(IQ_OM2,JT1,JF1)=NINT(( D0AP-GA3P)/DTETAR & + +DBLE(LBUF)) + K_1P2M(IQ_OM2,JT1,JF1)=NINT(( D0AP-GA2P)/DTETAR & + +DBLE(LBUF)) + K_1P3P(IQ_OM2,JT1,JF1)=NINT(( D0AP+GA3P)/DTETAR & + +DBLE(LBUF)) + ! Shifts the direction indexes - Config. -Delta1 (SIG=-1) + K_1M2P(IQ_OM2,JT1,JF1)=NINT((-D0AP+GA2P)/DTETAR & + +DBLE(LBUF)) + K_1M3M(IQ_OM2,JT1,JF1)=NINT((-D0AP-GA3P)/DTETAR & + +DBLE(LBUF)) + K_1M2M(IQ_OM2,JT1,JF1)=NINT((-D0AP-GA2P)/DTETAR & + +DBLE(LBUF)) + K_1M3P(IQ_OM2,JT1,JF1)=NINT((-D0AP+GA3P)/DTETAR & + +DBLE(LBUF)) + ! + !.........Computes the coupling coefficients (only for Delta_1+ ) + RK0=1.D0 + RK1=V1*V1 + RK2=V2*V2 + RK3=(1.D0+V1-V2)**2 + XK0 = RK0 + YK0 = 0.0D0 + XK1 = RK1*C_D01P + YK1 = RK1*S_D01P + XK2P = RK2*(C_D0AP*C_GA2P-S_D0AP*S_GA2P) + YK2P = RK2*(S_D0AP*C_GA2P+C_D0AP*S_GA2P) + XK2M = RK2*(C_D0AP*C_GA2P+S_D0AP*S_GA2P) + YK2M = RK2*(S_D0AP*C_GA2P-C_D0AP*S_GA2P) + XK3P = RK3*(C_D0AP*C_GA3P-S_D0AP*S_GA3P) + YK3P = RK3*(S_D0AP*C_GA3P+C_D0AP*S_GA3P) + XK3M = RK3*(C_D0AP*C_GA3P+S_D0AP*S_GA3P) + YK3M = RK3*(S_D0AP*C_GA3P-C_D0AP*S_GA3P) + TB_TPM(IQ_OM2,JT1,JF1)=COUPLE( XK0 , YK0 , XK1 , YK1 , XK2P , YK2P , XK3M , YK3M) + TB_TMP(IQ_OM2,JT1,JF1)=COUPLE( XK0 , YK0 , XK1 , YK1 , XK2M , YK2M , XK3P , YK3P) + ! + !.........Computes the multiplicative coefficient for QNL4 + DENO=2.D0*SQRT( (0.5D0*(1.D0+EPSI_A/2.D0)-W2) & + *((W2-0.5D0)**2+0.25D0*(1.D0+EPSI_A)) & + *(0.5D0*(1.D0+SQRT(EPSI_A-1.D0))-W2) ) + TB_FAC(IQ_OM2,JT1,JF1)=1.D0/(DENO*V1*W2*(1.D0-W2)) & + /(1.D0+V1)**5 * W_CHE_OM2* CCC + ! + ENDDO + ! ----------------------------------------------- + !........END OF LOOP 3 OVER OMEGA_2 (CASE Epsilon_A > 1) + ! ----------------------------------------------- + ! + ENDIF + ENDDO + ! ================================================= + ! END OF LOOP 2 OVER THE DELTA_1+ VALUES + ! ================================================= + ! + ENDDO + ! ================================================== + ! END OF LOOP 1 OVER THE F1/F0 RATIOS + ! ================================================== + DEALLOCATE(F1SF) + DEALLOCATE(X_CHE_TE1) + DEALLOCATE(X_CHE_OM2) + DEALLOCATE(X_LEG_OM2) + DEALLOCATE(W_LEG_OM2) + + ! =========================================================== + ! POST-PROCESSING TO ELIMINATE PART OF THE CONFIGURATIONS + ! =========================================================== + ! + !.....It looks, for every value of the ratio V1, for the maximum value + !.....of FACTOR*COUPLING : it is stored in the local table NAXCLA(.) + ! """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + ALLOCATE(MAXCLA(1:GQNF1)) + DO JF1=1,GQNF1 + AUX=0.0D0 + DO JT1=1,GQNT1 + DO IQ_OM2=1,GQNQ_OM2 + AUX=MAX(AUX,TB_FAC(IQ_OM2,JT1,JF1)*TB_TPM(IQ_OM2,JT1,JF1),TB_FAC(IQ_OM2,JT1,JF1)*TB_TMP(IQ_OM2,JT1,JF1)) + ENDDO + ENDDO + MAXCLA(JF1)=AUX + ENDDO + ! + !.....It looks for the max V1 value + ! """""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + AUX=0.0D0 + DO JF1=1,GQNF1 + IF (MAXCLA(JF1).GT.AUX) AUX=MAXCLA(JF1) + ENDDO + + TEST1=SEUIL1*AUX + ! + !.....Set to zero the coupling coefficients not used + ! """"""""""""""""""""""""""""""""""""""""""""""""""""" + NCONF=0 + DO JF1=1,GQNF1 + TEST2 =SEUIL2*MAXCLA(JF1) + DO JT1=1,GQNT1 + DO IQ_OM2=1,GQNQ_OM2 + AAA=TB_FAC(IQ_OM2,JT1,JF1)*TB_TPM(IQ_OM2,JT1,JF1) + CCC=TB_FAC(IQ_OM2,JT1,JF1)*TB_TMP(IQ_OM2,JT1,JF1) + IF ((AAA.GT.TEST1.OR.AAA.GT.TEST2).OR. & + (CCC.GT.TEST1.OR.CCC.GT.TEST2)) THEN + NCONF=NCONF+1 + IDCONF(NCONF,1)=JF1 + IDCONF(NCONF,2)=JT1 + IDCONF(NCONF,3)=IQ_OM2 + ENDIF +#ifdef W3_TGQM + WRITE(993,*) NCONF,JF1,JT1,IQ_OM2,AAA,CCC,(AAA.GT.TEST1.OR.AAA.GT.TEST2), & + (CCC.GT.TEST1.OR.CCC.GT.TEST2) +#endif + ENDDO + ENDDO + ENDDO + DEALLOCATE(MAXCLA) + ! + !..... counts the fraction of the eliminated configurations + ELIM=(1.D0-DBLE(NCONF)/DBLE(NCONFM))*100.D0 +#ifdef W3_TGQM + WRITE(994,*) 'NCONF, ELIM FRACTION:',NCONF,ELIM +#endif + END SUBROUTINE INSNLGQM !/ !/ End of module W3SNL1MD -------------------------------------------- / !/ diff --git a/model/src/w3src4md.F90 b/model/src/w3src4md.F90 index e2bf12c9a..3c10c8222 100644 --- a/model/src/w3src4md.F90 +++ b/model/src/w3src4md.F90 @@ -39,6 +39,7 @@ MODULE W3SRC4MD !/ 02-Sep-2011 : Clean up and time optimization ( version 4.04 ) !/ 04-Sep-2011 : Estimation of whitecap stats. ( version 4.04 ) !/ 13-Nov-2013 : Reduced frequency range with IG ( version 4.13 ) + !/ 01-Mar-2023 : Clean up of SDS4 ( version 7.14 ) !/ ! 1. Purpose : ! @@ -90,11 +91,9 @@ MODULE W3SRC4MD !air kinematic viscosity (used in WAM) INTEGER, PARAMETER :: ITAUMAX=200,JUMAX=200 INTEGER, PARAMETER :: IUSTAR=100,IALPHA=200, ILEVTAIL=50 - REAL :: TAUT(0:ITAUMAX,0:JUMAX), DELTAUW, DELU - ! Table for H.F. stress as a function of 2 variables - REAL :: TAUHFT(0:IUSTAR,0:IALPHA), DELUST, DELALP - ! Table for H.F. stress as a function of 3 variables - REAL :: TAUHFT2(0:IUSTAR,0:IALPHA,0:ILEVTAIL) + ! Tables for total stress and H.F. stress as a function of 2 or 3 variables + REAL, ALLOCATABLE :: TAUT(:,:),TAUHFT(:,:),TAUHFT2(:,:,:) + REAL :: DELUST, DELALP,DELTAUW, DELU ! Table for swell damping REAL :: DELTAIL REAL, PARAMETER :: UMAX = 50. @@ -231,7 +230,7 @@ SUBROUTINE W3SPR4 (A, CG, WN, EMEAN, FMEAN, FMEAN1, WNMEAN, & USE W3GDATMD, ONLY: NK, NTH, NSPEC, SIG, DTH, DDEN, WWNMEANP, & WWNMEANPTAIL, FTE, FTF, SSTXFTF, SSTXFTWN,& SSTXFTFTAIL, SSWELLF, ESIN, ECOS, AAIRCMIN, & - AAIRGB, AALPHA, ZZWND + AAIRGB, AALPHA, ZZWND, SSDSC #ifdef W3_S USE W3SERVMD, ONLY: STRACE #endif @@ -267,7 +266,7 @@ SUBROUTINE W3SPR4 (A, CG, WN, EMEAN, FMEAN, FMEAN1, WNMEAN, & #endif REAL :: TAUW, EBAND, EMEANWS,UNZ, & - EB(NK),EB2(NK),ELCS, ELSN + EB(NK),EB2(NK),ELCS, ELSN, SIGFAC !/ !/ ------------------------------------------------------------------- / !/ @@ -294,17 +293,18 @@ SUBROUTINE W3SPR4 (A, CG, WN, EMEAN, FMEAN, FMEAN1, WNMEAN, & DO IK=1, NK EB(IK) = 0. EB2(IK) = 0. + SIGFAC=SIG(IK)**SSDSC(12) * DDEN(IK) / CG(IK) DO ITH=1, NTH IS=ITH+(IK-1)*NTH EB(IK) = EB(IK) + A(ITH,IK) - ELCS = ELCS + A(ITH,IK)*ECOS(IS)*DDEN(IK) / CG(IK) - ELSN = ELSN + A(ITH,IK)*ESIN(IS)*DDEN(IK) / CG(IK) + ELCS = ELCS + A(ITH,IK)*ECOS(IS)*SIGFAC + ELSN = ELSN + A(ITH,IK)*ESIN(IS)*SIGFAC IF (LLWS(IS)) EB2(IK) = EB2(IK) + A(ITH,IK) AMAX = MAX ( AMAX , A(ITH,IK) ) END DO END DO - - DLWMEAN=ATAN2(ELSN,ELCS); + ! + DLWMEAN=ATAN2(ELSN,ELCS) ! ! 2. Integrate over directions -------------------------------------- * ! @@ -358,7 +358,6 @@ SUBROUTINE W3SPR4 (A, CG, WN, EMEAN, FMEAN, FMEAN1, WNMEAN, & CALL W3FLX5 ( ZZWND, U, UDIR, TAUA, TAUADIR, DAIR, & USTAR, USDIR, Z0, CD, CHARN ) #else - Z0=0. CALL CALC_USTAR(U,TAUW,USTAR,Z0,CHARN) UNZ = MAX ( 0.01 , U ) CD = (USTAR/UNZ)**2 @@ -510,7 +509,7 @@ SUBROUTINE W3SIN4 (A, CG, K, U, USTAR, DRAT, AS, USDIR, Z0, CD, & USE W3GDATMD, ONLY: NK, NTH, NSPEC, DDEN, SIG, SIG2, TH, & ESIN, ECOS, EC2, ZZWND, AALPHA, BBETA, ZZALP,& TTAUWSHELTER, SSWELLF, DDEN2, DTH, SSINTHP, & - ZZ0RAT, SSINBR + ZZ0RAT, SSINBR, SINTAILPAR #ifdef W3_S USE W3SERVMD, ONLY: STRACE #endif @@ -561,13 +560,21 @@ SUBROUTINE W3SIN4 (A, CG, K, U, USTAR, DRAT, AS, USDIR, Z0, CD, & REAL XI,DELI1,DELI2 REAL XJ,DELJ1,DELJ2 REAL XK,DELK1,DELK2 - REAL :: CONST, CONST0, CONST2, TAU1 + REAL :: CONST, CONST0, CONST2, TAU1, TAU1NT, ZINF, TENSK REAL X,ZARG,ZLOG,UST REAL :: COSWIND, XSTRESS, YSTRESS, TAUHF REAL TEMP, TEMP2 INTEGER IND,J,I,ISTAB REAL DSTAB(3,NSPEC), DVISC, DTURB REAL STRESSSTAB(3,2),STRESSSTABN(3,2) + ! + INTEGER, PARAMETER :: JTOT=50 + REAL , PARAMETER :: KM=363.,CMM=0.2325 ! K and C at phase speed minimum in rad/m + REAL :: OMEGACC, OMEGA, ZZ0, ZX, ZBETA, USTR, TAUR, & + CONST1, LEVTAIL0, X0, Y, DELY, YC, ZMU, & + LEVTAIL, CGTAIL, ALPHAM, FM, ALPHAT, FMEAN + + REAL, ALLOCATABLE :: W(:) #ifdef W3_T0 REAL :: DOUT(NK,NTH) #endif @@ -591,6 +598,11 @@ SUBROUTINE W3SIN4 (A, CG, K, U, USTAR, DRAT, AS, USDIR, Z0, CD, & STRESSSTAB =0. STRESSSTABN =0. ! + ! Coupling coefficient times density ratio DRAT + ! + CONST1=BBETA/KAPPA**2 ! needed for the tail + CONST0=CONST1*DRAT ! needed for the resolved spectrum + ! ! 1.a estimation of surface roughness parameters ! Z0VISC = 0.1*nu_air/MAX(USTAR,0.0001) @@ -615,9 +627,9 @@ SUBROUTINE W3SIN4 (A, CG, K, U, USTAR, DRAT, AS, USDIR, Z0, CD, & ! At this point UORB and AORB are the variances of the orbital velocity and surface elevation ! UORB = UORB + EB *SIG(IK)**2 * DDEN(IK) / CG(IK) - AORB = AORB + EB * DDEN(IK) / CG(IK) !deep water only + AORB = AORB + EB * DDEN(IK) / CG(IK) !correct for deep water only END DO - + ! FMEAN = SQRT((UORB+1E-6)/(AORB+1E-6)) UORB = 2*SQRT(UORB) ! significant orbital amplitude AORB1 = 2*AORB**(1-0.5*SSWELLF(6)) ! half the significant wave height ... if SWELLF(6)=1 RE = 4*UORB*AORB1 / NU_AIR ! Reynolds number @@ -672,7 +684,7 @@ SUBROUTINE W3SIN4 (A, CG, K, U, USTAR, DRAT, AS, USDIR, Z0, CD, & ELSE Usigma = MAX(0.,-0.025*AS) END IF - USTARsigma=(1.0+U/(10.+U))*Usigma + USTARsigma=(0.895+U**(1.48)/(34.8+1.35*U**(1.48)))*Usigma #endif #ifdef W3_T WRITE (NDST,9003) AS, Usigma, USTARsigma, U @@ -695,10 +707,6 @@ SUBROUTINE W3SIN4 (A, CG, K, U, USTAR, DRAT, AS, USDIR, Z0, CD, & STRESSSTAB(ISTAB,:)=0. STRESSSTABN(ISTAB,:)=0. ! - ! Coupling coefficient times density ratio DRAT - ! - CONST0=BBETA*DRAT/(kappa**2) - ! DO IK=1, NK TAUPX=TAUX-ABS(TTAUWSHELTER)*STRESSSTAB(ISTAB,1) TAUPY=TAUY-ABS(TTAUWSHELTER)*STRESSSTAB(ISTAB,2) @@ -813,13 +821,22 @@ SUBROUTINE W3SIN4 (A, CG, K, U, USTAR, DRAT, AS, USDIR, Z0, CD, & DOUT(IK,ITH) = D(ITH+(IK-1)*NTH) END DO END DO - CALL PRT2DS (NDST, NK, NK, NTH, DOUT, SIG(1:NK), ' ', 1., & + CALL PRT2DS (NDST, NK, NK, NTH, DOUT, SIG(1), ' ', 1., & 0.0, 0.001, 'Diag Sin', ' ', 'NONAME') #endif ! #ifdef W3_T1 CALL OUTMAT (NDST, D, NTH, NTH, NK, 'diag Sin') #endif + ! + TAUPX=TAUX-ABS(TTAUWSHELTER)*XSTRESS + TAUPY=TAUY-ABS(TTAUWSHELTER)*YSTRESS + USTP=(TAUPX**2+TAUPY**2)**0.25 + USDIRP=ATAN2(TAUPY,TAUPX) + + UST=USTP + ! + ! Computes HF tail ! ! Computes the high-frequency contribution ! the difference in spectal density (kx,ky) to (f,theta) @@ -832,36 +849,115 @@ SUBROUTINE W3SIN4 (A, CG, K, U, USTAR, DRAT, AS, USDIR, Z0, CD, & COSWIND=(ECOS(IS)*COSU+ESIN(IS)*SINU) TEMP=TEMP+A(IS)*(MAX(COSWIND,0.))**3 END DO + ! + LEVTAIL0= CONST0*TEMP ! LEVTAIL is sum over theta of A(k,theta)*cos^3(theta-wind)*DTH*SIG^5/(g^2*2pi)*2*pi*SIG/CG + ! which is the same as sum of E(f,theta)*cos^3(theta-wind)*DTH*SIG^5/(g^2*2pi) + ! reminder: sum of E(f,theta)*DTH*SIG^5/(g^2*2pi) is 2*k^3*E(k) +! +! Computation of stress supported by tail: uses table if SINTAILPAR(1)=1 , correspoding to SINTABLE = 1 +! + IF (SINTAILPAR(1).LT.0.5) THEN + ALLOCATE(W(JTOT)) + W(2:JTOT-1)=1. + W(1)=0.5 + W(JTOT)=0.5 + X0 = 0.05 + ! + USTR= UST + ZZ0=Z0 + OMEGACC = MAX(SIG(NK),X0*GRAV/UST) + YC = OMEGACC*SQRT(ZZ0/GRAV) - TAUPX=TAUX-ABS(TTAUWSHELTER)*XSTRESS - TAUPY=TAUY-ABS(TTAUWSHELTER)*YSTRESS - USTP=(TAUPX**2+TAUPY**2)**0.25 - USDIRP=ATAN2(TAUPY,TAUPX) + ! DELY = MAX((1.-YC)/REAL(JTOT),0.) + ! Changed integration variable from Y to LOG(Y) and to log(K) + !ZINF = LOG(YC) + !DELY = MAX((1.-ZINF)/REAL(JTOT),0.) + ZINF = LOG(SIG(NK)**2/GRAV) + DELY = (LOG(TPI/0.005)-ZINF)/REAL(JTOT) - UST=USTP - ! finds the values in the tabulated stress TAUHFT - XI=UST/DELUST - IND = MAX(1,MIN (IUSTAR-1, INT(XI))) - DELI1= MAX(MIN (1. ,XI-FLOAT(IND)),0.) - DELI2= 1. - DELI1 - XJ=MAX(0.,(GRAV*Z0/MAX(UST,0.00001)**2-AALPHA) / DELALP) - J = MAX(1 ,MIN (IALPHA-1, INT(XJ))) - DELJ1= MAX(0.,MIN (1. , XJ-FLOAT(J))) - DELJ2=1. - DELJ1 - IF (TTAUWSHELTER.GT.0) THEN - XK = CONST0*TEMP / DELTAIL - I = MIN (ILEVTAIL-1, INT(XK)) - DELK1= MIN (1. ,XK-FLOAT(I)) - DELK2=1. - DELK1 - TAU1 =((TAUHFT2(IND,J,I)*DELI2+TAUHFT2(IND+1,J,I)*DELI1 )*DELJ2 & - +(TAUHFT2(IND,J+1,I)*DELI2+TAUHFT2(IND+1,J+1,I)*DELI1)*DELJ1)*DELK2 & - +((TAUHFT2(IND,J,I+1)*DELI2+TAUHFT2(IND+1,J,I+1)*DELI1 )*DELJ2 & - +(TAUHFT2(IND,J+1,I+1)*DELI2+TAUHFT2(IND+1,J+1,I+1)*DELI1)*DELJ1)*DELK1 + TAUR=UST**2 + TAU1=0. + + ! Integration loop over the tail wavenumbers or frequencies ... + DO J=1,JTOT + !Y = YC+REAL(J-1)*DELY + !OMEGA = Y*SQRT(GRAV/ZZ0) + !OMEGA = SQRT(GRAV*Y) + ! This is the deep water phase speed... No surface tension !! + !CM = GRAV/OMEGA + ! With this form, Y is the wavenumber in the tail; + Y= EXP(ZINF+REAL(J-1)*DELY) + TENSK =1+(Y/KM)**2 + OMEGA = SQRT(GRAV*Y*TENSK) + CM = SQRT(GRAV*TENSK/Y) + CGTAIL = 0.5*(3*(Y/KM)**2+1)*SQRT(GRAV/(Y*TENSK)) + !this is the inverse wave age, shifted by ZZALP (tuning) + ZX = USTR/CM +ZZALP + ZARG = MIN(KAPPA/ZX,20.) + ! ZMU corresponds to EXP(ZCN) + ZMU = MIN(GRAV*ZZ0/CM**2*EXP(ZARG),1.) + ZLOG = MIN(ALOG(ZMU),0.) + ZBETA = CONST1*ZMU*ZLOG**4 + ! + ! Optional addition of capillary wave peak if SINTAIL2=1 + ! + IF (SINTAILPAR(3).GT.0) THEN + IF (USTR.LT.CM) THEN + ALPHAM=MAX(0.,0.01*(1.+ALOG(USTR/CM))) + ELSE + ALPHAM=0.01*(1+3.*ALOG(USTR/CM)) + END IF + FM=EXP(-0.25*(Y/KM-1)**2) + + ALPHAT=ALPHAM*(CMM/CM)*FM ! equivalent to 2*Bh in Elfouhaily et al. + LEVTAIL=LEVTAIL0*0.5*(1-tanh((Y-20)/5))+SINTAILPAR(3)*0.5*(1+TANH((Y-20)/5))*ALPHAT + ELSE + LEVTAIL=LEVTAIL0 + END IF + ! WRITE(991,*) 'TAIL??',SINTAILPAR(3),LEVTAIL0,LEVTAIL,ALPHAT,Y,Y/KM,OMEGA/(TPI) + + !TAU1=TAU1+W(J)*ZBETA*(USTR/UST)**2/Y*DELY ! integration over LOG(Y) + TAU1=TAU1+W(J)*ZBETA*USTR**2*LEVTAIL*DELY*CGTAIL/CM ! integration over LOG(K) + + ! NB: the factor ABS(TTAUWSHELTER) was forgotten in the TAUHFT2 table + !TAUR=TAUR-W(J)*ABS(TTAUWSHELTER)*USTR**2*ZBETA*LEVTAIL/Y*DELY + !TAUR=TAUR-W(J)*USTR**2*ZBETA*LEVTAIL*DELY ! integration over LOG(Y) + TAUR=TAUR-W(J)*SINTAILPAR(2)*USTR**2*ZBETA*LEVTAIL*DELY*CGTAIL/CM ! DK/K*CG/C = D OMEGA / OMEGA + USTR=SQRT(MAX(TAUR,0.)) + END DO + DEALLOCATE(W) + TAU1NT=TAU1 + TAUHF = TAU1 + ! + ! In this case, uses tables for high frequency contribution to TAUW. + ! ELSE - TAU1 =(TAUHFT(IND,J)*DELI2+TAUHFT(IND+1,J)*DELI1 )*DELJ2 & - +(TAUHFT(IND,J+1)*DELI2+TAUHFT(IND+1,J+1)*DELI1)*DELJ1 - END IF - TAUHF = CONST0*TEMP*UST**2*TAU1 + ! finds the values in the tabulated stress TAUHFT + XI=UST/DELUST + IND = MAX(1,MIN (IUSTAR-1, INT(XI))) + DELI1= MAX(MIN (1. ,XI-FLOAT(IND)),0.) + DELI2= 1. - DELI1 + XJ=MAX(0.,(GRAV*Z0/MAX(UST,0.00001)**2-AALPHA) / DELALP) + J = MAX(1 ,MIN (IALPHA-1, INT(XJ))) + DELJ1= MAX(0.,MIN (1. , XJ-FLOAT(J))) + DELJ2=1. - DELJ1 + IF (TTAUWSHELTER.GT.0) THEN + XK = LEVTAIL0/ DELTAIL + I = MIN (ILEVTAIL-1, INT(XK)) + DELK1= MIN (1. ,XK-FLOAT(I)) + DELK2=1. - DELK1 + TAU1 =((TAUHFT2(IND,J,I)*DELI2+TAUHFT2(IND+1,J,I)*DELI1 )*DELJ2 & + +(TAUHFT2(IND,J+1,I)*DELI2+TAUHFT2(IND+1,J+1,I)*DELI1)*DELJ1)*DELK2 & + +((TAUHFT2(IND,J,I+1)*DELI2+TAUHFT2(IND+1,J,I+1)*DELI1 )*DELJ2 & + +(TAUHFT2(IND,J+1,I+1)*DELI2+TAUHFT2(IND+1,J+1,I+1)*DELI1)*DELJ1)*DELK1 + ELSE + TAU1 =(TAUHFT(IND,J)*DELI2+TAUHFT(IND+1,J)*DELI1 )*DELJ2 & + +(TAUHFT(IND,J+1)*DELI2+TAUHFT(IND+1,J+1)*DELI1)*DELJ1 + END IF + ! + TAUHF = LEVTAIL0*UST**2*TAU1 + END IF ! End of test on use of table + TAUWX = XSTRESS+TAUHF*COS(USDIRP) TAUWY = YSTRESS+TAUHF*SIN(USDIRP) ! @@ -975,7 +1071,8 @@ SUBROUTINE INSIN4(FLTABS) SSDSDTH, SSDSCOS, TH, DTH, XFR, ECOS, ESIN, & SSDSC, SSDSBRF1, SSDSBCK, SSDSBINT, SSDSPBK, & SSDSABK, SSDSHCK, IKTAB, DCKI, SATINDICES, & - SATWEIGHTS, CUMULW, NKHS, NKD, NDTAB, QBI + SATWEIGHTS, CUMULW, NKHS, NKD, NDTAB, QBI, & + SINTAILPAR #ifdef W3_S USE W3SERVMD, ONLY: STRACE #endif @@ -1016,11 +1113,16 @@ SUBROUTINE INSIN4(FLTABS) ! ! These precomputed tables are written in mod_def.ww3 ! - IF (FLTABS) THEN - CALL TABU_STRESS - CALL TABU_TAUHF(SIG(NK) ) !tabulate high-frequency stress: 2D table + IF (SINTAILPAR(1).GT.0.5) THEN + IF (.NOT. ALLOCATED(TAUT)) ALLOCATE(TAUT(0:ITAUMAX,0:JUMAX)) + IF (.NOT. ALLOCATED(TAUHFT)) ALLOCATE(TAUHFT(0:IUSTAR,0:IALPHA)) + IF (FLTABS) THEN + CALL TABU_STRESS + CALL TABU_TAUHF(SIG(NK) ) !tabulate high-frequency stress: 2D table + END IF IF (TTAUWSHELTER.GT.0) THEN - CALL TABU_TAUHF2(SIG(NK) ) !tabulate high-frequency stress: 3D table + IF (.NOT. ALLOCATED(TAUHFT2)) ALLOCATE(TAUHFT2(0:IUSTAR,0:IALPHA,0:ILEVTAIL)) + IF (FLTABS) CALL TABU_TAUHF2(SIG(NK) ) !tabulate high-frequency stress: 3D table END IF END IF ! @@ -1146,7 +1248,7 @@ SUBROUTINE INSIN4(FLTABS) ! Precomputes the weights for the cumulative effect (TEST 441 and 500) ! DIKCUMUL = 0 - IF (SSDSC(3).NE.0) THEN + IF (SSDSC(3).LT.0.) THEN ! DIKCUMUL is the integer difference in frequency bands ! between the "large breakers" and short "wiped-out waves" DIKCUMUL = NINT(SSDSBRF1/(XFR-1.)) @@ -1264,7 +1366,7 @@ SUBROUTINE TABU_STRESS ! ---------------------------------------------------------------------- INTEGER I,J,ITER REAL ZTAUW,UTOP,CDRAG,WCD,USTOLD,TAUOLD - REAL X,UST,ZZ0,ZNU,F,DELF,ZZ00 + REAL X,UST,ZZ0,F,DELF,ZZ00 ! ! DELU = UMAX/FLOAT(JUMAX) @@ -1755,6 +1857,7 @@ SUBROUTINE CALC_USTAR(WINDSPEED,TAUW,USTAR,Z0,CHARN) ! 2. Method : ! ! Computation of u* based on Quasi-linear theory + ! uses Charnock relation with modified roughness Z1=Z0/SQRT(1-TAUW/TAU) ! ! 3. Parameters : ! @@ -1791,8 +1894,8 @@ SUBROUTINE CALC_USTAR(WINDSPEED,TAUW,USTAR,Z0,CHARN) ! ! 10. Source code : !-----------------------------------------------------------------------------! - USE CONSTANTS, ONLY: GRAV, KAPPA - USE W3GDATMD, ONLY: ZZWND, AALPHA + USE CONSTANTS, ONLY: GRAV, KAPPA, NU_AIR + USE W3GDATMD, ONLY: ZZWND, AALPHA, ZZ0MAX, SINTAILPAR #ifdef W3_T USE W3ODATMD, ONLY: NDST #endif @@ -1800,22 +1903,60 @@ SUBROUTINE CALC_USTAR(WINDSPEED,TAUW,USTAR,Z0,CHARN) REAL, intent(in) :: WINDSPEED,TAUW REAL, intent(out) :: USTAR, Z0, CHARN ! local variables - REAL SQRTCDM1 - REAL XI,DELI1,DELI2,XJ,delj1,delj2 - REAL TAUW_LOCAL - INTEGER IND,J - ! - TAUW_LOCAL=MAX(MIN(TAUW,TAUWMAX),0.) - XI = SQRT(TAUW_LOCAL)/DELTAUW - IND = MIN ( ITAUMAX-1, INT(XI)) ! index for stress table - DELI1 = MIN(1.,XI - REAL(IND)) !interpolation coefficient for stress table - DELI2 = 1. - DELI1 - XJ = WINDSPEED/DELU - J = MIN ( JUMAX-1, INT(XJ) ) - DELJ1 = MIN(1.,XJ - REAL(J)) - DELJ2 = 1. - DELJ1 - USTAR=(TAUT(IND,J)*DELI2+TAUT(IND+1,J )*DELI1)*DELJ2 & - + (TAUT(IND,J+1)*DELI2+TAUT(IND+1,J+1)*DELI1)*DELJ1 + REAL :: SQRTCDM1 + REAL :: XI,DELI1,DELI2,XJ,delj1,delj2 ! used for table version + INTEGER :: IND,J + REAL :: TAUW_LOCAL + REAL :: TAUOLD,CDRAG,WCD,USTOLD,X,UST,ZZ0,ZNU,ZZ00,F,DELF + INTEGER, PARAMETER :: NITER=10 + REAL , PARAMETER :: XM=0.50, EPS1=0.00001 + INTEGER :: ITER + ! VARIABLE. TYPE. PURPOSE. + ! *XM* REAL POWER OF TAUW/TAU IN ROUGHNESS LENGTH. + ! *XNU* REAL KINEMATIC VISCOSITY OF AIR. + ! *NITER* INTEGER NUMBER OF ITERATIONS TO OBTAIN TOTAL STRESS + ! *EPS1* REAL SMALL NUMBER TO MAKE SURE THAT A SOLUTION + ! IS OBTAINED IN ITERATION WITH TAU>TAUW. + + ! + IF (SINTAILPAR(1).GT.0.5) THEN + TAUW_LOCAL=MAX(MIN(TAUW,TAUWMAX),0.) + XI = SQRT(TAUW_LOCAL)/DELTAUW + IND = MIN ( ITAUMAX-1, INT(XI)) ! index for stress table + DELI1 = MIN(1.,XI - REAL(IND)) !interpolation coefficient for stress table + DELI2 = 1. - DELI1 + XJ = WINDSPEED/DELU + J = MIN ( JUMAX-1, INT(XJ) ) + DELJ1 = MIN(1.,XJ - REAL(J)) + DELJ2 = 1. - DELJ1 + USTAR=(TAUT(IND,J)*DELI2+TAUT(IND+1,J )*DELI1)*DELJ2 & + + (TAUT(IND,J+1)*DELI2+TAUT(IND+1,J+1)*DELI1)*DELJ1 + ELSE + ! This max is for comparison ... to be removed later + ! TAUW_LOCAL=MAX(MIN(TAUW,TAUWMAX),0.) + TAUW_LOCAL=TAUW + CDRAG = 0.0012875 + WCD = SQRT(CDRAG) + USTOLD = WINDSPEED*WCD + TAUOLD = MAX(USTOLD**2, TAUW_LOCAL+EPS1) + ! Newton method to solve for ustar in U=ustar*log(Z/Z0) + DO ITER=1,NITER + X = TAUW_LOCAL/TAUOLD + UST = SQRT(TAUOLD) + ZZ00=AALPHA*TAUOLD/GRAV + IF (ZZ0MAX.NE.0) ZZ00=MIN(ZZ00,ZZ0MAX) + ! Corrects roughness ZZ00 for quasi-linear effect + ZZ0 = ZZ00/(1.-X)**XM + ZNU = 0.11*nu_air/MAX(UST,1E-6) + ZZ0 = SINTAILPAR(5)*ZNU+ZZ0 + F = UST-KAPPA*WINDSPEED/(ALOG(ZZWND/ZZ0)) + DELF= 1.-KAPPA*WINDSPEED/(ALOG(ZZWND/ZZ0))**2*2./UST & + *(1.-(XM+1)*X)/(1.-X) + UST = UST-F/DELF + TAUOLD= MAX(UST**2., TAUW_LOCAL+EPS1) + END DO + USTAR=UST + END IF ! ! Determines roughness length ! @@ -1832,6 +1973,7 @@ SUBROUTINE CALC_USTAR(WINDSPEED,TAUW,USTAR,Z0,CHARN) END IF CHARN = AALPHA END IF + ! WRITE(6,*) 'CALC_USTAR:',WINDSPEED,TAUW,AALPHA,CHARN,Z0,USTAR ! RETURN END SUBROUTINE CALC_USTAR @@ -1882,10 +2024,11 @@ SUBROUTINE W3SDS4 (A, K, CG, USTAR, USDIR, DEPTH, DAIR, SRHS, & !/ 06-Jun-2018 : Add optional DEBUGSRC ( version 6.04 ) !/ 22-Feb-2020 : Option to use Romero (GRL 2019) ( version 7.06 ) !/ 13-Aug-2021 : Consider DAIR a variable ( version 7.14 ) + !/ 01-Mar-2023 : Clean up of SDS4 ( version 7.xx ) !/ ! 1. Purpose : ! - ! Calculate whitecapping source term and diagonal term of derivative. + ! Calculate wave dissipation source term and diagonal term of derivative. ! ! 2. Method : ! @@ -1949,7 +2092,7 @@ SUBROUTINE W3SDS4 (A, K, CG, USTAR, USDIR, DEPTH, DAIR, SRHS, & SSDSISO, SSDSDTH, SSDSBM, AAIRCMIN, & SSDSBRFDF, SSDSBCK, IKTAB, DCKI, & SATINDICES, SATWEIGHTS, CUMULW, NKHS, NKD, & - NDTAB, QBI + NDTAB, QBI, DSIP, SSDSBRF1,XFR #ifdef W3_IG1 USE W3GDATMD, ONLY: IGPARS #endif @@ -1989,7 +2132,7 @@ SUBROUTINE W3SDS4 (A, K, CG, USTAR, USDIR, DEPTH, DAIR, SRHS, & INTEGER :: IK, IK1, ITH, IK2, JTH, ITH2, & IKHS, IKD, SDSNTH, IT, IKM, NKM INTEGER :: NSMOOTH(NK) - REAL :: C, COSWIND, ASUM, SDIAGISO + REAL :: C, C2, CUMULWISO, COSWIND, ASUM, SDIAGISO REAL :: COEF1, COEF2, COEF4(NK), & COEF5(NK) @@ -2004,19 +2147,15 @@ SUBROUTINE W3SDS4 (A, K, CG, USTAR, USDIR, DEPTH, DAIR, SRHS, & REAL :: FACSAT, DKHS, FACSTRAINB, FACSTRAINL REAL :: BTH0(NK) !saturation spectrum REAL :: BTH(NSPEC) !saturation spectrum - REAL :: BTH0S(NK) !smoothed saturation spectrum - REAL :: BTHS(NSPEC) !smoothed saturation spectrum - INTEGER :: IMSSMAX(NK), NTHSUM - REAL :: MSSSUM(NK,5), WTHSUM(NTH), FACHF - REAL :: MSSSUM2(NK,NTH) - REAL :: MSSLONG(NK,NTH) + REAL :: MSSSUM(NK,5), FACHF + REAL :: MSSLONG REAL :: MSSPCS, MSSPC2, MSSPS2, MSSP, MSSD, MSSTH REAL :: MICHE, X, KLOC #ifdef W3_T0 REAL :: DOUT(NK,NTH) #endif REAL :: QB(NK), S2(NK) - REAL :: TSTR, TMAX, DT, T, MFT + REAL :: TSTR, TMAX, DT, T, MFT, DIRFORCUM REAL :: PB(NSPEC), PB2(NSPEC), BRM12(NK), BTOVER REAL :: KO, LMODULATION(NTH) !/ @@ -2034,10 +2173,10 @@ SUBROUTINE W3SDS4 (A, K, CG, USTAR, USDIR, DEPTH, DAIR, SRHS, & ! found in certain compilers NSMOOTH=0 S1=0.; E1=0. - NTIMES=0;IKSUP=0;IMSSMAX=0 + NTIMES=0;IKSUP=0 DK=0.; HS=0.; KBAR=0.; DCK=0.; EFDF=0. - BTH0=0.; BTH=0.; BTH0S=0.; DDIAG=0.; SRHS=0.; PB=0. - BTHS=0.; MSSSUM(:,:)=0. + BTH0=0.; BTH=0.; DDIAG=0.; SRHS=0.; PB=0. + MSSSUM(:,:)=0. #ifdef W3_T0 DOUT=0. #endif @@ -2047,50 +2186,33 @@ SUBROUTINE W3SDS4 (A, K, CG, USTAR, USDIR, DEPTH, DAIR, SRHS, & ! 1. Initialization and numerical factors ! FACTURB=SSDSC(5)*USTAR**2/GRAV*DAIR/DWAT + DIKCUMUL = NINT(SSDSBRF1/(XFR-1.)) BREAKFRACTION=0. RENEWALFREQ=0. IK1=1 #ifdef W3_IG1 IK1=NINT(IGPARS(5))+1 #endif - NTHSUM=MIN(FLOOR(SSDSC(10)+0.5),NTH-1) ! number of angular bins for enhanced modulation - IF (NTHSUM.GT.0) THEN - WTHSUM(1:NTHSUM)=1 - WTHSUM(NTHSUM+1)=SSDSC(10)+0.5-NTHSUM - ELSE - WTHSUM(1)=2*SSDSC(10) - END IF ! - ! 1.b MSS parameters used for Modulation factors for B or lambda + ! 1.b MSS parameters used for Modulation factors for lambda (Romero ) ! IF (SSDSC(8).GT.0.OR.SSDSC(11).GT.0.OR.SSDSC(18).GT.0) THEN - MSSSUM2(:,:)=0. DO IK=1,NK - IMSSMAX (IK) = 1 MSSP = 0. MSSPC2 = 0. MSSPS2 = 0. MSSPCS = 0. ! - ! Sums the contributions to the directional MSS for all ITH + ! Sums the contributions to the directional MSS for all angles ! DO ITH=1,NTH IS=ITH+(IK-1)*NTH - MSSLONG(IK,ITH) = K(IK)**SSDSC(20) * A(IS) * DDEN(IK) / CG(IK) ! contribution to MSS - END DO - DO ITH=1,NTH - DO JTH=-NTHSUM,NTHSUM - ITH2 = 1+MOD(ITH-1+JTH+NTH,NTH) - MSSSUM2(IK,ITH) = MSSSUM2(IK,ITH)+MSSLONG(IK,ITH2)*WTHSUM(ABS(JTH)+1) - END DO - MSSPC2 = MSSPC2 +MSSLONG(IK,ITH)*EC2(ITH) - MSSPS2 = MSSPS2 +MSSLONG(IK,ITH)*ES2(ITH) - MSSPCS = MSSPCS +MSSLONG(IK,ITH)*ESC(ITH) - MSSP = MSSP +MSSLONG(IK,ITH) + MSSLONG = K(IK)**SSDSC(20) * A(IS) * DDEN(IK) / CG(IK) ! contribution to MSS + MSSPC2 = MSSPC2 +MSSLONG*EC2(ITH) + MSSPS2 = MSSPS2 +MSSLONG*ES2(ITH) + MSSPCS = MSSPCS +MSSLONG*ESC(ITH) + MSSP = MSSP +MSSLONG END DO - ! - ! Now sums over IK - ! MSSSUM (IK:NK,1) = MSSSUM (IK:NK,1) +MSSP MSSSUM (IK:NK,3) = MSSSUM (IK:NK,3) +MSSPC2 MSSSUM (IK:NK,4) = MSSSUM (IK:NK,4) +MSSPS2 @@ -2100,18 +2222,13 @@ SUBROUTINE W3SDS4 (A, K, CG, USTAR, USDIR, DEPTH, DAIR, SRHS, & ! MSSD=0.5*(ATAN2(2*MSSSUM(IK,5),MSSSUM(IK,3)-MSSSUM(IK,4))) IF (MSSD.LT.0) MSSD = MSSD + PI - IMSSMAX (IK)=1+NINT(MSSD *NTH/TPI) - ! - ! mss along perpendicular direction - ! - MSSSUM (IK,2) = MAX(0.,MSSSUM(IK,4)*COS(MSSD)**2 & - -2*MSSSUM(IK,5)*SIN(MSSD)*COS(MSSD)+ & - MSSSUM(IK,3)*SIN(MSSD)**2 ) + MSSSUM (IK,2) = MSSD END DO END IF ! SSDSC(8).GT.0) THEN ! ! 2. Estimation of spontaneous breaking from local saturation ! + !############################################################################################" SELECT CASE (NINT(SSDSC(1))) CASE (1) ! @@ -2121,10 +2238,6 @@ SUBROUTINE W3SDS4 (A, K, CG, USTAR, USDIR, DEPTH, DAIR, SRHS, & ! ! 2.a.1 Computes saturation ! - SDSNTH = MIN(NINT(SSDSDTH/(DTH*RADE)),NTH/2-1) - ! SSDSDIK is the integer difference in frequency bands - ! between the "large breakers" and short "wiped-out waves" - ! BTH(:) = 0. DO IK=IK1, NK @@ -2134,99 +2247,20 @@ SUBROUTINE W3SDS4 (A, K, CG, USTAR, USDIR, DEPTH, DAIR, SRHS, & BTH(IS0+1)=0. ASUM = SUM(A(IS0+1:IS0+NTH)) BTH0(IK)=ASUM*FACSAT - IKC = MAX(1,IK-DIKCUMUL) - KLOC=K(IK)**(2-SSDSC(20)) ! local wavenumber factor, if mss not used. - + ! IF (SSDSDTH.GE.180) THEN ! integrates around full circle BTH(IS0+1:IS0+NTH)=BTH0(IK) ELSE DO ITH=1,NTH ! partial integration IS=ITH+(IK-1)*NTH - - ! straining effect of long waves on short waves - ! extended from Longuet-Higgins and Stewart (JFM 1960, eq. 2.27) the amplitude modulation - ! in deep water is equal to the long wave slope k*a cos(theta1-theta2) - ! Here we assume that the saturation is modulated as (1 + SSDSC(8) * sqrt(mss) ) - ! where mss_theta is the mss in direction ITH. - ! - ! Note: SSDSC(8) is sqrt(2)*times the mss MTF: equal to 4*sqrt(2) according to Longuet-Higgins and Stewart - ! - IF (SSDSC(8).GT.0.OR.SSDSC(11).GT.0) THEN - ! - MSSTH=(MSSSUM(IKC,1)-MSSSUM(IKC,2))*EC2(1+ABS(ITH-IMSSMAX (IKC))) & - +MSSSUM(IKC,2)*ES2(1+ABS(ITH-IMSSMAX (IKC)))*KLOC - ! - FACSTRAINB=1+SSDSC(8)*SQRT(MSSTH)+SSDSC(11)*SQRT(MSSSUM2(IKC,ITH)*KLOC) - ELSE - FACSTRAINB=1 - END IF - ! BTH(IS)=DOT_PRODUCT(SATWEIGHTS(:,ITH), A(IS0+SATINDICES(:,ITH)) ) & - *FACSAT*FACSTRAINB + *FACSAT END DO - IF (SSDSISO.NE.1) THEN - BTH0(IK)=MAXVAL(BTH(IS0+1:IS0+NTH)) - END IF + BTH0(IK)=MAXVAL(BTH(IS0+1:IS0+NTH)) END IF ! - END DO !NK END - ! - ! Optional smoothing of B and B0 over frequencies - ! - IF (SSDSBRFDF.GT.0.AND.SSDSBRFDF.LT.NK/2) THEN - BTH0S(:)=BTH0(:) - BTHS(:)=BTH(:) - NSMOOTH(:)=1 - DO IK=1, SSDSBRFDF - BTH0S(1+SSDSBRFDF)=BTH0S(1+SSDSBRFDF)+BTH0(IK) - NSMOOTH(1+SSDSBRFDF)=NSMOOTH(1+SSDSBRFDF)+1 - DO ITH=1,NTH - IS=ITH+(IK-1)*NTH - BTHS(ITH+SSDSBRFDF*NTH)=BTHS(ITH+SSDSBRFDF*NTH)+BTH(IS) - END DO - END DO - DO IK=IK1+1+SSDSBRFDF,1+2*SSDSBRFDF - BTH0S(1+SSDSBRFDF)=BTH0S(1+SSDSBRFDF)+BTH0(IK) - NSMOOTH(1+SSDSBRFDF)=NSMOOTH(1+SSDSBRFDF)+1 - DO ITH=1,NTH - IS=ITH+(IK-1)*NTH - BTHS(ITH+SSDSBRFDF*NTH)=BTHS(ITH+SSDSBRFDF*NTH)+BTH(IS) - END DO - END DO - DO IK=SSDSBRFDF,IK1,-1 - BTH0S(IK)=BTH0S(IK+1)-BTH0(IK+SSDSBRFDF+1) - NSMOOTH(IK)=NSMOOTH(IK+1)-1 - DO ITH=1,NTH - IS=ITH+(IK-1)*NTH - BTHS(IS)=BTHS(IS+NTH)-BTH(IS+(SSDSBRFDF+1)*NTH) - END DO - END DO - ! - DO IK=IK1+1+SSDSBRFDF,NK-SSDSBRFDF - BTH0S(IK)=BTH0S(IK-1)-BTH0(IK-SSDSBRFDF-1)+BTH0(IK+SSDSBRFDF) - NSMOOTH(IK)=NSMOOTH(IK-1) - DO ITH=1,NTH - IS=ITH+(IK-1)*NTH - BTHS(IS)=BTHS(IS-NTH)-BTH(IS-(SSDSBRFDF+1)*NTH)+BTH(IS+(SSDSBRFDF)*NTH) - END DO - END DO - ! - DO IK=NK-SSDSBRFDF+1,NK - BTH0S(IK)=BTH0S(IK-1)-BTH0(IK-SSDSBRFDF) - NSMOOTH(IK)=NSMOOTH(IK-1)-1 - DO ITH=1,NTH - IS=ITH+(IK-1)*NTH - BTHS(IS)=BTHS(IS-NTH)-BTH(IS-(SSDSBRFDF+1)*NTH) - END DO - END DO - ! division by NSMOOTH - BTH0(:)=MAX(0.,BTH0S(:)/NSMOOTH(:)) - DO IK=IK1,NK - IS0=(IK-1)*NTH - BTH(IS0+1:IS0+NTH)=MAX(0.,BTHS(IS0+1:IS0+NTH)/NSMOOTH(IK)) - END DO - END IF ! end of optional smoothing + END DO !IK=NK ! ! 2.a.2 Computes spontaneous breaking dissipation rate ! @@ -2238,7 +2272,8 @@ SUBROUTINE W3SDS4 (A, K, CG, USTAR, USDIR, DEPTH, DAIR, SRHS, & MICHE=1. ELSE X=TANH(MIN(K(IK)*DEPTH,10.)) - MICHE=(X*(SSDSBM(1)+X*(SSDSBM(2)+X*(SSDSBM(3)+X*SSDSBM(4)))))**2 ! Correction of saturation level for shallow-water kinematics + ! Correction of saturation threshold for shallow-water kinematics + MICHE=(X*(SSDSBM(1)+X*(SSDSBM(2)+X*(SSDSBM(3)+X*SSDSBM(4)))))**2 END IF COEF1=(SSDSBR*MICHE) ! @@ -2268,7 +2303,7 @@ SUBROUTINE W3SDS4 (A, K, CG, USTAR, USDIR, DEPTH, DAIR, SRHS, & BRLAMBDA = PB / (2.*PI**2.) SRHS = DDIAG * A - ! + !############################################################################################" CASE(2) ! ! 2.b Computes spontaneous breaking for T500 (Filipot et al. JGR 2010) @@ -2412,7 +2447,8 @@ SUBROUTINE W3SDS4 (A, K, CG, USTAR, USDIR, DEPTH, DAIR, SRHS, & ! Compute Lambda = PB* l(k,th) ! with l(k,th)=1/(2*pi²)= the breaking crest density BRLAMBDA = PB / (2.*PI**2.) - ! + SRHS = DDIAG * A + !############################################################################################" CASE(3) ! ! 2c Romero (GRL 2019) @@ -2425,27 +2461,15 @@ SUBROUTINE W3SDS4 (A, K, CG, USTAR, USDIR, DEPTH, DAIR, SRHS, & KLOC=K(IK)**(2-SSDSC(20)) ! local wavenumber factor, if mss not used. BTH(1:NTH)=MAX(A(IS0+1:IS0+NTH)*SIG(IK)*K(IK)**3,.00000000000001) ! - IF (SSDSC(8).GT.0) THEN ! Applies modulation factor on B - DO ITH=1,NTH - MSSTH=(MSSSUM(IK,1)-MSSSUM(IK,2))*EC2(1+ABS(ITH-IMSSMAX (IK))) & - +MSSSUM(IK,2)*ES2(1+ABS(ITH-IMSSMAX (IK)))*KLOC - FACSTRAINB=(1.+SSDSC(8)*SQRT(MSSTH)+SSDSC(11)*SQRT(MSSSUM2(IK,ITH))*KLOC) - BTH(ITH)=BTH(ITH)*FACSTRAINB - END DO - END IF - ! + DIRFORCUM=DLWMEAN + IF (SSDSC(11).GT.0) DIRFORCUM=MSSSUM(IK,2) + C=SIG(IK)/K(IK) BTH0(IK)=sum(BTH(1:NTH)*DTH) IF (SSDSC(18).GT.0) THEN ! Applies modulation factor on Lambda DO ITH=1,NTH - IF (SSDSC(11).GT.0) THEN - MSSTH=(MSSSUM(IK,1)-MSSSUM(IK,2))*EC2(1+ABS(ITH-IMSSMAX (IK))) & - +MSSSUM(IK,2)*ES2(1+ABS(ITH-IMSSMAX (IK)))*KLOC - FACSTRAINL=1.+SSDSC(18)*SQRT(MSSTH)+SSDSC(11)*SQRT(MSSSUM2(IK,ITH)*KLOC) - ELSE - FACSTRAINL=1.+SSDSC(18)*((MSSSUM(IK,1)*KLOC)**SSDSC(14) * & ! Romero - (ECOS(ITH)*COS(DLWMEAN)+ESIN(ITH)*SIN(DLWMEAN))**2) - ENDIF + FACSTRAINL=1.+SSDSC(18)*((MSSSUM(IK,1)*KLOC)**SSDSC(14) * & ! Romero + (ECOS(ITH)*COS(DIRFORCUM)+ESIN(ITH)*SIN(DIRFORCUM))**2) LMODULATION(ITH)= FACSTRAINL**SSDSC(19) END DO ELSE @@ -2470,7 +2494,7 @@ SUBROUTINE W3SDS4 (A, K, CG, USTAR, USDIR, DEPTH, DAIR, SRHS, & PB = BRLAMBDA *C ! END SELECT - ! + !############################################################################################" ! ! !/ ------------------------------------------------------------------- / @@ -2482,16 +2506,29 @@ SUBROUTINE W3SDS4 (A, K, CG, USTAR, USDIR, DEPTH, DAIR, SRHS, & ! IF ( (SSDSC(3).NE.0.) .OR. (SSDSC(5).NE.0.) .OR. (SSDSC(21).NE.0.) ) THEN DO IK=IK1, NK + RENEWALFREQ = 0. FACTURB2=-2.*SIG(IK)*K(IK)*FACTURB DVISC=-4.*SSDSC(21)*K(IK)*K(IK) + C = SIG(IK)/K(IK) ! phase speed ! + IF (SSDSC(3).GT.0 .AND. IK.GT.DIKCUMUL) THEN + ! this is the cheap isotropic version + DO IK2=IK1,IK-DIKCUMUL + C2 = SIG(IK2)/K(IK2) + IS2=(IK2-1)*NTH + CUMULWISO=ABS(C2-C)*DSIP(IK2)/(0.5*C2) * DTH + RENEWALFREQ=RENEWALFREQ-CUMULWISO*SUM(BRLAMBDA(IS2+1:IS2+NTH)) + END DO + END IF + DO ITH=1,NTH IS=ITH+(IK-1)*NTH ! ! Computes cumulative effect from Breaking probability ! - RENEWALFREQ = 0. - IF (SSDSC(3).NE.0 .AND. IK.GT.DIKCUMUL) THEN + IF (SSDSC(3).LT.0 .AND. IK.GT.DIKCUMUL) THEN + RENEWALFREQ = 0. + ! this is the expensive and largely useless version DO IK2=IK1,IK-DIKCUMUL IF (BTH0(IK2).GT.SSDSBR) THEN IS2=(IK2-1)*NTH @@ -2520,7 +2557,7 @@ SUBROUTINE W3SDS4 (A, K, CG, USTAR, USDIR, DEPTH, DAIR, SRHS, & RETURN END IF ! - WHITECAP(1:2) = 0. + WHITECAP(1:4) = 0. ! ! precomputes integration of Lambda over direction ! times wavelength times a (a=5 in Reul&Chapron JGR 2003) times dk diff --git a/model/src/w3srcemd.F90 b/model/src/w3srcemd.F90 index 11f6137a3..e90ba88eb 100644 --- a/model/src/w3srcemd.F90 +++ b/model/src/w3srcemd.F90 @@ -494,24 +494,22 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & ! !/ ------------------------------------------------------------------- / USE CONSTANTS, ONLY: DWAT, srce_imp_post, srce_imp_pre, & - srce_direct, GRAV, TPI, TPIINV, LPDLIB -#ifdef W3_T - USE CONSTANTS, ONLY: RADE -#endif + srce_direct, GRAV, TPI, TPIINV USE W3GDATMD, ONLY: NK, NTH, NSPEC, SIG, TH, DMIN, DTMAX, & DTMIN, FACTI1, FACTI2, FACSD, FACHFA, FACP, & XFC, XFLT, XREL, XFT, FXFM, FXPM, DDEN, & FTE, FTF, FHMAX, ECOS, ESIN, IICEDISP, & ICESCALES, IICESMOOTH - USE W3GDATMD, ONLY: FSSOURCE, optionCall - USE W3GDATMD, ONLY: B_JGS_NLEVEL, B_JGS_SOURCE_NONLINEAR, B_JGS_LIMITER -#ifdef W3_REF1 - USE W3GDATMD, ONLY: IOBP, IOBPD, IOBDP, GTYPE, UNGTYPE, REFPARS -#endif USE W3WDATMD, ONLY: TIME USE W3ODATMD, ONLY: NDSE, NDST, IAPROC - USE W3IDATMD, ONLY: INFLAGS2, ICEP2 + USE W3IDATMD, ONLY: INFLAGS2 USE W3DISPMD +#ifdef W3_T + USE CONSTANTS, ONLY: RADE +#endif +#ifdef W3_REF1 + USE W3GDATMD, ONLY: IOBP, IOBPD, GTYPE, UNGTYPE, REFPARS +#endif #ifdef W3_NNT USE W3ODATMD, ONLY: IAPROC, SCREEN, FNMPRE #endif @@ -557,7 +555,7 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & #endif #ifdef W3_ST4 USE W3SRC4MD, ONLY : W3SPR4, W3SIN4, W3SDS4 - USE W3GDATMD, ONLY : ZZWND, FFXFM, FFXPM, FFXFA + USE W3GDATMD, ONLY : ZZWND, FFXFM, FFXPM, FFXFA, SINTAILPAR #endif #ifdef W3_ST6 USE W3SRC6MD @@ -566,6 +564,7 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & #endif #ifdef W3_NL1 USE W3SNL1MD + USE W3GDATMD, ONLY: IQTPE #endif #ifdef W3_NL2 USE W3SNL2MD @@ -639,14 +638,15 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & USE W3SERVMD, ONLY: EXTCDE #endif #ifdef W3_UOST - USE W3UOSTMD, ONLY : UOST_SRCTRMCOMPUTE + USE W3UOSTMD, ONLY: UOST_SRCTRMCOMPUTE #endif #ifdef W3_PDLIB - USE PDLIB_W3PROFSMD, ONLY : B_JAC, ASPAR_JAC, ASPAR_DIAG_SOURCES, ASPAR_DIAG_ALL - USE yowNodepool, ONLY: PDLIB_CCON, NPA, PDLIB_I_DIAG, PDLIB_JA, PDLIB_IA_P, PDLIB_SI - USE W3GDATMD, ONLY: IOBP_LOC, IOBPD_LOC, IOBPA_LOC, IOBDP_LOC, B_JGS_LIMITER_FUNC + USE PDLIB_W3PROFSMD, ONLY : B_JAC, ASPAR_JAC, ASPAR_DIAG_ALL + USE yowNodepool, ONLY: PDLIB_I_DIAG, PDLIB_SI + USE W3GDATMD, ONLY: B_JGS_LIMITER, FSSOURCE, optionCall + USE W3GDATMD, ONLY: IOBP_LOC, IOBPD_LOC, B_JGS_LIMITER_FUNC USE W3WDATMD, ONLY: VA - USE W3PARALL, ONLY: ONESIXTH, ZERO, THR, IMEM, LSLOC + USE W3PARALL, ONLY: IMEM, LSLOC #endif !/ IMPLICIT NONE @@ -681,283 +681,253 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & !/ ------------------------------------------------------------------- / !/ Local parameters !/ - INTEGER :: IK, ITH, IS, IS0, NSTEPS, NKH, NKH1,& - IKS1, IS1, NSPECH, IDT, IERR, NKD, ISP - INTEGER :: IOBPIP, IOBPDIP, IOBDPIP -#ifdef W3_S - INTEGER, SAVE :: IENT = 0 -#endif -#ifdef W3_NNT - INTEGER, SAVE :: NDSD = 89, NDSD2 = 88, J -#endif -#ifdef W3_NL5 - INTEGER :: QI5TSTART(2) - REAL :: QR5KURT - INTEGER, PARAMETER :: NL5_SELECT = 1 - REAL, PARAMETER :: NL5_OFFSET = 0. ! explicit dyn. -#endif - REAL :: DTTOT, FHIGH, DT, AFILT, DAMAX, AFAC,& + INTEGER :: IK, ITH, IS, IS0, NSTEPS, NKH, NKH1, & + IKS1, IS1, NSPECH, IDT, IERR, ISP + REAL :: DTTOT, FHIGH, DT, AFILT, DAMAX, AFAC, & HDT, ZWND, FP, DEPTH, TAUSCX, TAUSCY, FHIGI ! Scaling factor for SIN, SDS, SNL - REAL :: ICESCALELN, ICESCALEIN, ICESCALENL, ICESCALEDS - REAL :: EMEAN, FMEAN, AMAX, CD, Z0, SCAT, & + REAL :: ICESCALELN, ICESCALEIN, ICESCALENL, ICESCALEDS + REAL :: EMEAN, FMEAN, AMAX, CD, Z0, SCAT, & SMOOTH_ICEDISP - REAL :: WN_R(NK), CG_ICE(NK),ALPHA_LIU(NK), ICECOEF2,& - R(NK) - DOUBLE PRECISION :: ATT, ISO -#ifdef W3_ST1 - REAL :: FH1, FH2 -#endif -#ifdef W3_ST2 - REAL :: FHTRAN, DFH, FACDIA, FACPAR -#endif -#ifdef W3_ST3 - REAL :: FMEANS, FH1, FH2 -#endif -#ifdef W3_ST4 - REAL :: FMEANS, FH1, FH2, FAGE, DLWMEAN -#endif - REAL :: QCERR = 0. !/XNL2 and !/NNT -#ifdef W3_SEED - REAL :: UC, SLEV -#endif -#ifdef W3_MLIM - REAL :: HM, EM -#endif -#ifdef W3_NNT - REAL :: FACNN -#endif -#ifdef W3_T - REAL :: DTRAW -#endif - REAL :: EBAND, DIFF, EFINISH, HSTOT, PHINL, & - FMEAN1, FMEANWS, MWXINIT, MWYINIT, & + REAL :: WN_R(NK), CG_ICE(NK), ALPHA_LIU(NK), ICECOEF2, R(NK) + DOUBLE PRECISION :: ATT, ISO + REAL :: EBAND, DIFF, EFINISH, HSTOT, PHINL, & + FMEAN1, FMEANWS, & FACTOR, FACTOR2, DRAT, TAUWAX, TAUWAY, & MWXFINISH, MWYFINISH, A1BAND, B1BAND, & COSI(2) - REAL :: SPECINIT(NSPEC), SPEC2(NSPEC), FRLOCAL, JAC2 - REAL :: DAM (NSPEC), DAM2(NSPEC), WN2 (NSPEC), & + REAL :: SPECINIT(NSPEC), SPEC2(NSPEC), FRLOCAL, JAC2 + REAL :: DAM (NSPEC), DAM2(NSPEC), WN2(NSPEC), & VSLN(NSPEC), & VSIN(NSPEC), VDIN(NSPEC), & VSNL(NSPEC), VDNL(NSPEC), & VSDS(NSPEC), VDDS(NSPEC), & -#ifdef W3_ST6 - VSWL(NSPEC), VDWL(NSPEC), & + VSBT(NSPEC), VDBT(NSPEC) + REAL :: VS(NSPEC), VD(NSPEC), EB(NK) + + LOGICAL :: SHAVE + LOGICAL :: LBREAK + LOGICAL, SAVE :: FIRST = .TRUE. + LOGICAL :: PrintDeltaSmDA + REAL :: eInc1, eInc2, eVS, eVD, JAC + REAL :: DeltaSRC(NSPEC) + + REAL :: FOUT(NK,NTH), SOUT(NK,NTH), DOUT(NK,NTH) + REAL, SAVE :: TAUNUX, TAUNUY + LOGICAL, SAVE :: FLTEST = .FALSE., FLAGNN = .TRUE. + +#ifdef W3_OMPG + !$omp threadprivate( TAUNUX, TAUNUY) + !$omp threadprivate( FLTEST, FLAGNN ) + !$omp threadprivate( FIRST ) #endif - VSBT(NSPEC), VDBT(NSPEC), & -#ifdef W3_IC1 - VSIC(NSPEC), VDIC(NSPEC), & + + !/ + !/ ------------------------------------------------------------------- / + !/ Local parameters dependent on compile switch + !/ +#ifdef W3_S + INTEGER, SAVE :: IENT = 0 #endif -#ifdef W3_IC2 - VSIC(NSPEC), VDIC(NSPEC), & + +#ifdef W3_NNT + INTEGER, SAVE :: NDSD = 89, NDSD2 = 88, J + REAL :: QCERR = 0. !/XNL2 and !/NNT #endif -#ifdef W3_IC3 - VSIC(NSPEC), VDIC(NSPEC), & + +#ifdef W3_NL5 + INTEGER :: QI5TSTART(2) + REAL :: QR5KURT + INTEGER, PARAMETER :: NL5_SELECT = 1 + REAL, PARAMETER :: NL5_OFFSET = 0. ! explicit dyn. #endif -#ifdef W3_IC4 - VSIC(NSPEC), VDIC(NSPEC), & + +#ifdef W3_SEED + REAL :: UC, SLEV #endif -#ifdef W3_IC5 - VSIC(NSPEC), VDIC(NSPEC), & + +#ifdef W3_MLIM + REAL :: HM, EM +#endif + +#ifdef W3_NNT + REAL :: FACNN #endif + +#ifdef W3_T + REAL :: DTRAW +#endif + +#if defined(W3_IC1) || defined(W3_IC2) || defined(W3_IC3) || defined(W3_IC4) || defined(W3_IC5) + REAL :: VSIC(NSPEC), VDIC(NSPEC) +#endif + #ifdef W3_DB1 - VSDB(NSPEC), VDDB(NSPEC), & + REAL :: VSDB(NSPEC), VDDB(NSPEC) #endif + #ifdef W3_TR1 - VSTR(NSPEC), VDTR(NSPEC), & + REAL :: VSTR(NSPEC), VDTR(NSPEC) #endif + #ifdef W3_BS1 - VSBS(NSPEC), VDBS(NSPEC), & + REAL :: VSBS(NSPEC), VDBS(NSPEC) #endif + #ifdef W3_REF1 - VREF(NSPEC), & + REAL :: VREF(NSPEC) #endif -#ifdef W3_IS1 - VSIR(NSPEC), VDIR(NSPEC), & + +#if defined(W3_IS1) || defined(W3_IS2) + REAL :: VSIR(NSPEC), VDIR(NSPEC) #endif + #ifdef W3_IS2 - VSIR(NSPEC), VDIR(NSPEC),VDIR2(NSPEC), & + REAL :: VDIR2(NSPEC) + DOUBLE PRECISION :: SCATSPEC(NTH) #endif + #ifdef W3_UOST - VSUO(NSPEC), VDUO(NSPEC), & + REAL :: VSUO(NSPEC), VDUO(NSPEC) #endif - VS(NSPEC), VD(NSPEC), EB(NK) -#ifdef W3_ST3 - LOGICAL :: LLWS(NSPEC) + +#ifdef W3_ST1 + REAL :: FH1, FH2 #endif -#ifdef W3_ST4 - LOGICAL :: LLWS(NSPEC) - REAL :: BRLAMBDA(NSPEC) + +#ifdef W3_ST2 + REAL :: FHTRAN, DFH, FACDIA, FACPAR #endif -#ifdef W3_IS2 - DOUBLE PRECISION :: SCATSPEC(NTH) + +#ifdef W3_ST3 + REAL :: FMEANS, FH1, FH2 #endif - REAL :: FOUT(NK,NTH), SOUT(NK,NTH), DOUT(NK,NTH) - REAL, SAVE :: TAUNUX, TAUNUY -#ifdef W3_OMPG - !$omp threadprivate( TAUNUX, TAUNUY) + +#ifdef W3_ST4 + REAL :: FMEANS, FH1, FH2, FAGE, DLWMEAN + REAL :: BRLAMBDA(NSPEC) #endif - LOGICAL, SAVE :: FLTEST = .FALSE., FLAGNN = .TRUE. -#ifdef W3_OMPG - !$omp threadprivate( FLTEST, FLAGNN ) + +#if defined(W3_ST3) || defined(W3_ST4) + LOGICAL :: LLWS(NSPEC) #endif - LOGICAL :: SHAVE - LOGICAL :: LBREAK - LOGICAL, SAVE :: FIRST = .TRUE. -#ifdef W3_OMPG - !$omp threadprivate( FIRST ) + +#ifdef W3_ST6 + REAL :: VSWL(NSPEC), VDWL(NSPEC) #endif - LOGICAL :: PrintDeltaSmDA - REAL :: eInc1, eInc2, eVS, eVD, JAC - REAL :: DeltaSRC(NSPEC) - REAL, PARAMETER :: DTMINTOT = 0.01 + #ifdef W3_PDLIB - REAL :: PreVS, FAK, DVS, SIDT, FAKS, MAXDAC + REAL :: PreVS, DVS, SIDT, FAKS, MAXDAC #endif #ifdef W3_NNT CHARACTER(LEN=17), SAVE :: FNAME = 'test_data_nnn.ww3' #endif - !/ - !/ ------------------------------------------------------------------- / - !/ + ! + !/ -- End of variable delclarations + ! #ifdef W3_S CALL STRACE (IENT, 'W3SRCE') #endif - ! + #ifdef W3_T FLTEST = .TRUE. #endif ! - VDIO = 0. - VSIO = 0. - DEPTH = MAX ( DMIN , D_INP ) - IKS1 = 1 - ICESCALELN = MAX(0.,MIN(1.,1.-ICE*ICESCALES(1))) - ICESCALEIN = MAX(0.,MIN(1.,1.-ICE*ICESCALES(2))) - ICESCALENL = MAX(0.,MIN(1.,1.-ICE*ICESCALES(3))) - ICESCALEDS = MAX(0.,MIN(1.,1.-ICE*ICESCALES(4))) #ifdef W3_IG1 - ! ! Does not integrate source terms for IG band if IGPARS(12) = 0. - ! IF (NINT(IGPARS(12)).EQ.0) IKS1 = NINT(IGPARS(5)) #endif IS1=(IKS1-1)*NTH+1 - ! -#ifdef W3_LN0 - VSLN = 0. -#endif -#ifdef W3_LN1 - VSLN = 0. -#endif -#ifdef W3_SEED + + !! Initialise source term arrays: + VD = 0. + VS = 0. + VDIO = 0. + VSIO = 0. + VSBT = 0. + VDBT = 0. + +#if defined(W3_LN0) || defined(W3_LN1) || defined(W3_SEED) VSLN = 0. #endif -#ifdef W3_ST0 - VSIN = 0. - VDIN = 0. -#endif -#ifdef W3_ST3 - VSIN = 0. - VDIN = 0. -#endif -#ifdef W3_ST4 + +#if defined(W3_ST0) || defined(W3_ST3) || defined(W3_ST4) VSIN = 0. VDIN = 0. #endif -#ifdef W3_NL0 - VSNL = 0. - VDNL = 0. -#endif -#ifdef W3_NL1 +#if defined(W3_NL0) || defined(W3_NL1) VSNL = 0. VDNL = 0. #endif + #ifdef W3_TR1 VSTR = 0. VDTR = 0. #endif -#ifdef W3_ST0 - VSDS = 0. - VDDS = 0. -#endif -#ifdef W3_ST4 + +#if defined(W3_ST0) || defined(W3_ST4) VSDS = 0. VDDS = 0. #endif - VSBT = 0. - VDBT = 0. + #ifdef W3_DB1 VSDB = 0. VDDB = 0. #endif -#ifdef W3_IC1 - VSIC = 0. - VDIC = 0. -#endif -#ifdef W3_IC2 - VSIC = 0. - VDIC = 0. -#endif -#ifdef W3_IC3 - VSIC = 0. - VDIC = 0. -#endif -#ifdef W3_IC4 + +#if defined(W3_IC1) || defined(W3_IC2) || defined(W3_IC3) || defined(W3_IC4) || defined(W3_IC5) VSIC = 0. VDIC = 0. #endif + #ifdef W3_UOST VSUO = 0. VDUO = 0. #endif -#ifdef W3_IC5 - VSIC = 0. - VDIC = 0. -#endif - ! -#ifdef W3_IS1 + +#if defined(W3_IS1) || defined(W3_IS2) VSIR = 0. VDIR = 0. #endif + #ifdef W3_IS2 - VSIR = 0. - VDIR = 0. - VDIR2= 0. + VDIR2 = 0. #endif - ! + #ifdef W3_ST6 VSWL = 0. VDWL = 0. #endif - ! -#ifdef W3_ST0 - ZWND = 10. -#endif -#ifdef W3_ST1 - ZWND = 10. -#endif -#ifdef W3_ST2 - ZWND = ZWIND + +#if defined(W3_ST0) || defined(W3_ST1) || defined(W3_ST6) + ZWND = 10. #endif -#ifdef W3_ST4 - ZWND = ZZWND + +#if defined(W3_ST2) + ZWND = ZWIND #endif -#ifdef W3_ST6 - ZWND = 10. + +#if defined(W3_ST4) + ZWND = ZZWND #endif ! - DRAT = DAIR / DWAT + ! 1. Preparations --------------------------------------------------- * + ! + DEPTH = MAX ( DMIN , D_INP ) + DRAT = DAIR / DWAT + ICESCALELN = MAX(0.,MIN(1.,1.-ICE*ICESCALES(1))) + ICESCALEIN = MAX(0.,MIN(1.,1.-ICE*ICESCALES(2))) + ICESCALENL = MAX(0.,MIN(1.,1.-ICE*ICESCALES(3))) + ICESCALEDS = MAX(0.,MIN(1.,1.-ICE*ICESCALES(4))) + #ifdef W3_T WRITE (NDST,9000) WRITE (NDST,9001) DEPTH, U10ABS, U10DIR*RADE #endif - ! - ! 1. Preparations --------------------------------------------------- * - ! + ! 1.a Set maximum change and wavenumber arrays. ! !XP = 0.15 @@ -1064,10 +1034,14 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & TWS = 1./FMEANWS #endif #ifdef W3_ST4 - TAUWX=0. - TAUWY=0. - IF ( IT .eq. 0 ) THEN + IF (SINTAILPAR(4).GT.0.5) THEN ! this is designed to keep the bug as an option + TAUWX=0. + TAUWY=0. + END IF + IF ( IT .EQ. 0 ) THEN LLWS(:) = .TRUE. + TAUWX=0. + TAUWY=0. USTAR=0. USTDIR=0. ELSE @@ -1080,8 +1054,7 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & TAUWX, TAUWY, CD, Z0, CHARN, LLWS, FMEANWS, DLWMEAN) #endif -#ifdef W3_DEBUGSRC -#ifdef W3_ST4 +#if defined(W3_DEBUGSRC) && defined(W3_ST4) IF (IX == DEBUG_NODE) THEN WRITE(740+IAPROC,*) '1: out value USTAR=', USTAR, ' USTDIR=', USTDIR WRITE(740+IAPROC,*) '1: out value EMEAN=', EMEAN, ' FMEAN=', FMEAN @@ -1090,16 +1063,14 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & WRITE(740+IAPROC,*) '1: out value ALPHA=', CHARN, ' FMEANWS=', FMEANWS END IF #endif -#endif #ifdef W3_ST4 - CALL W3SIN4 ( SPEC, CG1, WN2, U10ABS, USTAR, DRAT, AS, & + IF (SINTAILPAR(4).GT.0.5) CALL W3SIN4 ( SPEC, CG1, WN2, U10ABS, USTAR, DRAT, AS, & U10DIR, Z0, CD, TAUWX, TAUWY, TAUWAX, TAUWAY, & VSIN, VDIN, LLWS, IX, IY, BRLAMBDA ) END IF #endif -#ifdef W3_DEBUGSRC -#ifdef W3_ST4 +#if defined(W3_DEBUGSRC) && defined(W3_ST4) IF (IX == DEBUG_NODE) THEN WRITE(740+IAPROC,*) '1: U10DIR=', U10DIR, ' Z0=', Z0, ' CHARN=', CHARN WRITE(740+IAPROC,*) '1: USTAR=', USTAR, ' U10ABS=', U10ABS, ' AS=', AS @@ -1111,7 +1082,6 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & WRITE(740+IAPROC,*) '1: W3SIN4(min/max/sum)VDIN=', minval(VDIN), maxval(VDIN), sum(VDIN) END IF #endif -#endif #ifdef W3_ST4 CALL W3SPR4 (SPEC, CG1, WN1, EMEAN, FMEAN, FMEAN1, WNMEAN, & @@ -1171,9 +1141,7 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & #endif #ifdef W3_ST4 ! Introduces a Long & Resio (JGR2007) type dependance on wave age -#endif ! !/ST4 FAGE = FFXFA*TANH(0.3*U10ABS*FMEANWS*TPI/GRAV) -#ifdef W3_ST4 FAGE = 0. FHIGH = MAX( (FFXFM + FAGE ) * MAX(FMEAN1,FMEANWS), FFXPM / USTAR) FHIGI = FFXFA * FMEAN1 @@ -1237,14 +1205,12 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & VSIN, VDIN, LLWS, IX, IY, BRLAMBDA ) #endif -#ifdef W3_DEBUGSRC -#ifdef W3_ST4 +#if defined(W3_DEBUGSRC) && defined(W3_ST4) IF (IX == DEBUG_NODE) THEN WRITE(740+IAPROC,*) '2 : W3SIN4(min/max/sum)VSIN=', minval(VSIN), maxval(VSIN), sum(VSIN) WRITE(740+IAPROC,*) '2 : W3SIN4(min/max/sum)VDIN=', minval(VDIN), maxval(VDIN), sum(VDIN) END IF #endif -#endif #ifdef W3_ST6 CALL W3SIN6 ( SPEC, CG1, WN2, U10ABS, USTAR, USTDIR, CD, DAIR, & @@ -1254,16 +1220,20 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & ! 2.b Nonlinear interactions. ! #ifdef W3_NL1 - CALL W3SNL1 ( SPEC, CG1, WNMEAN*DEPTH, VSNL, VDNL ) + IF (IQTPE.GT.0) THEN + CALL W3SNL1 ( SPEC, CG1, WNMEAN*DEPTH, VSNL, VDNL ) + ELSE + CALL W3SNLGQM ( SPEC, CG1, WN1, DEPTH, VSNL, VDNL ) + END IF #endif #ifdef W3_NL2 - CALL W3SNL2 ( SPEC, CG1, DEPTH, VSNL, VDNL ) + CALL W3SNL2 ( SPEC, CG1, DEPTH, VSNL, VDNL ) #endif #ifdef W3_NL3 - CALL W3SNL3 ( SPEC, CG1, WN1, DEPTH, VSNL, VDNL ) + CALL W3SNL3 ( SPEC, CG1, WN1, DEPTH, VSNL, VDNL ) #endif #ifdef W3_NL4 - CALL W3SNL4 ( SPEC, CG1, WN1, DEPTH, VSNL, VDNL ) + CALL W3SNL4 ( SPEC, CG1, WN1, DEPTH, VSNL, VDNL ) #endif #ifdef W3_NL5 CALL W3SNL5 ( SPEC, CG1, WN1, FMEAN, QI5TSTART, & @@ -1297,15 +1267,12 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & CALL W3SDS4 ( SPEC, WN1, CG1, USTAR, USTDIR, DEPTH, DAIR, VSDS, & VDDS, IX, IY, BRLAMBDA, WHITECAP, DLWMEAN ) #endif - -#ifdef W3_DEBUGSRC -#ifdef W3_ST4 +#if defined(W3_DEBUGSRC) && defined(W3_ST4) IF (IX == DEBUG_NODE) THEN WRITE(740+IAPROC,*) '2 : W3SDS4(min/max/sum)VSDS=', minval(VSDS), maxval(VSDS), sum(VSDS) WRITE(740+IAPROC,*) '2 : W3SDS4(min/max/sum)VDDS=', minval(VDDS), maxval(VDDS), sum(VDDS) END IF #endif -#endif #ifdef W3_ST6 CALL W3SDS6 ( SPEC, CG1, WN1, VSDS, VDDS ) @@ -1367,9 +1334,7 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & 8888 FORMAT (1X,I8.8,1X,I6.6,F8.1,L2,F8.2) WRITE (NDSD,ERR=801,IOSTAT=IERR) IX, IY, TIME, NSTEPS, & DTTOT, FLAGNN, DEPTH, U10ABS, U10DIR -#endif ! -#ifdef W3_NNT IF ( FLAGNN ) THEN DO IK=1, NK FACNN = TPI * SIG(IK) / CG1(IK) @@ -1449,11 +1414,9 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & #ifdef W3_ST6 VS(IS) = VS(IS) + VSWL(IS) #endif -#ifndef W3_PDLIB -#ifdef W3_TR1 +#if defined(W3_TR1) && !defined(W3_PDLIB) VS(IS) = VS(IS) + VSTR(IS) #endif -#endif #ifdef W3_BS1 VS(IS) = VS(IS) + VSBS(IS) #endif @@ -1465,34 +1428,30 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & #ifdef W3_ST6 VD(IS) = VD(IS) + VDWL(IS) #endif -#ifndef W3_PDLIB -#ifdef W3_TR1 +#if defined(W3_TR1) && !defined(W3_PDLIB) VD(IS) = VD(IS) + VDTR(IS) #endif -#endif #ifdef W3_BS1 VD(IS) = VD(IS) + VDBS(IS) #endif #ifdef W3_UOST VD(IS) = VD(IS) + VDUO(IS) #endif - DAMAX = MIN ( DAM(IS) , MAX ( XREL*SPECINIT(IS) , AFILT ) ) - AFAC = 1. / MAX( 1.E-10 , ABS(VS(IS)/DAMAX) ) + DAMAX = MIN ( DAM(IS) , MAX ( XREL*SPECINIT(IS) , AFILT ) ) + AFAC = 1. / MAX( 1.E-10 , ABS(VS(IS)/DAMAX) ) #ifdef W3_NL5 IF (NL5_SELECT .EQ. 1) THEN - DT = MIN ( DT , AFAC / ( MAX ( 1.E-10, & + DT = MIN ( DT , AFAC / ( MAX ( 1.E-10, & 1. + NL5_OFFSET*AFAC*MIN(0.,VD(IS)) ) ) ) ELSE #endif - DT = MIN ( DT , AFAC / ( MAX ( 1.E-10, & + DT = MIN ( DT , AFAC / ( MAX ( 1.E-10, & 1. + OFFSET*AFAC*MIN(0.,VD(IS)) ) ) ) #ifdef W3_NL5 ENDIF #endif END DO ! end of loop on IS - !VD = 0 - !VS = 0 ! DT = MAX ( 0.5, DT ) ! The hardcoded min. dt is a problem for certain cases e.g. laborotary scale problems. ! @@ -1500,11 +1459,11 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & #ifdef W3_T DTRAW = DT #endif - IDT = 1 + INT ( 0.99*(DTG-DTTOT)/DT ) ! number of iterations - DT = (DTG-DTTOT)/REAL(IDT) ! actualy time step - SHAVE = DT.LT.DTMIN .AND. DT.LT.DTG-DTTOT ! limiter check ... + IDT = 1 + INT ( 0.99*(DTG-DTTOT)/DT ) ! number of iterations + DT = (DTG-DTTOT)/REAL(IDT) ! actualy time step + SHAVE = DT.LT.DTMIN .AND. DT.LT.DTG-DTTOT ! limiter check ... SHAVEIO = SHAVE - DT = MAX ( DT , MIN (DTMIN,DTG-DTTOT) ) ! override dt with input time step or last time step if it is bigger ... anyway the limiter is on! + DT = MAX ( DT , MIN (DTMIN,DTG-DTTOT) ) ! override dt with input time step or last time step if it is bigger ... anyway the limiter is on! ! #ifdef W3_NL5 DT = INT(DT) * 1.0 @@ -1702,7 +1661,7 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & RETURN ! return everything is done for the implicit ... END IF ! srce_imp_pre -!W3_PDLIB +! --end W3_PDLIB #endif ! #ifdef W3_T @@ -1758,9 +1717,7 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & WRITE(740+IAPROC,*) ' srce_direct : sum(VDTOT)=', sum(MIN(0. , VD)) END IF #endif - END IF - - + END IF ! srce_call .eq. srce_direct ! ! 5.b Computes ! atmos->wave flux PHIAW-------------------------------- * @@ -1790,12 +1747,12 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & HSTOT = HSTOT + SPEC(IS) * FACTOR END DO END DO - WHITECAP(3)=4.*SQRT(WHITECAP(3)) - HSTOT=4.*SQRT(HSTOT) - TAUWIX= TAUWIX+ TAUWX * DRAT *DT - TAUWIY= TAUWIY+ TAUWY * DRAT *DT - TAUWNX= TAUWNX+ TAUWAX * DRAT *DT - TAUWNY= TAUWNY+ TAUWAY * DRAT *DT + WHITECAP(3) = 4. * SQRT(WHITECAP(3)) + HSTOT =4.*SQRT(HSTOT) + TAUWIX = TAUWIX + TAUWX * DRAT * DT + TAUWIY = TAUWIY + TAUWY * DRAT * DT + TAUWNX = TAUWNX + TAUWAX * DRAT * DT + TAUWNY = TAUWNY + TAUWAY * DRAT * DT ! MISSING: TAIL TO BE ADDED ? ! #ifdef W3_NLS @@ -1848,9 +1805,7 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & FHIGH = MIN ( SIG(NK) , MAX ( FH1 , FH2 ) ) NKH = MAX ( 2 , MIN ( NKH1 , & INT ( FACTI2 + FACTI1*LOG(MAX(1.E-7,FHIGH)) ) ) ) -#endif ! -#ifdef W3_ST1 IF ( FLTEST ) WRITE (NDST,9060) & FH1*TPIINV, FH2*TPIINV, FHIGH*TPIINV, NKH #endif @@ -1861,9 +1816,7 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & DFH = FHIGH - FHTRAN NKH = MAX ( 1 , & INT ( FACTI2 + FACTI1*LOG(MAX(1.E-7,FHTRAN)) ) ) -#endif ! -#ifdef W3_ST2 IF ( FLTEST ) WRITE (NDST,9061) FHTRAN, FHIGH, NKH #endif ! @@ -1873,9 +1826,7 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & FHIGH = MIN ( SIG(NK) , MAX ( FH1 , FH2 ) ) NKH = MAX ( 2 , MIN ( NKH1 , & INT ( FACTI2 + FACTI1*LOG(MAX(1.E-7,FHIGH)) ) ) ) -#endif ! -#ifdef W3_ST3 IF ( FLTEST ) WRITE (NDST,9062) & FH1*TPIINV, FH2*TPIINV, FHIGH*TPIINV, NKH #endif @@ -1884,9 +1835,6 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & ! Introduces a Long & Resio (JGR2007) type dependance on wave age FAGE = FFXFA*TANH(0.3*U10ABS*FMEANWS*TPI/GRAV) FH1 = (FFXFM+FAGE) * FMEAN1 -#endif - -#ifdef W3_ST4 FH2 = FFXPM / USTAR FHIGH = MIN ( SIG(NK) , MAX ( FH1 , FH2 ) ) NKH = MAX ( 2 , MIN ( NKH1 , & @@ -1901,9 +1849,7 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & ENDIF NKH = MAX ( 2 , MIN ( NKH1 , & INT ( FACTI2 + FACTI1*LOG(MAX(1.E-7,FHIGH)) ) ) ) -#endif ! -#ifdef W3_ST6 IF ( FLTEST ) WRITE (NDST,9063) FHIGH*TPIINV, NKH #endif ! @@ -1965,6 +1911,13 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & CALL W3SIN4 ( SPEC, CG1, WN2, U10ABS, USTAR, DRAT, AS, & U10DIR, Z0, CD, TAUWX, TAUWY, TAUWAX, TAUWAY, & VSIN, VDIN, LLWS, IX, IY, BRLAMBDA ) + IF (SINTAILPAR(4).LT.0.5) CALL W3SPR4 (SPEC, CG1, WN1, EMEAN, FMEAN, FMEAN1, WNMEAN,& + AMAX, U10ABS, U10DIR, & +#ifdef W3_FLX5 + TAUA, TAUADIR, DAIR, & +#endif + USTAR, USTDIR, & + TAUWX, TAUWY, CD, Z0, CHARN, LLWS, FMEANWS, DLWMEAN) #endif ! @@ -1974,14 +1927,18 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & #ifdef W3_NL5 CALL TICK21(QI5TSTART, DT) #endif + IF (srce_call .eq. srce_imp_post) THEN EXIT ENDIF + IF ( DTTOT .GE. 0.9999*DTG ) THEN - ! IF (IX == DEBUG_NODE) WRITE(*,*) 'DTTOT, DTG', DTTOT, DTG + ! IF (IX == DEBUG_NODE) WRITE(*,*) 'DTTOT, DTG', DTTOT, DTG EXIT ENDIF + END DO ! INTEGRATION LOOP + #ifdef W3_DEBUGSRC IF (IX .eq. DEBUG_NODE) THEN WRITE(740+IAPROC,*) 'NSTEPS=', NSTEPS @@ -2005,9 +1962,7 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & 800 CONTINUE WRITE (NDSE,8000) FNAME, IERR CALL EXTCDE (1) -#endif ! -#ifdef W3_NNT 801 CONTINUE WRITE (NDSE,8001) IERR CALL EXTCDE (2) @@ -2100,13 +2055,12 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & R(:)=1 ! In case IC2 is defined but not IS2 ! #ifdef W3_IC1 - CALL W3SIC1 ( SPEC,DEPTH, CG1, IX, IY, VSIC, VDIC ) + CALL W3SIC1 ( SPEC,DEPTH, CG1, IX, IY, VSIC, VDIC ) #endif #ifdef W3_IS2 CALL W3SIS2 ( SPEC, DEPTH, ICE, ICEH, ICEF, ICEDMAX, IX, IY, & VSIR, VDIR, VDIR2, WN1, CG1, WN_R, CG_ICE, R ) #endif - #ifdef W3_IC2 CALL W3SIC2 ( SPEC, DEPTH, ICEH, ICEF, CG1, WN1,& IX, IY, VSIC, VDIC, WN_R, CG_ICE, ALPHA_LIU, R) @@ -2344,9 +2298,6 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & #ifdef W3_T 9020 FORMAT (' TEST W3SRCE : NSTEP : ',I4,' DTTOT :',F6.1) 9021 FORMAT (' TEST W3SRCE : NKH (3X) : ',2I3,I6) -#endif - ! -#ifdef W3_T 9040 FORMAT (' TEST W3SRCE : DTRAW, DT, SHAVE :',2F6.1,2X,L1) #endif ! diff --git a/model/src/w3wavemd.F90 b/model/src/w3wavemd.F90 index 6cbc7e74f..c144ab8d8 100644 --- a/model/src/w3wavemd.F90 +++ b/model/src/w3wavemd.F90 @@ -2409,8 +2409,7 @@ SUBROUTINE W3WAVE ( IMOD, ODAT, TEND, STAMP, NO_OUT & #endif ! #ifdef W3_MPI - IF ( ( (DSEC21(TIME,TONEXT(:,1)).EQ.0.) .AND. FLOUT(1) ) .OR. & - ( (DSEC21(TIME,TONEXT(:,7)).EQ.0.) .AND. FLOUT(7) .AND. SBSED ) ) THEN + IF ( (FLOUTG) .OR. (FLOUTG2 .AND. SBSED) ) THEN IF (.NOT. LPDLIB) THEN IF (NRQGO.NE.0 ) THEN #endif @@ -2567,7 +2566,11 @@ SUBROUTINE W3WAVE ( IMOD, ODAT, TEND, STAMP, NO_OUT & #ifdef W3_SBS IF ( J .EQ. 1 ) THEN #endif - CALL W3IOGO( 'WRITE', NDS(7), ITEST, IMOD ) + CALL W3IOGO( 'WRITE', NDS(7), ITEST, IMOD & +#ifdef W3_ASCII + ,NDS(14) & +#endif + ) #ifdef W3_SBS ENDIF #endif @@ -2598,7 +2601,11 @@ SUBROUTINE W3WAVE ( IMOD, ODAT, TEND, STAMP, NO_OUT & ! Gets the necessary spectral data ! CALL W3IOPE ( VA ) - CALL W3IOPO ( 'WRITE', NDS(8), ITEST, IMOD ) + CALL W3IOPO ( 'WRITE', NDS(8), ITEST, IMOD & +#ifdef W3_ASCII + ,NDS(15) & +#endif + ) END IF ! ELSE IF ( J .EQ. 3 ) THEN diff --git a/model/src/wminitmd.F90 b/model/src/wminitmd.F90 index 293b74848..956490b5e 100644 --- a/model/src/wminitmd.F90 +++ b/model/src/wminitmd.F90 @@ -426,6 +426,9 @@ SUBROUTINE WMINIT ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & #endif #ifdef W3_MPRF USE WMMDATMD, ONLY: MDSP +#endif +#ifdef W3_ASCII + USE WMMDATMD, ONLY: MDSUPA #endif USE W3INITMD, ONLY: WWVER USE W3ODATMD, ONLY: OFILES @@ -740,7 +743,7 @@ SUBROUTINE WMINIT ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & ! ! 2.c Set up I/O for individual models (initial) ! - ALLOCATE ( MDS(13,NRGRD), NTRACE(2,NRGRD), ODAT(40,0:NRGRD), & + ALLOCATE ( MDS(15,NRGRD), NTRACE(2,NRGRD), ODAT(40,0:NRGRD), & FLGRD(NOGRP,NGRPP,NRGRD), OT2(0:NRGRD), FLGD(NOGRP,NRGRD), & MDSF(-NRINP:NRGRD,JFIRST:9), IPRT(6,NRGRD), LPRT(NRGRD), & FLGR2(NOGRP,NGRPP,NRGRD),FLG2D(NOGRP,NGRPP), FLG1D(NOGRP), & @@ -1897,6 +1900,12 @@ SUBROUTINE WMINIT ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & CALL WMUSET ( MDSS, MDST, MDSUP, .TRUE., 'OUT', & TRIM(FNMPRE)//'out_pnt.'//MNAMES(0)(1:II), & 'Unified point output') +#ifdef W3_ASCII + CALL WMUGET ( MDSS, MDST, MDSUPA, 'OUA' ) + CALL WMUSET ( MDSS, MDST, MDSUPA, .TRUE., 'OUA', & + TRIM(FNMPRE)//'out_pnt.'//MNAMES(0)(1:II)//'.txt', & + 'Unified point output ascii') +#endif END IF END IF ! @@ -2294,8 +2303,20 @@ SUBROUTINE WMINIT ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & SELECT CASE (J) CASE (1) MDS(7,I) = NDSFND +#ifdef W3_ASCII + CALL WMUGET ( MDSE, MDST, NDSFND, 'OUT' ) + CALL WMUSET ( MDSE, MDST, NDSFND, .TRUE., & + DESC='ASCII output file' ) + MDS(14,I) = NDSFND ! ASCII +#endif CASE (2) MDS(8,I) = NDSFND +#ifdef W3_ASCII + CALL WMUGET ( MDSE, MDST, NDSFND, 'OUT' ) + CALL WMUSET ( MDSE, MDST, NDSFND, .TRUE., & + DESC='ASCII output file' ) + MDS(15,I) = NDSFND ! ASCII +#endif CASE (3) MDS(12,I) = NDSFND CALL WMUGET ( MDSE, MDST, NDSFND, 'INP' ) @@ -2413,6 +2434,28 @@ SUBROUTINE WMINIT ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & END IF END IF ! +#ifdef W3_ASCII + IF ( MDS(14,I) .NE. -1 ) THEN ! Grid output (ASCII) + IF ( IAPROC .EQ. NAPFLD ) THEN + TNAME = TRIM(FNMPRE)//'out_grd.' // FILEXT(:II) // '.txt' + CALL WMUSET ( MDSE,MDST, MDS(14,I), .TRUE., NAME=TNAME ) + ELSE + CALL WMUSET ( MDSE,MDST, MDS(14,I), .FALSE. ) + MDS(14,I) = -1 + END IF + END IF + ! + IF ( MDS(15,I) .NE. -1 ) THEN ! Point output (ASCII) + IF ( IAPROC .EQ. NAPPNT ) THEN + TNAME = TRIM(FNMPRE)//'out_pnt.' // FILEXT(:II) // '.txt' + CALL WMUSET ( MDSE,MDST, MDS(15,I), .TRUE., NAME=TNAME ) + ELSE + CALL WMUSET ( MDSE,MDST, MDS(15,I), .FALSE. ) + MDS(15,I) = -1 + END IF + END IF +#endif +! #ifdef W3_T WRITE (MDST,9081) I, TIME #endif @@ -3380,7 +3423,7 @@ SUBROUTINE WMINIT ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & ! #ifdef W3_T 9020 FORMAT ( ' TEST WMINIT : UNIT NUMBERS FOR GRIDS (',A,')'/ & - 15X,'GRID MDS(1-13)',43X,'NTRACE') + 15X,'GRID MDS(1-15)',43X,'NTRACE') 9021 FORMAT (14X,16I4) 9022 FORMAT ( ' TEST WMINIT : UNIT NUMBERS FOR INTPUT FILES'/ & 15X,'GRID MDSF(JFIRST-9)') @@ -3499,6 +3542,7 @@ SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & !/ Add ESMF override for STIME & ETIME ( version 6.02 ) !/ (T. J. Campbell, NRL) !/ 15-May-2018 : Update namelist ( version 6.05 ) + !/ 28-Oct-2020 : Add SMCTYPE for SMC sub-grid. JGLi ( version 7.13 ) !/ 22-Mar-2021 : Add momentum and air density input ( version 7.13 ) !/ ! 1. Purpose : @@ -3518,8 +3562,8 @@ SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & ! IDST Int. I Unit number for test output. ! IDSE Int. I Unit number for error output. ! IFNAME Char I File name for input file. - ! MPI_COMM Int. I MPI communicator to be used. - ! PREAMB Char I File name preamble (optiona). + ! MPI_COMM Int. I MPI communicator to be used. + ! PREAMB Char I File name preamble (optional). ! ---------------------------------------------------------------- ! ! 4. Subroutines used : @@ -3726,11 +3770,11 @@ SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & #endif USE W3WDATMD, ONLY: TIME USE W3ADATMD, ONLY: WADATS - USE W3IDATMD, ONLY: INFLAGS1, INPUTS, IINIT, & - JFIRST, INFLAGS2 + USE W3IDATMD, ONLY: INFLAGS1, INFLAGS2, INPUTS, IINIT, & + JFIRST USE W3ODATMD, ONLY: NOGRP, NGRPP, FLOUT, TONEXT, FLBPI, & FLBPO, NFBPO, NBI, NDS, IAPROC, & - NAPFLD, NAPPNT, NAPTRK, NAPBPT, & + NAPFLD, NAPPNT, NAPTRK, NAPBPT, & NAPPRT, NAPROC, FNMPRE, OUTPTS, NDST, NDSE, & NOPTS, IOSTYP, UNIPTS, UPPROC, DTOUT, & TOLAST, NOTYPE @@ -3749,6 +3793,9 @@ SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & #endif #ifdef W3_MPRF USE WMMDATMD, ONLY: MDSP +#endif +#ifdef W3_ASCII + USE WMMDATMD, ONLY: MDSUPA #endif USE W3INITMD, ONLY: WWVER USE W3NMLMULTIMD @@ -4095,16 +4142,17 @@ SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & ! ! 2.c Set up I/O for individual models (initial) ! - ALLOCATE ( MDS(13,NRGRD), NTRACE(2,NRGRD), ODAT(40,0:NRGRD), & + ALLOCATE ( MDS(15,NRGRD), NTRACE(2,NRGRD), ODAT(40,0:NRGRD), & FLGRD(NOGRP,NGRPP,NRGRD), OT2(0:NRGRD), FLGD(NOGRP,NRGRD), & MDSF(-NRINP:NRGRD,JFIRST:9), IPRT(6,NRGRD), LPRT(NRGRD), & FLGR2(NOGRP,NGRPP,NRGRD),FLG2D(NOGRP,NGRPP), FLG1D(NOGRP), & - FLG2(NOGRP,NRGRD) & - ,OUTFF(7,0:NRGRD)) + FLG2(NOGRP,NRGRD),OUTFF(7,0:NRGRD)) ! MDS = -1 MDSF = -1 FLGR2 = .FALSE. + FLG2 = .FALSE. + LPRT = .FALSE. IPRT = 0 ! ! ... Fixed and recycleable unit numbers. @@ -4148,9 +4196,9 @@ SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & ! sources, and from communication rather than ! files. ! - ALLOCATE ( INAMES(2*NRGRD,-7:9), MNAMES(-NRINP:2*NRGRD), & - TMPRNK(2*NRGRD), TMPGRP(2*NRGRD), NINGRP(2*NRGRD), & - RP1(2*NRGRD), RPN(2*NRGRD), BCDTMP(NRGRD+1:2*NRGRD)) + ALLOCATE ( INAMES(2*NRGRD,-7:9), MNAMES(-NRINP:2*NRGRD), & + TMPRNK(2*NRGRD), TMPGRP(2*NRGRD), NINGRP(2*NRGRD), & + RP1(2*NRGRD), RPN(2*NRGRD), BCDTMP(NRGRD+1:2*NRGRD) ) ALLOCATE ( GRANK(NRGRD), GRGRP(NRGRD), USEINP(NRINP) ) ALLOCATE ( CPLINP(NRINP) ) GRANK = -1 @@ -4615,31 +4663,39 @@ SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & ! DO I=1, NRGRD IF ( MDSS.NE.MDSO .AND. NMPSCR.EQ.IMPROC ) WRITE (MDSS,950) TRIM(MNAMES(NRGRD+I)) - NOTYPE = 6 - + NOTYPE = 8 + ! OTYPE 1 READ(NML_OUTPUT_DATE(I)%FIELD%START, *) ODAT(1,I), ODAT(2,I) READ(NML_OUTPUT_DATE(I)%FIELD%STRIDE, *) ODAT(3,I) READ(NML_OUTPUT_DATE(I)%FIELD%STOP, *) ODAT(4,I), ODAT(5,I) READ(NML_OUTPUT_DATE(I)%FIELD%OUTFFILE, *) OUTFF(1,I) + ! OTYPE 2 READ(NML_OUTPUT_DATE(I)%POINT%START, *) ODAT(6,I), ODAT(7,I) READ(NML_OUTPUT_DATE(I)%POINT%STRIDE, *) ODAT(8,I) READ(NML_OUTPUT_DATE(I)%POINT%STOP, *) ODAT(9,I), ODAT(10,I) READ(NML_OUTPUT_DATE(I)%POINT%OUTFFILE, *) OUTFF(2,I) + ! OTYPE 3 READ(NML_OUTPUT_DATE(I)%TRACK%START, *) ODAT(11,I), ODAT(12,I) READ(NML_OUTPUT_DATE(I)%TRACK%STRIDE, *) ODAT(13,I) READ(NML_OUTPUT_DATE(I)%TRACK%STOP, *) ODAT(14,I), ODAT(15,I) + ! OTYPE 4 READ(NML_OUTPUT_DATE(I)%RESTART%START, *) ODAT(16,I), ODAT(17,I) READ(NML_OUTPUT_DATE(I)%RESTART%STRIDE, *) ODAT(18,I) READ(NML_OUTPUT_DATE(I)%RESTART%STOP, *) ODAT(19,I), ODAT(20,I) - READ(NML_OUTPUT_DATE(I)%RESTART2%START, *) ODAT(36,I), ODAT(37,I) - READ(NML_OUTPUT_DATE(I)%RESTART2%STRIDE, *) ODAT(38,I) - READ(NML_OUTPUT_DATE(I)%RESTART2%STOP, *) ODAT(39,I), ODAT(40,I) + !OTYPE 5 READ(NML_OUTPUT_DATE(I)%BOUNDARY%START, *) ODAT(21,I), ODAT(22,I) READ(NML_OUTPUT_DATE(I)%BOUNDARY%STRIDE, *) ODAT(23,I) READ(NML_OUTPUT_DATE(I)%BOUNDARY%STOP, *) ODAT(24,I), ODAT(25,I) + !OTYPE 6 READ(NML_OUTPUT_DATE(I)%PARTITION%START, *) ODAT(26,I), ODAT(27,I) READ(NML_OUTPUT_DATE(I)%PARTITION%STRIDE, *) ODAT(28,I) READ(NML_OUTPUT_DATE(I)%PARTITION%STOP, *) ODAT(29,I), ODAT(30,I) + !OTYPE 7 + ! for coupling but not implemented yet + !OTYPE 8 + READ(NML_OUTPUT_DATE(I)%RESTART2%START, *) ODAT(36,I), ODAT(37,I) + READ(NML_OUTPUT_DATE(I)%RESTART2%STRIDE, *) ODAT(38,I) + READ(NML_OUTPUT_DATE(I)%RESTART2%STOP, *) ODAT(39,I), ODAT(40,I) ! set the time stride at 0 or more ODAT(3,I) = MAX ( 0 , ODAT(3,I) ) @@ -4852,6 +4908,10 @@ SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & ! ! ... End of output type selecttion ELSE IF ! + ELSE IF ( J .EQ. 8 ) THEN + ! + ! 5.i Type 8: checkpoint files (no additional data) + ! END IF ! ! ... End of IF in 5.b @@ -4861,45 +4921,6 @@ SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & ! ... End of loop J on NOTYPE in 5.a ! END DO - !xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - ! Checkpoint - J=8 - !OUTPTS(I)%FLOUT(8)=.FALSE. - IF ( ODAT(5*(J-1)+3,I) .NE. 0 ) THEN - !OUTPTS(I)%FLOUT(8)=.TRUE. - IF ( MDSS.NE.MDSO .AND. NMPSCR.EQ.IMPROC ) & - WRITE (MDSS,951) J, IDOTYP(J) - TTIME(1) = ODAT(5*(J-1)+1,I) - TTIME(2) = ODAT(5*(J-1)+2,I) - CALL STME21 ( TTIME , DTME21 ) - IF ( MDSS.NE.MDSO .AND. NMPSCR.EQ.IMPROC ) & - WRITE (MDSS,952) DTME21 - TTIME(1) = ODAT(5*(J-1)+4,I) - TTIME(2) = ODAT(5*(J-1)+5,I) - CALL STME21 ( TTIME , DTME21 ) - IF ( MDSS.NE.MDSO .AND. NMPSCR.EQ.IMPROC ) & - WRITE (MDSS,953) DTME21 - TTIME(1) = 0 - TTIME(2) = 0 - DTTST = REAL ( ODAT(5*(J-1)+3,I) ) - CALL TICK21 ( TTIME , DTTST ) - CALL STME21 ( TTIME , DTME21 ) - IF ( ( ODAT(5*(J-1)+1,I) .NE. ODAT(5*(J-1)+4,I) .OR. & - ODAT(5*(J-1)+2,I) .NE. ODAT(5*(J-1)+5,I) ) .AND. & - MDSS.NE.MDSO .AND. NMPSCR.EQ.IMPROC ) THEN - DO II=1, 18 - IF ( DTME21(II:II).NE.'0' .AND. & - DTME21(II:II).NE.'/' .AND. & - DTME21(II:II).NE.' ' .AND. & - DTME21(II:II).NE.':' ) EXIT - DTME21(II:II) = ' ' - END DO - WRITE (MDSS,954) DTME21(1:19) - END IF - !ELSE - !OUTPTS(I)%FLOUT(8) = .FALSE. - END IF - !xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ! ! ... End of loop I on NRGRD in 5.a ! @@ -5002,6 +5023,12 @@ SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & CALL WMUSET ( MDSS, MDST, MDSUP, .TRUE., 'OUT', & TRIM(FNMPRE)//'out_pnt.'//MNAMES(0)(1:II), & 'Unified point output') +#ifdef W3_ASCII + CALL WMUGET ( MDSS, MDST, MDSUPA, 'OUA' ) + CALL WMUSET ( MDSS, MDST, MDSUPA, .TRUE., 'OUA', & + TRIM(FNMPRE)//'out_pnt.'//MNAMES(0)(1:II)//'.txt', & + 'Unified point output ascii') +#endif END IF END IF ! @@ -5015,16 +5042,17 @@ SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & ! IF ( IOSTYP .GT. 1 ) THEN DO I=1, NRGRD + ! FIELD IF ( ODAT( 3,I) .GT. 0 ) NDPOUT(I) = NDPOUT(I) + 1 + ! TRACK IF ( ODAT(13,I) .GT. 0 ) NDPOUT(I) = NDPOUT(I) + 1 + ! PARTITION IF ( ODAT(28,I) .GT. 0 ) NDPOUT(I) = NDPOUT(I) + 1 - !xxx - ! Checkpoint - IF ( ODAT(38,I) .GT. 0 ) NDPOUT(I) = NDPOUT(I) + 1 - !xxx + ! POINT .OR. RESTART .OR. BOUNDARY IF ( ODAT( 8,I) .GT. 0 .OR. ODAT(18,I) .GT. 0 .OR. & - ODAT(23,I) .GT. 0 ) & - NDPOUT(I) = NDPOUT(I) + 1 + ODAT(23,I) .GT. 0 ) NDPOUT(I) = NDPOUT(I) + 1 + ! RESTART2 + IF ( ODAT(38,I) .GT. 0 ) NDPOUT(I) = NDPOUT(I) + 1 IF ( IOSTYP .EQ. 2 ) NDPOUT(I) = MIN ( 1 , NDPOUT(I) ) END DO END IF @@ -5406,8 +5434,20 @@ SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & SELECT CASE (J) CASE (1) MDS(7,I) = NDSFND +#ifdef W3_ASCII + CALL WMUGET ( MDSE, MDST, NDSFND, 'OUT' ) + CALL WMUSET ( MDSE, MDST, NDSFND, .TRUE., & + DESC='ASCII output file' ) + MDS(14,I) = NDSFND ! ASCII +#endif CASE (2) MDS(8,I) = NDSFND +#ifdef W3_ASCII + CALL WMUGET ( MDSE, MDST, NDSFND, 'OUT' ) + CALL WMUSET ( MDSE, MDST, NDSFND, .TRUE., & + DESC='ASCII output file' ) + MDS(15,I) = NDSFND ! ASCII +#endif CASE (3) MDS(12,I) = NDSFND CALL WMUGET ( MDSE, MDST, NDSFND, 'INP' ) @@ -5437,11 +5477,12 @@ SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & ! ..... Model initialization ! IF ( MDSS.NE.MDSO .AND. NMPSC2.EQ.IMPROC ) WRITE (MDSS,982) - ! - CALL W3INIT ( I, .TRUE., MNAMES(I), MDS(:,I), NTRACE(:,I), ODAT(:,I), & + + CALL W3INIT ( I, .TRUE., MNAMES(I), MDS(:,I), NTRACE(:,I), & + ODAT(:,I), & FLGRD(:,:,I),FLGR2(:,:,I),FLGD(:,I),FLG2(:,I), & OT2(I)%NPTS, OT2(I)%X, OT2(I)%Y, OT2(I)%PNAMES, & - IPRT(:,I), LPRT(I), MPI_COMM_LOC ) + IPRT(:,I), LPRT(I), MPI_COMM_LOC) ! ! ..... Finalize I/O file hook up ! @@ -5524,6 +5565,28 @@ SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & END IF END IF ! +#ifdef W3_ASCII + IF ( MDS(14,I) .NE. -1 ) THEN ! Grid output (ASCII) + IF ( IAPROC .EQ. NAPFLD ) THEN + TNAME = TRIM(FNMPRE)//'out_grd.' // FILEXT(:II) // '.txt' + CALL WMUSET ( MDSE,MDST, MDS(14,I), .TRUE., NAME=TNAME ) + ELSE + CALL WMUSET ( MDSE,MDST, MDS(14,I), .FALSE. ) + MDS(14,I) = -1 + END IF + END IF + ! + IF ( MDS(15,I) .NE. -1 ) THEN ! Point output (ASCII) + IF ( IAPROC .EQ. NAPPNT ) THEN + TNAME = TRIM(FNMPRE)//'out_pnt.' // FILEXT(:II) // '.txt' + CALL WMUSET ( MDSE,MDST, MDS(15,I), .TRUE., NAME=TNAME ) + ELSE + CALL WMUSET ( MDSE,MDST, MDS(15,I), .FALSE. ) + MDS(15,I) = -1 + END IF + END IF +#endif +! #ifdef W3_T WRITE (MDST,9081) I, TIME #endif @@ -5533,6 +5596,9 @@ SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & IF ( MDSS.NE.MDSO .AND. NMPSC2.EQ.IMPROC ) WRITE (MDSS,983) CALL W3SETI ( I, MDSE, MDST ) ! + !!Li Stop modifying GTYPE from input forcing file. JGLi08Apr2021. + JJJ = GTYPE + ! ! ..... regular input files ! DO J=JFIRST, 6 @@ -5540,9 +5606,16 @@ SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & IDINP(I,J) = IDSTR(J) IF ( INPMAP(I,J) .LT. 0 ) CYCLE CALL W3FLDO ('READ', IDINP(I,J), MDSF(I,J), MDST, MDSE2,& - NX, NY, GTYPE, IERR, MNAMES(I), & + !!Li NX, NY, GTYPE, IERR, MNAMES(I), & + NX, NY, JJJ, IERR, MNAMES(I), & TRIM(FNMPRE) ) IF ( IERR .NE. 0 ) GOTO 2080 + ! + !!Li Print a warning message when GTYPE not matching forcing field one. + IF ( (JJJ .NE. GTYPE) .AND. (IMPROC .EQ. NMPSC2) ) & + WRITE (MDSE, *) ' *** Warning: grid', I, ' GTYPE=', & + GTYPE, ' not matching field', J, ' grid type', JJJ + ! IF ( MDSS.NE.MDSO .AND. NMPSC2.EQ.IMPROC ) & WRITE (MDSS,985) IDFLDS(J) ELSE @@ -5606,8 +5679,8 @@ SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & IF ( J.EQ.6 ) ALLOCATE ( WADATS(I)%RA0(NSEA) , & WADATS(I)%RAI(NSEA) ) ! - END IF - END DO + END IF ! IF ( INPMAP(I,J) .NE. 0 ) THEN + END DO ! DO J=JFIRST, 9 ! INFLAGS1 = TFLAGS CALL W3SETI ( I, MDSE, MDST ) @@ -5626,34 +5699,20 @@ SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & END IF END DO ! - ! Checkpoint - J=8 - OUTPTS(I)%FLOUT(8)=.FALSE. - IF ( ODAT(5*(J-1)+3,I) .NE. 0 ) THEN - OUTPTS(I)%FLOUT(8)=.TRUE. - ELSE - OUTPTS(I)%FLOUT(8)=.FALSE. - ENDIF - - IF ( FLOUT(J) ) THEN - IF ( TOUTP(1,I) .EQ. -1 ) THEN - TOUTP(:,I) = TONEXT(:,J) - ELSE - DTTST = DSEC21 ( TOUTP(:,I), TONEXT(:,J) ) - IF ( DTTST .LT. 0. ) TOUTP(:,I) = TONEXT(:,J) - ENDIF - END IF - ! - ! GRSTAT(I) = 0 TSYNC(:,I) = TIME(:) ! +#ifdef W3_SMC + ! Check GTYPE values after initialization + IF ( IMPROC .EQ. NMPERR ) WRITE(MDSE,*) "GRID IMPROC GTYPE", & + I, IMPROC, GRIDS(I)%GTYPE +#endif + ! #ifdef W3_T WRITE (MDST,9082) GRSTAT(I), TOUTP(:,I), TSYNC(:,I) #endif ! - END DO ! DO I=1, NRGRD - + END DO !! 8.a I-NRGRD loop ! #ifdef W3_MPI CALL MPI_BARRIER (MPI_COMM_MWAVE,IERR_MPI) @@ -5725,7 +5784,7 @@ SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & MPI_COMM_BCT, IERR_MPI ) IF ( MPI_COMM_GRD .EQ. MPI_COMM_NULL ) & GSU = W3GSUC( .FALSE., FLAGLL, ICLOSE, & - XGRD, YGRD) + XGRD, YGRD ) CALL MPI_BCAST ( DXDP, NX*NY, MPI_REAL, 0, & MPI_COMM_BCT, IERR_MPI ) CALL MPI_BCAST ( DXDQ, NX*NY, MPI_REAL, 0, & @@ -5854,7 +5913,8 @@ SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & ! DO I=1, NRGRD DO J=JFIRST, 9 - IF ( INPMAP(I,J) .LT. 0 ) IDINP(I,J) = IDINP( INPMAP(I,J),J) + IF ( INPMAP(I,J).LT.0 .AND. INPMAP(I,J).NE.-999) IDINP(I,J) = IDINP( INPMAP(I,J),J) + !IF ( INPMAP(I,J) .LT. 0 ) IDINP(I,J) = IDINP( INPMAP(I,J),J) IF ( INPMAP(I,J) .GT. 0 ) IDINP(I,J) = IDINP(-INPMAP(I,J),J) END DO END DO @@ -5983,7 +6043,7 @@ SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & ! 8.c.3 Relation to same ranked grids ! #ifdef W3_SMC - !! Check whether there is a SMC grid group. JGLi12Apr2021 + !! Check whether there is a SMC grid group. JGLi12Apr2021 NGRPSMC = 0 DO JJ=1, NRGRP J = 0 @@ -6173,7 +6233,8 @@ SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & IF ( TSTOUT ) CALL WMUDMP ( MDST, 0 ) ! DEALLOCATE ( MDS, NTRACE, ODAT, FLGRD, FLGR2, FLGD, FLG2, INAMES,& - MNAMES ) + MNAMES & + ,OUTFF ) ! #ifdef W3_MPI CALL MPI_BARRIER ( MPI_COMM_MWAVE, IERR_MPI ) @@ -6500,7 +6561,7 @@ SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & ! #ifdef W3_T 9020 FORMAT ( ' TEST WMINITNML : UNIT NUMBERS FOR GRIDS (',A,')'/ & - 15X,'GRID MDS(1-13)',43X,'NTRACE') + 15X,'GRID MDS(1-15)',43X,'NTRACE') 9021 FORMAT (14X,16I4) 9022 FORMAT ( ' TEST WMINITNML : UNIT NUMBERS FOR INTPUT FILES'/ & 15X,'GRID MDSF(JFIRST-9)') diff --git a/model/src/wmiopomd.F90 b/model/src/wmiopomd.F90 index 071f7e051..73e036535 100644 --- a/model/src/wmiopomd.F90 +++ b/model/src/wmiopomd.F90 @@ -723,6 +723,9 @@ SUBROUTINE WMIOPO ( TOUT ) ICEO,ICEHO,ICEFO USE WMMDATMD, ONLY: MDST, MDSE, IMPROC, NMPROC, NMPUPT, NRGRD, & RESPEC, UPTMAP, MDSUP +#ifdef W3_ASCII + USE WMMDATMD, ONLY: MDSUPA +#endif #ifdef W3_MPI USE WMMDATMD, ONLY: MPI_COMM_MWAVE, MPI_COMM_GRD, ALLPRC, & MTAG0 @@ -1173,7 +1176,11 @@ SUBROUTINE WMIOPO ( TOUT ) ! TIME = TOUT ! - CALL W3IOPO ( 'WRITE', MDSUP, II, 0 ) + CALL W3IOPO ( 'WRITE', MDSUP, II, 0 & +#ifdef W3_ASCII + ,MDSUPA & +#endif + ) ! RETURN ! diff --git a/model/src/wmmdatmd.F90 b/model/src/wmmdatmd.F90 index e93c2cfb9..94aa7a7a9 100644 --- a/model/src/wmmdatmd.F90 +++ b/model/src/wmmdatmd.F90 @@ -74,6 +74,8 @@ MODULE WMMDATMD ! only. ! MDSP Int. Public Unit number for profiling. ! MDSUP Int. Public Unit number for unified point output. + ! MDSUPA Int. Public Unit number for unified point output. + ! ASCII ! MDSF I.A. Public Unit numbers for input files. ! ! NMPROC Int. Public Number of processors (for total multi- @@ -313,6 +315,9 @@ MODULE WMMDATMD INTEGER :: MDST = 6 !< MDST INTEGER :: MDSE = 6 !< MDSE INTEGER :: MDSUP !< MDSUP +#ifdef W3_ASCII + INTEGER :: MDSUPA !< MDSUPA +#endif INTEGER :: NMPROC = 1 !< NMPROC INTEGER :: IMPROC = 1 !< IMPROC INTEGER :: NMPLOG = 1 !< NMPLOG diff --git a/model/src/ww3_gint.F90 b/model/src/ww3_gint.F90 index ee1150485..bfd2dd467 100644 --- a/model/src/ww3_gint.F90 +++ b/model/src/ww3_gint.F90 @@ -1302,19 +1302,11 @@ SUBROUTINE W3EXGI ( NGRD, NSEA, NOSWLL_MIN, INTMETHOD, OUTorRESTflag, & ! IX = MAPSF(ISEA,1) IY = MAPSF(ISEA,2) - MAPICE = MOD(MAPST2(IY,IX),2) - MAPDRY = MOD(MAPST2(IY,IX)/2,2) - MAPLND = MOD(MAPST2(IY,IX)/4,2) - MAPMSK = MOD(MAPST2(IY,IX)/8,2) MAPINT = MOD(MAPST2(IY,IX)/16,2) - MAPST2(IY,IX) = MAPST2(IY,IX) - MAPICE - 2*MAPDRY - 4*MAPLND & - - 8*MAPMSK - ACTIVE = (MAPICE .NE. 1 .AND. MAPDRY .NE. 1) ! IF ( MAPINT .EQ. 0 ) THEN ! ! Initial loop to determine status map - ! Initialize by setting it to be ice free and wet ! MAPICE = 0 MAPDRY = 0 @@ -1361,8 +1353,8 @@ SUBROUTINE W3EXGI ( NGRD, NSEA, NOSWLL_MIN, INTMETHOD, OUTorRESTflag, & IF ( NMAPDRY .GT. 50 ) MAPDRYT = 1 IF ( NMAPLND .GT. 50 ) MAPLNDT = 1 IF ( NMAPMSK .GT. 50 ) MAPMSKT = 1 - ACTIVE = (MAPICET .NE. 1 .AND. MAPDRYT .NE. 1 .AND. & - MAPLNDT .NE. 1 .AND. MAPMSKT .NE. 1) + ! Allow use of grid with ice or dry point. Allow merge of group 1 output + ACTIVE = (MAPLNDT .NE. 1 .AND. MAPMSKT .NE. 1) IF ( ACTIVE ) THEN USEGRID(IG) = .TRUE. SUMGRD = SUMGRD+1 @@ -1572,7 +1564,7 @@ SUBROUTINE W3EXGI ( NGRD, NSEA, NOSWLL_MIN, INTMETHOD, OUTorRESTflag, & ! ! Group 1 variables ! - IF ( FLOGRD(1,1) .AND. ACTIVE ) THEN + IF ( FLOGRD(1,1) ) THEN IF ( WADATS(IGRID)%DW(GSEA) .NE. UNDEF ) THEN SUMWT1(1) = SUMWT1(1) + WT IF ( DWAUX .EQ. UNDEF ) THEN @@ -1583,7 +1575,7 @@ SUBROUTINE W3EXGI ( NGRD, NSEA, NOSWLL_MIN, INTMETHOD, OUTorRESTflag, & END IF END IF ! - IF ( FLOGRD(1,2) .AND. ACTIVE ) THEN + IF ( FLOGRD(1,2) ) THEN IF ( WADATS(IGRID)%CX(GSEA) .NE. UNDEF ) THEN SUMWT1(2) = SUMWT1(2) + WT IF ( CXAUX .EQ. UNDEF ) THEN @@ -1609,7 +1601,7 @@ SUBROUTINE W3EXGI ( NGRD, NSEA, NOSWLL_MIN, INTMETHOD, OUTorRESTflag, & END IF END IF ! - IF ( FLOGRD(1,4) .AND. ACTIVE ) THEN + IF ( FLOGRD(1,4) ) THEN IF ( WADATS(IGRID)%AS(GSEA) .NE. UNDEF ) THEN SUMWT1(4) = SUMWT1(4) + WT IF ( ASAUX .EQ. UNDEF ) THEN @@ -1620,7 +1612,7 @@ SUBROUTINE W3EXGI ( NGRD, NSEA, NOSWLL_MIN, INTMETHOD, OUTorRESTflag, & END IF END IF ! - IF ( FLOGRD(1,5) .AND. ACTIVE ) THEN + IF ( FLOGRD(1,5) ) THEN IF ( WDATAS(IGRID)%WLV(GSEA) .NE. UNDEF ) THEN SUMWT1(5) = SUMWT1(5) + WT IF ( WLVAUX .EQ. UNDEF ) THEN @@ -1642,7 +1634,7 @@ SUBROUTINE W3EXGI ( NGRD, NSEA, NOSWLL_MIN, INTMETHOD, OUTorRESTflag, & END IF END IF ! - IF ( FLOGRD(1,7) .AND. ACTIVE ) THEN + IF ( FLOGRD(1,7) ) THEN IF ( WDATAS(IGRID)%BERG(GSEA) .NE. UNDEF ) THEN SUMWT1(7) = SUMWT1(7) + WT IF ( BERGAUX .EQ. UNDEF ) THEN @@ -1666,7 +1658,7 @@ SUBROUTINE W3EXGI ( NGRD, NSEA, NOSWLL_MIN, INTMETHOD, OUTorRESTflag, & END IF END IF ! - IF ( FLOGRD(1,9) .AND. ACTIVE ) THEN + IF ( FLOGRD(1,9) ) THEN IF ( WDATAS(IGRID)%RHOAIR(GSEA) .NE. UNDEF ) THEN SUMWT1(9) = SUMWT1(9) + WT IF ( RHOAIRAUX .EQ. UNDEF ) THEN diff --git a/model/src/ww3_multi.F90 b/model/src/ww3_multi.F90 index 39a6b5bf3..e3101b7c2 100644 --- a/model/src/ww3_multi.F90 +++ b/model/src/ww3_multi.F90 @@ -91,6 +91,9 @@ PROGRAM W3MLTI !/ USE WMMDATMD, ONLY: MDSI, MDSO, MDSS, MDST, MDSE, & NMPROC, IMPROC, NMPSCR, NRGRD, ETIME +#ifdef W3_OMPG + USE OMP_LIB +#endif !/ IMPLICIT NONE ! @@ -144,6 +147,12 @@ PROGRAM W3MLTI #ifdef W3_OMPH IF ( IMPROC .EQ. NMPSCR ) WRITE (*,905) & MPI_THREAD_FUNNELED, THRLEV +#endif + ! +#ifdef W3_OMPG + IF( IMPROC .EQ. NMPSCR ) THEN + WRITE(*,906) omp_get_max_threads() + ENDIF #endif ! !/ ------------------------------------------------------------------- / @@ -210,6 +219,10 @@ PROGRAM W3MLTI 905 FORMAT ( ' Hybrid MPI/OMP thread support level:'/ & ' Requested: ', I2/ & ' Provided: ', I2/ ) +#endif + ! +#ifdef W3_OMPG +906 FORMAT ( ' OMP threading enabled. Number of threads: ', I3 / ) #endif ! 999 FORMAT(//' End of program '/ & diff --git a/model/src/ww3_ounf.F90 b/model/src/ww3_ounf.F90 index 8bbb13ee2..3df4c5d27 100644 --- a/model/src/ww3_ounf.F90 +++ b/model/src/ww3_ounf.F90 @@ -65,6 +65,7 @@ PROGRAM W3OUNF !/ 02-Feb-2021 : Make default global meta optional ( version 7.12 ) !/ 22-Mar-2021 : New coupling fields output ( version 7.12 ) !/ 02-Sep-2021 : Added coordinates attribute ( version 7.12 ) + !/ 14-Feb-2023 : Added QKK output ( version 7.12 ) !/ !/ Copyright 2009-2013 National Weather Service (NWS), !/ National Oceanic and Atmospheric Administration. All rights @@ -193,8 +194,8 @@ PROGRAM W3OUNF CFLTHMAX, CFLXYMAX, CFLKMAX, TAUICE, PHICE, & STMAXE, STMAXD, HMAXE, HCMAXE, HMAXD, HCMAXD,& P2SMS, EF, US3D, TH1M, STH1M, TH2M, STH2M, & - WN, USSP, WBT, WNMEAN, PHS2, PTP2, PDIR2, & - PSI2, PNR2, PTHP02, PT12 + WN, USSP, WBT, WNMEAN, QKK, & + PHS2, PTP2, PDIR2, PSI2, PNR2, PTHP02, PT12 USE W3ODATMD, ONLY: NDSO, NDSE, SCREEN, NOGRP, NGRPP, IDOUT, & UNDEF, FLOGRD, FNMPRE, NOSWLL, NOGE ! @@ -1648,7 +1649,10 @@ SUBROUTINE W3EXNC ( NX, NY, IX1, IXN, IY1, IYN, NSEA, & ! ! Wave energy flux ELSE IF ( IFI .EQ. 5 .AND. IFJ .EQ. 3 ) THEN - CGE=CGE*0.001 ! from W / m to kW / m + DO ISEA=1, NSEA + IF ( CGE(ISEA) .NE. UNDEF ) & + CGE(ISEA) = 0.001 * CGE(ISEA) ! from W / m to kW / m + END DO CALL S2GRID(CGE(1:NSEA), X1) ! ! Wind to wave energy flux @@ -1863,9 +1867,6 @@ SUBROUTINE W3EXNC ( NX, NY, IX1, IXN, IY1, IYN, NSEA, & ! Wave to sea ice energy flux ELSE IF ( IFI .EQ. 6 .AND. IFJ .EQ. 11 ) THEN IF (NCVARTYPEI.EQ.3) NCVARTYPE=4 - DO ISEA=1, NSEA - PHIOC(ISEA)=MIN(3000.,PHIOC(ISEA)) - END DO CALL S2GRID(PHICE(1:NSEA), X1) ! ! Partitioned surface stokes drift @@ -2007,6 +2008,10 @@ SUBROUTINE W3EXNC ( NX, NY, IX1, IXN, IY1, IYN, NSEA, & ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 5 ) THEN CALL S2GRID(QP, X1) ! + ! k bandwidth + ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 6 ) THEN + CALL S2GRID(QKK, X1) + ! ! Dynamic time step ELSE IF ( IFI .EQ. 9 .AND. IFJ .EQ. 1 ) THEN DO ISEA=1, NSEA @@ -2022,14 +2027,17 @@ SUBROUTINE W3EXNC ( NX, NY, IX1, IXN, IY1, IYN, NSEA, & ! ! Maximum CFL for spatial advection ELSE IF ( IFI .EQ. 9 .AND. IFJ .EQ. 3 ) THEN + IF (NCVARTYPEI.EQ.3) NCVARTYPE=4 CALL S2GRID(CFLXYMAX, X1) ! ! Maximum CFL for direction advection ELSE IF ( IFI .EQ. 9 .AND. IFJ .EQ. 4 ) THEN + IF (NCVARTYPEI.EQ.3) NCVARTYPE=4 CALL S2GRID(CFLTHMAX, X1) ! ! Maximum CFL for frequency advection ELSE IF ( IFI .EQ. 9 .AND. IFJ .EQ. 5 ) THEN + IF (NCVARTYPEI.EQ.3) NCVARTYPE=4 CALL S2GRID(CFLKMAX, X1) ! ! User defined... @@ -2605,39 +2613,31 @@ SUBROUTINE W3EXNC ( NX, NY, IX1, IXN, IY1, IYN, NSEA, & IVAR=IVAR1+I IF (COORDTYPE.EQ.1) THEN IF (NCVARTYPE.EQ.2) THEN - IF( SMCGRD ) THEN #ifdef W3_SMC - IF( SMCOTYPE .EQ. 1 ) THEN - ! SMC Flat file - IRET = NF90_DEF_VAR(NCID,META(I)%varnm, NF90_SHORT, (/DIMID(2), DIMID(4+EXTRADIM)/), VARID(IVAR)) - ELSE - ! SMC Regridded file - IRET = NF90_DEF_VAR(NCID,META(I)%varnm, NF90_SHORT, DIMID(2:4+EXTRADIM), VARID(IVAR)) - ENDIF - CALL CHECK_ERR(IRET) + IF( SMCGRD .AND. SMCOTYPE .EQ. 1 ) THEN + ! SMC Flat file + IRET = NF90_DEF_VAR(NCID,META(I)%varnm, NF90_SHORT, (/DIMID(2), DIMID(4+EXTRADIM)/), VARID(IVAR)) + ELSE #endif - ELSE ! SMCGRD - IRET=NF90_DEF_VAR(NCID,META(I)%VARNM, NF90_SHORT, DIMID(2:4+EXTRADIM), VARID(IVAR)) - CALL CHECK_ERR(IRET) - ENDIF ! SMCGRD + IRET = NF90_DEF_VAR(NCID,META(I)%varnm, NF90_SHORT, DIMID(2:4+EXTRADIM), VARID(IVAR)) +#ifdef W3_SMC + ENDIF +#endif + CALL CHECK_ERR(IRET) IF (NCTYPE.EQ.4) IRET = NF90_DEF_VAR_DEFLATE(NCID, VARID(IVAR), 1, 1, DEFLATE) IF (NCTYPE.EQ.4) CALL CHECK_ERR(IRET) ELSE - IF( SMCGRD ) THEN #ifdef W3_SMC - IF( SMCOTYPE .EQ. 1 ) THEN - ! SMC Flat file - IRET = NF90_DEF_VAR(NCID,META(I)%varnm, NF90_FLOAT, (/DIMID(2), DIMID(4+EXTRADIM)/), VARID(IVAR)) - ELSE - ! SMC Regridded file - IRET = NF90_DEF_VAR(NCID,META(I)%varnm, NF90_FLOAT, DIMID(2:4+EXTRADIM), VARID(IVAR)) - ENDIF - CALL CHECK_ERR(IRET) + IF( SMCGRD .AND. SMCOTYPE .EQ. 1 ) THEN + ! SMC Flat file + IRET = NF90_DEF_VAR(NCID,META(I)%varnm, NF90_FLOAT, (/DIMID(2), DIMID(4+EXTRADIM)/), VARID(IVAR)) + ELSE #endif - ELSE ! SMCGRD - IRET=NF90_DEF_VAR(NCID,META(I)%VARNM, NF90_FLOAT, DIMID(2:4+EXTRADIM), VARID(IVAR)) - CALL CHECK_ERR(IRET) - ENDIF ! SMCGRD + IRET = NF90_DEF_VAR(NCID,META(I)%varnm, NF90_FLOAT, DIMID(2:4+EXTRADIM), VARID(IVAR)) +#ifdef W3_SMC + ENDIF +#endif + CALL CHECK_ERR(IRET) IF (NCTYPE.EQ.4) IRET = NF90_DEF_VAR_DEFLATE(NCID, VARID(IVAR), 1, 1, DEFLATE) IF (NCTYPE.EQ.4) CALL CHECK_ERR(IRET) END IF @@ -2702,19 +2702,16 @@ SUBROUTINE W3EXNC ( NX, NY, IX1, IXN, IY1, IYN, NSEA, & ELSE ! If it is spherical coordinate IF (FLAGLL) THEN - IF(SMCGRD) THEN #ifdef W3_SMC - IF(SMCOTYPE .EQ. 1) THEN - IRET=NF90_INQ_DIMID (NCID, 'seapoint', DIMID(2)) - ELSE - IRET=NF90_INQ_DIMID (NCID, 'longitude', DIMID(2)) - IRET=NF90_INQ_DIMID (NCID, 'latitude', DIMID(3)) - ENDIF -#endif + IF(SMCGRD .AND. SMCOTYPE .EQ. 1) THEN + IRET=NF90_INQ_DIMID (NCID, 'seapoint', DIMID(2)) ELSE +#endif IRET=NF90_INQ_DIMID (NCID, 'longitude', DIMID(2)) IRET=NF90_INQ_DIMID (NCID, 'latitude', DIMID(3)) - ENDIF ! SMCGRD +#ifdef W3_SMC + ENDIF +#endif IRET=NF90_INQ_VARID (NCID, 'longitude', VARID(1)) IRET=NF90_INQ_VARID (NCID, 'latitude', VARID(2)) ! If it is cartesian coordinate @@ -2759,36 +2756,30 @@ SUBROUTINE W3EXNC ( NX, NY, IX1, IXN, IY1, IYN, NSEA, & IVAR=IVAR1+I IF (COORDTYPE.EQ.1) THEN IF (NCVARTYPE.EQ.2) THEN - IF( SMCGRD ) THEN #ifdef W3_SMC - IF( SMCOTYPE .EQ. 1 ) THEN - ! SMC Flat file - IRET = NF90_DEF_VAR(NCID,META(I)%varnm, NF90_SHORT, (/DIMID(2), DIMID(4+EXTRADIM)/), VARID(IVAR)) - ELSE - ! SMC Regridded file - IRET = NF90_DEF_VAR(NCID,META(I)%varnm, NF90_SHORT, DIMID(2:4+EXTRADIM), VARID(IVAR)) - ENDIF -#endif + IF( SMCGRD .AND. SMCOTYPE .EQ. 1 ) THEN + ! SMC Flat file + IRET = NF90_DEF_VAR(NCID,META(I)%varnm, NF90_SHORT, (/DIMID(2), DIMID(4+EXTRADIM)/), VARID(IVAR)) ELSE +#endif IRET = NF90_DEF_VAR(NCID,META(I)%varnm, NF90_SHORT, DIMID(2:4+EXTRADIM), VARID(IVAR)) - CALL CHECK_ERR(IRET) - ENDIF ! SMCGRD +#ifdef W3_SMC + ENDIF +#endif + CALL CHECK_ERR(IRET) IF (NCTYPE.EQ.4) IRET = NF90_DEF_VAR_DEFLATE(NCID, VARID(IVAR), 1, 1, DEFLATE) ELSE - IF( SMCGRD ) THEN #ifdef W3_SMC - IF( SMCOTYPE .EQ. 1 ) THEN - ! SMC Flat file - IRET = NF90_DEF_VAR(NCID,META(I)%varnm, NF90_FLOAT, (/DIMID(2), DIMID(4+EXTRADIM)/), VARID(IVAR)) - ELSE - ! SMC Regridded file - IRET = NF90_DEF_VAR(NCID,META(I)%varnm, NF90_FLOAT, DIMID(2:4+EXTRADIM), VARID(IVAR)) - ENDIF -#endif + IF( SMCGRD .AND. SMCOTYPE .EQ. 1 ) THEN + ! SMC Flat file + IRET = NF90_DEF_VAR(NCID,META(I)%varnm, NF90_FLOAT, (/DIMID(2), DIMID(4+EXTRADIM)/), VARID(IVAR)) ELSE +#endif IRET = NF90_DEF_VAR(NCID,META(I)%varnm, NF90_FLOAT, DIMID(2:4+EXTRADIM), VARID(IVAR)) - CALL CHECK_ERR(IRET) - ENDIF ! SMCGRD +#ifdef W3_SMC + ENDIF +#endif + CALL CHECK_ERR(IRET) IF (NCTYPE.EQ.4) IRET = NF90_DEF_VAR_DEFLATE(NCID, VARID(IVAR), 1, 1, DEFLATE) IF (NCTYPE.EQ.4) CALL CHECK_ERR(IRET) END IF @@ -2903,263 +2894,171 @@ SUBROUTINE W3EXNC ( NX, NY, IX1, IXN, IY1, IYN, NSEA, & ! NFIELD=3 IF (NCVARTYPE.EQ.2) THEN IF ( NFIELD.EQ.3 ) THEN - IF (SMCGRD) THEN + DO IX=IX1, IXN + DO IY=IY1, IYN + IF ( X1(IX,IY) .EQ. UNDEF ) THEN + MXX(IX,IY) = MFILL + MYY(IX,IY) = MFILL + MXY(IX,IY) = MFILL + ELSE + MXX(IX,IY) = NINT(X1(IX,IY)/META(1)%FSC) + MYY(IX,IY) = NINT(X2(IX,IY)/META(2)%FSC) + MXY(IX,IY) = NINT(XY(IX,IY)/META(3)%FSC) + END IF + END DO + END DO +#ifdef W3_SMC + IF(SMCGRD .AND. SMCOTYPE .EQ. 1) THEN + IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & + MXX(IX1:IXN,IY1:IYN),(/START(1), START(3)/),(/COUNT(1), COUNT(3)/)) + call CHECK_ERR(IRET) + IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+2), & + MYY(IX1:IXN,IY1:IYN),(/START(1), START(3)/),(/COUNT(1), COUNT(3)/)) + call CHECK_ERR(IRET) + IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+3), & + MXY(IX1:IXN,IY1:IYN),(/START(1), START(3)/),(/COUNT(1), COUNT(3)/)) + call CHECK_ERR(IRET) + ELSE +#endif + IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & + MXX(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) + call CHECK_ERR(IRET) + IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+2), & + MYY(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) + call CHECK_ERR(IRET) + IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+3), & + MXY(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) + call CHECK_ERR(IRET) #ifdef W3_SMC + ENDIF +#endif + ! NFIELD=2 + ELSE IF (NFIELD.EQ.2 ) THEN + ! EXTRADIM=0 + IF (EXTRADIM.EQ.0) THEN DO IX=IX1, IXN DO IY=IY1, IYN - ! TODO: Find some other way to access MAPSTA - IF ( X1(IX,IY) .EQ. UNDEF ) THEN + IF ( XX(IX,IY) .EQ. UNDEF ) THEN MXX(IX,IY) = MFILL MYY(IX,IY) = MFILL - MXY(IX,IY) = MFILL ELSE - MXX(IX,IY) = NINT(X1(IX,IY)/META(1)%FSC) - MYY(IX,IY) = NINT(X2(IX,IY)/META(2)%FSC) - MXY(IX,IY) = NINT(XY(IX,IY)/META(3)%FSC) + MXX(IX,IY) = NINT(XX(IX,IY)/META(1)%FSC) + MYY(IX,IY) = NINT(XY(IX,IY)/META(2)%FSC) END IF END DO END DO - IF(SMCOTYPE .EQ. 1) THEN +#ifdef W3_SMC + IF(SMCGRD .AND. SMCOTYPE .EQ. 1) THEN IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & MXX(IX1:IXN,IY1:IYN),(/START(1), START(3)/),(/COUNT(1), COUNT(3)/)) call CHECK_ERR(IRET) IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+2), & MYY(IX1:IXN,IY1:IYN),(/START(1), START(3)/),(/COUNT(1), COUNT(3)/)) call CHECK_ERR(IRET) - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+3), & - MXY(IX1:IXN,IY1:IYN),(/START(1), START(3)/),(/COUNT(1), COUNT(3)/)) - call CHECK_ERR(IRET) ELSE +#endif IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & MXX(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) call CHECK_ERR(IRET) IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+2), & MYY(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) call CHECK_ERR(IRET) - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+3), & - MXY(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) - call CHECK_ERR(IRET) +#ifdef W3_SMC ENDIF #endif - ELSE ! IF(SMCGRD) - DO IX=IX1, IXN - DO IY=IY1, IYN - IF ( MAPSTA(IY,IX) .LE. 0 .OR. X1(IX,IY) .EQ. UNDEF ) THEN - MXX(IX,IY) = MFILL - MYY(IX,IY) = MFILL - MXY(IX,IY) = MFILL - ELSE - MXX(IX,IY) = NINT(X1(IX,IY)/META(1)%FSC) - MYY(IX,IY) = NINT(X2(IX,IY)/META(2)%FSC) - MXY(IX,IY) = NINT(XY(IX,IY)/META(3)%FSC) - END IF - END DO - END DO - - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & - MXX(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) - CALL CHECK_ERR(IRET) - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+2), & - MYY(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) - CALL CHECK_ERR(IRET) - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+3), & - MXY(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) - CALL CHECK_ERR(IRET) - ENDIF ! SMCGRD - ! NFIELD=2 - ELSE IF (NFIELD.EQ.2 ) THEN - ! EXTRADIM=0 - IF (EXTRADIM.EQ.0) THEN - IF (SMCGRD) THEN -#ifdef W3_SMC + ! EXTRADIM=1 + ELSE + START(3+1-COORDTYPE)=0 + DO IK=I1F,I2F + START(3+1-COORDTYPE)=START(3+1-COORDTYPE)+1 DO IX=IX1, IXN DO IY=IY1, IYN - ! TODO: Find some other way to access MAPSTA - IF ( XX(IX,IY) .EQ. UNDEF ) THEN + IF ( XXK(IX,IY,IK) .EQ. UNDEF ) THEN MXX(IX,IY) = MFILL MYY(IX,IY) = MFILL ELSE - MXX(IX,IY) = NINT(XX(IX,IY)/META(1)%FSC) - MYY(IX,IY) = NINT(XY(IX,IY)/META(2)%FSC) + MXX(IX,IY) = NINT(XXK(IX,IY,IK)/META(1)%FSC) + MYY(IX,IY) = NINT(XYK(IX,IY,IK)/META(2)%FSC) END IF END DO END DO - IF(SMCOTYPE .EQ. 1) THEN - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & - MXX(IX1:IXN,IY1:IYN),(/START(1), START(3)/),(/COUNT(1), COUNT(3)/)) +#ifdef W3_SMC + IF(SMCGRD .AND. SMCOTYPE .EQ. 1) THEN + IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & + MXX(IX1:IXN,IY1:IYN),(/START(1), START(3), START(4)/), & + (/COUNT(1), COUNT(3), COUNT(4)/)) call CHECK_ERR(IRET) - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+2), & - MYY(IX1:IXN,IY1:IYN),(/START(1), START(3)/),(/COUNT(1), COUNT(3)/)) + IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+2), & + MXY(IX1:IXN,IY1:IYN),(/START(1), START(3), START(4)/), & + (/COUNT(1), COUNT(3), COUNT(4)/)) call CHECK_ERR(IRET) ELSE +#endif IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & - MXX(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) + MXX(IX1:IXN,IY1:IYN),(/START(1:4)/),(/COUNT(1:4)/)) call CHECK_ERR(IRET) IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+2), & - MYY(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) + MXX(IX1:IXN,IY1:IYN),(/START(1:4)/),(/COUNT(1:4)/)) call CHECK_ERR(IRET) - ENDIF -#endif - ELSE ! IF(SMCGRD) - DO IX=IX1, IXN - DO IY=IY1, IYN - IF ( MAPSTA(IY,IX) .LE. 0 .OR. XX(IX,IY) .EQ. UNDEF ) THEN - MXX(IX,IY) = MFILL - MYY(IX,IY) = MFILL - ELSE - !PRINT*,XX(IX,IY),XY(IX,IY) - !STOP - MXX(IX,IY) = NINT(XX(IX,IY)/META(1)%FSC) - MYY(IX,IY) = NINT(XY(IX,IY)/META(2)%FSC) - END IF - END DO - END DO - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & - MXX(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) - CALL CHECK_ERR(IRET) - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+2), & - MYY(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) - CALL CHECK_ERR(IRET) - ENDIF ! SMCGRD - ! EXTRADIM=1 - ELSE - START(3+1-COORDTYPE)=0 - DO IK=I1F,I2F - START(3+1-COORDTYPE)=START(3+1-COORDTYPE)+1 - - IF (SMCGRD) THEN #ifdef W3_SMC - DO IX=IX1, IXN - DO IY=IY1, IYN - ! TODO: Find some other way to access MAPSTA - IF ( XXK(IX,IY,IK) .EQ. UNDEF ) THEN - MXX(IX,IY) = MFILL - MYY(IX,IY) = MFILL - ELSE - MXX(IX,IY) = NINT(XXK(IX,IY,IK)/META(1)%FSC) - MYY(IX,IY) = NINT(XYK(IX,IY,IK)/META(2)%FSC) - END IF - END DO - END DO - IF(SMCOTYPE .EQ. 1) THEN - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & - MXX(IX1:IXN,IY1:IYN),(/START(1), START(3), START(4)/), & - (/COUNT(1), COUNT(3), COUNT(4)/)) - call CHECK_ERR(IRET) - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+2), & - MXY(IX1:IXN,IY1:IYN),(/START(1), START(3), START(4)/), & - (/COUNT(1), COUNT(3), COUNT(4)/)) - call CHECK_ERR(IRET) - ELSE - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & - MXX(IX1:IXN,IY1:IYN),(/START(1:4)/),(/COUNT(1:4)/)) - call CHECK_ERR(IRET) - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & - MXX(IX1:IXN,IY1:IYN),(/START(1:4)/),(/COUNT(1:4)/)) - call CHECK_ERR(IRET) - ENDIF + ENDIF #endif - ELSE ! IF(SMCGRD) - DO IX=IX1, IXN - DO IY=IY1, IYN - IF ( MAPSTA(IY,IX) .LE. 0 .OR.XXK(IX,IY,IK) .EQ. UNDEF ) THEN - MXX(IX,IY) = MFILL - MYY(IX,IY) = MFILL - ELSE - MXX(IX,IY) = NINT(XXK(IX,IY,IK)/META(1)%FSC) - MYY(IX,IY) = NINT(XYK(IX,IY,IK)/META(2)%FSC) - END IF - END DO - END DO - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & - MXX(IX1:IXN,IY1:IYN),(/START(1:4)/),(/COUNT(1:4)/)) - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+2), & - MYY(IX1:IXN,IY1:IYN),(/START(1:4)/),(/COUNT(1:4)/)) - ENDIF ! SMCGRD END DO END IF ! EXTRADIM ! NFIELD=1 ELSE ! EXTRADIM=0 IF (EXTRADIM.EQ.0) THEN - IF (SMCGRD) THEN + DO IX=IX1, IXN + DO IY=IY1, IYN + IF ( X1(IX,IY) .EQ. UNDEF ) THEN + MX1(IX,IY) = MFILL + ELSE + MX1(IX,IY) = NINT(X1(IX,IY)/META(1)%FSC) + END IF + END DO + END DO #ifdef W3_SMC + IF(SMCGRD .AND. SMCOTYPE .EQ. 1) THEN + IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & + MX1(IX1:IXN,IY1:IYN),(/START(1), START(3)/),(/COUNT(1), COUNT(3)/)) + call CHECK_ERR(IRET) + ELSE +#endif + IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & + MX1(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) + call CHECK_ERR(IRET) +#ifdef W3_SMC + ENDIF +#endif + ! EXTRADIM=1 + ELSE + START(3+1-COORDTYPE)=0 + DO IK=I1F,I2F + START(3+1-COORDTYPE)=START(3+1-COORDTYPE)+1 DO IX=IX1, IXN DO IY=IY1, IYN - ! TODO: Find some other way to access MAPSTA - IF ( X1(IX,IY) .EQ. UNDEF ) THEN + IF ( XK(IX,IY,IK) .EQ. UNDEF ) THEN MX1(IX,IY) = MFILL ELSE - MX1(IX,IY) = NINT(X1(IX,IY)/META(1)%FSC) + MX1(IX,IY) = NINT(XK(IX,IY,IK)/META(1)%FSC) END IF END DO END DO - IF(SMCOTYPE .EQ. 1) THEN - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & - MX1(IX1:IXN,IY1:IYN),(/START(1), START(3)/),(/COUNT(1), COUNT(3)/)) +#ifdef W3_SMC + IF(SMCGRD .AND. SMCOTYPE .EQ. 1) THEN + IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & + MX1(IX1:IXN,IY1:IYN),(/START(1), START(3), START(4)/), & + (/COUNT(1), COUNT(3), COUNT(4)/)) call CHECK_ERR(IRET) ELSE +#endif IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & - MX1(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) + MX1(IX1:IXN,IY1:IYN),(/START(1:4)/),(/COUNT(1:4)/)) call CHECK_ERR(IRET) - ENDIF -#endif - ELSE ! IF(SMCGRD) - DO IX=IX1, IXN - DO IY=IY1, IYN - IF ( MAPSTA(IY,IX) .LE. 0 .OR.X1(IX,IY) .EQ. UNDEF ) THEN - MX1(IX,IY) = MFILL - ELSE - MX1(IX,IY) = NINT(X1(IX,IY)/META(1)%FSC) - END IF - END DO - END DO - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & - MX1(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) - CALL CHECK_ERR(IRET) - ENDIF ! SMCGRD - ! EXTRADIM=1 - ELSE - START(3+1-COORDTYPE)=0 - DO IK=I1F,I2F - START(3+1-COORDTYPE)=START(3+1-COORDTYPE)+1 - - IF (SMCGRD) THEN #ifdef W3_SMC - DO IX=IX1, IXN - DO IY=IY1, IYN - ! TODO: Find some other way to access MAPSTA - IF ( XK(IX,IY,IK) .EQ. UNDEF ) THEN - MX1(IX,IY) = MFILL - ELSE - MX1(IX,IY) = NINT(XK(IX,IY,IK)/META(1)%FSC) - END IF - END DO - END DO - IF(SMCOTYPE .EQ. 1) THEN - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & - MX1(IX1:IXN,IY1:IYN),(/START(1), START(3)/),(/COUNT(1), COUNT(3)/)) - call CHECK_ERR(IRET) - ELSE - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & - MX1(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) - call CHECK_ERR(IRET) - ENDIF + ENDIF #endif - ELSE ! IF(SMCGRD) - DO IX=IX1, IXN - DO IY=IY1, IYN - IF ( MAPSTA(IY,IX) .LE. 0 .OR.XK(IX,IY,IK) .EQ. UNDEF ) THEN - MX1(IX,IY) = MFILL - ELSE - MX1(IX,IY) = NINT(XK(IX,IY,IK)/META(1)%FSC) - END IF - END DO - END DO - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & - MX1(IX1:IXN,IY1:IYN),(/START(1:4)/),(/COUNT(1:4)/)) - CALL CHECK_ERR(IRET) - ENDIF ! SMCGRD END DO END IF ! EXTRADIM END IF ! NFIELD @@ -3168,258 +3067,171 @@ SUBROUTINE W3EXNC ( NX, NY, IX1, IXN, IY1, IYN, NSEA, & ! ELSE IF ( NFIELD.EQ.3 ) THEN - IF (SMCGRD) THEN + DO IX=IX1, IXN + DO IY=IY1, IYN + IF ( X1(IX,IY) .EQ. UNDEF ) THEN + MXXR(IX,IY) = MFILLR + MYYR(IX,IY) = MFILLR + MXYR(IX,IY) = MFILLR + ELSE + MXXR(IX,IY) = X1(IX,IY) + MYYR(IX,IY) = X2(IX,IY) + MXYR(IX,IY) = XY(IX,IY) + END IF + END DO + END DO #ifdef W3_SMC + IF(SMCGRD .AND. SMCOTYPE .EQ. 1) THEN + IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & + MXXR(IX1:IXN,IY1:IYN),(/START(1), START(3)/),(/COUNT(1), COUNT(3)/)) + call CHECK_ERR(IRET) + IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+2), & + MYYR(IX1:IXN,IY1:IYN),(/START(1), START(3)/),(/COUNT(1), COUNT(3)/)) + call CHECK_ERR(IRET) + IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+3), & + MXYR(IX1:IXN,IY1:IYN),(/START(1), START(3)/),(/COUNT(1), COUNT(3)/)) + call CHECK_ERR(IRET) + ELSE +#endif + IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & + MXXR(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) + call CHECK_ERR(IRET) + IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+2), & + MYYR(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) + call CHECK_ERR(IRET) + IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+3), & + MXYR(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) + call CHECK_ERR(IRET) +#ifdef W3_SMC + ENDIF +#endif + ! NFIELD=2 + ELSE IF (NFIELD.EQ.2 ) THEN + ! EXTRADIM=0 + IF (EXTRADIM.EQ.0) THEN DO IX=IX1, IXN DO IY=IY1, IYN - ! TODO: Find some other way to access MAPSTA - IF ( X1(IX,IY) .EQ. UNDEF ) THEN + IF ( XX(IX,IY) .EQ. UNDEF ) THEN MXXR(IX,IY) = MFILLR MYYR(IX,IY) = MFILLR - MXYR(IX,IY) = MFILLR ELSE - MXXR(IX,IY) = X1(IX,IY) - MYYR(IX,IY) = X2(IX,IY) - MXYR(IX,IY) = XY(IX,IY) + MXXR(IX,IY) = XX(IX,IY) + MYYR(IX,IY) = XY(IX,IY) END IF END DO END DO - IF(SMCOTYPE .EQ. 1) THEN +#ifdef W3_SMC + IF(SMCGRD .AND. SMCOTYPE .EQ. 1) THEN IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & MXXR(IX1:IXN,IY1:IYN),(/START(1), START(3)/),(/COUNT(1), COUNT(3)/)) call CHECK_ERR(IRET) IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+2), & MYYR(IX1:IXN,IY1:IYN),(/START(1), START(3)/),(/COUNT(1), COUNT(3)/)) call CHECK_ERR(IRET) - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+3), & - MXYR(IX1:IXN,IY1:IYN),(/START(1), START(3)/),(/COUNT(1), COUNT(3)/)) - call CHECK_ERR(IRET) ELSE +#endif IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & MXXR(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) call CHECK_ERR(IRET) IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+2), & MYYR(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) call CHECK_ERR(IRET) - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+3), & - MXYR(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) - call CHECK_ERR(IRET) +#ifdef W3_SMC ENDIF #endif - ELSE ! IF(SMCGRD) - DO IX=IX1, IXN - DO IY=IY1, IYN - IF ( MAPSTA(IY,IX) .LE. 0 .OR. X1(IX,IY) .EQ. UNDEF ) THEN - MXXR(IX,IY) = MFILLR - MYYR(IX,IY) = MFILLR - MXYR(IX,IY) = MFILLR - ELSE - MXXR(IX,IY) = X1(IX,IY) - MYYR(IX,IY) = X2(IX,IY) - MXYR(IX,IY) = XY(IX,IY) - END IF - END DO - END DO - - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & - MXXR(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) - CALL CHECK_ERR(IRET) - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+2), & - MYYR(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) - CALL CHECK_ERR(IRET) - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+3), & - MXYR(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) - CALL CHECK_ERR(IRET) - ENDIF ! SMCGRD - ! NFIELD=2 - ELSE IF (NFIELD.EQ.2 ) THEN - ! EXTRADIM=0 - IF (EXTRADIM.EQ.0) THEN - IF (SMCGRD) THEN -#ifdef W3_SMC + ! EXTRADIM=1 + ELSE + START(4-COORDTYPE)=0 + DO IK=I1F,I2F + START(4-COORDTYPE)=START(4-COORDTYPE)+1 DO IX=IX1, IXN DO IY=IY1, IYN - ! TODO: Find some other way to access MAPSTA - IF ( XX(IX,IY) .EQ. UNDEF ) THEN + IF ( XXK(IX,IY,IK) .EQ. UNDEF ) THEN MXXR(IX,IY) = MFILLR MYYR(IX,IY) = MFILLR ELSE - MXXR(IX,IY) = XX(IX,IY) - MYYR(IX,IY) = XY(IX,IY) + MXXR(IX,IY) = XXK(IX,IY,IK) + MYYR(IX,IY) = XYK(IX,IY,IK) END IF END DO END DO - IF(SMCOTYPE .EQ. 1) THEN - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & - MXXR(IX1:IXN,IY1:IYN),(/START(1), START(3)/),(/COUNT(1), COUNT(3)/)) +#ifdef W3_SMC + IF(SMCGRD .AND. SMCOTYPE .EQ. 1) THEN + IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & + MXXR(IX1:IXN,IY1:IYN),(/START(1), START(3), START(4)/), & + (/COUNT(1), COUNT(3), COUNT(4)/)) call CHECK_ERR(IRET) - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+2), & - MYYR(IX1:IXN,IY1:IYN),(/START(1), START(3)/),(/COUNT(1), COUNT(3)/)) + IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+2), & + MYYR(IX1:IXN,IY1:IYN),(/START(1), START(3), START(4)/), & + (/COUNT(1), COUNT(3), COUNT(4)/)) call CHECK_ERR(IRET) ELSE +#endif IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & - MXXR(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) + MXXR(IX1:IXN,IY1:IYN),(/START(1:4)/),(/COUNT(1:4)/)) call CHECK_ERR(IRET) IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+2), & - MYYR(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) + MYYR(IX1:IXN,IY1:IYN),(/START(1:4)/),(/COUNT(1:4)/)) call CHECK_ERR(IRET) - ENDIF -#endif - ELSE ! IF SMCGRD - DO IX=IX1, IXN - DO IY=IY1, IYN - IF ( MAPSTA(IY,IX) .LE. 0 .OR. XX(IX,IY) .EQ. UNDEF ) THEN - MXXR(IX,IY) = MFILLR - MYYR(IX,IY) = MFILLR - ELSE - MXXR(IX,IY) = XX(IX,IY) - MYYR(IX,IY) = XY(IX,IY) - END IF - END DO - END DO - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & - MXXR(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) - CALL CHECK_ERR(IRET) - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+2), & - MYYR(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) - CALL CHECK_ERR(IRET) - ENDIF ! SMCGRD - ! EXTRADIM=1 - ELSE - START(4-COORDTYPE)=0 - DO IK=I1F,I2F - START(4-COORDTYPE)=START(4-COORDTYPE)+1 - - IF (SMCGRD) THEN #ifdef W3_SMC - DO IX=IX1, IXN - DO IY=IY1, IYN - ! TODO: Find some other way to access MAPSTA - IF ( XXK(IX,IY,IK) .EQ. UNDEF ) THEN - MXXR(IX,IY) = MFILLR - MYYR(IX,IY) = MFILLR - ELSE - MXXR(IX,IY) = XXK(IX,IY,IK) - MYYR(IX,IY) = XYK(IX,IY,IK) - END IF - END DO - END DO - IF(SMCOTYPE .EQ. 1) THEN - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & - MXXR(IX1:IXN,IY1:IYN),(/START(1), START(3)/),(/COUNT(1), COUNT(3)/)) - call CHECK_ERR(IRET) - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+2), & - MYYR(IX1:IXN,IY1:IYN),(/START(1), START(3)/),(/COUNT(1), COUNT(3)/)) - call CHECK_ERR(IRET) - ELSE - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & - MXXR(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) - call CHECK_ERR(IRET) - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+2), & - MYYR(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) - call CHECK_ERR(IRET) - ENDIF + ENDIF #endif - ELSE ! IF SMCGRD - DO IX=IX1, IXN - DO IY=IY1, IYN - IF ( MAPSTA(IY,IX) .LE. 0 .OR.XXK(IX,IY,IK) .EQ. UNDEF ) THEN - MXXR(IX,IY) = MFILLR - MYYR(IX,IY) = MFILLR - ELSE - MXXR(IX,IY) = XXK(IX,IY,IK) - MYYR(IX,IY) = XYK(IX,IY,IK) - END IF - END DO - END DO - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & - MXXR(IX1:IXN,IY1:IYN),(/START(1:4)/),(/COUNT(1:4)/)) - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+2), & - MYYR(IX1:IXN,IY1:IYN),(/START(1:4)/),(/COUNT(1:4)/)) - ENDIF ! SMCGRD END DO END IF ! EXTRADIM ! NFIELD=1 ELSE ! EXTRADIM=0 IF (EXTRADIM.EQ.0) THEN - IF (SMCGRD) THEN + DO IX=IX1, IXN + DO IY=IY1, IYN + IF ( X1(IX,IY) .EQ. UNDEF ) THEN + MX1R(IX,IY) = MFILLR + ELSE + MX1R(IX,IY) = X1(IX,IY) + END IF + END DO + END DO #ifdef W3_SMC + IF(SMCGRD .AND. SMCOTYPE .EQ. 1) THEN + IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & + MX1R(IX1:IXN,IY1:IYN),(/START(1), START(3)/),(/COUNT(1), COUNT(3)/)) + call CHECK_ERR(IRET) + ELSE +#endif + IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & + MX1R(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) + call CHECK_ERR(IRET) +#ifdef W3_SMC + ENDIF +#endif + ! EXTRADIM=1 + ELSE + START(4-COORDTYPE)=0 + DO IK=I1F,I2F + START(4-COORDTYPE)=START(4-COORDTYPE)+1 DO IX=IX1, IXN DO IY=IY1, IYN - ! TODO: Find some other way to access MAPSTA - IF ( X1(IX,IY) .EQ. UNDEF ) THEN + IF ( XK(IX,IY,IK) .EQ. UNDEF ) THEN MX1R(IX,IY) = MFILLR ELSE - MX1R(IX,IY) = X1(IX,IY) + MX1R(IX,IY) = XK(IX,IY,IK) END IF END DO END DO - IF(SMCOTYPE .EQ. 1) THEN - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & - MX1R(IX1:IXN,IY1:IYN),(/START(1), START(3)/),(/COUNT(1), COUNT(3)/)) +#ifdef W3_SMC + IF(SMCGRD .AND. SMCOTYPE .EQ. 1) THEN + IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & + MX1R(IX1:IXN,IY1:IYN),(/START(1), START(3), START(4)/), & + (/COUNT(1), COUNT(3), COUNT(4)/)) call CHECK_ERR(IRET) ELSE +#endif IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & - MX1R(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) + MX1R(IX1:IXN,IY1:IYN),(/START(1:4)/),(/COUNT(1:4)/)) call CHECK_ERR(IRET) - ENDIF -#endif - ELSE ! IF SMCGRD - DO IX=IX1, IXN - DO IY=IY1, IYN - IF ( MAPSTA(IY,IX) .LE. 0 .OR.X1(IX,IY) .EQ. UNDEF ) THEN - MX1R(IX,IY) = MFILLR - ELSE - MX1R(IX,IY) = X1(IX,IY) - END IF - END DO - END DO - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & - MX1R(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) - CALL CHECK_ERR(IRET) - ENDIF ! SMCGRD - ! EXTRADIM=1 - ELSE - START(4-COORDTYPE)=0 - DO IK=I1F,I2F - START(4-COORDTYPE)=START(4-COORDTYPE)+1 - IF (SMCGRD) THEN #ifdef W3_SMC - DO IX=IX1, IXN - DO IY=IY1, IYN - ! TODO: Find some other way to access MAPSTA - IF ( XK(IX,IY,IK) .EQ. UNDEF ) THEN - MX1R(IX,IY) = MFILLR - ELSE - MX1R(IX,IY) = XK(IX,IY,IK) - END IF - END DO - END DO - IF(SMCOTYPE .EQ. 1) THEN - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & - MX1R(IX1:IXN,IY1:IYN),(/START(1), START(3)/),(/COUNT(1), COUNT(3)/)) - call CHECK_ERR(IRET) - ELSE - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & - MX1R(IX1:IXN,IY1:IYN),(/START(1:3)/),(/COUNT(1:3)/)) - call CHECK_ERR(IRET) - ENDIF + ENDIF #endif - ELSE ! IF SMCGRD - DO IX=IX1, IXN - DO IY=IY1, IYN - IF ( MAPSTA(IY,IX) .LE. 0 .OR.XK(IX,IY,IK) .EQ. UNDEF ) THEN - MX1R(IX,IY) = MFILLR - ELSE - MX1R(IX,IY) = XK(IX,IY,IK) - END IF - END DO - END DO - IRET=NF90_PUT_VAR(NCID,VARID(IVAR1+1), & - MX1R(IX1:IXN,IY1:IYN),(/START(1:4)/),(/COUNT(1:4)/)) - CALL CHECK_ERR(IRET) - END IF ! SMCGRD END DO END IF ! EXTRADIM END IF ! NFIELD @@ -3572,21 +3384,18 @@ SUBROUTINE W3CRNC (NCFILE, NCID, DIMID, DIMLN, VARID, & ! IF (GTYPE.NE.UNGTYPE) THEN IF (FLAGLL) THEN - IF (SMCGRD) THEN #ifdef W3_SMC - IF(SMCOTYPE .EQ. 1) THEN - ! Flat seapoints file - IRET = NF90_DEF_DIM(NCID, 'seapoint', dimln(2), DIMID(2)) - ELSE - ! Regular gridded file: - IRET = NF90_DEF_DIM(NCID, 'longitude', dimln(2), DIMID(2)) - IRET = NF90_DEF_DIM(NCID, 'latitude', dimln(3), DIMID(3)) - ENDIF -#endif + IF(SMCGRD .AND. SMCOTYPE .EQ. 1) THEN + ! Flat seapoints file + IRET = NF90_DEF_DIM(NCID, 'seapoint', dimln(2), DIMID(2)) ELSE - IRET = NF90_DEF_DIM(NCID, 'longitude', DIMLN(2), DIMID(2)) - IRET = NF90_DEF_DIM(NCID, 'latitude', DIMLN(3), DIMID(3)) - ENDIF ! SMCGRD +#endif + ! Regular gridded file: + IRET = NF90_DEF_DIM(NCID, 'longitude', dimln(2), DIMID(2)) + IRET = NF90_DEF_DIM(NCID, 'latitude', dimln(3), DIMID(3)) +#ifdef W3_SMC + ENDIF +#endif ELSE IRET = NF90_DEF_DIM(NCID, 'x', DIMLN(2), DIMID(2)) IRET = NF90_DEF_DIM(NCID, 'y', DIMLN(3), DIMID(3)) diff --git a/model/src/ww3_ounp.F90 b/model/src/ww3_ounp.F90 index b005a5222..0af62ec49 100644 --- a/model/src/ww3_ounp.F90 +++ b/model/src/ww3_ounp.F90 @@ -1552,6 +1552,7 @@ SUBROUTINE W3EXNC(I,NCID,NREQ,INDREQ,ORDER) #endif #ifdef W3_NL1 USE W3SNL1MD + USE W3GDATMD, ONLY: IQTPE #endif #ifdef W3_NL2 USE W3SNL2MD @@ -2163,7 +2164,7 @@ SUBROUTINE W3EXNC(I,NCID,NREQ,INDREQ,ORDER) RHOAIR, USTAR, USTD, Z0, CD, CHARN ) #endif ! - DO ITT=1, 3 + DO ITT=1, 4 #ifdef W3_ST2 CALL W3SIN2 (A, CG, WN2, UABS, UDIRR, CD, Z0, & FPI, XIN, DIA ) @@ -2427,7 +2428,11 @@ SUBROUTINE W3EXNC(I,NCID,NREQ,INDREQ,ORDER) END IF IF ( FLSRCE(3) ) THEN #ifdef W3_NL1 - CALL W3SNL1 ( A, CG, WNMEAN*DEPTH, XNL, DIA ) + IF (IQTPE.GT.0) THEN + CALL W3SNL1 ( A, CG, WNMEAN*DEPTH, XNL, DIA ) + ELSE + CALL W3SNLGQM ( A, CG, WN, DEPTH, XNL, DIA ) + END IF #endif #ifdef W3_NL2 CALL W3SNL2 ( A, CG, DEPTH, XNL, DIA ) @@ -3209,7 +3214,7 @@ SUBROUTINE W3CRNC (ITYPE, OTYPE, NCTYPE, NCFILE, NCID, DIMID, DIMLN, VARID, ONE, IRET=NF90_PUT_ATT(NCID,VARID(4),'long_name','x') IRET=NF90_PUT_ATT(NCID,VARID(4),'standard_name','x') IRET=NF90_PUT_ATT(NCID,VARID(4),'globwave_name','x') - IRET=NF90_PUT_ATT(NCID,VARID(4),'units','m') + IRET=NF90_PUT_ATT(NCID,VARID(4),'units','km') IRET=NF90_PUT_ATT(NCID,VARID(4),'scale_factor',1.) IRET=NF90_PUT_ATT(NCID,VARID(4),'add_offset',0.) IRET=NF90_PUT_ATT(NCID,VARID(4),'valid_min',0.) @@ -3226,7 +3231,7 @@ SUBROUTINE W3CRNC (ITYPE, OTYPE, NCTYPE, NCFILE, NCID, DIMID, DIMLN, VARID, ONE, IRET=NF90_PUT_ATT(NCID,VARID(5),'long_name','y') IRET=NF90_PUT_ATT(NCID,VARID(5),'standard_name','y') IRET=NF90_PUT_ATT(NCID,VARID(5),'globwave_name','y') - IRET=NF90_PUT_ATT(NCID,VARID(5),'units','m') + IRET=NF90_PUT_ATT(NCID,VARID(5),'units','km') IRET=NF90_PUT_ATT(NCID,VARID(5),'scale_factor',1.) IRET=NF90_PUT_ATT(NCID,VARID(5),'add_offset',0.) IRET=NF90_PUT_ATT(NCID,VARID(5),'valid_min',0.) diff --git a/model/src/ww3_outf.F90 b/model/src/ww3_outf.F90 index e4c1affed..96f2751c8 100644 --- a/model/src/ww3_outf.F90 +++ b/model/src/ww3_outf.F90 @@ -159,7 +159,7 @@ PROGRAM W3OUTF ABA, ABD, UBA, UBD, SXX, SYY, SXY, USERO, & PHS, PTP, PLP, PDIR, PSI, PWS, PWST, PNR, & PTM1, PT1, PT2, PEP, TAUOCX, TAUOCY, & - PTHP0, PQP, PSW, PPE, PGW, QP, & + PTHP0, PQP, PSW, PPE, PGW, QP, QKK, & TAUOX, TAUOY, TAUWIX,BHD, & TAUWIY, PHIAW, PHIOC, TUSX, TUSY, PRMS, TPMS,& USSX, USSY, MSSX, MSSY, MSCX, MSCY, CHARN, & @@ -2196,7 +2196,7 @@ SUBROUTINE W3EXGO ( NX, NY, NSEA ) ! ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 5 ) THEN FLONE = .TRUE. - FSC = 0.01 + FSC = 0.001 UNITS = '1' ENAME = '.qp' IF ( ITYPE .EQ. 4 ) THEN @@ -2205,6 +2205,17 @@ SUBROUTINE W3EXGO ( NX, NY, NSEA ) CALL W3S2XY ( NSEA, NSEA, NX+1, NY, QP, MAPSF, X1 ) ENDIF ! + ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 6 ) THEN + FLONE = .TRUE. + FSC = 0.05 + UNITS = '1' + ENAME = '.qkk' + IF ( ITYPE .EQ. 4 ) THEN + XS1 = QKK + ELSE + CALL W3S2XY ( NSEA, NSEA, NX+1, NY, QKK, MAPSF, X1 ) + ENDIF + ! ELSE IF ( IFI .EQ. 9 .AND. IFJ .EQ. 1 ) THEN FLONE = .TRUE. FSC = 0.1 @@ -2365,8 +2376,7 @@ SUBROUTINE W3EXGO ( NX, NY, NSEA ) ! DO IX=IX1, IXN DO IY=IY1, IYN - IF ( MAPSTA(IY,IX) .GT. 0 .AND. & - X1(IX,IY) .NE. UNDEF ) THEN + IF ( X1(IX,IY) .NE. UNDEF ) THEN NINGRD = NINGRD + 1 XMIN = MIN ( XMIN , X1(IX,IY) ) XMAX = MAX ( XMAX , X1(IX,IY) ) @@ -2455,8 +2465,7 @@ SUBROUTINE W3EXGO ( NX, NY, NSEA ) IF ( FLTRI ) THEN DO IX=IX1, IXN DO IY=IY1, IYN - IF ( MAPSTA(IY,IX) .LE. 0 .OR. & - XX(IX,IY) .EQ. UNDEF ) THEN + IF ( XX(IX,IY) .EQ. UNDEF ) THEN MXX(IX,IY) = MFILL MYY(IX,IY) = MFILL MXY(IX,IY) = MFILL @@ -2495,8 +2504,7 @@ SUBROUTINE W3EXGO ( NX, NY, NSEA ) IF ( FLTWO .OR. FLDIR ) THEN DO IX=IX1, IXN DO IY=IY1, IYN - IF ( MAPSTA(IY,IX) .LE. 0 .OR. & - XX(IX,IY) .EQ. UNDEF ) THEN + IF ( XX(IX,IY) .EQ. UNDEF ) THEN MXX(IX,IY) = MFILL MYY(IX,IY) = MFILL ELSE @@ -2535,8 +2543,7 @@ SUBROUTINE W3EXGO ( NX, NY, NSEA ) ELSE DO IX=IX1, IXN DO IY=IY1, IYN - IF ( MAPSTA(IY,IX) .LE. 0 .OR. & - X1(IX,IY) .EQ. UNDEF ) THEN + IF ( X1(IX,IY) .EQ. UNDEF ) THEN MX1(IX,IY) = MFILL ELSE MX1(IX,IY) = NINT(X1(IX,IY)/FSC) diff --git a/model/src/ww3_outp.F90 b/model/src/ww3_outp.F90 index 45f706691..0ead3283c 100644 --- a/model/src/ww3_outp.F90 +++ b/model/src/ww3_outp.F90 @@ -1988,7 +1988,11 @@ SUBROUTINE W3EXPO END IF IF ( FLSRCE(3) ) THEN #ifdef W3_NL1 - CALL W3SNL1 ( A, CG, WNMEAN*DEPTH, XNL, DIA ) + IF (IQTPE.GT.0) THEN + CALL W3SNL1 ( A, CG, WNMEAN*DEPTH, XNL, DIA ) + ELSE + CALL W3SNLGQM ( A, CG, WN, DEPTH, XNL, DIA ) + END IF #endif #ifdef W3_NL2 CALL W3SNL2 ( A, CG, DEPTH, XNL, DIA ) diff --git a/model/src/ww3_prnc.F90 b/model/src/ww3_prnc.F90 index e77bbd918..59747d32a 100644 --- a/model/src/ww3_prnc.F90 +++ b/model/src/ww3_prnc.F90 @@ -1059,7 +1059,7 @@ PROGRAM W3PRNC ! Manages the simple closure of the grid ! IF (ICLO.EQ.ICLOSE_NONE) THEN - IF (IX21(IX,1).LT.1.OR.IX21(IX,1).GT.NXI-1) WRITE(NDSO,1042) IX, IY, X, Y + IF (IX21(IX,1).LT.1.OR.IX21(IX,1).GT.NXI-1) WRITE(NDSO,1041) IX, X, Y IX21(IX,1) = MAX ( 1 , MIN(IX21(IX,1),NXI-1) ) IX22(IX,1) = IX21(IX,1) + 1 ELSE @@ -1067,7 +1067,7 @@ PROGRAM W3PRNC IX22(IX,1) = MOD(IX21(IX,1),NXI)+1 END IF IY21(IX,1) = 1 + INT((Y-Y0I)/SYI) - IF (IY21(IX,1).LT.1.OR.IY21(IX,1).GT.NYI-1) WRITE(NDSO,1042) IX, IY, X, Y + IF (IY21(IX,1).LT.1.OR.IY21(IX,1).GT.NYI-1) WRITE(NDSO,1041) IX, X, Y IY21(IX,1) = MAX ( 1 , MIN(IY21(IX,1),NYI-1) ) IY22(IX,1) = IY21(IX,1) + 1 ! @@ -2438,6 +2438,9 @@ PROGRAM W3PRNC ' 2MS2 2MN2 2NK2 MNS2 MSN2 2SM2 3MSN2 ' & ' M4 MS4 MN4 M6 2MS6 2MN6'/) ! +1041 FORMAT (/' *** WAVEWATCH-III WARNING W3PRNC : '/ & + ' GRID POINT ',I6,2F7.2,/ & + ' NOT COVERED BY INPUT GRID.'/) 1042 FORMAT (/' *** WAVEWATCH-III WARNING W3PRNC : '/ & ' GRID POINT ',2I6,2F7.2,/ & ' NOT COVERED BY INPUT GRID.'/) diff --git a/model/src/ww3_shel.F90 b/model/src/ww3_shel.F90 index d7e9790bb..4bb888b48 100644 --- a/model/src/ww3_shel.F90 +++ b/model/src/ww3_shel.F90 @@ -304,6 +304,10 @@ PROGRAM W3SHEL #endif ! USE W3NMLSHELMD + +#ifdef W3_OMPG + USE OMP_LIB +#endif IMPLICIT NONE ! #ifdef W3_MPI @@ -329,7 +333,7 @@ PROGRAM W3SHEL NDSEN, IERR, J, I, ILOOP, IPTS, NPTS, & NDTNEW, MPI_COMM = -99, & FLAGTIDE, COUPL_COMM, IH, N_TOT - INTEGER :: NDSF(-7:9), NDS(13), NTRACE(2), NDT(7:9), & + INTEGER :: NDSF(-7:9), NDS(15), NTRACE(2), NDT(7:9), & TIME0(2), TIMEN(2), TTIME(2), TTT(2), & NH(-7:10), THO(2,-7:10,NHMAX), RCLD(7:9), & NODATA(7:9), ODAT(40), IPRT(6) = 0, & @@ -481,6 +485,7 @@ PROGRAM W3SHEL #ifdef W3_OMPH ENDIF #endif + #ifdef W3_MPI MPI_COMM = MPI_COMM_WORLD #endif @@ -583,6 +588,11 @@ PROGRAM W3SHEL MPI_THREAD_FUNNELED, THRLEV #endif ! +#ifdef W3_OMPG + IF(IAPROC .EQ. NAPOUT) THEN + WRITE(NDSO, 906) omp_get_max_threads() + ENDIF +#endif ! ! 1.b For WAVEWATCH III (See W3INIT) @@ -600,6 +610,9 @@ PROGRAM W3SHEL NDS(11) = 22 NDS(12) = 23 NDS(13) = 34 + NDS(14) = 36 + NDS(15) = 37 + ! NTRACE(1) = NDS(3) NTRACE(2) = 10 @@ -2734,6 +2747,10 @@ PROGRAM W3SHEL 905 FORMAT ( ' Hybrid MPI/OMP thread support level:'/ & ' Requested: ', I2/ & ' Provided: ', I2/ ) +#endif + ! +#ifdef W3_OMPG +906 FORMAT ( ' OMP threading enabled. Number of threads: ', I3 / ) #endif 920 FORMAT (/' Input fields : '/ & ' --------------------------------------------------') diff --git a/model/src/ww3_trnc.F90 b/model/src/ww3_trnc.F90 index b26d0d642..ec69db4dc 100644 --- a/model/src/ww3_trnc.F90 +++ b/model/src/ww3_trnc.F90 @@ -47,6 +47,7 @@ PROGRAM W3TRNC ! ---------------------------------------------------------------- ! W3NMOD Subr. W3GDATMD Set number of model. ! W3NOUT Subr. W3ODATMD Set number of model for output. + ! W3IOGR Subr. W3IOGRMD Reading/writing model definition file. ! ---------------------------------------------------------------- ! ! 5. Called by : @@ -70,13 +71,17 @@ PROGRAM W3TRNC !/ ------------------------------------------------------------------- / USE CONSTANTS - USE W3GDATMD, ONLY : W3NMOD, W3SETG, FLAGLL, XFR +#ifdef W3_NL1 + USE W3ADATMD, ONLY : W3NAUX, W3SETA +#endif + USE W3GDATMD, ONLY : W3NMOD, W3SETG, FLAGLL, XFR, GNAME USE W3ODATMD, ONLY : W3NOUT, W3SETO, FNMPRE USE W3SERVMD, ONLY : ITRACE, NEXTLN, EXTCDE #ifdef W3_S USE W3SERVMD, ONLY : STRACE #endif USE W3TIMEMD + USE W3IOGRMD, ONLY: W3IOGR ! USE W3ODATMD, ONLY: NDSO, NDSE ! @@ -91,7 +96,7 @@ PROGRAM W3TRNC TYPE(NML_TRACK_T) :: NML_TRACK TYPE(NML_FILE_T) :: NML_FILE ! - INTEGER :: NDSI, NDSINP, & + INTEGER :: NDSI, NDSINP, NDSM, & NDSOUT, NDSTRC, NTRACE, & NSPEC, IERR, MK, MTH, IT, & ILOC, ISPEC, S3, IOUT, & @@ -129,12 +134,17 @@ PROGRAM W3TRNC ! CALL W3NMOD ( 1, 6, 6 ) CALL W3SETG ( 1, 6, 6 ) +#ifdef W3_NL1 + CALL W3NAUX ( 6, 6 ) + CALL W3SETA ( 1, 6, 6 ) +#endif CALL W3NOUT ( 6, 6 ) CALL W3SETO ( 1, 6, 6 ) ! ! 1. IO set-up. ! NDSI = 10 + NDSM = 20 NDSINP = 11 NDSOUT = 51 ! @@ -148,11 +158,16 @@ PROGRAM W3TRNC ! WRITE (NDSO,900) ! + !--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + ! 2. Read model definition file. + ! + CALL W3IOGR ( 'READ', NDSM ) + WRITE (NDSO,920) GNAME ! !--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! 2. Read requests from input file. + ! 3. Read requests from input file. ! ! @@ -163,13 +178,13 @@ PROGRAM W3TRNC ! Read namelist CALL W3NMLTRNC (NDSI, TRIM(FNMPRE)//'ww3_trnc.nml', NML_TRACK, NML_FILE, IERR) - ! 2.1 Time setup IDTIME, DTREQ, NOUT + ! 3.1 Time setup IDTIME, DTREQ, NOUT READ(NML_TRACK%TIMESTRIDE, *) DTREQ READ(NML_TRACK%TIMECOUNT, *) NOUT READ(NML_TRACK%TIMESTART, *) TOUT(1), TOUT(2) - ! 2.2 Output type + ! 3.2 Output type NCTYPE = NML_FILE%NETCDF FILEPREFIX = NML_FILE%PREFIX S3 = NML_TRACK%TIMESPLIT @@ -189,12 +204,12 @@ PROGRAM W3TRNC WRITE (NDSO,901) COMSTR - ! 2.1 Time setup IDTIME, DTREQ, NOUT + ! 3.1 Time setup IDTIME, DTREQ, NOUT CALL NEXTLN ( COMSTR , NDSI , NDSE ) READ (NDSI,*,END=806,ERR=807) TOUT, DTREQ, NOUT - ! 2.2 Output type + ! 3.2 Output type CALL NEXTLN ( COMSTR , NDSI , NDSE ) READ (NDSI,*,END=806,ERR=807) NCTYPE CALL NEXTLN ( COMSTR , NDSI , NDSE ) @@ -208,7 +223,7 @@ PROGRAM W3TRNC - ! 2.1 Time setup IDTIME, DTREQ, NOUT + ! 3.3 Time setup IDTIME, DTREQ, NOUT DTREQ = MAX ( 0. , DTREQ ) IF ( DTREQ.EQ.0. ) NOUT = 1 NOUT = MAX ( 1 , NOUT ) @@ -227,7 +242,7 @@ PROGRAM W3TRNC WRITE (NDSO,941) IDTIME, NOUT - ! 2.2 Output type + ! 3.4 Output type IF ( NCTYPE.LT.3 .OR. NCTYPE.GT.4 ) THEN WRITE (NDSE,1010) NCTYPE CALL EXTCDE ( 1 ) @@ -239,7 +254,7 @@ PROGRAM W3TRNC ! !--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! 3. Check consistency with input file and track_o.ww3 + ! 4. Check consistency with input file and track_o.ww3 ! OPEN (NDSINP,FILE=TRIM(FNMPRE)//'track_o.ww3',form='UNFORMATTED', convert=file_endian, & STATUS='OLD',ERR=800,IOSTAT=IERR) @@ -262,7 +277,7 @@ PROGRAM W3TRNC ! !--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! 4. Time management. + ! 5. Time management. ! IOUT = 0 NCID = 0 @@ -271,7 +286,7 @@ PROGRAM W3TRNC BACKSPACE (NDSINP) - ! 4.1 Loops on track_o.ww3 to read the time and data + ! 5.1 Loops on track_o.ww3 to read the time and data DO DTEST = DSEC21 ( TIME , TOUT ) @@ -310,17 +325,17 @@ PROGRAM W3TRNC END IF - ! 4.1.1 Increments the global time counter IOUT + ! 5.1.1 Increments the global time counter IOUT IOUT = IOUT + 1 CALL STME21 ( TOUT , IDTIME ) WRITE (NDSO,971) IDTIME - ! 4.1.2 Processes the variable value for the time step IOUT + ! 5.1.2 Processes the variable value for the time step IOUT CALL W3EXNC ( FILEPREFIX, NCTYPE, NCID, S3, STRSTOPDATE, MK, MTH ) - ! 4.1.3 Defines the stop date + ! 5.1.3 Defines the stop date CALL T2D(TOUT,STOPDATE,IERR) WRITE(STRSTOPDATE,'(I4.4,A,4(I2.2,A),I2.2)') STOPDATE(1),'-',STOPDATE(2), & '-',STOPDATE(3),' ',STOPDATE(5),':',STOPDATE(6),':',STOPDATE(7) @@ -331,7 +346,7 @@ PROGRAM W3TRNC 444 CONTINUE - ! 4.2 Closes the netCDF file + ! 5.2 Closes the netCDF file IF (NCID.NE.0) THEN IRET = NF90_REDEF(NCID) CALL CHECK_ERR(IRET) @@ -383,6 +398,8 @@ PROGRAM W3TRNC 902 FORMAT ( ' Spectral grid size : ',I3,' by ',I3// & ' Opening file : '/ & ' -----------------------------------------------') +920 FORMAT ( ' Grid name : ',A/) + ! 940 FORMAT (/' Output time data : '/ & ' --------------------------------------------------'/ & ' First time : ',A) diff --git a/model/tools/bash/ww3_multi_inp2nml.sh b/model/tools/bash/ww3_multi_inp2nml.sh index aa9afd497..c616282d3 100755 --- a/model/tools/bash/ww3_multi_inp2nml.sh +++ b/model/tools/bash/ww3_multi_inp2nml.sh @@ -705,13 +705,13 @@ cat >> $nmlfile << EOF ! ! * the detailed list of field names is given in model/nml/ww3_shel.nml : ! DPT CUR WND AST WLV ICE IBG 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 ! diff --git a/model/tools/bash/ww3_shel_inp2nml.sh b/model/tools/bash/ww3_shel_inp2nml.sh index 7798abf20..619002aa8 100755 --- a/model/tools/bash/ww3_shel_inp2nml.sh +++ b/model/tools/bash/ww3_shel_inp2nml.sh @@ -878,7 +878,7 @@ cat >> $nmlfile << EOF ! T T 2 1 HS HS Wave height. ! T T 2 2 WLM LM Mean wave length. ! T T 2 3 T02 T02 Mean wave period (Tm0,2). -! T T 2 4 TM10 TM10 Mean wave period (Tm-1,0). +! T T 2 4 TM10 T0M1 Mean wave period (Tm-1,0). ! T T 2 5 T01 T01 Mean wave period (Tm0,1). ! T T 2 6 FP0 FP Peak frequency. ! T T 2 7 THM DIR Mean wave direction. @@ -893,6 +893,7 @@ cat >> $nmlfile << EOF ! T T 2 16 HCMAXD SDMHC St Dev of MXHC (STE) ! F T 2 17 WBT WBT Domiant 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) ! ------------------------------------------------- @@ -912,7 +913,7 @@ cat >> $nmlfile << EOF ! T T 4 5 PSI PSPR Partitioned mean directional spread. ! T T 4 6 PWS PWS Partitioned wind sea fraction. ! T T 4 7 PTHP0 PDP Peak wave direction of partition. -! T T 4 8 PQP PQP Goda peakdedness parameter of partition. +! T T 4 8 PQP PQP Goda peakedness parameter of partition. ! T T 4 9 PPE PPE JONSWAP peak enhancement factor of partition. ! T T 4 10 PGW PGW Gaussian frequency width of partition. ! T T 4 11 PSW PSW Spectral width of partition. @@ -965,10 +966,10 @@ cat >> $nmlfile << EOF ! ------------------------------------------------- ! 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 ! ------------------------------------------------- diff --git a/regtests/bin/matrix.base b/regtests/bin/matrix.base index a273372a9..97ae213f4 100755 --- a/regtests/bin/matrix.base +++ b/regtests/bin/matrix.base @@ -689,6 +689,7 @@ echo "$rtst -s ST0 -w work_ST0 $ww3 ww3_tp2.6" >> matrix.body echo "$rtst -s ST0 -w work_ST0 $ww3 ww3_tp2.7" >> matrix.body echo "$rtst -s ST4 -w work_ST4 $ww3 ww3_tp2.6" >> matrix.body + echo "$rtst -s ST4_ASCII -w work_ST4_ASCII $ww3 ww3_tp2.6" >> matrix.body fi if [ "$prop1D" = 'y' ] @@ -905,12 +906,18 @@ echo "$rtst -s ST2 -w work_ST2 $ww3 ww3_ts1" >> matrix.body echo "$rtst -s ST3 -w work_ST3 $ww3 ww3_ts1" >> matrix.body echo "$rtst -s ST4 -w work_ST4 $ww3 ww3_ts1" >> matrix.body + echo "$rtst -s ST4 -w work_ST4_T500 -g ST4_T500 -N $ww3 ww3_ts1" >> matrix.body echo "$rtst -s ST4 -w work_ST4_T700 -g ST4_T700 -N $ww3 ww3_ts1" >> matrix.body echo "$rtst -s ST4_WRT -w work_ST4_WRT $ww3 ww3_ts1" >> matrix.body echo "$rtst -s ST4_GMD -w work_ST4_GMD $ww3 ww3_ts1" >> matrix.body echo "$rtst -s ST4_TSA -w work_ST4_TSA $ww3 ww3_ts1" >> matrix.body echo "$rtst -s ST6 -w work_ST6 $ww3 ww3_ts1" >> matrix.body echo "$rtst -w work_NL5 -i input_nl5_matrix $ww3 ww3_ts1" >> matrix.body + echo "$rtst -g Romero -w work_Romero -i input_10ms -N $ww3 ww3_ts1" >> matrix.body + echo "$rtst -g ST4_T701 -w work_T701 -i input_10ms -N $ww3 ww3_ts1" >> matrix.body + echo "$rtst -g ST4_T702 -w work_T702 -i input_10ms -N $ww3 ww3_ts1" >> matrix.body + echo "$rtst -g ST4_T707 -w work_T707GQM -i input_10ms -N $ww3 ww3_ts1" >> matrix.body + echo "$rtst -g ST4_T713 -w work_T713GQM -i input_10ms -N $ww3 ww3_ts1" >> matrix.body fi # fetch limited growth, no switch sharing here @@ -1885,6 +1892,7 @@ then echo ' ' >> matrix.body echo "$rtst -s MPI -w work_MPI -m grdset_a -f -p $mpi -n $np $ww3 mww3_test_09" >> matrix.body + echo "$rtst -s MPI_ASCII -w work_MPI_ASCII -m grdset_a -f -p $mpi -n $np $ww3 mww3_test_09" >> matrix.body fi # Rotated pole grid cases, (ww3_tp2.11 MPI only if requested) @@ -1945,6 +1953,8 @@ echo "$rtst -g 206H -w work_IC4_M6H -i input_IC4_M6 $ww3 ww3_tic1.1" >> matrix.body echo "$rtst -g 206L -w work_IC4_M6L -i input_IC4_M6 $ww3 ww3_tic1.1" >> matrix.body echo "$rtst -w work_IC4_M7 -i input_IC4_M7 $ww3 ww3_tic1.1" >> matrix.body + echo "$rtst -w work_IC4_M8 -i input_IC4_M8 $ww3 ww3_tic1.1" >> matrix.body + echo "$rtst -w work_IC4_M9 -i input_IC4_M9 $ww3 ww3_tic1.1" >> matrix.body echo "$rtst -g 1000m -w work_IC5_M1 -i input_IC5_M1 $ww3 ww3_tic1.1" >> matrix.body echo "$rtst -g 1000m -w work_IC5_M2 -i input_IC5_M2 $ww3 ww3_tic1.1" >> matrix.body echo "$rtst -g 1000m -w work_IC5_M3 -i input_IC5_M3 $ww3 ww3_tic1.1" >> matrix.body @@ -2152,11 +2162,13 @@ # Global unstr case # Domain Decomposition Explicit fi + if [ "$ufs" = 'y' ] && [ "$pdlib" = 'y' ] && [ "$dist" = 'y' ]; then echo "$rtst -s MPI -s PDLIB -i input_unstr -w work_unstr_a -g a -f -p $mpi -n $np $ww3 ww3_ufs1.1" >> matrix.body # Domain Decomposition Block Explicit echo "$rtst -s MPI -s PDLIB -i input_unstr -w work_unstr_b -g b -f -p $mpi -n $np $ww3 ww3_ufs1.1" >> matrix.body # Domain Decomposition Implicit echo "$rtst -s MPI -s PDLIB -i input_unstr -w work_unstr_c -g c -f -p $mpi -n $np $ww3 ww3_ufs1.1" >> matrix.body + fi #Test of UFS applications with ww3_multi_esmf and grib2 output if [ "$ufs" = 'y' ] && [ "$esmf" = 'y' ] && [ "$grib" = 'y' ] diff --git a/regtests/bin/matrix.comp b/regtests/bin/matrix.comp index cc3ecf20a..0d70b1b7b 100755 --- a/regtests/bin/matrix.comp +++ b/regtests/bin/matrix.comp @@ -5,8 +5,8 @@ # Intended for interactive running only. # # # # Hendrik L. Tolman # -# Updated by Yukino Nagai # -# June 2017 # +# Updated by Yukino Nagai # +# June 2017 # # # # Copyright 2013 National Weather Service (NWS), # # National Oceanic and Atmospheric Administration. All rights # @@ -17,6 +17,24 @@ # This script takes in one argument: the name of a test directory or 'all' # # 1. Set up + +function isbinary { + # Check if file is binary [or text] + # + # Uses `file` command to check if a file is binary or text by inspecting + # the MIME type of file. + # + # `file -i ` will return `text/` if file is a text file. + # Anything else can be considered a binary file. + # + # If your version of `file` does not accept the -i or --mime flag, you + # can also just run `file` with no flags and use `grep -i text`. + # + # The mime checking version is a bit more robust though. + + file -i $1 | grep -vq "text/" +} + # 1.a Computer/ user dependent set up if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ] @@ -154,7 +172,7 @@ if [[ -d $file ]]; then if [[ $file == build* ]] || [[ $file == exe* ]] || [[ $file == *oasis3-mct* ]] || [[ $file == toy* ]]; then - echo "do not compare build or exe directories $file" + : # skip else #add files: files_dir=`ls $file` @@ -168,9 +186,6 @@ fi done - #Generate list of binary files in the directory - binaryfiles=`grep . -r * | grep 'Binary file' | sed -e "s/^Binary file //" -e "s/ matches$//"` - #Generate list of files to skip skipfiles="ww3_shel.out ww3_multi.out prf.*.mww3 finished ww3_systrk.out gmon.out time_count.txt oasis_make.out oasis_clean.out toy_model toy_make.out toy_clean.out build.log" @@ -186,7 +201,7 @@ if [[ -d $file ]]; then if [[ $file == build* ]] || [[ $file == exe* ]] || [[ $file == *oasis3-mct* ]] || [[ $file == toy* ]]; then - echo "do not compare build or exe directories $file" + : # skip else #add files: files_dir=`ls $file` @@ -227,7 +242,7 @@ elif [[ $file == log.* ]] || [[ $file == "output.ww3" ]] then filetype="log" - elif [[ $binaryfiles =~ (^|[[:space:]])"$file"($|[[:space:]]) ]] + elif isbinary $file then filetype="binary" else diff --git a/regtests/bin/matrix_cmake_datarmor b/regtests/bin/matrix_cmake_datarmor index f8ffaaa63..16c31e47c 100755 --- a/regtests/bin/matrix_cmake_datarmor +++ b/regtests/bin/matrix_cmake_datarmor @@ -112,6 +112,7 @@ main_dir="`cd $main_dir 1>/dev/null 2>&1 && pwd`" echo " export NETCDF_CONFIG=/home/datawork-wave/NETCDF2019/${COMP}/bin/nc-config" >> matrix.head echo " export NetCDF_ROOT=/home/datawork-wave/NETCDF2019/${COMP}" >> matrix.head echo " export METIS_PATH=/home/datawork-wave/PARMETIS2019/${COMP}" >> matrix.head + echo " export SCOTCH_PATH=/home/datawork-wave/LIB/SCOTCH/v7.0.3/${COMP}" >> matrix.head echo " export WW3_PARCOMPN=4" >> matrix.head echo " export G2_LIB4=/home/datawork-wave/NCEPLIBS/${COMP}/g2-3.4.5/lib64/libg2_4.a" >> matrix.head echo " export BACIO_LIB4=/home/datawork-wave/NCEPLIBS/${COMP}/bacio-2.4.1/lib/libbacio_4.a" >> matrix.head @@ -128,7 +129,7 @@ main_dir="`cd $main_dir 1>/dev/null 2>&1 && pwd`" export mpi='$MPI_LAUNCH' # Compile option - opt="-f -N -S -T" + opt="-f -N -S -T -o both" # Base run_test command line export rtst="./bin/run_cmake_test $opt" diff --git a/regtests/bin/matrix_cmake_ncep b/regtests/bin/matrix_cmake_ncep index 771b6f96e..7d0d26bec 100755 --- a/regtests/bin/matrix_cmake_ncep +++ b/regtests/bin/matrix_cmake_ncep @@ -41,16 +41,18 @@ EOF # Convert main_dir to absolute path main_dir="`cd $main_dir 1>/dev/null 2>&1 && pwd`" -# Module Versions from HPC-Stack that are common for all platforms - modnetcdf='netcdf/4.7.4' - modjasper='jasper/2.0.25' - modzlib='zlib/1.2.11' +# Module Versions from spack-stack that are common for all platforms + modnetcdfc='netcdf-c/4.9.2' + modnetcdff='netcdf-fortran/4.6.0' + modjasper='jasper/2.0.32' + modzlib='zlib/1.2.13' modpng='libpng/1.6.37' - modhdf5='hdf5/1.10.6' + modhdf5='hdf5/1.14.0' modbacio='bacio/2.4.1' modg2='g2/3.4.5' - modw3emc='w3emc/2.9.2' - modesmf='esmf/8.3.0b09' + modw3emc='w3emc/2.10.0' + modesmf='esmf/8.4.2' + modscotch='scotch/7.0.4' # Set batchq queue, choose modules and other custom variables to fit system and # to define headers etc (default to original version if empty) @@ -60,27 +62,19 @@ EOF then # If no other h, assuming Hera batchq='slurm' - basemodcomp='intel/2022.1.2' - basemodmpi='impi/2022.1.2' - hpcstackpath='/scratch1/NCEPDEV/nems/role.epic/hpc-stack/libs/intel-2022.1.2/modulefiles/stack' - hpcstackversion='hpc/1.2.0' - modcomp='hpc-intel/2022.1.2' - modmpi='hpc-impi/2022.1.2' - scotchpath='/scratch1/NCEPDEV/climate/Matthew.Masarik/waves/opt/hpc-stack/scotch-v7.0.3/install' - metispath='/scratch1/NCEPDEV/climate/Matthew.Masarik/waves/opt/hpc-stack/parmetis-4.0.3/install' - modcmake='cmake/3.20.1' + spackstackpath='/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.5.0/envs/unified-env-noavx512/install/modulefiles/Core' + modcomp='stack-intel/2021.5.0' + modmpi='stack-intel-oneapi-mpi/2021.5.1' + metispath='/scratch1/NCEPDEV/climate/Matthew.Masarik/waves/opt/spack-stack/1.5.0/parmetis-4.0.3/install' + modcmake='cmake/3.23.1' elif [ $isorion ] then batchq='slurm' - basemodcomp='intel/2022.1.2' - basemodmpi='impi/2022.1.2' - hpcstackpath='/work/noaa/epic-ps/role-epic-ps/hpc-stack/libs/intel-2022.1.2/modulefiles/stack' - hpcstackversion='hpc/1.2.0' - modcomp='hpc-intel/2022.1.2' - modmpi='hpc-impi/2022.1.2' - scotchpath='/work2/noaa/marine/mmasarik/waves/opt/hpc-stack/scotch-v7.0.3/install' - metispath='/work2/noaa/marine/mmasarik/waves/opt/hpc-stack/parmetis-4.0.3/install' - modcmake='cmake/3.22.1' + spackstackpath='/work/noaa/epic/role-epic/spack-stack/orion/spack-stack-1.5.0/envs/unified-env/install/modulefiles/Core' + modcomp='stack-intel/2022.0.2' + modmpi='stack-intel-oneapi-mpi/2021.5.1' + metispath='/work/noaa/marine/Matthew.Masarik/waves/opt/spack-stack/1.5.0/parmetis-4.0.3/install' + modcmake='cmake/3.23.1' else batchq= fi @@ -96,7 +90,7 @@ EOF # 1.a Computer/ user dependent set up - echo '#!/bin/sh --login' > matrix.head + echo '#!/bin/sh' > matrix.head echo ' ' >> matrix.head if [ $batchq = "slurm" ] && [ $isorion ] then @@ -139,29 +133,28 @@ EOF # Netcdf, Parmetis and SCOTCH modules & variables echo " module purge" >> matrix.head - echo " module load $modcmake" >> matrix.head if [ ! -z $basemodcomp ]; then echo " module load $basemodcomp" >> matrix.head fi if [ ! -z $basemodmpi ]; then echo " module load $basemodmpi" >> matrix.head fi - echo " module use $hpcstackpath" >> matrix.head - echo " module load $hpcstackversion" >> matrix.head + echo " module use $spackstackpath" >> matrix.head echo " module load $modcomp" >> matrix.head echo " module load $modmpi" >> matrix.head + echo " module load $modcmake" >> matrix.head echo " module load $modpng" >> matrix.head echo " module load $modzlib" >> matrix.head echo " module load $modjasper" >> matrix.head echo " module load $modhdf5" >> matrix.head - echo " module load $modnetcdf" >> matrix.head + echo " module load $modnetcdfc" >> matrix.head + echo " module load $modnetcdff" >> matrix.head echo " module load $modbacio" >> matrix.head echo " module load $modg2" >> matrix.head echo " module load $modw3emc" >> matrix.head echo " module load $modesmf" >> matrix.head - + echo " module load $modscotch" >> matrix.head echo " export METIS_PATH=${metispath}" >> matrix.head - echo " export SCOTCH_PATH=${scotchpath}" >> matrix.head echo " export path_build_root=$(dirname $main_dir)/regtests/buildmatrix" >> matrix.head echo ' [[ -d ${path_build_root} ]] && rm -rf ${path_build_root}' >> matrix.head echo ' ' diff --git a/regtests/bin/run_cmake_test b/regtests/bin/run_cmake_test index e114cd72a..07ade5a8b 100755 --- a/regtests/bin/run_cmake_test +++ b/regtests/bin/run_cmake_test @@ -109,7 +109,7 @@ EOF # --------------------------------------------------------------------------- # echo ' ' -echo " Running now options: run_test $*" +echo " Running now options: run_cmake_test $*" echo ' ' # 2.a Setup array of command-line arguments @@ -377,7 +377,7 @@ fi if [ $time_count ] then # Add time counter if -T - echo " REGTESTS Time counter: run_test $ARGS" >> time_count.txt + echo " REGTESTS Time counter: run_cmake_test $ARGS" >> time_count.txt Tstart=`date +"%s.%2N"` fi @@ -435,25 +435,26 @@ then echo "Switch file is $path_build/switch with switches:" >> $ofile cat $path_build/switch >> $ofile - cmake $path_cmake ${CMAKE_OPTIONS} -DSWITCH=$path_build/switch -DCMAKE_INSTALL_PREFIX=install > $ofile 2>&1 + cmake $path_cmake ${CMAKE_OPTIONS} -DSWITCH=$path_build/switch -DCMAKE_INSTALL_PREFIX=install >> $ofile 2>&1 rc=$? - if [[ $rc -ne 0 ]] ; then + if (( rc != 0 )); then echo "Fatal error in cmake." - echo "The build log is in $ofile" - exit + echo "The build log is in ${ofile}" + exit ${rc} fi - make -j 8 > $ofile 2>&1 + make -j 8 VERBOSE=1 >> $ofile 2>&1 rc=$? - if [[ $rc -ne 0 ]] ; then + if (( rc != 0 )); then echo "Fatal error in make." - echo "The build log is in $ofile" - exit + echo "The build log is in ${ofile}" + exit ${rc} fi - make install > $ofile 2>&1 - if [[ $rc -ne 0 ]] ; then + make install >> $ofile 2>&1 + rc=$? + if (( rc != 0 )); then echo "Fatal error in make install." echo "The build log is in $ofile" - exit + exit ${rc} fi cp $path_build/install/bin/* $path_e/ @@ -468,30 +469,34 @@ then \cp -f $file_c $path_build/switch echo "Switch file is $path_build/switch with switches:" >> $ofile cat $path_build/switch >> $ofile - cmake $path_cmake ${CMAKE_OPTIONS} -DSWITCH=$path_build/switch -DCMAKE_INSTALL_PREFIX=install > $ofile 2>&1 + cmake $path_cmake ${CMAKE_OPTIONS} -DSWITCH=$path_build/switch -DCMAKE_INSTALL_PREFIX=install >> $ofile 2>&1 rc=$? - if [[ $rc -ne 0 ]] ; then + if (( rc != 0 )); then echo "Fatal error in cmake." - echo "The build log is in $ofile" - exit + echo "The build log is in ${ofile}" + exit ${rc} fi - make -j 8 > $ofile 2>&1 - if [[ $rc -ne 0 ]] ; then + make -j 8 VERBOSE=1 >> $ofile 2>&1 + rc=$? + if (( rc != 0 )); then echo "Fatal error in make." - echo "The build log is in $ofile" - exit + echo "The build log is in ${ofile}" + exit ${rc} fi - make install > $ofile 2>&1 - if [[ $rc -ne 0 ]] ; then + make install >> $ofile 2>&1 + rc=$? + if (( rc != 0 )); then echo "Fatal error in make install." echo "The build log is in $ofile" - exit + exit ${rc} fi path_e=$path_w/exe cp $path_build/install/bin/ww3_shel $path_e/ cp $path_build/install/bin/ww3_multi $path_e/ cp $path_build/install/bin/ww3_systrk $path_e/ - cp $path_build/install/bin/ww3_prtide $path_e/ + if [ -e $path_build/install/bin/ww3_prtide ]; then + cp $path_build/install/bin/ww3_prtide $path_e/ + fi fi else path_build=${path_build_root} @@ -505,24 +510,26 @@ else fi echo "Switch file is $path_build/switch with switches:" >> $ofile cat $path_build/switch >> $ofile - cmake $path_cmake ${CMAKE_OPTIONS} -DSWITCH=$path_build/switch -DCMAKE_INSTALL_PREFIX=install > $ofile 2>&1 + cmake $path_cmake ${CMAKE_OPTIONS} -DSWITCH=$path_build/switch -DCMAKE_INSTALL_PREFIX=install >> $ofile 2>&1 rc=$? - if [[ $rc -ne 0 ]] ; then + if (( rc != 0 )); then echo "Fatal error in cmake." - echo "The build log is in $ofile" - exit + echo "The build log is in ${ofile}" + exit ${rc} fi - make -j 8 > $ofile 2>&1 - if [[ $rc -ne 0 ]] ; then + make -j 8 VERBOSE=1 >> $ofile 2>&1 + rc=$? + if (( rc != 0 )); then echo "Fatal error in make." - echo "The build log is in $ofile" - exit + echo "The build log is in ${ofile}" + exit ${rc} fi - make install > $ofile 2>&1 - if [[ $rc -ne 0 ]] ; then - echo "Fatal error in make install." - echo "The build log is in $ofile" - exit + make install >> $ofile 2>&1 + rc=$? + if (( rc != 0 )); then + echo "Fatal error in make." + echo "The build log is in ${ofile}" + exit ${rc} fi cp $path_build/install/bin/* $path_e/ @@ -626,7 +633,7 @@ then fi # link conf file - if [ $nml_input ] && [ ! -z "`echo ${ifile} | grep -o nml`" ] + if [ $nml_input ] && [ ! -z "`basename ${ifile} | grep -o nml`" ] then \rm -f $prog.nml \ln -s $ifile $prog.nml @@ -652,7 +659,11 @@ then if [ $multi -eq 2 ] then mv mod_def.ww3 mod_def.$g - if [ $nml_input ] && [ ! -z "`echo ${ifile} | grep -o nml`" ] + if [ -e mod_def.ww3.txt ] + then + mv mod_def.ww3.txt mod_def.${g}.txt + fi + if [ $nml_input ] && [ ! -z "`basename ${ifile} | grep -o nml`" ] then mv $prog.nml.log ${prog}_$g.nml.log fi @@ -750,7 +761,7 @@ then then mv restart.ww3 restart.$g \rm -f mod_def.ww3 - if [ $nml_input ] && [ ! -z "`echo ${ifile} | grep -o nml`" ] + if [ $nml_input ] && [ ! -z "`basename ${ifile} | grep -o nml`" ] then mv $prog.nml.log ${prog}_$g.nml.log fi @@ -849,7 +860,7 @@ then then mv nest.ww3 nest.$g \rm -f mod_def.ww3 - if [ $nml_input ] && [ ! -z "`echo ${ifile} | grep -o nml`" ] + if [ $nml_input ] && [ ! -z "`basename ${ifile} | grep -o nml`" ] then mv $prog.nml.log ${prog}_$g.nml.log fi @@ -948,7 +959,7 @@ then then mv nest.ww3 nest.$g \rm -f mod_def.ww3 - if [ $nml_input ] && [ ! -z "`echo ${ifile} | grep -o nml`" ] + if [ $nml_input ] && [ ! -z "`basename ${ifile} | grep -o nml`" ] then mv $prog.nml.log ${prog}_$g.nml.log fi @@ -1052,7 +1063,7 @@ then then \rm -f mod_def.ww3 mv $otype.ww3 $otype.$g - if [ $nml_input ] && [ ! -z "`echo ${ifile} | grep -o nml`" ] + if [ $nml_input ] && [ ! -z "`basename ${ifile} | grep -o nml`" ] then mv $prog.nml.log ${prog}_$g.nml.log fi @@ -1127,9 +1138,9 @@ then if [ $nml_input ] && [ ! -z "`ls ${path_i}/${prog}*.nml 2>/dev/null`" ] then - inputs_tmp=`( ls ${path_i}/${prog}${gu}*nml)` + inputs_tmp="`ls ${path_i}/${prog}${gu}*nml 2>/dev/null`" else - inputs_tmp=`( ls ${path_i}/${prog}${gu}*inp)` + inputs_tmp="`ls ${path_i}/${prog}${gu}*inp 2>/dev/null`" fi if [ ! -z "$inputs_tmp" ];then @@ -1176,7 +1187,7 @@ then then \rm -f mod_def.ww3 mv $otype.ww3 $otype.$g - if [ $nml_input ] && [ ! -z "`echo ${ifile} | grep -o nml`" ] + if [ $nml_input ] && [ ! -z "`basename ${ifile} | grep -o nml`" ] then mv $prog.nml.log ${prog}_$g.nml.log fi @@ -1299,7 +1310,7 @@ then then \rm -f mod_def.ww3 mv $otype.ww3 $otype.$g - if [ $nml_input ] && [ ! -z "`echo ${ifile} | grep -o nml`" ] + if [ $nml_input ] && [ ! -z "`basename ${ifile} | grep -o nml`" ] then mv $prog.nml.log ${prog}_$g.nml.log fi @@ -1443,7 +1454,7 @@ then \rm -f PET*.ESMF_LogFile \rm -f ww3_esmf.rc \cp -f ${path_i}/ww3_esmf.rc ww3_esmf.rc - if [ ! -z "`echo ${ifile} | grep -o nml`" ] + if [ ! -z "`basename ${ifile} | grep -o nml`" ] then echo "WAV_input_file_name: $prog.nml" >> ww3_esmf.rc fi @@ -1752,7 +1763,7 @@ do then \rm -f mod_def.ww3 \rm -f out_grd.ww3 - if [ $nml_input ] && [ ! -z "`echo ${ifile} | grep -o nml`" ] + if [ $nml_input ] && [ ! -z "`basename ${ifile} | grep -o nml`" ] then mv $prog.nml.log ${prog}_$g.nml.log fi @@ -1819,7 +1830,7 @@ do then \rm -f mod_def.ww3 \rm -f out_grd.ww3 - if [ $nml_input ] && [ ! -z "`echo ${ifile} | grep -o nml`" ] + if [ $nml_input ] && [ ! -z "`basename ${ifile} | grep -o nml`" ] then mv $prog.nml.log ${prog}_$g.nml.log fi @@ -1987,7 +1998,7 @@ do then \rm -f mod_def.ww3 \rm -f out_pnt.ww3 - if [ $nml_input ] && [ ! -z "`echo ${ifile} | grep -o nml`" ] + if [ $nml_input ] && [ ! -z "`basename ${ifile} | grep -o nml`" ] then mv $prog.nml.log ${prog}_$g.nml.log fi @@ -2025,7 +2036,7 @@ done # end of loop on progs case $outopt in native) out_progs="ww3_trck" ;; netcdf) out_progs="ww3_trnc" ;; - both) out_progs="ww3_trck ww3_trnc" ;; + both|all) out_progs="ww3_trck ww3_trnc" ;; *) out_progs="" ;; esac @@ -2068,6 +2079,9 @@ do then continue fi + + \ln -s mod_def.$g mod_def.ww3 + gu="_$g" fileconf="$prog${gu}" else @@ -2122,8 +2136,9 @@ do \rm -f $prog.nml if [ $multi -eq 2 ] then + \rm -f mod_def.ww3 \rm -f track_o.ww3 - if [ $nml_input ] && [ ! -z "`echo ${ifile} | grep -o nml`" ] + if [ $nml_input ] && [ ! -z "`basename ${ifile} | grep -o nml`" ] then mv $prog.nml.log ${prog}_$g.nml.log fi diff --git a/regtests/bin/run_test b/regtests/bin/run_test index 7ed5ce40e..560ab0725 100755 --- a/regtests/bin/run_test +++ b/regtests/bin/run_test @@ -2368,7 +2368,7 @@ done # end of loop on progs case $outopt in native) out_progs="ww3_trck" ;; netcdf) out_progs="ww3_trnc" ;; - both) out_progs="ww3_trck ww3_trnc" ;; + both|all) out_progs="ww3_trck ww3_trnc" ;; *) out_progs="" ;; esac @@ -2448,6 +2448,9 @@ do then continue fi + + \ln -s mod_def.$g mod_def.ww3 + gu="_$g" fileconf="$prog${gu}" else @@ -2502,6 +2505,7 @@ do \rm -f $prog.nml if [ $multi -eq 2 ] then + \rm -f mod_def.ww3 \rm -f track_o.ww3 if [ $nml_input ] && [ ! -z "`echo ${ifile} | grep -o nml`" ] then diff --git a/regtests/mww3_test_01/input/ww3_ounf.inp b/regtests/mww3_test_01/input/ww3_ounf.inp index 55b74a100..f78b0e667 100644 --- a/regtests/mww3_test_01/input/ww3_ounf.inp +++ b/regtests/mww3_test_01/input/ww3_ounf.inp @@ -11,7 +11,7 @@ $ file for a full documentation of field output options. Namelist type $ selection is used here (for alternative F/T flags, see ww3_shel.inp). $ N - HS + HS ICE $ $--------------------------------------------------------------------- $ $ Output type 4 [3,4] (version netCDF) diff --git a/regtests/mww3_test_01/input/ww3_ounf.nml b/regtests/mww3_test_01/input/ww3_ounf.nml index 5a92a0cb5..b6a115a7f 100644 --- a/regtests/mww3_test_01/input/ww3_ounf.nml +++ b/regtests/mww3_test_01/input/ww3_ounf.nml @@ -9,7 +9,7 @@ FIELD%TIMESTART = '19680606 000000' FIELD%TIMESTRIDE = '3600' FIELD%TIMECOUNT = '999' - FIELD%LIST = 'HS' + FIELD%LIST = 'HS ICE' FIELD%PARTITION = '0 1 2' FIELD%TYPE = 4 / diff --git a/regtests/mww3_test_01/input/ww3_outf_file.inp b/regtests/mww3_test_01/input/ww3_outf_file.inp index 6d909ff53..db8c14716 100644 --- a/regtests/mww3_test_01/input/ww3_outf_file.inp +++ b/regtests/mww3_test_01/input/ww3_outf_file.inp @@ -6,7 +6,7 @@ $ 19680606 000000 3600 999 $ N - HS + HS ICE $ 3 0 1 999 1 999 1 1 diff --git a/regtests/mww3_test_01/input/ww3_shel.inp b/regtests/mww3_test_01/input/ww3_shel.inp index 1585f747e..ecc511800 100644 --- a/regtests/mww3_test_01/input/ww3_shel.inp +++ b/regtests/mww3_test_01/input/ww3_shel.inp @@ -18,7 +18,7 @@ $ 19680606 000000 450 19680607 000000 $ N - HS FP DP + HS FP DP ICE $ 19680606 000000 450 19680607 000000 100.E3 100.E3 'point_A' diff --git a/regtests/mww3_test_01/input/ww3_shel.nml b/regtests/mww3_test_01/input/ww3_shel.nml index f9a586f53..903cef0c8 100644 --- a/regtests/mww3_test_01/input/ww3_shel.nml +++ b/regtests/mww3_test_01/input/ww3_shel.nml @@ -22,7 +22,7 @@ ! Define the output types point parameters via OUTPUT_TYPE_NML namelist ! -------------------------------------------------------------------- ! &OUTPUT_TYPE_NML - TYPE%FIELD%LIST = 'HS FP DP' + TYPE%FIELD%LIST = 'HS FP DP ICE' TYPE%POINT%FILE = '../input/points.list' / diff --git a/regtests/mww3_test_09/input/switch_MPI_ASCII b/regtests/mww3_test_09/input/switch_MPI_ASCII new file mode 100644 index 000000000..e3d9628f0 --- /dev/null +++ b/regtests/mww3_test_09/input/switch_MPI_ASCII @@ -0,0 +1 @@ +ASCII NOGRB MPI DIST PR2 UNO SMC FLX2 LN0 ST0 NL0 BT0 DB0 TR0 BS0 IC0 IS0 REF0 WNT1 WNX1 CRT1 CRX1 O0 O1 O2 O3 O4 O5 O6 O7 O10 O11 diff --git a/regtests/unittests/CMakeLists.txt b/regtests/unittests/CMakeLists.txt new file mode 100644 index 000000000..69445bfb7 --- /dev/null +++ b/regtests/unittests/CMakeLists.txt @@ -0,0 +1,39 @@ +# This is the CMake file for the model/tests directory in the WW3 +# project. +# +# Ed Hartnett, 10/14/23 + +# Some very small test files may be committed to the repo. This +# function copies such a data file to the build directory. +function(copy_test_data name) + message(STATUS "Copying ${name} to ${CMAKE_CURRENT_BINARY_DIR}") + file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/data/${name}" + DESTINATION ${CMAKE_CURRENT_BINARY_DIR} + FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) +endfunction() + +# Some very small test files may be committed to the repo. This +# function copies such a data file to the build directory. +function(copy_test_data_2 srcname destname) + message(STATUS "Copying ${srcname} to ${CMAKE_CURRENT_BINARY_DIR}/${destname}") + file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/data/${srcname}" + DESTINATION "${CMAKE_BINARY_DIR}" + FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) + file(RENAME "${CMAKE_BINARY_DIR}/${srcname}" "${CMAKE_BINARY_DIR}/${destname}") +endfunction() + +# Function to build and run a test. +function(unit_test name) + add_executable(${name} ${name}.F90) + target_link_libraries(${name} PRIVATE ww3_lib) + add_test(NAME ${name} COMMAND ${name}) +endfunction() + +# Copy test data files that are in the repo to the build directory. +copy_test_data(switch.io) +copy_test_data_2(ww3_grid.inp ww3_grid.inp) + +# Build and run the tests. +unit_test(test_io_points_bin) + + diff --git a/regtests/unittests/data/switch.io b/regtests/unittests/data/switch.io new file mode 100644 index 000000000..c97e44765 --- /dev/null +++ b/regtests/unittests/data/switch.io @@ -0,0 +1 @@ +NOGRB SHRD PR1 FLX2 LN0 ST0 NL0 BT0 DB0 TR0 BS0 IC0 IS0 REF0 WNT1 WNX1 CRT1 CRX1 O0 O1 O2 O3 O4 O5 O6 O7 O10 O11 \ No newline at end of file diff --git a/regtests/unittests/data/ww3_grid.inp b/regtests/unittests/data/ww3_grid.inp new file mode 100644 index 000000000..6f45604f3 --- /dev/null +++ b/regtests/unittests/data/ww3_grid.inp @@ -0,0 +1,48 @@ +$ WAVEWATCH III Grid preprocessor input file +$ ------------------------------------------ + '1-D REFRACTION X ' +$ + 1.25 0.08 3 24 0. +$ + F T F T F F + 300. 300. 150. 300. +$ + &PRO1 CFLTM = 0.75 / + &PRO2 CFLTM = 0.75 / + &PRO3 CFLTM = 0.75, WDTHCG = 0., WDTHTH = 0. / + &PRO4 CFLTM = 0.75, RNFAC = 0., RSFAC = 0. / +END OF NAMELISTS +$ + 'RECT' F 'NONE' + 13 3 + 5.E3 5.E3 1. + -5.E3 -5.E3 1. +$ + -1. 1. 10 -1. 2 1 '(....)' 'UNIT' 'input' +$ +$ First grid +$ + 50 50 50 45 40 35 30 25 20 15 10 5 0 + 50 50 50 45 40 35 30 25 20 15 10 5 0 + 50 50 50 45 40 35 30 25 20 15 10 5 0 +$ +$ Second grid +$ +$ 0 5 10 15 20 25 30 35 40 45 50 50 50 +$ 0 5 10 15 20 25 30 35 40 45 50 50 50 +$ 0 5 10 15 20 25 30 35 40 45 50 50 50 +$ + 10 1 1 '(....)' 'PART' 'input' +$ +$ First grid +$ + 2 2 F +$ +$ Second grid +$ +$ 12 2 F + 0 0 F + 0 0 F + 0 0 +$ + 0. 0. 0. 0. 0 diff --git a/regtests/unittests/data/ww3_outp.inp b/regtests/unittests/data/ww3_outp.inp new file mode 100644 index 000000000..dd728819f --- /dev/null +++ b/regtests/unittests/data/ww3_outp.inp @@ -0,0 +1,8 @@ +$ + 20100101 000000 3600 1 +$ + 1 + -1 +$ + 4 + 2 30 20100101 000000 'UTC' diff --git a/regtests/unittests/test_io_points_bin.F90 b/regtests/unittests/test_io_points_bin.F90 new file mode 100644 index 000000000..69c197bce --- /dev/null +++ b/regtests/unittests/test_io_points_bin.F90 @@ -0,0 +1,152 @@ +! This is a test for model IO for WW3. This tests the legacy (binary) +! output of points data, done by function W3IOPO(). +! +! Ed Hartnett 10/14/23 +program test_io_points_bin + use w3iopomd + use w3gdatmd + use w3wdatmd + use w3odatmd + use w3iogrmd + use w3adatmd + implicit none + + integer, target :: i + integer :: ndsop, iotest, ndsbul, ndsm + integer :: ndstrc, ntrace + character*7 expected_ptnme + character*6 my_fmt + real :: expected_loc_1 + integer :: write_test_file + + print *, 'Testing WW3 binary point file code.' + + ! These are mysterious but have to be called or else the IPASS + ! variable does not exist and w3iopo() crashes. + call w3nmod(1, 6, 6) + call w3setg(1, 6, 6) + call w3ndat(6, 6) + call w3setw(1, 6, 6) + call w3nout(6, 6) + call w3seto(1, 6, 6) + + ndsm = 20 + ndsop = 20 + ndsbul = 0 + ndstrc = 6 + ntrace = 10 + + ! Create a point output file needed for this test. + if (write_test_file() .ne. 0) stop 1 + + write (ndso,900) +900 FORMAT (/15X,' *** WAVEWATCH III Point output post.*** '/ & + 15X,'==============================================='/) + + ! 2. Read model definition file. + CALL W3IOGR('READ', NDSM) + WRITE (NDSO,920) GNAME +920 FORMAT (' Grid name : ',A/) + + ! This will not work. But cannot be tested because it will change the value of IPASS, +! call w3iopo('EAD', ndsop, iotest) +! if (iotest .ne. 1) stop 7 + + ! Read the file out_pnt.ww3 from the model/tests/data directory. + call w3iopo('READ', ndsop, iotest) + if (iotest .ne. 0) stop 10 + close(ndsop) + + ! Make sure we got the values we expected. + if (nopts .ne. 11) stop 11 + expected_loc_1 = 0.0 + do i = 1, nopts + ! Check ptnme and ptloc arrays. + print *, ptnme(i), ptloc(1, i), ptloc(2, i) + if (i .lt. 10) then + my_fmt = '(a,i1)' + else + my_fmt = '(a,i2)' + endif + write(fmt = my_fmt, unit=expected_ptnme) 'Point', i + if (ptnme(i) .ne. expected_ptnme) stop 20 + print *, expected_loc_1 + if (ptloc(1, i) .ne. expected_loc_1) stop 21 + expected_loc_1 = expected_loc_1 + 5000.0 + if (ptloc(2, i) .ne. 0) stop 22 + end do + + print *, 'OK!' + print *, 'SUCCESS!' +end program test_io_points_bin + +integer function write_test_file() + implicit none + + integer :: ntlu, nk, nth, nopts + character(len=10), parameter :: veropt = '2021-04-06' + character(len=31), parameter :: idstr = 'WAVEWATCH III POINT OUTPUT FILE' + real :: ptloc(2,11) = reshape((/ 0., 0., 5000., 0., 10000., 0., 15000., 0., & + 20000., 0., 25000., 0., 30000., 0., 35000., 0., 40000., 0., 45000., 0., 50000., 0. /), & + (/ 2, 11 /)) + character*40 ptnme(11) + integer :: time(2) = (/ 19680606, 0 /) + integer :: nspec = 72 + integer :: iw(11) = (/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /) + integer :: ii(11) = (/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /) + integer :: il(11) = (/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /) + real :: iceo(11) = (/ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0. /) + real :: iceho(11) = (/ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0. /) + real :: icefo(11) = (/ 1000., 1000., 1000., 1000., 1000., 1000., 1000., 1000., 1000., 1000., 1000. /) + real :: dpo(11) = (/ 50., 50., 45., 40., 35., 30., 25., 20., 15., 10., 5. /) + real :: wao(11) = (/ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0. /) + real :: wdo(11) = (/ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0. /) + real :: aso(11) = (/ -999.900024, -999.900024, -999.900024, -999.900024, -999.900024, & + -999.900024, -999.900024, -999.900024, -999.900024, -999.900024, -999.900024 /) + real :: cao(11) = (/ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0. /) + real :: cdo(11) = (/ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0. /) + character*13 :: grdid(11) + real :: spco(72, 11) + integer :: i, j + integer :: ierr + + ! Initialize some values. + ntlu = 21 + nk = 3 + nth = 24 + nopts = 11 + do i = 1, nopts + if (i .le. 9) then + write(ptnme(i), '(a,i1)') 'Point', i + else + write(ptnme(i), '(a,i2)') 'Point', i + endif + grdid(i) = 'ww3 ' + end do + + ! Open the file. + open(ntlu, file="out_pnt.ww3", form="unformatted", status="replace", & + action="write", convert="big_endian", iostat=ierr) + if (ierr .ne. 0) stop 111 + + ! Write our values. + write (ntlu, iostat=ierr) idstr, veropt, nk, nth, nopts + if (ierr .ne. 0) stop 112 + write (ntlu, iostat=ierr) ((ptloc(j,i),j=1,2),i=1,nopts), (ptnme(i),i=1,nopts) + if (ierr .ne. 0) stop 113 + write (ntlu, iostat=ierr) time + if (ierr .ne. 0) stop 114 + do i=1, nopts + write (ntlu, iostat=ierr) iw(i), ii(i), il(i), dpo(i), wao(i), wdo(i), & + aso(i), cao(i), cdo(i), iceo(i), iceho(i), & + icefo(i), grdid(i), (spco(j,i),j=1,nspec) + if (ierr .ne. 0) stop 115 + enddo + + ! Close the file. + close(ntlu) + + ! We're done! + write_test_file = 0 +end function write_test_file + diff --git a/regtests/ww3_tic1.1/info b/regtests/ww3_tic1.1/info index 89f046a37..589317ea5 100644 --- a/regtests/ww3_tic1.1/info +++ b/regtests/ww3_tic1.1/info @@ -51,6 +51,9 @@ # IC4METHOD = 5 - Simple ki step function # # IC4METHOD = 6 - Simple ki step function via namelist # # IC4METHOD = 7 - Doble et al. (GRL 2015) # +# IC4METHOD = 8 - Meylan et al. (2018) ; Liu et al. (2020) # +# (NB: redundant with IC5+IC5VEMOD=3) # +# IC4METHOD = 9 - RYW (2021) ; Yu et al. (2022) # # IC5 = Choose from three different effective medium models # # IC5VEMOD = 1 - Extended Fox and Squire model (EFS) # # IC5VEMOD = 2 - Robinson and Palmer model (RP) # @@ -170,7 +173,8 @@ # updated: Erick Rogers, Apr 2016 # # updated: Jessica Meixner, May 2016 # # updated: Qingxiang Liu, Jul 2018 # -# last updated: Qingxiang Liu, May 2021 # +# updated: Qingxiang Liu, May 2021 # +# last updated: Erick Rogers, Jan 2024 # # Copyright 2009-2014 National Weather Service (NWS), # # National Oceanic and Atmospheric Administration. All rights # # reserved. WAVEWATCH III is a trademark of the NWS. # diff --git a/regtests/ww3_tic1.1/input_IC4_M8/namelists_1-D.nml b/regtests/ww3_tic1.1/input_IC4_M8/namelists_1-D.nml new file mode 100644 index 000000000..281a0b12f --- /dev/null +++ b/regtests/ww3_tic1.1/input_IC4_M8/namelists_1-D.nml @@ -0,0 +1,2 @@ +&SIC4 IC4METHOD = 8 / +END OF NAMELISTS diff --git a/regtests/ww3_tic1.1/input_IC4_M8/points.list b/regtests/ww3_tic1.1/input_IC4_M8/points.list new file mode 100644 index 000000000..e2a0afe3d --- /dev/null +++ b/regtests/ww3_tic1.1/input_IC4_M8/points.list @@ -0,0 +1,16 @@ +0.00 0. 'Point 1 ' +1.00E3 0. 'Point 2 ' +2.00E3 0. 'Point 3 ' +3.00E3 0. 'Point 4 ' +4.00E3 0. 'Point 5 ' +5.00E3 0. 'Point 6 ' +6.00E3 0. 'Point 7 ' +7.00E3 0. 'Point 8 ' +8.00E3 0. 'Point 9 ' +9.00E3 0. 'Point 10 ' +10.00E3 0. 'Point 11 ' +11.00E3 0. 'Point 12 ' +12.00E3 0. 'Point 13 ' +13.00E3 0. 'Point 14 ' +14.00E3 0. 'Point 15 ' +15.00E3 0. 'Point 16 ' diff --git a/regtests/ww3_tic1.1/input_IC4_M8/switch b/regtests/ww3_tic1.1/input_IC4_M8/switch new file mode 100644 index 000000000..31ef85bae --- /dev/null +++ b/regtests/ww3_tic1.1/input_IC4_M8/switch @@ -0,0 +1 @@ +NOGRB SHRD PR3 UQ FLX2 LN0 ST0 NL0 BT0 DB0 TR0 BS0 IC4 IS0 REF0 WNT1 WNX1 CRT1 CRX1 O0 O1 O2 O3 O4 O5 O6 O7 diff --git a/regtests/ww3_tic1.1/input_IC4_M8/ww3_grid.inp b/regtests/ww3_tic1.1/input_IC4_M8/ww3_grid.inp new file mode 100644 index 000000000..9356362ef --- /dev/null +++ b/regtests/ww3_tic1.1/input_IC4_M8/ww3_grid.inp @@ -0,0 +1,42 @@ +$ WAVEWATCH III Grid preprocessor input file +$ ------------------------------------------ + '1-D parameterized ice test ' +$ +$ 1.1 0.04118 25 24 0.0 + 1.1 0.0418 31 36 5.0 +$ + F T F F F T + 60. 60. 60. 60. +$ +$ IC4METHOD determines calculation +$ IC4METHOD = 1 - Wadhams et al. (1988) +$ IC4METHOD = 2 - Meylan et al. (2014) +$ IC4METHOD = 3 - Kohout & Meylan (2008) in Horvat & Tziperman (2015) +$ IC4METHOD = 4 - Kohout et al. (2014) +$ IC4METHOD = 5 - Simple ki step function +$ IC4METHOD = 6 - Simple ki step function via namelist +$ IC4METHOD = 7 - Doble et al. (GRL 2015) +$ IC4METHOD = 8 - Meylan et al. (2018) ; Liu et al. (2020) +$ IC4METHOD = 9 - RYW (2021) ; Yu et al. (2022) +$ IC4M8 Fit to R21A L ChfM2=0.059 + &SIC4 IC4METHOD = 8 , IC4CN = 0.059/ +END OF NAMELISTS +$ + 'RECT' F 'NONE' + 156 3 + 1.0E3 1.0E3 1. + -1.0E3 -1.0E3 1. +$ dlim dmin file# scale layout# format# formatdescrip filetype# filenm + -0.1 0.1 401 -1.0 1 1 '(....)' 'NAME' '../input_IC1/depth1d.flat' +$ + 10 1 1 '(....)' 'PART' 'input' +$ +$ First grid +$ + 2 2 F +$ + 0 0 F + 0 0 F + 0 0 +$ + 0. 0. 0. 0. 0 diff --git a/regtests/ww3_tic1.1/input_IC4_M8/ww3_grid.nml b/regtests/ww3_tic1.1/input_IC4_M8/ww3_grid.nml new file mode 100644 index 000000000..87d4e3845 --- /dev/null +++ b/regtests/ww3_tic1.1/input_IC4_M8/ww3_grid.nml @@ -0,0 +1,81 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III - ww3_grid.nml - Grid pre-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the spectrum parameterization via SPECTRUM_NML namelist +! -------------------------------------------------------------------- ! +&SPECTRUM_NML + SPECTRUM%XFR = 1.1 + SPECTRUM%FREQ1 = 0.0418 + SPECTRUM%NK = 31 + SPECTRUM%NTH = 36 + SPECTRUM%THOFF = 5.0 +/ + +! -------------------------------------------------------------------- ! +! Define the run parameterization via RUN_NML namelist +! -------------------------------------------------------------------- ! +&RUN_NML + RUN%FLCX = T + RUN%FLSOU = T +/ + +! -------------------------------------------------------------------- ! +! Define the timesteps parameterization via TIMESTEPS_NML namelist +! -------------------------------------------------------------------- ! +&TIMESTEPS_NML + TIMESTEPS%DTMAX = 60. + TIMESTEPS%DTXY = 60. + TIMESTEPS%DTKTH = 60. + TIMESTEPS%DTMIN = 60. +/ + +! -------------------------------------------------------------------- ! +! Define the grid to preprocess via GRID_NML namelist +! -------------------------------------------------------------------- ! +&GRID_NML + GRID%NAME = '1-D parameterized ice test' + GRID%NML = '../input_IC4_M8/namelists_1-D.nml' + GRID%TYPE = 'RECT' + GRID%COORD = 'CART' + GRID%CLOS = 'NONE' + GRID%ZLIM = -0.1 + GRID%DMIN = 0.1 +/ + +! -------------------------------------------------------------------- ! +! Define the rectilinear grid type via RECT_NML namelist +! -------------------------------------------------------------------- ! +&RECT_NML + RECT%NX = 156 + RECT%NY = 3 + RECT%SX = 1.0E3 + RECT%SY = 1.0E3 + RECT%X0 = -1.0E3 + RECT%Y0 = -1.0E3 +/ + +! -------------------------------------------------------------------- ! +! Define the depth to preprocess via DEPTH_NML namelist +! -------------------------------------------------------------------- ! +&DEPTH_NML + DEPTH%SF = -1.0 + DEPTH%FILENAME = '../input_IC1/depth1d.flat' +/ + +! -------------------------------------------------------------------- ! +! Define the input boundary points via INBND_COUNT_NML and +! INBND_POINT_NML namelist +! -------------------------------------------------------------------- ! +&INBND_COUNT_NML + INBND_COUNT%N_POINT = 1 +/ + +&INBND_POINT_NML + INBND_POINT(1) = 2 2 F +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_tic1.1/input_IC4_M8/ww3_ounf.inp b/regtests/ww3_tic1.1/input_IC4_M8/ww3_ounf.inp new file mode 100644 index 000000000..4104d759e --- /dev/null +++ b/regtests/ww3_tic1.1/input_IC4_M8/ww3_ounf.inp @@ -0,0 +1,20 @@ +$ WAVEWATCH III Grid output post-processing (netcdf) +$--------------------------------------------------- + 19680606 000000 3600. 99 +N +$ Options: DPT CUR WND DT WLV ICE HS L T02 T01 TM1 FP DIR SPR DP EF +$ TH1M STH1M PHS PTP PLP PDIR PSP WSF TWS PNR UST CHA CGE FAW +$ TAW TWA WCC WCF WCH WCM SXY TWO BHD FOC TUS USS P2S WN USF +$ P2L ABR UBR BED FBB TBB MSS MSC DTD FCT CFX CFT CFK US1 US2 +DPT WLV HS DIR +$ + 3 4 + 0 1 2 + F + ww3. + 4 + 1 999 1 999 3 2 +$ +$ -------------------------------------------------------------------- $ +$ End of input file $ +$ -------------------------------------------------------------------- $ diff --git a/regtests/ww3_tic1.1/input_IC4_M8/ww3_ounf.nml b/regtests/ww3_tic1.1/input_IC4_M8/ww3_ounf.nml new file mode 100644 index 000000000..46aa758fa --- /dev/null +++ b/regtests/ww3_tic1.1/input_IC4_M8/ww3_ounf.nml @@ -0,0 +1,29 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III ww3_ounf.nml - Grid output post-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the output fields to postprocess via FIELD_NML namelist +! -------------------------------------------------------------------- ! +&FIELD_NML + FIELD%TIMESTART = '19680606 000000' + FIELD%TIMESTRIDE = '3600.' + FIELD%TIMECOUNT = '99' + FIELD%TIMESPLIT = 4 + FIELD%LIST = 'DPT WLV HS DIR' + FIELD%PARTITION = '0 1 2' + FIELD%SAMEFILE = F + FIELD%TYPE = 4 +/ + +! -------------------------------------------------------------------- ! +! Define the content of the output file via FILE_NML namelist +! -------------------------------------------------------------------- ! +&FILE_NML + FILE%IXN = 999 + FILE%IYN = 999 +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_tic1.1/input_IC4_M8/ww3_outf.inp b/regtests/ww3_tic1.1/input_IC4_M8/ww3_outf.inp new file mode 100644 index 000000000..2b4c6bca8 --- /dev/null +++ b/regtests/ww3_tic1.1/input_IC4_M8/ww3_outf.inp @@ -0,0 +1,13 @@ +$ WAVEWATCH III Grid output post-processing +$ ----------------------------------------- + 19680606 000000 3600. 99 +N +$ Options: DPT CUR WND DT WLV ICE HS L T02 T01 TM1 FP DIR SPR DP EF +$ TH1M STH1M PHS PTP PLP PDIR PSP WSF TWS PNR UST CHA CGE FAW +$ TAW TWA WCC WCF WCH WCM SXY TWO BHD FOC TUS USS P2S WN USF +$ P2L ABR UBR BED FBB TBB MSS MSC DTD FCT CFX CFT CFK US1 US2 +DPT WLV HS DIR +$ + 3 0 +$ + 1 999 1 999 1 1 diff --git a/regtests/ww3_tic1.1/input_IC4_M8/ww3_outp_spec.inp b/regtests/ww3_tic1.1/input_IC4_M8/ww3_outp_spec.inp new file mode 100644 index 000000000..b500e0ca4 --- /dev/null +++ b/regtests/ww3_tic1.1/input_IC4_M8/ww3_outp_spec.inp @@ -0,0 +1,19 @@ +$ WAVEWATCH III Point output post-processing +$ ------------------------------------------ + 19680606 120000 3600. 1 +$ + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + -1 +$ + 1 + 2 -1. 0. 33 F diff --git a/regtests/ww3_tic1.1/input_IC4_M8/ww3_outp_tab50.inp b/regtests/ww3_tic1.1/input_IC4_M8/ww3_outp_tab50.inp new file mode 100644 index 000000000..826bd422d --- /dev/null +++ b/regtests/ww3_tic1.1/input_IC4_M8/ww3_outp_tab50.inp @@ -0,0 +1,19 @@ +$ WAVEWATCH III Point output post-processing +$ ------------------------------------------ + 19680606 000000 600. 9999 +$ + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + -1 +$ + 2 + 2 50 diff --git a/regtests/ww3_tic1.1/input_IC4_M8/ww3_outp_tab51.inp b/regtests/ww3_tic1.1/input_IC4_M8/ww3_outp_tab51.inp new file mode 100644 index 000000000..e54faed46 --- /dev/null +++ b/regtests/ww3_tic1.1/input_IC4_M8/ww3_outp_tab51.inp @@ -0,0 +1,10 @@ +$ WAVEWATCH III Point output post-processing +$ ------------------------------------------ + 19680606 000000 900. 49 +$ +$ 1 + 11 + -1 +$ + 2 + 2 51 diff --git a/regtests/ww3_tic1.1/input_IC4_M8/ww3_prep_icecon.inp b/regtests/ww3_tic1.1/input_IC4_M8/ww3_prep_icecon.inp new file mode 100644 index 000000000..26a94221f --- /dev/null +++ b/regtests/ww3_tic1.1/input_IC4_M8/ww3_prep_icecon.inp @@ -0,0 +1,38 @@ +$ -------------------------------------------------------------------- $ +$ WAVEWATCH III Field preprocessor input file $ +$ -------------------------------------------------------------------- $ +$ Mayor types of field and time flag +$ Field types : IC1, IC2, IC3, IC4, IC5 => Ice parameters (5) +$ MDN => Mud densities +$ MTH => Mud thicknesses +$ MVS => Mud viscosities +$ ICE => Ice concentrations. +$ LEV => Water levels. +$ WND => Winds. +$ WNS => Winds (including air-sea temp. dif.) +$ CUR => Currents. +$ Format types : AI Transfer field 'as is'. +$ LL Field defined on longitude-latitude grid. +$ F1 Arbitrary grid, longitude and latitude of +$ each grid point given in separate file. +$ F2 Like F1, composite of 2 fields. +$ Time flag : If true, time is included in file. +$ Header flag : If true, write header on "*.ww3" data file +$ + 'ICE' 'AI' T T +$ +$ Additional time input ---------------------------------------------- $ +$ If time flag is .FALSE., give time of field in yyyymmdd hhmmss format. +$ +$ 19680606 000000 +$ +$ Define data files -------------------------------------------------- $ +$ The first input line identifies the file format with FROM, IDLA and +$ IDFM, the second (third) lines give the file unit number and name. +$ + 'NAME' 1 2 '(I10,1x,I10)' '(1000(F6.2))' + 2345 '../input_IC2_nondisp/icecon.156x3.txt' +$ +$ -------------------------------------------------------------------- $ +$ End of input file $ +$ -------------------------------------------------------------------- $ diff --git a/regtests/ww3_tic1.1/input_IC4_M8/ww3_shel.inp b/regtests/ww3_tic1.1/input_IC4_M8/ww3_shel.inp new file mode 100644 index 000000000..c496220ff --- /dev/null +++ b/regtests/ww3_tic1.1/input_IC4_M8/ww3_shel.inp @@ -0,0 +1,68 @@ +$ WAVEWATCH III shell input file +$ ------------------------------ + T T Ice parameter 1 + F F Ice parameter 2 + F F Ice parameter 3 + F F Ice parameter 4 + F F Ice parameter 5 + F F Mud parameter 1 + F F Mud parameter 2 + F F Mud parameter 3 + F F Water levels + F F Currents + F F Winds + T F Ice concentrations + F F Atmospheric momentum + F F Air density + F Assimilation data : Mean parameters + F Assimilation data : 1-D spectra + F Assimilation data : 2-D spectra. +$ + 19680606 000000 + 19680606 120000 +$ + 1 +$ + 19680606 000000 900 19680606 120000 +N +$ Options: DPT CUR WND DT WLV ICE HS L T02 T01 TM1 FP DIR SPR DP EF +$ TH1M STH1M PHS PTP PLP PDIR PSP WSF TWS PNR UST CHA CGE FAW +$ TAW TWA WCC WCF WCH WCM SXY TWO BHD FOC TUS USS P2S WN USF +$ P2L ABR UBR BED FBB TBB MSS MSC DTD FCT CFX CFT CFK US1 US2 +DPT HS ICE DIR EF + 19680606 000000 900 19680606 120000 + 0.00 0. 'Point 1 ' + 1.00E3 0. 'Point 2 ' + 2.00E3 0. 'Point 3 ' + 3.00E3 0. 'Point 4 ' + 4.00E3 0. 'Point 5 ' + 5.00E3 0. 'Point 6 ' + 6.00E3 0. 'Point 7 ' + 7.00E3 0. 'Point 8 ' + 8.00E3 0. 'Point 9 ' + 9.00E3 0. 'Point 10 ' + 10.00E3 0. 'Point 11 ' + 11.00E3 0. 'Point 12 ' + 12.00E3 0. 'Point 13 ' + 13.00E3 0. 'Point 14 ' + 14.00E3 0. 'Point 15 ' + 15.00E3 0. 'Point 16 ' + 0. 0. 'STOPSTRING' + 19680606 000000 0 19680606 120000 + 19680606 000000 0 19680606 120000 + 19680606 000000 0 19680606 120000 + 19680606 000000 0 19680606 120000 +$ +$ Testing of output through parameter list (C/TPAR) ------------------ $ +$ Time for output and field flags as in above output type 1. +$ +$ 19680606 014500 +$ T T T T T T T T T T T T T T T T +$ +$ Homogeneous field data --------------------------------------------- $ +$ constant case: + 'IC1' 19680606 000000 0.2 +$ 'IC1' 19680606 000000 2.00 + 'STP' +$ +$ -------------------------------------------------------------------- $ diff --git a/regtests/ww3_tic1.1/input_IC4_M8/ww3_strt.inp b/regtests/ww3_tic1.1/input_IC4_M8/ww3_strt.inp new file mode 100644 index 000000000..49747e41a --- /dev/null +++ b/regtests/ww3_tic1.1/input_IC4_M8/ww3_strt.inp @@ -0,0 +1,17 @@ +$ WAVEWATCH III Initial conditions input file +$ ------------------------------------------- + 2 +$ 0.1 0.0001 225. 12 0. -5.E3 0. 5.E3 1.0 +$ 0.1 0.0001 315. 12 0. -5.E3 0. 5.E3 1.0 +$ 0.1 0.0001 240. 2 0. -5.E3 0. 5.E3 1.0 +$ fp sip thm ncos xm six ym siy hmax +$ 0.1 0.0001 270. 12 0. -5.E3 0. 5.E3 1.0 +$ 0.1 0.0001 270. 2 0. -5.E3 0. 5.E3 1.0 +$ 0.1 0.0001 300. 2 0. -5.E3 0. 5.E3 1.0 +$ 0.1 0.0001 135. 12 50.E3 -5.E3 0. 5.E3 1.0 +$ 0.1 0.0001 45. 12 50.E3 -5.E3 0. 5.E3 1.0 +$ 0.1 0.0001 120. 2 50.E3 -5.E3 0. 5.E3 1.0 +$ 0.1 0.0001 60. 2 50.E3 -5.E3 0. 5.E3 1.0 +$ +$ alpha fp thm gamma sigA sigB xm six ym siy + 0.0081 0.1 270.0 1.0 0.07 0.09 0. -5.E3 0. 5.E3 diff --git a/regtests/ww3_tic1.1/input_IC4_M9/namelists_1-D.nml b/regtests/ww3_tic1.1/input_IC4_M9/namelists_1-D.nml new file mode 100644 index 000000000..3c6dc824d --- /dev/null +++ b/regtests/ww3_tic1.1/input_IC4_M9/namelists_1-D.nml @@ -0,0 +1,2 @@ +&SIC4 IC4METHOD = 9 / +END OF NAMELISTS diff --git a/regtests/ww3_tic1.1/input_IC4_M9/points.list b/regtests/ww3_tic1.1/input_IC4_M9/points.list new file mode 100644 index 000000000..e2a0afe3d --- /dev/null +++ b/regtests/ww3_tic1.1/input_IC4_M9/points.list @@ -0,0 +1,16 @@ +0.00 0. 'Point 1 ' +1.00E3 0. 'Point 2 ' +2.00E3 0. 'Point 3 ' +3.00E3 0. 'Point 4 ' +4.00E3 0. 'Point 5 ' +5.00E3 0. 'Point 6 ' +6.00E3 0. 'Point 7 ' +7.00E3 0. 'Point 8 ' +8.00E3 0. 'Point 9 ' +9.00E3 0. 'Point 10 ' +10.00E3 0. 'Point 11 ' +11.00E3 0. 'Point 12 ' +12.00E3 0. 'Point 13 ' +13.00E3 0. 'Point 14 ' +14.00E3 0. 'Point 15 ' +15.00E3 0. 'Point 16 ' diff --git a/regtests/ww3_tic1.1/input_IC4_M9/switch b/regtests/ww3_tic1.1/input_IC4_M9/switch new file mode 100644 index 000000000..31ef85bae --- /dev/null +++ b/regtests/ww3_tic1.1/input_IC4_M9/switch @@ -0,0 +1 @@ +NOGRB SHRD PR3 UQ FLX2 LN0 ST0 NL0 BT0 DB0 TR0 BS0 IC4 IS0 REF0 WNT1 WNX1 CRT1 CRX1 O0 O1 O2 O3 O4 O5 O6 O7 diff --git a/regtests/ww3_tic1.1/input_IC4_M9/ww3_grid.inp b/regtests/ww3_tic1.1/input_IC4_M9/ww3_grid.inp new file mode 100644 index 000000000..201517305 --- /dev/null +++ b/regtests/ww3_tic1.1/input_IC4_M9/ww3_grid.inp @@ -0,0 +1,42 @@ +$ WAVEWATCH III Grid preprocessor input file +$ ------------------------------------------ + '1-D parameterized ice test ' +$ +$ 1.1 0.04118 25 24 0.0 + 1.1 0.0418 31 36 5.0 +$ + F T F F F T + 60. 60. 60. 60. +$ +$ IC4METHOD determines calculation +$ IC4METHOD = 1 - Wadhams et al. (1988) +$ IC4METHOD = 2 - Meylan et al. (2014) +$ IC4METHOD = 3 - Kohout & Meylan (2008) in Horvat & Tziperman (2015) +$ IC4METHOD = 4 - Kohout et al. (2014) +$ IC4METHOD = 5 - Simple ki step function +$ IC4METHOD = 6 - Simple ki step function via namelist +$ IC4METHOD = 7 - Doble et al. (GRL 2015) +$ IC4METHOD = 8 - Meylan et al. (2018) ; Liu et al. (2020) +$ IC4METHOD = 9 - RYW (2021) ; Yu et al. (2022) +$ IC4M9 Fit to R21A Chf=2.9 and n=4.5 + &SIC4 IC4METHOD = 9 , IC4CN = 2.9, 4.5/ +END OF NAMELISTS +$ + 'RECT' F 'NONE' + 156 3 + 1.0E3 1.0E3 1. + -1.0E3 -1.0E3 1. +$ dlim dmin file# scale layout# format# formatdescrip filetype# filenm + -0.1 0.1 401 -1.0 1 1 '(....)' 'NAME' '../input_IC1/depth1d.flat' +$ + 10 1 1 '(....)' 'PART' 'input' +$ +$ First grid +$ + 2 2 F +$ + 0 0 F + 0 0 F + 0 0 +$ + 0. 0. 0. 0. 0 diff --git a/regtests/ww3_tic1.1/input_IC4_M9/ww3_grid.nml b/regtests/ww3_tic1.1/input_IC4_M9/ww3_grid.nml new file mode 100644 index 000000000..071761155 --- /dev/null +++ b/regtests/ww3_tic1.1/input_IC4_M9/ww3_grid.nml @@ -0,0 +1,81 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III - ww3_grid.nml - Grid pre-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the spectrum parameterization via SPECTRUM_NML namelist +! -------------------------------------------------------------------- ! +&SPECTRUM_NML + SPECTRUM%XFR = 1.1 + SPECTRUM%FREQ1 = 0.0418 + SPECTRUM%NK = 31 + SPECTRUM%NTH = 36 + SPECTRUM%THOFF = 5.0 +/ + +! -------------------------------------------------------------------- ! +! Define the run parameterization via RUN_NML namelist +! -------------------------------------------------------------------- ! +&RUN_NML + RUN%FLCX = T + RUN%FLSOU = T +/ + +! -------------------------------------------------------------------- ! +! Define the timesteps parameterization via TIMESTEPS_NML namelist +! -------------------------------------------------------------------- ! +&TIMESTEPS_NML + TIMESTEPS%DTMAX = 60. + TIMESTEPS%DTXY = 60. + TIMESTEPS%DTKTH = 60. + TIMESTEPS%DTMIN = 60. +/ + +! -------------------------------------------------------------------- ! +! Define the grid to preprocess via GRID_NML namelist +! -------------------------------------------------------------------- ! +&GRID_NML + GRID%NAME = '1-D parameterized ice test' + GRID%NML = '../input_IC4_M9/namelists_1-D.nml' + GRID%TYPE = 'RECT' + GRID%COORD = 'CART' + GRID%CLOS = 'NONE' + GRID%ZLIM = -0.1 + GRID%DMIN = 0.1 +/ + +! -------------------------------------------------------------------- ! +! Define the rectilinear grid type via RECT_NML namelist +! -------------------------------------------------------------------- ! +&RECT_NML + RECT%NX = 156 + RECT%NY = 3 + RECT%SX = 1.0E3 + RECT%SY = 1.0E3 + RECT%X0 = -1.0E3 + RECT%Y0 = -1.0E3 +/ + +! -------------------------------------------------------------------- ! +! Define the depth to preprocess via DEPTH_NML namelist +! -------------------------------------------------------------------- ! +&DEPTH_NML + DEPTH%SF = -1.0 + DEPTH%FILENAME = '../input_IC1/depth1d.flat' +/ + +! -------------------------------------------------------------------- ! +! Define the input boundary points via INBND_COUNT_NML and +! INBND_POINT_NML namelist +! -------------------------------------------------------------------- ! +&INBND_COUNT_NML + INBND_COUNT%N_POINT = 1 +/ + +&INBND_POINT_NML + INBND_POINT(1) = 2 2 F +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_tic1.1/input_IC4_M9/ww3_ounf.inp b/regtests/ww3_tic1.1/input_IC4_M9/ww3_ounf.inp new file mode 100644 index 000000000..4104d759e --- /dev/null +++ b/regtests/ww3_tic1.1/input_IC4_M9/ww3_ounf.inp @@ -0,0 +1,20 @@ +$ WAVEWATCH III Grid output post-processing (netcdf) +$--------------------------------------------------- + 19680606 000000 3600. 99 +N +$ Options: DPT CUR WND DT WLV ICE HS L T02 T01 TM1 FP DIR SPR DP EF +$ TH1M STH1M PHS PTP PLP PDIR PSP WSF TWS PNR UST CHA CGE FAW +$ TAW TWA WCC WCF WCH WCM SXY TWO BHD FOC TUS USS P2S WN USF +$ P2L ABR UBR BED FBB TBB MSS MSC DTD FCT CFX CFT CFK US1 US2 +DPT WLV HS DIR +$ + 3 4 + 0 1 2 + F + ww3. + 4 + 1 999 1 999 3 2 +$ +$ -------------------------------------------------------------------- $ +$ End of input file $ +$ -------------------------------------------------------------------- $ diff --git a/regtests/ww3_tic1.1/input_IC4_M9/ww3_ounf.nml b/regtests/ww3_tic1.1/input_IC4_M9/ww3_ounf.nml new file mode 100644 index 000000000..46aa758fa --- /dev/null +++ b/regtests/ww3_tic1.1/input_IC4_M9/ww3_ounf.nml @@ -0,0 +1,29 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III ww3_ounf.nml - Grid output post-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the output fields to postprocess via FIELD_NML namelist +! -------------------------------------------------------------------- ! +&FIELD_NML + FIELD%TIMESTART = '19680606 000000' + FIELD%TIMESTRIDE = '3600.' + FIELD%TIMECOUNT = '99' + FIELD%TIMESPLIT = 4 + FIELD%LIST = 'DPT WLV HS DIR' + FIELD%PARTITION = '0 1 2' + FIELD%SAMEFILE = F + FIELD%TYPE = 4 +/ + +! -------------------------------------------------------------------- ! +! Define the content of the output file via FILE_NML namelist +! -------------------------------------------------------------------- ! +&FILE_NML + FILE%IXN = 999 + FILE%IYN = 999 +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_tic1.1/input_IC4_M9/ww3_outf.inp b/regtests/ww3_tic1.1/input_IC4_M9/ww3_outf.inp new file mode 100644 index 000000000..2b4c6bca8 --- /dev/null +++ b/regtests/ww3_tic1.1/input_IC4_M9/ww3_outf.inp @@ -0,0 +1,13 @@ +$ WAVEWATCH III Grid output post-processing +$ ----------------------------------------- + 19680606 000000 3600. 99 +N +$ Options: DPT CUR WND DT WLV ICE HS L T02 T01 TM1 FP DIR SPR DP EF +$ TH1M STH1M PHS PTP PLP PDIR PSP WSF TWS PNR UST CHA CGE FAW +$ TAW TWA WCC WCF WCH WCM SXY TWO BHD FOC TUS USS P2S WN USF +$ P2L ABR UBR BED FBB TBB MSS MSC DTD FCT CFX CFT CFK US1 US2 +DPT WLV HS DIR +$ + 3 0 +$ + 1 999 1 999 1 1 diff --git a/regtests/ww3_tic1.1/input_IC4_M9/ww3_outp_spec.inp b/regtests/ww3_tic1.1/input_IC4_M9/ww3_outp_spec.inp new file mode 100644 index 000000000..b500e0ca4 --- /dev/null +++ b/regtests/ww3_tic1.1/input_IC4_M9/ww3_outp_spec.inp @@ -0,0 +1,19 @@ +$ WAVEWATCH III Point output post-processing +$ ------------------------------------------ + 19680606 120000 3600. 1 +$ + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + -1 +$ + 1 + 2 -1. 0. 33 F diff --git a/regtests/ww3_tic1.1/input_IC4_M9/ww3_outp_tab50.inp b/regtests/ww3_tic1.1/input_IC4_M9/ww3_outp_tab50.inp new file mode 100644 index 000000000..826bd422d --- /dev/null +++ b/regtests/ww3_tic1.1/input_IC4_M9/ww3_outp_tab50.inp @@ -0,0 +1,19 @@ +$ WAVEWATCH III Point output post-processing +$ ------------------------------------------ + 19680606 000000 600. 9999 +$ + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + -1 +$ + 2 + 2 50 diff --git a/regtests/ww3_tic1.1/input_IC4_M9/ww3_outp_tab51.inp b/regtests/ww3_tic1.1/input_IC4_M9/ww3_outp_tab51.inp new file mode 100644 index 000000000..e54faed46 --- /dev/null +++ b/regtests/ww3_tic1.1/input_IC4_M9/ww3_outp_tab51.inp @@ -0,0 +1,10 @@ +$ WAVEWATCH III Point output post-processing +$ ------------------------------------------ + 19680606 000000 900. 49 +$ +$ 1 + 11 + -1 +$ + 2 + 2 51 diff --git a/regtests/ww3_tic1.1/input_IC4_M9/ww3_prep_icecon.inp b/regtests/ww3_tic1.1/input_IC4_M9/ww3_prep_icecon.inp new file mode 100644 index 000000000..26a94221f --- /dev/null +++ b/regtests/ww3_tic1.1/input_IC4_M9/ww3_prep_icecon.inp @@ -0,0 +1,38 @@ +$ -------------------------------------------------------------------- $ +$ WAVEWATCH III Field preprocessor input file $ +$ -------------------------------------------------------------------- $ +$ Mayor types of field and time flag +$ Field types : IC1, IC2, IC3, IC4, IC5 => Ice parameters (5) +$ MDN => Mud densities +$ MTH => Mud thicknesses +$ MVS => Mud viscosities +$ ICE => Ice concentrations. +$ LEV => Water levels. +$ WND => Winds. +$ WNS => Winds (including air-sea temp. dif.) +$ CUR => Currents. +$ Format types : AI Transfer field 'as is'. +$ LL Field defined on longitude-latitude grid. +$ F1 Arbitrary grid, longitude and latitude of +$ each grid point given in separate file. +$ F2 Like F1, composite of 2 fields. +$ Time flag : If true, time is included in file. +$ Header flag : If true, write header on "*.ww3" data file +$ + 'ICE' 'AI' T T +$ +$ Additional time input ---------------------------------------------- $ +$ If time flag is .FALSE., give time of field in yyyymmdd hhmmss format. +$ +$ 19680606 000000 +$ +$ Define data files -------------------------------------------------- $ +$ The first input line identifies the file format with FROM, IDLA and +$ IDFM, the second (third) lines give the file unit number and name. +$ + 'NAME' 1 2 '(I10,1x,I10)' '(1000(F6.2))' + 2345 '../input_IC2_nondisp/icecon.156x3.txt' +$ +$ -------------------------------------------------------------------- $ +$ End of input file $ +$ -------------------------------------------------------------------- $ diff --git a/regtests/ww3_tic1.1/input_IC4_M9/ww3_shel.inp b/regtests/ww3_tic1.1/input_IC4_M9/ww3_shel.inp new file mode 100644 index 000000000..c496220ff --- /dev/null +++ b/regtests/ww3_tic1.1/input_IC4_M9/ww3_shel.inp @@ -0,0 +1,68 @@ +$ WAVEWATCH III shell input file +$ ------------------------------ + T T Ice parameter 1 + F F Ice parameter 2 + F F Ice parameter 3 + F F Ice parameter 4 + F F Ice parameter 5 + F F Mud parameter 1 + F F Mud parameter 2 + F F Mud parameter 3 + F F Water levels + F F Currents + F F Winds + T F Ice concentrations + F F Atmospheric momentum + F F Air density + F Assimilation data : Mean parameters + F Assimilation data : 1-D spectra + F Assimilation data : 2-D spectra. +$ + 19680606 000000 + 19680606 120000 +$ + 1 +$ + 19680606 000000 900 19680606 120000 +N +$ Options: DPT CUR WND DT WLV ICE HS L T02 T01 TM1 FP DIR SPR DP EF +$ TH1M STH1M PHS PTP PLP PDIR PSP WSF TWS PNR UST CHA CGE FAW +$ TAW TWA WCC WCF WCH WCM SXY TWO BHD FOC TUS USS P2S WN USF +$ P2L ABR UBR BED FBB TBB MSS MSC DTD FCT CFX CFT CFK US1 US2 +DPT HS ICE DIR EF + 19680606 000000 900 19680606 120000 + 0.00 0. 'Point 1 ' + 1.00E3 0. 'Point 2 ' + 2.00E3 0. 'Point 3 ' + 3.00E3 0. 'Point 4 ' + 4.00E3 0. 'Point 5 ' + 5.00E3 0. 'Point 6 ' + 6.00E3 0. 'Point 7 ' + 7.00E3 0. 'Point 8 ' + 8.00E3 0. 'Point 9 ' + 9.00E3 0. 'Point 10 ' + 10.00E3 0. 'Point 11 ' + 11.00E3 0. 'Point 12 ' + 12.00E3 0. 'Point 13 ' + 13.00E3 0. 'Point 14 ' + 14.00E3 0. 'Point 15 ' + 15.00E3 0. 'Point 16 ' + 0. 0. 'STOPSTRING' + 19680606 000000 0 19680606 120000 + 19680606 000000 0 19680606 120000 + 19680606 000000 0 19680606 120000 + 19680606 000000 0 19680606 120000 +$ +$ Testing of output through parameter list (C/TPAR) ------------------ $ +$ Time for output and field flags as in above output type 1. +$ +$ 19680606 014500 +$ T T T T T T T T T T T T T T T T +$ +$ Homogeneous field data --------------------------------------------- $ +$ constant case: + 'IC1' 19680606 000000 0.2 +$ 'IC1' 19680606 000000 2.00 + 'STP' +$ +$ -------------------------------------------------------------------- $ diff --git a/regtests/ww3_tic1.1/input_IC4_M9/ww3_strt.inp b/regtests/ww3_tic1.1/input_IC4_M9/ww3_strt.inp new file mode 100644 index 000000000..49747e41a --- /dev/null +++ b/regtests/ww3_tic1.1/input_IC4_M9/ww3_strt.inp @@ -0,0 +1,17 @@ +$ WAVEWATCH III Initial conditions input file +$ ------------------------------------------- + 2 +$ 0.1 0.0001 225. 12 0. -5.E3 0. 5.E3 1.0 +$ 0.1 0.0001 315. 12 0. -5.E3 0. 5.E3 1.0 +$ 0.1 0.0001 240. 2 0. -5.E3 0. 5.E3 1.0 +$ fp sip thm ncos xm six ym siy hmax +$ 0.1 0.0001 270. 12 0. -5.E3 0. 5.E3 1.0 +$ 0.1 0.0001 270. 2 0. -5.E3 0. 5.E3 1.0 +$ 0.1 0.0001 300. 2 0. -5.E3 0. 5.E3 1.0 +$ 0.1 0.0001 135. 12 50.E3 -5.E3 0. 5.E3 1.0 +$ 0.1 0.0001 45. 12 50.E3 -5.E3 0. 5.E3 1.0 +$ 0.1 0.0001 120. 2 50.E3 -5.E3 0. 5.E3 1.0 +$ 0.1 0.0001 60. 2 50.E3 -5.E3 0. 5.E3 1.0 +$ +$ alpha fp thm gamma sigA sigB xm six ym siy + 0.0081 0.1 270.0 1.0 0.07 0.09 0. -5.E3 0. 5.E3 diff --git a/regtests/ww3_tp2.12/info b/regtests/ww3_tp2.12/info index e39ade75b..622e6f523 100644 --- a/regtests/ww3_tp2.12/info +++ b/regtests/ww3_tp2.12/info @@ -29,7 +29,7 @@ # * ww3_grid.inp (dummy grid input file, with assoc .bot, .mask, .obst) # # * partition.ww3 (raw fields of partition data, 4 time steps) # # * ww3_systrk.inp (instruction file) # -# * ww3_systrk will ABORT if endianess is incompatible with binary file! # +# * ww3_systrk will stop if endianess is incompatible with binary file! # # # # Sample run_test commands : # # (Note: mpirun commands differ by local system) # diff --git a/regtests/ww3_tp2.15/input_rho/ww3_ounf.inp b/regtests/ww3_tp2.15/input_rho/ww3_ounf.inp index 9e9b2c300..564610663 100644 --- a/regtests/ww3_tp2.15/input_rho/ww3_ounf.inp +++ b/regtests/ww3_tp2.15/input_rho/ww3_ounf.inp @@ -3,7 +3,7 @@ $ ----------------------------------------- 20140309 000000 900. 9999 $ N -HS WND RHO TAU T02 DP DIR FP MXE MXES MXH MXHC SDMH SDMHC +HS WND RHO TAU T02 DP DIR FP MXE MXES MXH MXHC SDMH SDMHC QP QKK $ $ 3 4 diff --git a/regtests/ww3_tp2.15/input_rho/ww3_ounf.nml b/regtests/ww3_tp2.15/input_rho/ww3_ounf.nml index 848d2ec92..d4e8c9151 100644 --- a/regtests/ww3_tp2.15/input_rho/ww3_ounf.nml +++ b/regtests/ww3_tp2.15/input_rho/ww3_ounf.nml @@ -9,7 +9,7 @@ FIELD%TIMESTART = '20140309 000000' FIELD%TIMESTRIDE = '900.' FIELD%TIMECOUNT = '9999' - FIELD%LIST = 'HS WND RHO TAU T02 DP DIR FP MXE MXES MXH MXHC SDMH SDMHC' + FIELD%LIST = 'HS WND RHO TAU T02 DP DIR FP MXE MXES MXH MXHC SDMH SDMHC QP QKK' FIELD%PARTITION = '0 1 2' FIELD%TYPE = 4 / diff --git a/regtests/ww3_tp2.15/input_rho/ww3_outf.inp b/regtests/ww3_tp2.15/input_rho/ww3_outf.inp index 666f36966..05e04c291 100644 --- a/regtests/ww3_tp2.15/input_rho/ww3_outf.inp +++ b/regtests/ww3_tp2.15/input_rho/ww3_outf.inp @@ -3,7 +3,7 @@ $ ----------------------------------------- 20140309 000000 3600. 37 $ N -HS DIR DP T02 FP STMAXE STMAXD HMAXE HCMAXE HMAXD HCMAXD +HS DIR DP T02 FP STMAXE STMAXD HMAXE HCMAXE HMAXD HCMAXD QP QKK $ 3 0 1 43 1 42 1 1 diff --git a/regtests/ww3_tp2.15/input_rho/ww3_shel.inp b/regtests/ww3_tp2.15/input_rho/ww3_shel.inp index c436305e8..ce4d90011 100644 --- a/regtests/ww3_tp2.15/input_rho/ww3_shel.inp +++ b/regtests/ww3_tp2.15/input_rho/ww3_shel.inp @@ -31,7 +31,7 @@ $ A A W C C C C B B E B B X W O U S S S 2 S S $ W W A C F H M R R D B B Y O C S S S C S 1 2 $ --------------------------------------------------------------- N - HS WND RHO TAU T02 DP DIR FP MXE MXES MXH MXHC SDMH SDMHC + HS WND RHO TAU T02 DP DIR FP MXE MXES MXH MXHC SDMH SDMHC QP QKK 20140310 000000 3600 20140310 060000 12.5088 45.3138 'AA ' 0.0 0.0 'STOPSTRING' diff --git a/regtests/ww3_tp2.15/input_rho/ww3_shel.nml b/regtests/ww3_tp2.15/input_rho/ww3_shel.nml index 5fb0fd0a2..fc0277a12 100644 --- a/regtests/ww3_tp2.15/input_rho/ww3_shel.nml +++ b/regtests/ww3_tp2.15/input_rho/ww3_shel.nml @@ -24,7 +24,7 @@ ! Define the output types point parameters via OUTPUT_TYPE_NML namelist ! -------------------------------------------------------------------- ! &OUTPUT_TYPE_NML - TYPE%FIELD%LIST = 'HS WND RHO TAU T02 DP DIR FP MXE MXES MXH MXHC SDMH SDMHC' + TYPE%FIELD%LIST = 'HS WND RHO TAU T02 DP DIR FP MXE MXES MXH MXHC SDMH SDMHC QP QKK' TYPE%POINT%FILE = '../input_rho/points.list' / diff --git a/regtests/ww3_tp2.19/input_Case1A/switch_PDLIB b/regtests/ww3_tp2.19/input_Case1A/switch_PDLIB index 173947fdd..0ffd8565f 100644 --- a/regtests/ww3_tp2.19/input_Case1A/switch_PDLIB +++ b/regtests/ww3_tp2.19/input_Case1A/switch_PDLIB @@ -1 +1 @@ -F90 PDLIB METIS NOGRB NC4 DIST MPI PR3 UQ FLX0 LN0 ST0 NL0 BT0 DB1 TR1 BS0 IC0 IS0 REF0 XX0 WNT1 WNX1 CRT1 CRX1 SEC1 O0 O1 O2 O3 O4 O5 O6 O7 + PDLIB METIS NOGRB DIST MPI PR3 UQ FLX0 LN0 ST0 NL0 BT0 DB1 TR1 BS0 IC0 IS0 REF0 WNT1 WNX1 CRT1 CRX1 SEC1 O0 O1 O2 O3 O4 O5 O6 O7 diff --git a/regtests/ww3_tp2.19/input_Case1B/switch_PDLIB b/regtests/ww3_tp2.19/input_Case1B/switch_PDLIB index 173947fdd..0ffd8565f 100644 --- a/regtests/ww3_tp2.19/input_Case1B/switch_PDLIB +++ b/regtests/ww3_tp2.19/input_Case1B/switch_PDLIB @@ -1 +1 @@ -F90 PDLIB METIS NOGRB NC4 DIST MPI PR3 UQ FLX0 LN0 ST0 NL0 BT0 DB1 TR1 BS0 IC0 IS0 REF0 XX0 WNT1 WNX1 CRT1 CRX1 SEC1 O0 O1 O2 O3 O4 O5 O6 O7 + PDLIB METIS NOGRB DIST MPI PR3 UQ FLX0 LN0 ST0 NL0 BT0 DB1 TR1 BS0 IC0 IS0 REF0 WNT1 WNX1 CRT1 CRX1 SEC1 O0 O1 O2 O3 O4 O5 O6 O7 diff --git a/regtests/ww3_tp2.19/input_Case1C/switch_PDLIB b/regtests/ww3_tp2.19/input_Case1C/switch_PDLIB index ec5c35288..20fbedfed 100644 --- a/regtests/ww3_tp2.19/input_Case1C/switch_PDLIB +++ b/regtests/ww3_tp2.19/input_Case1C/switch_PDLIB @@ -1 +1 @@ -F90 PDLIB METIS NOGRB NC4 DIST MPI PR3 UQ FLX0 LN0 ST0 NL0 BT0 DB1 TR1 BS0 IC0 IS0 REF0 XX0 WNT1 WNX1 CRT1 CRX1 SEC1 O0 O1 O2 O3 O4 O5 O6 O7 + PDLIB METIS NOGRB DIST MPI PR3 UQ FLX0 LN0 ST0 NL0 BT0 DB1 TR1 BS0 IC0 IS0 REF0 WNT1 WNX1 CRT1 CRX1 SEC1 O0 O1 O2 O3 O4 O5 O6 O7 diff --git a/regtests/ww3_tp2.2/input/track_i.ww3 b/regtests/ww3_tp2.2/input/track_i.ww3 index ae2154a44..e4e7fbf61 100644 --- a/regtests/ww3_tp2.2/input/track_i.ww3 +++ b/regtests/ww3_tp2.2/input/track_i.ww3 @@ -1,6 +1,6 @@ WAVEWATCH III TRACK LOCATIONS DATA -19680606 000000 0 0 S1A -19680606 040000 1 0 S1B -19680606 060000 1 0 S1C -19680606 080000 2 0 S1D -19680606 120000 0.5 0 S1E +20220606 000000 0 0 S1A +20220606 040000 1 0 S1B +20220606 060000 1 0 S1C +20220606 080000 2 0 S1D +20220606 120000 0.5 0 S1E diff --git a/regtests/ww3_tp2.2/input/ww3_multi.inp b/regtests/ww3_tp2.2/input/ww3_multi.inp index 4d5d699e6..62f187b20 100644 --- a/regtests/ww3_tp2.2/input/ww3_multi.inp +++ b/regtests/ww3_tp2.2/input/ww3_multi.inp @@ -4,25 +4,25 @@ $ ------------------------------ $ 'ww3' 'no' 'no' 'no' 'no' 'no' 'no' 'no' 'no' 'no' 1 1 0.00 1.00 F $ - 19680606 000000 19680618 000000 + 20220606 000000 20220618 000000 $ T T $ - 19680606 000000 86400 19680618 000000 + 20220606 000000 86400 20220618 000000 $ N HS T0M1 DIR SPR $ - 19680606 000000 21600 19680618 000000 + 20220606 000000 21600 20220618 000000 0.0 0.0 'LEFT' 90.0 0.0 'CENTER' 180.0 0.0 'RIGHT' 0.0 0.0 'STOPSTRING' - 19680606 000000 3600 19680618 000000 + 20220606 000000 3600 20220618 000000 T - 19680612 000000 0 19680612 000000 - 19680606 000000 3600 19680618 000000 - 19680612 000000 0 19680612 000000 + 20220612 000000 0 20220612 000000 + 20220606 000000 3600 20220618 000000 + 20220612 000000 0 20220612 000000 $ 'the_end' 0 $ diff --git a/regtests/ww3_tp2.2/input/ww3_multi.nml b/regtests/ww3_tp2.2/input/ww3_multi.nml index 95c0f379c..6736ed229 100644 --- a/regtests/ww3_tp2.2/input/ww3_multi.nml +++ b/regtests/ww3_tp2.2/input/ww3_multi.nml @@ -9,7 +9,8 @@ &DOMAIN_NML DOMAIN%FLGHG1 = T DOMAIN%FLGHG2 = T - DOMAIN%STOP = '19680618 000000' + DOMAIN%START = '20220606 000000' + DOMAIN%STOP = '20220618 000000' / ! -------------------------------------------------------------------- ! @@ -37,10 +38,10 @@ ! Define output dates via OUTPUT_DATE_NML namelist ! -------------------------------------------------------------------- ! &OUTPUT_DATE_NML - ALLDATE%FIELD = '19680606 000000' '86400' '19680618 000000' - ALLDATE%POINT = '19680606 000000' '21600' '19680618 000000' - ALLDATE%TRACK = '19680606 000000' '3600' '19680618 000000' - ALLDATE%BOUNDARY = '19680606 000000' '3600' '19680618 000000' + ALLDATE%FIELD = '20220606 000000' '86400' '20220618 000000' + ALLDATE%POINT = '20220606 000000' '21600' '20220618 000000' + ALLDATE%TRACK = '20220606 000000' '3600' '20220618 000000' + ALLDATE%BOUNDARY = '20220606 000000' '3600' '20220618 000000' / ! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_tp2.2/input/ww3_ounf.inp b/regtests/ww3_tp2.2/input/ww3_ounf.inp index 1d901574c..120b78d3d 100644 --- a/regtests/ww3_tp2.2/input/ww3_ounf.inp +++ b/regtests/ww3_tp2.2/input/ww3_ounf.inp @@ -4,7 +4,7 @@ $--------------------------------------------------------------------- $ $ First output time (yyyymmdd hhmmss), increment of output (s), $ and number of output times. $ - 19680606 000000 10800. 100 + 20220606 000000 10800. 100 $ $ Fields requested --------------------------------------------------- $ $ diff --git a/regtests/ww3_tp2.2/input/ww3_ounf.nml b/regtests/ww3_tp2.2/input/ww3_ounf.nml index 44db63521..07dcdd2c2 100644 --- a/regtests/ww3_tp2.2/input/ww3_ounf.nml +++ b/regtests/ww3_tp2.2/input/ww3_ounf.nml @@ -6,7 +6,7 @@ ! Define the output fields to postprocess via FIELD_NML namelist ! -------------------------------------------------------------------- ! &FIELD_NML - FIELD%TIMESTART = '19680606 000000' + FIELD%TIMESTART = '20220606 000000' FIELD%TIMESTRIDE = '10800.' FIELD%TIMECOUNT = '100' FIELD%LIST = 'HS T01 DIR SPR' diff --git a/regtests/ww3_tp2.2/input/ww3_ounp.inp b/regtests/ww3_tp2.2/input/ww3_ounp.inp index 4816a3a7e..2c6a2f8d2 100644 --- a/regtests/ww3_tp2.2/input/ww3_ounp.inp +++ b/regtests/ww3_tp2.2/input/ww3_ounp.inp @@ -4,7 +4,7 @@ $--------------------------------------------------------------------- $ $ First output time (yyyymmdd hhmmss), increment of output (s), $ and number of output times. $ - 19680606 000000 21600. 1000 + 20220606 000000 21600. 1000 $ $ Points requested --------------------------------------------------- $ $ diff --git a/regtests/ww3_tp2.2/input/ww3_ounp.nml b/regtests/ww3_tp2.2/input/ww3_ounp.nml index 29fa1897d..e97fc6b22 100644 --- a/regtests/ww3_tp2.2/input/ww3_ounp.nml +++ b/regtests/ww3_tp2.2/input/ww3_ounp.nml @@ -6,7 +6,7 @@ ! Define the output fields to postprocess via POINT_NML namelist ! -------------------------------------------------------------------- ! &POINT_NML - POINT%TIMESTART = '19680606 000000' + POINT%TIMESTART = '20220606 000000' POINT%TIMESTRIDE = '21600.' POINT%TIMECOUNT = '1000' POINT%LIST = '1 2 3' diff --git a/regtests/ww3_tp2.2/input/ww3_outf.inp b/regtests/ww3_tp2.2/input/ww3_outf.inp index 4b062a870..d49b283c9 100644 --- a/regtests/ww3_tp2.2/input/ww3_outf.inp +++ b/regtests/ww3_tp2.2/input/ww3_outf.inp @@ -1,6 +1,6 @@ $ WAVEWATCH III Grid output post-processing $ ----------------------------------------- - 19680612 000000 518400. 2 + 20220612 000000 518400. 2 $ N HS T01 DIR SPR diff --git a/regtests/ww3_tp2.2/input/ww3_outp_spec.inp b/regtests/ww3_tp2.2/input/ww3_outp_spec.inp index d4c452b1f..cb7c2ba52 100644 --- a/regtests/ww3_tp2.2/input/ww3_outp_spec.inp +++ b/regtests/ww3_tp2.2/input/ww3_outp_spec.inp @@ -1,6 +1,6 @@ $ WAVEWATCH III Point output post-processing $ ------------------------------------------ - 19680606 000000 43200. 25 + 20220606 000000 43200. 25 $ 1 2 diff --git a/regtests/ww3_tp2.2/input/ww3_outp_tab51.inp b/regtests/ww3_tp2.2/input/ww3_outp_tab51.inp index d40f4a55d..9e4c288b6 100644 --- a/regtests/ww3_tp2.2/input/ww3_outp_tab51.inp +++ b/regtests/ww3_tp2.2/input/ww3_outp_tab51.inp @@ -1,6 +1,6 @@ $ WAVEWATCH III Point output post-processing $ ------------------------------------------ - 19680606 000000 43200. 25 + 20220606 000000 43200. 25 $ 1 -1 diff --git a/regtests/ww3_tp2.2/input/ww3_outp_tab52.inp b/regtests/ww3_tp2.2/input/ww3_outp_tab52.inp index 06431db5d..3ded7db46 100644 --- a/regtests/ww3_tp2.2/input/ww3_outp_tab52.inp +++ b/regtests/ww3_tp2.2/input/ww3_outp_tab52.inp @@ -1,6 +1,6 @@ $ WAVEWATCH III Point output post-processing $ ------------------------------------------ - 19680606 000000 43200. 25 + 20220606 000000 43200. 25 $ 2 -1 diff --git a/regtests/ww3_tp2.2/input/ww3_outp_tab53.inp b/regtests/ww3_tp2.2/input/ww3_outp_tab53.inp index 209a605b0..0e57f1322 100644 --- a/regtests/ww3_tp2.2/input/ww3_outp_tab53.inp +++ b/regtests/ww3_tp2.2/input/ww3_outp_tab53.inp @@ -1,6 +1,6 @@ $ WAVEWATCH III Point output post-processing $ ------------------------------------------ - 19680606 000000 43200. 25 + 20220606 000000 43200. 25 $ 3 -1 diff --git a/regtests/ww3_tp2.2/input/ww3_shel.inp b/regtests/ww3_tp2.2/input/ww3_shel.inp index aba7af3e4..37d914fad 100644 --- a/regtests/ww3_tp2.2/input/ww3_shel.inp +++ b/regtests/ww3_tp2.2/input/ww3_shel.inp @@ -10,31 +10,31 @@ $ ------------------------------ F F $ - 19680606 000000 - 19680606 120000 + 20220606 000000 + 20220606 120000 $ 1 $ - 19680606 000000 10800 19680608 000000 + 20220606 000000 10800 20220608 000000 $ N HS EF T01 DIR SPR $ - 19680606 000000 21600 19680608 000000 + 20220606 000000 21600 20220608 000000 0.0 0.0 'LEFT' 90.0 0.0 'CENTER' 180.0 0.0 'RIGHT' 0.0 0.0 'STOPSTRING' - 19680606 000000 14400 19680608 000000 + 20220606 000000 14400 20220608 000000 T - 19680606 000000 0 19680608 000000 - 19680606 000000 0 19680608 000000 - 19680606 000000 0 19680608 000000 + 20220606 000000 0 20220608 000000 + 20220606 000000 0 20220608 000000 + 20220606 000000 0 20220608 000000 $ - 'CUR' 19680606 030000 2.0 45. - 'WND' 19680606 000000 20.0 180. 2. - 'WND' 19680606 040000 15.0 130. 1. - 'WND' 19680606 080000 25.0 90. 3. + 'CUR' 20220606 030000 2.0 45. + 'WND' 20220606 000000 20.0 180. 2. + 'WND' 20220606 040000 15.0 130. 1. + 'WND' 20220606 080000 25.0 90. 3. 'STP' $ $ -------------------------------------------------------------------- $ diff --git a/regtests/ww3_tp2.2/input/ww3_shel.nml b/regtests/ww3_tp2.2/input/ww3_shel.nml index 578f05f93..32205bc57 100644 --- a/regtests/ww3_tp2.2/input/ww3_shel.nml +++ b/regtests/ww3_tp2.2/input/ww3_shel.nml @@ -7,7 +7,8 @@ ! Define top-level model parameters via DOMAIN_NML namelist ! -------------------------------------------------------------------- ! &DOMAIN_NML - DOMAIN%STOP = '19680606 120000' + DOMAIN%START = '20220606 000000' + DOMAIN%STOP = '20220606 120000' / ! -------------------------------------------------------------------- ! @@ -30,9 +31,9 @@ ! Define output dates via OUTPUT_DATE_NML namelist ! -------------------------------------------------------------------- ! &OUTPUT_DATE_NML - DATE%FIELD = '19680606 000000' '10800' '19680608 000000' - DATE%POINT = '19680606 000000' '21600' '19680608 000000' - DATE%TRACK = '19680606 000000' '14400' '19680608 000000' + DATE%FIELD = '20220606 000000' '10800' '20220608 000000' + DATE%POINT = '20220606 000000' '21600' '20220608 000000' + DATE%TRACK = '20220606 000000' '14400' '20220608 000000' / ! -------------------------------------------------------------------- ! @@ -45,23 +46,24 @@ &HOMOG_INPUT_NML HOMOG_INPUT(1)%NAME = 'CUR' - HOMOG_INPUT(1)%DATE = '19680606 030000' + HOMOG_INPUT(1)%DATE = '20220606 030000' HOMOG_INPUT(1)%VALUE1 = 2.0 HOMOG_INPUT(1)%VALUE2 = 45. HOMOG_INPUT(2)%NAME = 'WND' + HOMOG_INPUT(2)%DATE = '20220606 000000' HOMOG_INPUT(2)%VALUE1 = 20.0 HOMOG_INPUT(2)%VALUE2 = 180. HOMOG_INPUT(2)%VALUE3 = 2. HOMOG_INPUT(3)%NAME = 'WND' - HOMOG_INPUT(3)%DATE = '19680606 040000' + HOMOG_INPUT(3)%DATE = '20220606 040000' HOMOG_INPUT(3)%VALUE1 = 15.0 HOMOG_INPUT(3)%VALUE2 = 130. HOMOG_INPUT(3)%VALUE3 = 1. HOMOG_INPUT(4)%NAME = 'WND' - HOMOG_INPUT(4)%DATE = '19680606 080000' + HOMOG_INPUT(4)%DATE = '20220606 080000' HOMOG_INPUT(4)%VALUE1 = 25.0 HOMOG_INPUT(4)%VALUE2 = 90. HOMOG_INPUT(4)%VALUE3 = 3. diff --git a/regtests/ww3_tp2.2/input/ww3_trnc.inp b/regtests/ww3_tp2.2/input/ww3_trnc.inp index df60800b8..ddfd4f403 100755 --- a/regtests/ww3_tp2.2/input/ww3_trnc.inp +++ b/regtests/ww3_tp2.2/input/ww3_trnc.inp @@ -4,7 +4,7 @@ $--------------------------------------------------------------------- $ $ First output time (yyyymmdd hhmmss), increment of output (s), $ and number of output times. $ - 19680606 000000 3600. 100000 + 20220606 000000 3600. 100000 $ $ Output type -------------------------------------------------------- $ $ netCDF version [3,4] diff --git a/regtests/ww3_tp2.2/input/ww3_trnc.nml b/regtests/ww3_tp2.2/input/ww3_trnc.nml index e4ae8ceab..e6847f529 100644 --- a/regtests/ww3_tp2.2/input/ww3_trnc.nml +++ b/regtests/ww3_tp2.2/input/ww3_trnc.nml @@ -6,7 +6,7 @@ ! Define the output fields to postprocess via TRACK_NML namelist ! -------------------------------------------------------------------- ! &TRACK_NML - TRACK%TIMESTART = '19680606 000000' + TRACK%TIMESTART = '20220606 000000' TRACK%TIMESTRIDE = '3600.' / diff --git a/regtests/ww3_tp2.3/input/namelists_GARDEN.nml b/regtests/ww3_tp2.3/input/namelists_GARDEN.nml index 04b929ca1..b8533ddda 100644 --- a/regtests/ww3_tp2.3/input/namelists_GARDEN.nml +++ b/regtests/ww3_tp2.3/input/namelists_GARDEN.nml @@ -1,4 +1,4 @@ -&OUTS E3D=1 / +&OUTS E3D=1, TH1MF=1, STH1MF=1 / &PRO2 DTIME=345600. / &PRO3 WDTHTH=1.50, WDTHCG=1.50 / END OF NAMELISTS diff --git a/regtests/ww3_tp2.3/input/ww3_grid.inp b/regtests/ww3_tp2.3/input/ww3_grid.inp index 9be443dbb..3a4271307 100644 --- a/regtests/ww3_tp2.3/input/ww3_grid.inp +++ b/regtests/ww3_tp2.3/input/ww3_grid.inp @@ -16,7 +16,7 @@ $ $ $ Activated up to one line per namelist !! $ - &OUTS E3D=1 / + &OUTS E3D=1, TH1MF=1, STH1MF=1 / $ &PRO2 DTIME= 0. / $ &PRO2 DTIME=172800. / &PRO2 DTIME=345600. / diff --git a/regtests/ww3_tp2.6/input/switch_ST4_ASCII b/regtests/ww3_tp2.6/input/switch_ST4_ASCII new file mode 100644 index 000000000..db1b70b66 --- /dev/null +++ b/regtests/ww3_tp2.6/input/switch_ST4_ASCII @@ -0,0 +1 @@ +ASCII NOGRB SHRD PR3 UQ FLX0 LN0 ST4 NL1 BT1 DB1 MLIM TR0 BS0 IC0 IS0 REF0 WNT1 WNX1 CRT1 CRX1 O0 O1 O2 O3 O4 O5 O6 O7 O10 O11 diff --git a/regtests/ww3_tp2.6/input/ww3_ounf.inp b/regtests/ww3_tp2.6/input/ww3_ounf.inp index c4d51a66c..d2bde30b6 100644 --- a/regtests/ww3_tp2.6/input/ww3_ounf.inp +++ b/regtests/ww3_tp2.6/input/ww3_ounf.inp @@ -13,7 +13,7 @@ $ file for a full documentation of field output options. Namelist type $ selection is used here (for alternative F/T flags, see ww3_shel.inp). $ N - HS LM T02 T01 T0M1 UST CHA CGE DTD FC CFX CFD + HS LM T02 T01 T0M1 UST CHA CGE DTD FC CFX CFD QP QKK $ $--------------------------------------------------------------------- $ $ netCDF version [3,4] diff --git a/regtests/ww3_tp2.6/input/ww3_ounf.nml b/regtests/ww3_tp2.6/input/ww3_ounf.nml index 658dd2525..7b344cc1c 100644 --- a/regtests/ww3_tp2.6/input/ww3_ounf.nml +++ b/regtests/ww3_tp2.6/input/ww3_ounf.nml @@ -9,7 +9,7 @@ FIELD%TIMESTART = '20100801 000000' FIELD%TIMESTRIDE = '10' FIELD%TIMECOUNT = '3600' - FIELD%LIST = 'HS LM T02 T01 T0M1 UST CHA CGE DTD FC CFX CFD' + FIELD%LIST = 'HS LM T02 T01 T0M1 UST CHA CGE DTD FC CFX CFD QP QKK' FIELD%PARTITION = '0 1 2' FIELD%SAMEFILE = F FIELD%TYPE = 4 diff --git a/regtests/ww3_tp2.6/input/ww3_outf.inp b/regtests/ww3_tp2.6/input/ww3_outf.inp index 70dc9974c..86c1115ff 100644 --- a/regtests/ww3_tp2.6/input/ww3_outf.inp +++ b/regtests/ww3_tp2.6/input/ww3_outf.inp @@ -7,7 +7,7 @@ $ $ $ Request flags identifying fields as in ww3_shel input and section 2.4 fo the manual. N -HS LM T02 T01 T0M1 UST CHA CGE DTD FC CFX CFD +HS LM T02 T01 T0M1 UST CHA CGE DTD FC CFX CFD QP QKK $ $ Output type ITYPE [0,1,2,3] $ diff --git a/regtests/ww3_tp2.6/input/ww3_shel.inp b/regtests/ww3_tp2.6/input/ww3_shel.inp index ecdf1bc3a..2bd59dc2c 100644 --- a/regtests/ww3_tp2.6/input/ww3_shel.inp +++ b/regtests/ww3_tp2.6/input/ww3_shel.inp @@ -60,7 +60,7 @@ $ Output request flags identifying fields as in ww3_shel input and $ section 2.4 of the manual. $ N -HS LM T02 T01 T0M1 UST CHA CGE DTD FC CFX CFD +HS LM T02 T01 T0M1 UST CHA CGE DTD FC CFX CFD QP QKK $ $---------------------------------------------------------------- $ diff --git a/regtests/ww3_tp2.6/input/ww3_shel.nml b/regtests/ww3_tp2.6/input/ww3_shel.nml index f27f0b161..3518049f2 100644 --- a/regtests/ww3_tp2.6/input/ww3_shel.nml +++ b/regtests/ww3_tp2.6/input/ww3_shel.nml @@ -22,7 +22,7 @@ ! Define the output types point parameters via OUTPUT_TYPE_NML namelist ! -------------------------------------------------------------------- ! &OUTPUT_TYPE_NML - TYPE%FIELD%LIST = 'HS LM T02 T01 T0M1 UST CHA CGE DTD FC CFX CFD' + TYPE%FIELD%LIST = 'HS LM T02 T01 T0M1 UST CHA CGE DTD FC CFX CFD QP QKK' TYPE%POINT%FILE = '../input/points.list' / diff --git a/regtests/ww3_ts1/input/namelists_ST4_T475.nml b/regtests/ww3_ts1/input/namelists_ST4_T475.nml new file mode 100644 index 000000000..e104247aa --- /dev/null +++ b/regtests/ww3_ts1/input/namelists_ST4_T475.nml @@ -0,0 +1,7 @@ +&SIN4 BETAMAX = 1.75, SWELLF = 0.66, TAUWSHELTER = 0.3, + SWELLF3 = 0.022, SWELLF4 = 115000.0, SWELLF7 = 432000.00 / +&SDS4 FXFM3 = 2.5 / +&SIC2 IC2ROUGH = 0.001000, IC2VISC = 2.000, IC2DMAX =0.300 / +&SIS2 ISC1 =0.200E+00, IS2BREAK = T, IS2DUPDATE = F, IS2CREEPB = 0.200E+08 / + +END OF NAMELISTS diff --git a/regtests/ww3_ts1/input/namelists_ST4_T500.nml b/regtests/ww3_ts1/input/namelists_ST4_T500.nml new file mode 100644 index 000000000..317705f93 --- /dev/null +++ b/regtests/ww3_ts1/input/namelists_ST4_T500.nml @@ -0,0 +1,3 @@ + &SDS4 SDSBCHOICE=2, SDSC2 = 0.0, SDSBR = 0.005, + FXFM3 = 9., SDSBCK = 0.185, SDSHCK = 1.5/ +END OF NAMELISTS diff --git a/regtests/ww3_ts1/input/namelists_ST4_T700.nml b/regtests/ww3_ts1/input/namelists_ST4_T700.nml index aa6ecdf70..b47cc70d0 100644 --- a/regtests/ww3_ts1/input/namelists_ST4_T700.nml +++ b/regtests/ww3_ts1/input/namelists_ST4_T700.nml @@ -1,4 +1,4 @@ &SDS4 SDSBCHOICE=3, SDSC2 = -3.8, SDSBR = 0.005, - SDSSTRAIN =0., SDSSTRAIN2 = 0., FXFM3 = 20., SDSFACMTF = 400., + FXFM3 = 20., SDSFACMTF = 400., SDSCUM=0., SDSC5 =0. / END OF NAMELISTS diff --git a/regtests/ww3_ts1/input/namelists_ST4_T702.nml b/regtests/ww3_ts1/input/namelists_ST4_T702.nml new file mode 100644 index 000000000..444c02e29 --- /dev/null +++ b/regtests/ww3_ts1/input/namelists_ST4_T702.nml @@ -0,0 +1,12 @@ +&SIN4 BETAMAX = 1.7, SWELLF = 0.60, TAUWSHELTER = 0.2, + SWELLF3 = 0.022, SWELLF4 = 115000.0, SWELLF7 = 432000.00 / +&SDS4 SDSBCHOICE = 3, SDSC2 = -3.80, FXFM3 = 20.00, + SDSBR = 0.005, SDSBT = 0.0011, SDSCUM = 0.300, SDSC5 = 1.0, + SDSMWD = 0.00, SDSFACMTF = 400 / +&SNL1 NLPROP = 25000000.0 / +&SIC2 IC2ROUGH = 0.001000, IC2VISC = 2.000, IC2DMAX =0.300 / +&SIS2 ISC1 =0.200E+00, IS2BREAK = T, IS2DUPDATE = F, IS2CREEPB = 0.200E+08 / +&MISC ICEHINIT = 0.5, ICEHMIN = 0.1, CICE0 = 0.25, NOSW =6, + CICEN = 2.00, LICE = 40000., FLAGTR = 4, FACBERG = 0.2 , + WCOR1=21., WCOR2=0.5 / +END OF NAMELISTS diff --git a/regtests/ww3_ts1/input/namelists_ST4_T707.nml b/regtests/ww3_ts1/input/namelists_ST4_T707.nml new file mode 100644 index 000000000..b1d0a9727 --- /dev/null +++ b/regtests/ww3_ts1/input/namelists_ST4_T707.nml @@ -0,0 +1,13 @@ + &SNL1 IQTYPE = -2, GQMNF1 = 11, GQMNT1 = 6, GQMNQ_OM2 = 6, + TAILNL=-5.0, GQMTHRSAT=5E-5, GQMTHRCOU = 0.05, GQAMP1=1., + GQAMP2=0.0022, GQAMP3=1., GQAMP4=1.0 / + &SIN4 BETAMAX = 1.6, TAUWSHELTER = 0.0 / + &SDS4 SDSBCHOICE=3, SDSC2 = -2.3, SDSBR = 0.005, CUMSIGP =2.0, + FXFM3 = 20, SDSFACMTF = 400., + SDSMWD = 2., SDSCUM = 0.35, SDSNUW =0, SDSC5=1., SDSBRF1=0.5 / +&SIC2 IC2ROUGH = 0.001000, IC2VISC = 2.000, IC2DMAX =0.300 / +&SIS2 ISC1 =0.200E+00, IS2BREAK = T, IS2DUPDATE = F, IS2CREEPB = 0.200E+08 / +&MISC ICEHINIT = 0.5, ICEHMIN = 0.1, CICE0 = 0.25, NOSW =6, + CICEN = 2.00, LICE = 40000., FLAGTR = 4, FACBERG = 0.2 , + WCOR1=21., WCOR2=0.5 / +END OF NAMELISTS diff --git a/regtests/ww3_ts1/input/ww3_grid_ST4_T475.nml b/regtests/ww3_ts1/input/ww3_grid_ST4_T475.nml new file mode 100644 index 000000000..7987e9528 --- /dev/null +++ b/regtests/ww3_ts1/input/ww3_grid_ST4_T475.nml @@ -0,0 +1,225 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III - ww3_grid.nml - Grid pre-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the spectrum parameterization via SPECTRUM_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! SPECTRUM%XFR = 0. ! frequency increment +! SPECTRUM%FREQ1 = 0. ! first frequency (Hz) +! SPECTRUM%NK = 0 ! number of frequencies (wavenumbers) +! SPECTRUM%NTH = 0 ! number of direction bins +! SPECTRUM%THOFF = 0. ! relative offset of first direction [-0.5,0.5] +! -------------------------------------------------------------------- ! +&SPECTRUM_NML + SPECTRUM%XFR = 1.10 + SPECTRUM%FREQ1 = 0.0485 + SPECTRUM%NK = 36 + SPECTRUM%NTH = 24 +/ + +! -------------------------------------------------------------------- ! +! Define the run parameterization via RUN_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! RUN%FLDRY = F ! dry run (I/O only, no calculation) +! RUN%FLCX = F ! x-component of propagation +! RUN%FLCY = F ! y-component of propagation +! RUN%FLCTH = F ! direction shift +! RUN%FLCK = F ! wavenumber shift +! RUN%FLSOU = F ! source terms +! -------------------------------------------------------------------- ! +&RUN_NML + RUN%FLSOU = T +/ + +! -------------------------------------------------------------------- ! +! Define the timesteps parameterization via TIMESTEPS_NML namelist +! +! * It is highly recommended to set up time steps which are multiple +! between them. +! +! * The first time step to calculate is the maximum CFL time step +! which depend on the lowest frequency FREQ1 previously set up and the +! lowest spatial grid resolution in meters DXY. +! reminder : 1 degree=60minutes // 1minute=1mile // 1mile=1.852km +! The formula for the CFL time is : +! Tcfl = DXY / (G / (FREQ1*4*Pi) ) with the constants Pi=3,14 and G=9.8m/s²; +! DTXY ~= 90% Tcfl +! DTMAX ~= 3 * DTXY (maximum global time step limit) +! +! * The refraction time step depends on how strong can be the current velocities +! on your grid : +! DTKTH ~= DTMAX / 2 ! in case of no or light current velocities +! DTKTH ~= DTMAX / 10 ! in case of strong current velocities +! +! * The source terms time step is usually defined between 5s and 60s. +! A common value is 10s. +! DTMIN ~= 10 +! +! * namelist must be terminated with / +! * definitions & defaults: +! TIMESTEPS%DTMAX = 0. ! maximum global time step (s) +! TIMESTEPS%DTXY = 0. ! maximum CFL time step for x-y (s) +! TIMESTEPS%DTKTH = 0. ! maximum CFL time step for k-th (s) +! TIMESTEPS%DTMIN = 0. ! minimum source term time step (s) +! -------------------------------------------------------------------- ! +&TIMESTEPS_NML + TIMESTEPS%DTMAX = 900. + TIMESTEPS%DTXY = 900. + TIMESTEPS%DTKTH = 900. + TIMESTEPS%DTMIN = 15. +/ + +! -------------------------------------------------------------------- ! +! Define the grid to preprocess via GRID_NML namelist +! +! * the tunable parameters for source terms, propagation schemes, and +! numerics are read using namelists. +! * Any namelist found in the folowing sections is temporarily written +! to param.scratch, and read from there if necessary. +! * The order of the namelists is immaterial. +! * Namelists not needed for the given switch settings will be skipped +! automatically +! +! * grid type can be : +! 'RECT' : rectilinear +! 'CURV' : curvilinear +! 'UNST' : unstructured (triangle-based) +! +! * coordinate system can be : +! 'SPHE' : Spherical (degrees) +! 'CART' : Cartesian (meters) +! +! * grid closure can only be applied in spherical coordinates +! +! * grid closure can be : +! 'NONE' : No closure is applied +! 'SMPL' : Simple grid closure. Grid is periodic in the +! : i-index and wraps at i=NX+1. In other words, +! : (NX+1,J) => (1,J). A grid with simple closure +! : may be rectilinear or curvilinear. +! 'TRPL' : Tripole grid closure : Grid is periodic in the +! : i-index and wraps at i=NX+1 and has closure at +! : j=NY+1. In other words, (NX+1,J<=NY) => (1,J) +! : and (I,NY+1) => (NX-I+1,NY). Tripole +! : grid closure requires that NX be even. A grid +! : with tripole closure must be curvilinear. +! +! * The coastline limit depth is the value which distinguish the sea +! points to the land points. All the points with depth values (ZBIN) +! greater than this limit (ZLIM) will be considered as excluded points +! and will never be wet points, even if the water level grows over. +! It can only overwrite the status of a sea point to a land point. +! The value must have a negative value under the mean sea level +! +! * The minimum water depth allowed to compute the model is the absolute +! depth value (DMIN) used in the model if the input depth is lower to +! avoid the model to blow up. +! +! * namelist must be terminated with / +! * definitions & defaults: +! GRID%NAME = 'unset' ! grid name (30 char) +! GRID%NML = 'namelists.nml' ! namelists filename +! GRID%TYPE = 'unset' ! grid type +! GRID%COORD = 'unset' ! coordinate system +! GRID%CLOS = 'unset' ! grid closure +! +! GRID%ZLIM = 0. ! coastline limit depth (m) +! GRID%DMIN = 0. ! abs. minimum water depth (m) +! -------------------------------------------------------------------- ! +&GRID_NML + GRID%NAME = 'HOMOGENEOUS SOURCE TERM TEST' + GRID%NML = '../input/namelists_ST4_T475.nml' + GRID%TYPE = 'RECT' + GRID%COORD = 'SPHE' + GRID%CLOS = 'NONE' + GRID%ZLIM = -5. + GRID%DMIN = 5.75 +/ + +! -------------------------------------------------------------------- ! +! Define the rectilinear grid type via RECT_NML namelist +! - only for RECT grids - +! +! * The minimum grid size is 3x3. +! +! * If the grid increments SX and SY are given in minutes of arc, the scaling +! factor SF must be set to 60. to provide an increment factor in degree. +! +! * If CSTRG='SMPL', then SX is forced to 360/NX. +! +! * value <= value_read / scale_fac +! +! * namelist must be terminated with / +! * definitions & defaults: +! RECT%NX = 0 ! number of points along x-axis +! RECT%NY = 0 ! number of points along y-axis +! +! RECT%SX = 0. ! grid increment along x-axis +! RECT%SY = 0. ! grid increment along y-axis +! RECT%SF = 1. ! scaling division factor for x-y axis +! +! RECT%X0 = 0. ! x-coordinate of lower-left corner (deg) +! RECT%Y0 = 0. ! y-coordinate of lower-left corner (deg) +! RECT%SF0 = 1. ! scaling division factor for x0,y0 coord +! -------------------------------------------------------------------- ! +&RECT_NML + RECT%NX = 3 + RECT%NY = 3 + RECT%SX = 1. + RECT%SY = 1. + RECT%SF = 1.E-2 + RECT%X0 = -1. + RECT%Y0 = -1. + RECT%SF0 = 1.E-2 +/ + +! -------------------------------------------------------------------- ! +! Define the depth to preprocess via DEPTH_NML namelist +! - for RECT and CURV grids - +! +! * if no obstruction subgrid, need to set &MISC FLAGTR = 0 +! +! * The depth value must have negative values under the mean sea level +! +! * value <= value_read * scale_fac +! +! * IDLA : Layout indicator : +! 1 : Read line-by-line bottom to top. (default) +! 2 : Like 1, single read statement. +! 3 : Read line-by-line top to bottom. +! 4 : Like 3, single read statement. +! * IDFM : format indicator : +! 1 : Free format. (default) +! 2 : Fixed format. +! 3 : Unformatted. +! * FORMAT : element format to read : +! '(....)' : auto detected (default) +! '(f10.6)' : float type +! +! * Example : +! IDF SF IDLA IDFM FORMAT FILENAME +! 50 0.001 1 1 '(....)' 'GLOB-30M.bot' +! +! * namelist must be terminated with / +! * definitions & defaults: +! DEPTH%SF = 1. ! scale factor +! DEPTH%FILENAME = 'unset' ! filename +! DEPTH%IDF = 50 ! file unit number +! DEPTH%IDLA = 1 ! layout indicator +! DEPTH%IDFM = 1 ! format indicator +! DEPTH%FORMAT = '(....)' ! formatted read format +! -------------------------------------------------------------------- ! +&DEPTH_NML + DEPTH%SF = -2500. + DEPTH%FILENAME = '../input/HOMOGENEOUS.depth' + DEPTH%IDLA = 3 +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_ts1/input/ww3_grid_ST4_T500.nml b/regtests/ww3_ts1/input/ww3_grid_ST4_T500.nml new file mode 100644 index 000000000..bef18d975 --- /dev/null +++ b/regtests/ww3_ts1/input/ww3_grid_ST4_T500.nml @@ -0,0 +1,225 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III - ww3_grid.nml - Grid pre-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the spectrum parameterization via SPECTRUM_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! SPECTRUM%XFR = 0. ! frequency increment +! SPECTRUM%FREQ1 = 0. ! first frequency (Hz) +! SPECTRUM%NK = 0 ! number of frequencies (wavenumbers) +! SPECTRUM%NTH = 0 ! number of direction bins +! SPECTRUM%THOFF = 0. ! relative offset of first direction [-0.5,0.5] +! -------------------------------------------------------------------- ! +&SPECTRUM_NML + SPECTRUM%XFR = 1.10 + SPECTRUM%FREQ1 = 0.0485 + SPECTRUM%NK = 36 + SPECTRUM%NTH = 24 +/ + +! -------------------------------------------------------------------- ! +! Define the run parameterization via RUN_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! RUN%FLDRY = F ! dry run (I/O only, no calculation) +! RUN%FLCX = F ! x-component of propagation +! RUN%FLCY = F ! y-component of propagation +! RUN%FLCTH = F ! direction shift +! RUN%FLCK = F ! wavenumber shift +! RUN%FLSOU = F ! source terms +! -------------------------------------------------------------------- ! +&RUN_NML + RUN%FLSOU = T +/ + +! -------------------------------------------------------------------- ! +! Define the timesteps parameterization via TIMESTEPS_NML namelist +! +! * It is highly recommended to set up time steps which are multiple +! between them. +! +! * The first time step to calculate is the maximum CFL time step +! which depend on the lowest frequency FREQ1 previously set up and the +! lowest spatial grid resolution in meters DXY. +! reminder : 1 degree=60minutes // 1minute=1mile // 1mile=1.852km +! The formula for the CFL time is : +! Tcfl = DXY / (G / (FREQ1*4*Pi) ) with the constants Pi=3,14 and G=9.8m/s²; +! DTXY ~= 90% Tcfl +! DTMAX ~= 3 * DTXY (maximum global time step limit) +! +! * The refraction time step depends on how strong can be the current velocities +! on your grid : +! DTKTH ~= DTMAX / 2 ! in case of no or light current velocities +! DTKTH ~= DTMAX / 10 ! in case of strong current velocities +! +! * The source terms time step is usually defined between 5s and 60s. +! A common value is 10s. +! DTMIN ~= 10 +! +! * namelist must be terminated with / +! * definitions & defaults: +! TIMESTEPS%DTMAX = 0. ! maximum global time step (s) +! TIMESTEPS%DTXY = 0. ! maximum CFL time step for x-y (s) +! TIMESTEPS%DTKTH = 0. ! maximum CFL time step for k-th (s) +! TIMESTEPS%DTMIN = 0. ! minimum source term time step (s) +! -------------------------------------------------------------------- ! +&TIMESTEPS_NML + TIMESTEPS%DTMAX = 900. + TIMESTEPS%DTXY = 900. + TIMESTEPS%DTKTH = 900. + TIMESTEPS%DTMIN = 15. +/ + +! -------------------------------------------------------------------- ! +! Define the grid to preprocess via GRID_NML namelist +! +! * the tunable parameters for source terms, propagation schemes, and +! numerics are read using namelists. +! * Any namelist found in the folowing sections is temporarily written +! to param.scratch, and read from there if necessary. +! * The order of the namelists is immaterial. +! * Namelists not needed for the given switch settings will be skipped +! automatically +! +! * grid type can be : +! 'RECT' : rectilinear +! 'CURV' : curvilinear +! 'UNST' : unstructured (triangle-based) +! +! * coordinate system can be : +! 'SPHE' : Spherical (degrees) +! 'CART' : Cartesian (meters) +! +! * grid closure can only be applied in spherical coordinates +! +! * grid closure can be : +! 'NONE' : No closure is applied +! 'SMPL' : Simple grid closure. Grid is periodic in the +! : i-index and wraps at i=NX+1. In other words, +! : (NX+1,J) => (1,J). A grid with simple closure +! : may be rectilinear or curvilinear. +! 'TRPL' : Tripole grid closure : Grid is periodic in the +! : i-index and wraps at i=NX+1 and has closure at +! : j=NY+1. In other words, (NX+1,J<=NY) => (1,J) +! : and (I,NY+1) => (NX-I+1,NY). Tripole +! : grid closure requires that NX be even. A grid +! : with tripole closure must be curvilinear. +! +! * The coastline limit depth is the value which distinguish the sea +! points to the land points. All the points with depth values (ZBIN) +! greater than this limit (ZLIM) will be considered as excluded points +! and will never be wet points, even if the water level grows over. +! It can only overwrite the status of a sea point to a land point. +! The value must have a negative value under the mean sea level +! +! * The minimum water depth allowed to compute the model is the absolute +! depth value (DMIN) used in the model if the input depth is lower to +! avoid the model to blow up. +! +! * namelist must be terminated with / +! * definitions & defaults: +! GRID%NAME = 'unset' ! grid name (30 char) +! GRID%NML = 'namelists.nml' ! namelists filename +! GRID%TYPE = 'unset' ! grid type +! GRID%COORD = 'unset' ! coordinate system +! GRID%CLOS = 'unset' ! grid closure +! +! GRID%ZLIM = 0. ! coastline limit depth (m) +! GRID%DMIN = 0. ! abs. minimum water depth (m) +! -------------------------------------------------------------------- ! +&GRID_NML + GRID%NAME = 'HOMOGENEOUS SOURCE TERM TEST' + GRID%NML = '../input/namelists_ST4_T500.nml' + GRID%TYPE = 'RECT' + GRID%COORD = 'SPHE' + GRID%CLOS = 'NONE' + GRID%ZLIM = -5. + GRID%DMIN = 5.75 +/ + +! -------------------------------------------------------------------- ! +! Define the rectilinear grid type via RECT_NML namelist +! - only for RECT grids - +! +! * The minimum grid size is 3x3. +! +! * If the grid increments SX and SY are given in minutes of arc, the scaling +! factor SF must be set to 60. to provide an increment factor in degree. +! +! * If CSTRG='SMPL', then SX is forced to 360/NX. +! +! * value <= value_read / scale_fac +! +! * namelist must be terminated with / +! * definitions & defaults: +! RECT%NX = 0 ! number of points along x-axis +! RECT%NY = 0 ! number of points along y-axis +! +! RECT%SX = 0. ! grid increment along x-axis +! RECT%SY = 0. ! grid increment along y-axis +! RECT%SF = 1. ! scaling division factor for x-y axis +! +! RECT%X0 = 0. ! x-coordinate of lower-left corner (deg) +! RECT%Y0 = 0. ! y-coordinate of lower-left corner (deg) +! RECT%SF0 = 1. ! scaling division factor for x0,y0 coord +! -------------------------------------------------------------------- ! +&RECT_NML + RECT%NX = 3 + RECT%NY = 3 + RECT%SX = 1. + RECT%SY = 1. + RECT%SF = 1.E-2 + RECT%X0 = -1. + RECT%Y0 = -1. + RECT%SF0 = 1.E-2 +/ + +! -------------------------------------------------------------------- ! +! Define the depth to preprocess via DEPTH_NML namelist +! - for RECT and CURV grids - +! +! * if no obstruction subgrid, need to set &MISC FLAGTR = 0 +! +! * The depth value must have negative values under the mean sea level +! +! * value <= value_read * scale_fac +! +! * IDLA : Layout indicator : +! 1 : Read line-by-line bottom to top. (default) +! 2 : Like 1, single read statement. +! 3 : Read line-by-line top to bottom. +! 4 : Like 3, single read statement. +! * IDFM : format indicator : +! 1 : Free format. (default) +! 2 : Fixed format. +! 3 : Unformatted. +! * FORMAT : element format to read : +! '(....)' : auto detected (default) +! '(f10.6)' : float type +! +! * Example : +! IDF SF IDLA IDFM FORMAT FILENAME +! 50 0.001 1 1 '(....)' 'GLOB-30M.bot' +! +! * namelist must be terminated with / +! * definitions & defaults: +! DEPTH%SF = 1. ! scale factor +! DEPTH%FILENAME = 'unset' ! filename +! DEPTH%IDF = 50 ! file unit number +! DEPTH%IDLA = 1 ! layout indicator +! DEPTH%IDFM = 1 ! format indicator +! DEPTH%FORMAT = '(....)' ! formatted read format +! -------------------------------------------------------------------- ! +&DEPTH_NML + DEPTH%SF = -2500. + DEPTH%FILENAME = '../input/HOMOGENEOUS.depth' + DEPTH%IDLA = 3 +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_ts1/input/ww3_grid_ST4_T702.nml b/regtests/ww3_ts1/input/ww3_grid_ST4_T702.nml new file mode 100644 index 000000000..48135e1d9 --- /dev/null +++ b/regtests/ww3_ts1/input/ww3_grid_ST4_T702.nml @@ -0,0 +1,225 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III - ww3_grid.nml - Grid pre-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the spectrum parameterization via SPECTRUM_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! SPECTRUM%XFR = 0. ! frequency increment +! SPECTRUM%FREQ1 = 0. ! first frequency (Hz) +! SPECTRUM%NK = 0 ! number of frequencies (wavenumbers) +! SPECTRUM%NTH = 0 ! number of direction bins +! SPECTRUM%THOFF = 0. ! relative offset of first direction [-0.5,0.5] +! -------------------------------------------------------------------- ! +&SPECTRUM_NML + SPECTRUM%XFR = 1.10 + SPECTRUM%FREQ1 = 0.0485 + SPECTRUM%NK = 36 + SPECTRUM%NTH = 24 +/ + +! -------------------------------------------------------------------- ! +! Define the run parameterization via RUN_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! RUN%FLDRY = F ! dry run (I/O only, no calculation) +! RUN%FLCX = F ! x-component of propagation +! RUN%FLCY = F ! y-component of propagation +! RUN%FLCTH = F ! direction shift +! RUN%FLCK = F ! wavenumber shift +! RUN%FLSOU = F ! source terms +! -------------------------------------------------------------------- ! +&RUN_NML + RUN%FLSOU = T +/ + +! -------------------------------------------------------------------- ! +! Define the timesteps parameterization via TIMESTEPS_NML namelist +! +! * It is highly recommended to set up time steps which are multiple +! between them. +! +! * The first time step to calculate is the maximum CFL time step +! which depend on the lowest frequency FREQ1 previously set up and the +! lowest spatial grid resolution in meters DXY. +! reminder : 1 degree=60minutes // 1minute=1mile // 1mile=1.852km +! The formula for the CFL time is : +! Tcfl = DXY / (G / (FREQ1*4*Pi) ) with the constants Pi=3,14 and G=9.8m/s²; +! DTXY ~= 90% Tcfl +! DTMAX ~= 3 * DTXY (maximum global time step limit) +! +! * The refraction time step depends on how strong can be the current velocities +! on your grid : +! DTKTH ~= DTMAX / 2 ! in case of no or light current velocities +! DTKTH ~= DTMAX / 10 ! in case of strong current velocities +! +! * The source terms time step is usually defined between 5s and 60s. +! A common value is 10s. +! DTMIN ~= 10 +! +! * namelist must be terminated with / +! * definitions & defaults: +! TIMESTEPS%DTMAX = 0. ! maximum global time step (s) +! TIMESTEPS%DTXY = 0. ! maximum CFL time step for x-y (s) +! TIMESTEPS%DTKTH = 0. ! maximum CFL time step for k-th (s) +! TIMESTEPS%DTMIN = 0. ! minimum source term time step (s) +! -------------------------------------------------------------------- ! +&TIMESTEPS_NML + TIMESTEPS%DTMAX = 900. + TIMESTEPS%DTXY = 900. + TIMESTEPS%DTKTH = 900. + TIMESTEPS%DTMIN = 15. +/ + +! -------------------------------------------------------------------- ! +! Define the grid to preprocess via GRID_NML namelist +! +! * the tunable parameters for source terms, propagation schemes, and +! numerics are read using namelists. +! * Any namelist found in the folowing sections is temporarily written +! to param.scratch, and read from there if necessary. +! * The order of the namelists is immaterial. +! * Namelists not needed for the given switch settings will be skipped +! automatically +! +! * grid type can be : +! 'RECT' : rectilinear +! 'CURV' : curvilinear +! 'UNST' : unstructured (triangle-based) +! +! * coordinate system can be : +! 'SPHE' : Spherical (degrees) +! 'CART' : Cartesian (meters) +! +! * grid closure can only be applied in spherical coordinates +! +! * grid closure can be : +! 'NONE' : No closure is applied +! 'SMPL' : Simple grid closure. Grid is periodic in the +! : i-index and wraps at i=NX+1. In other words, +! : (NX+1,J) => (1,J). A grid with simple closure +! : may be rectilinear or curvilinear. +! 'TRPL' : Tripole grid closure : Grid is periodic in the +! : i-index and wraps at i=NX+1 and has closure at +! : j=NY+1. In other words, (NX+1,J<=NY) => (1,J) +! : and (I,NY+1) => (NX-I+1,NY). Tripole +! : grid closure requires that NX be even. A grid +! : with tripole closure must be curvilinear. +! +! * The coastline limit depth is the value which distinguish the sea +! points to the land points. All the points with depth values (ZBIN) +! greater than this limit (ZLIM) will be considered as excluded points +! and will never be wet points, even if the water level grows over. +! It can only overwrite the status of a sea point to a land point. +! The value must have a negative value under the mean sea level +! +! * The minimum water depth allowed to compute the model is the absolute +! depth value (DMIN) used in the model if the input depth is lower to +! avoid the model to blow up. +! +! * namelist must be terminated with / +! * definitions & defaults: +! GRID%NAME = 'unset' ! grid name (30 char) +! GRID%NML = 'namelists.nml' ! namelists filename +! GRID%TYPE = 'unset' ! grid type +! GRID%COORD = 'unset' ! coordinate system +! GRID%CLOS = 'unset' ! grid closure +! +! GRID%ZLIM = 0. ! coastline limit depth (m) +! GRID%DMIN = 0. ! abs. minimum water depth (m) +! -------------------------------------------------------------------- ! +&GRID_NML + GRID%NAME = 'HOMOGENEOUS SOURCE TERM TEST' + GRID%NML = '../input/namelists_ST4_T702.nml' + GRID%TYPE = 'RECT' + GRID%COORD = 'SPHE' + GRID%CLOS = 'NONE' + GRID%ZLIM = -5. + GRID%DMIN = 5.75 +/ + +! -------------------------------------------------------------------- ! +! Define the rectilinear grid type via RECT_NML namelist +! - only for RECT grids - +! +! * The minimum grid size is 3x3. +! +! * If the grid increments SX and SY are given in minutes of arc, the scaling +! factor SF must be set to 60. to provide an increment factor in degree. +! +! * If CSTRG='SMPL', then SX is forced to 360/NX. +! +! * value <= value_read / scale_fac +! +! * namelist must be terminated with / +! * definitions & defaults: +! RECT%NX = 0 ! number of points along x-axis +! RECT%NY = 0 ! number of points along y-axis +! +! RECT%SX = 0. ! grid increment along x-axis +! RECT%SY = 0. ! grid increment along y-axis +! RECT%SF = 1. ! scaling division factor for x-y axis +! +! RECT%X0 = 0. ! x-coordinate of lower-left corner (deg) +! RECT%Y0 = 0. ! y-coordinate of lower-left corner (deg) +! RECT%SF0 = 1. ! scaling division factor for x0,y0 coord +! -------------------------------------------------------------------- ! +&RECT_NML + RECT%NX = 3 + RECT%NY = 3 + RECT%SX = 1. + RECT%SY = 1. + RECT%SF = 1.E-2 + RECT%X0 = -1. + RECT%Y0 = -1. + RECT%SF0 = 1.E-2 +/ + +! -------------------------------------------------------------------- ! +! Define the depth to preprocess via DEPTH_NML namelist +! - for RECT and CURV grids - +! +! * if no obstruction subgrid, need to set &MISC FLAGTR = 0 +! +! * The depth value must have negative values under the mean sea level +! +! * value <= value_read * scale_fac +! +! * IDLA : Layout indicator : +! 1 : Read line-by-line bottom to top. (default) +! 2 : Like 1, single read statement. +! 3 : Read line-by-line top to bottom. +! 4 : Like 3, single read statement. +! * IDFM : format indicator : +! 1 : Free format. (default) +! 2 : Fixed format. +! 3 : Unformatted. +! * FORMAT : element format to read : +! '(....)' : auto detected (default) +! '(f10.6)' : float type +! +! * Example : +! IDF SF IDLA IDFM FORMAT FILENAME +! 50 0.001 1 1 '(....)' 'GLOB-30M.bot' +! +! * namelist must be terminated with / +! * definitions & defaults: +! DEPTH%SF = 1. ! scale factor +! DEPTH%FILENAME = 'unset' ! filename +! DEPTH%IDF = 50 ! file unit number +! DEPTH%IDLA = 1 ! layout indicator +! DEPTH%IDFM = 1 ! format indicator +! DEPTH%FORMAT = '(....)' ! formatted read format +! -------------------------------------------------------------------- ! +&DEPTH_NML + DEPTH%SF = -2500. + DEPTH%FILENAME = '../input/HOMOGENEOUS.depth' + DEPTH%IDLA = 3 +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_ts1/input/ww3_grid_ST4_T707.nml b/regtests/ww3_ts1/input/ww3_grid_ST4_T707.nml new file mode 100644 index 000000000..e6ef84a56 --- /dev/null +++ b/regtests/ww3_ts1/input/ww3_grid_ST4_T707.nml @@ -0,0 +1,225 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III - ww3_grid.nml - Grid pre-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the spectrum parameterization via SPECTRUM_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! SPECTRUM%XFR = 0. ! frequency increment +! SPECTRUM%FREQ1 = 0. ! first frequency (Hz) +! SPECTRUM%NK = 0 ! number of frequencies (wavenumbers) +! SPECTRUM%NTH = 0 ! number of direction bins +! SPECTRUM%THOFF = 0. ! relative offset of first direction [-0.5,0.5] +! -------------------------------------------------------------------- ! +&SPECTRUM_NML + SPECTRUM%XFR = 1.10 + SPECTRUM%FREQ1 = 0.0485 + SPECTRUM%NK = 36 + SPECTRUM%NTH = 24 +/ + +! -------------------------------------------------------------------- ! +! Define the run parameterization via RUN_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! RUN%FLDRY = F ! dry run (I/O only, no calculation) +! RUN%FLCX = F ! x-component of propagation +! RUN%FLCY = F ! y-component of propagation +! RUN%FLCTH = F ! direction shift +! RUN%FLCK = F ! wavenumber shift +! RUN%FLSOU = F ! source terms +! -------------------------------------------------------------------- ! +&RUN_NML + RUN%FLSOU = T +/ + +! -------------------------------------------------------------------- ! +! Define the timesteps parameterization via TIMESTEPS_NML namelist +! +! * It is highly recommended to set up time steps which are multiple +! between them. +! +! * The first time step to calculate is the maximum CFL time step +! which depend on the lowest frequency FREQ1 previously set up and the +! lowest spatial grid resolution in meters DXY. +! reminder : 1 degree=60minutes // 1minute=1mile // 1mile=1.852km +! The formula for the CFL time is : +! Tcfl = DXY / (G / (FREQ1*4*Pi) ) with the constants Pi=3,14 and G=9.8m/s²; +! DTXY ~= 90% Tcfl +! DTMAX ~= 3 * DTXY (maximum global time step limit) +! +! * The refraction time step depends on how strong can be the current velocities +! on your grid : +! DTKTH ~= DTMAX / 2 ! in case of no or light current velocities +! DTKTH ~= DTMAX / 10 ! in case of strong current velocities +! +! * The source terms time step is usually defined between 5s and 60s. +! A common value is 10s. +! DTMIN ~= 10 +! +! * namelist must be terminated with / +! * definitions & defaults: +! TIMESTEPS%DTMAX = 0. ! maximum global time step (s) +! TIMESTEPS%DTXY = 0. ! maximum CFL time step for x-y (s) +! TIMESTEPS%DTKTH = 0. ! maximum CFL time step for k-th (s) +! TIMESTEPS%DTMIN = 0. ! minimum source term time step (s) +! -------------------------------------------------------------------- ! +&TIMESTEPS_NML + TIMESTEPS%DTMAX = 900. + TIMESTEPS%DTXY = 900. + TIMESTEPS%DTKTH = 900. + TIMESTEPS%DTMIN = 15. +/ + +! -------------------------------------------------------------------- ! +! Define the grid to preprocess via GRID_NML namelist +! +! * the tunable parameters for source terms, propagation schemes, and +! numerics are read using namelists. +! * Any namelist found in the folowing sections is temporarily written +! to param.scratch, and read from there if necessary. +! * The order of the namelists is immaterial. +! * Namelists not needed for the given switch settings will be skipped +! automatically +! +! * grid type can be : +! 'RECT' : rectilinear +! 'CURV' : curvilinear +! 'UNST' : unstructured (triangle-based) +! +! * coordinate system can be : +! 'SPHE' : Spherical (degrees) +! 'CART' : Cartesian (meters) +! +! * grid closure can only be applied in spherical coordinates +! +! * grid closure can be : +! 'NONE' : No closure is applied +! 'SMPL' : Simple grid closure. Grid is periodic in the +! : i-index and wraps at i=NX+1. In other words, +! : (NX+1,J) => (1,J). A grid with simple closure +! : may be rectilinear or curvilinear. +! 'TRPL' : Tripole grid closure : Grid is periodic in the +! : i-index and wraps at i=NX+1 and has closure at +! : j=NY+1. In other words, (NX+1,J<=NY) => (1,J) +! : and (I,NY+1) => (NX-I+1,NY). Tripole +! : grid closure requires that NX be even. A grid +! : with tripole closure must be curvilinear. +! +! * The coastline limit depth is the value which distinguish the sea +! points to the land points. All the points with depth values (ZBIN) +! greater than this limit (ZLIM) will be considered as excluded points +! and will never be wet points, even if the water level grows over. +! It can only overwrite the status of a sea point to a land point. +! The value must have a negative value under the mean sea level +! +! * The minimum water depth allowed to compute the model is the absolute +! depth value (DMIN) used in the model if the input depth is lower to +! avoid the model to blow up. +! +! * namelist must be terminated with / +! * definitions & defaults: +! GRID%NAME = 'unset' ! grid name (30 char) +! GRID%NML = 'namelists.nml' ! namelists filename +! GRID%TYPE = 'unset' ! grid type +! GRID%COORD = 'unset' ! coordinate system +! GRID%CLOS = 'unset' ! grid closure +! +! GRID%ZLIM = 0. ! coastline limit depth (m) +! GRID%DMIN = 0. ! abs. minimum water depth (m) +! -------------------------------------------------------------------- ! +&GRID_NML + GRID%NAME = 'HOMOGENEOUS SOURCE TERM TEST' + GRID%NML = '../input/namelists_ST4_T707.nml' + GRID%TYPE = 'RECT' + GRID%COORD = 'SPHE' + GRID%CLOS = 'NONE' + GRID%ZLIM = -5. + GRID%DMIN = 5.75 +/ + +! -------------------------------------------------------------------- ! +! Define the rectilinear grid type via RECT_NML namelist +! - only for RECT grids - +! +! * The minimum grid size is 3x3. +! +! * If the grid increments SX and SY are given in minutes of arc, the scaling +! factor SF must be set to 60. to provide an increment factor in degree. +! +! * If CSTRG='SMPL', then SX is forced to 360/NX. +! +! * value <= value_read / scale_fac +! +! * namelist must be terminated with / +! * definitions & defaults: +! RECT%NX = 0 ! number of points along x-axis +! RECT%NY = 0 ! number of points along y-axis +! +! RECT%SX = 0. ! grid increment along x-axis +! RECT%SY = 0. ! grid increment along y-axis +! RECT%SF = 1. ! scaling division factor for x-y axis +! +! RECT%X0 = 0. ! x-coordinate of lower-left corner (deg) +! RECT%Y0 = 0. ! y-coordinate of lower-left corner (deg) +! RECT%SF0 = 1. ! scaling division factor for x0,y0 coord +! -------------------------------------------------------------------- ! +&RECT_NML + RECT%NX = 3 + RECT%NY = 3 + RECT%SX = 1. + RECT%SY = 1. + RECT%SF = 1.E-2 + RECT%X0 = -1. + RECT%Y0 = -1. + RECT%SF0 = 1.E-2 +/ + +! -------------------------------------------------------------------- ! +! Define the depth to preprocess via DEPTH_NML namelist +! - for RECT and CURV grids - +! +! * if no obstruction subgrid, need to set &MISC FLAGTR = 0 +! +! * The depth value must have negative values under the mean sea level +! +! * value <= value_read * scale_fac +! +! * IDLA : Layout indicator : +! 1 : Read line-by-line bottom to top. (default) +! 2 : Like 1, single read statement. +! 3 : Read line-by-line top to bottom. +! 4 : Like 3, single read statement. +! * IDFM : format indicator : +! 1 : Free format. (default) +! 2 : Fixed format. +! 3 : Unformatted. +! * FORMAT : element format to read : +! '(....)' : auto detected (default) +! '(f10.6)' : float type +! +! * Example : +! IDF SF IDLA IDFM FORMAT FILENAME +! 50 0.001 1 1 '(....)' 'GLOB-30M.bot' +! +! * namelist must be terminated with / +! * definitions & defaults: +! DEPTH%SF = 1. ! scale factor +! DEPTH%FILENAME = 'unset' ! filename +! DEPTH%IDF = 50 ! file unit number +! DEPTH%IDLA = 1 ! layout indicator +! DEPTH%IDFM = 1 ! format indicator +! DEPTH%FORMAT = '(....)' ! formatted read format +! -------------------------------------------------------------------- ! +&DEPTH_NML + DEPTH%SF = -2500. + DEPTH%FILENAME = '../input/HOMOGENEOUS.depth' + DEPTH%IDLA = 3 +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_ts1/input_10ms/namelists_Romero.nml b/regtests/ww3_ts1/input_10ms/namelists_Romero.nml new file mode 100644 index 000000000..919c786d9 --- /dev/null +++ b/regtests/ww3_ts1/input_10ms/namelists_Romero.nml @@ -0,0 +1,20 @@ +&SIN4 BETAMAX = 1.43, SWELLF = 0.66, TAUWSHELTER = 0.3, Z0MAX = 0.0008, + SWELLF3 = 0.022, SWELLF4 = 150000.0, SWELLF7 = 360000.00, ZALP = 0.006 / +&SDS4 SDSBCHOICE = 3, SDSC2 = -3.80, FXFM3 = 20.00, WNMEANP = 1.0 , + SDSSTRAINA = 0.00, SDSSTRAIN = 0.00, SDSSTRAIN2 = 0.00, + SDSBR = 0.005, SDSBT = 0.0011, SDSCUM = 0.300, SDSC5 = 1.0, + SDSMWD = 0.90, SDSFACMTF = 400 / +&SNL1 NLPROP = 25000000.0 / + +&OUTS P2SF = 1, E3D = 1, I1P2SF = 1, I2P2SF = 36 / +&PRO3 WDTHCG = 1.50, WDTHTH = 1.50 / +&REF1 REFCOAST = 0.1, REFCOSP_STRAIGHT = 4, REFFREQ = 0., REFICEBERG = 0.4, + REFMAP = 0., REFSLOPE = 0., REFSUBGRID = 0.2, REFRMAX = 0.5 / +&SIC2 IC2DISPER = F, IC2TURB = 0.5 , IC2ROUGH = 0.0001, + IC2REYNOLDS = 150000, IC2SMOOTH = 200000., IC2VISC = 1.0 / +&SIS2 ISC1 = 1., IS2C2 = 0.000000, IS2C3 = 0. , IS2BACKSCAT = 1. , + IS2BREAK = T, IS2DUPDATE = F , IS2CREEPB = 5E8 , IS2CREEPD = 0.3 / +&MISC ICEHINIT = 0.5, ICEHMIN = 0.1, CICE0 = 0.25, NOSW =6, + CICEN = 2.00, LICE = 40000., FACBERG = 0.2 , + WCOR1=21., WCOR2=0.5 / +END OF NAMELISTS diff --git a/regtests/ww3_ts1/input_10ms/namelists_ST4_T471.nml b/regtests/ww3_ts1/input_10ms/namelists_ST4_T471.nml new file mode 100644 index 000000000..5ab7abb58 --- /dev/null +++ b/regtests/ww3_ts1/input_10ms/namelists_ST4_T471.nml @@ -0,0 +1,2 @@ +! T471 corresponds to the default parameter values for ST4. +END OF NAMELISTS diff --git a/regtests/ww3_ts1/input_10ms/namelists_ST4_T475.nml b/regtests/ww3_ts1/input_10ms/namelists_ST4_T475.nml new file mode 100644 index 000000000..e104247aa --- /dev/null +++ b/regtests/ww3_ts1/input_10ms/namelists_ST4_T475.nml @@ -0,0 +1,7 @@ +&SIN4 BETAMAX = 1.75, SWELLF = 0.66, TAUWSHELTER = 0.3, + SWELLF3 = 0.022, SWELLF4 = 115000.0, SWELLF7 = 432000.00 / +&SDS4 FXFM3 = 2.5 / +&SIC2 IC2ROUGH = 0.001000, IC2VISC = 2.000, IC2DMAX =0.300 / +&SIS2 ISC1 =0.200E+00, IS2BREAK = T, IS2DUPDATE = F, IS2CREEPB = 0.200E+08 / + +END OF NAMELISTS diff --git a/regtests/ww3_ts1/input_10ms/namelists_ST4_T701.nml b/regtests/ww3_ts1/input_10ms/namelists_ST4_T701.nml new file mode 100644 index 000000000..b107fef73 --- /dev/null +++ b/regtests/ww3_ts1/input_10ms/namelists_ST4_T701.nml @@ -0,0 +1,20 @@ +&SIN4 BETAMAX = 1.7, SWELLF = 0.60, TAUWSHELTER = 0.3, + SWELLF3 = 0.022, SWELLF4 = 115000.0, SWELLF7 = 432000.00 / +&SDS4 SDSBCHOICE = 3, SDSC2 = -3.80, FXFM3 = 20.00, CUMSIGP = 2, + SDSBR = 0.005, SDSBT = 0.0011, SDSCUM = 0.300, SDSC5 = 1.0, + SDSMWD = 2.00, SDSFACMTF = 400 / +&SNL1 NLPROP = 25000000.0 / + +&OUTS P2SF = 1, E3D = 1, I1P2SF = 1, I2P2SF = 36 / +&PRO3 WDTHCG = 1.50, WDTHTH = 1.50 / +&REF1 REFCOAST = 0.1, REFCOSP_STRAIGHT = 4, REFFREQ = 0., REFICEBERG = 0.4, + REFMAP = 0., REFSLOPE = 0., REFSUBGRID = 0.2, REFRMAX = 0.5 / + +&SIC2 IC2ROUGH = 0.001000, IC2VISC = 2.000, IC2DMAX =0.300 / +&SIS2 ISC1 =0.200E+00, IS2BREAK = T, IS2DUPDATE = F, IS2CREEPB = 0.200E+08, + IS2CREEPD = 0.50 / + +&MISC ICEHINIT = 0.5, ICEHMIN = 0.1, CICE0 = 0.25, NOSW =6, + CICEN = 2.00, LICE = 40000., FACBERG = 0.2 , + WCOR1=21., WCOR2=0.5 / +END OF NAMELISTS diff --git a/regtests/ww3_ts1/input_10ms/namelists_ST4_T702.nml b/regtests/ww3_ts1/input_10ms/namelists_ST4_T702.nml new file mode 100644 index 000000000..1b673567a --- /dev/null +++ b/regtests/ww3_ts1/input_10ms/namelists_ST4_T702.nml @@ -0,0 +1,14 @@ +&SIN4 BETAMAX = 1.7, SWELLF = 0.60, TAUWSHELTER = 0.2, + SWELLF3 = 0.022, SWELLF4 = 115000.0, SWELLF7 = 432000.00 / +&SDS4 SDSBCHOICE = 3, SDSC2 = -3.80, FXFM3 = 20.00, CUMSIGP = 2, + SDSSTRAINA = 0.00, SDSSTRAIN = 0.00, SDSSTRAIN2 = 0.00, + SDSBR = 0.005, SDSBT = 0.0011, SDSCUM = 0.300, SDSC5 = 1.0, + SDSMWD = 0.00, SDSFACMTF = 400 / +&SNL1 NLPROP = 25000000.0 / +&SIC2 IC2ROUGH = 0.001000, IC2VISC = 2.000, IC2DMAX =0.300 / +&SIS2 ISC1 =0.200E+00, IS2BREAK = T, IS2DUPDATE = F, IS2CREEPB = 0.200E+08 / +! DO NOT FORGET TO ADD FLAGTR = 4 for real life runs ... +&MISC ICEHINIT = 0.5, ICEHMIN = 0.1, CICE0 = 0.25, NOSW =6, + CICEN = 2.00, LICE = 40000., FACBERG = 0.2 , + WCOR1=21., WCOR2=0.5 / +END OF NAMELISTS diff --git a/regtests/ww3_ts1/input_10ms/namelists_ST4_T707.nml b/regtests/ww3_ts1/input_10ms/namelists_ST4_T707.nml new file mode 100644 index 000000000..8d19dd444 --- /dev/null +++ b/regtests/ww3_ts1/input_10ms/namelists_ST4_T707.nml @@ -0,0 +1,14 @@ + &SNL1 IQTYPE = -2, GQMNF1 = 11, GQMNT1 = 6, GQMNQ_OM2 = 6, + TAILNL=-5.0, GQMTHRSAT=5E-5, GQMTHRCOU = 0.05, GQAMP1=1., + GQAMP2=0.0022, GQAMP3=1., GQAMP4=1.0 / + &SIN4 BETAMAX = 1.6, TAUWSHELTER = 0.0 / + &SDS4 SDSBCHOICE=3, SDSC2 = -2.3, SDSBR = 0.005, CUMSIGP =2.0, + FXFM3 = 20, SDSFACMTF = 400., + SDSMWD = 2., SDSCUM = 0.35, SDSNUW =0, SDSC5=1., SDSBRF1=0.5 / +&SIC2 IC2ROUGH = 0.001000, IC2VISC = 2.000, IC2DMAX =0.300 / +&SIS2 ISC1 =0.200E+00, IS2BREAK = T, IS2DUPDATE = F, IS2CREEPB = 0.200E+08 / +! DO NOT FORGET TO ADD FLAGTR = 4 for real life runs ... +&MISC ICEHINIT = 0.5, ICEHMIN = 0.1, CICE0 = 0.25, NOSW =6, + CICEN = 2.00, LICE = 40000., FACBERG = 0.2 , + WCOR1=21., WCOR2=0.5 / +END OF NAMELISTS diff --git a/regtests/ww3_ts1/input_10ms/namelists_ST4_T713.nml b/regtests/ww3_ts1/input_10ms/namelists_ST4_T713.nml new file mode 100644 index 000000000..fa4a7eb78 --- /dev/null +++ b/regtests/ww3_ts1/input_10ms/namelists_ST4_T713.nml @@ -0,0 +1,15 @@ + &SNL1 IQTYPE = -2, GQMNF1 = 11, GQMNT1 = 6, GQMNQ_OM2 = 6, + TAILNL=-5.0, GQMTHRSAT=5E-5, GQMTHRCOU = 0.05, GQAMP1=1., + GQAMP2=0.0022, GQAMP3=2. / +&SIN4 BETAMAX = 1.1, TAUWSHELTER = 0.0, TAUWBUG = 0, + VISCSTRESS =1., SINTABLE=0 / +&SDS4 SDSBCHOICE=3, SDSC2 = -2.5, SDSBR = 0.005, CUMSIGP =2.0, + SDSSTRAIN2 =1.,SDSCUMP=1., FXFM3 = 20, SDSFACMTF = 200., + SDSMWD = 0.9, SDSCUM = 0.3, SDSNUW =0, SDSC5=0.5, SDSBRF1=0.5 / +&SIC2 IC2ROUGH = 0.001000, IC2VISC = 2.000, IC2DMAX =0.300 / +&SIS2 ISC1 =0.200E+00, IS2BREAK = T, IS2DUPDATE = F, IS2CREEPB = 0.200E+08 / +! DO NOT FORGET TO ADD FLAGTR = 4 for real life runs ... +&MISC ICEHINIT = 0.5, ICEHMIN = 0.1, CICE0 = 0.25, NOSW =6, + CICEN = 2.00, LICE = 40000., FACBERG = 0.2 , + WCOR1=21., WCOR2=0.5 / +END OF NAMELISTS diff --git a/regtests/ww3_ts1/input_10ms/points.list b/regtests/ww3_ts1/input_10ms/points.list new file mode 100644 index 000000000..5ad8fde50 --- /dev/null +++ b/regtests/ww3_ts1/input_10ms/points.list @@ -0,0 +1 @@ +0.0 0.0 'The_point' diff --git a/regtests/ww3_ts1/input_10ms/switch b/regtests/ww3_ts1/input_10ms/switch new file mode 100644 index 000000000..c3b8938ee --- /dev/null +++ b/regtests/ww3_ts1/input_10ms/switch @@ -0,0 +1 @@ +NOGRB SHRD PR0 FLX0 LN1 ST4 NL1 BT1 DB1 TR0 BS0 IC0 IS0 REF0 WNT1 WNX1 CRT1 CRX1 O0 O1 O2 O3 O4 O5 O6 O7 O10 O11 diff --git a/regtests/ww3_ts1/input_10ms/switch_ST4 b/regtests/ww3_ts1/input_10ms/switch_ST4 new file mode 100644 index 000000000..c3b8938ee --- /dev/null +++ b/regtests/ww3_ts1/input_10ms/switch_ST4 @@ -0,0 +1 @@ +NOGRB SHRD PR0 FLX0 LN1 ST4 NL1 BT1 DB1 TR0 BS0 IC0 IS0 REF0 WNT1 WNX1 CRT1 CRX1 O0 O1 O2 O3 O4 O5 O6 O7 O10 O11 diff --git a/regtests/ww3_ts1/input_10ms/ww3_grid_Romero.nml b/regtests/ww3_ts1/input_10ms/ww3_grid_Romero.nml new file mode 100644 index 000000000..c510784c1 --- /dev/null +++ b/regtests/ww3_ts1/input_10ms/ww3_grid_Romero.nml @@ -0,0 +1,225 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III - ww3_grid.nml - Grid pre-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the spectrum parameterization via SPECTRUM_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! SPECTRUM%XFR = 0. ! frequency increment +! SPECTRUM%FREQ1 = 0. ! first frequency (Hz) +! SPECTRUM%NK = 0 ! number of frequencies (wavenumbers) +! SPECTRUM%NTH = 0 ! number of direction bins +! SPECTRUM%THOFF = 0. ! relative offset of first direction [-0.5,0.5] +! -------------------------------------------------------------------- ! +&SPECTRUM_NML + SPECTRUM%XFR = 1.10 + SPECTRUM%FREQ1 = 0.034 + SPECTRUM%NK = 36 + SPECTRUM%NTH = 36 +/ + +! -------------------------------------------------------------------- ! +! Define the run parameterization via RUN_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! RUN%FLDRY = F ! dry run (I/O only, no calculation) +! RUN%FLCX = F ! x-component of propagation +! RUN%FLCY = F ! y-component of propagation +! RUN%FLCTH = F ! direction shift +! RUN%FLCK = F ! wavenumber shift +! RUN%FLSOU = F ! source terms +! -------------------------------------------------------------------- ! +&RUN_NML + RUN%FLSOU = T +/ + +! -------------------------------------------------------------------- ! +! Define the timesteps parameterization via TIMESTEPS_NML namelist +! +! * It is highly recommended to set up time steps which are multiple +! between them. +! +! * The first time step to calculate is the maximum CFL time step +! which depend on the lowest frequency FREQ1 previously set up and the +! lowest spatial grid resolution in meters DXY. +! reminder : 1 degree=60minutes // 1minute=1mile // 1mile=1.852km +! The formula for the CFL time is : +! Tcfl = DXY / (G / (FREQ1*4*Pi) ) with the constants Pi=3,14 and G=9.8m/s²; +! DTXY ~= 90% Tcfl +! DTMAX ~= 3 * DTXY (maximum global time step limit) +! +! * The refraction time step depends on how strong can be the current velocities +! on your grid : +! DTKTH ~= DTMAX / 2 ! in case of no or light current velocities +! DTKTH ~= DTMAX / 10 ! in case of strong current velocities +! +! * The source terms time step is usually defined between 1s and 60s. +! A common value is 10s. +! DTMIN = 10 +! +! * namelist must be terminated with / +! * definitions & defaults: +! TIMESTEPS%DTMAX = 0. ! maximum global time step (s) +! TIMESTEPS%DTXY = 0. ! maximum CFL time step for x-y (s) +! TIMESTEPS%DTKTH = 0. ! maximum CFL time step for k-th (s) +! TIMESTEPS%DTMIN = 0. ! minimum source term time step (s) +! -------------------------------------------------------------------- ! +&TIMESTEPS_NML + TIMESTEPS%DTMAX = 900. + TIMESTEPS%DTXY = 900. + TIMESTEPS%DTKTH = 900. + TIMESTEPS%DTMIN = 15. +/ + +! -------------------------------------------------------------------- ! +! Define the grid to preprocess via GRID_NML namelist +! +! * the tunable parameters for source terms, propagation schemes, and +! numerics are read using namelists. +! * Any namelist found in the folowing sections is temporarily written +! to param.scratch, and read from there if necessary. +! * The order of the namelists is immaterial. +! * Namelists not needed for the given switch settings will be skipped +! automatically +! +! * grid type can be : +! 'RECT' : rectilinear +! 'CURV' : curvilinear +! 'UNST' : unstructured (triangle-based) +! +! * coordinate system can be : +! 'SPHE' : Spherical (degrees) +! 'CART' : Cartesian (meters) +! +! * grid closure can only be applied in spherical coordinates +! +! * grid closure can be : +! 'NONE' : No closure is applied +! 'SMPL' : Simple grid closure. Grid is periodic in the +! : i-index and wraps at i=NX+1. In other words, +! : (NX+1,J) => (1,J). A grid with simple closure +! : may be rectilinear or curvilinear. +! 'TRPL' : Tripole grid closure : Grid is periodic in the +! : i-index and wraps at i=NX+1 and has closure at +! : j=NY+1. In other words, (NX+1,J<=NY) => (1,J) +! : and (I,NY+1) => (NX-I+1,NY). Tripole +! : grid closure requires that NX be even. A grid +! : with tripole closure must be curvilinear. +! +! * The coastline limit depth is the value which distinguish the sea +! points to the land points. All the points with depth values (ZBIN) +! greater than this limit (ZLIM) will be considered as excluded points +! and will never be wet points, even if the water level grows over. +! It can only overwrite the status of a sea point to a land point. +! The value must have a negative value under the mean sea level +! +! * The minimum water depth allowed to compute the model is the absolute +! depth value (DMIN) used in the model if the input depth is lower to +! avoid the model to blow up. +! +! * namelist must be terminated with / +! * definitions & defaults: +! GRID%NAME = 'unset' ! grid name (30 char) +! GRID%NML = 'namelists.nml' ! namelists filename +! GRID%TYPE = 'unset' ! grid type +! GRID%COORD = 'unset' ! coordinate system +! GRID%CLOS = 'unset' ! grid closure +! +! GRID%ZLIM = 0. ! coastline limit depth (m) +! GRID%DMIN = 0. ! abs. minimum water depth (m) +! -------------------------------------------------------------------- ! +&GRID_NML + GRID%NAME = 'HOMOGENEOUS SOURCE TERM TEST' + GRID%NML = '../input_10ms/namelists_Romero.nml' + GRID%TYPE = 'RECT' + GRID%COORD = 'SPHE' + GRID%CLOS = 'NONE' + GRID%ZLIM = -5. + GRID%DMIN = 5.75 +/ + +! -------------------------------------------------------------------- ! +! Define the rectilinear grid type via RECT_NML namelist +! - only for RECT grids - +! +! * The minimum grid size is 3x3. +! +! * If the grid increments SX and SY are given in minutes of arc, the scaling +! factor SF must be set to 60. to provide an increment factor in degree. +! +! * If CSTRG='SMPL', then SX is forced to 360/NX. +! +! * value <= value_read / scale_fac +! +! * namelist must be terminated with / +! * definitions & defaults: +! RECT%NX = 0 ! number of points along x-axis +! RECT%NY = 0 ! number of points along y-axis +! +! RECT%SX = 0. ! grid increment along x-axis +! RECT%SY = 0. ! grid increment along y-axis +! RECT%SF = 1. ! scaling division factor for x-y axis +! +! RECT%X0 = 0. ! x-coordinate of lower-left corner (deg) +! RECT%Y0 = 0. ! y-coordinate of lower-left corner (deg) +! RECT%SF0 = 1. ! scaling division factor for x0,y0 coord +! -------------------------------------------------------------------- ! +&RECT_NML + RECT%NX = 3 + RECT%NY = 3 + RECT%SX = 1. + RECT%SY = 1. + RECT%SF = 1.E-2 + RECT%X0 = -1. + RECT%Y0 = -1. + RECT%SF0 = 1.E-2 +/ + +! -------------------------------------------------------------------- ! +! Define the depth to preprocess via DEPTH_NML namelist +! - for RECT and CURV grids - +! +! * if no obstruction subgrid, need to set &MISC FLAGTR = 0 +! +! * The depth value must have negative values under the mean sea level +! +! * value <= value_read * scale_fac +! +! * IDLA : Layout indicator : +! 1 : Read line-by-line bottom to top. (default) +! 2 : Like 1, single read statement. +! 3 : Read line-by-line top to bottom. +! 4 : Like 3, single read statement. +! * IDFM : format indicator : +! 1 : Free format. (default) +! 2 : Fixed format. +! 3 : Unformatted. +! * FORMAT : element format to read : +! '(....)' : auto detected (default) +! '(f10.6)' : float type +! +! * Example : +! IDF SF IDLA IDFM FORMAT FILENAME +! 50 0.001 1 1 '(....)' 'GLOB-30M.bot' +! +! * namelist must be terminated with / +! * definitions & defaults: +! DEPTH%SF = 1. ! scale factor +! DEPTH%FILENAME = 'unset' ! filename +! DEPTH%IDF = 50 ! file unit number +! DEPTH%IDLA = 1 ! layout indicator +! DEPTH%IDFM = 1 ! format indicator +! DEPTH%FORMAT = '(....)' ! formatted read format +! -------------------------------------------------------------------- ! +&DEPTH_NML + DEPTH%SF = -2500. + DEPTH%FILENAME = '../input/HOMOGENEOUS.depth' + DEPTH%IDLA = 3 +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_ts1/input_10ms/ww3_grid_ST4_T471.nml b/regtests/ww3_ts1/input_10ms/ww3_grid_ST4_T471.nml new file mode 100644 index 000000000..80069e4a1 --- /dev/null +++ b/regtests/ww3_ts1/input_10ms/ww3_grid_ST4_T471.nml @@ -0,0 +1,225 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III - ww3_grid.nml - Grid pre-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the spectrum parameterization via SPECTRUM_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! SPECTRUM%XFR = 0. ! frequency increment +! SPECTRUM%FREQ1 = 0. ! first frequency (Hz) +! SPECTRUM%NK = 0 ! number of frequencies (wavenumbers) +! SPECTRUM%NTH = 0 ! number of direction bins +! SPECTRUM%THOFF = 0. ! relative offset of first direction [-0.5,0.5] +! -------------------------------------------------------------------- ! +&SPECTRUM_NML + SPECTRUM%XFR = 1.10 + SPECTRUM%FREQ1 = 0.034 + SPECTRUM%NK = 36 + SPECTRUM%NTH = 36 +/ + +! -------------------------------------------------------------------- ! +! Define the run parameterization via RUN_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! RUN%FLDRY = F ! dry run (I/O only, no calculation) +! RUN%FLCX = F ! x-component of propagation +! RUN%FLCY = F ! y-component of propagation +! RUN%FLCTH = F ! direction shift +! RUN%FLCK = F ! wavenumber shift +! RUN%FLSOU = F ! source terms +! -------------------------------------------------------------------- ! +&RUN_NML + RUN%FLSOU = T +/ + +! -------------------------------------------------------------------- ! +! Define the timesteps parameterization via TIMESTEPS_NML namelist +! +! * It is highly recommended to set up time steps which are multiple +! between them. +! +! * The first time step to calculate is the maximum CFL time step +! which depend on the lowest frequency FREQ1 previously set up and the +! lowest spatial grid resolution in meters DXY. +! reminder : 1 degree=60minutes // 1minute=1mile // 1mile=1.852km +! The formula for the CFL time is : +! Tcfl = DXY / (G / (FREQ1*4*Pi) ) with the constants Pi=3,14 and G=9.8m/s²; +! DTXY ~= 90% Tcfl +! DTMAX ~= 3 * DTXY (maximum global time step limit) +! +! * The refraction time step depends on how strong can be the current velocities +! on your grid : +! DTKTH ~= DTMAX / 2 ! in case of no or light current velocities +! DTKTH ~= DTMAX / 10 ! in case of strong current velocities +! +! * The source terms time step is usually defined between 1s and 60s. +! A common value is 10s. +! DTMIN = 10 +! +! * namelist must be terminated with / +! * definitions & defaults: +! TIMESTEPS%DTMAX = 0. ! maximum global time step (s) +! TIMESTEPS%DTXY = 0. ! maximum CFL time step for x-y (s) +! TIMESTEPS%DTKTH = 0. ! maximum CFL time step for k-th (s) +! TIMESTEPS%DTMIN = 0. ! minimum source term time step (s) +! -------------------------------------------------------------------- ! +&TIMESTEPS_NML + TIMESTEPS%DTMAX = 900. + TIMESTEPS%DTXY = 900. + TIMESTEPS%DTKTH = 900. + TIMESTEPS%DTMIN = 15. +/ + +! -------------------------------------------------------------------- ! +! Define the grid to preprocess via GRID_NML namelist +! +! * the tunable parameters for source terms, propagation schemes, and +! numerics are read using namelists. +! * Any namelist found in the folowing sections is temporarily written +! to param.scratch, and read from there if necessary. +! * The order of the namelists is immaterial. +! * Namelists not needed for the given switch settings will be skipped +! automatically +! +! * grid type can be : +! 'RECT' : rectilinear +! 'CURV' : curvilinear +! 'UNST' : unstructured (triangle-based) +! +! * coordinate system can be : +! 'SPHE' : Spherical (degrees) +! 'CART' : Cartesian (meters) +! +! * grid closure can only be applied in spherical coordinates +! +! * grid closure can be : +! 'NONE' : No closure is applied +! 'SMPL' : Simple grid closure. Grid is periodic in the +! : i-index and wraps at i=NX+1. In other words, +! : (NX+1,J) => (1,J). A grid with simple closure +! : may be rectilinear or curvilinear. +! 'TRPL' : Tripole grid closure : Grid is periodic in the +! : i-index and wraps at i=NX+1 and has closure at +! : j=NY+1. In other words, (NX+1,J<=NY) => (1,J) +! : and (I,NY+1) => (NX-I+1,NY). Tripole +! : grid closure requires that NX be even. A grid +! : with tripole closure must be curvilinear. +! +! * The coastline limit depth is the value which distinguish the sea +! points to the land points. All the points with depth values (ZBIN) +! greater than this limit (ZLIM) will be considered as excluded points +! and will never be wet points, even if the water level grows over. +! It can only overwrite the status of a sea point to a land point. +! The value must have a negative value under the mean sea level +! +! * The minimum water depth allowed to compute the model is the absolute +! depth value (DMIN) used in the model if the input depth is lower to +! avoid the model to blow up. +! +! * namelist must be terminated with / +! * definitions & defaults: +! GRID%NAME = 'unset' ! grid name (30 char) +! GRID%NML = 'namelists.nml' ! namelists filename +! GRID%TYPE = 'unset' ! grid type +! GRID%COORD = 'unset' ! coordinate system +! GRID%CLOS = 'unset' ! grid closure +! +! GRID%ZLIM = 0. ! coastline limit depth (m) +! GRID%DMIN = 0. ! abs. minimum water depth (m) +! -------------------------------------------------------------------- ! +&GRID_NML + GRID%NAME = 'HOMOGENEOUS SOURCE TERM TEST' + GRID%NML = '../input_10ms/namelists_ST4_T471.nml' + GRID%TYPE = 'RECT' + GRID%COORD = 'SPHE' + GRID%CLOS = 'NONE' + GRID%ZLIM = -5. + GRID%DMIN = 5.75 +/ + +! -------------------------------------------------------------------- ! +! Define the rectilinear grid type via RECT_NML namelist +! - only for RECT grids - +! +! * The minimum grid size is 3x3. +! +! * If the grid increments SX and SY are given in minutes of arc, the scaling +! factor SF must be set to 60. to provide an increment factor in degree. +! +! * If CSTRG='SMPL', then SX is forced to 360/NX. +! +! * value <= value_read / scale_fac +! +! * namelist must be terminated with / +! * definitions & defaults: +! RECT%NX = 0 ! number of points along x-axis +! RECT%NY = 0 ! number of points along y-axis +! +! RECT%SX = 0. ! grid increment along x-axis +! RECT%SY = 0. ! grid increment along y-axis +! RECT%SF = 1. ! scaling division factor for x-y axis +! +! RECT%X0 = 0. ! x-coordinate of lower-left corner (deg) +! RECT%Y0 = 0. ! y-coordinate of lower-left corner (deg) +! RECT%SF0 = 1. ! scaling division factor for x0,y0 coord +! -------------------------------------------------------------------- ! +&RECT_NML + RECT%NX = 3 + RECT%NY = 3 + RECT%SX = 1. + RECT%SY = 1. + RECT%SF = 1.E-2 + RECT%X0 = -1. + RECT%Y0 = -1. + RECT%SF0 = 1.E-2 +/ + +! -------------------------------------------------------------------- ! +! Define the depth to preprocess via DEPTH_NML namelist +! - for RECT and CURV grids - +! +! * if no obstruction subgrid, need to set &MISC FLAGTR = 0 +! +! * The depth value must have negative values under the mean sea level +! +! * value <= value_read * scale_fac +! +! * IDLA : Layout indicator : +! 1 : Read line-by-line bottom to top. (default) +! 2 : Like 1, single read statement. +! 3 : Read line-by-line top to bottom. +! 4 : Like 3, single read statement. +! * IDFM : format indicator : +! 1 : Free format. (default) +! 2 : Fixed format. +! 3 : Unformatted. +! * FORMAT : element format to read : +! '(....)' : auto detected (default) +! '(f10.6)' : float type +! +! * Example : +! IDF SF IDLA IDFM FORMAT FILENAME +! 50 0.001 1 1 '(....)' 'GLOB-30M.bot' +! +! * namelist must be terminated with / +! * definitions & defaults: +! DEPTH%SF = 1. ! scale factor +! DEPTH%FILENAME = 'unset' ! filename +! DEPTH%IDF = 50 ! file unit number +! DEPTH%IDLA = 1 ! layout indicator +! DEPTH%IDFM = 1 ! format indicator +! DEPTH%FORMAT = '(....)' ! formatted read format +! -------------------------------------------------------------------- ! +&DEPTH_NML + DEPTH%SF = -2500. + DEPTH%FILENAME = '../input/HOMOGENEOUS.depth' + DEPTH%IDLA = 3 +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_ts1/input_10ms/ww3_grid_ST4_T475.nml b/regtests/ww3_ts1/input_10ms/ww3_grid_ST4_T475.nml new file mode 100644 index 000000000..7d41e0b7d --- /dev/null +++ b/regtests/ww3_ts1/input_10ms/ww3_grid_ST4_T475.nml @@ -0,0 +1,225 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III - ww3_grid.nml - Grid pre-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the spectrum parameterization via SPECTRUM_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! SPECTRUM%XFR = 0. ! frequency increment +! SPECTRUM%FREQ1 = 0. ! first frequency (Hz) +! SPECTRUM%NK = 0 ! number of frequencies (wavenumbers) +! SPECTRUM%NTH = 0 ! number of direction bins +! SPECTRUM%THOFF = 0. ! relative offset of first direction [-0.5,0.5] +! -------------------------------------------------------------------- ! +&SPECTRUM_NML + SPECTRUM%XFR = 1.10 + SPECTRUM%FREQ1 = 0.0485 + SPECTRUM%NK = 36 + SPECTRUM%NTH = 24 +/ + +! -------------------------------------------------------------------- ! +! Define the run parameterization via RUN_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! RUN%FLDRY = F ! dry run (I/O only, no calculation) +! RUN%FLCX = F ! x-component of propagation +! RUN%FLCY = F ! y-component of propagation +! RUN%FLCTH = F ! direction shift +! RUN%FLCK = F ! wavenumber shift +! RUN%FLSOU = F ! source terms +! -------------------------------------------------------------------- ! +&RUN_NML + RUN%FLSOU = T +/ + +! -------------------------------------------------------------------- ! +! Define the timesteps parameterization via TIMESTEPS_NML namelist +! +! * It is highly recommended to set up time steps which are multiple +! between them. +! +! * The first time step to calculate is the maximum CFL time step +! which depend on the lowest frequency FREQ1 previously set up and the +! lowest spatial grid resolution in meters DXY. +! reminder : 1 degree=60minutes // 1minute=1mile // 1mile=1.852km +! The formula for the CFL time is : +! Tcfl = DXY / (G / (FREQ1*4*Pi) ) with the constants Pi=3,14 and G=9.8m/s²; +! DTXY ~= 90% Tcfl +! DTMAX ~= 3 * DTXY (maximum global time step limit) +! +! * The refraction time step depends on how strong can be the current velocities +! on your grid : +! DTKTH ~= DTMAX / 2 ! in case of no or light current velocities +! DTKTH ~= DTMAX / 10 ! in case of strong current velocities +! +! * The source terms time step is usually defined between 5s and 60s. +! A common value is 10s. +! DTMIN ~= 10 +! +! * namelist must be terminated with / +! * definitions & defaults: +! TIMESTEPS%DTMAX = 0. ! maximum global time step (s) +! TIMESTEPS%DTXY = 0. ! maximum CFL time step for x-y (s) +! TIMESTEPS%DTKTH = 0. ! maximum CFL time step for k-th (s) +! TIMESTEPS%DTMIN = 0. ! minimum source term time step (s) +! -------------------------------------------------------------------- ! +&TIMESTEPS_NML + TIMESTEPS%DTMAX = 900. + TIMESTEPS%DTXY = 900. + TIMESTEPS%DTKTH = 900. + TIMESTEPS%DTMIN = 15. +/ + +! -------------------------------------------------------------------- ! +! Define the grid to preprocess via GRID_NML namelist +! +! * the tunable parameters for source terms, propagation schemes, and +! numerics are read using namelists. +! * Any namelist found in the folowing sections is temporarily written +! to param.scratch, and read from there if necessary. +! * The order of the namelists is immaterial. +! * Namelists not needed for the given switch settings will be skipped +! automatically +! +! * grid type can be : +! 'RECT' : rectilinear +! 'CURV' : curvilinear +! 'UNST' : unstructured (triangle-based) +! +! * coordinate system can be : +! 'SPHE' : Spherical (degrees) +! 'CART' : Cartesian (meters) +! +! * grid closure can only be applied in spherical coordinates +! +! * grid closure can be : +! 'NONE' : No closure is applied +! 'SMPL' : Simple grid closure. Grid is periodic in the +! : i-index and wraps at i=NX+1. In other words, +! : (NX+1,J) => (1,J). A grid with simple closure +! : may be rectilinear or curvilinear. +! 'TRPL' : Tripole grid closure : Grid is periodic in the +! : i-index and wraps at i=NX+1 and has closure at +! : j=NY+1. In other words, (NX+1,J<=NY) => (1,J) +! : and (I,NY+1) => (NX-I+1,NY). Tripole +! : grid closure requires that NX be even. A grid +! : with tripole closure must be curvilinear. +! +! * The coastline limit depth is the value which distinguish the sea +! points to the land points. All the points with depth values (ZBIN) +! greater than this limit (ZLIM) will be considered as excluded points +! and will never be wet points, even if the water level grows over. +! It can only overwrite the status of a sea point to a land point. +! The value must have a negative value under the mean sea level +! +! * The minimum water depth allowed to compute the model is the absolute +! depth value (DMIN) used in the model if the input depth is lower to +! avoid the model to blow up. +! +! * namelist must be terminated with / +! * definitions & defaults: +! GRID%NAME = 'unset' ! grid name (30 char) +! GRID%NML = 'namelists.nml' ! namelists filename +! GRID%TYPE = 'unset' ! grid type +! GRID%COORD = 'unset' ! coordinate system +! GRID%CLOS = 'unset' ! grid closure +! +! GRID%ZLIM = 0. ! coastline limit depth (m) +! GRID%DMIN = 0. ! abs. minimum water depth (m) +! -------------------------------------------------------------------- ! +&GRID_NML + GRID%NAME = 'HOMOGENEOUS SOURCE TERM TEST' + GRID%NML = '../input_10ms/namelists_ST4_T475.nml' + GRID%TYPE = 'RECT' + GRID%COORD = 'SPHE' + GRID%CLOS = 'NONE' + GRID%ZLIM = -5. + GRID%DMIN = 5.75 +/ + +! -------------------------------------------------------------------- ! +! Define the rectilinear grid type via RECT_NML namelist +! - only for RECT grids - +! +! * The minimum grid size is 3x3. +! +! * If the grid increments SX and SY are given in minutes of arc, the scaling +! factor SF must be set to 60. to provide an increment factor in degree. +! +! * If CSTRG='SMPL', then SX is forced to 360/NX. +! +! * value <= value_read / scale_fac +! +! * namelist must be terminated with / +! * definitions & defaults: +! RECT%NX = 0 ! number of points along x-axis +! RECT%NY = 0 ! number of points along y-axis +! +! RECT%SX = 0. ! grid increment along x-axis +! RECT%SY = 0. ! grid increment along y-axis +! RECT%SF = 1. ! scaling division factor for x-y axis +! +! RECT%X0 = 0. ! x-coordinate of lower-left corner (deg) +! RECT%Y0 = 0. ! y-coordinate of lower-left corner (deg) +! RECT%SF0 = 1. ! scaling division factor for x0,y0 coord +! -------------------------------------------------------------------- ! +&RECT_NML + RECT%NX = 3 + RECT%NY = 3 + RECT%SX = 1. + RECT%SY = 1. + RECT%SF = 1.E-2 + RECT%X0 = -1. + RECT%Y0 = -1. + RECT%SF0 = 1.E-2 +/ + +! -------------------------------------------------------------------- ! +! Define the depth to preprocess via DEPTH_NML namelist +! - for RECT and CURV grids - +! +! * if no obstruction subgrid, need to set &MISC FLAGTR = 0 +! +! * The depth value must have negative values under the mean sea level +! +! * value <= value_read * scale_fac +! +! * IDLA : Layout indicator : +! 1 : Read line-by-line bottom to top. (default) +! 2 : Like 1, single read statement. +! 3 : Read line-by-line top to bottom. +! 4 : Like 3, single read statement. +! * IDFM : format indicator : +! 1 : Free format. (default) +! 2 : Fixed format. +! 3 : Unformatted. +! * FORMAT : element format to read : +! '(....)' : auto detected (default) +! '(f10.6)' : float type +! +! * Example : +! IDF SF IDLA IDFM FORMAT FILENAME +! 50 0.001 1 1 '(....)' 'GLOB-30M.bot' +! +! * namelist must be terminated with / +! * definitions & defaults: +! DEPTH%SF = 1. ! scale factor +! DEPTH%FILENAME = 'unset' ! filename +! DEPTH%IDF = 50 ! file unit number +! DEPTH%IDLA = 1 ! layout indicator +! DEPTH%IDFM = 1 ! format indicator +! DEPTH%FORMAT = '(....)' ! formatted read format +! -------------------------------------------------------------------- ! +&DEPTH_NML + DEPTH%SF = -2500. + DEPTH%FILENAME = '../input/HOMOGENEOUS.depth' + DEPTH%IDLA = 3 +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_ts1/input_10ms/ww3_grid_ST4_T701.nml b/regtests/ww3_ts1/input_10ms/ww3_grid_ST4_T701.nml new file mode 100644 index 000000000..d7aca045c --- /dev/null +++ b/regtests/ww3_ts1/input_10ms/ww3_grid_ST4_T701.nml @@ -0,0 +1,225 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III - ww3_grid.nml - Grid pre-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the spectrum parameterization via SPECTRUM_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! SPECTRUM%XFR = 0. ! frequency increment +! SPECTRUM%FREQ1 = 0. ! first frequency (Hz) +! SPECTRUM%NK = 0 ! number of frequencies (wavenumbers) +! SPECTRUM%NTH = 0 ! number of direction bins +! SPECTRUM%THOFF = 0. ! relative offset of first direction [-0.5,0.5] +! -------------------------------------------------------------------- ! +&SPECTRUM_NML + SPECTRUM%XFR = 1.10 + SPECTRUM%FREQ1 = 0.034 + SPECTRUM%NK = 36 + SPECTRUM%NTH = 36 +/ + +! -------------------------------------------------------------------- ! +! Define the run parameterization via RUN_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! RUN%FLDRY = F ! dry run (I/O only, no calculation) +! RUN%FLCX = F ! x-component of propagation +! RUN%FLCY = F ! y-component of propagation +! RUN%FLCTH = F ! direction shift +! RUN%FLCK = F ! wavenumber shift +! RUN%FLSOU = F ! source terms +! -------------------------------------------------------------------- ! +&RUN_NML + RUN%FLSOU = T +/ + +! -------------------------------------------------------------------- ! +! Define the timesteps parameterization via TIMESTEPS_NML namelist +! +! * It is highly recommended to set up time steps which are multiple +! between them. +! +! * The first time step to calculate is the maximum CFL time step +! which depend on the lowest frequency FREQ1 previously set up and the +! lowest spatial grid resolution in meters DXY. +! reminder : 1 degree=60minutes // 1minute=1mile // 1mile=1.852km +! The formula for the CFL time is : +! Tcfl = DXY / (G / (FREQ1*4*Pi) ) with the constants Pi=3,14 and G=9.8m/s²; +! DTXY ~= 90% Tcfl +! DTMAX ~= 3 * DTXY (maximum global time step limit) +! +! * The refraction time step depends on how strong can be the current velocities +! on your grid : +! DTKTH ~= DTMAX / 2 ! in case of no or light current velocities +! DTKTH ~= DTMAX / 10 ! in case of strong current velocities +! +! * The source terms time step is usually defined between 1s and 60s. +! A common value is 10s. +! DTMIN = 10 +! +! * namelist must be terminated with / +! * definitions & defaults: +! TIMESTEPS%DTMAX = 0. ! maximum global time step (s) +! TIMESTEPS%DTXY = 0. ! maximum CFL time step for x-y (s) +! TIMESTEPS%DTKTH = 0. ! maximum CFL time step for k-th (s) +! TIMESTEPS%DTMIN = 0. ! minimum source term time step (s) +! -------------------------------------------------------------------- ! +&TIMESTEPS_NML + TIMESTEPS%DTMAX = 900. + TIMESTEPS%DTXY = 900. + TIMESTEPS%DTKTH = 900. + TIMESTEPS%DTMIN = 15. +/ + +! -------------------------------------------------------------------- ! +! Define the grid to preprocess via GRID_NML namelist +! +! * the tunable parameters for source terms, propagation schemes, and +! numerics are read using namelists. +! * Any namelist found in the folowing sections is temporarily written +! to param.scratch, and read from there if necessary. +! * The order of the namelists is immaterial. +! * Namelists not needed for the given switch settings will be skipped +! automatically +! +! * grid type can be : +! 'RECT' : rectilinear +! 'CURV' : curvilinear +! 'UNST' : unstructured (triangle-based) +! +! * coordinate system can be : +! 'SPHE' : Spherical (degrees) +! 'CART' : Cartesian (meters) +! +! * grid closure can only be applied in spherical coordinates +! +! * grid closure can be : +! 'NONE' : No closure is applied +! 'SMPL' : Simple grid closure. Grid is periodic in the +! : i-index and wraps at i=NX+1. In other words, +! : (NX+1,J) => (1,J). A grid with simple closure +! : may be rectilinear or curvilinear. +! 'TRPL' : Tripole grid closure : Grid is periodic in the +! : i-index and wraps at i=NX+1 and has closure at +! : j=NY+1. In other words, (NX+1,J<=NY) => (1,J) +! : and (I,NY+1) => (NX-I+1,NY). Tripole +! : grid closure requires that NX be even. A grid +! : with tripole closure must be curvilinear. +! +! * The coastline limit depth is the value which distinguish the sea +! points to the land points. All the points with depth values (ZBIN) +! greater than this limit (ZLIM) will be considered as excluded points +! and will never be wet points, even if the water level grows over. +! It can only overwrite the status of a sea point to a land point. +! The value must have a negative value under the mean sea level +! +! * The minimum water depth allowed to compute the model is the absolute +! depth value (DMIN) used in the model if the input depth is lower to +! avoid the model to blow up. +! +! * namelist must be terminated with / +! * definitions & defaults: +! GRID%NAME = 'unset' ! grid name (30 char) +! GRID%NML = 'namelists.nml' ! namelists filename +! GRID%TYPE = 'unset' ! grid type +! GRID%COORD = 'unset' ! coordinate system +! GRID%CLOS = 'unset' ! grid closure +! +! GRID%ZLIM = 0. ! coastline limit depth (m) +! GRID%DMIN = 0. ! abs. minimum water depth (m) +! -------------------------------------------------------------------- ! +&GRID_NML + GRID%NAME = 'HOMOGENEOUS SOURCE TERM TEST' + GRID%NML = '../input_10ms/namelists_ST4_T701.nml' + GRID%TYPE = 'RECT' + GRID%COORD = 'SPHE' + GRID%CLOS = 'NONE' + GRID%ZLIM = -5. + GRID%DMIN = 5.75 +/ + +! -------------------------------------------------------------------- ! +! Define the rectilinear grid type via RECT_NML namelist +! - only for RECT grids - +! +! * The minimum grid size is 3x3. +! +! * If the grid increments SX and SY are given in minutes of arc, the scaling +! factor SF must be set to 60. to provide an increment factor in degree. +! +! * If CSTRG='SMPL', then SX is forced to 360/NX. +! +! * value <= value_read / scale_fac +! +! * namelist must be terminated with / +! * definitions & defaults: +! RECT%NX = 0 ! number of points along x-axis +! RECT%NY = 0 ! number of points along y-axis +! +! RECT%SX = 0. ! grid increment along x-axis +! RECT%SY = 0. ! grid increment along y-axis +! RECT%SF = 1. ! scaling division factor for x-y axis +! +! RECT%X0 = 0. ! x-coordinate of lower-left corner (deg) +! RECT%Y0 = 0. ! y-coordinate of lower-left corner (deg) +! RECT%SF0 = 1. ! scaling division factor for x0,y0 coord +! -------------------------------------------------------------------- ! +&RECT_NML + RECT%NX = 3 + RECT%NY = 3 + RECT%SX = 1. + RECT%SY = 1. + RECT%SF = 1.E-2 + RECT%X0 = -1. + RECT%Y0 = -1. + RECT%SF0 = 1.E-2 +/ + +! -------------------------------------------------------------------- ! +! Define the depth to preprocess via DEPTH_NML namelist +! - for RECT and CURV grids - +! +! * if no obstruction subgrid, need to set &MISC FLAGTR = 0 +! +! * The depth value must have negative values under the mean sea level +! +! * value <= value_read * scale_fac +! +! * IDLA : Layout indicator : +! 1 : Read line-by-line bottom to top. (default) +! 2 : Like 1, single read statement. +! 3 : Read line-by-line top to bottom. +! 4 : Like 3, single read statement. +! * IDFM : format indicator : +! 1 : Free format. (default) +! 2 : Fixed format. +! 3 : Unformatted. +! * FORMAT : element format to read : +! '(....)' : auto detected (default) +! '(f10.6)' : float type +! +! * Example : +! IDF SF IDLA IDFM FORMAT FILENAME +! 50 0.001 1 1 '(....)' 'GLOB-30M.bot' +! +! * namelist must be terminated with / +! * definitions & defaults: +! DEPTH%SF = 1. ! scale factor +! DEPTH%FILENAME = 'unset' ! filename +! DEPTH%IDF = 50 ! file unit number +! DEPTH%IDLA = 1 ! layout indicator +! DEPTH%IDFM = 1 ! format indicator +! DEPTH%FORMAT = '(....)' ! formatted read format +! -------------------------------------------------------------------- ! +&DEPTH_NML + DEPTH%SF = -2500. + DEPTH%FILENAME = '../input/HOMOGENEOUS.depth' + DEPTH%IDLA = 3 +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_ts1/input_10ms/ww3_grid_ST4_T702.nml b/regtests/ww3_ts1/input_10ms/ww3_grid_ST4_T702.nml new file mode 100644 index 000000000..7669b24c6 --- /dev/null +++ b/regtests/ww3_ts1/input_10ms/ww3_grid_ST4_T702.nml @@ -0,0 +1,225 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III - ww3_grid.nml - Grid pre-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the spectrum parameterization via SPECTRUM_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! SPECTRUM%XFR = 0. ! frequency increment +! SPECTRUM%FREQ1 = 0. ! first frequency (Hz) +! SPECTRUM%NK = 0 ! number of frequencies (wavenumbers) +! SPECTRUM%NTH = 0 ! number of direction bins +! SPECTRUM%THOFF = 0. ! relative offset of first direction [-0.5,0.5] +! -------------------------------------------------------------------- ! +&SPECTRUM_NML + SPECTRUM%XFR = 1.10 + SPECTRUM%FREQ1 = 0.034 + SPECTRUM%NK = 36 + SPECTRUM%NTH = 36 +/ + +! -------------------------------------------------------------------- ! +! Define the run parameterization via RUN_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! RUN%FLDRY = F ! dry run (I/O only, no calculation) +! RUN%FLCX = F ! x-component of propagation +! RUN%FLCY = F ! y-component of propagation +! RUN%FLCTH = F ! direction shift +! RUN%FLCK = F ! wavenumber shift +! RUN%FLSOU = F ! source terms +! -------------------------------------------------------------------- ! +&RUN_NML + RUN%FLSOU = T +/ + +! -------------------------------------------------------------------- ! +! Define the timesteps parameterization via TIMESTEPS_NML namelist +! +! * It is highly recommended to set up time steps which are multiple +! between them. +! +! * The first time step to calculate is the maximum CFL time step +! which depend on the lowest frequency FREQ1 previously set up and the +! lowest spatial grid resolution in meters DXY. +! reminder : 1 degree=60minutes // 1minute=1mile // 1mile=1.852km +! The formula for the CFL time is : +! Tcfl = DXY / (G / (FREQ1*4*Pi) ) with the constants Pi=3,14 and G=9.8m/s²; +! DTXY ~= 90% Tcfl +! DTMAX ~= 3 * DTXY (maximum global time step limit) +! +! * The refraction time step depends on how strong can be the current velocities +! on your grid : +! DTKTH ~= DTMAX / 2 ! in case of no or light current velocities +! DTKTH ~= DTMAX / 10 ! in case of strong current velocities +! +! * The source terms time step is usually defined between 5s and 60s. +! A common value is 10s. +! DTMIN = 10 +! +! * namelist must be terminated with / +! * definitions & defaults: +! TIMESTEPS%DTMAX = 0. ! maximum global time step (s) +! TIMESTEPS%DTXY = 0. ! maximum CFL time step for x-y (s) +! TIMESTEPS%DTKTH = 0. ! maximum CFL time step for k-th (s) +! TIMESTEPS%DTMIN = 0. ! minimum source term time step (s) +! -------------------------------------------------------------------- ! +&TIMESTEPS_NML + TIMESTEPS%DTMAX = 900. + TIMESTEPS%DTXY = 900. + TIMESTEPS%DTKTH = 900. + TIMESTEPS%DTMIN = 15. +/ + +! -------------------------------------------------------------------- ! +! Define the grid to preprocess via GRID_NML namelist +! +! * the tunable parameters for source terms, propagation schemes, and +! numerics are read using namelists. +! * Any namelist found in the folowing sections is temporarily written +! to param.scratch, and read from there if necessary. +! * The order of the namelists is immaterial. +! * Namelists not needed for the given switch settings will be skipped +! automatically +! +! * grid type can be : +! 'RECT' : rectilinear +! 'CURV' : curvilinear +! 'UNST' : unstructured (triangle-based) +! +! * coordinate system can be : +! 'SPHE' : Spherical (degrees) +! 'CART' : Cartesian (meters) +! +! * grid closure can only be applied in spherical coordinates +! +! * grid closure can be : +! 'NONE' : No closure is applied +! 'SMPL' : Simple grid closure. Grid is periodic in the +! : i-index and wraps at i=NX+1. In other words, +! : (NX+1,J) => (1,J). A grid with simple closure +! : may be rectilinear or curvilinear. +! 'TRPL' : Tripole grid closure : Grid is periodic in the +! : i-index and wraps at i=NX+1 and has closure at +! : j=NY+1. In other words, (NX+1,J<=NY) => (1,J) +! : and (I,NY+1) => (NX-I+1,NY). Tripole +! : grid closure requires that NX be even. A grid +! : with tripole closure must be curvilinear. +! +! * The coastline limit depth is the value which distinguish the sea +! points to the land points. All the points with depth values (ZBIN) +! greater than this limit (ZLIM) will be considered as excluded points +! and will never be wet points, even if the water level grows over. +! It can only overwrite the status of a sea point to a land point. +! The value must have a negative value under the mean sea level +! +! * The minimum water depth allowed to compute the model is the absolute +! depth value (DMIN) used in the model if the input depth is lower to +! avoid the model to blow up. +! +! * namelist must be terminated with / +! * definitions & defaults: +! GRID%NAME = 'unset' ! grid name (30 char) +! GRID%NML = 'namelists.nml' ! namelists filename +! GRID%TYPE = 'unset' ! grid type +! GRID%COORD = 'unset' ! coordinate system +! GRID%CLOS = 'unset' ! grid closure +! +! GRID%ZLIM = 0. ! coastline limit depth (m) +! GRID%DMIN = 0. ! abs. minimum water depth (m) +! -------------------------------------------------------------------- ! +&GRID_NML + GRID%NAME = 'HOMOGENEOUS SOURCE TERM TEST' + GRID%NML = '../input_10ms/namelists_ST4_T702.nml' + GRID%TYPE = 'RECT' + GRID%COORD = 'SPHE' + GRID%CLOS = 'NONE' + GRID%ZLIM = -5. + GRID%DMIN = 5.75 +/ + +! -------------------------------------------------------------------- ! +! Define the rectilinear grid type via RECT_NML namelist +! - only for RECT grids - +! +! * The minimum grid size is 3x3. +! +! * If the grid increments SX and SY are given in minutes of arc, the scaling +! factor SF must be set to 60. to provide an increment factor in degree. +! +! * If CSTRG='SMPL', then SX is forced to 360/NX. +! +! * value <= value_read / scale_fac +! +! * namelist must be terminated with / +! * definitions & defaults: +! RECT%NX = 0 ! number of points along x-axis +! RECT%NY = 0 ! number of points along y-axis +! +! RECT%SX = 0. ! grid increment along x-axis +! RECT%SY = 0. ! grid increment along y-axis +! RECT%SF = 1. ! scaling division factor for x-y axis +! +! RECT%X0 = 0. ! x-coordinate of lower-left corner (deg) +! RECT%Y0 = 0. ! y-coordinate of lower-left corner (deg) +! RECT%SF0 = 1. ! scaling division factor for x0,y0 coord +! -------------------------------------------------------------------- ! +&RECT_NML + RECT%NX = 3 + RECT%NY = 3 + RECT%SX = 1. + RECT%SY = 1. + RECT%SF = 1.E-2 + RECT%X0 = -1. + RECT%Y0 = -1. + RECT%SF0 = 1.E-2 +/ + +! -------------------------------------------------------------------- ! +! Define the depth to preprocess via DEPTH_NML namelist +! - for RECT and CURV grids - +! +! * if no obstruction subgrid, need to set &MISC FLAGTR = 0 +! +! * The depth value must have negative values under the mean sea level +! +! * value <= value_read * scale_fac +! +! * IDLA : Layout indicator : +! 1 : Read line-by-line bottom to top. (default) +! 2 : Like 1, single read statement. +! 3 : Read line-by-line top to bottom. +! 4 : Like 3, single read statement. +! * IDFM : format indicator : +! 1 : Free format. (default) +! 2 : Fixed format. +! 3 : Unformatted. +! * FORMAT : element format to read : +! '(....)' : auto detected (default) +! '(f10.6)' : float type +! +! * Example : +! IDF SF IDLA IDFM FORMAT FILENAME +! 50 0.001 1 1 '(....)' 'GLOB-30M.bot' +! +! * namelist must be terminated with / +! * definitions & defaults: +! DEPTH%SF = 1. ! scale factor +! DEPTH%FILENAME = 'unset' ! filename +! DEPTH%IDF = 50 ! file unit number +! DEPTH%IDLA = 1 ! layout indicator +! DEPTH%IDFM = 1 ! format indicator +! DEPTH%FORMAT = '(....)' ! formatted read format +! -------------------------------------------------------------------- ! +&DEPTH_NML + DEPTH%SF = -2500. + DEPTH%FILENAME = '../input/HOMOGENEOUS.depth' + DEPTH%IDLA = 3 +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_ts1/input_10ms/ww3_grid_ST4_T707.nml b/regtests/ww3_ts1/input_10ms/ww3_grid_ST4_T707.nml new file mode 100644 index 000000000..5378ebec3 --- /dev/null +++ b/regtests/ww3_ts1/input_10ms/ww3_grid_ST4_T707.nml @@ -0,0 +1,225 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III - ww3_grid.nml - Grid pre-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the spectrum parameterization via SPECTRUM_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! SPECTRUM%XFR = 0. ! frequency increment +! SPECTRUM%FREQ1 = 0. ! first frequency (Hz) +! SPECTRUM%NK = 0 ! number of frequencies (wavenumbers) +! SPECTRUM%NTH = 0 ! number of direction bins +! SPECTRUM%THOFF = 0. ! relative offset of first direction [-0.5,0.5] +! -------------------------------------------------------------------- ! +&SPECTRUM_NML + SPECTRUM%XFR = 1.10 + SPECTRUM%FREQ1 = 0.034 + SPECTRUM%NK = 36 + SPECTRUM%NTH = 36 +/ + +! -------------------------------------------------------------------- ! +! Define the run parameterization via RUN_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! RUN%FLDRY = F ! dry run (I/O only, no calculation) +! RUN%FLCX = F ! x-component of propagation +! RUN%FLCY = F ! y-component of propagation +! RUN%FLCTH = F ! direction shift +! RUN%FLCK = F ! wavenumber shift +! RUN%FLSOU = F ! source terms +! -------------------------------------------------------------------- ! +&RUN_NML + RUN%FLSOU = T +/ + +! -------------------------------------------------------------------- ! +! Define the timesteps parameterization via TIMESTEPS_NML namelist +! +! * It is highly recommended to set up time steps which are multiple +! between them. +! +! * The first time step to calculate is the maximum CFL time step +! which depend on the lowest frequency FREQ1 previously set up and the +! lowest spatial grid resolution in meters DXY. +! reminder : 1 degree=60minutes // 1minute=1mile // 1mile=1.852km +! The formula for the CFL time is : +! Tcfl = DXY / (G / (FREQ1*4*Pi) ) with the constants Pi=3,14 and G=9.8m/s²; +! DTXY ~= 90% Tcfl +! DTMAX ~= 3 * DTXY (maximum global time step limit) +! +! * The refraction time step depends on how strong can be the current velocities +! on your grid : +! DTKTH ~= DTMAX / 2 ! in case of no or light current velocities +! DTKTH ~= DTMAX / 10 ! in case of strong current velocities +! +! * The source terms time step is usually defined between 5s and 60s. +! A common value is 10s. +! DTMIN = 10 +! +! * namelist must be terminated with / +! * definitions & defaults: +! TIMESTEPS%DTMAX = 0. ! maximum global time step (s) +! TIMESTEPS%DTXY = 0. ! maximum CFL time step for x-y (s) +! TIMESTEPS%DTKTH = 0. ! maximum CFL time step for k-th (s) +! TIMESTEPS%DTMIN = 0. ! minimum source term time step (s) +! -------------------------------------------------------------------- ! +&TIMESTEPS_NML + TIMESTEPS%DTMAX = 900. + TIMESTEPS%DTXY = 900. + TIMESTEPS%DTKTH = 900. + TIMESTEPS%DTMIN = 5. +/ + +! -------------------------------------------------------------------- ! +! Define the grid to preprocess via GRID_NML namelist +! +! * the tunable parameters for source terms, propagation schemes, and +! numerics are read using namelists. +! * Any namelist found in the folowing sections is temporarily written +! to param.scratch, and read from there if necessary. +! * The order of the namelists is immaterial. +! * Namelists not needed for the given switch settings will be skipped +! automatically +! +! * grid type can be : +! 'RECT' : rectilinear +! 'CURV' : curvilinear +! 'UNST' : unstructured (triangle-based) +! +! * coordinate system can be : +! 'SPHE' : Spherical (degrees) +! 'CART' : Cartesian (meters) +! +! * grid closure can only be applied in spherical coordinates +! +! * grid closure can be : +! 'NONE' : No closure is applied +! 'SMPL' : Simple grid closure. Grid is periodic in the +! : i-index and wraps at i=NX+1. In other words, +! : (NX+1,J) => (1,J). A grid with simple closure +! : may be rectilinear or curvilinear. +! 'TRPL' : Tripole grid closure : Grid is periodic in the +! : i-index and wraps at i=NX+1 and has closure at +! : j=NY+1. In other words, (NX+1,J<=NY) => (1,J) +! : and (I,NY+1) => (NX-I+1,NY). Tripole +! : grid closure requires that NX be even. A grid +! : with tripole closure must be curvilinear. +! +! * The coastline limit depth is the value which distinguish the sea +! points to the land points. All the points with depth values (ZBIN) +! greater than this limit (ZLIM) will be considered as excluded points +! and will never be wet points, even if the water level grows over. +! It can only overwrite the status of a sea point to a land point. +! The value must have a negative value under the mean sea level +! +! * The minimum water depth allowed to compute the model is the absolute +! depth value (DMIN) used in the model if the input depth is lower to +! avoid the model to blow up. +! +! * namelist must be terminated with / +! * definitions & defaults: +! GRID%NAME = 'unset' ! grid name (30 char) +! GRID%NML = 'namelists.nml' ! namelists filename +! GRID%TYPE = 'unset' ! grid type +! GRID%COORD = 'unset' ! coordinate system +! GRID%CLOS = 'unset' ! grid closure +! +! GRID%ZLIM = 0. ! coastline limit depth (m) +! GRID%DMIN = 0. ! abs. minimum water depth (m) +! -------------------------------------------------------------------- ! +&GRID_NML + GRID%NAME = 'HOMOGENEOUS SOURCE TERM TEST' + GRID%NML = '../input_10ms/namelists_ST4_T707.nml' + GRID%TYPE = 'RECT' + GRID%COORD = 'SPHE' + GRID%CLOS = 'NONE' + GRID%ZLIM = -5. + GRID%DMIN = 5.75 +/ + +! -------------------------------------------------------------------- ! +! Define the rectilinear grid type via RECT_NML namelist +! - only for RECT grids - +! +! * The minimum grid size is 3x3. +! +! * If the grid increments SX and SY are given in minutes of arc, the scaling +! factor SF must be set to 60. to provide an increment factor in degree. +! +! * If CSTRG='SMPL', then SX is forced to 360/NX. +! +! * value <= value_read / scale_fac +! +! * namelist must be terminated with / +! * definitions & defaults: +! RECT%NX = 0 ! number of points along x-axis +! RECT%NY = 0 ! number of points along y-axis +! +! RECT%SX = 0. ! grid increment along x-axis +! RECT%SY = 0. ! grid increment along y-axis +! RECT%SF = 1. ! scaling division factor for x-y axis +! +! RECT%X0 = 0. ! x-coordinate of lower-left corner (deg) +! RECT%Y0 = 0. ! y-coordinate of lower-left corner (deg) +! RECT%SF0 = 1. ! scaling division factor for x0,y0 coord +! -------------------------------------------------------------------- ! +&RECT_NML + RECT%NX = 3 + RECT%NY = 3 + RECT%SX = 1. + RECT%SY = 1. + RECT%SF = 1.E-2 + RECT%X0 = -1. + RECT%Y0 = -1. + RECT%SF0 = 1.E-2 +/ + +! -------------------------------------------------------------------- ! +! Define the depth to preprocess via DEPTH_NML namelist +! - for RECT and CURV grids - +! +! * if no obstruction subgrid, need to set &MISC FLAGTR = 0 +! +! * The depth value must have negative values under the mean sea level +! +! * value <= value_read * scale_fac +! +! * IDLA : Layout indicator : +! 1 : Read line-by-line bottom to top. (default) +! 2 : Like 1, single read statement. +! 3 : Read line-by-line top to bottom. +! 4 : Like 3, single read statement. +! * IDFM : format indicator : +! 1 : Free format. (default) +! 2 : Fixed format. +! 3 : Unformatted. +! * FORMAT : element format to read : +! '(....)' : auto detected (default) +! '(f10.6)' : float type +! +! * Example : +! IDF SF IDLA IDFM FORMAT FILENAME +! 50 0.001 1 1 '(....)' 'GLOB-30M.bot' +! +! * namelist must be terminated with / +! * definitions & defaults: +! DEPTH%SF = 1. ! scale factor +! DEPTH%FILENAME = 'unset' ! filename +! DEPTH%IDF = 50 ! file unit number +! DEPTH%IDLA = 1 ! layout indicator +! DEPTH%IDFM = 1 ! format indicator +! DEPTH%FORMAT = '(....)' ! formatted read format +! -------------------------------------------------------------------- ! +&DEPTH_NML + DEPTH%SF = -2500. + DEPTH%FILENAME = '../input/HOMOGENEOUS.depth' + DEPTH%IDLA = 3 +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_ts1/input_10ms/ww3_grid_ST4_T713.nml b/regtests/ww3_ts1/input_10ms/ww3_grid_ST4_T713.nml new file mode 100644 index 000000000..3efd65adf --- /dev/null +++ b/regtests/ww3_ts1/input_10ms/ww3_grid_ST4_T713.nml @@ -0,0 +1,225 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III - ww3_grid.nml - Grid pre-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the spectrum parameterization via SPECTRUM_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! SPECTRUM%XFR = 0. ! frequency increment +! SPECTRUM%FREQ1 = 0. ! first frequency (Hz) +! SPECTRUM%NK = 0 ! number of frequencies (wavenumbers) +! SPECTRUM%NTH = 0 ! number of direction bins +! SPECTRUM%THOFF = 0. ! relative offset of first direction [-0.5,0.5] +! -------------------------------------------------------------------- ! +&SPECTRUM_NML + SPECTRUM%XFR = 1.10 + SPECTRUM%FREQ1 = 0.034 + SPECTRUM%NK = 36 + SPECTRUM%NTH = 36 +/ + +! -------------------------------------------------------------------- ! +! Define the run parameterization via RUN_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! RUN%FLDRY = F ! dry run (I/O only, no calculation) +! RUN%FLCX = F ! x-component of propagation +! RUN%FLCY = F ! y-component of propagation +! RUN%FLCTH = F ! direction shift +! RUN%FLCK = F ! wavenumber shift +! RUN%FLSOU = F ! source terms +! -------------------------------------------------------------------- ! +&RUN_NML + RUN%FLSOU = T +/ + +! -------------------------------------------------------------------- ! +! Define the timesteps parameterization via TIMESTEPS_NML namelist +! +! * It is highly recommended to set up time steps which are multiple +! between them. +! +! * The first time step to calculate is the maximum CFL time step +! which depend on the lowest frequency FREQ1 previously set up and the +! lowest spatial grid resolution in meters DXY. +! reminder : 1 degree=60minutes // 1minute=1mile // 1mile=1.852km +! The formula for the CFL time is : +! Tcfl = DXY / (G / (FREQ1*4*Pi) ) with the constants Pi=3,14 and G=9.8m/s²; +! DTXY ~= 90% Tcfl +! DTMAX ~= 3 * DTXY (maximum global time step limit) +! +! * The refraction time step depends on how strong can be the current velocities +! on your grid : +! DTKTH ~= DTMAX / 2 ! in case of no or light current velocities +! DTKTH ~= DTMAX / 10 ! in case of strong current velocities +! +! * The source terms time step is usually defined between 5s and 60s. +! A common value is 10s. +! DTMIN = 10 +! +! * namelist must be terminated with / +! * definitions & defaults: +! TIMESTEPS%DTMAX = 0. ! maximum global time step (s) +! TIMESTEPS%DTXY = 0. ! maximum CFL time step for x-y (s) +! TIMESTEPS%DTKTH = 0. ! maximum CFL time step for k-th (s) +! TIMESTEPS%DTMIN = 0. ! minimum source term time step (s) +! -------------------------------------------------------------------- ! +&TIMESTEPS_NML + TIMESTEPS%DTMAX = 900. + TIMESTEPS%DTXY = 900. + TIMESTEPS%DTKTH = 900. + TIMESTEPS%DTMIN = 5. +/ + +! -------------------------------------------------------------------- ! +! Define the grid to preprocess via GRID_NML namelist +! +! * the tunable parameters for source terms, propagation schemes, and +! numerics are read using namelists. +! * Any namelist found in the folowing sections is temporarily written +! to param.scratch, and read from there if necessary. +! * The order of the namelists is immaterial. +! * Namelists not needed for the given switch settings will be skipped +! automatically +! +! * grid type can be : +! 'RECT' : rectilinear +! 'CURV' : curvilinear +! 'UNST' : unstructured (triangle-based) +! +! * coordinate system can be : +! 'SPHE' : Spherical (degrees) +! 'CART' : Cartesian (meters) +! +! * grid closure can only be applied in spherical coordinates +! +! * grid closure can be : +! 'NONE' : No closure is applied +! 'SMPL' : Simple grid closure. Grid is periodic in the +! : i-index and wraps at i=NX+1. In other words, +! : (NX+1,J) => (1,J). A grid with simple closure +! : may be rectilinear or curvilinear. +! 'TRPL' : Tripole grid closure : Grid is periodic in the +! : i-index and wraps at i=NX+1 and has closure at +! : j=NY+1. In other words, (NX+1,J<=NY) => (1,J) +! : and (I,NY+1) => (NX-I+1,NY). Tripole +! : grid closure requires that NX be even. A grid +! : with tripole closure must be curvilinear. +! +! * The coastline limit depth is the value which distinguish the sea +! points to the land points. All the points with depth values (ZBIN) +! greater than this limit (ZLIM) will be considered as excluded points +! and will never be wet points, even if the water level grows over. +! It can only overwrite the status of a sea point to a land point. +! The value must have a negative value under the mean sea level +! +! * The minimum water depth allowed to compute the model is the absolute +! depth value (DMIN) used in the model if the input depth is lower to +! avoid the model to blow up. +! +! * namelist must be terminated with / +! * definitions & defaults: +! GRID%NAME = 'unset' ! grid name (30 char) +! GRID%NML = 'namelists.nml' ! namelists filename +! GRID%TYPE = 'unset' ! grid type +! GRID%COORD = 'unset' ! coordinate system +! GRID%CLOS = 'unset' ! grid closure +! +! GRID%ZLIM = 0. ! coastline limit depth (m) +! GRID%DMIN = 0. ! abs. minimum water depth (m) +! -------------------------------------------------------------------- ! +&GRID_NML + GRID%NAME = 'HOMOGENEOUS SOURCE TERM TEST' + GRID%NML = '../input_10ms/namelists_ST4_T713.nml' + GRID%TYPE = 'RECT' + GRID%COORD = 'SPHE' + GRID%CLOS = 'NONE' + GRID%ZLIM = -5. + GRID%DMIN = 5.75 +/ + +! -------------------------------------------------------------------- ! +! Define the rectilinear grid type via RECT_NML namelist +! - only for RECT grids - +! +! * The minimum grid size is 3x3. +! +! * If the grid increments SX and SY are given in minutes of arc, the scaling +! factor SF must be set to 60. to provide an increment factor in degree. +! +! * If CSTRG='SMPL', then SX is forced to 360/NX. +! +! * value <= value_read / scale_fac +! +! * namelist must be terminated with / +! * definitions & defaults: +! RECT%NX = 0 ! number of points along x-axis +! RECT%NY = 0 ! number of points along y-axis +! +! RECT%SX = 0. ! grid increment along x-axis +! RECT%SY = 0. ! grid increment along y-axis +! RECT%SF = 1. ! scaling division factor for x-y axis +! +! RECT%X0 = 0. ! x-coordinate of lower-left corner (deg) +! RECT%Y0 = 0. ! y-coordinate of lower-left corner (deg) +! RECT%SF0 = 1. ! scaling division factor for x0,y0 coord +! -------------------------------------------------------------------- ! +&RECT_NML + RECT%NX = 3 + RECT%NY = 3 + RECT%SX = 1. + RECT%SY = 1. + RECT%SF = 1.E-2 + RECT%X0 = -1. + RECT%Y0 = -1. + RECT%SF0 = 1.E-2 +/ + +! -------------------------------------------------------------------- ! +! Define the depth to preprocess via DEPTH_NML namelist +! - for RECT and CURV grids - +! +! * if no obstruction subgrid, need to set &MISC FLAGTR = 0 +! +! * The depth value must have negative values under the mean sea level +! +! * value <= value_read * scale_fac +! +! * IDLA : Layout indicator : +! 1 : Read line-by-line bottom to top. (default) +! 2 : Like 1, single read statement. +! 3 : Read line-by-line top to bottom. +! 4 : Like 3, single read statement. +! * IDFM : format indicator : +! 1 : Free format. (default) +! 2 : Fixed format. +! 3 : Unformatted. +! * FORMAT : element format to read : +! '(....)' : auto detected (default) +! '(f10.6)' : float type +! +! * Example : +! IDF SF IDLA IDFM FORMAT FILENAME +! 50 0.001 1 1 '(....)' 'GLOB-30M.bot' +! +! * namelist must be terminated with / +! * definitions & defaults: +! DEPTH%SF = 1. ! scale factor +! DEPTH%FILENAME = 'unset' ! filename +! DEPTH%IDF = 50 ! file unit number +! DEPTH%IDLA = 1 ! layout indicator +! DEPTH%IDFM = 1 ! format indicator +! DEPTH%FORMAT = '(....)' ! formatted read format +! -------------------------------------------------------------------- ! +&DEPTH_NML + DEPTH%SF = -2500. + DEPTH%FILENAME = '../input/HOMOGENEOUS.depth' + DEPTH%IDLA = 3 +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_ts1/input_10ms/ww3_ounf.nml b/regtests/ww3_ts1/input_10ms/ww3_ounf.nml new file mode 100644 index 000000000..716f1df4b --- /dev/null +++ b/regtests/ww3_ts1/input_10ms/ww3_ounf.nml @@ -0,0 +1,29 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III ww3_ounf.nml - Grid output post-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the output fields to postprocess via FIELD_NML namelist +! -------------------------------------------------------------------- ! +&FIELD_NML + FIELD%TIMESTART = '20000101 000000' + FIELD%TIMESTRIDE = '10' + FIELD%TIMECOUNT = '8000' + FIELD%LIST = 'DPT QP QKK WND ICE HS MSS MSD FAW WCC WCF WCH WCM FOC TAW CHA UST' + FIELD%PARTITION = '0 1 2' + FIELD%TYPE = 4 +/ + +! -------------------------------------------------------------------- ! +! Define the content of the output file via FILE_NML namelist +! -------------------------------------------------------------------- ! +&FILE_NML + FILE%IX0 = 2 + FILE%IXN = 2 + FILE%IY0 = 2 + FILE%IYN = 2 +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_ts1/input_10ms/ww3_ounp_spec.nml b/regtests/ww3_ts1/input_10ms/ww3_ounp_spec.nml new file mode 100644 index 000000000..34bac9764 --- /dev/null +++ b/regtests/ww3_ts1/input_10ms/ww3_ounp_spec.nml @@ -0,0 +1,48 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III ww3_ounp.nml - Point output post-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the output fields to postprocess via POINT_NML namelist +! -------------------------------------------------------------------- ! +&POINT_NML + POINT%TIMESTART = '20000101 000000' + POINT%TIMESTRIDE = '1800.' + POINT%TIMECOUNT = '1000' + POINT%TIMESPLIT = 4 + POINT%BUFFER = 100 + POINT%TYPE = 3 +/ + +! -------------------------------------------------------------------- ! +! Define the content of the output file via FILE_NML namelist +! -------------------------------------------------------------------- ! +&FILE_NML +/ + +! -------------------------------------------------------------------- ! +! Define the type 0, inventory of file +! -------------------------------------------------------------------- ! + + +! -------------------------------------------------------------------- ! +! Define the type 1, spectra via SPECTRA_NML namelist +! -------------------------------------------------------------------- ! +&SPECTRA_NML +/ + +! -------------------------------------------------------------------- ! +! Define the type 2, mean parameter via PARAM_NML namelist +! -------------------------------------------------------------------- ! +&PARAM_NML +/ + +! -------------------------------------------------------------------- ! +! Define the type 3, source terms via SOURCE_NML namelist +! -------------------------------------------------------------------- ! +&SOURCE_NML +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_ts1/input_10ms/ww3_shel.nml b/regtests/ww3_ts1/input_10ms/ww3_shel.nml new file mode 100644 index 000000000..d83106ed1 --- /dev/null +++ b/regtests/ww3_ts1/input_10ms/ww3_shel.nml @@ -0,0 +1,54 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III ww3_shel.nml - single-grid model ! +! -------------------------------------------------------------------- ! + + +! -------------------------------------------------------------------- ! +! Define top-level model parameters via DOMAIN_NML namelist +! -------------------------------------------------------------------- ! +&DOMAIN_NML + DOMAIN%START = '20000101 000000' + DOMAIN%STOP = '20000106 000000' +/ + +! -------------------------------------------------------------------- ! +! Define each forcing via the INPUT_NML namelist +! -------------------------------------------------------------------- ! +&INPUT_NML + INPUT%FORCING%WINDS = 'H' +/ + +! -------------------------------------------------------------------- ! +! Define the output types point parameters via OUTPUT_TYPE_NML namelist +! -------------------------------------------------------------------- ! +&OUTPUT_TYPE_NML + TYPE%FIELD%LIST = 'DPT QP QKK WND ICE HS MSS MSD FAW WCC WCF WCH WCM FOC TAW CHA UST' + TYPE%POINT%FILE = '../input_10ms/points.list' +/ + +! -------------------------------------------------------------------- ! +! Define output dates via OUTPUT_DATE_NML namelist +! -------------------------------------------------------------------- ! +&OUTPUT_DATE_NML + DATE%FIELD = '19680606 000000' '1800' '20230618 000000' + DATE%POINT = '19680606 000000' '1800' '20230618 000000' +/ + +! -------------------------------------------------------------------- ! +! Define homogeneous input via HOMOG_COUNT_NML and HOMOG_INPUT_NML namelist +! -------------------------------------------------------------------- ! +&HOMOG_COUNT_NML + HOMOG_COUNT%N_CUR = 0 + HOMOG_COUNT%N_WND = 1 +/ + +&HOMOG_INPUT_NML + HOMOG_INPUT(1)%NAME = 'WND' + HOMOG_INPUT(1)%VALUE1 = 10. + HOMOG_INPUT(1)%VALUE2 = 270. + HOMOG_INPUT(1)%VALUE3 = 0. +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_ufs1.1/input_unstr/namelists_a.nml b/regtests/ww3_ufs1.1/input_unstr/namelists_a.nml index 584405f2f..e28a03245 100644 --- a/regtests/ww3_ufs1.1/input_unstr/namelists_a.nml +++ b/regtests/ww3_ufs1.1/input_unstr/namelists_a.nml @@ -31,7 +31,7 @@ SDSHCK = 1.50, SDSBR = 0.9000E-03, SDSSTRAIN = 0.000, SDSP = 2.00, SDSISO = 2, SDSCOS =2.0, SDSDTH = 80.0, SDSBRF1 = 0.50, SDSBRFDF = 0, SDSBM0 = 1.00, SDSBM1 = 0.00, SDSBM2 = 0.00, SDSBM3 = 0.00, SDSBM4 = 0.00, -, WHITECAPWIDTH = 0.30/ +WHITECAPWIDTH = 0.30/ &SBT1 GAMMA = -0.6700E-01 / &SDB1 BJALFA = 1.000, BJGAM = 0.730, BJFLAG = .TRUE. / &PRO3 CFLTM = 0.70, WDTHCG = 1.50, WDTHTH = 1.50 / diff --git a/regtests/ww3_ufs1.1/input_unstr/namelists_b.nml b/regtests/ww3_ufs1.1/input_unstr/namelists_b.nml index 292ffc5f7..8d1c72eda 100644 --- a/regtests/ww3_ufs1.1/input_unstr/namelists_b.nml +++ b/regtests/ww3_ufs1.1/input_unstr/namelists_b.nml @@ -51,7 +51,7 @@ SDSHCK = 1.50, SDSBR = 0.9000E-03, SDSSTRAIN = 0.000, SDSP = 2.00, SDSISO = 2, SDSCOS =2.0, SDSDTH = 80.0, SDSBRF1 = 0.50, SDSBRFDF = 0, SDSBM0 = 1.00, SDSBM1 = 0.00, SDSBM2 = 0.00, SDSBM3 = 0.00, SDSBM4 = 0.00, -, WHITECAPWIDTH = 0.30/ +WHITECAPWIDTH = 0.30/ &SBT1 GAMMA = -0.6700E-01 / &SDB1 BJALFA = 1.000, BJGAM = 0.730, BJFLAG = .TRUE. / &PRO3 CFLTM = 0.70, WDTHCG = 1.50, WDTHTH = 1.50 /