Skip to content

Commit b582f8c

Browse files
authored
HF ounfpart + NCO switch + DB1 coeff (#14)
Merging Hotfixes branch HF_ounfpart into the WW3 master. * Bugfix in ww3_ounf.ftn: NBIPART check against NOSWLL was not accouting for zeroth wind partition. See Issue #2. * Updating link.wcoss_phase2 for grib compile, removing !$ lines in ww3_uprstr that broke compilation of codes with OMPH OMPG switch flags, added new global wave model switch. Added option for writing to fixed netcdf gridded output file when using NCO switch (the issue will be fixed more adequately in v7 following Issue #8). * DB1 depth-breaking_bugfix: added proper scaling coefficients for radian freq. [radHz]. See issue #7. Merge will lead to v6.07.1, tag and release will be updated accordingly.
1 parent 913dc83 commit b582f8c

22 files changed

+112
-77
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# The WAVEWATCH III Framework
22

3-
WAVEWATCH III ™ is a community wave modeling framework that includes the
3+
WAVEWATCH III ® is a community wave modeling framework that includes the
44
latest scientific advancements in the field of wind-wave modeling and dynamics.
55

66
## General Features
@@ -11,7 +11,7 @@ for shallow-water (surf zone) applications, as well as wetting and drying of
1111
grid points. Propagation of a wave spectrum can be solved using regular
1212
(rectilinear or curvilinear) and unstructured (triangular) grids. See
1313
[About WW3](https://github.com/NOAA-EMC/WW3/wiki/About-WW3) for a
14-
detailed description of WAVEWATCH III ™.
14+
detailed description of WAVEWATCH III ®.
1515

1616
## Installation
1717

model/bin/link.cray_xc.Intel

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@
8282

8383
# Intel compiler ------------------------------------------------------------
8484
# 3.a Build options and determine compiler name
85-
# No GRIB libraries for this one
8685

8786
opt="-o $prog"
8887
opt="$opt -xHost -O3 -ip -fno-alias -fp-model strict -no-fma -ftz"
@@ -121,7 +120,14 @@
121120
fi
122121
fi
123122

124-
# netcdf library dir
123+
if [ "$ncep_grib_compile" = 'yes' ]
124+
then
125+
# GRIB libraries for this one
126+
opt="$opt -convert big_endian -assume byterecl -prec-div -prec-sqrt -ip"
127+
libs="$libs ${G2_LIB4} ${W3NCO_LIB4} ${BACIO_LIB4} ${JASPER_LIB} ${PNG_LIB} ${Z_LIB}"
128+
fi
129+
130+
# netcdf library dir
125131
if [ "$netcdf_compile" = 'yes' ]
126132
then
127133
case $WWATCH3_NETCDF in

model/bin/link.wcoss_phase2

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,11 @@
140140
esac
141141
fi
142142

143-
if [ "$prog" = 'ww3_grib' ]
143+
# NCEP grib creation
144+
if [ "$ncep_grib_compile" = 'yes' ]
144145
then
146+
# GRIB libraries for this one
147+
opt="$opt -convert big_endian -assume byterecl -prec-div -prec-sqrt -ip"
145148
libs="$libs ${G2_LIB4} ${W3NCO_LIB4} ${BACIO_LIB4} ${JASPER_LIB} ${PNG_LIB} ${Z_LIB}"
146149
fi
147150

model/bin/switch_NCEP_glwu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
F90 NCO NOPA LRB4 NCEP2 DIST MPI SCRIP SCRIPNC NC4 PR3 UQ ST4 STAB0 FLX0 LN1 NL3 BT1 DB1 IC0 IS0 REF0 MLIM TR0 BS0 XX0 WNX1 WNT1 CRX1 CRT1 O0 O1 O2 O4 O5 O6 O7 O14 O15

model/bin/switch_NCEP_gwm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
F90 NCO NOPA LRB4 NOGRB DIST MPI OMPH OMPG SCRIP SCRIPNC NC4 PR3 UQ ST4 STAB0 FLX0 LN1 NL1 BT1 DB1 IC4 IS0 REF0 TR0 BS0 XX0 WNX1 WNT1 CRX1 CRT1 RWND O0 O1 O2 O4 O5 O6 O7 O14 O15

model/bin/w3_make

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,13 @@
161161
cdf_programs="$cdf_programs ww3_prtide"
162162
fi
163163

164+
# NCEP GRIB
165+
export ncep_grib_compile="no"
166+
if [ -n "`grep NCEP $switch_file`" ]
167+
then
168+
export ncep_grib_compile="yes"
169+
fi
170+
164171
# MULTI MULTI_ESMF SBS1
165172
if [ -n "`grep SCRIPNC $switch_file`" ] || [ -n "`grep OASIS $switch_file`" ] || [ -n "`grep PDLIB $switch_file`" ]
166173
then

model/ftn/w3sdb1md.ftn

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,27 +57,37 @@
5757
!/ | FORTRAN 90 |
5858
!/ | J. H. Alves |
5959
!/ | H. L. Tolman |
60+
!/ ! A. Roland |
6061
!/ | Last update : 08-Jun-2018 |
6162
!/ +-----------------------------------+
6263
!/
6364
!/ 25-Apr-2007 : Origination of module. ( version 3.11 )
6465
!/ 08-Jun-2018 : Add DEBUGDB1. ( version 6.04 )
66+
!/ 03-Apr-2019 : Rewrite in terms of energy density (A. Roland,version 6.07)
67+
!/ 03-Apr-2019 : Add Thornton & Guza, 1983 (A. Roland,version 6.07)
6568
!/
6669
! 1. Purpose :
6770
!
6871
! Compute depth-induced breaking using Battjes and Janssen bore
6972
! model approach
7073
!
71-
! 2. Method :
72-
!
73-
! Sdb = - CDB * FMEAN * QB * B * B * SPEC
74-
!
75-
! Where CDB = SDBC1 = 0.25 * BJALFA (defaults to BJALFA = 1)
76-
! modified via ww3_grid namelist parameter BJALFA
77-
! B = HM / HRMS
78-
! HM = GAMMA * DEP
79-
! GAMMA = SDBC2 defaults to 0.73 (mean Battjes/Janssen value)
80-
! modified via ww3_grid namelist parameter BJGAM
74+
! 2. Method : Battjes & Janssen (1978),
75+
!
76+
! Sbr = Dtot/Etot*WA = D * WA
77+
! Dtot = 0.25*alpha*Qb*fm*Hmax²
78+
! fm = sigma/2Pi
79+
! BB = Hrms²/Hmax² = 8Etot/Hmax²
80+
! D = Dtot/Etot = BJALFA * sigma / pi * Qb/BB = 2 * BJALFA * fm * Qb/BB
81+
!
82+
! AR: only valid for Hrms .le. Hm, Qb .le. 1, otherwise, in the degenrative regime it is
83+
! due to Qb > 1 that all wave are broken and Hrms .le. Hmax
84+
! MLIM can be used to enforce this conditions, source term will smoothly converge to this limit.
85+
!
86+
! Where CDB = SDBC1 = BJALFA (defaults to BJALFA = 1)
87+
! modified via ww3_grid namelist parameter BJALFA
88+
! HM = GAMMA * DEP
89+
! GAMMA = SDBC2 defaults to 0.73 (mean Battjes/Janssen value)
90+
! modified via ww3_grid namelist parameter BJGAM
8191
!
8292
! And QB is estimated by iterations using the nonlinear expression
8393
!
@@ -145,7 +155,6 @@
145155
!/
146156
INTEGER, INTENT(IN) :: IX ! Local grid number
147157
REAL, INTENT(IN) :: A(NSPEC)
148-
!AR: This below is not good I know ... we need more inlined methods ...
149158
REAL, INTENT(INOUT) :: EMEAN, FMEAN, WNMEAN, DEPTH
150159
REAL, INTENT(OUT) :: S(NSPEC), D(NSPEC)
151160
REAL, INTENT(IN) :: CG(NK)
@@ -179,7 +188,7 @@
179188
!
180189
!/T WRITE (NDST,9000) SDBC1, SDBC2, FDONLY
181190
!
182-
! 1. Integral quantities ... only for the case when it is used nonlinear in the solver ...
191+
! 1. Integral quantities. AR: make sure mean quantities are computed, need to move upward
183192
!
184193
ETOT = 0.
185194
FMEAN2 = 0.
@@ -256,16 +265,16 @@
256265
IF (IWB == 1) THEN
257266
IF ( ( BB .GT. THR) .AND. ( ABS ( BB - QB ) .GT. THR) ) THEN
258267
IF ( BB .LT. 1.0) THEN
259-
CBJ = DBLE(SDBC1) * QB * DBLE(FMEAN) / BB
268+
CBJ = 2 * DBLE(SDBC1) * QB * DBLE(FMEAN) / BB
260269
ELSE
261-
CBJ = DBLE(SDBC1) * DBLE(FMEAN) * BB ! Make sure the energy vanishes ...
270+
CBJ = 2 * DBLE(SDBC1) * DBLE(FMEAN) * BB ! AR: degenerative regime, all waves must be .le. Hmax, we just smoothly let the excessive energy vanish by * BB.
262271
END IF
263272
ELSE
264273
CBJ = 0.d0
265274
ENDIF
266275
D = - CBJ
267276
S = D * A
268-
ELSE IF (IWB == 2) THEN
277+
ELSE IF (IWB == 2) THEN
269278
IF (ETOT .GT. THR) THEN
270279
HRMS = SQRT(8*EMEAN)
271280
FAK = (1+4./SQRT(PI)*(B*BB+1.5*B)*exp(-BB)-ERF(B))
@@ -275,7 +284,6 @@
275284
ENDIF
276285
D = - CBJ
277286
S = D * A
278-
ELSE IF (IWB == 3) THEN
279287
ENDIF
280288

281289
IF (CBJ .GT. 0.) THEN

model/ftn/ww3_grid.ftn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1888,7 +1888,7 @@
18881888
!/DB1 ' Using Hmax/d in Miche style formulation.'
18891889
!/DB1 END IF
18901890
!/DB1 WRITE (NDSO,*)
1891-
!/DB1 SDBC1 = 0.25 * BJALFA
1891+
!/DB1 SDBC1 = BJALFA
18921892
!/DB1 SDBC2 = BJGAM
18931893
!/DB1 FDONLY = BJFLAG
18941894
!

model/ftn/ww3_ounf.ftn

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
!/ | F. Ardhuin |
88
!/ | M. Accensi |
99
!/ | FORTRAN 90 |
10-
!/ | Last update : 12-Sep-2018 |
10+
!/ | Last update : 28-Mar-2019 |
1111
!/ +-----------------------------------+
1212
!/
1313
!/ 17-Mar-2010 : Creation ( version 3.14_SHOM )
@@ -31,6 +31,7 @@
3131
!/ 26-Jul-2018 : Changed reading of TABIPART ( version 6.05 )
3232
!/ 12-Sep-2018 : Added extra partitioned fields ( version 6.06 )
3333
!/ 25-Sep-2018 : Add WBT parameter ( version 6.06 )
34+
!/ 28-Mar-2019 : Bugfix to NBIPART check. ( version 6.07 )
3435
!/
3536
!/ Copyright 2009-2013 National Weather Service (NWS),
3637
!/ National Oceanic and Atmospheric Administration. All rights
@@ -381,7 +382,7 @@
381382

382383
! Alternative processing of TABIPART to capture requests
383384
! greater than NOSWLL (C.Bunney):
384-
ALLOCATE(TABIPART(NOSWLL))
385+
ALLOCATE(TABIPART(NOSWLL + 1))
385386
NBIPART=0
386387
DO I=1,30
387388
IF(STRINGIPART(I:I) .EQ. ' ') CYCLE
@@ -391,7 +392,7 @@
391392
CYCLE
392393
ENDIF
393394
NBIPART = NBIPART + 1
394-
IF(NBIPART .GT. NOSWLL) THEN
395+
IF(NBIPART .GT. NOSWLL + 1) THEN
395396
GOTO 803
396397
ENDIF
397398
TABIPART(NBIPART) = IPART
@@ -3397,6 +3398,9 @@
33973398
FNAMENC(S1+S2+1:S1+S2+3) = '.nc'
33983399
FNAMENC(S1+S2+4:S1+S2+6) = ' '
33993400

3401+
!/NCO ! For NCEP application, requires fixed netcdf file name
3402+
!/NCO FNAMENC='ww3.gridded.nc'
3403+
34003404
! If the flag frequency is .TRUE., defines the fourth dimension
34013405
IF (FLFRQ) THEN
34023406
UNITVAR(:)=UNITS

model/ftn/ww3_ounp.ftn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@
202202
!/MPI INTEGER :: IERR_MPI
203203
!/O14 INTEGER :: NDBO
204204
!/S INTEGER, SAVE :: IENT = 0
205-
!/NCO INTEGER :: NDSTAB
205+
!/NCO INTEGER :: NDSTAB, NDST
206206
!
207207
INTEGER, ALLOCATABLE :: INDREQ(:), INDREQTMP(:)
208208
INTEGER,ALLOCATABLE :: NCID(:)

0 commit comments

Comments
 (0)