Skip to content

Commit

Permalink
Merge pull request #15 from MatthewMasarik-NOAA/sync-dev-unified
Browse files Browse the repository at this point in the history
Langmuir PR: regtest and documentation polishing
  • Loading branch information
alperaltuntas authored Dec 8, 2023
2 parents 7f29db6 + 4c0ee1c commit 90cd7c4
Show file tree
Hide file tree
Showing 30 changed files with 185 additions and 504 deletions.
8 changes: 7 additions & 1 deletion model/inp/ww3_grid.inp
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ $ The LMPENABLED flag turns on the parameterization computations.
$ The SDTAIL flag enables the spectral tail contribution. HSLMODE
$ parameter determines the surface layer depth (HSL).
$
$ Langmuir parameters : Namelist LMPN
$ Input parameters : Namelist LMPN
$ LMPENABLED : Logical controlling Langmuir
$ related computations.
$ T : Activates calculations
Expand All @@ -446,6 +446,12 @@ $ depth (HSL) type.
$ 0 : Uniform HSL=10m (default)
$ 1 : HSL from coupler
$
$ Output parameters :
$ USS : surface Stokes drift
$ USSX/Y (netCDF: uuss/vuss)
$ USSH : surface layer averaged Stokes drift
$ USSHX/Y (netCDF: uussh/vussh)
$
$ For more info on the Langmuir parameterization, see:
$ Li, Qing, et al. "Langmuir mixing effects on global climate:
$ WAVEWATCH III in CESM." Ocean Modelling 103 (2016): 145-160.
Expand Down
2 changes: 1 addition & 1 deletion model/inp/ww3_ounf.inp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,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
$ WCF WCH WCM SXY TWO BHD FOC TUS USS USSH P2S USF P2L TWI FIC ABR UBR BED
$ FBB TBB MSS MSC DTD FC CFX CFD CFK U1 U2 WNM TOC
$
N
Expand Down
7 changes: 4 additions & 3 deletions model/inp/ww3_shel.inp
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,15 @@ $ F F 6 2 TAUO[X,Y] TWO Wave to ocean momentum flux
$ F F 6 3 BHD BHD Bernoulli head (J term)
$ F F 6 4 PHIOC FOC Wave to ocean energy flux
$ F F 6 5 TUS[X,Y] TUS Stokes transport
$ F F 6 6 USS[X,Y] USS Surface Stokes drift
$ F F 6 6 USS[X,Y] USS Surface layer Stokes drift
$ F F 6 7 [PR,TP]MS P2S Second-order sum pressure
$ F F 6 8 US3D USF Spectrum of surface Stokes drift
$ F F 6 9 P2SMS P2L Micro seism source term
$ F F 6 10 TAUICE TWI Wave to sea ice stress
$ F F 6 11 PHICE FIC Wave to sea ice energy flux
$ F F 6 12 USSP USP Partitioned surface Stokes drift
$ F F 6 13 TAUOC[X,Y] TOC Total momentum to the ocean
$ F F 6 14 USSH[X,Y] USSH Surface layer averaged Stokes drift
$ -------------------------------------------------
$ 7 Wave-bottom layer
$ -------------------------------------------------
Expand Down Expand Up @@ -257,8 +258,8 @@ $ UST CHA CGE FAW TAW TWA WCC WCF WCH WCM FWS
T T T T T T T T T T T
$ (6) Wave-Ocean layer
T
$ SXY TWO BHD FOC TUS USS P2S USF P2L TWI FIC USP
T T T T T T T F F F F T
$ SXY TWO BHD FOC TUS USS P2S USF P2L TWI FIC USP TOC USSH
T T T T T T T F F F F T T T
$ (7) Wave-bottom layer
T
$ ABR UBR BED FBB TBB
Expand Down
4 changes: 2 additions & 2 deletions model/src/w3odatmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ SUBROUTINE W3NOUT ( NDSERR, NDSTST )
!
! 6) Wave-ocean layer
!
NOGE(6) = 13
NOGE(6) = 14
!
IDOUT( 6, 1) = 'Radiation stresses '
IDOUT( 6, 2) = 'Wave-ocean mom. flux'
Expand All @@ -891,7 +891,7 @@ SUBROUTINE W3NOUT ( NDSERR, NDSTST )
IDOUT( 6,11) = 'Wave-ice energy flux'
IDOUT( 6,12) = 'Split Surface Stokes'
IDOUT( 6,13) = 'Tot wav-ocn mom flux'
IDOUT( 6,14) = 'Turbulent Langmuir number'
IDOUT( 6,14) = 'Stokes drift sfc ave'
!
! 7) Wave-bottom layer
!
Expand Down
25 changes: 25 additions & 0 deletions model/src/w3ounfmetamd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3744,6 +3744,30 @@ SUBROUTINE DEFAULT_META()
META(2)%VARNS=''
META(2)%VARNG=''
META(2)%VARNC='toc=sqrt(utoc**2+vtoc**2)'

! IFI=6, IFJ=14, USSH
META => GROUP(6)%FIELD(14)%META
META(1)%FSC = 0.0005
META(1)%UNITS = 'm s-1'
META(1)%ENAME = '.ussh'

! First component
META(1)%VARNM='uussh'
META(1)%VARNL='eastward surface averaged stokes drift'
META(1)%VARNS='sea_surface_wave_averaged_stokes_drift_eastward_velocity'
META(1)%VARNG='eastward_surface_averaged_stokes_drift'
META(1)%VARND=DIRCOM
META(1)%VMIN = -4.95
META(1)%VMAX = 4.95

! Second component
META(2) = META(1)
META(2)%VARNM='vussh'
META(2)%VARNL='northward surface averaged stokes drift'
META(2)%VARNS='sea_surface_wave_averaged_stokes_drift_northward_velocity'
META(2)%VARNG='northward_surface_averaged_stokes_drift'


!
!---------- GROUP 7 ----------------
!
Expand Down Expand Up @@ -3956,6 +3980,7 @@ SUBROUTINE DEFAULT_META()
META(1)%VARNC='Goda wave peakedness parameter'
META(1)%VMIN = 0
META(1)%VMAX = 32

!
!---------- GROUP 9 ----------------
!
Expand Down
19 changes: 18 additions & 1 deletion model/src/ww3_ounf.F90
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ PROGRAM W3OUNF
TAUOX, TAUOY, TAUWIX, &
TAUWIY, PHIAW, PHIOC, TUSX, TUSY, PRMS, TPMS,&
USSX, USSY, MSSX, MSSY, MSSD, MSCX, MSCY, &
MSCD, CHARN, TWS, TAUA, TAUADIR, &
MSCD, CHARN, TWS, TAUA, TAUADIR,USSHX,USSHY, &
TAUWNX, TAUWNY, BHD, T02, HSIG, CGE, &
T01, BEDFORMS, WHITECAP, TAUBBL, PHIBBL, &
CFLTHMAX, CFLXYMAX, CFLKMAX, TAUICE, PHICE, &
Expand Down Expand Up @@ -1854,6 +1854,23 @@ SUBROUTINE W3EXNC ( NX, NY, IX1, IXN, IY1, IYN, NSEA, &
CALL W3S2XY ( NSEA, NSEA, NX+1, NY, TAUOCY(1:NSEA) &
, MAPSF, XY )
ENDIF ! SMCGRD
!
NFIELD=2

!
! Surface averaged stokes drift
ELSE IF ( IFI .EQ. 6 .AND. IFJ .EQ. 14 ) THEN
DO ISEA=1, NSEA
USSHX(ISEA)=MAX(-0.9998,MIN(0.9998,USSHX(ISEA)))
USSHY(ISEA)=MAX(-0.9998,MIN(0.9998,USSHY(ISEA)))
END DO
#ifdef W3_RTD
! Rotate x,y vector back to standard pole
IF ( FLAGUNR ) CALL W3XYRTN(NSEA, USSHX(1:NSEA), USSHY(1:NSEA), AnglD)
#endif
CALL S2GRID(USSHX(1:NSEA), XX)
CALL S2GRID(USSHY(1:NSEA), XY)
!
NFIELD=2
!
! RMS of bottom displacement amplitude
Expand Down
53 changes: 52 additions & 1 deletion model/src/ww3_outf.F90
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ PROGRAM W3OUTF
CFLTHMAX, CFLKMAX, BEDFORMS, WHITECAP, T02, &
CGE, T01, HSIG, STMAXE, STMAXD, HMAXE, &
HCMAXE, HMAXD, HCMAXD, MSSD, MSCD, WBT, &
WNMEAN, TAUA, TAUADIR
WNMEAN, TAUA, TAUADIR, USSHX, USSHY
USE W3ODATMD, ONLY: NDSO, NDSE, NDST, NOGRP, NGRPP, IDOUT, &
UNDEF, FLOGRD, FNMPRE, NOSWLL, NOGE
!
Expand Down Expand Up @@ -1940,6 +1940,57 @@ SUBROUTINE W3EXGO ( NX, NY, NSEA )
CALL W3S2XY (NSEA,NSEA,NX+1,NY, TAUOCY(1:NSEA) &
, MAPSF, X2 )
ENDIF

!
ELSE IF ( IFI .EQ. 6 .AND. IFJ .EQ. 14 ) THEN
IF ( VECTOR ) THEN
FLTWO = .TRUE.
ELSE
FLDIR = .TRUE.
END IF
FSC = 0.001
UNITS = 'm s-1'
ENAME = '.ussh'
DO ISEA=1, NSEA
IF (USSHX(ISEA) .NE. UNDEF) THEN
USSHX(ISEA)=MAX(-0.9998,MIN(0.9998,USSHX(ISEA)))
USSHY(ISEA)=MAX(-0.9998,MIN(0.9998,USSHY(ISEA)))
END IF
END DO
#ifdef W3_RTD
! Rotate x,y vector back to standard pole
IF ( FLAGUNR ) CALL W3XYRTN(NSEA, USSHX, USSHY, AnglD)
#endif
IF ( ITYPE .EQ. 4 ) THEN
XS1 = USSHX(1:NSEA)
XS2 = USSHY(1:NSEA)
ELSE
CALL W3S2XY ( NSEA, NSEA, NX+1, NY, USSHX(1:NSEA) &
, MAPSF, XX )
CALL W3S2XY ( NSEA, NSEA, NX+1, NY, USSHY(1:NSEA) &
, MAPSF, XY )
ENDIF
DO ISEA=1, NSEA
CABS = SQRT(USSHX(ISEA)**2+USSHY(ISEA)**2)
IF ( USSHX(ISEA) .NE. UNDEF ) THEN
USSHY(ISEA) = MOD ( 630. - &
RADE*ATAN2(USSHY(ISEA),USSHX(ISEA)) , 360. )
ELSE
USSHY(ISEA) = UNDEF
CABS = UNDEF
END IF
USSHX(ISEA) = CABS
END DO
IF ( ITYPE .EQ. 4 ) THEN
XS3 = USSHX(1:NSEA)
XS4 = USSHY(1:NSEA)
ELSE
CALL W3S2XY ( NSEA, NSEA, NX+1, NY, USSHX(1:NSEA), &
MAPSF, X1 )
CALL W3S2XY ( NSEA, NSEA, NX+1, NY, USSHY(1:NSEA), &
MAPSF, X2 )
ENDIF

!
ELSE IF ( IFI .EQ. 7 .AND. IFJ .EQ. 1 ) THEN
IF ( VECTOR ) THEN
Expand Down
4 changes: 3 additions & 1 deletion regtests/bin/matrix.base
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,9 @@

if [ "$lmp" == "y" ]; # Langmuir mixing parameterization
then
echo "$rtst -s PR3_UQ_MPI -w work_PR3_UQ_MPI -f -p $mpi -n $np $ww3 ww3_tp2.22" >> matrix.body
echo ' ' >> matrix.body
echo "$rtst -w work_LMPN -f -p $mpi -n $np $ww3 ww3_tp2.22" >> matrix.body
echo "$rtst -g sdtail -w work_LMPN_SDTAIL -f -p $mpi -n $np $ww3 ww3_tp2.22" >> matrix.body
fi
fi

Expand Down
76 changes: 30 additions & 46 deletions regtests/ww3_tp2.22/info
Original file line number Diff line number Diff line change
@@ -1,61 +1,43 @@
#############################################################################
# #
# ww3_tp2.22 Test script for WW-III, two-dimensional propagation and LMP #
# Propagation over half the globe. #
# Langmuir Mixing Parameterization #
# ww3_tp2.22 Test script for WW-III demonstrating Langmuir Mixing #
# Parmeterization for the case of two-dimensional propagation #
# over half the globe. Based on regtest ww3_tp2.2 with #
# switch_PR3_UQ_MPI used as a sample switch. #
# #
# Model should be compiled with the switches : #
# #
# !/LN0 !/ST0 !/NL0 !/BT0 !/DB0 !/TR0 !/BS0 #
# Select the 'no source terms' option. #
# !/PRn Selecting one of the propagation schemes. #
# 1: First order. #
# 2: UQ with diffusion term. #
# 3: UQ with averaging (set to zero here). #
# !/WNX1 !/WNT1 !/CRX1 !/CRT1 Wind and current interpolation. #
# !/O0 !/O1 !/O2 !/O3 !/O4 !/O5 !/O6 !/O7 Sdt out output options. #
# Two test cases are run. Both have LMPENABLED, with one which #
# includes the tail contribution, the other does not. #
# #
# Remarks : #
# - Test case input (default): #
# * Single grid, but run using ww3_multi. #
# * ww3_grid.inp : (default) #
# + Spatial grid: 193 x 93 rectilinear lat/lon grid #
# - dx = 1.0 deg, dy = 1.0 deg #
# - Xrange = -6:186 deg, Yrange = -46:46 deg #
# + Spectral grid: ntheta = 24, nf = 3, f1 = 0.03679, fgamma = 1.1 #
# + Langmuir mixing parameterization (LMPENABLED = T) and tail #
# contribution (SDTAIL = T) enabled. A uniform (10m) surface layer #
# depth is asumed (HSLMODE = 0). #
# * map2_2.gs: grads script for visualizing results. #
# * GSE correction is enabled. To disable GSE correction #
# comment/uncomment the appropriate lines in ww3_grid.inp. #
# * switch options (mostly self-explanatory). #
# + switch_PR1 : First order scheme #
# + switch_PR2_UNO : UQ scheme with diffusion #
# + switch_PR2_UQ : UQ scheme with diffusion #
# + switch_PR3_UNO : UQ scheme with averaging (default) #
# + switch_PR3_UQ : UQ scheme with averaging (default) #
# + switch_PR1_MPI #
# + switch_PR2_UNO_MPI #
# + switch_PR2_UQ_MPI #
# + switch_PR3_UNO_MPI #
# + switch_PR3_UQ_MPI #
# #
# Sample run_test commands : #
# - Test case input parameters: #
# I. NO TAIL #
# ---------- #
# + LMPENABLED = T: Langmuir mixing parameterization enabled. #
# + SDTAIL = F: tail contribution NOT enabled. #
# + HSLMODE = 0: uniform (10m) surface layer depth is assumed. #
# #
# II. TAIL INCLUDED #
# ----------------- #
# + LMPENABLED = T: Langmuir mixing parameterization enabled. #
# + SDTAIL = T: tail contribution enabled. #
# + HSLMODE = 0: uniform (10m) surface layer depth is assumed. #
# #
# - Test case output parameters: #
# + USSX/USSY: surface Stokes drift (netCDF: uuss/vuss) #
# + USSHX/USSHY: surface averaged Stokes drift (netCDF: uussh/vussh) #
# #
# Sample run_test commands : #
# (Note: mpirun commands differ by local system) #
# ./bin/run_test -s PR1 ../model ww3_tp2.22 #
# ./bin/run_test -n 3 -p mpirun -f -s PR1_MPI ../model ww3_tp2.22 #
# #
# Hendrik Tolman, Jun 2002 #
# Last Mod : Dec 2013 #
# ./bin/run_cmake_test -n 4 -p mpirun -f ../model ww3_tp2.22 #
# ./bin/run_cmake_test -n 4 -p mpirun -f -g sdtail ../model ww3_tp2.22 #
# #
# Notes on LMPN namelist and Langmuir Mixing Parameterization: #
# #
# The LMPN namelist group configures the Langmuir Mixing #
# Parameterization used within the context of climate modeling and #
# when WW3 is coupled with an active ocean model (.e.g., POP2, MOM6). #
# The LMPENABLED flag turns on the parameterization computations. #
# The SDTAIL flag enabled the spectral tail contribution. #
# The SDTAIL flag enables the spectral tail contribution. #
# HSLMODE parameter determines the surface layer depth (HSL). #
# When HSLMODE == 0, a uniform 10m HSL is assumed for testing purposes. #
# When HSLMODE == 1, the HSL field is to be received from the active #
Expand All @@ -65,8 +47,10 @@
# Li, Qing, et al. "Langmuir mixing effects on global climate: #
# WAVEWATCH III in CESM." Ocean Modelling 103 (2016): 145-160. #
# #
# Hendrik Tolman, Jun 2002 #
# Last Mod : Li / Altuntas, Nov 2023 #
# #
# Copyright 2009-2013 National Weather Service (NWS), #
# Copyright 2009-2023 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. #
Expand Down
1 change: 0 additions & 1 deletion regtests/ww3_tp2.22/input/2-D.depth

This file was deleted.

11 changes: 0 additions & 11 deletions regtests/ww3_tp2.22/input/gx_outf.inp

This file was deleted.

Loading

0 comments on commit 90cd7c4

Please sign in to comment.