From d90078b3cd97418451deeb2909615d77dbd4a136 Mon Sep 17 00:00:00 2001 From: Mickael Accensi <49198861+mickaelaccensi@users.noreply.github.com> Date: Tue, 28 Nov 2023 17:30:37 +0100 Subject: [PATCH 01/30] correct bugs to run correctly GQM implementation (#1127) --- manual/eqs/NL1.tex | 29 +++++++++++++++-------------- manual/manual.bib | 11 +++++++++++ manual/sys/files_w3.tex | 6 +++++- model/src/w3snl1md.F90 | 22 ++++++++++++++-------- model/src/w3src4md.F90 | 2 +- 5 files changed, 46 insertions(+), 24 deletions(-) diff --git a/manual/eqs/NL1.tex b/manual/eqs/NL1.tex index d9bc4c521..c45e9294d 100644 --- a/manual/eqs/NL1.tex +++ b/manual/eqs/NL1.tex @@ -55,37 +55,38 @@ \subsubsection{~$S_{nl}$: Discrete Interaction Approximation (\dia)} \label{sec: \sin(\delta_{\theta,3})&=&\sin(\delta_{\theta,2}) (1-\lambda)^2/(1+\lambda)^2. \end{eqnarray} - For these quadruplets, each source term value -$S_{nl}(\bk)$ corresponding to each discrete $(f_r,\theta)$ -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 +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} +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} -with elementary contributions given by +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{equation} -\delta S_{\mathrm{nl}}(\bk,\bk_2,\bk_3,s) = \frac{C}{g^4} f_{r,1}^{11} \left [ F^2 \left ( \frac{F_{2,s}}{(1+\lambda_{nl})^4} + - \frac{F_{3,s}}{(1-\lambda_{nl})^4} \right ) - \frac{2 F F_{2,s} F_{3,s}}{(1-\lambda_{nl}^2)^4} \right] , +\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 $s=+$ or $s=-$ is a sign index, and the spectral densities are $F = F(f_{r} ,\theta)$, $F_{2,+} = F(f_{r,2} ,\theta + \delta_{\theta,2})$, $F_{2,-} = F(f_{r,2} ,\theta - \delta_{\theta,2})$, etc. +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}. -As a result, when accounting for the two quadruplet configurations, the source term at $\bk$ includes the interactions with -10 other spectral components. Besides, because $f_{r,2}$ and $f_{r,3}$ nor $\theta_{2,\pm} $ and $\theta_{3,\pm} $ fall on discretized frequencies and directions, the spectral densities are bilinearly interpolated, which involves 4 discrete spectral components for each of these 10 components. - % 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 diff --git a/manual/manual.bib b/manual/manual.bib index 0aacb5105..c49e3340b 100644 --- a/manual/manual.bib +++ b/manual/manual.bib @@ -3665,6 +3665,17 @@ @article{art:DC23 year = {2023} } +@ARTICLE{Webb1978, + author = "D. J. Webb", + title = "Nonlinear transfer between sea waves", + journal = DSR, + volume = 25, + pages = "279--298", + year = 1978, + where="paper", +} + + @ARTICLE{Lavrenov2001, author = "Igor V. Lavrenov", title = "Effect of wind wave parameter fluctuation on the nonlinear spectrum evolution", diff --git a/manual/sys/files_w3.tex b/manual/sys/files_w3.tex index fcd48a8f7..d0ad76f7e 100644 --- a/manual/sys/files_w3.tex +++ b/manual/sys/files_w3.tex @@ -506,11 +506,15 @@ \subsubsection{~Wave model modules} \label{sec:wave_mod} \end{flist} \noindent -Nonlinear interaction module (\dia) \hfill {\file w3snl1md.ftn} +Nonlinear interaction module (\dia or GQM) \hfill {\file w3snl1md.ftn} \begin{flisti} \fit{w3snl1}{Calculation of $S_{nl}$.} \fit{insnl1}{Initialization for $S_{nl}$.} +\fit{w3snlgqm}{Calculation of $S_{nl}$.} +\fit{w3scouple}{Calculation of coupling coefficient.} +\fit{gauleg}{Calculation of Gauss-Legendre quadrature coefficients.} +\fit{INSNLGQM}{Initialization for $S_{nl}$ with GQ method.} \end{flisti} \noindent diff --git a/model/src/w3snl1md.F90 b/model/src/w3snl1md.F90 index 598b627ea..09c096d2b 100644 --- a/model/src/w3snl1md.F90 +++ b/model/src/w3snl1md.F90 @@ -825,6 +825,8 @@ SUBROUTINE W3SNLGQM(A,CG,WN,DEPTH,TSTOTn,TSDERn) 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) @@ -883,8 +885,8 @@ SUBROUTINE W3SNLGQM(A,CG,WN,DEPTH,TSTOTn,TSDERn) ! 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= 1-INT(LOG(1.0D0)/LOG(RAISF)) - JFMAX=NF+INT(LOG(1.3D0)/LOG(RAISF)) + 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 @@ -1065,7 +1067,7 @@ SUBROUTINE W3SNLGQM(A,CG,WN,DEPTH,TSTOTn,TSDERn) 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,'(5I3,3E12.3)') ICONF,JF,JT, F(JT,JFM0) + 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) @@ -1219,6 +1221,8 @@ FUNCTION COUPLE(XK1 ,YK1 ,XK2 ,YK2 ,XK3 ,YK3 ,XK4 ,YK4) !/ ------------------------------------------------------------------- / 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 @@ -1305,6 +1309,7 @@ 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) ! @@ -1552,6 +1557,7 @@ SUBROUTINE INSNLGQM #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 @@ -2084,10 +2090,7 @@ SUBROUTINE INSNLGQM AUX=0.0D0 DO JT1=1,GQNT1 DO IQ_OM2=1,GQNQ_OM2 - AAA=TB_FAC(IQ_OM2,JT1,JF1)*TB_TPM(IQ_OM2,JT1,JF1) - IF (AAA.GT.AUX) AUX=AAA - CCC=TB_FAC(IQ_OM2,JT1,JF1)*TB_TMP(IQ_OM2,JT1,JF1) - IF (CCC.GT.AUX) AUX=CCC + 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 @@ -2099,6 +2102,7 @@ SUBROUTINE INSNLGQM DO JF1=1,GQNF1 IF (MAXCLA(JF1).GT.AUX) AUX=MAXCLA(JF1) ENDDO + TEST1=SEUIL1*AUX ! !.....Set to zero the coupling coefficients not used @@ -2128,7 +2132,9 @@ SUBROUTINE INSNLGQM ! !..... counts the fraction of the eliminated configurations ELIM=(1.D0-DBLE(NCONF)/DBLE(NCONFM))*100.D0 - ! WRITE(994,*) 'NCONF:',NCONF,ELIM +#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..a1d4423bf 100644 --- a/model/src/w3src4md.F90 +++ b/model/src/w3src4md.F90 @@ -2520,7 +2520,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 From 3f35df79359f90969b4c33069b82477003d9fdb5 Mon Sep 17 00:00:00 2001 From: Edward Hartnett <38856240+edwardhartnett@users.noreply.github.com> Date: Thu, 30 Nov 2023 12:33:23 -0700 Subject: [PATCH 02/30] Adding documentation to w3iopo() in preparation for code for #682. (#1131) --- model/src/w3iopomd.F90 | 78 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 71 insertions(+), 7 deletions(-) diff --git a/model/src/w3iopomd.F90 b/model/src/w3iopomd.F90 index d573879ce..0c15ea8c6 100644 --- a/model/src/w3iopomd.F90 +++ b/model/src/w3iopomd.F90 @@ -1023,17 +1023,81 @@ 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 + !> + !> @author H. L. Tolman @date 25-Jul-2006 SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD & #ifdef W3_ASCII ,NDSOA & From ff1b9e9df09607a15b532392594f55a831927941 Mon Sep 17 00:00:00 2001 From: Matthew Masarik <86749872+MatthewMasarik-NOAA@users.noreply.github.com> Date: Thu, 7 Dec 2023 15:42:16 -0500 Subject: [PATCH 03/30] NCEP regtest module updates: uses spack-stack/1.5.0, includes scotch/7.0.4 (#1137) --- regtests/bin/matrix_cmake_ncep | 51 ++++++++++++++++------------------ 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/regtests/bin/matrix_cmake_ncep b/regtests/bin/matrix_cmake_ncep index 771b6f96e..300af93e3 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) @@ -62,25 +64,21 @@ EOF 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 @@ -139,29 +137,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 ' ' From d3ea810da35e9266a4163b4b8f2f4cba5599a5eb Mon Sep 17 00:00:00 2001 From: Jessica Meixner Date: Tue, 12 Dec 2023 15:15:42 -0500 Subject: [PATCH 04/30] Minor update to ncep regtests (#1138) --- regtests/bin/matrix_cmake_ncep | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/regtests/bin/matrix_cmake_ncep b/regtests/bin/matrix_cmake_ncep index 300af93e3..7d0d26bec 100755 --- a/regtests/bin/matrix_cmake_ncep +++ b/regtests/bin/matrix_cmake_ncep @@ -62,8 +62,6 @@ EOF then # If no other h, assuming Hera batchq='slurm' - basemodcomp='intel/2022.1.2' - basemodmpi='impi/2022.1.2' 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' @@ -72,8 +70,6 @@ EOF elif [ $isorion ] then batchq='slurm' - basemodcomp='intel/2022.1.2' - basemodmpi='impi/2022.1.2' 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' @@ -94,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 From 88c89be2b4d868442bfea6dfc29feb5eba1e2058 Mon Sep 17 00:00:00 2001 From: Edward Hartnett <38856240+edwardhartnett@users.noreply.github.com> Date: Tue, 26 Dec 2023 13:16:55 -0700 Subject: [PATCH 05/30] Updated intel workflow to install oneapi compilers from new location. (#1157) --- .github/workflows/intel.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/intel.yml b/.github/workflows/intel.yml index 700553cea..54a388c55 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: intel10 + cache_key: intel10-3 CC: icc FC: ifort CXX: icpc @@ -51,7 +56,7 @@ 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-dev-utilities 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 From 7bec5605487761a03759a5e2f5f7159f18f0ca1b Mon Sep 17 00:00:00 2001 From: Edward Hartnett <38856240+edwardhartnett@users.noreply.github.com> Date: Thu, 4 Jan 2024 10:03:03 -0700 Subject: [PATCH 06/30] Add unit test for points I/O code. (#1158) --- .github/workflows/io_gnu_yml.old | 122 +++++++++++++++++ CMakeLists.txt | 6 + regtests/unittests/CMakeLists.txt | 39 ++++++ regtests/unittests/data/switch.io | 1 + regtests/unittests/data/ww3_grid.inp | 48 +++++++ regtests/unittests/data/ww3_outp.inp | 8 ++ regtests/unittests/test_io_points_bin.F90 | 152 ++++++++++++++++++++++ 7 files changed, 376 insertions(+) create mode 100644 .github/workflows/io_gnu_yml.old create mode 100644 regtests/unittests/CMakeLists.txt create mode 100644 regtests/unittests/data/switch.io create mode 100644 regtests/unittests/data/ww3_grid.inp create mode 100644 regtests/unittests/data/ww3_outp.inp create mode 100644 regtests/unittests/test_io_points_bin.F90 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/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 + From 63f82704fb6dce077958cfb562193320fb0d0da7 Mon Sep 17 00:00:00 2001 From: Alex Richert <82525672+AlexanderRichert-NOAA@users.noreply.github.com> Date: Thu, 11 Jan 2024 14:12:05 -0500 Subject: [PATCH 07/30] Update Intel CI (relocate /usr/local; ensure intel-oneapi-mpi; use ubuntu-latest) (#1161) --- .github/workflows/intel.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/intel.yml b/.github/workflows/intel.yml index 54a388c55..f5de65dcd 100644 --- a/.github/workflows/intel.yml +++ b/.github/workflows/intel.yml @@ -26,7 +26,7 @@ env: jobs: setup: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: @@ -62,6 +62,7 @@ jobs: - 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 git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git @@ -72,7 +73,7 @@ jobs: spack compiler find sudo apt install cmake spack external find - spack add intel-oneapi-mpi + spack config add "packages:mpi:require:'intel-oneapi-mpi'" spack config add "packages:all:require:['%intel']" spack concretize spack install --dirty -v --fail-fast @@ -97,7 +98,7 @@ 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 @@ -118,6 +119,8 @@ 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 From 3952826f7f0f79b622f5e325151355a05cda09b8 Mon Sep 17 00:00:00 2001 From: Mickael Accensi <49198861+mickaelaccensi@users.noreply.github.com> Date: Tue, 16 Jan 2024 18:49:43 +0100 Subject: [PATCH 08/30] remove lookup table for ST4 to speed up computation and clean up the ST4 code (#1124) Co-authored-by: Fabrice Ardhuin --- manual/eqs/ST3.tex | 11 +- manual/eqs/ST4.tex | 20 +- model/src/w3gdatmd.F90 | 11 +- model/src/w3gridmd.F90 | 58 ++- model/src/w3iogrmd.F90 | 59 ++- model/src/w3src4md.F90 | 493 ++++++++++-------- model/src/w3srcemd.F90 | 21 +- model/src/ww3_ounp.F90 | 2 +- regtests/bin/matrix.base | 4 + regtests/bin/run_cmake_test | 4 +- regtests/ww3_ts1/input/namelists_ST4_T500.nml | 3 + regtests/ww3_ts1/input/namelists_ST4_T707.nml | 2 +- regtests/ww3_ts1/input/ww3_grid_ST4_T500.nml | 225 ++++++++ .../ww3_ts1/input_10ms/namelists_Romero.nml | 20 + .../ww3_ts1/input_10ms/namelists_ST4_T471.nml | 2 + .../ww3_ts1/input_10ms/namelists_ST4_T475.nml | 7 + .../ww3_ts1/input_10ms/namelists_ST4_T701.nml | 20 + .../ww3_ts1/input_10ms/namelists_ST4_T702.nml | 14 + .../ww3_ts1/input_10ms/namelists_ST4_T707.nml | 2 +- .../ww3_ts1/input_10ms/namelists_ST4_T713.nml | 5 +- .../ww3_ts1/input_10ms/ww3_grid_Romero.nml | 225 ++++++++ .../ww3_ts1/input_10ms/ww3_grid_ST4_T471.nml | 225 ++++++++ .../ww3_ts1/input_10ms/ww3_grid_ST4_T475.nml | 225 ++++++++ .../ww3_ts1/input_10ms/ww3_grid_ST4_T701.nml | 225 ++++++++ .../ww3_ts1/input_10ms/ww3_grid_ST4_T702.nml | 225 ++++++++ 25 files changed, 1801 insertions(+), 307 deletions(-) create mode 100644 regtests/ww3_ts1/input/namelists_ST4_T500.nml create mode 100644 regtests/ww3_ts1/input/ww3_grid_ST4_T500.nml create mode 100644 regtests/ww3_ts1/input_10ms/namelists_Romero.nml create mode 100644 regtests/ww3_ts1/input_10ms/namelists_ST4_T471.nml create mode 100644 regtests/ww3_ts1/input_10ms/namelists_ST4_T475.nml create mode 100644 regtests/ww3_ts1/input_10ms/namelists_ST4_T701.nml create mode 100644 regtests/ww3_ts1/input_10ms/namelists_ST4_T702.nml create mode 100644 regtests/ww3_ts1/input_10ms/ww3_grid_Romero.nml create mode 100644 regtests/ww3_ts1/input_10ms/ww3_grid_ST4_T471.nml create mode 100644 regtests/ww3_ts1/input_10ms/ww3_grid_ST4_T475.nml create mode 100644 regtests/ww3_ts1/input_10ms/ww3_grid_ST4_T701.nml create mode 100644 regtests/ww3_ts1/input_10ms/ww3_grid_ST4_T702.nml 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/model/src/w3gdatmd.F90 b/model/src/w3gdatmd.F90 index 7bc5e2f30..59d3bcddf 100644 --- a/model/src/w3gdatmd.F90 +++ b/model/src/w3gdatmd.F90 @@ -897,7 +897,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,& @@ -1317,7 +1317,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 @@ -2074,12 +2074,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. @@ -2648,6 +2654,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 diff --git a/model/src/w3gridmd.F90 b/model/src/w3gridmd.F90 index fa8128afb..5af38fc12 100644 --- a/model/src/w3gridmd.F90 +++ b/model/src/w3gridmd.F90 @@ -839,7 +839,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, & @@ -855,7 +856,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 @@ -997,7 +999,7 @@ 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, & @@ -1039,7 +1041,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 @@ -1718,6 +1720,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 @@ -1801,6 +1809,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 @@ -2106,8 +2119,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. @@ -2117,8 +2130,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 @@ -2129,7 +2143,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 @@ -2211,9 +2225,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 @@ -3197,7 +3211,7 @@ 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 @@ -3262,7 +3276,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 @@ -3305,7 +3319,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, & @@ -3642,7 +3656,7 @@ SUBROUTINE W3GRID() END SELECT IF (FSTOTALIMP .or. FSTOTALEXP) THEN - LPDLIB = .TRUE. + LPDLIB = .TRUE. ENDIF ! IF (SUM(UNSTSCHEMES).GT.1) WRITE(NDSO,1035) @@ -6234,7 +6248,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 @@ -6407,7 +6423,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 ! @@ -6519,12 +6535,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/ & @@ -6532,7 +6548,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/ & @@ -6543,7 +6559,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/w3iogrmd.F90 b/model/src/w3iogrmd.F90 index 4f211402d..f8723d812 100644 --- a/model/src/w3iogrmd.F90 +++ b/model/src/w3iogrmd.F90 @@ -1065,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 ! @@ -1313,35 +1313,35 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT & 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) & + READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & IC4PARS,IC4_KI,IC4_FC #endif #ifdef W3_IC5 - READ (NDSM) & + READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & IC5PARS #endif END IF @@ -1506,10 +1506,9 @@ 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, & @@ -1520,10 +1519,9 @@ 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:', & ZZWND, AALPHA, ZZ0MAX, BBETA, SSINTHP, ZZALP, & TTAUWSHELTER, SSWELLFPAR, SSWELLF, SSINBR, & ZZ0RAT, SSDSC, & @@ -1532,11 +1530,22 @@ 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 #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, & @@ -1547,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 ! diff --git a/model/src/w3src4md.F90 b/model/src/w3src4md.F90 index a1d4423bf..32eadaf82 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 @@ -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 diff --git a/model/src/w3srcemd.F90 b/model/src/w3srcemd.F90 index a846605d8..e90ba88eb 100644 --- a/model/src/w3srcemd.F90 +++ b/model/src/w3srcemd.F90 @@ -555,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 @@ -1034,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 @@ -1061,7 +1065,7 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & #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 @@ -1907,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 ! diff --git a/model/src/ww3_ounp.F90 b/model/src/ww3_ounp.F90 index 499e0371f..c35ff6e98 100644 --- a/model/src/ww3_ounp.F90 +++ b/model/src/ww3_ounp.F90 @@ -2158,7 +2158,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 ) diff --git a/regtests/bin/matrix.base b/regtests/bin/matrix.base index 3d1d84f16..3fcf651d6 100755 --- a/regtests/bin/matrix.base +++ b/regtests/bin/matrix.base @@ -906,12 +906,16 @@ 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 diff --git a/regtests/bin/run_cmake_test b/regtests/bin/run_cmake_test index 86248bb4e..844f3e23e 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 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_T707.nml b/regtests/ww3_ts1/input/namelists_ST4_T707.nml index 16f81517d..b1d0a9727 100644 --- a/regtests/ww3_ts1/input/namelists_ST4_T707.nml +++ b/regtests/ww3_ts1/input/namelists_ST4_T707.nml @@ -2,7 +2,7 @@ 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, + &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 / 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_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 index 0458cd775..8d19dd444 100644 --- a/regtests/ww3_ts1/input_10ms/namelists_ST4_T707.nml +++ b/regtests/ww3_ts1/input_10ms/namelists_ST4_T707.nml @@ -2,7 +2,7 @@ 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, + &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 / diff --git a/regtests/ww3_ts1/input_10ms/namelists_ST4_T713.nml b/regtests/ww3_ts1/input_10ms/namelists_ST4_T713.nml index 878604430..fa4a7eb78 100644 --- a/regtests/ww3_ts1/input_10ms/namelists_ST4_T713.nml +++ b/regtests/ww3_ts1/input_10ms/namelists_ST4_T713.nml @@ -1,8 +1,9 @@ &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 / -&SDS4 SDSBCHOICE=3, SDSC2 = -2.5, SDSBR = 0.005, +&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 / 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 ! +! -------------------------------------------------------------------- ! From 026fcdd66de9cd94644fd527eb1eced4a6dd66f6 Mon Sep 17 00:00:00 2001 From: Jessica Meixner Date: Mon, 22 Jan 2024 11:43:45 -0500 Subject: [PATCH 09/30] initialize USSP_WN for mod_def (#1165) --- model/src/w3gridmd.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/model/src/w3gridmd.F90 b/model/src/w3gridmd.F90 index 5af38fc12..51aa3d159 100644 --- a/model/src/w3gridmd.F90 +++ b/model/src/w3gridmd.F90 @@ -2976,6 +2976,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 From 9a718fc86fb0d4658dfcdd9295e156c7ce437d19 Mon Sep 17 00:00:00 2001 From: "W. Erick Rogers" <156342000+ErickRogers@users.noreply.github.com> Date: Tue, 23 Jan 2024 15:20:34 -0600 Subject: [PATCH 10/30] Introduce IC4M8 and IC4M9 to WW3 (#1176) --- manual/eqs/ICE4.tex | 16 +- manual/eqs/ICE5.tex | 4 +- manual/manual.bib | 81 ++++++- model/nml/ww3_shel.nml | 4 +- model/src/w3gdatmd.F90 | 21 +- model/src/w3gridmd.F90 | 15 +- model/src/w3iogrmd.F90 | 8 +- model/src/w3sic4md.F90 | 229 +++++++++++++++--- regtests/bin/matrix.base | 2 + regtests/ww3_tic1.1/info | 6 +- .../ww3_tic1.1/input_IC4_M8/namelists_1-D.nml | 2 + regtests/ww3_tic1.1/input_IC4_M8/points.list | 16 ++ regtests/ww3_tic1.1/input_IC4_M8/switch | 1 + regtests/ww3_tic1.1/input_IC4_M8/ww3_grid.inp | 42 ++++ regtests/ww3_tic1.1/input_IC4_M8/ww3_grid.nml | 81 +++++++ regtests/ww3_tic1.1/input_IC4_M8/ww3_ounf.inp | 20 ++ regtests/ww3_tic1.1/input_IC4_M8/ww3_ounf.nml | 29 +++ regtests/ww3_tic1.1/input_IC4_M8/ww3_outf.inp | 13 + .../ww3_tic1.1/input_IC4_M8/ww3_outp_spec.inp | 19 ++ .../input_IC4_M8/ww3_outp_tab50.inp | 19 ++ .../input_IC4_M8/ww3_outp_tab51.inp | 10 + .../input_IC4_M8/ww3_prep_icecon.inp | 38 +++ regtests/ww3_tic1.1/input_IC4_M8/ww3_shel.inp | 68 ++++++ regtests/ww3_tic1.1/input_IC4_M8/ww3_strt.inp | 17 ++ .../ww3_tic1.1/input_IC4_M9/namelists_1-D.nml | 2 + regtests/ww3_tic1.1/input_IC4_M9/points.list | 16 ++ regtests/ww3_tic1.1/input_IC4_M9/switch | 1 + regtests/ww3_tic1.1/input_IC4_M9/ww3_grid.inp | 42 ++++ regtests/ww3_tic1.1/input_IC4_M9/ww3_grid.nml | 81 +++++++ regtests/ww3_tic1.1/input_IC4_M9/ww3_ounf.inp | 20 ++ regtests/ww3_tic1.1/input_IC4_M9/ww3_ounf.nml | 29 +++ regtests/ww3_tic1.1/input_IC4_M9/ww3_outf.inp | 13 + .../ww3_tic1.1/input_IC4_M9/ww3_outp_spec.inp | 19 ++ .../input_IC4_M9/ww3_outp_tab50.inp | 19 ++ .../input_IC4_M9/ww3_outp_tab51.inp | 10 + .../input_IC4_M9/ww3_prep_icecon.inp | 38 +++ regtests/ww3_tic1.1/input_IC4_M9/ww3_shel.inp | 68 ++++++ regtests/ww3_tic1.1/input_IC4_M9/ww3_strt.inp | 17 ++ 38 files changed, 1071 insertions(+), 65 deletions(-) create mode 100644 regtests/ww3_tic1.1/input_IC4_M8/namelists_1-D.nml create mode 100644 regtests/ww3_tic1.1/input_IC4_M8/points.list create mode 100644 regtests/ww3_tic1.1/input_IC4_M8/switch create mode 100644 regtests/ww3_tic1.1/input_IC4_M8/ww3_grid.inp create mode 100644 regtests/ww3_tic1.1/input_IC4_M8/ww3_grid.nml create mode 100644 regtests/ww3_tic1.1/input_IC4_M8/ww3_ounf.inp create mode 100644 regtests/ww3_tic1.1/input_IC4_M8/ww3_ounf.nml create mode 100644 regtests/ww3_tic1.1/input_IC4_M8/ww3_outf.inp create mode 100644 regtests/ww3_tic1.1/input_IC4_M8/ww3_outp_spec.inp create mode 100644 regtests/ww3_tic1.1/input_IC4_M8/ww3_outp_tab50.inp create mode 100644 regtests/ww3_tic1.1/input_IC4_M8/ww3_outp_tab51.inp create mode 100644 regtests/ww3_tic1.1/input_IC4_M8/ww3_prep_icecon.inp create mode 100644 regtests/ww3_tic1.1/input_IC4_M8/ww3_shel.inp create mode 100644 regtests/ww3_tic1.1/input_IC4_M8/ww3_strt.inp create mode 100644 regtests/ww3_tic1.1/input_IC4_M9/namelists_1-D.nml create mode 100644 regtests/ww3_tic1.1/input_IC4_M9/points.list create mode 100644 regtests/ww3_tic1.1/input_IC4_M9/switch create mode 100644 regtests/ww3_tic1.1/input_IC4_M9/ww3_grid.inp create mode 100644 regtests/ww3_tic1.1/input_IC4_M9/ww3_grid.nml create mode 100644 regtests/ww3_tic1.1/input_IC4_M9/ww3_ounf.inp create mode 100644 regtests/ww3_tic1.1/input_IC4_M9/ww3_ounf.nml create mode 100644 regtests/ww3_tic1.1/input_IC4_M9/ww3_outf.inp create mode 100644 regtests/ww3_tic1.1/input_IC4_M9/ww3_outp_spec.inp create mode 100644 regtests/ww3_tic1.1/input_IC4_M9/ww3_outp_tab50.inp create mode 100644 regtests/ww3_tic1.1/input_IC4_M9/ww3_outp_tab51.inp create mode 100644 regtests/ww3_tic1.1/input_IC4_M9/ww3_prep_icecon.inp create mode 100644 regtests/ww3_tic1.1/input_IC4_M9/ww3_shel.inp create mode 100644 regtests/ww3_tic1.1/input_IC4_M9/ww3_strt.inp 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/manual.bib b/manual/manual.bib index c49e3340b..3da650ea2 100644 --- a/manual/manual.bib +++ b/manual/manual.bib @@ -524,7 +524,7 @@ @TECHREPORT{rep:CR17 INSTITUTION = "{N}aval {R}esearch {L}aboratory, {S}tennis {S}pace {C}enter, {MS}", TYPE = "NRL Memorandum Report", NUMBER = "NRL/MR/7320--17-9726", - NOTE = "25 pp., www7320.nrlssc.navy.mil/pubs.php" } + NOTE = "25 pp., www7320.nrlssc.navy.mil/pubs" } % item art:CRT17 @@ -1764,7 +1764,7 @@ @INPROCEEDINGS{pro:RZ14 TITLE = "New wave-ice interaction physics in {WAVEWATCH III}", BOOKTITLE = Ice14, PUBLISHER = "IAHR", - NOTE = "8 pp., www7320.nrlssc.navy.mil/pubs.php" } + NOTE = "8 pp., www7320.nrlssc.navy.mil/pubs" } % item rep:RPLA18 @@ -1775,7 +1775,18 @@ @TECHREPORT{rep:RPLA18 INSTITUTION = "{N}aval {R}esearch {L}aboratory, {S}tennis {S}pace {C}enter, {MS}", TYPE = "NRL Memorandum Report", NUMBER = "NRL/MR/7320--18-9786", - NOTE = "179 pp., www7320.nrlssc.navy.mil/pubs.php" } + NOTE = "179 pp., www7320.nrlssc.navy.mil/pubs" } + +% item rep:RYW2021 + +@TECHREPORT{rep:RYW2021, + AUTHOR = "W. E. Rogers and J. Yu and D. W. Wang", + YEAR = "2021", + TITLE = "Incorporating dependencies on ice thickness in empirical parameterizations of wave dissipation by sea ice", + INSTITUTION = "{N}aval {R}esearch {L}aboratory, {S}tennis {S}pace {C}enter, {MS}", + TYPE = "NRL Technical Report", + NUMBER = "NRL/OT/7320-21-5145", + NOTE = "35 pp., https://arxiv.org/abs/2104.01246" } % item rep:RMK18 @@ -1786,7 +1797,7 @@ @TECHREPORT{rep:RMK18 INSTITUTION = "{N}aval {R}esearch {L}aboratory, {S}tennis {S}pace {C}enter, {MS}", TYPE = "NRL Memorandum Report", NUMBER = "NRL/MR/7320--18-9801", - NOTE = "25 pp., www7320.nrlssc.navy.mil/pubs.php" } + NOTE = "25 pp., www7320.nrlssc.navy.mil/pubs" } % item art:RH09 @@ -1811,6 +1822,33 @@ @ARTICLE{art:RTS16 doi = "doi:10.1002/2016JC012251" } +% item art:YRW2019 + +@ARTICLE{art:YRW2019, + AUTHOR = "J. Yu and W. E. Rogers and D. W. Wang", + YEAR = 2019, + TITLE = "A Scaling for Wave Dispersion Relationships in Ice-Covered Waters", + JOURNAL = JGR, + VOLUME = "124", + PAGES = "8429--8438" , + doi = "doi:10.1029/2018JC014870" + } + +% item art:Yu2022 + +@Article{art:Yu2022, +AUTHOR = {Yu, Jie}, +TITLE = {Wave Boundary Layer at the Ice-Water Interface}, +JOURNAL = {Journal of Marine Science and Engineering}, +VOLUME = {10}, +YEAR = {2022}, +NUMBER = {10}, +ARTICLE-NUMBER = {1472}, +URL = {https://www.mdpi.com/2077-1312/10/10/1472}, +ISSN = {2077-1312}, +DOI = {10.3390/jmse10101472} +} + % item art:CFSRR10 @ARTICLE{art:CFSRR10, @@ -2346,7 +2384,7 @@ @TECHREPORT{rep:RC09 INSTITUTION = "{N}aval {R}esearch {L}aboratory, {S}tennis {S}pace {C}enter, {MS}", TYPE = "NRL Memorandum Report", NUMBER = "NRL/MR/7320--09-9193", - NOTE = "42 pp., www7320.nrlssc.navy.mil/pubs.php" } + NOTE = "42 pp., www7320.nrlssc.navy.mil/pubs" } % item rep:RO13 @@ -2357,7 +2395,7 @@ @TECHREPORT{rep:RO13 INSTITUTION = "{N}aval {R}esearch {L}aboratory, {S}tennis {S}pace {C}enter, {MS}", TYPE = "NRL Memorandum Report", NUMBER = "NRL/MR/7320--13-9462", - NOTE = "31 pp., www7320.nrlssc.navy.mil/pubs.php" } + NOTE = "31 pp., www7320.nrlssc.navy.mil/pubs" } % item rep:Roland2008 @@ -2606,6 +2644,17 @@ @MANUAL{man:SWAN3 ADDRESS = "P.O. Box 5048, 2600 GA Delft, The Netherlands", NOTE = "see http://swan.ct.tudelft.nl" } +% item man:SWAN4145A + +@MANUAL{man:SWAN4145A, + AUTHOR = "{SWAN team}", + YEAR = "2023", + TITLE = "{SWAN Cycle III} version 41.45A User Manual", + ORGANIZATION = "Delft University of Technology, + Faculty of Civil Engineering and Geosciences", + ADDRESS = "P.O. Box 5048, 2600 GA Delft, The Netherlands", + NOTE = "see https://swanmodel.sourceforge.io/" } + % item man:Jones98 @MANUAL{man:Jones98, @@ -3485,10 +3534,14 @@ @article{Liu2021 title={{Global Wave Hindcasts Using the Observation-based Source Terms: Description and Validation}}, author={Liu, Qingxiang and Babanin, Alexander and Rogers, W Erick and Zieger, Stefan and Young, Ian and Bidlot, Jean-Raymond and Durrant, Tom and Ewans, Kevin and Guan, Changlong and Kirezci, Cagil and Lemos, Gil and MacHutchon, Keith and Moon, Il-Ju and Rapizo, Henrique and Ribal, Agustinus and Semedo, Alvaro and Wang, Juanjuan}, journal={Journal of Advances in Modeling Earth Systems (JAMES)}, - year={submitted} + year = {2021}, + volume = {13}, + number = {8}, + pages = {e2021MS002493}, + doi = {https://doi.org/10.1029/2021MS002493}, } -@article{Rogers2021, +@article{art:RMK2021, title = {Estimates of spectral wave attenuation in Antarctic sea ice, using model/data inversion}, journal = {Cold Regions Science and Technology}, volume = {182}, @@ -3499,6 +3552,18 @@ @article{Rogers2021 author = {W. Erick Rogers and Michael H. Meylan and Alison L. Kohout} } +@article{art:YRW2022, + title = {A new method for parameterization of wave dissipation by sea ice}, + journal = {Cold Regions Science and Technology}, + volume = {199}, + pages = {103582}, + year = {2022}, + issn = {0165-232X}, + doi = {https://doi.org/10.1016/j.coldregions.2022.103582}, + url = {https://www.sciencedirect.com/science/article/pii/S0165232X2200101X}, + author = {Jie Yu and W. Erick Rogers and David W. Wang}, +} + @article{Forristall1981, author = {Forristall, George Z.}, doi = {10.1029/JC086iC09p08075}, diff --git a/model/nml/ww3_shel.nml b/model/nml/ww3_shel.nml index f6700ca8a..97beaf6a0 100644 --- a/model/nml/ww3_shel.nml +++ b/model/nml/ww3_shel.nml @@ -319,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/w3gdatmd.F90 b/model/src/w3gdatmd.F90 index 59d3bcddf..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 @@ -615,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 @@ -732,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(:) @@ -1144,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(:) @@ -1840,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 ) @@ -2314,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 diff --git a/model/src/w3gridmd.F90 b/model/src/w3gridmd.F90 index 51aa3d159..977a203ae 100644 --- a/model/src/w3gridmd.F90 +++ b/model/src/w3gridmd.F90 @@ -114,6 +114,7 @@ MODULE W3GRIDMD !/ 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 @@ -764,9 +765,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, & @@ -970,7 +972,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, & @@ -2891,6 +2894,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 @@ -5313,6 +5319,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 diff --git a/model/src/w3iogrmd.F90 b/model/src/w3iogrmd.F90 index f8723d812..ce4403ba3 100644 --- a/model/src/w3iogrmd.F90 +++ b/model/src/w3iogrmd.F90 @@ -1292,11 +1292,11 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT & #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:', & - IC4PARS,IC4_KI,IC4_FC + '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 @@ -1338,7 +1338,7 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT & #endif #ifdef W3_IC4 READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & - IC4PARS,IC4_KI,IC4_FC + IC4PARS,IC4_KI,IC4_FC,IC4_CN,IC4_FMIN,IC4_KIBK #endif #ifdef W3_IC5 READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & 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/regtests/bin/matrix.base b/regtests/bin/matrix.base index 3fcf651d6..97ae213f4 100755 --- a/regtests/bin/matrix.base +++ b/regtests/bin/matrix.base @@ -1953,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 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 From ff0358a6a4c34e5c4a18788d5141970b207961cb Mon Sep 17 00:00:00 2001 From: Mickael Accensi <49198861+mickaelaccensi@users.noreply.github.com> Date: Thu, 25 Jan 2024 16:23:51 +0100 Subject: [PATCH 11/30] clean up and add ST4 variables (#1181) --- model/nml/namelists.nml | 555 +++++++++++++++++++++++----------------- 1 file changed, 318 insertions(+), 237 deletions(-) diff --git a/model/nml/namelists.nml b/model/nml/namelists.nml index 390fdb874..9fb59fe1c 100644 --- a/model/nml/namelists.nml +++ b/model/nml/namelists.nml @@ -25,51 +25,68 @@ $ Define constants in source terms ----------------------------------- $ $ $ Stresses - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $ TC 1996 with cap : Namelist FLX3 -$ CDMAX : Maximum allowed CD (cap) -$ CTYPE : Cap type : +$ CDMAX : Maximum allowed CD (cap) +$ CTYPE : Cap type : $ 0: Discontinuous (default). $ 1: Hyperbolic tangent. +$ $ Hwang 2011 : Namelist FLX4 -$ CDFAC : re-scaling of drag +$ CDFAC : re-scaling of drag $ $ Linear input - - - - - - - - - - - - - - - - - - - - - - - - - - - - $ Cavaleri and M-R : Namelist SLN1 -$ CLIN : Proportionality constant. -$ RFPM : Factor for fPM in filter. -$ RFHF : Factor for fh in filter. +$ CLIN : Proportionality constant. +$ RFPM : Factor for fPM in filter. +$ RFHF : Factor for fh in filter. $ $ Exponential input - - - - - - - - - - - - - - - - - - - - - - - - - $ WAM-3 : Namelist SIN1 -$ CINP : Proportionality constant. +$ CINP : Proportionality constant. $ $ Tolman and Chalikov : Namelist SIN2 -$ ZWND : Height of wind (m). +$ ZWND : Height of wind (m). $ SWELLF : swell factor in (n.nn). -$ STABSH, STABOF, CNEG, CPOS, FNEG : -$ c0, ST0, c1, c2 and f1 in . (n.nn) +$ STABSH, STABOF, CNEG, CPOS, FNEG : c0, ST0, c1, c2 and f1 in . (n.nn) $ through (2.65) for definition of $ effective wind speed (!/STAB2). -$ WAM4 and variants : Namelist SIN3 -$ ZWND : Height of wind (m). -$ ALPHA0 : minimum value of Charnock coefficient -$ Z0MAX : maximum value of air-side roughness z0 -$ BETAMAX : maximum value of wind-wave coupling -$ SINTHP : power of cosine in wind input -$ ZALP : wave age shift to account for gustiness -$ TAUWSHELTER : sheltering of short waves to reduce u_star -$ SWELLFPAR : choice of swell attenuation formulation +$ +$ WAM4 and variants : Namelist SIN3 +$ ZWND : Height of wind (m). +$ ALPHA0 : minimum value of Charnock coefficient +$ Z0MAX : maximum value of air-side roughness z0 +$ BETAMAX : maximum value of wind-wave coupling +$ SINTHP : power of cosine in wind input +$ ZALP : wave age shift to account for gustiness +$ SWELLF : swell attenuation factor +$ +$ Janssen / Ardhuin : Namelist SIN4 +$ ZWND : Height of wind (m). +$ ALPHA0 : minimum value of Charnock coefficient +$ Z0MAX : maximum value of air-side roughness z0 +$ BETAMAX : maximum value of wind-wave coupling +$ SINTHP : power of cosine in wind input +$ ZALP : wave age shift to account for gustiness +$ SWELLF : swell attenuation factor +$ TAUWSHELTER : sheltering of short waves to reduce u_star +$ SWELLFPAR : choice of swell attenuation formulation $ (1: TC 1996, 3: ACC 2008) -$ SWELLF : swell attenuation factor -$ Extra parameters for SWELLFPAR=3 only -$ SWELLF2, SWELLF3 : swell attenuation factors -$ SWELLF4 : Threshold Reynolds number for ACC2008 -$ SWELLF5 : Relative viscous decay below threshold -$ Z0RAT : roughness for oscil. flow / mean flow +$ Extra parameters for SWELLFPAR=3 only +$ SWELLF2, SWELLF3 : swell attenuation factors +$ SWELLF4 : Threshold Reynolds number for ACC2008 +$ SWELLF5 : Relative viscous decay below threshold +$ Z0RAT : roughness for oscil. flow / mean flow +$ SINBR : effect of wave breaking on wind input +$ SINTABLE : flag to enable or the table computation +$ SINTAIL1 : tauwshelter for tail (no table) +$ SINTAIL2 : additional peak in capillary range +$ TAUWBUG : Set to 1 to keep bug on TAUW +$ VISCSTRESS : coefficient for viscous part of wind stress +$ $ BYDRZ input : Namelist SIN6 -$ SINA0 : factor for negative input -$ SINWS : wind speed scaling option -$ SINFC : high-frequency extent of the -$ prognostic frequency region +$ SINA0 : factor for negative input +$ SINWS : wind speed scaling option +$ SINFC : high-frequency extent of the +$ prognostic frequency region $ $ Nonlinear interactions - - - - - - - - - - - - - - - - - - - - - - - $ Discrete I.A. : Namelist SNL1 @@ -78,8 +95,7 @@ $ NLPROP : C in sourc term. NOTE : default $ value depends on other source $ terms selected. $ KDCONV : Factor before kd in Eq. (n.nn). -$ KDMIN, SNLCS1, SNLCS2, SNLCS3 : -$ Minimum kd, and constants c1-3 +$ KDMIN, SNLCS1, SNLCS2, SNLCS3 : Minimum kd, and constants c1-3 $ in depth scaling function. $ IQTYPE : Type of depth treatment $ -2 : Deep water GQM with scaling @@ -87,10 +103,11 @@ $ 1 : Deep water DIA $ 2 : Deep water DIA with scaling $ 3 : Shallow water DIA $ TAILNL : Parametric tail power. -$ GQMNF1, GQMNT1, GQMNQ_OM2 : Gaussian quadrature resolution -$ GQMTHRSAT : Threshold on saturation for SNL calculation -$ GQMTHRCOU : Threshold for filter on coupling coefficient -$ GQAMP1, GQAMP2, GQAMP3, GQAMP4 : Amplification factors +$ GQMNF1, GQMNT1, GQMNQ_OM2 : Gaussian quadrature resolution +$ GQMTHRSAT : Threshold on saturation for SNL calculation +$ GQMTHRCOU : Threshold for filter on coupling coefficient +$ GQAMP1, GQAMP2, GQAMP3, GQAMP4 : Amplification factors +$ $ Exact interactions : Namelist SNL2 $ IQTYPE : Type of depth treatment $ 1 : Deep water @@ -100,22 +117,26 @@ $ TAILNL : Parametric tail power. $ NDEPTH : Number of depths in for which $ integration space is established. $ Used for IQTYPE = 3 only +$ $ Namelist ANL2 $ DEPTHS : Array with depths for NDEPTH = 3 +$ $ Gen. Multiple DIA : Namelist SNL3 -$ NQDEF : Number of quadruplets. -$ MSC : Scaling constant 'm'. -$ NSC : Scaling constant 'N'. -$ KDFD : Deep water relative filter depth, -$ KDFS : Shallow water relative filter depth, +$ NQDEF : Number of quadruplets. +$ MSC : Scaling constant 'm'. +$ NSC : Scaling constant 'N'. +$ KDFD : Deep water relative filter depth, +$ KDFS : Shallow water relative filter depth, +$ $ Namelist ANL3 $ QPARMS : 5 x NQDEF paramaters describing the $ quadruplets, repeating LAMBDA, MU, DT12. $ Cdeep and Cshal. See examples below. +$ $ Two Scale Approx. : Namelist SNL4 $ INDTSA : Index for TSA/FBI computations $ (0 = FBI ; 1 = TSA) -$ ALTLP : Index for alternate looping +$ ALTLP : Index for alternate looping $ (1 = no ; 2 = yes) $ $ Traditional DIA setup (default): @@ -141,141 +162,182 @@ $ 0.369, 0.226, 11.5, 0.118E+08, 0.000E+00 / $ $ Nonlinear filter based on DIA - - - - - - - - - - - - - - - - - - - $ Namelist SNLS -$ A34 : Relative offset in quadruplet -$ FHFC : Proportionality constants. -$ DMN : Maximum relative change. -$ FC1-3 : Constants in frequency filter. +$ A34 : Relative offset in quadruplet +$ FHFC : Proportionality constants. +$ DMN : Maximum relative change. +$ FC1-3 : Constants in frequency filter. $ $ Whitecapping dissipation - - - - - - - - - - - - - - - - - - - - - $ WAM-3 : Namelist SDS1 -$ CDIS, APM : As in source term. +$ CDIS, APM : As in source term. $ $ Tolman and Chalikov : Namelist SDS2 -$ SDSA0, SDSA1, SDSA2, SDSB0, SDSB1, PHIMIN : -$ Constants a0, a1, a2, b0, b1 and -$ PHImin. +$ SDSA0,SDSA1,SDSA2,SDSB0,SDSB1 : Constants a0, a1, a2, b0, b1 and +$ PKIMIN : Constants PHImin $ $ WAM4 and variants : Namelist SDS3 -$ SDSC1 : WAM4 Cds coeffient -$ MNMEANP, WNMEANPTAIL : power of wavenumber +$ SDSC1 : WAM4 Cds coeffient +$ MNMEANP, WNMEANPTAIL : power of wavenumber $ for mean definitions in Sds and tail -$ SDSDELTA1, SDSDELTA2 : relative weights +$ SDSDELTA1, SDSDELTA2 : relative weights $ of k and k^2 parts of WAM4 dissipation -$ SDSLF, SDSHF : coefficient for activation of -$ WAM4 dissipation for unsaturated (SDSLF) and -$ saturated (SDSHF) parts of the spectrum -$ SDSC2 : Saturation dissipation coefficient -$ SDSC4 : Value of B0=B/Br for wich Sds is zero -$ SDSBR : Threshold Br for saturation -$ SDSP : power of (B/Br-B0) in Sds -$ SDSBR2 : Threshold Br2 for the separation of -$ WAM4 dissipation in saturated and non-saturated -$ SDSC5 : coefficient for turbulence dissipation -$ SDSC6 : Weight for the istropic part of Sds_SAT -$ SDSDTH: Angular half-width for integration of B +$ SDSLF, SDSHF : coefficient for activation of +$ WAM4 dissipation for unsaturated (SDSLF) and +$ saturated (SDSHF) parts of the spectrum +$ SDSC2 : Saturation dissipation coefficient +$ SDSC4 : Value of B0=B/Br for wich Sds is zero +$ SDSBR : Threshold Br for saturation +$ SDSP : power of (B/Br-B0) in Sds +$ SDSBR2 : Threshold Br2 for the separation of +$ WAM4 dissipation in saturated and non-saturated +$ SDSC5 : coefficient for turbulence dissipation +$ SDSC6 : Weight for the istropic part of Sds_SAT +$ SDSDTH : Angular half-width for integration of B +$ +$ Ardhuin : Namelist SDS4 +$ SDSBCHOICE : 1: Ardhuin et al., 2: Filipot & Ardhuin, 3: Romero +$ WNMEANP, WNMEANPTAIL : power of wavenumber +$ for mean definitions in Sds and tail +$ FXPM3 : Coefficient defining the diagnostic tail +$ FXFM3 : Coefficient defining the diagnostic tail +$ FXFMAGE : This does not do anything as FHIGI is not used in W3SRCE +$ SDSC2 : coefficient in front of dissipation term +$ SDSCUM : coefficient for cumulative breaking term +$ SDSSTRAIN : Straining coefficient +$ SDSSTRAINA : Not used anymore +$ SDSSTRAIN2 : If non-zero, uses a directionally-enhanced straining +$ SDSC4 : Not used anymore +$ SDSFACMTF : MTF factor for Lambda , Romero (2019) +$ SDSNMTF : MTF power +$ SDSCUMP : 2 for cumulative mss, 1 for cumulative orb. vel. +$ SDSC5 : coefficient for wave-turbulence interaction (Ardhuin & Jenkins +$ SDSC6 : delta_d in eq. (13) of Ardhuin et al. (2010) +$ SDSBR : saturation threshold +$ SDSBT : Saturation threshold for dissipation rate b +$ SDSP : power of saturation in diagonal term +$ SDSISO : Not used anymore +$ SDSBCK : Coefficient for Filipot & Ardhuin +$ SDSABK : Coefficient for Filipot & Ardhuin +$ SDSPBK : Coefficient for Filipot & Ardhuin +$ SDSBINT : frequency integration factor for Filipot & Ardhuin +$ SDSHCK : power of tanh(KD) in Filipot & Ardhuin +$ SDSDTH : half-widht of directional integration for Ardhuin saturation +$ SDSCOS : power of coside for saturation +$ SDSBRF1 : ratio of f_high / f for which cumulative term at f has an impact on f_high +$ SDSBRFDF : not used anymore +$ SDSNUW : viscous dissipation term (water side only) : DVISC = - 4 SDSNUW*k**2 +$ SDSBM0 : activates depth correction to Ardhuin et al. , with X = tanhs (kD) +$ SDSBM1 : coefficients of polynomial function to enhance saturation +$ SDSBM2 : based on Fig. 2 in Filipot et et al. (JGR 2010) +$ SDSBM3 : the code is MICHE=(X*(SSDSBM(1)+X*(SSDSBM(2)+X*(SSDSBM(3) +X*SSDSBM(4)))))**2 +$ SDSBM4 : it should be MICHE=(X*(SSDSBM(1)+X*(SSDSBM(2)+X**2*(SSDSBM(3)+X**3*SSDSBM(4)))))**2 +$ CUMSIGP : power of frequency for defining the direction of mean direction used in Romero (default is 0 but not optimal) +$ see Alday and Ardhuin (2023) with CUMSIGP=2 in T701-GQM +$ WHITECAPWIDTH : constant fraction of breaker wavelength +$ WHITECAPDUR : breaking duration factor +$ SDSMWD : new AFo +$ SDSMWPOW : (k)^pow +$ SDKOF : ko factor such that ko= g (SDKOF/(28 us))^2 $ $ BYDRZ : Namelist SDS6 -$ SDSET : Select threshold normalization spectra -$ SDSA1, SDSA2, SDSP1, SDSP2 : -$ Coefficients for dissipation terms T1 and T2 +$ SDSET : Select threshold normalization spectra +$ SDSA1, SDSA2, SDSP1, SDSP2 : Coefficients for dissipation terms T1 and T2 $ : Namelist SWL6 -$ SWLB1 : Coefficient for swell dissipation +$ SWLB1 : Coefficient for swell dissipation $ $ Bottom friction - - - - - - - - - - - - - - - - - - - - - - - - - - $ JONSWAP : Namelist SBT1 -$ GAMMA : Bottom friction emprical constant +$ GAMMA : Bottom friction emprical constant $ $ $ Surf breaking - - - - - - - - - - - - - - - - - - - - - - - - - - - $ Battjes and Janssen : Namelist SDB1 -$ BJALFA : Dissipation constant (default = 1) -$ BJGAM : Breaking threshold (default = 0.73) -$ BJFLAG : TRUE - Use Hmax/d ratio only (default) -$ FALSE - Use Hmax/d in Miche formulation +$ BJALFA : Dissipation constant (default = 1) +$ BJGAM : Breaking threshold (default = 0.73) +$ BJFLAG : TRUE - Use Hmax/d ratio only (default) +$ FALSE - Use Hmax/d in Miche formulation $ $ Dissipation in the ice - - - - - - - - - - - - - - - - - - - - - - $ Generalization of Liu et al. : Namelist SIC2 -$ IC2DISPER : If true uses Liu formulation with eddy viscosity -$ If false, uses the generalization with turbulent -$ to laminar transition -$ IC2TURB : empirical factor for the turbulent part -$ IC2ROUGH : under-ice roughness length -$ IC2REYNOLDS: Re number for laminar to turbulent transition -$ IC2SMOOTH : smoothing of transition reprensenting random waves -$ IC2VISC : empirical factor for viscous part +$ IC2DISPER : If true uses Liu formulation with eddy viscosity +$ If false, uses the generalization with turbulent +$ to laminar transition +$ IC2TURB : empirical factor for the turbulent part +$ IC2ROUGH : under-ice roughness length +$ IC2REYNOLDS : Re number for laminar to turbulent transition +$ IC2SMOOTH : smoothing of transition reprensenting random waves +$ IC2VISC : empirical factor for viscous part $ $ $ Scattering in the ice & creep dissipations- - - - - - - - - - - - - $ Generalization of Wiliams et al. : Namelist SIS2 -$ ISC1 : scattering coefficient (default = 1) -$ IS2BACKSCAT : fraction of energy back-scattered (default = 1 ) -$ IS2BREAK : TRUE - changes floe max diameter -$ : FALSE - does not change floe max diameter -$ IS2C1 : scattering in pack ice -$ IS2C2 : frequency dependance of scattering in pack ice -$ IS2C3 : frequency dependance of scattering in pack ice -$ ISBACKSCAT : fraction of scattered energy actualy redistributed -$ IS2DISP : use of ice-specific dispersion relation (T/F) -$ FRAGILITY : parameter between 0 and 1 that gives the shape of FSD -$ IS2DMIN : minimum floe diameter in meters -$ IS2DAMP : multiplicative coefficient for dissipation term from RP -$ IS2UPDATE : TRUE - updates the max floe diameter with forcing only -$ : FALSE - updates the max floe diameter at each time step +$ ISC1 : scattering coefficient (default = 1) +$ IS2BACKSCAT : fraction of energy back-scattered (default = 1 ) +$ IS2BREAK : TRUE - changes floe max diameter +$ FALSE - does not change floe max diameter +$ IS2C1 : scattering in pack ice +$ IS2C2 : frequency dependance of scattering in pack ice +$ IS2C3 : frequency dependance of scattering in pack ice +$ ISBACKSCAT : fraction of scattered energy actualy redistributed +$ IS2DISP : use of ice-specific dispersion relation (T/F) +$ FRAGILITY : parameter between 0 and 1 that gives the shape of FSD +$ IS2DMIN : minimum floe diameter in meters +$ IS2DAMP : multiplicative coefficient for dissipation term from RP +$ IS2UPDATE : TRUE - updates the max floe diameter with forcing only +$ FALSE - updates the max floe diameter at each time step $ $ Dissipation by sea ice $ Empirical/parametric representations : Namelist SIC4 -$ IC4METHOD : integer 1 to 7 -$ : In most cases, additional input -$ : is required. -$ : See examples in /regtests/ww3_tic1.1/ -$ : See also: 1) description in manual -$ : and 2) inline documentation in -$ w3sic4md.ftn +$ IC4METHOD : integer 1 to 7 +$ In most cases, additional input is required. +$ See examples in /regtests/ww3_tic1.1/ +$ See also: 1) description in manual +$ and 2) inline documentation in w3sic4md.ftn $ $ Triad nonlinear interactions - - - - - - - - - - - - - - - - - - - - $ Lumped Triad Interaction (LTA) : Namelist STR1 (To be implemented) -$ PTRIAD1 : Proportionality coefficient (default 1.) -$ PTRIAD2 : Multiple of Tm01 up to which interaction -$ is computed (2.5) -$ PTRIAD3 : Ursell upper limit for computing -$ interactions (not used, default 10.) -$ PTRIAD4 : Shape parameter for biphase -$ computation (0.2) -$ PTRIAD5 : Ursell number treshold for computing -$ interactions (0.01) +$ PTRIAD1 : Proportionality coefficient (default 1.) +$ PTRIAD2 : Multiple of Tm01 up to which interaction +$ is computed (2.5) +$ PTRIAD3 : Ursell upper limit for computing +$ interactions (not used, default 10.) +$ PTRIAD4 : Shape parameter for biphase +$ computation (0.2) +$ PTRIAD5 : Ursell number treshold for computing +$ interactions (0.01) $ $ Shoreline reflections - - - - - - - - - - - - - - - - - - - - - - - - $ ref. parameters : Namelist REF1 -$ REFCOAST : Reflection coefficient at shoreline -$ REFFREQ : Activation of freq-dependent ref. -$ REFMAP : Scale factor for bottom slope map -$ REFRMAX : maximum ref. coeffient (default 0.8) -$ REFFREQPOW: power of frequency -$ REFICEBERG: Reflection coefficient for icebergs -$ REFSUBGRID: Reflection coefficient for islands -$ REFCOSP_STRAIGHT: power of cosine used for -$ straight shoreline +$ REFCOAST : Reflection coefficient at shoreline +$ REFFREQ : Activation of freq-dependent ref. +$ REFMAP : Scale factor for bottom slope map +$ REFRMAX : maximum ref. coeffient (default 0.8) +$ REFFREQPOW : power of frequency +$ REFICEBERG : Reflection coefficient for icebergs +$ REFSUBGRID : Reflection coefficient for islands +$ REFCOSP_STRAIGHT : power of cosine used for +$ straight shoreline $ $ Bound 2nd order spectrum and free IG - - - - - - - - - - - - - - - - - $ IG1 parameters : Namelist SIG1 -$ 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. +$ 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 @@ -284,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. $ @@ -294,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. $ @@ -361,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. $ @@ -386,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) @@ -414,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. @@ -427,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. From ba5cd68fbb5a5be98e196b51aecda2f4bbb7f7a9 Mon Sep 17 00:00:00 2001 From: Matthew Masarik <86749872+MatthewMasarik-NOAA@users.noreply.github.com> Date: Mon, 5 Feb 2024 13:45:25 -0500 Subject: [PATCH 12/30] w3fld1md.F90: fix divide by zero in CRIT2 parameter (#1184) --- model/src/w3fld1md.F90 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/model/src/w3fld1md.F90 b/model/src/w3fld1md.F90 index 960fd185a..10b2fce08 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 From fd6d559e5dbcea001dec8f138edca90589098c42 Mon Sep 17 00:00:00 2001 From: Matthew Masarik <86749872+MatthewMasarik-NOAA@users.noreply.github.com> Date: Mon, 5 Feb 2024 13:45:48 -0500 Subject: [PATCH 13/30] ww3_prnc.F90: fix out-of-scope grid index write statement (#1185) --- model/src/ww3_prnc.F90 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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.'/) From 6d420257c4e1439fd76f4b0d6185e0e4c46d3199 Mon Sep 17 00:00:00 2001 From: Matthew Masarik <86749872+MatthewMasarik-NOAA@users.noreply.github.com> Date: Thu, 15 Feb 2024 08:39:18 -0500 Subject: [PATCH 14/30] Bugfix: address potential divide-by-zero in APPENDTAIL (#1188) Co-authored-by: Denise Worthen --- model/src/cmake/src_list.cmake | 2 -- model/src/w3fld1md.F90 | 18 +++++++++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) 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/w3fld1md.F90 b/model/src/w3fld1md.F90 index 10b2fce08..fdd5ad230 100644 --- a/model/src/w3fld1md.F90 +++ b/model/src/w3fld1md.F90 @@ -1120,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 !----------------------------------------------------------- @@ -1138,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 @@ -1152,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) From e085bcfa4e735100dcb5a7185cd3cb655f0673e3 Mon Sep 17 00:00:00 2001 From: Chris Bunney <48915820+ukmo-ccbunney@users.noreply.github.com> Date: Fri, 23 Feb 2024 19:06:28 +0000 Subject: [PATCH 15/30] Provide initial drying of cells with depth < ZLIM for SMC grid. (#1192) --- model/src/w3gridmd.F90 | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/model/src/w3gridmd.F90 b/model/src/w3gridmd.F90 index 977a203ae..e81c4ea91 100644 --- a/model/src/w3gridmd.F90 +++ b/model/src/w3gridmd.F90 @@ -678,6 +678,7 @@ MODULE W3GRIDMD #endif ! #ifdef W3_SMC + REAL :: DVSMC REAL :: TRNMX, TRNMY INTEGER, ALLOCATABLE :: NLvCelsk(:), NLvUFcsk(:), NLvVFcsk(:) INTEGER, ALLOCATABLE :: IJKCelin(:,:),IJKUFcin(:,:),IJKVFcin(:,:) @@ -3944,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 ! @@ -5065,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. From 156a46dfdc5bba3b9679e3a704197125ecaf6c52 Mon Sep 17 00:00:00 2001 From: Chris Bunney <48915820+ukmo-ccbunney@users.noreply.github.com> Date: Mon, 11 Mar 2024 12:57:05 +0000 Subject: [PATCH 16/30] Output OMP threading info to screen when running ww3_shel/ww3_multi compiled with the OMPG switch. Also fixes truncation of build.log when running run_cmake_build. (#1191) * Added screen output showing number of threads when OMP enabled. * update build to get more info in logs (#46) --------- Co-authored-by: Jessica Meixner --- model/src/ww3_multi.F90 | 13 +++++++++++++ model/src/ww3_shel.F90 | 14 ++++++++++++++ regtests/bin/run_cmake_test | 18 +++++++++--------- 3 files changed, 36 insertions(+), 9 deletions(-) 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_shel.F90 b/model/src/ww3_shel.F90 index ee3464f44..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 @@ -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) @@ -2737,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/regtests/bin/run_cmake_test b/regtests/bin/run_cmake_test index 844f3e23e..993745060 100755 --- a/regtests/bin/run_cmake_test +++ b/regtests/bin/run_cmake_test @@ -435,21 +435,21 @@ 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 echo "Fatal error in cmake." echo "The build log is in $ofile" exit fi - make -j 8 > $ofile 2>&1 + make -j 8 VERBOSE=1 >> $ofile 2>&1 rc=$? if [[ $rc -ne 0 ]] ; then echo "Fatal error in make." echo "The build log is in $ofile" exit fi - make install > $ofile 2>&1 + make install >> $ofile 2>&1 if [[ $rc -ne 0 ]] ; then echo "Fatal error in make install." echo "The build log is in $ofile" @@ -468,20 +468,20 @@ 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 echo "Fatal error in cmake." echo "The build log is in $ofile" exit fi - make -j 8 > $ofile 2>&1 + make -j 8 VERBOSE=1 >> $ofile 2>&1 if [[ $rc -ne 0 ]] ; then echo "Fatal error in make." echo "The build log is in $ofile" exit fi - make install > $ofile 2>&1 + make install >> $ofile 2>&1 if [[ $rc -ne 0 ]] ; then echo "Fatal error in make install." echo "The build log is in $ofile" @@ -507,20 +507,20 @@ 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 echo "Fatal error in cmake." echo "The build log is in $ofile" exit fi - make -j 8 > $ofile 2>&1 + make -j 8 VERBOSE=1 >> $ofile 2>&1 if [[ $rc -ne 0 ]] ; then echo "Fatal error in make." echo "The build log is in $ofile" exit fi - make install > $ofile 2>&1 + make install >> $ofile 2>&1 if [[ $rc -ne 0 ]] ; then echo "Fatal error in make install." echo "The build log is in $ofile" From 9d3799f2fd1cf0c366071a6de9c01c9fa3e06ee8 Mon Sep 17 00:00:00 2001 From: Jessica Meixner Date: Tue, 12 Mar 2024 09:06:31 -0400 Subject: [PATCH 17/30] update run_cmake_test to catch build errors and exit (#1194) --- regtests/bin/run_cmake_test | 57 ++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/regtests/bin/run_cmake_test b/regtests/bin/run_cmake_test index 993745060..07ade5a8b 100755 --- a/regtests/bin/run_cmake_test +++ b/regtests/bin/run_cmake_test @@ -437,23 +437,24 @@ then cat $path_build/switch >> $ofile 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 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 + 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/ @@ -470,22 +471,24 @@ then cat $path_build/switch >> $ofile 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 VERBOSE=1 >> $ofile 2>&1 - if [[ $rc -ne 0 ]] ; then + 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 + 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/ @@ -509,22 +512,24 @@ else cat $path_build/switch >> $ofile 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 VERBOSE=1 >> $ofile 2>&1 - if [[ $rc -ne 0 ]] ; then + 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 + 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/ From e064dbf4c873b984e9ef29394282748442da9ca0 Mon Sep 17 00:00:00 2001 From: Chris Bunney <48915820+ukmo-ccbunney@users.noreply.github.com> Date: Wed, 13 Mar 2024 20:42:08 +0000 Subject: [PATCH 18/30] Adds 360_day calendar support to ww3_prnc (#1193) --- model/src/w3timemd.F90 | 97 ++++++++++++++++++++++++++++-------------- model/src/ww3_prnc.F90 | 47 +++++++++++++++----- 2 files changed, 101 insertions(+), 43 deletions(-) diff --git a/model/src/w3timemd.F90 b/model/src/w3timemd.F90 index 11376969f..0041866db 100644 --- a/model/src/w3timemd.F90 +++ b/model/src/w3timemd.F90 @@ -6,7 +6,7 @@ MODULE W3TIMEMD !/ | WAVEWATCH III NOAA/NCEP | !/ | H. L. Tolman | !/ | FORTRAN 90 | - !/ | Last update : 12-Jan-2021 | + !/ | Last update : 23-Feb-2024 | !/ +-----------------------------------+ !/ !/ Copyright 2009 National Weather Service (NWS), @@ -1233,6 +1233,7 @@ SUBROUTINE D2J(DAT,JULIAN,IERR) !/ +-----------------------------------+ !/ !/ 04-Jan-2018 : Origination from m_time library ( version 6.04 ) + !/ 23-Feb-2024 : Updated to handle 360_day calendar ( version 7.14 ) !/ ! 1. Purpose : ! @@ -1251,6 +1252,8 @@ SUBROUTINE D2J(DAT,JULIAN,IERR) ! * There is no year zero ! * Julian Day must be non-negative ! * Julian Day starts at noon; while Civil Calendar date starts at midnight + ! * If CALTYPE is "360_day" a simpler calculation is used (30 days in every + ! month) with a reference date of 1800-01-01. ! ! 3. Parameters : ! @@ -1313,6 +1316,21 @@ SUBROUTINE D2J(DAT,JULIAN,IERR) JULIAN = -HUGE(99999) ! this is the date if an error occurs and IERR is < 0 + ! Special case for 360 day climate calendar; return a pseudo-Julian day + ! Assumes a reference date of 1800-01-01 00:00:00 + IF( CALTYPE .EQ. "360_day" ) THEN + JULIAN = (YEAR - 1800) * 360.0 + & ! Years since 1800 + (MONTH - 1) * 30.0 + & + (DAY - 1) + & + HOUR / 24.0_8 + & + MINUTE / 1440.0_8 + & + SECOND / 86400.0_8 + + IERR = 0 + RETURN + ENDIF + + ! Standard/Gregorian calendar - return standard Julian day calculation: IF(YEAR==0 .or. YEAR .lt. -4713) THEN IERR=-1 RETURN @@ -1356,6 +1374,7 @@ SUBROUTINE J2D(JULIAN,DAT,IERR) !/ +-----------------------------------+ !/ !/ 04-Jan-2018 : Origination from m_time library ( version 6.04 ) + !/ 23-Feb-2024 : Upated to handle 360_day calendar ( version 7.14 ) !/ ! 1. Purpose : ! @@ -1364,6 +1383,8 @@ SUBROUTINE J2D(JULIAN,DAT,IERR) ! * There is no year zero ! * Julian Day must be non-negative ! * Julian Day starts at noon; while Civil Calendar date starts at midnight + ! * If CALTYPE is "360_day" a simpler calculation is used (30 days in every + ! month) with a reference date of 1800-01-01. ! ! 3. Parameters : ! @@ -1397,7 +1418,7 @@ SUBROUTINE J2D(JULIAN,DAT,IERR) DOUBLE PRECISION,INTENT(IN) :: JULIAN ! Julian Day (non-negative, but may be non-integer) INTEGER,INTENT(OUT) :: DAT(8) ! array like returned by DATE_AND_TIME(3f) INTEGER,INTENT(OUT) :: IERR ! Error return, 0 for successful execution - ! Otherwise returnb 1 + ! ! otherwise return 1 !/ !/ ------------------------------------------------------------------- / !/ Local parameters @@ -1417,27 +1438,31 @@ SUBROUTINE J2D(JULIAN,DAT,IERR) #ifdef W3_S CALL STRACE (IENT, 'J2D') #endif + ! - IF(JULIAN.LT.0.d0) THEN ! Negative Julian Day not allowed + IF(CALTYPE .EQ. 'standard' .AND. JULIAN .LT. 0.d0) THEN + ! Negative Julian Day not allowed IERR=1 RETURN - ELSE - IERR=0 END IF !CALL DATE_AND_TIME(values=TIMEZONE) ! Get the timezone !TZ=TIMEZONE(4) TZ=0 ! Force to UTC timezone + ! Calculation for time (hour,min,sec) same for Julian + ! and 360_day calendars: IJUL=IDINT(JULIAN) ! Integral Julian Day SECOND=SNGL((JULIAN-DBLE(IJUL))*SECDAY) ! Seconds from beginning of Jul. Day SECOND=SECOND+(tz*60) - IF(SECOND.GE.(SECDAY/2.0d0)) THEN ! In next calendar day - IJUL=IJUL+1 - SECOND=SECOND-(SECDAY/2.0d0) ! Adjust from noon to midnight - ELSE ! In same calendar day - SECOND=SECOND+(SECDAY/2.0d0) ! Adjust from noon to midnight + IF(CALTYPE .EQ. "standard") THEN + IF(SECOND.GE.(SECDAY/2.0d0)) THEN ! In next calendar day + IJUL=IJUL+1 + SECOND=SECOND-(SECDAY/2.0d0) ! Adjust from noon to midnight + ELSE ! In same calendar day + SECOND=SECOND+(SECDAY/2.0d0) ! Adjust from noon to midnight + END IF END IF IF(SECOND.GE.SECDAY) THEN ! Final check to prevent time 24:00:00 @@ -1450,31 +1475,38 @@ SUBROUTINE J2D(JULIAN,DAT,IERR) HOUR=MINUTE/60 ! Integral hours from beginning of day MINUTE=MINUTE-HOUR*60 ! Integral minutes from beginning of hour - !--------------------------------------------- - JALPHA=IDINT((DBLE(IJUL-1867216)-0.25d0)/36524.25d0) ! Correction for Gregorian Calendar - JA=IJUL+1+JALPHA-IDINT(0.25d0*DBLE(JALPHA)) - !--------------------------------------------- + IF(CALTYPE .EQ. '360_day') THEN + ! Calculate date parts for 360 day climate calendar + YEAR = INT(JULIAN / 360) + 1800 ! (base year is 1800) + MONTH = MOD(INT(JULIAN / 30), 12) + 1 + DAY = MOD(INT(JULIAN), 30) + 1 + ELSE ! Stardard Julian day calculation + !--------------------------------------------- + JALPHA=IDINT((DBLE(IJUL-1867216)-0.25d0)/36524.25d0) ! Correction for Gregorian Calendar + JA=IJUL+1+JALPHA-IDINT(0.25d0*DBLE(JALPHA)) + !--------------------------------------------- - JB=JA+1524 - JC=IDINT(6680.d0+(DBLE(JB-2439870)-122.1d0)/365.25d0) - JD=365*JC+IDINT(0.25d0*DBLE(JC)) - JE=IDINT(DBLE(JB-JD)/30.6001d0) - DAY=JB-JD-IDINT(30.6001d0*DBLE(JE)) - MONTH=JE-1 + JB=JA+1524 + JC=IDINT(6680.d0+(DBLE(JB-2439870)-122.1d0)/365.25d0) + JD=365*JC+IDINT(0.25d0*DBLE(JC)) + JE=IDINT(DBLE(JB-JD)/30.6001d0) + DAY=JB-JD-IDINT(30.6001d0*DBLE(JE)) + MONTH=JE-1 - IF(MONTH.GT.12) THEN - MONTH=MONTH-12 - END IF - - YEAR=jc-4715 - IF(MONTH.GT.2) THEN - YEAR=YEAR-1 - END IF - - IF(YEAR.LE.0) THEN - YEAR=YEAR-1 - END IF + IF(MONTH.GT.12) THEN + MONTH=MONTH-12 + END IF + YEAR=jc-4715 + IF(MONTH.GT.2) THEN + YEAR=YEAR-1 + END IF + + IF(YEAR.LE.0) THEN + YEAR=YEAR-1 + END IF + ENDIF + DAT(1)=YEAR DAT(2)=MONTH DAT(3)=DAY @@ -1487,7 +1519,6 @@ SUBROUTINE J2D(JULIAN,DAT,IERR) ! RETURN !/ - !/ End of J2D ----------------------------------------------------- / !/ END SUBROUTINE J2D diff --git a/model/src/ww3_prnc.F90 b/model/src/ww3_prnc.F90 index 59747d32a..e107a1f43 100644 --- a/model/src/ww3_prnc.F90 +++ b/model/src/ww3_prnc.F90 @@ -766,6 +766,9 @@ PROGRAM W3PRNC CALL STME21 ( TIMESTOP , IDTIME ) IF ( IAPROC .EQ. NAPOUT ) WRITE (NDSO,2931) IDTIME END IF + IF(CALTYPE .NE. 'standard') THEN + IF ( IAPROC .EQ. NAPOUT ) WRITE (NDSO,2932) CALTYPE + ENDIF END IF IF (.NOT. FLTIME) THEN CALL STME21 ( TIMESHIFT , IDTIME ) @@ -797,11 +800,26 @@ PROGRAM W3PRNC CALL CHECK_ERR(IRET) IRET=NF90_GET_ATT(NCID,VARIDTMP,"calendar",CALENDAR) IF ( IRET/=NF90_NOERR ) THEN + ! No calendar attribute - default to "standard" WRITE(NDSE,1028) - ELSE IF ((INDEX(CALENDAR, "standard").EQ.0) .AND. & - (INDEX(CALENDAR, "gregorian").EQ.0)) THEN - WRITE(NDSE,1029) + CALENDAR = "standard" + ELSE IF ((INDEX(CALENDAR, "standard") .GT. 0) .OR. & + (INDEX(CALENDAR, "gregorian") .GT. 0)) THEN + CALENDAR = "standard" + ELSE IF (INDEX(CALENDAR, "360_day") .GT. 0) THEN + CALENDAR = "360_day" + ELSE + ! Calendar attribute set, but not a recognised calendar. + WRITE(NDSE,1029) CALENDAR + CALL EXTCDE( 25 ) END IF + + ! Check input calendar compatible with expected calendar + IF(CALENDAR .NE. CALTYPE) THEN + WRITE(NDSE,1027) CALTYPE, CALENDAR + CALL EXTCDE( 26 ) + ENDIF + IRET=NF90_GET_ATT(NCID,VARIDTMP,"units",TIMEUNITS) CALL CHECK_ERR(IRET) CALL U2D(TIMEUNITS,REFDATE,IERR) @@ -821,7 +839,7 @@ PROGRAM W3PRNC END DO IRET=NF90_GET_ATT(NCID,VARIDF(I),"_FillValue", FILLVALUE) IF ( IRET/=NF90_NOERR ) THEN - WRITE(NDSE,1027) TRIM(FIELDSNAME(I)) + WRITE(NDSE,1026) TRIM(FIELDSNAME(I)) CALL EXTCDE ( 27 ) END IF END DO @@ -2317,6 +2335,7 @@ PROGRAM W3PRNC 2930 FORMAT ( ' Field corrected for energy conservation.') 1931 FORMAT ( ' Start time : ',A) 2931 FORMAT ( ' Stop time : ',A) +2932 FORMAT ( ' Calendar : ',A) 3931 FORMAT ( ' Shifted time : ',A) 932 FORMAT (/' Input grid dim. :',I9,3X,I5) 1933 FORMAT ( ' Longitude range :',2F8.2,' (deg)'/ & @@ -2404,15 +2423,23 @@ PROGRAM W3PRNC 1011 FORMAT (/' *** WAVEWATCH III ERROR IN W3PRNC : '/ & ' NO GRID SELECTED'/) ! -1027 FORMAT (/' *** WAVEWATCH III ERROR IN W3PRNC : '/ & +1026 FORMAT (/' *** WAVEWATCH III ERROR IN W3PRNC : '/ & ' _FillValue ATTRIBUTE NOT DEFINED FOR : ',A/) - ! + ! +1027 FORMAT (/' *** WAVEWATCH III ERROR IN W3PRNC : '/ & + ' INCOMPATIBLE CALENDARS:' / & + ' MODEL CALENDAR : ', A / & + ' INPUT FILE CALENDAR : ', A /) 1028 FORMAT (/' *** WAVEWATCH III WARNING IN W3PRNC : '/ & ' calendar ATTRIBUTE NOT DEFINED'/ & - ' IT MUST RESPECT STANDARD OR GREGORIAN CALENDAR') -1029 FORMAT (/' *** WAVEWATCH III WARNING IN W3PRNC : '/ & - ' CALENDAR ATTRIBUTE NOT MATCH'/ & - ' IT MUST RESPECT STANDARD OR GREGORIAN CALENDAR') + ' DEFAULTING TO "standard" CALENDAR'/ & + ' INPUT FILE MUST RESPECT STANDARD/GREGORIAN CALENDAR') +1029 FORMAT (/' *** WAVEWATCH III ERROR IN W3PRNC : '/ & + ' UNKNOWN CALENDAR TYPE: ', A / & + ' "calendar" ATTRIBUTE MUST BE ONE OF: '/ & + ' - standard'/ & + ' - gregorian'/ & + ' - 360_day'/ ) 1030 FORMAT (/' *** WAVEWATCH III ERROR IN W3PRNC : '/ & ' ILLEGAL FIELD ID -->',A,'<--'/) 1031 FORMAT (/' *** WAVEWATCH III ERROR IN W3PRNC : '/ & From f66b6d46ad8204a74ad4112ef39d5a230525f8c8 Mon Sep 17 00:00:00 2001 From: Matthew Masarik <86749872+MatthewMasarik-NOAA@users.noreply.github.com> Date: Wed, 13 Mar 2024 17:10:44 -0400 Subject: [PATCH 19/30] Fix compiler build 'remark's (#1201) --- model/src/w3arrymd.F90 | 6 +++--- model/src/w3gridmd.F90 | 2 +- model/src/w3tidemd.F90 | 4 ++-- model/src/ww3_outf.F90 | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/model/src/w3arrymd.F90 b/model/src/w3arrymd.F90 index 600e6f014..845d6ccae 100644 --- a/model/src/w3arrymd.F90 +++ b/model/src/w3arrymd.F90 @@ -2250,10 +2250,10 @@ SUBROUTINE PRT2DS (NDS, NFR0, NFR, NTH, E, FR, UFR, FACSP, FSC, & ! 900 FORMAT (/' Location : ',A/ & ' Spectrum : ',A,' (Normalized) ', & - ' Maximum value : ',E8.3,1X,A/) + ' Maximum value : ',E10.3,1X,A/) 901 FORMAT (/' Location : ',A/ & - ' Spectrum : ',A,' Units : ',E8.3,1X,A, & - ' Maximum value : ',E8.3,1X,A/) + ' Spectrum : ',A,' Units : ',E10.3,1X,A, & + ' Maximum value : ',E10.3,1X,A/) ! 910 FORMAT (5X,' ang.| frequencies (Hz) '/ & 5X,' deg.|',F6.3,15F8.3) diff --git a/model/src/w3gridmd.F90 b/model/src/w3gridmd.F90 index e81c4ea91..fe60c1e35 100644 --- a/model/src/w3gridmd.F90 +++ b/model/src/w3gridmd.F90 @@ -6439,7 +6439,7 @@ SUBROUTINE W3GRID() ' SDSBRF1 = ',F5.2,', SDSBRFDF =',I2,', '/ & ' SDSBM0 = ',F5.2, ', SDSBM1 =',F5.2, & ', SDSBM2 =',F5.2,', SDSBM3 =',F5.2,', SDSBM4 =', & - F5.2,', '/, & + F7.2,', '/, & ' SPMSS = ',F5.2, ', SDKOF =',F5.2, & ', SDSMWD =',F5.2,', SDSFACMTF =',F5.1,', '/ & ' SDSMWPOW =',F3.1,', SDSNMTF =', F5.2, & diff --git a/model/src/w3tidemd.F90 b/model/src/w3tidemd.F90 index 4f58afd4b..00b7b047d 100644 --- a/model/src/w3tidemd.F90 +++ b/model/src/w3tidemd.F90 @@ -823,11 +823,11 @@ SUBROUTINE TIDE_READ_ANAPAR(KR1,LP,filename,KD1,KD2,XLON,XLAT,NDEF,ITREND,ITZ) ! read in inference information now as it will be used in the lsq matrix ! DO K=1,10 - READ(KR1,'(4X,A5,E16.10,i5)')TIDE_KONAN(K),TIDE_SIGAN(K),TIDE_NINF(k) + READ(KR1,'(4X,A5,E17.10,i5)')TIDE_KONAN(K),TIDE_SIGAN(K),TIDE_NINF(k) ! write(6,1010)TIDE_KONAN(K),TIDE_SIGAN(K),TIDE_NINF(k) IF (TIDE_KONAN(K).EQ.KBLANK) EXIT do k2=1,TIDE_NINF(k) - read(kr1,'(4X,A5,E16.10,2F10.3)') TIDE_KONIN(K,k2),TIDE_SIGIN(K,k2),TIDE_R(K,k2),TIDE_ZETA(K,k2) + read(kr1,'(4X,A5,E17.10,2F10.3)') TIDE_KONIN(K,k2),TIDE_SIGIN(K,k2),TIDE_R(K,k2),TIDE_ZETA(K,k2) END DO END DO TIDE_NIN=K-1 diff --git a/model/src/ww3_outf.F90 b/model/src/ww3_outf.F90 index 96f2751c8..e955f00ad 100644 --- a/model/src/ww3_outf.F90 +++ b/model/src/ww3_outf.F90 @@ -2433,7 +2433,7 @@ SUBROUTINE W3EXGO ( NX, NY, NSEA ) OPEN (NDSDAT,FILE=FNMPRE(:JJ)//FNAME,ERR=800, & IOSTAT=IERR) IF (FSC.LT.1E-4) THEN - WRITE(FSCS,'(G7.1)') FSC + WRITE(FSCS,'(G8.1)') FSC ELSE WRITE(FSCS,'(F7.4)') FSC END IF From 399df7843b3fdba1f766a2eb9142e4b77a2c30f9 Mon Sep 17 00:00:00 2001 From: Jessica Meixner Date: Tue, 2 Apr 2024 12:37:55 -0400 Subject: [PATCH 20/30] For NCEP regtests, add option for gnu compiler and new machine Hercules (#1145) --- model/src/wminitmd.F90 | 6 ++ regtests/bin/matrix_cmake_ncep | 108 +++++++++++++++++++++++++-------- 2 files changed, 88 insertions(+), 26 deletions(-) diff --git a/model/src/wminitmd.F90 b/model/src/wminitmd.F90 index 956490b5e..768b6d91e 100644 --- a/model/src/wminitmd.F90 +++ b/model/src/wminitmd.F90 @@ -1273,6 +1273,12 @@ SUBROUTINE WMINIT ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & IF (WORDS(6) .EQ. 'T') THEN CALL NEXTLN ( COMSTR , MDSI , MDSE2 ) READ (MDSI,*,END=2001,ERR=2002)(ODAT(I,1),I=5*(8-1)+1,5*8) + ELSE + ODAT(5*(8-1)+1,1)=0 + ODAT(5*(8-1)+2,1)=0 + ODAT(5*(8-1)+3,1)=0 + ODAT(5*(8-1)+4,1)=0 + ODAT(5*8,1)=0 END IF ELSE READ (MDSI,*,END=2001,ERR=2002)(ODAT(I,1),I=5*(J-1)+1,5*J) diff --git a/regtests/bin/matrix_cmake_ncep b/regtests/bin/matrix_cmake_ncep index 7d0d26bec..2eafd8986 100755 --- a/regtests/bin/matrix_cmake_ncep +++ b/regtests/bin/matrix_cmake_ncep @@ -22,28 +22,37 @@ usage () { cat 2>&1 << EOF - Usage: $myname model_dir + Usage: $myname model_dir compiler Required: model_dir : path to model dir of WW3 source + Optional: + compiler : intel (default) or gnu EOF } - # Get required arguments if [ ! $# = 0 ] then main_dir="$1" ; shift + if [ ! $# = 0 ] + then + compiler="$1"; shift + else + compiler='intel' + fi else usage exit 1 fi + + # Convert main_dir to absolute path main_dir="`cd $main_dir 1>/dev/null 2>&1 && pwd`" # Module Versions from spack-stack that are common for all platforms modnetcdfc='netcdf-c/4.9.2' - modnetcdff='netcdf-fortran/4.6.0' + modnetcdff='netcdf-fortran/4.6.1' modjasper='jasper/2.0.32' modzlib='zlib/1.2.13' modpng='libpng/1.6.37' @@ -51,30 +60,71 @@ EOF modbacio='bacio/2.4.1' modg2='g2/3.4.5' modw3emc='w3emc/2.10.0' - modesmf='esmf/8.4.2' + modesmf='esmf/8.5.0' 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) ishera=`hostname | grep hfe` isorion=`hostname | grep Orion` + ishercules=`hostname | grep hercules` if [ $ishera ] then - # If no other h, assuming Hera batchq='slurm' - 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' + if [ $compiler = "intel" ] + then + spackstackpath='/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.6.0/envs/unified-env-rocky8/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/hera/intel/spack-stack/1.6.0/parmetis-4.0.3/install' + modcmake='cmake/3.23.1' + elif [ $compiler = "gnu" ] + then + spackstackpath='/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.6.0/envs/unified-env-rocky8/install/modulefiles/Core' + modcomp='stack-gcc/9.2.0' + modmpi='stack-openmpi/4.1.5' + metispath='/scratch1/NCEPDEV/climate/Matthew.Masarik/waves/opt/hera/gnu/spack-stack/1.6.0/parmetis-4.0.3/install' + modcmake='cmake/3.23.1' + else + echo "Compiler $compiler not supported on hera" + exit 1 + fi elif [ $isorion ] then + if [ $compiler = "intel" ] + then + batchq='slurm' + spackstackpath='/work/noaa/epic/role-epic/spack-stack/orion/spack-stack-1.6.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/orion/intel/spack-stack/1.6.0/parmetis-4.0.3/install' + modcmake='cmake/3.23.1' + else + echo "Compiler $compiler not supported on orion" + exit 1 + fi + elif [ $ishercules ] + then batchq='slurm' - 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' + if [ $compiler = "intel" ] + then + spackstackpath='/work/noaa/epic/role-epic/spack-stack/hercules/spack-stack-1.6.0/envs/unified-env/install/modulefiles/Core' + modcomp='stack-intel/2021.9.0' + modmpi='stack-intel-oneapi-mpi/2021.9.0' + metispath='/work/noaa/marine/Matthew.Masarik/waves/opt/hercules/intel/spack-stack/1.6.0/parmetis-4.0.3/install' + modcmake='cmake/3.23.1' + elif [ $compiler = "gnu" ] + then + spackstackpath='/work/noaa/epic/role-epic/spack-stack/hercules/spack-stack-1.6.0/envs/unified-env/install/modulefiles/Core' + spackstackpath2='/work/noaa/epic/role-epic/spack-stack/hercules/modulefiles' + modcomp='stack-gcc/12.2.0' + modmpi='stack-mvapich2/2.3.7' + metispath='/work/noaa/marine/Matthew.Masarik/waves/opt/hercules/gnu/spack-stack/1.6.0/parmetis-4.0.3/install' + modcmake='cmake/3.23.1' + else + echo "Compiler $compiler not supported on hercules" + exit 1 + fi else batchq= fi @@ -105,10 +155,19 @@ EOF echo '#SBATCH --exclusive' >> matrix.head echo ' ' >> matrix.head echo 'ulimit -s unlimited' >> matrix.head - echo 'ulimit -c 0' >> matrix.head - echo 'export KMP_STACKSIZE=2G' >> matrix.head - echo 'export FI_OFI_RXM_BUFFER_SIZE=128000' >> matrix.head - echo 'export FI_OFI_RXM_RX_SIZE=64000' >> matrix.head + elif [ $batchq = "slurm" ] && [ $ishercules ] + then + echo "#SBATCH -n ${np}" >> matrix.head + echo "##SBATCH --cpus-per-task=${nth}" >> matrix.head + echo '#SBATCH -q batch' >> matrix.head + echo '#SBATCH -t 08:00:00' >> matrix.head + echo '#SBATCH -A marine-cpu' >> matrix.head + echo '#SBATCH -J ww3_regtest' >> matrix.head + echo '#SBATCH -o matrix.out' >> matrix.head + echo '#SBATCH -p hercules' >> matrix.head + echo '#SBATCH --exclusive' >> matrix.head + echo ' ' >> matrix.head + echo 'ulimit -s unlimited' >> matrix.head elif [ $batchq = "slurm" ] then echo "#SBATCH -n ${np}" >> matrix.head @@ -133,13 +192,10 @@ EOF # Netcdf, Parmetis and SCOTCH modules & variables echo " module purge" >> 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 $spackstackpath" >> matrix.head + echo " module use $spackstackpath" >> matrix.head + if [ ! -z $spackstackpath2 ]; then + echo " module use $spackstackpath2" >> matrix.head + fi echo " module load $modcomp" >> matrix.head echo " module load $modmpi" >> matrix.head echo " module load $modcmake" >> matrix.head From d8b82c96806590d14b7a70872cbee3d83b974d66 Mon Sep 17 00:00:00 2001 From: Jessica Meixner Date: Tue, 2 Apr 2024 13:47:39 -0400 Subject: [PATCH 21/30] Fix compiler remarks for ST6 and GMD (#1206) --- model/src/w3gridmd.F90 | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/model/src/w3gridmd.F90 b/model/src/w3gridmd.F90 index fe60c1e35..dad11eddc 100644 --- a/model/src/w3gridmd.F90 +++ b/model/src/w3gridmd.F90 @@ -6330,14 +6330,14 @@ SUBROUTINE W3GRID() 2923 FORMAT ( ' ',2F8.3,F6.1,2E12.4) 2922 FORMAT ( ' &SNL3 NQDEF =',I3,', MSC =',F6.2,', NSC =', & F6.2,', KDFD =',F6.2,', KDFS =',F6.2,' /') -3923 FORMAT ( ' &ANL3 QPARMS = ',2(F5.3,', '),F5.1,', ',E10.4, & - ', ',E10.4,' /') -4923 FORMAT ( ' &ANL3 QPARMS = ',2(F5.3,', '),F5.1,', ',E10.4, & - ', ',E10.4,' ,') -5923 FORMAT ( ' ',2(F5.3,', '),F5.1,', ',E10.4, & - ', ',E10.4,' ,') -6923 FORMAT ( ' ',2(F5.3,', '),F5.1,', ',E10.4, & - ', ',E10.4,' /') +3923 FORMAT ( ' &ANL3 QPARMS = ',2(F5.3,', '),F5.1,', ',E11.4, & + ', ',E11.4,' /') +4923 FORMAT ( ' &ANL3 QPARMS = ',2(F5.3,', '),F5.1,', ',E11.4, & + ', ',E11.4,' ,') +5923 FORMAT ( ' ',2(F5.3,', '),F5.1,', ',E11.4, & + ', ',E11.4,' ,') +6923 FORMAT ( ' ',2(F5.3,', '),F5.1,', ',E11.4, & + ', ',E11.4,' /') #endif ! #ifdef W3_NL4 @@ -6453,18 +6453,18 @@ SUBROUTINE W3GRID() 925 FORMAT ( ' normalise by threshold spectral density : ',A/& ' normalise by spectral density : ',A/& ' coefficient and exponent for '/ & - ' inherent breaking term a1, L as in (21) : ',E9.3,I3/ & - ' cumulative breaking term a2, M as in (22) : ',E9.3,I3/ & + ' inherent breaking term a1, L as in (21) : ',E10.3,I3/ & + ' cumulative breaking term a2, M as in (22) : ',E10.3,I3/ & ' ') -2924 FORMAT ( ' &SDS6 SDSET = ',L,', SDSA1 = ',E9.3, & - ', SDSA2 = ',E9.3,', SDSP1 = ',I2,', SDSP1 = ', & +2924 FORMAT ( ' &SDS6 SDSET = ',L,', SDSA1 = ',E10.3, & + ', SDSA2 = ',E10.3,', SDSP1 = ',I2,', SDSP1 = ', & I2,' /' ) 937 FORMAT (/' Swell dissipation ',A/ & ' --------------------------------------------------') 940 FORMAT ( ' subroutine W3SWL6 activated : ',A/ & - ' coefficient b1 ',A, ' : ',E9.3/ ) -2937 FORMAT ( ' &SWL6 SWLB1 = ',E9.3,', CSTB1 = ',L,' /') + ' coefficient b1 ',A, ' : ',E10.3/ ) +2937 FORMAT ( ' &SWL6 SWLB1 = ',E10.3,', CSTB1 = ',L,' /') #endif ! #ifdef W3_BT0 @@ -6549,7 +6549,7 @@ SUBROUTINE W3GRID() 946 FORMAT (' Isotropic (linear function of ice concentration)'/& ' slope : ',E10.3/ & ' offset : ',E10.3) -2946 FORMAT ( ' &SIS1 ISC1 =',E9.3,', ISC2 =',E9.3) +2946 FORMAT ( ' &SIS1 ISC1 =',E10.3,', ISC2 =',E10.3) #endif #ifdef W3_IS2 947 FORMAT (/' Ice scattering ',A,/ & From 8b5e91f0887ab2b8c218228fff6cb82297a613b3 Mon Sep 17 00:00:00 2001 From: Mickael Accensi <49198861+mickaelaccensi@users.noreply.github.com> Date: Thu, 4 Apr 2024 21:34:11 +0200 Subject: [PATCH 22/30] add output parameters for skewness (#1209) Co-authored-by: Fabrice Ardhuin --- manual/eqs/output.tex | 4 + manual/manual.bib | 10 + model/inp/ww3_ounf.inp | 2 +- model/inp/ww3_shel.inp | 11 +- model/nml/ww3_ounf.nml | 2 +- model/nml/ww3_shel.nml | 3 + model/src/w3adatmd.F90 | 42 +- model/src/w3initmd.F90 | 86 ++++- model/src/w3iogomd.F90 | 556 ++++++++++++++++++++++++++- model/src/w3odatmd.F90 | 5 +- model/src/w3ounfmetamd.F90 | 39 ++ model/src/ww3_ounf.F90 | 15 +- model/src/ww3_outf.F90 | 34 ++ model/tools/bash/ww3_ounf_inp2nml.sh | 2 +- model/tools/bash/ww3_shel_inp2nml.sh | 3 + regtests/ww3_ts1/input/ww3_ounf.inp | 2 +- regtests/ww3_ts1/input/ww3_ounf.nml | 2 +- regtests/ww3_ts1/input/ww3_shel.inp | 2 +- regtests/ww3_ts1/input/ww3_shel.nml | 2 +- 19 files changed, 800 insertions(+), 22 deletions(-) diff --git a/manual/eqs/output.tex b/manual/eqs/output.tex index bfa7e0b5a..8deb484e1 100644 --- a/manual/eqs/output.tex +++ b/manual/eqs/output.tex @@ -310,6 +310,10 @@ \subsection{~Output parameters} \label{sub:outpars} \begin{equation} Q_{kk} = \frac{1}{E^2} \int_0^{f_{NK}} \int_0^{2\pi} 0.5 \left[ A(k,\theta)+ A(k,\theta+\pi)\right]^2 \frac{\sigma^2}{k C_g} \:\rd \theta \: \rd \sigma \: \label{eq:qkk} \end{equation} +\item \textbf{SKW} Skewness of surface elevation sampled at zero slope. This is the $\lambda_1$ parameter defined in \cite{Barrick&Lipa1985} or $\lambda_{3,0,0}$ in \cite{Srokosz1986}. It is computed from the second order correction to the surface elevation, using ECWAM code by P. Janssen. +\item \textbf{EMB} this is $-\gamma/8 = -(\lambda_{1,2,0}+\lambda_{1,0,2}-2 \lambda{0,1,1} \lambda{1,1,1})/8 (1-\lambda_{0,1,1]^2)$, such that the mean sea level of points with zero slope +is EMB$\times H_s$. +\item \textbf{EMC} this is hte additional tracker bias coefficient equal to $-\lambda_{3,0,0}/24$, which is specific to the choice of retracker, see the $J_z$ function in \cite{DeCarlo&Ardhuin2024}. \end{list} \item{Numerical diagnostics } diff --git a/manual/manual.bib b/manual/manual.bib index 3da650ea2..33e0a9fdd 100644 --- a/manual/manual.bib +++ b/manual/manual.bib @@ -3760,3 +3760,13 @@ @PHDTHESIS{Gagnaire-Renou2009 year = 2010, } +@ARTICLE{Srokosz1986, + author = "Meric A. Srokosz", + title = "On the joint distribution of surface elevation and slopes for a non linear random sea, with an application to radar altimetry", + journal = JGR, + volume = 91, + pages = "995--1006", + year = 1986, + keywords={altimeter;sea state bias}, +} + diff --git a/model/inp/ww3_ounf.inp b/model/inp/ww3_ounf.inp index 7bde30754..b0c29ff75 100644 --- a/model/inp/ww3_ounf.inp +++ b/model/inp/ww3_ounf.inp @@ -16,7 +16,7 @@ $ DPT CUR WND AST WLV ICE IBG TAU RHO D50 IC1 IC5 HS LM T02 T0M1 T01 FP $ DIR SPR DP HIG 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 SXY TWO BHD FOC TUS USS P2S USF P2L TWI FIC ABR UBR BED -$ FBB TBB MSS MSC DTD FC CFX CFD CFK U1 U2 WNM TOC +$ FBB TBB MSS MSC DTD FC CFX CFD CFK U1 U2 WNM TOC MSS QP QKK SKW EMB EMC $ N DPT HS FP T01 diff --git a/model/inp/ww3_shel.inp b/model/inp/ww3_shel.inp index 7980cbe06..576e01c5f 100644 --- a/model/inp/ww3_shel.inp +++ b/model/inp/ww3_shel.inp @@ -212,10 +212,13 @@ $ 8 Spectrum parameters $ ------------------------------------------------- $ F F 8 1 MSS[X,Y] MSS Mean square slopes $ F F 8 2 MSC[X,Y] MSC Spectral level at high frequency tail -! F F 8 3 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 +$ 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 +$ F F 8 7 SKEW SKW Skewness of elevation for zero slopes +$ F F 8 8 EMBIA1 EMB Mean sea level at zero slopes / Hs +$ F F 8 9 EMBIA2 EMC Tracker bias for LRM least square altimetry $ ------------------------------------------------- $ 9 Numerical diagnostics $ ------------------------------------------------- diff --git a/model/nml/ww3_ounf.nml b/model/nml/ww3_ounf.nml index 9b1ffe136..a70cf9eae 100644 --- a/model/nml/ww3_ounf.nml +++ b/model/nml/ww3_ounf.nml @@ -14,7 +14,7 @@ ! UST CHA CGE FAW TAW TWA WCC WCF WCH WCM FWS ! SXY TWO BHD FOC TUS USS P2S USF P2L TWI FIC TOC ! ABR UBR BED FBB TBB -! MSS MSC WL02 AXT AYT AXY +! MSS MSC MSD MCD QP QKK SKW EMB EMC ! DTD FC CFX CFD CFK ! U1 U2 ! diff --git a/model/nml/ww3_shel.nml b/model/nml/ww3_shel.nml index 97beaf6a0..b6ae8cfef 100644 --- a/model/nml/ww3_shel.nml +++ b/model/nml/ww3_shel.nml @@ -206,6 +206,9 @@ ! 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 +! F F 8 7 SKEW SKW Skewness of elevation for zero slopes +! F F 8 8 EMBIA1 EMB Mean sea level at zero slopes / Hs +! F F 8 9 EMBIA2 EMC Tracker bias for LRM least square altimetry ! ------------------------------------------------- ! 9 Numerical diagnostics ! ------------------------------------------------- diff --git a/model/src/w3adatmd.F90 b/model/src/w3adatmd.F90 index 1ee07eca4..2daee3609 100644 --- a/model/src/w3adatmd.F90 +++ b/model/src/w3adatmd.F90 @@ -188,6 +188,7 @@ MODULE W3ADATMD ! 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) + ! SKEW R.A. Public skewness lambda_3,0,0 (Srokosz 1986) ! ! DTDYN R.A. Public Mean dynamic time step (raw). ! FCUT R.A. Public Cut-off frequency for tail. @@ -475,9 +476,10 @@ MODULE W3ADATMD ! Output fields group 8) ! REAL, POINTER :: MSSX(:), MSSY(:), MSSD(:), & - MSCX(:), MSCY(:), MSCD(:), QKK(:) + MSCX(:), MSCY(:), MSCD(:), QKK(:), SKEW(:), EMBIA1(:), EMBIA2(:) REAL, POINTER :: XMSSX(:), XMSSY(:), XMSSD(:), & - XMSCX(:), XMSCY(:), XMSCD(:), XQKK(:) + XMSCX(:), XMSCY(:), XMSCD(:), XQKK(:), & + XSKEW(:), XEMBIA1(:), XEMBIA2(:) ! ! Output fields group 9) ! @@ -613,7 +615,7 @@ MODULE W3ADATMD BEDFORMS(:,:), PHIBBL(:), TAUBBL(:,:) ! REAL, POINTER :: MSSX(:), MSSY(:), MSSD(:), & - MSCX(:), MSCY(:), MSCD(:), QKK(:) + MSCX(:), MSCY(:), MSCD(:), QKK(:), SKEW(:), EMBIA1(:), EMBIA2(:) ! REAL, POINTER :: DTDYN(:), FCUT(:), CFLXYMAX(:), & CFLTHMAX(:), CFLKMAX(:) @@ -1265,7 +1267,9 @@ 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), & - WADATS(IMOD)%QKK(NSEALM), STAT=ISTAT ) + WADATS(IMOD)%QKK(NSEALM), WADATS(IMOD)%SKEW(NSEALM), & + WADATS(IMOD)%EMBIA1(NSEALM), WADATS(IMOD)%EMBIA2(NSEALM), & + STAT=ISTAT ) CHECK_ALLOC_STATUS ( ISTAT ) ! WADATS(IMOD)%MSSX = UNDEF @@ -1275,6 +1279,9 @@ SUBROUTINE W3DIMA ( IMOD, NDSE, NDST, D_ONLY ) WADATS(IMOD)%MSCY = UNDEF WADATS(IMOD)%MSCD = UNDEF WADATS(IMOD)%QKK = UNDEF + WADATS(IMOD)%SKEW = UNDEF + WADATS(IMOD)%EMBIA1 = UNDEF + WADATS(IMOD)%EMBIA2 = UNDEF call print_memcheck(memunit, 'memcheck_____:'//' W3DIMA 8') ! ! 9) Numerical diagnostics @@ -2281,6 +2288,24 @@ SUBROUTINE W3XDMA ( IMOD, NDSE, NDST, OUTFLAGS ) ALLOCATE ( WADATS(IMOD)%XQKK(1) ) END IF ! + IF ( OUTFLAGS( 8, 7) ) THEN + ALLOCATE ( WADATS(IMOD)%XSKEW(NXXX) ) + ELSE + ALLOCATE ( WADATS(IMOD)%XSKEW(1) ) + END IF + ! + IF ( OUTFLAGS( 8, 8) ) THEN + ALLOCATE ( WADATS(IMOD)%XEMBIA1(NXXX) ) + ELSE + ALLOCATE ( WADATS(IMOD)%XEMBIA1(1) ) + END IF + ! + IF ( OUTFLAGS( 8, 9) ) THEN + ALLOCATE ( WADATS(IMOD)%XEMBIA2(NXXX) ) + ELSE + ALLOCATE ( WADATS(IMOD)%XEMBIA2(1) ) + END IF + ! WADATS(IMOD)%XMSSX = UNDEF WADATS(IMOD)%XMSSY = UNDEF WADATS(IMOD)%XMSSD = UNDEF @@ -2289,6 +2314,9 @@ SUBROUTINE W3XDMA ( IMOD, NDSE, NDST, OUTFLAGS ) WADATS(IMOD)%XMSCD = UNDEF WADATS(IMOD)%XQP(1) = UNDEF WADATS(IMOD)%XQKK = UNDEF + WADATS(IMOD)%XSKEW = UNDEF + WADATS(IMOD)%XEMBIA1 = UNDEF + WADATS(IMOD)%XEMBIA2 = UNDEF ! IF ( OUTFLAGS( 9, 1) ) THEN ALLOCATE ( WADATS(IMOD)%XDTDYN(NXXX), STAT=ISTAT ) @@ -2903,6 +2931,9 @@ SUBROUTINE W3SETA ( IMOD, NDSE, NDST ) MSCY => WADATS(IMOD)%MSCY MSCD => WADATS(IMOD)%MSCD QKK => WADATS(IMOD)%QKK + SKEW => WADATS(IMOD)%SKEW + EMBIA1 => WADATS(IMOD)%EMBIA1 + EMBIA2 => WADATS(IMOD)%EMBIA2 ! DTDYN => WADATS(IMOD)%DTDYN FCUT => WADATS(IMOD)%FCUT @@ -3242,6 +3273,9 @@ SUBROUTINE W3XETA ( IMOD, NDSE, NDST ) MSCY => WADATS(IMOD)%XMSCY MSCD => WADATS(IMOD)%XMSCD QKK => WADATS(IMOD)%XQKK + SKEW => WADATS(IMOD)%XSKEW + EMBIA1 => WADATS(IMOD)%XEMBIA1 + EMBIA2 => WADATS(IMOD)%XEMBIA2 ! DTDYN => WADATS(IMOD)%XDTDYN FCUT => WADATS(IMOD)%XFCUT diff --git a/model/src/w3initmd.F90 b/model/src/w3initmd.F90 index 93218d473..044a18760 100644 --- a/model/src/w3initmd.F90 +++ b/model/src/w3initmd.F90 @@ -2150,7 +2150,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, QKK + TAUOCX, TAUOCY, WNMEAN, QKK, SKEW, EMBIA1, EMBIA2 #endif #ifdef W3_MPI @@ -3406,6 +3406,48 @@ SUBROUTINE W3MPIO ( IMOD ) #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( 8, 7) ) THEN + IH = IH + 1 + IT = IT + 1 + CALL MPI_SEND_INIT (SKEW (1),NSEALM , MPI_REAL, IROOT, & + IT, MPI_COMM_WAVE, IRQGO(IH), IERR) +#endif +#ifdef W3_MPIT + WRITE (NDST,9011) IH, ' 8/07', IROOT, IT, IRQGO(IH), IERR +#endif +#ifdef W3_MPI + END IF +#endif + ! +#ifdef W3_MPI + IF ( FLGRDALL( 8, 8) ) THEN + IH = IH + 1 + IT = IT + 1 + CALL MPI_SEND_INIT (EMBIA1 (1),NSEALM , MPI_REAL, IROOT, & + IT, MPI_COMM_WAVE, IRQGO(IH), IERR) +#endif +#ifdef W3_MPIT + WRITE (NDST,9011) IH, ' 8/08', IROOT, IT, IRQGO(IH), IERR +#endif +#ifdef W3_MPI + END IF +#endif + ! +#ifdef W3_MPI + IF ( FLGRDALL( 8, 9) ) THEN + IH = IH + 1 + IT = IT + 1 + CALL MPI_SEND_INIT (EMBIA2 (1),NSEALM , MPI_REAL, IROOT, & + IT, MPI_COMM_WAVE, IRQGO(IH), IERR) +#endif +#ifdef W3_MPIT + WRITE (NDST,9011) IH, ' 8/09', IROOT, IT, IRQGO(IH), IERR +#endif #ifdef W3_MPI END IF #endif @@ -4653,6 +4695,48 @@ SUBROUTINE W3MPIO ( IMOD ) #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( 8, 7) ) THEN + IH = IH + 1 + IT = IT + 1 + CALL MPI_RECV_INIT (SKEW (I0),1,WW3_FIELD_VEC, IFROM, IT, & + MPI_COMM_WAVE, IRQGO2(IH), IERR ) +#endif +#ifdef W3_MPIT + WRITE (NDST,9011) IH, ' 8/07', IFROM, IT, IRQGO2(IH), IERR +#endif +#ifdef W3_MPI + END IF +#endif + ! +#ifdef W3_MPI + IF ( FLGRDALL( 8, 8) ) THEN + IH = IH + 1 + IT = IT + 1 + CALL MPI_RECV_INIT (EMBIA1 (I0),1,WW3_FIELD_VEC, IFROM, IT, & + MPI_COMM_WAVE, IRQGO2(IH), IERR ) +#endif +#ifdef W3_MPIT + WRITE (NDST,9011) IH, ' 8/08', IFROM, IT, IRQGO2(IH), IERR +#endif +#ifdef W3_MPI + END IF +#endif + ! +#ifdef W3_MPI + IF ( FLGRDALL( 8, 9) ) THEN + IH = IH + 1 + IT = IT + 1 + CALL MPI_RECV_INIT (EMBIA2 (I0),1,WW3_FIELD_VEC, IFROM, IT, & + MPI_COMM_WAVE, IRQGO2(IH), IERR ) +#endif +#ifdef W3_MPIT + WRITE (NDST,9011) IH, ' 8/09', IFROM, IT, IRQGO2(IH), IERR +#endif #ifdef W3_MPI END IF #endif diff --git a/model/src/w3iogomd.F90 b/model/src/w3iogomd.F90 index 2ddfa77e0..de660ded4 100644 --- a/model/src/w3iogomd.F90 +++ b/model/src/w3iogomd.F90 @@ -18,7 +18,7 @@ MODULE W3IOGOMD !/ | WAVEWATCH III NOAA/NCEP | !/ | H. L. Tolman | !/ | FORTRAN 90 | - !/ | Last update : 22-Mar-2021 | + !/ | Last update : 02-Mar-2024 | !/ +-----------------------------------+ !/ !/ 04-Jan-2001 : Origination. ( version 2.00 ) @@ -74,8 +74,9 @@ MODULE W3IOGOMD !/ 22-Mar-2021 : Add extra coupling fields as output ( version 7.13 ) !/ 21-Jul-2022 : Correct FP0 calc for peak energy in ( version 7.14 ) !/ min/max freq band (B. Pouliot, CMC) + !/ 02-Mar-2024 : Add skweness and EM bias varaible ( version 7.xx ) !/ - !/ Copyright 2009-2014 National Weather Service (NWS), + !/ Copyright 2009-2024 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. @@ -1126,6 +1127,15 @@ SUBROUTINE W3FLDTOIJ(FLD, I, J, IAPROC, NAPOUT, NDSEN) CASE('QKK') I = 8 J = 6 + CASE('SKW') + I = 8 + J = 7 + CASE('EMB') + I = 8 + J = 8 + CASE('EMC') + I = 8 + J = 9 ! ! Group 9 ! @@ -2340,6 +2350,11 @@ SUBROUTINE W3OUTG ( A, FLPART, FLOUTG, FLOUTG2 ) IF (FLOLOC( 6, 12)) THEN CALL CALC_U3STOKES(A,2) ENDIF + ! + IF (FLOLOC( 8, 7).OR.FLOLOC( 8, 8).OR.FLOLOC( 8, 9)) THEN + CALL SKEWNESS(A) + END IF + ! ! Dominant wave breaking probability ! @@ -2417,6 +2432,7 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD & !/ processing code) !/ 25-Aug-2018 : Add WBT parameter ( version 6.06 ) !/ 22-Mar-2021 : Add extra coupling fields as output ( version 7.13 ) + !/ 07-Mar-2024 : Add Skewness parameters ( version 7.13 ) !/ ! 1. Purpose : ! @@ -2513,7 +2529,7 @@ 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, QKK + USSP, TAUOCX, TAUOCY, QKK, SKEW, EMBIA1, EMBIA2 !/ USE W3ODATMD, ONLY: NOGRP, NGRPP, IDOUT, UNDEF, NDST, NDSE, & FLOGRD, IPASS => IPASS1, WRITE => WRITE1, & @@ -2923,6 +2939,9 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD & IF ( FLOGRD( 8, 4) ) MSCD (ISEA) = UNDEF IF ( FLOGRD( 8, 5) ) QP (ISEA) = UNDEF IF ( FLOGRD( 8, 6) ) QKK (ISEA) = UNDEF + IF ( FLOGRD( 8, 7) ) SKEW (ISEA) = UNDEF + IF ( FLOGRD( 8, 8) ) EMBIA1(ISEA) = UNDEF + IF ( FLOGRD( 8, 9) ) EMBIA2(ISEA) = UNDEF ! IF ( FLOGRD( 9, 1) ) DTDYN (ISEA) = UNDEF IF ( FLOGRD( 9, 2) ) FCUT (ISEA) = UNDEF @@ -3576,7 +3595,7 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD & #endif ! ! Section 8) - ! + !Skewness ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 1 ) THEN WRITE ( NDSOG ) MSSX(1:NSEA) #ifdef W3_ASCII @@ -3614,6 +3633,21 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD & WRITE ( NDSOG ) QKK(1:NSEA) #ifdef W3_ASCII WRITE ( NDSOA,* ) 'QKK:', QKK(1:NSEA) +#endif + ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 7 ) THEN + WRITE ( NDSOG ) SKEW(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'SKW:', SKEW(1:NSEA) +#endif + ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 8 ) THEN + WRITE ( NDSOG ) EMBIA1(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'EMB:', EMBIA1(1:NSEA) +#endif + ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 9 ) THEN + WRITE ( NDSOG ) EMBIA2(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'EMC:', EMBIA2(1:NSEA) #endif ! ! Section 9) @@ -3967,6 +4001,12 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD & 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) + ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 7 ) THEN + READ (NDSOG,END=801,ERR=802,IOSTAT=IERR) SKEW(1:NSEA) + ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 8 ) THEN + READ (NDSOG,END=801,ERR=802,IOSTAT=IERR) EMBIA1(1:NSEA) + ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 9 ) THEN + READ (NDSOG,END=801,ERR=802,IOSTAT=IERR) EMBIA2(1:NSEA) ! ! Section 9) ! @@ -4610,4 +4650,512 @@ SUBROUTINE CALC_WBT (A) !/ END SUBROUTINE CALC_WBT !/ ------------------------------------------------------------------- / + !/ + !> + !> @brief Computation of second order harmonics and + !> relevant tables for the altimeter corrections + !> + !> @param[in] NKHF Extended number of frequencies. + !> @param[out] FAC0 2nd order coef correction. + !> @param[out] FAC1 2nd order coef correction. + !> @param[out] FAC2 2nd order coef correction. + !> @param[out] FAC3 2nd order coef correction. + !> + !> @author P. Janssen @date 29-Mar-2024 + !> + SUBROUTINE SECONDHH(NKHF,FAC0,FAC1,FAC2,FAC3) +!---------------------------------------------------------------- + +!**** *SECONDHH* - COMPUTATION OF SECOND ORDER HARMONICS AND +! RELEVANT TABLES FOR THE ALTIMETER CORRECTIONS. + +! P.A.E.M. JANSSEN + +! PURPOSE. +! --------- + +! COMPUTE SECOND HARMONICS + +!** INTERFACE. +! ---------- + +! *CALL* *SECONDHH* + +! METHOD. +! ------- + +! SEE REFERENCE. + +! EXTERNALS. +! ---------- + +! VMIN_D +! VPLUS_D + +! REFERENCES. +! ----------- + +! V E ZAKHAROV(1967) + +!------------------------------------------------------------------- + +!------------------------------------------------------------------- +USE CONSTANTS, ONLY: GRAV, TPI +USE W3GDATMD, ONLY: NK, NTH, XFR, SIG, TH, DTH, ECOS, ESIN + IMPLICIT NONE + ! REAL(KIND=4) :: VMIN_D,VPLUS_D + + + + INTEGER, INTENT(IN) :: NKHF + REAL(KIND=4), DIMENSION(NTH,NTH,NKHF,NKHF), INTENT(OUT) :: FAC0, FAC1, FAC2, FAC3 + REAL(KIND=4), PARAMETER :: FRATIO = 1.1 + + + INTEGER :: M, K1, M1, K2, M2 + + REAL(KIND=4), PARAMETER :: DEL1=1.0E-8 + REAL(KIND=4), PARAMETER :: ZCONST = 0.0281349 + + !REAL(KIND=4) :: VMIN_D, VPLUS_D + REAL(KIND=4) :: CO1 + REAL(KIND=4) :: XK1, XK1SQ, XK2, XK2SQ, XK3 + REAL(KIND=4) :: COSDIFF + REAL(KIND=4) :: X12, X13, X32, OM1, OM2, OM3, F1, F2, F3 + REAL(KIND=4) :: VM, VP + REAL(KIND=4) :: DELOM1, DELOM2 + REAL(KIND=4) :: DELOM321, DELOM312 + REAL(KIND=4) :: C22, S22 + + REAL(KIND=4), DIMENSION(NTH,NTH,NKHF,NKHF) :: B + REAL(KIND=4), DIMENSION(:), ALLOCATABLE:: FAK, SIGHF, DFIMHF + + + + +!----------------------------------------------------------------------- + + + + +!* 1. INITIALISE RELEVANT QUANTITIES. + + ALLOCATE(FAK(NKHF)) + ALLOCATE(SIGHF(NKHF)) + ALLOCATE(DFIMHF(NKHF)) + + SIGHF(1) = SIG(1) + DO M=2,NKHF + SIGHF(M) = XFR*SIGHF(M-1) + ENDDO + + DO M=1,NKHF + FAK(M) = (SIGHF(M))**2/GRAV + ENDDO + + CO1 = 0.5*(XFR-1.)*DTH + DFIMHF(1) = CO1*SIGHF(1) + DO M=2,NKHF-1 + DFIMHF(M)=CO1*(SIGHF(M)+SIGHF(M-1)) + ENDDO + DFIMHF(NKHF)=CO1*SIGHF(NKHF-1) + + DO M2=1,NKHF + XK2 = FAK(M2) + XK2SQ = FAK(M2)**2 + DO M1=1,NKHF + XK1 = FAK(M1) + XK1SQ = FAK(M1)**2 + DO K1=1,NTH + DO K2=1,NTH + COSDIFF = COS(TH(K1)-TH(K2)) + X12 = XK1*XK2*COSDIFF + XK3 = XK1SQ + XK2SQ +2.0*X12 +DEL1 + XK3 = SQRT(XK3) + X13 = XK1SQ+X12 + X32 = X12+XK2SQ + OM1 = SQRT(GRAV*XK1) + OM2 = SQRT(GRAV*XK2) + OM3 = SQRT(GRAV*XK3) + F1 = SQRT(XK1/(2.0*OM1)) + F2 = SQRT(XK2/(2.0*OM2)) + F3 = SQRT(XK3/(2.0*OM3)) + VM = TPI*VMIN_D(XK3,XK1,XK2,X13,X32,X12,OM3,OM1,OM2) + VP = TPI*VPLUS_D(-XK3,XK1,XK2,-X13,-X32,X12,OM3,OM1,OM2) + DELOM1 = OM3-OM1-OM2+DEL1 + DELOM2 = OM3+OM1+OM2+DEL1 + FAC0(K1,K2,M1,M2) = -F3/(F1*F2)*(VM/(DELOM1)+ & + & VP/(DELOM2)) + ENDDO + ENDDO + ENDDO + ENDDO + + DO M2=1,NKHF + XK2 = FAK(M2) + XK2SQ = FAK(M2)**2 + DO M1=1,NKHF + XK1 = FAK(M1) + XK1SQ = FAK(M1)**2 + DO K1=1,NTH + DO K2=1,NTH + COSDIFF = COS(TH(K1)-TH(K2)) + X12 = XK1*XK2*COSDIFF + XK3 = XK1SQ + XK2SQ - 2.*X12 + DEL1 + XK3 = SQRT(XK3) + X13 = XK1SQ-X12 + X32 = X12-XK2SQ + OM1 = SQRT(GRAV*XK1) + OM2 = SQRT(GRAV*XK2) + OM3 = SQRT(GRAV*XK3)+DEL1 + F1 = SQRT(XK1/(2.0*OM1)) + F2 = SQRT(XK2/(2.0*OM2)) + F3 = SQRT(ABS(XK3)/(2.0*OM3)) + VM = TPI*VMIN_D(XK1,XK3,XK2,X13,X12,X32,OM1,OM3,OM2) + VP = TPI*VMIN_D(XK2,-XK3,XK1,-X32,X12,-X13,OM2,OM3,OM1) + DELOM321 = OM3+OM2-OM1+DEL1 + DELOM312 = OM3+OM1-OM2+DEL1 + B(K1,K2,M1,M2) = -F3/(F1*F2)*(VM/(DELOM321)+ & + & VP/(DELOM312)) + ENDDO + ENDDO + ENDDO + ENDDO + + DO M2=1,NKHF + XK2SQ = FAK(M2)**2 + DO M1=1,NKHF + XK1SQ = FAK(M1)**2 + DO K2=1,NTH + DO K1=1,NTH + C22 = FAC0(K1,K2,M1,M2)+B(K1,K2,M1,M2) + S22 = B(K1,K2,M1,M2)-FAC0(K1,K2,M1,M2) + FAC1(K1,K2,M1,M2) = & + & (XK1SQ*ECOS(K1)**2 + XK2SQ*ECOS(K2)**2)*C22 & + & -FAK(M1)*FAK(M2)*ECOS(K1)*ECOS(K2)*S22 + FAC2(K1,K2,M1,M2) = & + & (XK1SQ*ESIN(K1)**2 + XK2SQ*ESIN(K2)**2)*C22 & + & -FAK(M1)*FAK(M2)*ESIN(K1)*ESIN(K2)*S22 + FAC3(K1,K2,M1,M2) = & + & (XK1SQ*ESIN(K1)*ECOS(K1) + & + & XK2SQ*ESIN(K2)*ECOS(K2))*C22 & + & -FAK(M1)*FAK(M2)*ECOS(K1)*ESIN(K2)*S22 + FAC0(K1,K2,M1,M2) = C22 + ENDDO + ENDDO + ENDDO + ENDDO + + + CONTAINS + +!----------------------------------------------------------------------- + + REAL(KIND=4) FUNCTION VMIN_D(XI,XJ,XK,XIJ,XIK,XJK,XOI,XOJ,XOK) + +! PETER JANSSEN + +! PURPOSE. +! -------- + +! GIVES NONLINEAR TRANSFER COEFFICIENT FOR THREE +! WAVE INTERACTIONS OF DEEP-WATER WAVES IN THE +! IDEAL CASE OF NO CURRENT. (CF.ZAKHAROV) + +! INTERFACE. +! ---------- +! *VMIN_D(XI,XJ,XK)* +! *XI* - WAVE NUMBER +! *XJ* - WAVE NUMBER +! *XK* - WAVE NUMBER +! METHOD. +! ------- +! NONE + +! EXTERNALS. +! ---------- +! NONE. + + +!*** 1. DETERMINE NONLINEAR TRANSFER. +! -------------------------------- + IMPLICIT NONE + REAL, INTENT(IN) :: XI, XJ, XK, XIJ, XIK, XJK, XOI, XOJ, XOK + REAL :: RI, RJ, RK, OI, OJ, OK, SQIJK, SQIKJ, SQJKI + + RI=ABS(XI)+DEL1 + RJ=ABS(XJ)+DEL1 + RK=ABS(XK)+DEL1 + OI=XOI+DEL1 + OJ=XOJ+DEL1 + OK=XOK+DEL1 + SQIJK=SQRT(OI*OJ*RK/(OK*RI*RJ)) + SQIKJ=SQRT(OI*OK*RJ/(OJ*RI*RK)) + SQJKI=SQRT(OJ*OK*RI/(OI*RJ*RK)) + VMIN_D=ZCONST*( (XIJ-RI*RJ)*SQIJK + (XIK-RI*RK)*SQIKJ & + & + (XJK+RJ*RK)*SQJKI ) + + END FUNCTION VMIN_D + +!----------------------------------------------------------------------- + + REAL(KIND=4) FUNCTION VPLUS_D(XI,XJ,XK,XIJ,XIK,XJK,XOI,XOJ,XOK) + +!*** *VPLUS_D* DETERMINES THE NONLINEAR TRANSFER COEFFICIENT FOR THREE +! WAVE INTERACTIONS OF DEEP-WATER WAVES. + +! PETER JANSSEN + +! PURPOSE. +! -------- + +! GIVES NONLINEAR TRANSFER COEFFICIENT FOR THREE +! WAVE INTERACTIONS OF GRAVITY-CAPILLARY WAVES IN THE +! IDEAL CASE OF NO CURRENT. (CF.ZAKHAROV) + +! INTERFACE. +! ---------- +! *VPLUS_D(XI,XJ,XK)* +! *XI* - WAVE NUMBER +! *XJ* - WAVE NUMBER +! *XK* - WAVE NUMBER +! METHOD. +! ------- +! NONE + +! EXTERNALS. +! ---------- +! NONE. + + + +!*** 1. DETERMINE NONLINEAR TRANSFER. +! -------------------------------- + + IMPLICIT NONE + REAL, INTENT(IN) :: XI, XJ, XK, XIJ, XIK, XJK, XOI, XOJ, XOK + REAL :: RI, RJ, RK, OI, OJ, OK, SQIJK, SQIKJ, SQJKI + + RI=ABS(XI)+DEL1 + RJ=ABS(XJ)+DEL1 + RK=ABS(XK)+DEL1 + OI=XOI+DEL1 + OJ=XOJ+DEL1 + OK=XOK+DEL1 + SQIJK=SQRT(OI*OJ*RK/(OK*RI*RJ)) + SQIKJ=SQRT(OI*OK*RJ/(OJ*RI*RK)) + SQJKI=SQRT(OJ*OK*RI/(OI*RJ*RK)) + VPLUS_D=ZCONST*( (XIJ+RI*RJ)*SQIJK + (XIK+RI*RK)*SQIKJ & + & + (XJK+RJ*RK)*SQJKI ) + + END FUNCTION VPLUS_D +! ----------------------------------------------------------------- + + END SUBROUTINE SECONDHH + !/ ------------------------------------------------------------------- / + !/ + !> + !> @brief Determines skewness paramters in order to obtain + !> correction on altimeter wave height + !> + !> @details Evaluate deviations from gaussianity following the work + !> of Srokosz and Longuet-Higgins. For second order + !> corrections to surface elevation, the approach of + !> Zaharov has been used. + !> + !> @param[in] NKHF Extended number of frequencies. + !> @param[out] FAC0 2nd order coef correction. + !> @param[out] FAC1 2nd order coef correction. + !> @param[out] FAC2 2nd order coef correction. + !> @param[out] FAC3 2nd order coef correction. + !> + !> @author P. Janssen @date 29-Mar-2024 + !> + SUBROUTINE SKEWNESS(A) + +!-------------------------------------------------------------------- + +!*****SKEWNESS** COMPUTES PARAMETERS OF THE NEARLY-GAUSSIAN +! DISTRIBUTION OF OCEAN WAVES AT A FIXED GRID POINT. + +! P.JANSSEN JULY 1997 + +! PURPOSE +! ------- +! DETERMINES SKEWNESS PARAMETERS IN ORDER TO OBTAIN +! CORRECTION ON ALTIMETER WAVE HEIGHT. + +! INTERFACE +! --------- +! *CALL* *SKEWNESS(IU06,F1,NCOLL,XKAPPA1,DELH_ALT)* + + + +! METHOD +! ------ +! EVALUATE DEVIATIONS FROM GAUSSIANITY FOLLOWING THE WORK +! OF SROKOSZ AND LONGUET-HIGGINS. FOR SECOND ORDER +! CORRECTIONS TO SURFACE ELEVATION THE APPROACH OF +! ZAKHAROV HAS BEEN USED. + +! EXTERNALS +! --------- +! NONE + +! REFERENCES +! ---------- +! M.A. SROKOSZ, J.G.R.,91,995-1006(1986) +! V.E. ZAKHAROV, HAMILTONIAN APPROACH(1967) +!-------------------------------------------------------------------- + + + +!-------------------------------------------------------------------- +! *TH* REAL DIRECTIONS IN RADIANS. +USE CONSTANTS, ONLY: GRAV, TPI, TPIINV +USE W3GDATMD, ONLY: NK, NTH, XFR, SIG, DTH, ECOS, ESIN, NSEAL +USE W3PARALL, ONLY: INIT_GET_ISEA +USE W3ADATMD, ONLY: CG, SKEW, EMBIA1, EMBIA2 + + + IMPLICIT NONE + + REAL, INTENT(IN) :: A(NTH,NK,0:NSEAL) + + INTEGER :: NKHF + REAL(KIND=4), DIMENSION(:,:,:,:) , ALLOCATABLE:: FAC0,FAC1,FAC2,FAC3 + + INTEGER :: M, K, M1, K1, M2, K2, I, J + INTEGER :: MSTART, JSEA + + REAL(KIND=4) :: CONX, DELTA + REAL(KIND=4) :: FH, DELF, XK1 + REAL(KIND=4) :: XPI, XPJ, XPK, XN, XFAC, CO1 + REAL(KIND=4), DIMENSION(:,:), ALLOCATABLE :: F2 + REAL(KIND=4), DIMENSION(0:3,0:2,0:2) :: XMU, XLAMBDA + REAL(KIND=4), DIMENSION(:) , ALLOCATABLE:: SIGHF, DFIMHF, FAK + +! ---------------------------------------------------------------------- + + NKHF=NK+13 ! same offset as in ECWAM + + ALLOCATE(FAC0(NTH,NTH,NKHF,NKHF)) + ALLOCATE(FAC1(NTH,NTH,NKHF,NKHF)) + ALLOCATE(FAC2(NTH,NTH,NKHF,NKHF)) + ALLOCATE(FAC3(NTH,NTH,NKHF,NKHF)) + + CALL SECONDHH(NKHF,FAC0,FAC1,FAC2,FAC3) + + ALLOCATE(F2(NTH,NKHF)) + ALLOCATE(SIGHF(NKHF), DFIMHF(NKHF), FAK(NKHF)) + +! 1. COMPUTATION OF FREQUENCY-DIRECTION INCREMENT +! ----------------------------------------------- + + MSTART = 1 + + +#ifdef W3_OMPG + !$OMP PARALLEL DO PRIVATE(JSEA) +#endif + DO JSEA=1, NSEAL + XMU(:,:,:) = 0.0 + DO K=1,NTH + DO M=1,NK + CONX = TPIINV / SIG(M) * CG(M,JSEA) + F2(K,M)=A(K,M,JSEA)/ CONX + END DO + END DO + + SIGHF(1) = SIG(1) + DO M=2,NKHF + SIGHF(M) = XFR*SIGHF(M-1) + ENDDO + + CO1 = 0.5*(XFR-1.)*DTH*TPIINV + DFIMHF(1) = CO1*SIGHF(1) ! this is DF*DTH + DO M=2,NKHF-1 + DFIMHF(M)=CO1*(SIGHF(M)+SIGHF(M-1)) + ENDDO + DFIMHF(NKHF)=CO1*SIGHF(NKHF-1) + + DO M=1,NKHF + FAK(M) = (SIGHF(M))**2/GRAV + ENDDO + +! Deals with the tail ... + DO M=NK+1,NKHF + FH=(SIGHF(NK)/SIGHF(M))**5 + DO K=1,NTH + F2(K,M)=F2(K,NK)*FH + ENDDO + ENDDO + +! 2. COMPUTATION OF THE SKEWNESS COEFFICIENTS +! -------------------------------------------- + + DO M1=MSTART,NKHF + DO M2=MSTART,NKHF + DO K1=1,NTH + DO K2=1,NTH + DELF = DFIMHF(M1)*DFIMHF(M2)*F2( K1,M1)*F2(K2,M2) + XMU(3,0,0) = XMU(3,0,0)+3.0*FAC0(K1,K2,M1,M2)*DELF + XMU(1,2,0) = XMU(1,2,0)+FAC1(K1,K2,M1,M2)*DELF + XMU(1,0,2) = XMU(1,0,2)+FAC2(K1,K2,M1,M2)*DELF + XMU(1,1,1) = XMU(1,1,1)+FAC3(K1,K2,M1,M2)*DELF + ENDDO + ENDDO + ENDDO + ENDDO + + DO K1=1,NTH + DO M1=MSTART,NKHF + XK1 = FAK(M1)**2 + DELF = DFIMHF(M1)*F2(K1,M1) + XMU(2,0,0) = XMU(2,0,0) + DELF + XMU(0,2,0) = XMU(0,2,0) + XK1*ECOS(K1)**2*DELF + XMU(0,0,2) = XMU(0,0,2) + XK1*ESIN(K1)**2*DELF + XMU(0,1,1) = XMU(0,1,1) + XK1*ECOS(K1)*ESIN(K1)*DELF + ENDDO + ENDDO + + +! 3. COMPUTATION OF THE NORMALISED SKEWNESS COEFFICIENTS +! ------------------------------------------------------ + + DO I=0,3 + XPI = 0.5*FLOAT(I) + DO J=0,2 + XPJ = 0.5*FLOAT(J) + DO K=0,2 + XPK = 0.5*FLOAT(K) + XN = XMU(2,0,0)**XPI*XMU(0,2,0)**XPJ*XMU(0,0,2)**XPK ! denom in Srokosz eq. 11 + IF (XN .NE. 0) THEN + XLAMBDA(I,J,K) = XMU(I,J,K)/XN + ELSE + XLAMBDA(I,J,K) = 0 + END IF + END DO + END DO + END DO + IF ( XMU(2,0,0) .GT. 1.E-7 ) THEN + SKEW(JSEA)=XLAMBDA(3,0,0) + DELTA = ( XLAMBDA(1,2,0) + XLAMBDA(1,0,2) & + - 2.0*XLAMBDA(0,1,1)*XLAMBDA(1,1,1) )/ & + (1.0 - XLAMBDA(0,1,1)**2) ! this is called gamma eq. 20 + EMBIA1(JSEA)=-0.125*DELTA ! EM Bias coefficient + EMBIA2(JSEA)=-0.125*XLAMBDA(3,0,0)/3.0 ! tracker bias (least squares only) + END IF + END DO ! end of loop on JSEA + ! +#ifdef W3_OMPG + !$OMP END PARALLEL DO +#endif + + DEALLOCATE(FAC0,FAC1,FAC2,FAC3) + DEALLOCATE(F2,SIGHF,DFIMHF,FAK) + + + END SUBROUTINE SKEWNESS + END MODULE W3IOGOMD diff --git a/model/src/w3odatmd.F90 b/model/src/w3odatmd.F90 index d268793fb..3a667ebbf 100644 --- a/model/src/w3odatmd.F90 +++ b/model/src/w3odatmd.F90 @@ -887,7 +887,7 @@ SUBROUTINE W3NOUT ( NDSERR, NDSTST ) ! ! 8) Spectrum parameters ! - NOGE(8) = 6 + NOGE(8) = 9 ! IDOUT( 8, 1) = 'Mean square slopes ' IDOUT( 8, 2) = 'Phillips tail const' @@ -895,6 +895,9 @@ SUBROUTINE W3NOUT ( NDSERR, NDSTST ) IDOUT( 8, 4) = 'Tail slope direction' IDOUT( 8, 5) = 'Goda peakedness parm' IDOUT( 8, 6) = 'kxky-peakdness ' + IDOUT( 8, 7) = 'Skewness ' + IDOUT( 8, 8) = 'EM bias(l120+l102)/8' + IDOUT( 8, 9) = 'Tracker bias:-l300/8' ! 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 a4a58d079..87e606e56 100644 --- a/model/src/w3ounfmetamd.F90 +++ b/model/src/w3ounfmetamd.F90 @@ -3969,6 +3969,45 @@ SUBROUTINE DEFAULT_META() META(1)%VARNC='2D wavenumber peakedness' META(1)%VMIN = 0 META(1)%VMAX = 1600 + ! IFI=8, IFJ=7, SKW + META => GROUP(8)%FIELD(7)%META + META(1)%FSC = 0.00001 + META(1)%UNITS = '1' + META(1)%ENAME = '.skw' + META(1)%VARNM='skw' + META(1)%VARNL='skewness' + !META(1)%VARNS='sea_surface_wave_peakedness' + META(1)%VARNS='' + META(1)%VARNG='skewness of P(z,sx,sy=0)' + META(1)%VARNC='skewness of P(z,sx,sy=0)' + META(1)%VMIN = 0 + META(1)%VMAX = 1 + ! IFI=8, IFJ=8, EMB + META => GROUP(8)%FIELD(8)%META + META(1)%FSC = 0.00001 + META(1)%UNITS = '1' + META(1)%ENAME = '.emb' + META(1)%VARNM='emb' + META(1)%VARNL='EM-bias' + !META(1)%VARNS='sea_surface_wave_peakedness' + META(1)%VARNS='' + META(1)%VARNG='EM bias coefficient' + META(1)%VARNC='EM bias coefficient' + META(1)%VMIN = -1 + META(1)%VMAX = 1 + ! IFI=8, IFJ=7, SKW + META => GROUP(8)%FIELD(9)%META + META(1)%FSC = 0.00001 + META(1)%UNITS = '1' + META(1)%ENAME = '.emc' + META(1)%VARNM='emc' + META(1)%VARNL='trackerbias' + !META(1)%VARNS='sea_surface_wave_peakedness' + META(1)%VARNS='' + META(1)%VARNG='tracker bias coefficient' + META(1)%VARNC='tracker bias coefficient' + META(1)%VMIN = -1 + META(1)%VMAX = 1 ! ! !---------- GROUP 9 ---------------- ! diff --git a/model/src/ww3_ounf.F90 b/model/src/ww3_ounf.F90 index 02fd0d6f8..a2ff83e26 100644 --- a/model/src/ww3_ounf.F90 +++ b/model/src/ww3_ounf.F90 @@ -66,6 +66,7 @@ PROGRAM W3OUNF !/ 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 ) + !/ 03-Mar-2024 : Added SKEW & EMBIAS output ( version 7.xx ) !/ !/ Copyright 2009-2013 National Weather Service (NWS), !/ National Oceanic and Atmospheric Administration. All rights @@ -193,7 +194,7 @@ PROGRAM W3OUNF CFLTHMAX, CFLXYMAX, CFLKMAX, TAUICE, PHICE, & STMAXE, STMAXD, HMAXE, HCMAXE, HMAXD, HCMAXD,& P2SMS, EF, US3D, TH1M, STH1M, TH2M, STH2M, & - WN, USSP, WBT, WNMEAN, QKK + WN, USSP, WBT, WNMEAN, QKK, SKEW, EMBIA1, EMBIA2 USE W3ODATMD, ONLY: NDSO, NDSE, SCREEN, NOGRP, NGRPP, IDOUT, & UNDEF, FLOGRD, FNMPRE, NOSWLL, NOGE ! @@ -1960,6 +1961,18 @@ SUBROUTINE W3EXNC ( NX, NY, IX1, IXN, IY1, IYN, NSEA, & ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 6 ) THEN CALL S2GRID(QKK, X1) ! + ! surface elevation skewness lambda_3,0,0 + ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 7 ) THEN + CALL S2GRID(SKEW, X1) + ! + ! em bias param 1 + ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 8 ) THEN + CALL S2GRID(EMBIA1, X1) + ! + ! em bias param 2 + ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 9 ) THEN + CALL S2GRID(EMBIA2, X1) + ! ! Dynamic time step ELSE IF ( IFI .EQ. 9 .AND. IFJ .EQ. 1 ) THEN DO ISEA=1, NSEA diff --git a/model/src/ww3_outf.F90 b/model/src/ww3_outf.F90 index e955f00ad..590518037 100644 --- a/model/src/ww3_outf.F90 +++ b/model/src/ww3_outf.F90 @@ -160,6 +160,7 @@ PROGRAM W3OUTF PHS, PTP, PLP, PDIR, PSI, PWS, PWST, PNR, & PTM1, PT1, PT2, PEP, TAUOCX, TAUOCY, & PTHP0, PQP, PSW, PPE, PGW, QP, QKK, & + SKEW, EMBIA1, EMBIA2, & TAUOX, TAUOY, TAUWIX,BHD, & TAUWIY, PHIAW, PHIOC, TUSX, TUSY, PRMS, TPMS,& USSX, USSY, MSSX, MSSY, MSCX, MSCY, CHARN, & @@ -2216,6 +2217,39 @@ SUBROUTINE W3EXGO ( NX, NY, NSEA ) CALL W3S2XY ( NSEA, NSEA, NX+1, NY, QKK, MAPSF, X1 ) ENDIF ! + ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 7 ) THEN + FLONE = .TRUE. + FSC = 0.01 + UNITS = '1' + ENAME = '.skw' + IF ( ITYPE .EQ. 4 ) THEN + XS1 = SKEW + ELSE + CALL W3S2XY ( NSEA, NSEA, NX+1, NY, SKEW, MAPSF, X1 ) + ENDIF + ! + ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 8 ) THEN + FLONE = .TRUE. + FSC = 0.0001 + UNITS = '1' + ENAME = '.emb' + IF ( ITYPE .EQ. 4 ) THEN + XS1 = EMBIA1 + ELSE + CALL W3S2XY ( NSEA, NSEA, NX+1, NY, EMBIA1, MAPSF, X1 ) + ENDIF + ! + ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 9 ) THEN + FLONE = .TRUE. + FSC = 0.0001 + UNITS = '1' + ENAME = '.emc' + IF ( ITYPE .EQ. 4 ) THEN + XS1 = EMBIA2 + ELSE + CALL W3S2XY ( NSEA, NSEA, NX+1, NY, EMBIA2, MAPSF, X1 ) + ENDIF + ! ELSE IF ( IFI .EQ. 9 .AND. IFJ .EQ. 1 ) THEN FLONE = .TRUE. FSC = 0.1 diff --git a/model/tools/bash/ww3_ounf_inp2nml.sh b/model/tools/bash/ww3_ounf_inp2nml.sh index e9a34d7b8..1edd05562 100755 --- a/model/tools/bash/ww3_ounf_inp2nml.sh +++ b/model/tools/bash/ww3_ounf_inp2nml.sh @@ -184,7 +184,7 @@ cat >> $nmlfile << EOF ! 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 SKW EMB EMC ! 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 619002aa8..8ea336e13 100755 --- a/model/tools/bash/ww3_shel_inp2nml.sh +++ b/model/tools/bash/ww3_shel_inp2nml.sh @@ -970,6 +970,9 @@ cat >> $nmlfile << EOF ! 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 +! F F 8 7 SKEW SKW Skewness of elevation for zero slopes +! F F 8 8 EMBIA1 EMB Mean sea level at zero slopes / Hs +! F F 8 9 EMBIA2 EMC Tracker bias for LRM least square altimetry ! ------------------------------------------------- ! 9 Numerical diagnostics ! ------------------------------------------------- diff --git a/regtests/ww3_ts1/input/ww3_ounf.inp b/regtests/ww3_ts1/input/ww3_ounf.inp index 52a2dd2c6..0b89ef01e 100644 --- a/regtests/ww3_ts1/input/ww3_ounf.inp +++ b/regtests/ww3_ts1/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 - DPT WND ICE HS MSS MSD FAW WCC WCF WCH WCM FOC TAW CHA FWS WBT + DPT WND ICE HS MSS MSD FAW WCC WCF WCH WCM FOC TAW CHA FWS WBT SKW EMB EMC $ $--------------------------------------------------------------------- $ $ NetCDF version [3,4] and variable type 4 [2 = SHORT, 3 = it depends , 4 = REAL] diff --git a/regtests/ww3_ts1/input/ww3_ounf.nml b/regtests/ww3_ts1/input/ww3_ounf.nml index fb0f02d3e..f9992f0ce 100644 --- a/regtests/ww3_ts1/input/ww3_ounf.nml +++ b/regtests/ww3_ts1/input/ww3_ounf.nml @@ -9,7 +9,7 @@ FIELD%TIMESTART = '19680101 120000' FIELD%TIMESTRIDE = '10' FIELD%TIMECOUNT = '8000' - FIELD%LIST = 'DPT WND ICE HS MSS MSD FAW WCC WCF WCH WCM FOC TAW CHA FWS WBT' + FIELD%LIST = 'DPT WND ICE HS MSS MSD FAW WCC WCF WCH WCM FOC TAW CHA FWS WBT SKW EMB EMC' FIELD%PARTITION = '0 1 2' FIELD%TYPE = 4 / diff --git a/regtests/ww3_ts1/input/ww3_shel.inp b/regtests/ww3_ts1/input/ww3_shel.inp index fca96fb7e..5171bd9ab 100644 --- a/regtests/ww3_ts1/input/ww3_shel.inp +++ b/regtests/ww3_ts1/input/ww3_shel.inp @@ -19,7 +19,7 @@ $ $ N $ -DPT WND MSS MSD ICE HS MSS FAW WCC WCF WCH WCM FOC TAW CHA FWS WBT +DPT WND MSS MSD ICE HS MSS FAW WCC WCF WCH WCM FOC TAW CHA FWS WBT SKW EMB EMC $ 19680606 000000 60 19680618 000000 0.0 0.0 'The_point' diff --git a/regtests/ww3_ts1/input/ww3_shel.nml b/regtests/ww3_ts1/input/ww3_shel.nml index b4837d6e1..1ecf48c51 100644 --- a/regtests/ww3_ts1/input/ww3_shel.nml +++ b/regtests/ww3_ts1/input/ww3_shel.nml @@ -21,7 +21,7 @@ ! Define the output types point parameters via OUTPUT_TYPE_NML namelist ! -------------------------------------------------------------------- ! &OUTPUT_TYPE_NML - TYPE%FIELD%LIST = 'DPT WND MSS MSD ICE HS MSS FAW WCC WCF WCH WCM FOC TAW CHA FWS WBT' + TYPE%FIELD%LIST = 'DPT WND MSS MSD ICE HS MSS FAW WCC WCF WCH WCM FOC TAW CHA FWS WBT SKW EMB EMC' TYPE%POINT%FILE = '../input/points.list' / From c13d0b1e178c7de0635f2577dd125b51fc31e372 Mon Sep 17 00:00:00 2001 From: Jessica Meixner Date: Thu, 9 May 2024 17:22:48 -0400 Subject: [PATCH 23/30] Add ice time variables to restart file (#1224) Co-authored-by: Nicholas Szapiro <149816583+NickSzapiro-NOAA@users.noreply.github.com> --- model/src/w3iorsmd.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/model/src/w3iorsmd.F90 b/model/src/w3iorsmd.F90 index 05f7e9163..5253a66ab 100644 --- a/model/src/w3iorsmd.F90 +++ b/model/src/w3iorsmd.F90 @@ -69,7 +69,7 @@ MODULE W3IORSMD !/ !/ Private parameter statements (ID strings) !/ - CHARACTER(LEN=10), PARAMETER, PRIVATE :: VERINI = '2021-05-28' + CHARACTER(LEN=10), PARAMETER, PRIVATE :: VERINI = '2024-04-26' CHARACTER(LEN=26), PARAMETER, PRIVATE :: & IDSTR = 'WAVEWATCH III RESTART FILE' !/ @@ -845,7 +845,7 @@ SUBROUTINE W3IORS ( INXOUT, NDSR, DUMFPI, IMOD, FLRSTRT ) WRITEBUFF(:) = 0. WRITE (NDSR,POS=RPOS,ERR=803,IOSTAT=IERR) WRITEBUFF WRITE (NDSR,POS=RPOS,ERR=803,IOSTAT=IERR) & - TLEV, TICE, TRHO + TLEV, TICE, TRHO, TIC1, TIC5 DO IPART=1,NPART NREC = NREC + 1 RPOS = 1_8 + LRECL*(NREC-1_8) @@ -1026,7 +1026,7 @@ SUBROUTINE W3IORS ( INXOUT, NDSR, DUMFPI, IMOD, FLRSTRT ) IF (TYPE.EQ.'FULL') THEN RPOS = 1_8 + LRECL*(NREC-1_8) READ (NDSR,POS=RPOS,ERR=802,IOSTAT=IERR) & - TLEV, TICE, TRHO + TLEV, TICE, TRHO, TIC1, TIC5 DO IPART=1,NPART NREC = NREC + 1 RPOS = 1_8 + LRECL*(NREC-1_8) From 14e6bedfcefeff8f0896acea5dade4100a3fbacd Mon Sep 17 00:00:00 2001 From: Chris Bunney <48915820+ukmo-ccbunney@users.noreply.github.com> Date: Fri, 10 May 2024 18:07:55 +0100 Subject: [PATCH 24/30] Functional form of Charnock calculation in ST4. (#1225) Authored by: @ukmo-nievesvaliente --- model/inp/ww3_grid.inp | 6 ++ model/nml/namelists.nml | 6 ++ model/src/w3gdatmd.F90 | 7 +- model/src/w3gridmd.F90 | 24 +++++- model/src/w3iogrmd.F90 | 8 +- model/src/w3src4md.F90 | 31 ++++++-- regtests/bin/matrix.base | 1 + .../ww3_ts1/input_capcha/namelists_CAPCHA.nml | 12 +++ regtests/ww3_ts1/input_capcha/switch_ST4 | 1 + regtests/ww3_ts1/input_capcha/ww3_grid.nml | 70 +++++++++++++++++ regtests/ww3_ts1/input_capcha/ww3_ounf.nml | 29 +++++++ .../ww3_ts1/input_capcha/ww3_ounp_spec.nml | 47 +++++++++++ regtests/ww3_ts1/input_capcha/ww3_shel.nml | 78 +++++++++++++++++++ regtests/ww3_ts1/input_capcha/ww3_strt.inp | 7 ++ 14 files changed, 312 insertions(+), 15 deletions(-) create mode 100644 regtests/ww3_ts1/input_capcha/namelists_CAPCHA.nml create mode 100644 regtests/ww3_ts1/input_capcha/switch_ST4 create mode 100644 regtests/ww3_ts1/input_capcha/ww3_grid.nml create mode 100644 regtests/ww3_ts1/input_capcha/ww3_ounf.nml create mode 100644 regtests/ww3_ts1/input_capcha/ww3_ounp_spec.nml create mode 100644 regtests/ww3_ts1/input_capcha/ww3_shel.nml create mode 100644 regtests/ww3_ts1/input_capcha/ww3_strt.inp diff --git a/model/inp/ww3_grid.inp b/model/inp/ww3_grid.inp index 655a10493..b3458402b 100644 --- a/model/inp/ww3_grid.inp +++ b/model/inp/ww3_grid.inp @@ -73,6 +73,12 @@ $ effective wind speed (!/STAB2). $ WAM4 and variants : Namelist SIN3 $ ZWND : Height of wind (m). $ ALPHA0 : minimum value of Charnock coefficient +$ CAPCHA : enable functional form for Cd (1=enabled), +$ only valid when SINTABLE=0. +$ UCAP : Wind speed threshold for cap (CAPCHA=1) +$ SIGMAUCAP : Width of functional form (CAPCHA=1) +$ CHA0 : Initial Charnock coefficient (CAPCHA=1) +$ CHAMIN : Minimum Charnock value (CAPCHA=1) $ Z0MAX : maximum value of air-side roughness z0 $ BETAMAX : maximum value of wind-wave coupling $ SINTHP : power of cosine in wind input diff --git a/model/nml/namelists.nml b/model/nml/namelists.nml index 9fb59fe1c..ff55b14a4 100644 --- a/model/nml/namelists.nml +++ b/model/nml/namelists.nml @@ -62,6 +62,12 @@ $ $ Janssen / Ardhuin : Namelist SIN4 $ ZWND : Height of wind (m). $ ALPHA0 : minimum value of Charnock coefficient +$ CAPCHA : enable functional form for Cd (1=enabled), +$ only valid when SINTABLE=0. +$ UCAP : Wind speed threshold for cap (CAPCHA=1) +$ SIGMAUCAP : Width of functional form (CAPCHA=1) +$ CHA0 : Initial Charnock coefficient (CAPCHA=1) +$ CHAMIN : Minimum Charnock value (CAPCHA=1) $ Z0MAX : maximum value of air-side roughness z0 $ BETAMAX : maximum value of wind-wave coupling $ SINTHP : power of cosine in wind input diff --git a/model/src/w3gdatmd.F90 b/model/src/w3gdatmd.F90 index bde5bf999..e73957128 100644 --- a/model/src/w3gdatmd.F90 +++ b/model/src/w3gdatmd.F90 @@ -907,7 +907,8 @@ MODULE W3GDATMD SSDSP, WWNMEANP, SSTXFTF, SSTXFTWN, & FFXPM, FFXFM, FFXFA, & SSDSBRF1, SSDSBRF2, SSDSBINT,SSDSBCK,& - SSDSHCK, SSDSABK, SSDSPBK, SSINBR + SSDSHCK, SSDSABK, SSDSPBK, SSINBR, & + CAPCHNK(1:10) REAL :: ZZWND REAL :: SSDSCOS, SSDSDTH, SSDSBT, SSDSBM(0:4) #endif @@ -1327,7 +1328,8 @@ MODULE W3GDATMD SSDSPBK, SSINBR,SSINTHP,TTAUWSHELTER,& SINTAILPAR(:), SSWELLF(:), SSDSC(:), SSDSBR, & SSDSP, WWNMEANP, SSTXFTF, SSTXFTWN, & - SSDSBT, SSDSCOS, SSDSDTH, SSDSBM(:) + SSDSBT, SSDSCOS, SSDSDTH, SSDSBM(:), & + CAPCHNK(:) #endif #ifdef W3_ST6 REAL, POINTER :: SIN6A0, SDS6A1, SDS6A2, SWL6B1, & @@ -2668,6 +2670,7 @@ SUBROUTINE W3SETG ( IMOD, NDSE, NDST ) ZZALP => MPARS(IMOD)%SRCPS%ZZALP TTAUWSHELTER => MPARS(IMOD)%SRCPS%TTAUWSHELTER SINTAILPAR => MPARS(IMOD)%SRCPS%SINTAILPAR + CAPCHNK => MPARS(IMOD)%SRCPS%CAPCHNK SSWELLFPAR => MPARS(IMOD)%SRCPS%SSWELLFPAR SSWELLF => MPARS(IMOD)%SRCPS%SSWELLF SSDSC => MPARS(IMOD)%SRCPS%SSDSC diff --git a/model/src/w3gridmd.F90 b/model/src/w3gridmd.F90 index dad11eddc..ecf2726a0 100644 --- a/model/src/w3gridmd.F90 +++ b/model/src/w3gridmd.F90 @@ -115,6 +115,7 @@ MODULE W3GRIDMD !/ 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 ) + !/ 03-May-2024 : New CAPCHNK parameters for SIN4 ( version 7.15 ) !/ !/ Copyright 2009-2013 National Weather Service (NWS), !/ National Oceanic and Atmospheric Administration. All rights @@ -860,7 +861,8 @@ MODULE W3GRIDMD SDSBM0, SDSBM1, SDSBM2, SDSBM3, & SDSBM4, SDSFACMTF, SDSCUMP, SDSNUW, & SDSL, SDSMWD, SDSMWPOW, SPMSS, SDSNMTF, SINTAIL1, SINTAIL2, & - CUMSIGP, VISCSTRESS + CUMSIGP, VISCSTRESS, & + CAPCHA, CHAMIN, CHA0, UCAP, SIGMAUCAP #endif ! #ifdef W3_ST6 @@ -1003,7 +1005,8 @@ MODULE W3GRIDMD NAMELIST /SIN4/ ZWND, ALPHA0, Z0MAX, BETAMAX, SINTHP, ZALP, & TAUWSHELTER, SWELLFPAR, SWELLF, & SWELLF2, SWELLF3, SWELLF4, SWELLF5, SWELLF6, & - SWELLF7, Z0RAT, SINBR, SINTABLE, SINTAIL1, SINTAIL2, TAUWBUG, VISCSTRESS + SWELLF7, Z0RAT, SINBR, SINTABLE, SINTAIL1, SINTAIL2, TAUWBUG, VISCSTRESS, & + CAPCHA, CHAMIN, CHA0, UCAP, SIGMAUCAP #endif #ifdef W3_NL1 NAMELIST /SNL1/ LAMBDA, NLPROP, KDCONV, KDMIN, & @@ -1730,6 +1733,11 @@ SUBROUTINE W3GRID() TAUWBUG = 1 ! TAUWBUG is 1 is the bug is kept: ! initializes TAUWX/Y to zero in W3SRCE VISCSTRESS =0 + CAPCHA = 0. ! =1 indicates capping of drag is active + CHAMIN = 0.0001 ! + CHA0 = ALPHA0 ! initial value for charnock + UCAP = 30. ! U10 threshold from which drag capping is applied + SIGMAUCAP = 10. ! Width for reduction of drag beyond UCAP #endif ! #ifdef W3_ST6 @@ -1818,6 +1826,11 @@ SUBROUTINE W3GRID() SINTAILPAR(3) = SINTAIL2 SINTAILPAR(4) = FLOAT(TAUWBUG) SINTAILPAR(5) = VISCSTRESS + CAPCHNK(1) = CAPCHA + CAPCHNK(2) = CHAMIN + CAPCHNK(3) = CHA0 + CAPCHNK(4) = UCAP + CAPCHNK(5) = SIGMAUCAP #endif ! #ifdef W3_ST6 @@ -3219,7 +3232,8 @@ 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, SINTABLE, TAUWBUG, VISCSTRESS, SINTAIL1, SINTAIL2 + SWELLF5, SWELLF6, SWELLF7, Z0RAT, SINBR, SINTABLE, TAUWBUG, VISCSTRESS, SINTAIL1, SINTAIL2, & + CAPCHA, CHAMIN, CHA0, UCAP, SIGMAUCAP #endif #ifdef W3_ST6 WRITE (NDSO,2920) SINA0, SINWS, SINFC @@ -6270,7 +6284,9 @@ SUBROUTINE W3GRID() ' SWELLF5 =',F8.5,', SWELLF6 =',F8.5, & ', SWELLF7 =',F12.2,', Z0RAT =',F8.5,', SINBR =',F8.5,','/ & ' SINTABLE =',I2,', TAUWBUG =',I2, & - ', VISCSTRESS =',F8.5,', SINTAIL1 =',F8.5,', SINTAIL2 =',F8.5,' /') + ', VISCSTRESS =',F8.5,', SINTAIL1 =',F8.5,', SINTAIL2 =',F8.5,',' / & + ', CAPCHA =',F8.5,', CHAMIN =',F8.5,', CHA0 =',F8.5,', UCAP =',F5.1,', SIGMAUCAP =', & + F5.1,' /') #endif ! #ifdef W3_ST6 diff --git a/model/src/w3iogrmd.F90 b/model/src/w3iogrmd.F90 index ce4403ba3..9f9e8c8db 100644 --- a/model/src/w3iogrmd.F90 +++ b/model/src/w3iogrmd.F90 @@ -1508,7 +1508,7 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT & SSDSPBK, SSDSBINT, FFXPM, FFXFM, FFXFA, & SSDSHCK, & IKTAB, DCKI, QBI, SATINDICES, SATWEIGHTS, & - DIKCUMUL, CUMULW, SINTAILPAR + DIKCUMUL, CUMULW, SINTAILPAR, CAPCHNK #ifdef W3_ASCII WRITE (NDSA,*) & 'ZZWND, AALPHA, ZZ0MAX, BBETA, SSINTHP, ZZALP, & @@ -1521,7 +1521,7 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT & SSDSPBK, SSDSBINT, FFXPM, FFXFM, FFXFA, & SSDSHCK, & IKTAB, DCKI, QBI, SATINDICES, SATWEIGHTS, & - DIKCUMUL, CUMULW, SINTAILPAR:', & + DIKCUMUL, CUMULW, SINTAILPAR, CAPCHNK:', & ZZWND, AALPHA, ZZ0MAX, BBETA, SSINTHP, ZZALP, & TTAUWSHELTER, SSWELLFPAR, SSWELLF, SSINBR, & ZZ0RAT, SSDSC, & @@ -1532,7 +1532,7 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT & SSDSPBK, SSDSBINT, FFXPM, FFXFM, FFXFA, & SSDSHCK, & IKTAB, DCKI, QBI, SATINDICES, SATWEIGHTS, & - DIKCUMUL, CUMULW, SINTAILPAR + DIKCUMUL, CUMULW, SINTAILPAR, CAPCHNK #endif IF (SINTAILPAR(1).GT.0.5) THEN WRITE (NDSM) DELUST, DELTAIL, DELTAUW, DELU, DELALP, & @@ -1558,7 +1558,7 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT & SSDSPBK, SSDSBINT, FFXPM, FFXFM, FFXFA, & SSDSHCK, & IKTAB, DCKI, QBI, SATINDICES, SATWEIGHTS, & - DIKCUMUL, CUMULW, SINTAILPAR + DIKCUMUL, CUMULW, SINTAILPAR, CAPCHNK IF (SINTAILPAR(1).GT.0.5) THEN CALL INSIN4(.FALSE.) READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & diff --git a/model/src/w3src4md.F90 b/model/src/w3src4md.F90 index 32eadaf82..dcf1e5808 100644 --- a/model/src/w3src4md.F90 +++ b/model/src/w3src4md.F90 @@ -1849,6 +1849,8 @@ SUBROUTINE CALC_USTAR(WINDSPEED,TAUW,USTAR,Z0,CHARN) !/ 14-Aug-2006 : Modified following Bidlot ( version 2.22-SHOM ) !/ 18-Aug-2006 : Ported to version 3.09 !/ 03-Apr-2010 : Adding output of Charnock parameter ( version 3.14-IFREMER ) + !/ 03-May-2024 : Optional functional form of ( version 7.15 ) + !/ Charnock coefficient and surface drag (UK Met Office). ! ! 1. Purpose : ! @@ -1895,7 +1897,7 @@ SUBROUTINE CALC_USTAR(WINDSPEED,TAUW,USTAR,Z0,CHARN) ! 10. Source code : !-----------------------------------------------------------------------------! USE CONSTANTS, ONLY: GRAV, KAPPA, NU_AIR - USE W3GDATMD, ONLY: ZZWND, AALPHA, ZZ0MAX, SINTAILPAR + USE W3GDATMD, ONLY: ZZWND, AALPHA, ZZ0MAX, SINTAILPAR, CAPCHNK #ifdef W3_T USE W3ODATMD, ONLY: NDST #endif @@ -1908,6 +1910,7 @@ SUBROUTINE CALC_USTAR(WINDSPEED,TAUW,USTAR,Z0,CHARN) INTEGER :: IND,J REAL :: TAUW_LOCAL REAL :: TAUOLD,CDRAG,WCD,USTOLD,X,UST,ZZ0,ZNU,ZZ00,F,DELF + REAL :: CHATH, XMIN ! used for reduction of high winds INTEGER, PARAMETER :: NITER=10 REAL , PARAMETER :: XM=0.50, EPS1=0.00001 INTEGER :: ITER @@ -1918,6 +1921,7 @@ SUBROUTINE CALC_USTAR(WINDSPEED,TAUW,USTAR,Z0,CHARN) ! *EPS1* REAL SMALL NUMBER TO MAKE SURE THAT A SOLUTION ! IS OBTAINED IN ITERATION WITH TAU>TAUW. + CHATH = AALPHA ! IF (SINTAILPAR(1).GT.0.5) THEN TAUW_LOCAL=MAX(MIN(TAUW,TAUWMAX),0.) @@ -1932,6 +1936,17 @@ SUBROUTINE CALC_USTAR(WINDSPEED,TAUW,USTAR,Z0,CHARN) USTAR=(TAUT(IND,J)*DELI2+TAUT(IND+1,J )*DELI1)*DELJ2 & + (TAUT(IND,J+1)*DELI2+TAUT(IND+1,J+1)*DELI1)*DELJ1 ELSE + IF (CAPCHNK(1).EQ.1.) THEN + ! Computation of sea surface roughness and charnock coefficient based + ! on Donelan (2018). Determines minimum charnock; reduction for winds + ! above a particular threshold + CHATH = CAPCHNK(2) + 0.5 * (CAPCHNK(3) - CAPCHNK(2)) * (1 & + - TANH((WINDSPEED-CAPCHNK(4))/CAPCHNK(5))) + XMIN = 0.15 * (CAPCHNK(3)-CHATH) + ELSE + XMIN = 0. + END IF + ! This max is for comparison ... to be removed later ! TAUW_LOCAL=MAX(MIN(TAUW,TAUWMAX),0.) TAUW_LOCAL=TAUW @@ -1941,9 +1956,9 @@ SUBROUTINE CALC_USTAR(WINDSPEED,TAUW,USTAR,Z0,CHARN) 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 + X = MAX(TAUW_LOCAL/TAUOLD, XMIN) UST = SQRT(TAUOLD) - ZZ00=AALPHA*TAUOLD/GRAV + ZZ00 = CHATH*TAUOLD/GRAV IF (ZZ0MAX.NE.0) ZZ00=MIN(ZZ00,ZZ0MAX) ! Corrects roughness ZZ00 for quasi-linear effect ZZ0 = ZZ00/(1.-X)**XM @@ -1969,10 +1984,16 @@ SUBROUTINE CALC_USTAR(WINDSPEED,TAUW,USTAR,Z0,CHARN) SQRTCDM1 = MIN(WINDSPEED/USTAR,100.0) Z0 = ZZWND*EXP(-KAPPA*SQRTCDM1) ELSE - Z0 = AALPHA*0.001*0.001/GRAV + Z0 = CHATH*0.001*0.001/GRAV END IF - CHARN = AALPHA + CHARN = CHATH END IF + IF(CAPCHNK(1) .EQ. 1) THEN + ! Problem with large values of CHARN for low winds + CHARN = MIN( 0.09 , CHARN ) + IF(CHARN.LT.CHATH) CHARN = CHATH + ENDIF + ! WRITE(6,*) 'CALC_USTAR:',WINDSPEED,TAUW,AALPHA,CHARN,Z0,USTAR ! RETURN diff --git a/regtests/bin/matrix.base b/regtests/bin/matrix.base index 97ae213f4..819ea0101 100755 --- a/regtests/bin/matrix.base +++ b/regtests/bin/matrix.base @@ -918,6 +918,7 @@ 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 + echo "$rtst -s ST4 -w work_ST4_CAP -i input_capcha -N $ww3 ww3_ts1" >> matrix.body fi # fetch limited growth, no switch sharing here diff --git a/regtests/ww3_ts1/input_capcha/namelists_CAPCHA.nml b/regtests/ww3_ts1/input_capcha/namelists_CAPCHA.nml new file mode 100644 index 000000000..5a5c72657 --- /dev/null +++ b/regtests/ww3_ts1/input_capcha/namelists_CAPCHA.nml @@ -0,0 +1,12 @@ +&SIN4 + SINTABLE=0, + BETAMAX=1.35, + CAPCHA=1, + CHA0=0.0095, + SIGMAUCAP=5.0, + SINTAIL1=0.8, + TAUWBUG = 1, + UCAP=28.0 +/ + +END OF NAMELISTS diff --git a/regtests/ww3_ts1/input_capcha/switch_ST4 b/regtests/ww3_ts1/input_capcha/switch_ST4 new file mode 100644 index 000000000..c3b8938ee --- /dev/null +++ b/regtests/ww3_ts1/input_capcha/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_capcha/ww3_grid.nml b/regtests/ww3_ts1/input_capcha/ww3_grid.nml new file mode 100644 index 000000000..9b47a9123 --- /dev/null +++ b/regtests/ww3_ts1/input_capcha/ww3_grid.nml @@ -0,0 +1,70 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III - ww3_grid.nml - Grid pre-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the spectrum parameterization via SPECTRUM_NML namelist +! -------------------------------------------------------------------- ! +&SPECTRUM_NML + SPECTRUM%XFR = 1.10 + SPECTRUM%FREQ1 = 0.0485 + SPECTRUM%NK = 36 + SPECTRUM%NTH = 24 +/ + +! -------------------------------------------------------------------- ! +! Define the run parameterization via RUN_NML namelist +! -------------------------------------------------------------------- ! +&RUN_NML + RUN%FLSOU = T +/ + +! -------------------------------------------------------------------- ! +! Define the timesteps parameterization via TIMESTEPS_NML namelist +! -------------------------------------------------------------------- ! +&TIMESTEPS_NML + TIMESTEPS%DTMAX = 900. + TIMESTEPS%DTXY = 900. + TIMESTEPS%DTKTH = 900. + TIMESTEPS%DTMIN = 15. +/ + +! -------------------------------------------------------------------- ! +! Define the grid to preprocess via GRID_NML namelist +! -------------------------------------------------------------------- ! +&GRID_NML + GRID%NAME = 'HOMOGENEOUS SOURCE TERM TEST' + GRID%NML = '../input_capcha/namelists_CAPCHA.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 +! -------------------------------------------------------------------- ! +&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 +! -------------------------------------------------------------------- ! +&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_capcha/ww3_ounf.nml b/regtests/ww3_ts1/input_capcha/ww3_ounf.nml new file mode 100644 index 000000000..fb0f02d3e --- /dev/null +++ b/regtests/ww3_ts1/input_capcha/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 = '19680101 120000' + FIELD%TIMESTRIDE = '10' + FIELD%TIMECOUNT = '8000' + FIELD%LIST = 'DPT WND ICE HS MSS MSD FAW WCC WCF WCH WCM FOC TAW CHA FWS WBT' + 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_capcha/ww3_ounp_spec.nml b/regtests/ww3_ts1/input_capcha/ww3_ounp_spec.nml new file mode 100644 index 000000000..3e968f825 --- /dev/null +++ b/regtests/ww3_ts1/input_capcha/ww3_ounp_spec.nml @@ -0,0 +1,47 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III ww3_ounp.nml - Point output post-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the output fields to postprocess via POINT_NML namelist +! -------------------------------------------------------------------- ! +&POINT_NML + POINT%TIMESTART = '19680101 000000' + POINT%TIMESTRIDE = '3600.' + POINT%TIMECOUNT = '1000' + POINT%TIMESPLIT = 4 + POINT%BUFFER = 100 +/ + +! -------------------------------------------------------------------- ! +! 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_capcha/ww3_shel.nml b/regtests/ww3_ts1/input_capcha/ww3_shel.nml new file mode 100644 index 000000000..884a8ede5 --- /dev/null +++ b/regtests/ww3_ts1/input_capcha/ww3_shel.nml @@ -0,0 +1,78 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III ww3_shel.nml - single-grid model ! +! -------------------------------------------------------------------- ! + + +! -------------------------------------------------------------------- ! +! Define top-level model parameters via DOMAIN_NML namelist +! -------------------------------------------------------------------- ! +&DOMAIN_NML + DOMAIN%STOP = '19680607 120000' +/ + +! -------------------------------------------------------------------- ! +! 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 WND MSS MSD ICE HS MSS FAW WCC WCF WCH WCM FOC TAW CHA FWS WBT' + TYPE%POINT%FILE = '../input/points.list' +/ + +! -------------------------------------------------------------------- ! +! Define output dates via OUTPUT_DATE_NML namelist +! -------------------------------------------------------------------- ! +&OUTPUT_DATE_NML + DATE%FIELD = '19680606 000000' '3600' '19680618 000000' + DATE%POINT = '19680606 000000' '60' '19680618 000000' +/ + +! -------------------------------------------------------------------- ! +! Define homogeneous input via HOMOG_COUNT_NML and HOMOG_INPUT_NML namelist +! -------------------------------------------------------------------- ! +&HOMOG_COUNT_NML + !HOMOG_COUNT%N_CUR = 1 + HOMOG_COUNT%N_WND = 5 +/ + +&HOMOG_INPUT_NML + HOMOG_INPUT(1)%NAME = 'WND' + HOMOG_INPUT(2)%DATE = '19680606 000000' + HOMOG_INPUT(1)%VALUE1 = 5. + HOMOG_INPUT(1)%VALUE2 = 270. + HOMOG_INPUT(1)%VALUE3 = 0. + + HOMOG_INPUT(2)%NAME = 'WND' + HOMOG_INPUT(2)%DATE = '19680606 060000' + HOMOG_INPUT(2)%VALUE1 = 10. + HOMOG_INPUT(2)%VALUE2 = 270. + HOMOG_INPUT(2)%VALUE3 = 0. + + HOMOG_INPUT(3)%NAME = 'WND' + HOMOG_INPUT(3)%DATE = '19680606 180000' + HOMOG_INPUT(3)%VALUE1 = 30. + HOMOG_INPUT(3)%VALUE2 = 270. + HOMOG_INPUT(3)%VALUE3 = 0. + + HOMOG_INPUT(4)%NAME = 'WND' + HOMOG_INPUT(4)%DATE = '19680607 000000' + HOMOG_INPUT(4)%VALUE1 = 2. + HOMOG_INPUT(4)%VALUE2 = 270. + HOMOG_INPUT(4)%VALUE3 = 0. + + HOMOG_INPUT(5)%NAME = 'WND' + HOMOG_INPUT(5)%DATE = '19680607 120000' + HOMOG_INPUT(5)%VALUE1 = 0. + HOMOG_INPUT(5)%VALUE2 = 270. + HOMOG_INPUT(5)%VALUE3 = 0. +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_ts1/input_capcha/ww3_strt.inp b/regtests/ww3_ts1/input_capcha/ww3_strt.inp new file mode 100644 index 000000000..d18f7cebd --- /dev/null +++ b/regtests/ww3_ts1/input_capcha/ww3_strt.inp @@ -0,0 +1,7 @@ +$ WAVEWATCH III Initial conditions input file +$ ------------------------------------------- +$ 2 +$ 0.0 0.30 270. 3.3 0. 0. 0. 1. 0. 1. +$ 3 + 5 +$ From 629d27a3137929bbf91b19d212437606135f0d20 Mon Sep 17 00:00:00 2001 From: Jessica Meixner Date: Fri, 14 Jun 2024 13:45:39 -0400 Subject: [PATCH 25/30] Add option to use NetCDF output instead of binary for point output (#1230) --------- Co-authored-by: Edward Hartnett Co-authored-by: Matthew Masarik --- .github/workflows/regtest_gnu.yml | 133 +++ CMakeLists.txt | 8 +- model/bin/ww3_from_ftp.sh | 9 +- model/src/CMakeLists.txt | 5 +- model/src/cmake/switches.json | 10 + model/src/gx_outp.F90 | 12 + model/src/w3iopomd.F90 | 826 +++++++++++++++++- model/src/w3wavemd.F90 | 8 +- model/src/wmiopomd.F90 | 9 +- model/src/ww3_ounp.F90 | 22 +- model/src/ww3_outp.F90 | 17 +- regtests/bin/matrix.base | 1 + regtests/unittests/CMakeLists.txt | 11 +- regtests/unittests/test_io.F90 | 117 +++ regtests/unittests/test_io2.F90 | 123 +++ regtests/unittests/test_io3.F90 | 110 +++ regtests/unittests/test_io_points_bin.F90 | 71 -- regtests/unittests/test_io_restart_bin.F90 | 59 ++ regtests/unittests/ww3_unittest_util.F90 | 75 ++ .../ww3_tp2.2/input/switch_PR1_MPI_BIN2NC | 1 + regtests/ww3_ufs1.1/input_unstr/switch_PDLIB | 2 +- 21 files changed, 1528 insertions(+), 101 deletions(-) create mode 100644 .github/workflows/regtest_gnu.yml create mode 100644 regtests/unittests/test_io.F90 create mode 100644 regtests/unittests/test_io2.F90 create mode 100644 regtests/unittests/test_io3.F90 create mode 100644 regtests/unittests/test_io_restart_bin.F90 create mode 100644 regtests/unittests/ww3_unittest_util.F90 create mode 100644 regtests/ww3_tp2.2/input/switch_PR1_MPI_BIN2NC diff --git a/.github/workflows/regtest_gnu.yml b/.github/workflows/regtest_gnu.yml new file mode 100644 index 000000000..81d1317a3 --- /dev/null +++ b/.github/workflows/regtest_gnu.yml @@ -0,0 +1,133 @@ +name: regtest_gnu +on: [push, pull_request, workflow_dispatch] + +# Cancel in-progress workflows when pushing to a branch +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +env: + cache_key: gnu11-1 + CC: gcc-10 + FC: gfortran-10 + CXX: g++-10 + + +# Split into a steup step, and a WW3 build step which +# builds multiple switches in a matrix. The setup is run once and +# the environment is cached so each build of WW3 can share the dependencies. + +jobs: + setup: + runs-on: ubuntu-latest + + steps: + - name: checkout-ww3 + if: steps.cache-env.outputs.cache-hit != 'true' + uses: actions/checkout@v3 + with: + path: ww3 + # Cache spack, OASIS, and compiler + # No way to flush Action cache, so key may have # appended + - name: cache-env + id: cache-env + uses: actions/cache@v3 + with: + path: | + spack + ~/.spack + work_oasis3-mct + key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('ww3/model/ci/spack_gnu.yaml') }} + + # Build WW3 spack environment + - name: install-dependencies-with-spack + if: steps.cache-env.outputs.cache-hit != 'true' + run: | + # Install NetCDF, ESMF, g2, etc using Spack + sudo apt install cmake + git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git + source spack/share/spack/setup-env.sh + spack env create ww3-gnu ww3/model/ci/spack_gnu.yaml + spack env activate ww3-gnu + spack compiler find + spack external find cmake + spack add 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} + + regtest_gnu: + needs: setup + runs-on: ubuntu-latest + + steps: + - name: install-dependencies + run: | + sudo apt-get update + sudo apt-get install doxygen gcovr valgrind + + - name: checkout-ww3 + uses: actions/checkout@v3 + with: + path: ww3 + + - name: cache-env + id: cache-env + uses: actions/cache@v3 + with: + path: | + spack + ~/.spack + work_oasis3-mct + key: spack2-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('ww3/model/ci/spack_gnu.yaml') }} + + - name: build-ww3 + run: | + source spack/share/spack/setup-env.sh + spack env activate ww3-gnu + set -x + cd ww3 + export CC=mpicc + export FC=mpif90 + export OASISDIR=${GITHUB_WORKSPACE}/work_oasis3-mct +# mkdir build && cd build + export LD_LIBRARY_PATH="/home/runner/work/WW3/WW3/spack/var/spack/environments/ww3-gnu/.spack-env/view/:$LD_LIBRARY_PATH" +# cmake -DSWITCH=${GITHUB_WORKSPACE}/ww3/regtests/unittests/data/switch.io -DCMAKE_BUILD_TYPE=Debug .. +# make -j2 VERBOSE=1 + cd ${GITHUB_WORKSPACE}/ww3 + ls -l + ${GITHUB_WORKSPACE}/ww3/model/bin/ww3_from_ftp.sh -k + cd regtests + ./bin/run_cmake_test -o all -S -T -s PR1_MPI -w work_PR1_MPI -f -p mpirun -n 24 ../model ww3_tp2.5 + cd ww3_tp2.5 + ls -l + cd work_PR1_MPI + pwd + ls -l + ncdump -h out_pnt.ww3.nc > ncdump_out.txt + cat ncdump_out.txt + pwd + cat ${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.5/out_pnt_ncdump.txt + cmp ${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.5/out_pnt_ncdump.txt ncdump_out.txt + + - name: cache-data + id: cache-data + uses: actions/cache@v3 + with: + path: ww3/ww3_from_ftp.v7.14.1.tar.gz + key: ww3_from_ftp.v7.14.1 + + + diff --git a/CMakeLists.txt b/CMakeLists.txt index 5436f9cb1..b485488b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,7 +60,7 @@ endif() add_subdirectory(model) # Turn on unit testing. -include(CTest) -if(BUILD_TESTING) - add_subdirectory(regtests/unittests) -endif() +#include(CTest) +#if(BUILD_TESTING) +# add_subdirectory(regtests/unittests) +#endif() diff --git a/model/bin/ww3_from_ftp.sh b/model/bin/ww3_from_ftp.sh index 67efc9284..4ab231e54 100755 --- a/model/bin/ww3_from_ftp.sh +++ b/model/bin/ww3_from_ftp.sh @@ -61,11 +61,14 @@ fi #Move to top level directory of ww3: cd $ww3dir -#Download from ftp and uptar: -echo -e "Downloading and untaring file from ftp:" -wget --no-check-certificate https://ftp.emc.ncep.noaa.gov/static_files/public/WW3/ww3_from_ftp.${ww3ver}.tar.gz +#Download from ftp (if not already present) and uptar: +echo -e "Downloading (or finding) and untaring file from ftp:" +if ! test -f ww3_from_ftp.${ww3ver}.tar.gz; then + wget --no-check-certificate https://ftp.emc.ncep.noaa.gov/static_files/public/WW3/ww3_from_ftp.${ww3ver}.tar.gz +fi tar -xvzf ww3_from_ftp.${ww3ver}.tar.gz + #Move regtest info from data_regtests to regtests: echo -e "Moving data from data_regtests to regtests" cp -r data_regtests/ww3_tp2.18/input/*.nc regtests/ww3_tp2.18/input/ diff --git a/model/src/CMakeLists.txt b/model/src/CMakeLists.txt index 7dd7d82a2..4710576a5 100644 --- a/model/src/CMakeLists.txt +++ b/model/src/CMakeLists.txt @@ -174,10 +174,9 @@ if("SCRIP" IN_LIST switches) target_sources(ww3_lib PRIVATE ${scrip_src}) endif() - -if("SCRIPNC" IN_LIST switches OR "OASIS" IN_LIST switches OR "TRKNC" IN_LIST switches) +if("SCRIPNC" IN_LIST switches OR "OASIS" IN_LIST switches OR "TRKNC" IN_LIST switches OR "BIN2NC" IN_LIST switches) if(NOT NetCDF_Fortran_FOUND) - message(FATAL_ERROR "Cannot build SCRIPNC, OASIS, or TRKNC without NetCDF") + message(FATAL_ERROR "Cannot build SCRIPNC, OASIS, TRKNC, or BIN2NC without NetCDF") endif() endif() diff --git a/model/src/cmake/switches.json b/model/src/cmake/switches.json index 30eca480c..a7b9bc94f 100644 --- a/model/src/cmake/switches.json +++ b/model/src/cmake/switches.json @@ -814,6 +814,16 @@ } ] }, + { + "name": "bin2nc", + "num_switches": "upto1", + "description": "use netcdf instead of binary model output", + "valid-options": [ + { + "name": "BIN2NC" + } + ] + }, { "name": "ascii", "num_switches": "upto1", diff --git a/model/src/gx_outp.F90 b/model/src/gx_outp.F90 index d34fdbaa7..8dce5f4d0 100644 --- a/model/src/gx_outp.F90 +++ b/model/src/gx_outp.F90 @@ -165,7 +165,11 @@ PROGRAM GXOUTP #endif USE W3ODATMD, ONLY: W3SETO, W3NOUT USE W3IOGRMD, ONLY: W3IOGR +#ifdef W3_BIN2NC + USE W3IOPOMD, ONLY: W3IOPON +#else USE W3IOPOMD, ONLY: W3IOPO +#endif USE W3SERVMD, ONLY : ITRACE, NEXTLN, EXTCDE #ifdef W3_S USE W3SERVMD, ONLY : STRACE @@ -277,7 +281,11 @@ PROGRAM GXOUTP !--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! 3. Read general data and first fields from file ! +#ifdef W3_BIN2NC + CALL W3IOPON ( 'READ', NDSOP, IOTEST ) +#else CALL W3IOPO ( 'READ', NDSOP, IOTEST ) +#endif ALLOCATE ( FLREQ(NOPTS) ) ! WRITE (NDSO,930) @@ -369,7 +377,11 @@ PROGRAM GXOUTP DO DTEST = DSEC21 ( TIME , TOUT ) IF ( DTEST .GT. 0. ) THEN +#ifdef W3_BIN2NC + CALL W3IOPON ( 'READ', NDSOP, IOTEST ) +#else CALL W3IOPO ( 'READ', NDSOP, IOTEST ) +#endif IF ( IOTEST .EQ. -1 ) THEN WRITE (NDSO,998) EXIT diff --git a/model/src/w3iopomd.F90 b/model/src/w3iopomd.F90 index 0c15ea8c6..bbdfda34c 100644 --- a/model/src/w3iopomd.F90 +++ b/model/src/w3iopomd.F90 @@ -5,6 +5,7 @@ !> #include "w3macros.h" +#define nf90_err(ncerr) nf90_err_check(ncerr, __LINE__) !/ ------------------------------------------------------------------- / !> !> @brief Process point output. @@ -65,7 +66,7 @@ MODULE W3IOPOMD ! Name Type Scope Description ! ---------------------------------------------------------------- ! VEROPT C*10 Private Point output file version number. - ! IDSTR C*32 Private Point output file ID string. + ! IDSTR C*31 Private Point output file ID string. ! ---------------------------------------------------------------- ! ! 3. Subroutines and functions : @@ -118,6 +119,96 @@ MODULE W3IOPOMD CHARACTER(LEN=10), PARAMETER, PRIVATE :: VEROPT = '2021-04-06' CHARACTER(LEN=31), PARAMETER, PRIVATE :: & IDSTR = 'WAVEWATCH III POINT OUTPUT FILE' + + !> Dimension name for the netCDF point output file, for NOPTS, the + !> Number of Output Points. + character(*), parameter, private :: DNAME_NOPTS = 'NOPTS' + + !> Dimension name for the netCDF point output file, for NSPEC. + character(*), parameter, private :: DNAME_NSPEC = 'NSPEC' + + !> Dimension name for the netCDF point output file, for VSIZE. This + !> is for the vector size for points, which is 2. + character(*), parameter, private :: DNAME_VSIZE = 'VSIZE' + + !> Dimension name for the netCDF point output file, for + !> NAMELEN. This is the length of the PTNME strings, which contains + !> the names of the points. + character(*), parameter, private :: DNAME_NAMELEN = 'NAMELEN' + + !> Dimension name for the netCDF point output file, for GRDIDLEN, + !> this is the length of the GRDID character array. + character(*), parameter, private :: DNAME_GRDIDLEN = 'GRDIDLEN' + + !> Dimension name for the netCDF point output file, for TIME + character(*), parameter, private :: DNAME_TIME = 'TIME' + + !> Dimension name for the netCDF point output file, for WW3TIME + character(*), parameter, private :: DNAME_WW3TIME = 'WW3TIME' + + !> Variable name for the netCDF point output file, for NK. + character(*), parameter, private :: VNAME_NK = 'NK' + + !> Variable name for the netCDF point output file, for MTH. + character(*), parameter, private :: VNAME_NTH = 'NTH' + + !> Variable name for the netCDF point output file, for PTLOC. + character(*), parameter, private :: VNAME_PTLOC = 'PTLOC' + + !> Variable name for the netCDF point output file, for PTNME. + character(*), parameter, private :: VNAME_PTNME = 'PTNME' + + !> Variable name for the netCDF point output file, for TIME. + character(*), parameter, private :: VNAME_TIME = 'TIME' + + !> Variable name for the netCDF point output file, for WW3TIME. + character(*), parameter, private :: VNAME_WW3TIME = 'WW3TIME' + + !> Variable name for the netCDF point output file, for DPO. + character(*), parameter, private :: VNAME_DPO = 'DPO' + + !> Variable name for the netCDF point output file, for WAO. + character(*), parameter, private :: VNAME_WAO = 'WAO' + + !> Variable name for the netCDF point output file, for WDO. + character(*), parameter, private :: VNAME_WDO = 'WDO' + + !> Variable name for the netCDF point output file, for TAUAO. + character(*), parameter, private :: VNAME_TAUAO = 'TAUAO' + + !> Variable name for the netCDF point output file, for TAUDO. + character(*), parameter, private :: VNAME_TAUDO = 'TAUDO' + + !> Variable name for the netCDF point output file, for DAIRO. + character(*), parameter, private :: VNAME_DAIRO = 'DAIRO' + + !> Variable name for the netCDF point output file, for ZET_SETO. + character(*), parameter, private :: VNAME_ZET_SETO = 'ZET_SETO' + + !> Variable name for the netCDF point output file, for ASO. + character(*), parameter, private :: VNAME_ASO = 'ASO' + + !> Variable name for the netCDF point output file, for CAO. + character(*), parameter, private :: VNAME_CAO = 'CAO' + + !> Variable name for the netCDF point output file, for CDO. + character(*), parameter, private :: VNAME_CDO = 'CDO' + + !> Variable name for the netCDF point output file, for ICEO. + character(*), parameter, private :: VNAME_ICEO = 'ICEO' + + !> Variable name for the netCDF point output file, for ICEHO. + character(*), parameter, private :: VNAME_ICEHO = 'ICEHO' + + !> Variable name for the netCDF point output file, for ICEFO. + character(*), parameter, private :: VNAME_ICEFO = 'ICEFO' + + !> Variable name for the netCDF point output file, for GRDID. + character(*), parameter, private :: VNAME_GRDID = 'GRDID' + + !> Variable name for the netCDF point output file, for SPCO. + character(*), parameter, private :: VNAME_SPCO = 'SPCO' + !/ CONTAINS !/ ------------------------------------------------------------------- / @@ -1024,6 +1115,717 @@ SUBROUTINE W3IOPE ( A ) !/ END SUBROUTINE W3IOPE +#ifdef W3_BIN2NC + !> Handle netCDF return code. + !> + !> @param errcode NetCDF error code. 0 for no error. + !> + !> @author Edward Hartnett @date 1-Nov-2023 + !> + integer function nf90_err_check(errcode, ILINE) + USE NetCDF + USE W3ODATMD, ONLY: NDSE + implicit none + integer, intent(in) :: errcode, ILINE + + nf90_err_check = errcode + if(errcode /= nf90_noerr) then + WRITE(NDSE,*) ' *** WAVEWATCH III ERROR IN W3IOPO :' + WRITE(NDSE,*) ' LINE NUMBER ', ILINE + WRITE(NDSE,*) ' NETCDF ERROR MESSAGE: ' + WRITE(NDSE,*) 'Error: ', trim(nf90_strerror(errcode)) + return + endif + end function nf90_err_check + + !> Read point output in netCDF format. + !> + !> @param[out] IOTST Test indictor for reading. + !> @param[in] IMOD_IN Model number for W3GDAT etc. + !> @param[in] filename Name of file to read. + !> @param[inout] ncerr Error code, 0 for success, netCDF error code + !> otherwise. + !> + !> @author Edward Hartnett @date 1-Nov-2023 + !> + SUBROUTINE W3IOPON_READ(IOTST, IMOD_IN, filename, ncerr) + USE NetCDF + USE W3ODATMD, ONLY: W3DMO2 + USE W3WDATMD, ONLY: TIME + USE W3GDATMD, ONLY: NTH, NK, NSPEC, FILEXT + USE W3ODATMD, ONLY: NDST, NDSE, IPASS => IPASS2, NOPTS, IPTINT, & + IL, IW, II, PTLOC, PTIFAC, DPO, WAO, WDO, & + ASO, CAO, CDO, SPCO, PTNME, O2INIT, FNMPRE, & + GRDID, ICEO, ICEHO, ICEFO, W3DMO2 + USE W3SERVMD, ONLY: EXTCDE +#ifdef W3_FLX5 + USE W3ODATMD, ONLY: TAUAO, TAUDO, DAIRO +#endif +#ifdef W3_SETUP + USE W3ODATMD, ONLY: ZET_SETO +#endif + IMPLICIT NONE + + INTEGER, INTENT(OUT) :: IOTST + INTEGER, INTENT(IN), OPTIONAL :: IMOD_IN + character(*), intent(in) :: filename + integer, intent(inout) :: ncerr + INTEGER :: IGRD,MK,MTH + integer :: fh + integer :: d_nopts, d_nspec, d_vsize, d_namelen, d_grdidlen, d_time, d_ww3time + integer :: d_nopts_len, d_nspec_len, d_vsize_len, d_namelen_len, d_grdidlen_len, d_time_len, d_ww3time_len + integer :: v_idtst, v_vertst, v_nk, v_nth, v_ptloc, v_ptnme, v_time, v_ww3time + integer :: v_dpo, v_wao, v_wdo +#ifdef W3_FLX5 + integer :: v_tauao,v_taudo, v_dairo +#endif +#ifdef W3_SETUP + integer :: v_zet_seto +#endif + integer :: v_aso, v_cao, v_cdo, v_iceo + integer :: v_iceho, v_icefo, v_grdid, v_spco + integer :: v_title_len, v_version_len + CHARACTER(LEN=31) :: IDTST + CHARACTER(LEN=10) :: VERTST + + IOTST = 0 + + IF (PRESENT(IMOD_IN)) THEN + IGRD = IMOD_IN + ELSE + IGRD = 1 + END IF + + ! Open the netCDF file. + ncerr = nf90_open(filename, NF90_NOWRITE, fh) + if (nf90_err(ncerr) .ne. 0) return + + ! Read and check the version: + ncerr = nf90_inquire_attribute(fh, NF90_GLOBAL, 'title', len = v_title_len) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_get_att(fh, NF90_GLOBAL, 'title', IDTST) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inquire_attribute(fh, NF90_GLOBAL, 'version', len = v_version_len) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_get_att(fh, NF90_GLOBAL, 'version', VERTST) + if (nf90_err(ncerr) .ne. 0) return + + IF ( IDTST .NE. IDSTR ) THEN + WRITE (NDSE,902) IDTST, IDSTR + CALL EXTCDE ( 10 ) + END IF + IF ( VERTST .NE. VEROPT ) THEN + WRITE (NDSE,903) VERTST, VEROPT + CALL EXTCDE ( 11 ) + END IF + + ! Read the dimension information for NOPTS. + ncerr = nf90_inq_dimid(fh, DNAME_NOPTS, d_nopts) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inquire_dimension(fh, d_nopts, len = d_nopts_len) + if (nf90_err(ncerr) .ne. 0) return + NOPTS=d_nopts_len + + ! Read the dimension information for NSPEC. + ncerr = nf90_inq_dimid(fh, DNAME_NSPEC, d_nspec) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inquire_dimension(fh, d_nspec, len = d_nspec_len) + if (nf90_err(ncerr) .ne. 0) return + + ! Read the dimension information for VSIZE. + ncerr = nf90_inq_dimid(fh, DNAME_VSIZE, d_vsize) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inquire_dimension(fh, d_vsize, len = d_vsize_len) + if (nf90_err(ncerr) .ne. 0) return + + ! Read the dimension information for NAMELEN. + ncerr = nf90_inq_dimid(fh, DNAME_NAMELEN, d_namelen) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inquire_dimension(fh, d_namelen, len = d_namelen_len) + if (nf90_err(ncerr) .ne. 0) return + + ! Read the dimension information for GRDIDLEN. + ncerr = nf90_inq_dimid(fh, DNAME_GRDIDLEN, d_grdidlen) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inquire_dimension(fh, d_grdidlen, len = d_grdidlen_len) + if (nf90_err(ncerr) .ne. 0) return + + ! Read the dimention information from time + ncerr = nf90_inq_dimid(fh, DNAME_TIME, d_time) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inquire_dimension(fh, d_time, len = d_time_len) + if (nf90_err(ncerr) .ne. 0) return + + IF ( IPASS .LE. d_time_len ) THEN + + IF ( IPASS.EQ.1 ) THEN + + ! Read scalar variables. + ncerr = nf90_inq_varid(fh, VNAME_NK, v_nk) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_get_var(fh, v_nk, MK) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inq_varid(fh, VNAME_NTH, v_nth) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_get_var(fh, v_nth, MTH) + if (nf90_err(ncerr) .ne. 0) return + + !read in written variables NK, NTH as MK and MTH + !and ensure they match + IF (NK.NE.MK .OR. NTH.NE.MTH) THEN + WRITE (NDSE,904) MK, MTH, NK, NTH + CALL EXTCDE ( 12 ) + END IF + + ! Allocate variables: + IF ( .NOT. O2INIT ) & + CALL W3DMO2 ( IGRD, NDSE, NDST, NOPTS ) + + ! Read vars with nopts as a dimension. + ncerr = nf90_inq_varid(fh, VNAME_PTLOC, v_ptloc) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_get_var(fh, v_ptloc, PTLOC, start = (/ 1, 1/), & + count = (/ d_vsize_len, d_nopts_len /)) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inq_varid(fh, VNAME_PTNME, v_ptnme) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_get_var(fh, v_ptnme, PTNME) + if (nf90_err(ncerr) .ne. 0) return + END IF + + !Variables read based on time (IPASS): + + ncerr = nf90_inq_varid(fh, VNAME_WW3TIME, v_ww3time) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_get_var(fh, v_ww3time, TIME, start = (/ 1, IPASS/), & + count = (/ d_vsize_len, 1 /)) + if (nf90_err(ncerr) .ne. 0) return + + ! set IW, II and IL to 0, + ! These values are set to 0 in binary file and have been removed + ! from netcdf file. Possible can be completely removed. + IW = 0 + II = 0 + IL = 0 + + ncerr = nf90_inq_varid(fh, VNAME_DPO, v_dpo) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_get_var(fh, v_dpo, DPO, start = (/ 1, IPASS/), & + count = (/ NOPTS, 1 /)) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inq_varid(fh, VNAME_WAO, v_wao) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_get_var(fh, v_wao, WAO, start = (/ 1, IPASS/), & + count = (/ NOPTS, 1 /)) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inq_varid(fh, VNAME_WDO, v_wdo) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_get_var(fh, v_wdo, WDO, start = (/ 1, IPASS/), & + count = (/ NOPTS, 1 /)) + if (nf90_err(ncerr) .ne. 0) return +#ifdef W3_FLX5 + ncerr = nf90_inq_varid(fh, VNAME_TAUAO, v_tauao) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_get_var(fh, v_tauao, TAUAO, start = (/ 1, IPASS/), & + count = (/ NOPTS, 1 /)) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inq_varid(fh, VNAME_TAUDO, v_taudo) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_get_var(fh, v_taudo, TAUDO, start = (/ 1, IPASS/), & + count = (/ NOPTS, 1 /)) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inq_varid(fh, VNAME_DAIRO, v_dairo) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_get_var(fh, v_dairo, DAIRO, start = (/ 1, IPASS/), & + count = (/ NOPTS, 1 /)) + if (nf90_err(ncerr) .ne. 0) return +#endif +#ifdef W3_SETUP + ncerr = nf90_inq_varid(fh, ZET_SETO, v_zet_seto) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_get_var(fh, v_zet_seto, ZET_SETO, start = (/ 1, IPASS/), & + count = (/ NOPTS, 1 /)) + if (nf90_err(ncerr) .ne. 0) return +#endif + ncerr = nf90_inq_varid(fh, VNAME_ASO, v_aso) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_get_var(fh, v_aso, ASO, start = (/ 1, IPASS/), & + count = (/ NOPTS, 1 /)) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inq_varid(fh, VNAME_CAO, v_cao) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_get_var(fh, v_cao, CAO, start = (/ 1, IPASS/), & + count = (/ NOPTS, 1 /)) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inq_varid(fh, VNAME_CDO, v_cdo) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_get_var(fh, v_cdo, CDO, start = (/ 1, IPASS/), & + count = (/ NOPTS, 1 /)) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inq_varid(fh, VNAME_ICEO, v_iceo) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_get_var(fh, v_iceo, ICEO, start = (/ 1, IPASS/), & + count = (/ NOPTS, 1 /)) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inq_varid(fh, VNAME_ICEHO, v_iceho) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_get_var(fh, v_iceho, ICEHO, start = (/ 1, IPASS/), & + count = (/ NOPTS, 1 /)) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inq_varid(fh, VNAME_ICEFO, v_icefo) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_get_var(fh, v_icefo, ICEFO, start = (/ 1, IPASS/), & + count = (/ NOPTS, 1 /)) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inq_varid(fh, VNAME_GRDID, v_grdid) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_get_var(fh, v_grdid, GRDID, start = (/ 1, 1, IPASS/), & + count = (/ 13, nopts, 1 /)) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inq_varid(fh, VNAME_SPCO, v_spco) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_get_var(fh, v_spco, SPCO, start = (/ 1, 1, IPASS/), & + count = (/nspec, nopts, 1 /)) + if (nf90_err(ncerr) .ne. 0) return + + ELSE + ! Set flag to indicate IPASS > d_time_len + ! and are at the end of the + IOTST = -1 + END IF + + ! Close the file. + ncerr = nf90_close(fh) + if (nf90_err(ncerr) .ne. 0) return + +902 FORMAT (/' *** WAVEWATCH III ERROR IN W3IOPON :'/ & + ' ILEGAL IDSTR, READ : ',A/ & + ' CHECK : ',A/) +903 FORMAT (/' *** WAVEWATCH III ERROR IN W3IOPON :'/ & + ' ILEGAL VEROPT, READ : ',A/ & + ' CHECK : ',A/) +904 FORMAT (/' *** WAVEWATCH III ERROR IN W3IOPO :'/ & + ' ERROR IN SPECTRA, MK, MTH : ',2I8/ & + ' ARRAY DIMENSIONS : ',2I8/) + + + END SUBROUTINE W3IOPON_READ + + !/ ------------------------------------------------------------------- / + !> + !> @brief Write point output in netCDF format. + !> + !> @param[in] filename Name of file to write. + !> @param[in] timestep_only Will be 0 if whole model run should be + !> written, 1 if only one timestep should be written. + !> @param[inout] ncerr Error code, 0 for success, netCDF error code + !> otherwise. + !> + !> @author Edward Hartnett @date 1-Nov-2023 + !> + SUBROUTINE W3IOPON_WRITE(timestep_only,filename, ncerr) + USE NETCDF + USE W3GDATMD, ONLY: NTH, NK, NSPEC + USE W3WDATMD, ONLY: TIME + USE W3ODATMD, ONLY: NDST, NDSE, IPASS => IPASS2, NOPTS, IPTINT, & + PTLOC, PTIFAC, DPO, WAO, WDO, & + ASO, CAO, CDO, SPCO, PTNME, O2INIT, FNMPRE, & + GRDID, ICEO, ICEHO, ICEFO + USE W3TIMEMD, ONLY: CALTYPE, T2D, U2D, TSUB +#ifdef W3_FLX5 + USE W3ODATMD, ONLY: TAUAO, TAUDO, DAIRO +#endif +#ifdef W3_SETUP + USE W3ODATMD, ONLY: ZET_SETO +#endif + + IMPLICIT NONE + integer, intent(in) :: timestep_only ! 1 if only timestep should be written. + character(*), intent(in) :: filename + integer, intent(inout) :: ncerr + integer :: ndim, nvar, fmt, itime, fh + integer :: d_nopts, d_nspec, d_vsize, d_namelen, d_grdidlen, d_time + integer :: v_idtst, v_vertst, v_nk, v_nth, v_ptloc, v_ptnme, v_time, v_ww3time + integer :: v_dpo, v_wao, v_wdo +#ifdef W3_FLX5 + integer :: v_tauao, v_taudo, v_dairo +#endif +#ifdef W3_SETUP + integer :: v_zet_seto +#endif + integer :: v_aso, v_cao, v_cdo, v_iceo + integer :: v_iceho, v_icefo, v_grdid, v_spco + integer :: curdate(8), refdate(8),ierr + double precision :: outjulday + + !If first pass, or if you are writting a file for every time-step: + IF ( IPASS.EQ.1 .OR. timestep_only.EQ.1 ) THEN + ! Create the netCDF file. + ncerr = nf90_create(filename, NF90_NETCDF4, fh) + if (nf90_err(ncerr) .ne. 0) return + + ! Define dimensions. + ncerr = nf90_def_dim(fh, DNAME_NOPTS, NOPTS, d_nopts) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_def_dim(fh, DNAME_NSPEC, NSPEC, d_nspec) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_def_dim(fh, DNAME_VSIZE, 2, d_vsize) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_def_dim(fh, DNAME_NAMELEN, 40, d_namelen) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_def_dim(fh, DNAME_GRDIDLEN, 13, d_grdidlen) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_def_dim(fh, DNAME_TIME, NF90_UNLIMITED, d_time) + if (nf90_err(ncerr) .ne. 0) return + + ! Define global attributes. + ncerr = nf90_put_att(fh, NF90_GLOBAL, 'title', IDSTR) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_put_att(fh, NF90_GLOBAL, 'version', VEROPT) + if (nf90_err(ncerr) .ne. 0) return + + ! Define scalar variables. + ncerr = nf90_def_var(fh, VNAME_NK, NF90_INT, v_nk) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_def_var(fh, VNAME_NTH, NF90_INT, v_nth) + if (nf90_err(ncerr) .ne. 0) return + + ! Define vars with nopts as a dimension. Point location and name + ncerr = nf90_def_var(fh, VNAME_PTLOC, NF90_FLOAT, (/d_vsize, d_nopts/), v_ptloc) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_def_var(fh, VNAME_PTNME, NF90_CHAR, (/d_namelen, d_nopts/), v_ptnme) + if (nf90_err(ncerr) .ne. 0) return + + ! Define time for each time step + ncerr = nf90_def_var(fh, VNAME_WW3TIME, NF90_INT, (/d_vsize, d_time/),v_ww3time) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_def_var(fh, VNAME_TIME, NF90_DOUBLE, (/d_time/),v_time) + if (nf90_err(ncerr) .ne. 0) return + SELECT CASE (TRIM(CALTYPE)) + CASE ('360_day') + ncerr = nf90_put_att(fh, v_time, 'long_name', 'time in 360 day calendar') + if (nf90_err(ncerr) .ne. 0) return + CASE ('365_day') + ncerr = nf90_put_att(fh, v_time, 'long_name', 'time in 365 day calendar') + if (nf90_err(ncerr) .ne. 0) return + CASE ('standard') + ncerr = nf90_put_att(fh, V_TIME, 'long_name', 'Julian day (UT)') + if (nf90_err(ncerr) .ne. 0) return + END SELECT + ncerr = nf90_put_att(fh, V_TIME, 'standard_name', 'time') + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_put_att(fh, V_TIME, 'units', 'days since 1990-01-01 00:00:00') + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_put_att(fh, V_TIME, 'conventions','Relative Julian days with decimal part (as parts of the day)') + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_put_att(fh, V_TIME, 'axis', 'T') + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_put_att(fh, V_TIME, 'calendar', TRIM(CALTYPE)) + if (nf90_err(ncerr) .ne. 0) return + + ! Define vars with nopts and time as dimensions + ncerr = nf90_def_var(fh, VNAME_DPO, NF90_FLOAT, (/d_nopts, d_time/), v_dpo) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_def_var(fh, VNAME_WAO, NF90_FLOAT, (/d_nopts, d_time/), v_wao) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_def_var(fh, VNAME_WDO, NF90_FLOAT, (/d_nopts, d_time/), v_wdo) + if (nf90_err(ncerr) .ne. 0) return +#ifdef W3_FLX5 + ncerr = nf90_def_var(fh, VNAME_TAUAO, NF90_FLOAT, (/d_nopts, d_time/), v_tauao) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_def_var(fh, VNAME_TAUDO, NF90_FLOAT, (/d_nopts, d_time/), v_taudo) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_def_var(fh, VNAME_DAIRO, NF90_FLOAT, (/d_nopts, d_time/), v_dairo) + if (nf90_err(ncerr) .ne. 0) return +#endif +#ifdef W3_SETUP + ncerr = nf90_def_var(fh, VNAME_ZET_SETO, NF90_FLOAT, (/d_nopts, d_time/), v_zet_seto) + if (nf90_err(ncerr) .ne. 0) return +#endif + ncerr = nf90_def_var(fh, VNAME_ASO, NF90_FLOAT, (/d_nopts, d_time/), v_aso) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_def_var(fh, VNAME_CAO, NF90_FLOAT, (/d_nopts, d_time/), v_cao) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_def_var(fh, VNAME_CDO, NF90_FLOAT, (/d_nopts, d_time/), v_cdo) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_def_var(fh, VNAME_ICEO, NF90_FLOAT, (/d_nopts, d_time/), v_iceo) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_def_var(fh, VNAME_ICEHO, NF90_FLOAT, (/d_nopts, d_time/), v_iceho) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_def_var(fh, VNAME_ICEFO, NF90_FLOAT, (/d_nopts, d_time/), v_icefo) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_def_var(fh, VNAME_GRDID, NF90_CHAR, (/d_grdidlen, d_nopts, d_time/), v_grdid) + if (nf90_err(ncerr) .ne. 0) return + + ! Define spectral output with dimensions nspec, nopts and time + ncerr = nf90_def_var(fh, VNAME_SPCO, NF90_FLOAT, (/d_nspec, d_nopts, d_time/), v_spco) + if (nf90_err(ncerr) .ne. 0) return + + ! End of all variable definitions + ncerr = nf90_enddef(fh) + if (nf90_err(ncerr) .ne. 0) return + + ! Write the scalar data. + ncerr = nf90_put_var(fh, v_nk, NK) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_put_var(fh, v_nth, NTH) + if (nf90_err(ncerr) .ne. 0) return + + ! Write the data with NOPTS as a dimension. (no time dimension) + if (associated(PTLOC)) then + ncerr = nf90_put_var(fh, v_ptloc, PTLOC(:,1:NOPTS)) + if (nf90_err(ncerr) .ne. 0) return + endif + if (associated(PTNME)) then + ncerr = nf90_put_var(fh, v_ptnme, PTNME(1:NOPTS)) + if (nf90_err(ncerr) .ne. 0) return + endif + + ELSE + ! If we are writing to the same file, re-open the file + ncerr = nf90_open(filename, nf90_write, fh) + if (nf90_err(ncerr) .ne. 0) return + END IF + + !Determine the start for the time dimension + IF ( timestep_only.EQ.1 ) THEN + itime=1 + ELSE + itime=IPASS + END IF + + ! Write Time + IF ( itime > 1 ) THEN + ncerr = nf90_inq_varid(fh, VNAME_WW3TIME, v_ww3time) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inq_varid(fh, VNAME_TIME, v_time) + if (nf90_err(ncerr) .ne. 0) return + END IF + ncerr = nf90_put_var(fh, v_ww3time, TIME, start = (/ 1, itime/), & + count = (/ 2, 1 /)) + if (nf90_err(ncerr) .ne. 0) return + + CALL U2D('days since 1990-01-01 00:00:00',REFDATE,IERR) + CALL T2D(TIME,CURDATE,IERR) + outjulday=TSUB(REFDATE,CURDATE) + + ncerr = nf90_put_var(fh, v_time, outjulday, start = (/itime/)) + if (nf90_err(ncerr) .ne. 0) return + + + ! If itime > 1 need to inquire varid + IF ( itime > 1 ) THEN + ncerr = nf90_inq_varid(fh, VNAME_DPO, v_dpo) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inq_varid(fh, VNAME_WAO, v_wao) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inq_varid(fh, VNAME_WDO, v_wdo) + if (nf90_err(ncerr) .ne. 0) return +#ifdef W3_FLX5 + ncerr = nf90_inq_varid(fh, VNAME_TAUAO, v_tauao) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inq_varid(fh, VNAME_TAUDO, v_taudo) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inq_varid(fh, VNAME_DAIRO, v_dairo) + if (nf90_err(ncerr) .ne. 0) return +#endif +#ifdef W3_SETUP + ncerr = nf90_inq_varid(fh, VNAME_ZET_SETO, v_zet_seto) + if (nf90_err(ncerr) .ne. 0) return +#endif + ncerr = nf90_inq_varid(fh, VNAME_ASO, v_aso) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inq_varid(fh, VNAME_CAO, v_cao) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inq_varid(fh, VNAME_CDO, v_cdo) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inq_varid(fh, VNAME_ICEO, v_iceo) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inq_varid(fh, VNAME_ICEHO, v_iceho) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inq_varid(fh, VNAME_ICEFO, v_icefo) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inq_varid(fh, VNAME_GRDID, v_grdid) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inq_varid(fh, VNAME_SPCO, v_spco) + if (nf90_err(ncerr) .ne. 0) return + END IF + + ncerr = nf90_put_var(fh, v_dpo, DPO, start = (/ 1, itime/), & + count = (/ nopts, 1 /)) + if (nf90_err(ncerr) .ne. 0) return + + ncerr = nf90_put_var(fh, v_wao, WAO, start = (/ 1, itime/), & + count = (/ nopts, 1 /)) + if (nf90_err(ncerr) .ne. 0) return + + ncerr = nf90_put_var(fh, v_wdo, WDO, start = (/ 1, itime/), & + count = (/ nopts, 1 /)) + if (nf90_err(ncerr) .ne. 0) return + +#ifdef W3_FLX5 + ncerr = nf90_put_var(fh, v_tauao, TAUAO, start = (/ 1, itime/), & + count = (/ nopts, 1 /)) + if (nf90_err(ncerr) .ne. 0) return + + ncerr = nf90_put_var(fh, v_taudo, TAUDO, start = (/ 1, itime/), & + count = (/ nopts, 1 /)) + if (nf90_err(ncerr) .ne. 0) return + + ncerr = nf90_put_var(fh, v_dairo, DAIRO, start = (/ 1, itime/), & + count = (/ nopts, 1 /)) + if (nf90_err(ncerr) .ne. 0) return +#endif +#ifdef W3_SETUP + ncerr = nf90_put_var(fh, v_zet_seto, ZET_SETO, start = (/ 1, itime/), & + count = (/ nopts, 1 /)) + if (nf90_err(ncerr) .ne. 0) return +#endif + ncerr = nf90_put_var(fh, v_aso, ASO, start = (/ 1, itime/), & + count = (/ nopts, 1 /)) + if (nf90_err(ncerr) .ne. 0) return + + ncerr = nf90_put_var(fh, v_cao, CAO, start = (/ 1, itime/), & + count = (/ nopts, 1 /)) + if (nf90_err(ncerr) .ne. 0) return + + ncerr = nf90_put_var(fh, v_cdo, CDO, start = (/ 1, itime/), & + count = (/ nopts, 1 /)) + if (nf90_err(ncerr) .ne. 0) return + + ncerr = nf90_put_var(fh, v_iceo, ICEO, start = (/ 1, itime/), & + count = (/ nopts, 1 /)) + if (nf90_err(ncerr) .ne. 0) return + + ncerr = nf90_put_var(fh, v_iceho, ICEHO, start = (/ 1, itime/), & + count = (/ nopts, 1 /)) + if (nf90_err(ncerr) .ne. 0) return + + ncerr = nf90_put_var(fh, v_icefo, ICEFO, start = (/ 1, itime/), & + count = (/ nopts, 1 /)) + if (nf90_err(ncerr) .ne. 0) return + + ncerr = nf90_put_var(fh, v_grdid, GRDID, start = (/ 1, 1, itime/), & + count = (/ 13, nopts, 1 /)) + if (nf90_err(ncerr) .ne. 0) return + + !write spectral output + ncerr = nf90_put_var(fh, v_spco, SPCO, start = (/ 1, 1, itime/), & + count = (/nspec, nopts, 1 /)) + if (nf90_err(ncerr) .ne. 0) return + + ! Close the file. + ncerr = nf90_close(fh) + if (nf90_err(ncerr) .ne. 0) return + + END SUBROUTINE W3IOPON_WRITE + + !> Read or write the netCDF point output file, + !> depending on the value of the first parameter. + !> + !> When reading, the entire file is read with one call to this + !> subroutine. + !> + !> 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. + !> + !> @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. + !> + !> @author Edward Hartnett @date 1-Nov-2023 + SUBROUTINE W3IOPON ( INXOUT, NDSOP, IOTST, IMOD) + USE W3GDATMD, ONLY: W3SETG + USE W3WDATMD, ONLY: W3SETW + USE W3ODATMD, ONLY: W3SETO + USE W3GDATMD, ONLY: FILEXT + USE W3WDATMD, ONLY: TIME + USE W3ODATMD, ONLY: NDST, NDSE, IPASS => IPASS2, FNMPRE + USE W3ODATMD, ONLY: OFILES + USE W3SERVMD, ONLY: EXTCDE +#ifdef W3_S + USE W3SERVMD, ONLY: STRACE +#endif + use netcdf + IMPLICIT NONE + + CHARACTER, INTENT(IN) :: INXOUT*(*) + INTEGER, INTENT(IN) :: NDSOP + INTEGER, INTENT(OUT) :: IOTST + INTEGER, INTENT(IN), OPTIONAL :: IMOD + + CHARACTER(LEN=15) :: TIMETAG + INTEGER :: IGRD + character(len = 124) :: filename + integer :: ncerr + +#ifdef W3_S + CALL STRACE (IENT, 'W3IOPON') +#endif + + ! IPASS essentially is the time variable dimension + IPASS = IPASS + 1 + + ! Optimistically assume success. + IOTST = 0 + + ! Has a model number been specified? + IF (PRESENT(IMOD)) THEN + IGRD = IMOD + ELSE + IGRD = 1 + END IF + + CALL W3SETO(IGRD, NDSE, NDST) + CALL W3SETG(IGRD, NDSE, NDST) + CALL W3SETW(IGRD, NDSE, NDST) + + ! INXOUT must be 'READ' or 'WRITE'. + IF (INXOUT .NE. 'READ' .AND. INXOUT .NE. 'WRITE') THEN + WRITE (NDSE, 900) INXOUT + CALL EXTCDE(1) + END IF + + ! Determine filename. + IF ( OFILES(2) .EQ. 1 ) THEN + ! Create TIMETAG for file name using YYYYMMDD.HHMMS prefix + WRITE(TIMETAG,"(i8.8,'.'i6.6)")TIME(1),TIME(2) + filename = FNMPRE(:LEN_TRIM(FNMPRE))//TIMETAG//'.out_pnt.'//FILEXT(:LEN_TRIM(FILEXT))//'.nc' + ELSE + filename = FNMPRE(:LEN_TRIM(FNMPRE))//'out_pnt.'//FILEXT(:LEN_TRIM(FILEXT))//'.nc' + END IF + + ! Do a read or a write of the point file. + IF (INXOUT .EQ. 'READ') THEN + CALL W3IOPON_READ(IOTST, IMOD, filename, ncerr) + ELSE + CALL W3IOPON_WRITE(OFILES(2), filename, ncerr) + ENDIF + if (nf90_err(ncerr) .ne. 0) then + WRITE(NDSE,*) ' *** WAVEWATCH III ERROR IN W3IOPO :' + WRITE(NDSE,*) 'Nonzero return at end of W3IOPON' + WRITE(NDSE,*) 'Error: ', trim(nf90_strerror(ncerr)) + CALL EXTCDE(21) + endif + + !/ + !/ End of W3IOPON ----------------------------------------------------- / + !/ + +900 FORMAT (/' *** WAVEWATCH III ERROR IN W3IOPO :'/ & + ' ILEGAL INXOUT VALUE: ',A/) + END SUBROUTINE W3IOPON +#endif + !/ ------------------------------------------------------------------- / !> Read or write point output. !> !> This subroutine can either read or write the point output file, @@ -1045,12 +1847,12 @@ END SUBROUTINE W3IOPE !> -------------|------|----------|-------- !> 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 | NK | Number of discrete wavenumbers + !> 4 | integer | NTH | Number of discrete directions. !> 4 | integer | NOPTS | Number of output points. - !> 8*NOPTS | integer(2,NOPTS) | PTLOC | Point locations + !> 8*NOPTS | real(2,NOPTS) | PTLOC | Point locations !> 7*NOPTS | character*7 | PTNME | Point names - !> 8 | integer(2) | TIME | Time + !> 8 | integer(2) | TIME | Valid time !> reclen*NOPTS | * | * | records !> !> Each record contains: @@ -1088,7 +1890,9 @@ END SUBROUTINE W3IOPE !> !> @param[in] INXOUT String indicating read/write. Must be 'READ' or !> 'WRITE'. - !> @param[in] NDSOP File unit number. + !> @param[in] NDSOP This is set by this subroutine to the netCDF + !> file ID (ncid) of the opened file. User does not have to + !> initialize this value, and should not change it. !> @param[out] IOTST Error code: !> - 0 No error. !> - -1 Unexpected end of file when reading. @@ -1254,7 +2058,7 @@ SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD & CALL EXTCDE ( 1 ) END IF ! - ! IF ( IPASS.EQ.1 ) THEN + ! First pass to this file and we are only writing 1 file for all time IF ( IPASS.EQ.1 .AND. OFILES(2) .EQ. 0) THEN WRITE = INXOUT.EQ.'WRITE' ELSE @@ -1267,10 +2071,10 @@ SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD & ! open file ---------------------------------------------------------- * ! IF ( IPASS.EQ.1 .AND. OFILES(2) .EQ. 0 ) THEN - ! + I = LEN_TRIM(FILEXT) J = LEN_TRIM(FNMPRE) - ! + #ifdef W3_T WRITE (NDST,9001) FNMPRE(:J)//'out_pnt.'//FILEXT(:I) #endif @@ -1389,7 +2193,7 @@ SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD & ! IF ( WRITE ) THEN WRITE (NDSOP) & - IDSTR, VEROPT, NK, NTH, NOPTS + IDSTR, VEROPT, NK, NTH, NOPTS #ifdef W3_ASCII WRITE (NDSOA,*) & 'IDSTR, VEROPT, NK, NTH, NOPTS:', & @@ -1495,7 +2299,7 @@ SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD & #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):', & ICEFO(I), GRDID(I), (SPCO(J,I),J=1,NSPEC) #endif ELSE diff --git a/model/src/w3wavemd.F90 b/model/src/w3wavemd.F90 index c144ab8d8..6db2f03af 100644 --- a/model/src/w3wavemd.F90 +++ b/model/src/w3wavemd.F90 @@ -2601,12 +2601,16 @@ SUBROUTINE W3WAVE ( IMOD, ODAT, TEND, STAMP, NO_OUT & ! Gets the necessary spectral data ! CALL W3IOPE ( VA ) - CALL W3IOPO ( 'WRITE', NDS(8), ITEST, IMOD & +#ifdef W3_BIN2NC + CALL W3IOPON ( 'WRITE', NDS(8), ITEST, IMOD ) +#else + CALL W3IOPO ( 'WRITE', NDS(8), ITEST, IMOD & #ifdef W3_ASCII ,NDS(15) & #endif ) - END IF +#endif + END IF ! ELSE IF ( J .EQ. 3 ) THEN ! diff --git a/model/src/wmiopomd.F90 b/model/src/wmiopomd.F90 index 73e036535..bce460483 100644 --- a/model/src/wmiopomd.F90 +++ b/model/src/wmiopomd.F90 @@ -714,8 +714,7 @@ SUBROUTINE WMIOPO ( TOUT ) USE W3ODATMD, ONLY: W3SETO USE WMMDATMD, ONLY: WMSETM USE W3CSPCMD, ONLY: W3CSPC - USE W3IOPOMD, ONLY: W3IOPO - ! + USE W3IOPOMD USE W3GDATMD, ONLY: NK, NTH, NSPEC, XFR, FR1, TH, SGRDS USE W3WDATMD, ONLY: TIME USE W3ODATMD, ONLY: IAPROC, NAPROC, NAPPNT, NOPTS, SPCO, DPO, & @@ -1176,11 +1175,15 @@ SUBROUTINE WMIOPO ( TOUT ) ! TIME = TOUT ! +#ifdef W3_BIN2NC + CALL W3IOPON ( 'WRITE', MDSUP, II, 0) +#else CALL W3IOPO ( 'WRITE', MDSUP, II, 0 & #ifdef W3_ASCII - ,MDSUPA & + ,MDSUPA & #endif ) +#endif ! RETURN ! diff --git a/model/src/ww3_ounp.F90 b/model/src/ww3_ounp.F90 index c35ff6e98..a1533c73b 100644 --- a/model/src/ww3_ounp.F90 +++ b/model/src/ww3_ounp.F90 @@ -184,7 +184,7 @@ PROGRAM W3OUNP USE W3ODATMD, ONLY: W3SETO, W3NOUT USE W3ODATMD, ONLY: IAPROC, NAPROC, NAPERR, NAPOUT, DIMP USE W3IOGRMD, ONLY: W3IOGR - USE W3IOPOMD, ONLY: W3IOPO + USE W3IOPOMD USE W3SERVMD, ONLY : ITRACE, NEXTLN, EXTCDE, STRSPLIT #ifdef W3_S USE W3SERVMD, ONLY : STRACE @@ -387,7 +387,11 @@ PROGRAM W3OUNP !--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! 3. Read general data and first fields from file ! +#if W3_BIN2NC + CALL W3IOPON ( 'READ', NDSOP, IOTEST ) +#else CALL W3IOPO ( 'READ', NDSOP, IOTEST ) +#endif ! IF ( IAPROC .EQ. NAPOUT ) WRITE (NDSO,930) DO I=1, NOPTS @@ -604,7 +608,11 @@ PROGRAM W3OUNP DO WHILE (DTEST.NE.0) DTEST = DSEC21 ( TIME , TOUT ) IF ( DTEST .GT. 0. ) THEN +#ifdef W3_BIN2NC + CALL W3IOPON ( 'READ', NDSOP, IOTEST ) +#else CALL W3IOPO ( 'READ', NDSOP, IOTEST ) +#endif IF ( IOTEST .EQ. -1 ) THEN IF ( IAPROC .EQ. NAPOUT ) WRITE (NDSO,949) GOTO 888 @@ -1070,7 +1078,11 @@ PROGRAM W3OUNP DTEST = DSEC21 ( TIME , TOUT ) IF ( DTEST .GT. 0. ) THEN ! reads TIME from out_pnt.ww3 +#ifdef W3_BIN2NC + CALL W3IOPON ( 'READ', NDSOP, IOTEST ) +#else CALL W3IOPO ( 'READ', NDSOP, IOTEST ) +#endif IF ( IOTEST .EQ. -1 ) THEN IF ( IAPROC .EQ. NAPOUT ) WRITE (NDSO,949) GOTO 700 @@ -1215,7 +1227,11 @@ PROGRAM W3OUNP ! 7.3 Reinitiazes TIME (close open out_pnt.ww3) and TOUT to process a new bunch of stations CLOSE(NDSOP) ! closes binary file out_pnt* IPASS = 0 ! resets time counter for binary file out_pnt* +#ifdef W3_BIN2NC + CALL W3IOPON ( 'READ', NDSOP, IOTEST ) +#else CALL W3IOPO ( 'READ', NDSOP, IOTEST ) +#endif #ifdef W3_T WRITE(NDSE,*) 'out_pnt* closed and reopened' #endif @@ -1228,7 +1244,11 @@ PROGRAM W3OUNP DO WHILE (DTEST.NE.0) DTEST = DSEC21 ( TIME , TOUT ) IF ( DTEST .GT. 0. ) THEN +#ifdef W3_BIN2NC + CALL W3IOPON ( 'READ', NDSOP, IOTEST ) +#else CALL W3IOPO ( 'READ', NDSOP, IOTEST ) +#endif IF ( IOTEST .EQ. -1 ) THEN IF ( IAPROC .EQ. NAPOUT ) WRITE (NDSO,949) GOTO 700 diff --git a/model/src/ww3_outp.F90 b/model/src/ww3_outp.F90 index 6d750687a..d793783ca 100644 --- a/model/src/ww3_outp.F90 +++ b/model/src/ww3_outp.F90 @@ -208,13 +208,16 @@ PROGRAM W3OUTP #endif USE W3ODATMD, ONLY: W3SETO, W3NOUT USE W3IOGRMD, ONLY: W3IOGR +#ifdef W3_BIN2NC + USE W3IOPOMD, ONLY: W3IOPON, W3IOPON_READ, W3IOPON_WRITE +#else USE W3IOPOMD, ONLY: W3IOPO +#endif USE W3SERVMD, ONLY : ITRACE, NEXTLN, EXTCDE #ifdef W3_S USE W3SERVMD, ONLY : STRACE #endif USE W3TIMEMD, ONLY: STME21, TICK21, DSEC21 - !/ USE W3GDATMD USE W3WDATMD, ONLY: TIME USE W3ODATMD, ONLY: NDSE, NDST, NDSO, NOPTS, PTLOC, PTNME, & @@ -359,7 +362,11 @@ PROGRAM W3OUTP !--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! 3. Read general data and first fields from file ! +#if W3_BIN2NC + CALL W3IOPON ( 'READ', NDSOP, IOTEST ) +#else CALL W3IOPO ( 'READ', NDSOP, IOTEST ) +#endif ! WRITE (NDSO,930) DO I=1, NOPTS @@ -457,7 +464,11 @@ PROGRAM W3OUTP DO CALL STME21 ( TIME , IDTIME ) WRITE (NDSO,948) IDTIME +#ifdef W3_BIN2NC + CALL W3IOPON ( 'READ', NDSOP, IOTEST ) +#else CALL W3IOPO ( 'READ', NDSOP, IOTEST ) +#endif IF ( IOTEST .EQ. -1 ) THEN WRITE (NDSO,949) GOTO 888 @@ -777,7 +788,11 @@ PROGRAM W3OUTP DO DTEST = DSEC21 ( TIME , TOUT ) IF ( DTEST .GT. 0. ) THEN +#ifdef W3_BIN2NC + CALL W3IOPON ( 'READ', NDSOP, IOTEST ) +#else CALL W3IOPO ( 'READ', NDSOP, IOTEST ) +#endif IF ( IOTEST .EQ. -1 ) THEN WRITE (NDSO,949) EXIT diff --git a/regtests/bin/matrix.base b/regtests/bin/matrix.base index 819ea0101..824b358f1 100755 --- a/regtests/bin/matrix.base +++ b/regtests/bin/matrix.base @@ -180,6 +180,7 @@ if [ "$prop2D" = 'y' ] then echo ' ' >> matrix.body + echo "$rtst -s PR1_MPI_BIN2NC -w work_PR1_MPI_BIN2NC -f -p $mpi -n $np $ww3 ww3_tp2.2" >> matrix.body echo "$rtst -s PR1_MPI -w work_PR1_MPI -f -p $mpi -n $np $ww3 ww3_tp2.1" >> matrix.body echo "$rtst -s PR1_MPI -w work_PR1_MPI -f -p $mpi -n $np $ww3 ww3_tp2.2" >> matrix.body echo "$rtst -s PR1_MPI -w work_PR1_MPI -f -p $mpi -n $np $ww3 ww3_tp2.3" >> matrix.body diff --git a/regtests/unittests/CMakeLists.txt b/regtests/unittests/CMakeLists.txt index 69445bfb7..1d3d81f60 100644 --- a/regtests/unittests/CMakeLists.txt +++ b/regtests/unittests/CMakeLists.txt @@ -24,16 +24,25 @@ endfunction() # Function to build and run a test. function(unit_test name) - add_executable(${name} ${name}.F90) + add_executable(${name} ${name}.F90 ww3_unittest_util.F90) target_link_libraries(${name} PRIVATE ww3_lib) add_test(NAME ${name} COMMAND ${name}) endfunction() +# The binary file mod_def.ww3 is needed for testing. It's created by +# the ww3_grid utility. +#add_custom_target(create_mod_def TEST ../../bin/ww3_grid +# COMMENT "Creating mod_def.ww3 file for testing") + # 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) +unit_test(test_io) +unit_test(test_io2) +unit_test(test_io3) +unit_test(test_io_restart_bin) diff --git a/regtests/unittests/test_io.F90 b/regtests/unittests/test_io.F90 new file mode 100644 index 000000000..ebe4e2385 --- /dev/null +++ b/regtests/unittests/test_io.F90 @@ -0,0 +1,117 @@ +! This is a test for model IO for WW3. +! +! Ed Hartnett 10/14/23 +program test_io + use w3iopomd + use w3gdatmd + use w3wdatmd + use w3odatmd + use w3iogrmd + use w3adatmd + implicit none + + integer, target :: i, j, k, l + integer :: ndsop, iotest, imod, ndstst, ierr, ndsbul, ndsm + integer :: ndstrc, ntrace + real :: m2km + character*7 expected_ptnme + character*6 my_fmt + real :: expected_loc_1 + integer :: write_test_file + + print *, 'Testing WW3 netCDF 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 + imod = 1 + + write (ndso,900) +900 FORMAT (/15X,' *** WAVEWATCH III Point output post.*** '/ & + 15X,'==============================================='/) + + ! Open the file with the output settings for WW3. It is not needed actually. + ! open(ndsi, file = 'ww3_outp.inp', status='old', iostat = ierr) + ! if (ierr .ne. 0) stop 10 + + ! Create a point output file needed for this test. + print *, 'Creating point output test file for this test...' + if (write_test_file() .ne. 0) stop 1 + + ! 2. Read model definition file. + CALL W3IOGR('READ', NDSM) + WRITE (NDSO,920) GNAME +920 FORMAT (' Grid name : ',A/) + + ! IF (FLAGLL) THEN + ! M2KM = 1. + ! ELSE + ! M2KM = 1.E-3 + ! END IF + + ! Read the file out_pnt.ww3 from the model/tests/data directory. + print *, 'OK!' + print *, 'Reading the point output test file for this test...' + 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 *, 'initializing some data...' + ipass2 = 0 + do i = 1, nopts + do j = 1, nspec + spco(j, i) = 0.0 + end do + end do + + print *, 'OK!' + print *, 'testing writing the WW3 binary point file in netCDF...' + + ! Write in netCDF. + call w3iopon('WRITE', ndsop, iotest, imod) + if (iotest .ne. 0) stop 100 + print *, 'OK!' + + print *, 'testing reading the WW3 binary point file in netCDF...' + ipass2 = 0 + call w3iopon('READ', ndsop, iotest, imod) + print *, iotest + if (iotest .ne. 0) stop 100 + print *, 'OK!' + + print *, 'OK!' + + print *, 'SUCCESS!' +end program test_io + diff --git a/regtests/unittests/test_io2.F90 b/regtests/unittests/test_io2.F90 new file mode 100644 index 000000000..b7fe5092d --- /dev/null +++ b/regtests/unittests/test_io2.F90 @@ -0,0 +1,123 @@ +! This is a test for model IO for WW3. +! +! Ed Hartnett 10/14/23 +program test_io2 + use w3iopomd + use w3gdatmd + use w3wdatmd + use w3odatmd + use w3iogrmd + use w3adatmd + implicit none + + integer, target :: i, j, k, l + integer :: ndsop, iotest, imod, ndstst, ierr, ndsbul, ndsm + integer :: ndstrc, ntrace + real :: m2km + character*7 expected_ptnme + character*6 my_fmt + real :: expected_loc_1 + integer :: write_test_file + + print *, 'Testing WW3 netCDF point file code some more.' + + ! 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 + imod = 1 + + write (ndso,900) +900 FORMAT (/15X,' *** WAVEWATCH III Point output post.*** '/ & + 15X,'==============================================='/) + + ! Open the file with the output settings for WW3. It is not needed actually. + ! open(ndsi, file = 'ww3_outp.inp', status='old', iostat = ierr) + ! if (ierr .ne. 0) stop 10 + + ! Create a point output file needed for this test. + print *, 'Creating point output test file for this test...' + if (write_test_file() .ne. 0) stop 1 + + ! 2. Read model definition file. + CALL W3IOGR('READ', NDSM) + WRITE (NDSO,920) GNAME +920 FORMAT (' Grid name : ',A/) + + ! IF (FLAGLL) THEN + ! M2KM = 1. + ! ELSE + ! M2KM = 1.E-3 + ! END IF + + ! Read the file out_pnt.ww3 from the model/tests/data directory. + print *, 'OK!' + print *, 'Reading the point output test file for this test...' + 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 *, 'initializing some data...' + ipass2 = 0 + do i = 1, nopts + do j = 1, nspec + spco(j, i) = 0.0 + end do + end do + + print *, 'OK!' + print *, 'testing writing the WW3 binary point file in netCDF...' + + ! Write in netCDF. + ofiles(2) = 1 + call w3iopon('WRITE', ndsop, iotest, imod) + if (iotest .ne. 0) stop 100 + print *, 'OK!' + + ! Another timestep in netCDF. + call w3iopon('WRITE', ndsop, iotest, imod) + if (iotest .ne. 0) stop 100 + print *, 'OK!' + + print *, 'testing reading the WW3 binary point file in netCDF...' + ipass2 = 0 + call w3iopon('READ', ndsop, iotest) + print *, iotest + if (iotest .ne. 0) stop 100 + print *, 'OK!' + + print *, 'OK!' + + print *, 'SUCCESS!' +end program test_io2 + diff --git a/regtests/unittests/test_io3.F90 b/regtests/unittests/test_io3.F90 new file mode 100644 index 000000000..b5f65849c --- /dev/null +++ b/regtests/unittests/test_io3.F90 @@ -0,0 +1,110 @@ +! This is a test for model IO for WW3. +! +! Ed Hartnett 10/14/23 +program test_io3 + use w3iopomd + use w3gdatmd + use w3wdatmd + use w3odatmd + use w3iogrmd + use w3adatmd + implicit none + + integer, target :: i, j, k, l + integer :: ndsop, iotest, imod, ndstst, ierr, ndsbul, ndsm + integer :: ndstrc, ntrace + real :: m2km + character*7 expected_ptnme + character*6 my_fmt + real :: expected_loc_1 + integer :: write_test_file + + print *, 'Testing WW3 netCDF point file code even more.' + + ! 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) + + nth = 4 + ndsm = 20 + ndsop = 20 + ndsbul = 0 + ndstrc = 6 + ntrace = 10 + imod = 1 + + ! 2. Read model definition file. + CALL W3IOGR('READ', NDSM) + WRITE (NDSO,920) GNAME +920 FORMAT (' Grid name : ',A/) + + ! Create a point output file needed for this test. + print *, 'Creating point output test file for this test...' + if (write_test_file() .ne. 0) stop 1 + + ! Read the file out_pnt.ww3 from the model/tests/data directory. + ! print *, 'OK!' + ! print *, 'Reading the point output test file for this test...' + 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 *, 'initializing some data...' + ipass2 = 0 + do i = 1, nopts + do j = 1, nspec + spco(j, i) = 0.0 + end do + end do + + print *, 'OK!' + print *, 'testing writing the WW3 binary point file in netCDF...' + + ! ! Write in netCDF. + ! ofiles(2) = 1 + ! call w3iopon('WRITE', ndsop, iotest, imod) + ! if (iotest .ne. 0) stop 100 + ! print *, 'OK!' + + ! ! Another timestep in netCDF. + ! call w3iopon('WRITE', ndsop, iotest, imod) + ! if (iotest .ne. 0) stop 100 + ! print *, 'OK!' + + print *, 'testing reading the WW3 binary point file in netCDF...' + ipass2 = 0 + call w3iopon('READ', ndsop, iotest) + print *, iotest + if (iotest .ne. 0) stop 100 + print *, 'OK!' + + print *, 'OK!' + + print *, 'SUCCESS!' +end program test_io3 + diff --git a/regtests/unittests/test_io_points_bin.F90 b/regtests/unittests/test_io_points_bin.F90 index 69c197bce..4093b24ba 100644 --- a/regtests/unittests/test_io_points_bin.F90 +++ b/regtests/unittests/test_io_points_bin.F90 @@ -79,74 +79,3 @@ program test_io_points_bin 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/unittests/test_io_restart_bin.F90 b/regtests/unittests/test_io_restart_bin.F90 new file mode 100644 index 000000000..026e8d3d2 --- /dev/null +++ b/regtests/unittests/test_io_restart_bin.F90 @@ -0,0 +1,59 @@ +! This is a test for model IO for WW3. This tests the legacy (binary) +! output of restart data, done by function W3IORS(). +! +! Ed Hartnett 1/13/24 +program test_io_restart_bin + use w3iorsmd + 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 :: ndsr = 11 +! real :: dumfpi = 99.9 + +! print *, 'Testing WW3 binary restart 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 + +! 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/) + +! ! Read the file out_pnt.ww3 from the model/tests/data directory. +! call w3iors('HOT', ndsr, dumfpi) +! if (iotest .ne. 0) stop 10 +! close(ndsop) + + + print *, 'OK!' + print *, 'SUCCESS!' +end program test_io_restart_bin + diff --git a/regtests/unittests/ww3_unittest_util.F90 b/regtests/unittests/ww3_unittest_util.F90 new file mode 100644 index 000000000..fe20ddb30 --- /dev/null +++ b/regtests/unittests/ww3_unittest_util.F90 @@ -0,0 +1,75 @@ +! This is test code for the WW3 I/O unit tests. +! +! This file holds a function used by multiple tests. +! +! Ed Hartnett, 1/11/24 +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_tp2.2/input/switch_PR1_MPI_BIN2NC b/regtests/ww3_tp2.2/input/switch_PR1_MPI_BIN2NC new file mode 100644 index 000000000..bb79e8549 --- /dev/null +++ b/regtests/ww3_tp2.2/input/switch_PR1_MPI_BIN2NC @@ -0,0 +1 @@ +NOGRB DIST MPI 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 BIN2NC diff --git a/regtests/ww3_ufs1.1/input_unstr/switch_PDLIB b/regtests/ww3_ufs1.1/input_unstr/switch_PDLIB index ff569c11f..0927be62d 100644 --- a/regtests/ww3_ufs1.1/input_unstr/switch_PDLIB +++ b/regtests/ww3_ufs1.1/input_unstr/switch_PDLIB @@ -1 +1 @@ -PDLIB SCOTCH NOGRB DIST MPI PR3 UQ FLX0 SEED ST4 STAB0 NL1 BT1 DB1 MLIM FLD1 TR0 BS0 WNX1 WNT1 CRX1 CRT1 O0 O1 O2 O3 O4 O5 O6 O7 O14 O15 IC0 IS0 REF0 +PDLIB SCOTCH NOGRB DIST MPI PR3 UQ FLX0 SEED ST4 STAB0 NL1 BT1 DB1 MLIM FLD1 TR0 BS0 WNX1 WNT1 CRX1 CRT1 O0 O1 O2 O3 O4 O5 O6 O7 O14 O15 IC0 IS0 REF0 BIN2NC From f22c38a534048b670eace57937c488e14321b30c Mon Sep 17 00:00:00 2001 From: Matthew Masarik <86749872+MatthewMasarik-NOAA@users.noreply.github.com> Date: Mon, 24 Jun 2024 05:38:54 -0700 Subject: [PATCH 26/30] Fix GNU regtest CI failure (#1253) --- .github/workflows/regtest_gnu.yml | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/regtest_gnu.yml b/.github/workflows/regtest_gnu.yml index 81d1317a3..d5b71673c 100644 --- a/.github/workflows/regtest_gnu.yml +++ b/.github/workflows/regtest_gnu.yml @@ -91,7 +91,7 @@ jobs: spack ~/.spack work_oasis3-mct - key: spack2-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('ww3/model/ci/spack_gnu.yaml') }} + key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('ww3/model/ci/spack_gnu.yaml') }} - name: build-ww3 run: | @@ -102,10 +102,10 @@ jobs: export CC=mpicc export FC=mpif90 export OASISDIR=${GITHUB_WORKSPACE}/work_oasis3-mct -# mkdir build && cd build + # mkdir build && cd build export LD_LIBRARY_PATH="/home/runner/work/WW3/WW3/spack/var/spack/environments/ww3-gnu/.spack-env/view/:$LD_LIBRARY_PATH" -# cmake -DSWITCH=${GITHUB_WORKSPACE}/ww3/regtests/unittests/data/switch.io -DCMAKE_BUILD_TYPE=Debug .. -# make -j2 VERBOSE=1 + # cmake -DSWITCH=${GITHUB_WORKSPACE}/ww3/regtests/unittests/data/switch.io -DCMAKE_BUILD_TYPE=Debug .. + # make -j2 VERBOSE=1 cd ${GITHUB_WORKSPACE}/ww3 ls -l ${GITHUB_WORKSPACE}/ww3/model/bin/ww3_from_ftp.sh -k @@ -116,18 +116,15 @@ jobs: cd work_PR1_MPI pwd ls -l - ncdump -h out_pnt.ww3.nc > ncdump_out.txt - cat ncdump_out.txt - pwd - cat ${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.5/out_pnt_ncdump.txt - cmp ${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.5/out_pnt_ncdump.txt ncdump_out.txt - + # ncdump -h out_pnt.ww3.nc > ncdump_out.txt + # cat ncdump_out.txt + # pwd + # cat ${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.5/out_pnt_ncdump.txt + # cmp ${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.5/out_pnt_ncdump.txt ncdump_out.txt + - name: cache-data id: cache-data uses: actions/cache@v3 with: path: ww3/ww3_from_ftp.v7.14.1.tar.gz key: ww3_from_ftp.v7.14.1 - - - From af38c437084308dd06ea1b03886cad7d2805ee33 Mon Sep 17 00:00:00 2001 From: Matthew Masarik <86749872+MatthewMasarik-NOAA@users.noreply.github.com> Date: Wed, 3 Jul 2024 06:18:40 -0700 Subject: [PATCH 27/30] Fix code stability issue in ww3_outp (#1258) Co-authored-by: saeideh banihashemi --- model/src/w3bullmd.F90 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/model/src/w3bullmd.F90 b/model/src/w3bullmd.F90 index 10301e8ca..af749549a 100644 --- a/model/src/w3bullmd.F90 +++ b/model/src/w3bullmd.F90 @@ -268,8 +268,8 @@ SUBROUTINE W3BULL & ! CSVBLINE = BLANK2 ! + IPG1 = 0 IF (IOUT .EQ. 1) THEN - IPG1 = 0 DO IP=1, NPTAB HST(IP,1) = -99.9 TPT(IP,1) = -99.9 @@ -286,10 +286,12 @@ SUBROUTINE W3BULL & ! HSTOT = XPART(1,0) TP = XPART(2,0) - HSP = XPART(1,1:NPART) - TPP = XPART(2,1:NPART) - WNP = TPI / XPART(3,1:NPART) - DMP = MOD( XPART(4,1:NPART) + 180., 360.) + DO IP=1, NPART + HSP(IP) = XPART(1,IP) + TPP(IP) = XPART(2,IP) + WNP(IP) = TPI / XPART(3,IP) + DMP(IP) = MOD( XPART(4,IP) + 180., 360.) + ENDDO NZERO = 0 NZERO = COUNT( HSP <= BHSMIN .AND. HSP /= 0. ) From ca58c139e9f4b25250d9292afbfe169c7171c03c Mon Sep 17 00:00:00 2001 From: Matthew Masarik <86749872+MatthewMasarik-NOAA@users.noreply.github.com> Date: Mon, 15 Jul 2024 05:49:21 -0700 Subject: [PATCH 28/30] Updates to NCEP regtests for Orion Rocky9 OS(#1263) --- regtests/bin/matrix_cmake_ncep | 52 +++++++++++++++++----------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/regtests/bin/matrix_cmake_ncep b/regtests/bin/matrix_cmake_ncep index 2eafd8986..1fa1a2d6f 100755 --- a/regtests/bin/matrix_cmake_ncep +++ b/regtests/bin/matrix_cmake_ncep @@ -22,11 +22,11 @@ usage () { cat 2>&1 << EOF - Usage: $myname model_dir compiler + Usage: $myname model_dir compiler Required: model_dir : path to model dir of WW3 source - Optional: - compiler : intel (default) or gnu + Optional: + compiler : intel (default) or gnu EOF } @@ -36,16 +36,16 @@ EOF main_dir="$1" ; shift if [ ! $# = 0 ] then - compiler="$1"; shift - else + compiler="$1"; shift + else compiler='intel' - fi + fi else usage exit 1 fi - - + + # Convert main_dir to absolute path main_dir="`cd $main_dir 1>/dev/null 2>&1 && pwd`" @@ -60,51 +60,51 @@ EOF modbacio='bacio/2.4.1' modg2='g2/3.4.5' modw3emc='w3emc/2.10.0' - modesmf='esmf/8.5.0' + modesmf='esmf/8.6.0' 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) ishera=`hostname | grep hfe` - isorion=`hostname | grep Orion` + isorion=`hostname | grep orion` ishercules=`hostname | grep hercules` if [ $ishera ] then batchq='slurm' if [ $compiler = "intel" ] - then + then spackstackpath='/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.6.0/envs/unified-env-rocky8/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/hera/intel/spack-stack/1.6.0/parmetis-4.0.3/install' modcmake='cmake/3.23.1' elif [ $compiler = "gnu" ] - then + then spackstackpath='/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.6.0/envs/unified-env-rocky8/install/modulefiles/Core' modcomp='stack-gcc/9.2.0' modmpi='stack-openmpi/4.1.5' metispath='/scratch1/NCEPDEV/climate/Matthew.Masarik/waves/opt/hera/gnu/spack-stack/1.6.0/parmetis-4.0.3/install' modcmake='cmake/3.23.1' - else - echo "Compiler $compiler not supported on hera" - exit 1 - fi + else + echo "Compiler $compiler not supported on hera" + exit 1 + fi elif [ $isorion ] then if [ $compiler = "intel" ] then batchq='slurm' - spackstackpath='/work/noaa/epic/role-epic/spack-stack/orion/spack-stack-1.6.0/envs/unified-env/install/modulefiles/Core' - modcomp='stack-intel/2022.0.2' - modmpi='stack-intel-oneapi-mpi/2021.5.1' + spackstackpath='/work/noaa/epic/role-epic/spack-stack/orion/spack-stack-1.6.0/envs/unified-env-rocky9/install/modulefiles/Core' + modcomp='stack-intel/2021.9.0' + modmpi='stack-intel-oneapi-mpi/2021.9.0' metispath='/work/noaa/marine/Matthew.Masarik/waves/opt/orion/intel/spack-stack/1.6.0/parmetis-4.0.3/install' modcmake='cmake/3.23.1' else - echo "Compiler $compiler not supported on orion" + echo "Compiler $compiler not supported on orion" exit 1 - fi - elif [ $ishercules ] - then + fi + elif [ $ishercules ] + then batchq='slurm' if [ $compiler = "intel" ] then @@ -114,7 +114,7 @@ EOF metispath='/work/noaa/marine/Matthew.Masarik/waves/opt/hercules/intel/spack-stack/1.6.0/parmetis-4.0.3/install' modcmake='cmake/3.23.1' elif [ $compiler = "gnu" ] - then + then spackstackpath='/work/noaa/epic/role-epic/spack-stack/hercules/spack-stack-1.6.0/envs/unified-env/install/modulefiles/Core' spackstackpath2='/work/noaa/epic/role-epic/spack-stack/hercules/modulefiles' modcomp='stack-gcc/12.2.0' @@ -122,7 +122,7 @@ EOF metispath='/work/noaa/marine/Matthew.Masarik/waves/opt/hercules/gnu/spack-stack/1.6.0/parmetis-4.0.3/install' modcmake='cmake/3.23.1' else - echo "Compiler $compiler not supported on hercules" + echo "Compiler $compiler not supported on hercules" exit 1 fi else @@ -195,7 +195,7 @@ EOF echo " module use $spackstackpath" >> matrix.head if [ ! -z $spackstackpath2 ]; then echo " module use $spackstackpath2" >> matrix.head - fi + fi echo " module load $modcomp" >> matrix.head echo " module load $modmpi" >> matrix.head echo " module load $modcmake" >> matrix.head From a2c086e69467b1a3ca28287a62ab4b0cd9e3c8a5 Mon Sep 17 00:00:00 2001 From: Chris Bunney <48915820+ukmo-ccbunney@users.noreply.github.com> Date: Fri, 19 Jul 2024 17:23:36 +0100 Subject: [PATCH 29/30] Add depth scaling value to SMC regression tests. (#1264) --- regtests/ww3_tp2.10/input/ww3_grid.nml | 7 +++++++ regtests/ww3_tp2.16/input/ww3_grid.nml | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/regtests/ww3_tp2.10/input/ww3_grid.nml b/regtests/ww3_tp2.10/input/ww3_grid.nml index ee9ac10e4..26e0465dc 100644 --- a/regtests/ww3_tp2.10/input/ww3_grid.nml +++ b/regtests/ww3_tp2.10/input/ww3_grid.nml @@ -67,6 +67,13 @@ SMC%SUBTR%FILENAME = '../input/ErieObstr.dat' / +! -------------------------------------------------------------------- ! +! Scaling factor for depth input file +! -------------------------------------------------------------------- ! +&DEPTH_NML + DEPTH%SF = -1.0 +/ + ! -------------------------------------------------------------------- ! ! WAVEWATCH III - end of namelist ! ! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_tp2.16/input/ww3_grid.nml b/regtests/ww3_tp2.16/input/ww3_grid.nml index 19b0fdc05..c97e3126d 100644 --- a/regtests/ww3_tp2.16/input/ww3_grid.nml +++ b/regtests/ww3_tp2.16/input/ww3_grid.nml @@ -70,6 +70,13 @@ SMC%AJSID%FILENAME = '../input/A50AJSide.dat' / +! -------------------------------------------------------------------- ! +! Scaling factor for depth input file +! -------------------------------------------------------------------- ! +&DEPTH_NML + DEPTH%SF = -1.0 +/ + ! -------------------------------------------------------------------- ! ! WAVEWATCH III - end of namelist ! ! -------------------------------------------------------------------- ! From b4e119e18c747fe20d5794ab6dfa33bdc3617aed Mon Sep 17 00:00:00 2001 From: Jessica Meixner Date: Fri, 19 Jul 2024 14:23:36 -0400 Subject: [PATCH 30/30] Simplify MPI ifdefs in subroutine W3MPIO (#1266) --- model/src/w3initmd.F90 | 620 ----------------------------------------- 1 file changed, 620 deletions(-) diff --git a/model/src/w3initmd.F90 b/model/src/w3initmd.F90 index 044a18760..4badbcb1a 100644 --- a/model/src/w3initmd.F90 +++ b/model/src/w3initmd.F90 @@ -2272,22 +2272,18 @@ SUBROUTINE W3MPIO ( IMOD ) ! IF ( IAPROC .LE. NAPROC ) THEN IT = IT0 -#endif #ifdef W3_MPIT WRITE (NDST,9010) '(SEND)' #endif ! -#ifdef W3_MPI IF ( FLGRDALL( 1, 12) ) THEN IH = IH + 1 IT = IT + 1 CALL MPI_SEND_INIT (ICEF (IAPROC), 1, WW3_FIELD_VEC, IROOT, IT, & MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 1/09', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 1) ) THEN @@ -2295,11 +2291,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (HS (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/01', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 2) ) THEN @@ -2307,11 +2301,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (WLM (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/02', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 3) ) THEN @@ -2319,11 +2311,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (T02 (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/03', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 4) ) THEN @@ -2331,11 +2321,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (T0M1 (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/04', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 5) ) THEN @@ -2343,11 +2331,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (T01 (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/05', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 6) .OR. FLGRDALL( 2,18) ) THEN @@ -2356,11 +2342,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (FP0 (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/06', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 7) ) THEN @@ -2368,11 +2352,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (THM (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/07', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 8) ) THEN @@ -2380,11 +2362,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (THS (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/09', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 9) ) THEN @@ -2392,11 +2372,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (THP0 (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/09', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 10) ) THEN @@ -2404,11 +2382,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (HSIG (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/10', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 11) ) THEN @@ -2416,11 +2392,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (STMAXE (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/11', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 12) ) THEN @@ -2428,11 +2402,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (STMAXD (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/12', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 13) ) THEN @@ -2440,11 +2412,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (HMAXE (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/13', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 14) ) THEN @@ -2452,11 +2422,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (HCMAXE (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/14', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 15) ) THEN @@ -2464,11 +2432,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (HMAXD (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/15', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 16) ) THEN @@ -2476,11 +2442,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (HCMAXD (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/16', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 17) ) THEN @@ -2488,11 +2452,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (WBT (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/17', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 19) ) THEN @@ -2500,11 +2462,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (WNMEAN(1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/19', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 3, 1) ) THEN @@ -2513,11 +2473,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (EF(1,IK),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, 'EF', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -2527,11 +2485,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (TH1M(1,IK),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, 'TH1M', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -2541,11 +2497,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (STH1M(1,IK),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, 'STH1M', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -2555,11 +2509,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (TH2M(1,IK),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, 'TH2M', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -2569,11 +2521,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (STH2M(1,IK),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, 'STH2M', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -2583,11 +2533,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (PHS(1,K),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/01', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -2597,11 +2545,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (PTP(1,K),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/02', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -2611,11 +2557,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (PLP(1,K),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/03', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -2625,11 +2569,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (PDIR(1,K),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/04', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -2639,11 +2581,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (PSI(1,K),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/05', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -2653,11 +2593,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (PWS(1,K),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/06', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -2667,11 +2605,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (PTHP0(1,K),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/07', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -2681,11 +2617,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (PQP (1,K),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/08', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -2695,11 +2629,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (PPE (1,K),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/09', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -2709,11 +2641,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (PGW (1,K),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/10', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -2723,11 +2653,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (PSW (1,K),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/11', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -2737,11 +2665,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (PTM1(1,K),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/12', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -2752,11 +2678,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (PT1 (1,K),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/13', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -2766,11 +2690,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (PT2 (1,K),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/14', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -2780,11 +2702,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (PEP (1,K),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/15', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -2793,11 +2713,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (PWST (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/16', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 4,17) ) THEN @@ -2805,11 +2723,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (PNR (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/17', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 5, 1) ) THEN @@ -2817,29 +2733,23 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (UST (IAPROC), 1, WW3_FIELD_VEC, & IROOT, IT, MPI_COMM_WAVE, IRQGO(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/01', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_SEND_INIT (USTDIR(IAPROC), 1, WW3_FIELD_VEC, & IROOT, IT, MPI_COMM_WAVE, IRQGO(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/01', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_SEND_INIT (ASF (IAPROC), 1, WW3_FIELD_VEC, & IROOT, IT, MPI_COMM_WAVE, IRQGO(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/01', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 5, 2) ) THEN @@ -2847,11 +2757,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (CHARN(1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/02', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 5, 3) ) THEN @@ -2859,11 +2767,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (CGE (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/03', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 5, 4) ) THEN @@ -2871,11 +2777,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (PHIAW(1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/04', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 5, 5) ) THEN @@ -2883,20 +2787,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (TAUWIX(1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/05', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_SEND_INIT (TAUWIY(1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/05', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 5, 6) ) THEN @@ -2904,20 +2804,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (TAUWNX(1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/06', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_SEND_INIT (TAUWNY(1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/06', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 5, 7) ) THEN @@ -2925,11 +2821,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (WHITECAP(1,1),NSEALM , MPI_REAL, IROOT,& IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/07', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 5, 8) ) THEN @@ -2937,11 +2831,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (WHITECAP(1,2),NSEALM , MPI_REAL, IROOT,& IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/08', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 5, 9) ) THEN @@ -2949,11 +2841,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (WHITECAP(1,3),NSEALM , MPI_REAL, IROOT,& IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/09', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 5,10) ) THEN @@ -2961,11 +2851,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (WHITECAP(1,4),NSEALM , MPI_REAL, IROOT,& IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/10', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 5, 11) ) THEN @@ -2973,11 +2861,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (TWS(1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/11', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 6, 1) ) THEN @@ -2985,29 +2871,23 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (SXX (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/01', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_SEND_INIT (SYY (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/01', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_SEND_INIT (SXY (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/01', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 6, 2) ) THEN @@ -3015,20 +2895,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (TAUOX (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/02', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_SEND_INIT (TAUOY (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/02', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 6, 3) ) THEN @@ -3036,11 +2912,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (BHD(1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/03', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 6, 4) ) THEN @@ -3048,11 +2922,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (PHIOC (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/04', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 6, 5) ) THEN @@ -3060,20 +2932,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (TUSX (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/05', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_SEND_INIT (TUSY (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/05', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 6, 6) ) THEN @@ -3081,20 +2949,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (USSX (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/06', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_SEND_INIT (USSY (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/06', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 6, 7) ) THEN @@ -3102,20 +2966,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (PRMS (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/07', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_SEND_INIT (TPMS (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/07', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 6, 8) ) THEN @@ -3124,11 +2984,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (US3D(1,IK),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, 'US3D ', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -3138,11 +2996,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (P2SMS(1,K),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, 'P2SMS', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -3151,20 +3007,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (TAUICE (1,1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/10', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_SEND_INIT (TAUICE (1,2),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/10', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 6,11) ) THEN @@ -3172,11 +3024,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (PHICE (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/11', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 6, 12) ) THEN @@ -3185,11 +3035,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (USSP(1,IK),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, 'USSP ', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -3198,20 +3046,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (TAUOCX(1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/13', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_SEND_INIT (TAUOCY(1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/13', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 7, 1) ) THEN @@ -3219,20 +3063,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (ABA (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 7/01', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_SEND_INIT (ABD (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 7/01', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 7, 2) ) THEN @@ -3240,20 +3080,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (UBA (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 7/02', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_SEND_INIT (UBD (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 7/02', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 7, 3) ) THEN @@ -3261,29 +3097,23 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (BEDFORMS(1,1),NSEALM , MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 7/03', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_SEND_INIT (BEDFORMS(1,2),NSEALM , MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 7/03', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_SEND_INIT (BEDFORMS(1,3),NSEALM , MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 7/03', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 7, 4) ) THEN @@ -3291,11 +3121,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (PHIBBL(1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 7/04', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 7, 5) ) THEN @@ -3303,20 +3131,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (TAUBBL(1,1),NSEALM , MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 7/05', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_SEND_INIT (TAUBBL(1,2),NSEALM , MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 7/05', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 8, 1) ) THEN @@ -3324,20 +3148,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (MSSX (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 8/01', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_SEND_INIT (MSSY (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 8/01', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 8, 2) ) THEN @@ -3345,20 +3165,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (MSCX (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 8/02', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_SEND_INIT (MSCY (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 8/02', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 8, 3) ) THEN @@ -3366,11 +3182,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (MSSD (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 8/03', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 8, 4) ) THEN @@ -3378,11 +3192,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (MSCD (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 8/04', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 8, 5) ) THEN @@ -3390,11 +3202,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (QP (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 8/05', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 8, 6) ) THEN @@ -3402,67 +3212,49 @@ SUBROUTINE W3MPIO ( IMOD ) 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( 8, 7) ) THEN IH = IH + 1 IT = IT + 1 CALL MPI_SEND_INIT (SKEW (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 8/07', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF -#endif ! -#ifdef W3_MPI IF ( FLGRDALL( 8, 8) ) THEN IH = IH + 1 IT = IT + 1 CALL MPI_SEND_INIT (EMBIA1 (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 8/08', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF -#endif ! -#ifdef W3_MPI IF ( FLGRDALL( 8, 9) ) THEN IH = IH + 1 IT = IT + 1 CALL MPI_SEND_INIT (EMBIA2 (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 8/09', 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 CALL MPI_SEND_INIT (DTDYN(1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 9/01', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 9, 2) ) THEN @@ -3470,11 +3262,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (FCUT (1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 9/02', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 9, 3) ) THEN @@ -3482,11 +3272,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (CFLXYMAX(1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 9/03', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 9, 4) ) THEN @@ -3494,11 +3282,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (CFLTHMAX(1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 9/04', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 9, 5) ) THEN @@ -3506,11 +3292,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (CFLKMAX(1),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 9/05', IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF ! DO I=1, NOEXTR @@ -3519,23 +3303,19 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_SEND_INIT (USERO(1,I),NSEALM , MPI_REAL, IROOT, & IT, MPI_COMM_WAVE, IRQGO(IH), IERR) -#endif #ifdef W3_MPIT WRITE (STRING,'(A3,I2.2)') '10/', I WRITE (NDST,9011) IH, STRING, IROOT, IT, IRQGO(IH), IERR #endif -#ifdef W3_MPI END IF END DO ! NRQGO = IH -#endif #ifdef W3_MPIT WRITE (NDST,9012) WRITE (NDST,9013) NRQGO, NRQMAX #endif ! -#ifdef W3_MPI END IF !IF ( IAPROC .LE. NAPROC ) THEN ! IF ( NRQGO .GT. NRQMAX ) THEN @@ -3556,12 +3336,10 @@ SUBROUTINE W3MPIO ( IMOD ) ! 1.c Receives of fields ! CALL W3XETA ( IMOD, NDSE, NDST ) -#endif #ifdef W3_MPIT WRITE (NDST,9010) '(RECV)' #endif ! -#ifdef W3_MPI IH = 0 ! DO I0=1, NAPROC @@ -3573,11 +3351,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (ICEF (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 1/09', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 1) ) THEN @@ -3585,11 +3361,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (HS (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/01', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 2) ) THEN @@ -3597,11 +3371,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (WLM (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/02', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 3) ) THEN @@ -3609,11 +3381,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (T02 (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/03', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 4) ) THEN @@ -3621,11 +3391,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (T0M1 (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/04', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 5) ) THEN @@ -3633,11 +3401,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (T01(I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/05', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 6) .OR. FLGRDALL( 2,18) ) THEN @@ -3646,11 +3412,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (FP0 (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/06', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 7) ) THEN @@ -3658,11 +3422,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (THM (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/07', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 8) ) THEN @@ -3670,11 +3432,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (THS (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/08', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 9) ) THEN @@ -3682,11 +3442,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (THP0 (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/09', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 10) ) THEN @@ -3694,11 +3452,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (HSIG (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/10', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 11) ) THEN @@ -3706,11 +3462,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (STMAXE (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/11', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 12) ) THEN @@ -3718,11 +3472,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (STMAXD(I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/12', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 13) ) THEN @@ -3730,11 +3482,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (HMAXE (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/13', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 14) ) THEN @@ -3742,11 +3492,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (HCMAXE(I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/14', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 15) ) THEN @@ -3754,11 +3502,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (HMAXD (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/15', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 16) ) THEN @@ -3766,11 +3512,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (HCMAXD(I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/16', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 17) ) THEN @@ -3778,11 +3522,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (WBT(I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/17', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 2, 19) ) THEN @@ -3790,11 +3532,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (WNMEAN(I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 2/19', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 3, 1) ) THEN @@ -3803,11 +3543,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (EF(I0,IK),1,WW3_FIELD_VEC, IFROM, IT,& MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, 'EF', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -3817,11 +3555,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (TH1M(I0,IK),1,WW3_FIELD_VEC, IFROM, IT,& MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, 'TH1M', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -3831,11 +3567,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (STH1M(I0,IK),1,WW3_FIELD_VEC, IFROM, IT,& MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, 'STH1M', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -3845,11 +3579,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (TH2M(I0,IK),1,WW3_FIELD_VEC, IFROM, IT,& MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, 'TH2M', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -3859,11 +3591,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (STH2M(I0,IK),1,WW3_FIELD_VEC, IFROM, IT,& MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, 'STH2M', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -3873,11 +3603,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (PHS(I0,K),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/01', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -3887,11 +3615,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (PTP(I0,K),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/02', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -3901,11 +3627,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (PLP(I0,K),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/03', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -3915,11 +3639,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (PDIR(I0,K),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/04', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -3929,11 +3651,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (PSI(I0,K),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/05', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -3943,11 +3663,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (PWS(I0,K),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/06', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -3957,11 +3675,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (PTHP0(I0,K),1,WW3_FIELD_VEC, IFROM, IT,& MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/07', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -3971,11 +3687,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (PQP(I0,K),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/08', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -3985,11 +3699,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (PPE(I0,K),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/09', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -3999,11 +3711,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (PGW(I0,K),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/10', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -4013,11 +3723,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (PSW(I0,K),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/11', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -4027,11 +3735,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (PTM1(I0,K),1,WW3_FIELD_VEC, IFROM, IT,& MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/12', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -4041,11 +3747,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (PT1(I0,K),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/13', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -4055,11 +3759,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (PT2(I0,K),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/14', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -4069,11 +3771,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (PEP(I0,K),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/15', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -4082,11 +3782,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (PWST (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/16', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 4,17) ) THEN @@ -4094,11 +3792,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (PNR (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 4/17', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 5, 1) ) THEN @@ -4106,29 +3802,23 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (UST (I0), 1, WW3_FIELD_VEC, IFROM, & IT, MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/01', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_RECV_INIT (USTDIR(I0), 1, WW3_FIELD_VEC, IFROM, & IT, MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/01', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_RECV_INIT (ASF (I0), 1, WW3_FIELD_VEC, IFROM, & IT, MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/01', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 5, 2) ) THEN @@ -4136,11 +3826,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (CHARN(I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/02', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 5, 3) ) THEN @@ -4148,11 +3836,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (CGE (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/03', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 5, 4) ) THEN @@ -4160,11 +3846,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (PHIAW(I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/04', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 5, 5) ) THEN @@ -4172,20 +3856,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (TAUWIX(I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/05', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_RECV_INIT (TAUWIY(I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/05', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 5, 6) ) THEN @@ -4193,20 +3873,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (TAUWNX(I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/06', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_RECV_INIT (TAUWNY(I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/06', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 5, 7) ) THEN @@ -4214,11 +3890,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (WHITECAP(I0,1),1,WW3_FIELD_VEC, IFROM, & IT, MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/07', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 5, 8) ) THEN @@ -4226,11 +3900,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (WHITECAP(I0,2),1,WW3_FIELD_VEC, IFROM, & IT, MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/08', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 5, 9) ) THEN @@ -4238,11 +3910,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (WHITECAP(I0,3),1,WW3_FIELD_VEC, IFROM, & IT, MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/09', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 5,10) ) THEN @@ -4250,11 +3920,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (WHITECAP(I0,4),1,WW3_FIELD_VEC, IFROM, & IT, MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/10', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 5,11) ) THEN @@ -4262,11 +3930,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (TWS(I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 5/11', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 6, 1) ) THEN @@ -4274,29 +3940,23 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (SXX (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/01', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_RECV_INIT (SYY (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/01', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_RECV_INIT (SXY (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/01', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 6, 2) ) THEN @@ -4304,20 +3964,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (TAUOX (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/02', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_RECV_INIT (TAUOY (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/02', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 6, 3) ) THEN @@ -4325,11 +3981,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (BHD(I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/03', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 6, 4) ) THEN @@ -4337,11 +3991,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (PHIOC (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/04', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 6, 5) ) THEN @@ -4349,20 +4001,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (TUSX (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/05', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_RECV_INIT (TUSY (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/05', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 6, 6) ) THEN @@ -4370,20 +4018,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (USSX (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/06', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_RECV_INIT (USSY (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/06', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 6, 7) ) THEN @@ -4391,20 +4035,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (PRMS (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/07', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_RECV_INIT (TPMS (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/07', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 6, 8) ) THEN @@ -4413,11 +4053,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (US3D(I0,IK),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, 'US3D ', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -4427,11 +4065,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (P2SMS(I0,K),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, 'P3SMS', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -4440,20 +4076,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (TAUICE (I0,1),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/10', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_RECV_INIT (TAUICE (I0,2),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/10', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 6,11) ) THEN @@ -4461,11 +4093,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (PHICE (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/11', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 6, 12) ) THEN @@ -4474,11 +4104,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (USSP(I0,IK),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, 'USSP ', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END DO END IF ! @@ -4487,20 +4115,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (TAUOCX(I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/13', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_RECV_INIT (TAUOCY(I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 6/13', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 7, 1) ) THEN @@ -4508,20 +4132,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (ABA (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 7/01', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_RECV_INIT (ABD (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 7/01', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 7, 2) ) THEN @@ -4529,20 +4149,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (UBA (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 7/02', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_RECV_INIT (UBD (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 7/02', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 7, 3) ) THEN @@ -4550,29 +4166,23 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (BEDFORMS(I0,1),1,WW3_FIELD_VEC, IFROM, & IT, MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 7/03', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_RECV_INIT (BEDFORMS(I0,2),1,WW3_FIELD_VEC, IFROM, & IT, MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 7/03', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_RECV_INIT (BEDFORMS(I0,3),1,WW3_FIELD_VEC, IFROM, & IT, MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 7/03', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 7, 4) ) THEN @@ -4580,11 +4190,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (PHIBBL(I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 7/04', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 7, 5) ) THEN @@ -4592,20 +4200,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (TAUBBL(I0,1),1,WW3_FIELD_VEC, IFROM, & IT, MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 7/05', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_RECV_INIT (TAUBBL(I0,2),1,WW3_FIELD_VEC, IFROM, & IT, MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 7/05', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 8, 1) ) THEN @@ -4613,20 +4217,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (MSSX (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 8/01', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_RECV_INIT (MSSY (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 8/01', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 8, 2) ) THEN @@ -4634,20 +4234,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (MSCX (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 8/02', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT + 1 CALL MPI_RECV_INIT (MSCY (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 8/02', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 8, 3) ) THEN @@ -4655,11 +4251,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (MSSD (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 8/03', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 8, 4) ) THEN @@ -4667,11 +4261,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (MSCD (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 8/04', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 8, 5) ) THEN @@ -4679,11 +4271,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (QP (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 8/05', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 8, 6) ) THEN @@ -4691,67 +4281,49 @@ SUBROUTINE W3MPIO ( IMOD ) 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( 8, 7) ) THEN IH = IH + 1 IT = IT + 1 CALL MPI_RECV_INIT (SKEW (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 8/07', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF -#endif ! -#ifdef W3_MPI IF ( FLGRDALL( 8, 8) ) THEN IH = IH + 1 IT = IT + 1 CALL MPI_RECV_INIT (EMBIA1 (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 8/08', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF -#endif ! -#ifdef W3_MPI IF ( FLGRDALL( 8, 9) ) THEN IH = IH + 1 IT = IT + 1 CALL MPI_RECV_INIT (EMBIA2 (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 8/09', 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 CALL MPI_RECV_INIT (DTDYN(I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 9/01', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 9, 2) ) THEN @@ -4759,11 +4331,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (FCUT (I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 9/02', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 9, 3) ) THEN @@ -4771,11 +4341,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (CFLXYMAX(I0),1,WW3_FIELD_VEC, IFROM, IT,& MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 9/03', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 9, 4) ) THEN @@ -4783,11 +4351,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (CFLTHMAX(I0),1,WW3_FIELD_VEC, IFROM, IT,& MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 9/04', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLGRDALL( 9, 5) ) THEN @@ -4795,11 +4361,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (CFLKMAX(I0),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9011) IH, ' 9/05', IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF ! DO I=1, NOEXTR @@ -4809,25 +4373,21 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT + 1 CALL MPI_RECV_INIT (USERO(I0,I),1,WW3_FIELD_VEC, IFROM, IT, & MPI_COMM_WAVE, IRQGO2(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (STRING,'(A3,I2.2)') '10/', I WRITE (NDST,9011) IH, STRING, IFROM, IT, IRQGO2(IH), IERR #endif -#ifdef W3_MPI END IF END DO ! END DO ! NRQGO2 = IH -#endif #ifdef W3_MPIT WRITE (NDST,9012) WRITE (NDST,9014) NRQGO2, NRQMAX*NAPROC #endif ! -#ifdef W3_MPI CALL W3SETA ( IMOD, NDSE, NDST ) ! END IF ! IF ( IAPROC .EQ. NAPFLD ) THEN @@ -4853,7 +4413,6 @@ SUBROUTINE W3MPIO ( IMOD ) ALLOCATE ( OUTPTS(IMOD)%OUT4%IRQRS(3*NAPROC) ) ENDIF IRQRS => OUTPTS(IMOD)%OUT4%IRQRS -#endif ! ! 2.b Fields at end of file (always) ! @@ -4861,39 +4420,32 @@ SUBROUTINE W3MPIO ( IMOD ) WRITE (NDST,9020) #endif ! -#ifdef W3_MPI IF ( IAPROC.NE.NAPRST .AND. IAPROC.LE.NAPROC ) THEN ! IH = IH + 1 IT = IT0 + 1 CALL MPI_SEND_INIT (UST (IAPROC), 1, WW3_FIELD_VEC, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S U*', IROOT, IT, IRQRS(IH), IERR #endif ! -#ifdef W3_MPI IH = IH + 1 IT = IT0 + 2 CALL MPI_SEND_INIT (USTDIR(IAPROC), 1, WW3_FIELD_VEC, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S UD', IROOT, IT, IRQRS(IH), IERR #endif ! -#ifdef W3_MPI IH = IH + 1 IT = IT0 + 3 CALL MPI_SEND_INIT (FPIS(IAPROC), 1, WW3_FIELD_VEC, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S FP', IROOT, IT, IRQRS(IH), IERR #endif ! -#ifdef W3_MPI ELSE IF ( IAPROC .EQ. NAPRST ) THEN DO I0=1, NAPROC IFROM = I0 - 1 @@ -4903,31 +4455,25 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 1 CALL MPI_RECV_INIT (UST (I0),1,WW3_FIELD_VEC, & IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R U*', IFROM, IT, IRQRS(IH), IERR #endif ! -#ifdef W3_MPI IH = IH + 1 IT = IT0 + 2 CALL MPI_RECV_INIT (USTDIR(I0),1,WW3_FIELD_VEC, & IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R UD', IFROM, IT, IRQRS(IH), IERR #endif ! -#ifdef W3_MPI IH = IH + 1 IT = IT0 + 3 CALL MPI_RECV_INIT (FPIS(I0),1,WW3_FIELD_VEC, & IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R FP', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF END DO END IF @@ -4938,20 +4484,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 4 CALL MPI_SEND_INIT (CX(IAPROC), 1, WW3_FIELD_VEC, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S CX', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT0 + 5 CALL MPI_SEND_INIT (CY(IAPROC), 1, WW3_FIELD_VEC, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S CY', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 1, 12) ) THEN @@ -4959,11 +4501,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 6 CALL MPI_SEND_INIT (ICEF(IAPROC), 1, WW3_FIELD_VEC, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S IF', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 2, 1) ) THEN @@ -4971,11 +4511,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 7 CALL MPI_SEND_INIT (HS (1), NSEALM, MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S HS', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 2, 2) ) THEN @@ -4983,11 +4521,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 8 CALL MPI_SEND_INIT (WLM (1), NSEALM, MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S WL', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 2, 4) ) THEN @@ -4995,11 +4531,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 9 CALL MPI_SEND_INIT (T0M1(1), NSEALM, MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S T0', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI ENDIF ! IF ( FLOGRR( 2, 5) ) THEN @@ -5007,11 +4541,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 10 CALL MPI_SEND_INIT (T01 (1), NSEALM, MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S T1', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI ENDIF ! IF ( FLOGRR( 2, 6) ) THEN @@ -5019,11 +4551,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 11 CALL MPI_SEND_INIT (FP0 (1), NSEALM, MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S FP', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 2, 7) ) THEN @@ -5031,11 +4561,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 12 CALL MPI_SEND_INIT (THM (1), NSEALM, MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S TH', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 2, 19) ) THEN @@ -5043,11 +4571,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 13 CALL MPI_SEND_INIT (WNMEAN(1), NSEALM, MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S WM', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 5, 2) ) THEN @@ -5055,11 +4581,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 14 CALL MPI_SEND_INIT (CHARN(1), NSEALM, MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S CH', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI ENDIF ! IF ( FLOGRR( 5, 5) ) THEN @@ -5067,20 +4591,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 15 CALL MPI_SEND_INIT (TAUWIX(1), NSEALM, MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S WX', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT0 + 16 CALL MPI_SEND_INIT (TAUWIY(1), NSEALM, MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S WY', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 5, 11) ) THEN @@ -5088,11 +4608,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 17 CALL MPI_SEND_INIT (TWS (1), NSEALM, MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S TS', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 6, 2) ) THEN @@ -5100,20 +4618,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 18 CALL MPI_SEND_INIT (TAUOX(1), NSEALM, MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S OX', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT0 + 19 CALL MPI_SEND_INIT (TAUOY(1), NSEALM, MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S OY', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 6, 3) ) THEN @@ -5121,11 +4635,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 20 CALL MPI_SEND_INIT (BHD (1), NSEALM, MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S BH', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 6, 4) ) THEN @@ -5133,11 +4645,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 21 CALL MPI_SEND_INIT (PHIOC(1), NSEALM, MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S PH', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 6, 5) ) THEN @@ -5145,20 +4655,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 22 CALL MPI_SEND_INIT (TUSX (1), NSEALM, MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S UX', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT0 + 23 CALL MPI_SEND_INIT (TUSY (1), NSEALM, MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S UY', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 6, 6) ) THEN @@ -5166,20 +4672,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 24 CALL MPI_SEND_INIT (USSX (1), NSEALM, MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S SX', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT0 + 25 CALL MPI_SEND_INIT (USSY (1), NSEALM, MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S SY', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 6,10) ) THEN @@ -5187,20 +4689,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 26 CALL MPI_SEND_INIT (TAUICE(1,1), NSEALM, MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S I1', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT0 + 27 CALL MPI_SEND_INIT (TAUICE(1,2), NSEALM, MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S I2', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 6,13) ) THEN @@ -5208,20 +4706,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 28 CALL MPI_SEND_INIT (TAUOCX(1), NSEALM, MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S TX', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT0 + 29 CALL MPI_SEND_INIT (TAUOCY(1), NSEALM, MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S TY', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 7, 2) ) THEN @@ -5229,20 +4723,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 30 CALL MPI_SEND_INIT (UBA (1), NSEALM, MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S BA', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT0 + 31 CALL MPI_SEND_INIT (UBD (1), NSEALM, MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S BD', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 7, 4) ) THEN @@ -5250,11 +4740,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 32 CALL MPI_SEND_INIT (PHIBBL(1), NSEALM, MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S PB', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 7, 5) ) THEN @@ -5262,20 +4750,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 33 CALL MPI_SEND_INIT (TAUBBL(1,1), NSEALM, MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S T1', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT0 + 34 CALL MPI_SEND_INIT (TAUBBL(1,2), NSEALM, MPI_REAL, & IROOT, IT, MPI_COMM_WAVE, IRQRS(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'S T2', IROOT, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( IAPROC .EQ. NAPRST ) THEN @@ -5289,20 +4773,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 4 CALL MPI_RECV_INIT (CX (I0),1,WW3_FIELD_VEC, & IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R CX', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI IH = IT0 + 5 IT = IT + 1 CALL MPI_RECV_INIT (CY (I0),1,WW3_FIELD_VEC, & IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R CY', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 1, 12) ) THEN @@ -5310,11 +4790,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 6 CALL MPI_RECV_INIT (ICEF (I0),1,WW3_FIELD_VEC, & IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R IF', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 2, 1) ) THEN @@ -5322,11 +4800,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 7 CALL MPI_RECV_INIT (HS (I0),1,WW3_FIELD_VEC, & IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R HS', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 2, 2) ) THEN @@ -5334,11 +4810,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 8 CALL MPI_RECV_INIT (WLM (I0),1,WW3_FIELD_VEC, & IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R WL', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 2, 4) ) THEN @@ -5346,11 +4820,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 9 CALL MPI_RECV_INIT (T0M1(I0),1,WW3_FIELD_VEC, & IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R T0', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI ENDIF ! IF ( FLOGRR( 2, 5) ) THEN @@ -5358,11 +4830,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 10 CALL MPI_RECV_INIT (T01 (I0),1,WW3_FIELD_VEC, & IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R T1', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI ENDIF ! IF ( FLOGRR( 2, 6) ) THEN @@ -5370,11 +4840,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 11 CALL MPI_RECV_INIT (FP0 (I0),1,WW3_FIELD_VEC, & IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R FP', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 2, 7) ) THEN @@ -5382,11 +4850,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 12 CALL MPI_RECV_INIT (THM (I0),1,WW3_FIELD_VEC, & IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R TH', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 2, 19) ) THEN @@ -5394,11 +4860,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 13 CALL MPI_RECV_INIT (WNMEAN(I0),1,WW3_FIELD_VEC, & IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R WM', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 5, 2) ) THEN @@ -5406,11 +4870,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 14 CALL MPI_RECV_INIT (CHARN(I0),1,WW3_FIELD_VEC, & IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R CH', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI ENDIF ! IF ( FLOGRR( 5, 5) ) THEN @@ -5418,20 +4880,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 15 CALL MPI_RECV_INIT (TAUWIX(I0),1,WW3_FIELD_VEC,& IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R WX', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT0 + 16 CALL MPI_RECV_INIT (TAUWIY(I0),1,WW3_FIELD_VEC,& IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R WY', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 5,11) ) THEN @@ -5439,11 +4897,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 17 CALL MPI_RECV_INIT (TWS (I0),1,WW3_FIELD_VEC, & IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R TS', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 6, 2) ) THEN @@ -5451,20 +4907,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 18 CALL MPI_RECV_INIT (TAUOX(I0),1,WW3_FIELD_VEC, & IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R OX', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT0 + 19 CALL MPI_RECV_INIT (TAUOY(I0),1,WW3_FIELD_VEC, & IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R OY', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 6, 3) ) THEN @@ -5472,11 +4924,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 20 CALL MPI_RECV_INIT (BHD (I0),1,WW3_FIELD_VEC, & IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R BH', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 6, 4) ) THEN @@ -5484,11 +4934,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 21 CALL MPI_RECV_INIT (PHIOC(I0),1,WW3_FIELD_VEC, & IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R PH', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 6, 5) ) THEN @@ -5496,20 +4944,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 22 CALL MPI_RECV_INIT (TUSX (I0),1,WW3_FIELD_VEC, & IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R UX', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT0 + 23 CALL MPI_RECV_INIT (TUSY (I0),1,WW3_FIELD_VEC, & IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R UY', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 6, 6) ) THEN @@ -5517,20 +4961,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 24 CALL MPI_RECV_INIT (USSX (I0),1,WW3_FIELD_VEC, & IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R SX', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT0 + 25 CALL MPI_RECV_INIT (USSY (I0),1,WW3_FIELD_VEC, & IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R SY', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 6,10) ) THEN @@ -5538,20 +4978,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 26 CALL MPI_RECV_INIT (TAUICE(I0,1),1,WW3_FIELD_VEC,& IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R I1', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT0 + 27 CALL MPI_RECV_INIT (TAUICE(I0,2),1,WW3_FIELD_VEC,& IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R I2', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 6,13) ) THEN @@ -5559,20 +4995,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 28 CALL MPI_RECV_INIT (TAUOCX(I0),1,WW3_FIELD_VEC,& IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R SX', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT0 + 29 CALL MPI_RECV_INIT (TAUOCY(I0),1,WW3_FIELD_VEC,& IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R SY', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 7, 2) ) THEN @@ -5580,20 +5012,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 30 CALL MPI_RECV_INIT (UBA (I0),1,WW3_FIELD_VEC, & IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R BA', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT0 + 31 CALL MPI_RECV_INIT (UBD (I0),1,WW3_FIELD_VEC, & IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R BD', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 7, 4) ) THEN @@ -5601,11 +5029,9 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 32 CALL MPI_RECV_INIT (PHIBBL(I0),1,WW3_FIELD_VEC,& IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R PB', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF ! IF ( FLOGRR( 7, 5) ) THEN @@ -5613,20 +5039,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 33 CALL MPI_RECV_INIT (TAUBBL(I0,1),1,WW3_FIELD_VEC,& IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R T1', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT0 + 34 CALL MPI_RECV_INIT (TAUBBL(I0,2),1,WW3_FIELD_VEC,& IFROM, IT, MPI_COMM_WAVE, IRQRS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9021) IH, 'R T2', IFROM, IT, IRQRS(IH), IERR #endif -#ifdef W3_MPI END IF END DO ! @@ -5640,7 +5062,6 @@ SUBROUTINE W3MPIO ( IMOD ) ELSE IT0 = IT0 + 3 ENDIF -#endif ! #ifdef W3_MPIT WRITE (NDST,9022) @@ -5649,19 +5070,16 @@ SUBROUTINE W3MPIO ( IMOD ) ! ! 2.c Data server mode ! -#ifdef W3_MPI IF ( IOSTYP .GT. 0 ) THEN ! NBLKRS = 10 RSBLKS = MAX ( 5 , NSEALM/NBLKRS ) IF ( NBLKRS*RSBLKS .LT. NSEALM ) RSBLKS = RSBLKS + 1 NBLKRS = 1 + (NSEALM-1)/RSBLKS -#endif ! #ifdef W3_MPIT WRITE (NDST,9025) RSBLKS, NBLKRS #endif -#ifdef W3_MPI IH = 0 ! IF ( IAPROC .NE. NAPRST ) THEN @@ -5677,11 +5095,9 @@ SUBROUTINE W3MPIO ( IMOD ) NSEAB = 1 + JSEAN - JSEA0 CALL MPI_SEND_INIT (VA(1,JSEA0), NSPEC*NSEAB, MPI_REAL, IROOT, IT, & MPI_COMM_WAVE, IRQRSS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9026) IH, 'S', IB, IROOT, IT, IRQRSS(IH), IERR, NSEAB #endif -#ifdef W3_MPI END DO ! ELSE @@ -5703,33 +5119,27 @@ SUBROUTINE W3MPIO ( IMOD ) IBOFF = MOD(IB-1,2)*RSBLKS CALL MPI_RECV_INIT (VAAUX(1,1+IBOFF,I0), NSPEC*NSEAB, MPI_REAL, & IFROM, IT, MPI_COMM_WAVE, IRQRSS(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9026) IH, 'R', IB, IFROM, IT, IRQRSS(IH), IERR, NSEAB #endif -#ifdef W3_MPI END IF END DO END DO ! END IF -#endif ! #ifdef W3_MPIT WRITE (NDST,9027) WRITE (NDST,9028) IH #endif -#ifdef W3_MPI IT0 = IT0 + NBLKRS ! END IF ! END IF ! IF ((FLOUT(4) .OR. FLOUT(8)) .and. (.not. LPDLIB)) THEN -#endif ! ! 3. Set-up for W3IOBC ( SENDs ) ------------------------------------ / ! -#ifdef W3_MPI NRQBP = 0 NRQBP2 = 0 IH = 0 @@ -5741,7 +5151,6 @@ SUBROUTINE W3MPIO ( IMOD ) OUTPTS(IMOD)%OUT5%IRQBP2(NBO2(NFBPO)) ) IRQBP1 => OUTPTS(IMOD)%OUT5%IRQBP1 IRQBP2 => OUTPTS(IMOD)%OUT5%IRQBP2 -#endif ! ! 3.a Loops over files and points ! @@ -5749,7 +5158,6 @@ SUBROUTINE W3MPIO ( IMOD ) WRITE (NDST,9030) 'MPI_SEND_INIT' #endif ! -#ifdef W3_MPI DO J=1, NFBPO DO I=NBO2(J-1)+1, NBO2(J) ! @@ -5766,22 +5174,17 @@ SUBROUTINE W3MPIO ( IMOD ) IH = IH + 1 CALL MPI_SEND_INIT (VA(1,JSEA),NSPEC,MPI_REAL, IROOT, IT, MPI_COMM_WAVE, & IRQBP1(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9031) IH, I, J, IROOT, IT, IRQBP1(IH), IERR #endif -#ifdef W3_MPI END IF ! END DO END DO -#endif ! ! ... End of loops 4.a ! -#ifdef W3_MPI NRQBP = IH -#endif ! #ifdef W3_MPIT WRITE (NDST,9032) @@ -5790,12 +5193,10 @@ SUBROUTINE W3MPIO ( IMOD ) ! ! 3.d Set-up for W3IOBC ( RECVs ) ------------------------------------ / ! -#ifdef W3_MPI IF ( IAPROC .EQ. NAPBPT ) THEN ! IH = 0 IT = IT0 -#endif ! ! 3.e Loops over files and points ! @@ -5803,7 +5204,6 @@ SUBROUTINE W3MPIO ( IMOD ) WRITE (NDST,9030) 'MPI_RECV_INIT' #endif ! -#ifdef W3_MPI DO J=1, NFBPO DO I=NBO2(J-1)+1, NBO2(J) ! @@ -5819,17 +5219,14 @@ SUBROUTINE W3MPIO ( IMOD ) ITARG = ISPROC - 1 CALL MPI_RECV_INIT (ABPOS(1,IH),NSPEC,MPI_REAL, ITARG, IT, MPI_COMM_WAVE, & IRQBP2(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9031) IH, I, J, ITARG, IT, IRQBP2(IH), IERR #endif ! -#ifdef W3_MPI END DO END DO ! NRQBP2 = IH -#endif ! ! ... End of loops 4.e ! @@ -5838,13 +5235,11 @@ SUBROUTINE W3MPIO ( IMOD ) WRITE (NDST,9033) NRQBP2 #endif ! -#ifdef W3_MPI END IF ! IT0 = IT0 + NBO2(NFBPO) ! END IF -#endif ! #ifdef W3_MPIT WRITE (NDST,*) @@ -5852,12 +5247,10 @@ SUBROUTINE W3MPIO ( IMOD ) ! ! 4. Set-up for W3IOTR ---------------------------------------------- / ! -#ifdef W3_MPI IH = 0 IROOT = NAPTRK - 1 ! IF ( FLOUT(3) ) THEN -#endif ! ! 4.a U* ! @@ -5865,7 +5258,6 @@ SUBROUTINE W3MPIO ( IMOD ) WRITE (NDST,9040) #endif ! -#ifdef W3_MPI IF ( IAPROC .NE. NAPTRK ) THEN ALLOCATE ( OUTPTS(IMOD)%OUT3%IRQTR(2) ) IRQTR => OUTPTS(IMOD)%OUT3%IRQTR @@ -5873,20 +5265,16 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 1 CALL MPI_SEND_INIT (UST (IAPROC),1,WW3_FIELD_VEC, IROOT, IT, MPI_COMM_WAVE, & IRQTR(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9041) IH, 'S U*', IROOT, IT, IRQTR(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT0 + 2 CALL MPI_SEND_INIT (USTDIR(IAPROC),1,WW3_FIELD_VEC, IROOT, IT, MPI_COMM_WAVE, & IRQTR(IH), IERR ) -#endif #ifdef W3_MPIT WRITE (NDST,9041) IH, 'S U*', IROOT, IT, IRQTR(IH), IERR #endif -#ifdef W3_MPI ELSE ALLOCATE ( OUTPTS(IMOD)%OUT3%IRQTR(2*NAPROC) ) IRQTR => OUTPTS(IMOD)%OUT3%IRQTR @@ -5897,40 +5285,32 @@ SUBROUTINE W3MPIO ( IMOD ) IT = IT0 + 1 CALL MPI_RECV_INIT(UST (I0),1,WW3_FIELD_VEC, IFROM, IT, MPI_COMM_WAVE, & IRQTR(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9041) IH, 'R U*', IFROM, IT, IRQTR(IH), IERR #endif -#ifdef W3_MPI IH = IH + 1 IT = IT0 + 2 CALL MPI_RECV_INIT(USTDIR(I0),1,WW3_FIELD_VEC, IFROM, IT, MPI_COMM_WAVE, & IRQTR(IH), IERR) -#endif #ifdef W3_MPIT WRITE (NDST,9041) IH, 'R U*', IFROM, IT, IRQTR(IH), IERR #endif -#ifdef W3_MPI END IF END DO END IF ! NRQTR = IH IT0 = IT0 + 2 -#endif ! #ifdef W3_MPIT WRITE (NDST,9042) WRITE (NDST,9043) NRQTR #endif ! -#ifdef W3_MPI END IF -#endif ! ! 5. Set-up remaining counters -------------------------------------- / ! -#ifdef W3_MPI IT0PRT = IT0 IT0PNT = IT0PRT + 2*NAPROC IT0TRK = IT0PNT + 5000