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/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/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..c297e8522 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 ) !/ !/ +-----------------------------------+