Skip to content

Commit

Permalink
Sea-state dependent air-sea fluxes FLD1 and FLD2 extended
Browse files Browse the repository at this point in the history
to any input/dissipation term (Ticket: NOAA-EMC#1309)

Changes
-------
 [x] Add namelist parameter FALPHA to `&FLD1` and `&FLD2`.
 [x] Default value for &FLD[12] FALPHA is set to &SIN4 ALPHA0=0.0095
     if ST4 is selected, otherwise FALPHA=0.0095 in `w3gridmd.F90`.
 [x] Passed regression test `ww3_ts3`. A new namelist parameter is
      printed in equivalent namelist in ww3_grid standard output.
  • Loading branch information
stefanzieger committed Oct 31, 2024
1 parent 53699de commit 65e3151
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 26 deletions.
2 changes: 1 addition & 1 deletion cmake/FindOASIS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ else()
endif()

message(STATUS " Searching for mod_oasis...")
find_path(oasis_inc NAMES mod_oasis.mod HINTS ENV OASISDIR PATH_SUFFIXES include)
find_path(oasis_inc NAMES mod_oasis.mod HINTS ENV OASISDIR PATH_SUFFIXES build/lib/psmile.MPI1 include)
if(oasis_inc)
message(STATUS " Found: ${oasis_inc}")
else()
Expand Down
10 changes: 6 additions & 4 deletions model/src/w3gdatmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -835,11 +835,11 @@ MODULE W3GDATMD
REAL :: DUMMY
#ifdef W3_FLD1
INTEGER :: Tail_ID
REAL :: Tail_Lev, TAIL_TRAN1, TAIL_TRAN2
REAL :: Tail_Lev, TAIL_TRAN1, TAIL_TRAN2, FLDALPHA
#endif
#ifdef W3_FLD2
INTEGER :: Tail_ID
REAL :: Tail_Lev, TAIL_TRAN1, TAIL_TRAN2
REAL :: Tail_Lev, TAIL_TRAN1, TAIL_TRAN2, FLDALPHA
#endif
END TYPE FLDP
TYPE SFLP
Expand Down Expand Up @@ -1268,11 +1268,11 @@ MODULE W3GDATMD
!/
#ifdef W3_FLD1
INTEGER, POINTER :: TAIL_ID
REAL, POINTER :: TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2
REAL, POINTER :: TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2, FLDALPHA
#endif
#ifdef W3_FLD2
INTEGER, POINTER :: TAIL_ID
REAL, POINTER :: TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2
REAL, POINTER :: TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2, FLDALPHA
#endif
!/
!/ Data aliasses for structure SFLP(S)
Expand Down Expand Up @@ -2577,12 +2577,14 @@ SUBROUTINE W3SETG ( IMOD, NDSE, NDST )
TAIL_LEV => MPARS(IMOD)%FLDPS%TAIL_LEV
TAIL_TRAN1 => MPARS(IMOD)%FLDPS%TAIL_TRAN1
TAIL_TRAN2 => MPARS(IMOD)%FLDPS%TAIL_TRAN2
FLDALPHA => MPARS(IMOD)%FLDPS%FLDALPHA
#endif
#ifdef W3_FLD2
TAIL_ID => MPARS(IMOD)%FLDPS%TAIL_ID
TAIL_LEV => MPARS(IMOD)%FLDPS%TAIL_LEV
TAIL_TRAN1 => MPARS(IMOD)%FLDPS%TAIL_TRAN1
TAIL_TRAN2 => MPARS(IMOD)%FLDPS%TAIL_TRAN2
FLDALPHA => MPARS(IMOD)%FLDPS%FLDALPHA
#endif
!
! Structure SFLPS
Expand Down
25 changes: 20 additions & 5 deletions model/src/w3gridmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,9 @@ MODULE W3GRIDMD
INTEGER :: TAILTYPE
REAL :: TAILLEV, TAILT1, TAILT2
#endif
#if defined(W3_FLD1) || defined(W3_FLD2)
REAL :: FALPHA
#endif
#ifdef W3_FLX3
INTEGER :: CTYPE
REAL :: CDMAX
Expand Down Expand Up @@ -953,10 +956,10 @@ MODULE W3GRIDMD
#endif
!
#ifdef W3_FLD1
NAMELIST /FLD1/ TAILTYPE, TAILLEV, TAILT1, TAILT2
NAMELIST /FLD1/ TAILTYPE, TAILLEV, TAILT1, TAILT2, FALPHA
#endif
#ifdef W3_FLD2
NAMELIST /FLD2/ TAILTYPE, TAILLEV, TAILT1, TAILT2
NAMELIST /FLD2/ TAILTYPE, TAILLEV, TAILT1, TAILT2, FALPHA
#endif
#ifdef W3_FLX3
NAMELIST /FLX3/ CDMAX, CTYPE
Expand Down Expand Up @@ -3169,12 +3172,20 @@ SUBROUTINE W3GRID()
TAILLEV = 0.006
TAILT1 = 1.25
TAILT2 = 3.00
FALPHA = 0.0095
#endif
#ifdef W3_FLD2
TAILTYPE = 0
TAILLEV = 0.006
TAILT1 = 1.25
TAILT2 = 3.00
FALPHA = 0.0095
#endif
#if defined(W3_FLD1) && defined(W3_ST4)
FALPHA = AALPHA
#endif
#if defined(W3_FLD2) && defined(W3_ST4)
FALPHA = AALPHA
#endif
!
#ifdef W3_FLD1
Expand All @@ -3184,6 +3195,7 @@ SUBROUTINE W3GRID()
TAIL_ID = TAILTYPE
TAIL_TRAN1 = TAILT1
TAIL_TRAN2 = TAILT2
FLDALPHA = FALPHA
#endif
#ifdef W3_FLD2
CALL READNL ( NDSS, 'FLD2', STATUS )
Expand All @@ -3192,6 +3204,7 @@ SUBROUTINE W3GRID()
TAIL_ID = TAILTYPE
TAIL_TRAN1 = TAILT1
TAIL_TRAN2 = TAILT2
FLDALPHA = FALPHA
#endif
!
! 6.o End of namelist processing
Expand Down Expand Up @@ -3440,10 +3453,12 @@ SUBROUTINE W3GRID()
END IF
!
#ifdef W3_FLD1
WRITE(NDSO,2987) TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2
WRITE(NDSO,2987) TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2, &
FLDALPHA
#endif
#ifdef W3_FLD2
WRITE(NDSO,2987) TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2
WRITE(NDSO,2987) TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2, &
FLDALPHA
#endif
#ifdef W3_RTD
WRITE(NDSO,4991) PLAT, PLON, UNROT
Expand Down Expand Up @@ -6854,7 +6869,7 @@ SUBROUTINE W3GRID()
', REFICEBERG =',F5.2,', REFCOSP_STRAIGHT =',F4.1,' /')
!
2987 FORMAT ( ' &FLD TAIL_ID =',I1,' TAIL_LEV =',F5.4,' TAILT1 =',F5.3,&
' TAILT2 =',F5.3,' /')
' TAILT2 =',F5.3,' FALPHA =',F8.5,' /')
#ifdef W3_RTD

4991 FORMAT ( ' &ROTD PLAT =', F6.2,', PLON =', F7.2,', UNROT =',L3,' /')
Expand Down
16 changes: 8 additions & 8 deletions model/src/w3iogrmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1920,26 +1920,26 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT &
!
#ifdef W3_FLD1
IF ( WRITE ) THEN
WRITE (NDSM) TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2
WRITE (NDSM) TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2, FLDALPHA
#ifdef W3_ASCII
WRITE (NDSA,*) 'TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2:', &
TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2
WRITE (NDSA,*) 'TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2, FLDALPHA:', &
TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2, FLDALPHA
#endif
ELSE
READ (NDSM,END=801,ERR=802,IOSTAT=IERR) &
TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2
TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2, FLDALPHA
END IF
#endif
#ifdef W3_FLD2
IF ( WRITE ) THEN
WRITE (NDSM) TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2
WRITE (NDSM) TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2, FLDALPHA
#ifdef W3_ASCII
WRITE (NDSA,*) 'TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2:', &
TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2
WRITE (NDSA,*) 'TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2, FLDALPHA:', &
TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2, FLDALPHA
#endif
ELSE
READ (NDSM,END=801,ERR=802,IOSTAT=IERR) &
TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2
TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2, FLDALPHA
END IF
#endif
!
Expand Down
14 changes: 6 additions & 8 deletions model/src/w3srcemd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -516,11 +516,12 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, &
#endif
#ifdef W3_FLD1
USE W3FLD1MD, ONLY: W3FLD1
USE W3GDATMD, ONLY: AALPHA
#endif
#ifdef W3_FLD2
USE W3FLD2MD, ONLY: W3FLD2
USE W3GDATMD, ONLY: AALPHA
#endif
#if defined(W3_FLD1) || defined(W3_FLD2)
USE W3GDATMD, ONLY: FLDALPHA
#endif
#ifdef W3_FLX1
USE W3FLX1MD
Expand Down Expand Up @@ -2181,10 +2182,7 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, &
#endif

! FLD1/2 requires the calculation of FPI:
#ifdef W3_FLD1
CALL CALC_FPI(SPEC, CG1, FPI, VSIN )
#endif
#ifdef W3_FLD2
#if defined(W3_FLD1) || defined(W3_FLD2)
CALL CALC_FPI(SPEC, CG1, FPI, VSIN )
#endif
!
Expand All @@ -2194,7 +2192,7 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, &
COEF*U10ABS*Sin(U10DIR), ZWND, DEPTH, 0.0, &
DAIR, USTAR, USTDIR, Z0,TAUNUX,TAUNUY,CHARN)
ELSE
CHARN = AALPHA
CHARN = FLDALPHA
ENDIF
#endif
#ifdef W3_FLD2
Expand All @@ -2203,7 +2201,7 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, &
COEF*U10ABS*Sin(U10DIR), ZWND, DEPTH, 0.0, &
DAIR, USTAR, USTDIR, Z0,TAUNUX,TAUNUY,CHARN)
ELSE
CHARN = AALPHA
CHARN = FLDALPHA
ENDIF
#endif
!
Expand Down

0 comments on commit 65e3151

Please sign in to comment.