Skip to content

Commit

Permalink
Merge pull request NOAA-EMC#1029
Browse files Browse the repository at this point in the history
Update dev/ufs-weather-model branch with develop - 2023-jun-27
  • Loading branch information
JessicaMeixner-NOAA authored Jul 25, 2023
2 parents c4b1168 + 5114dff commit 59c554a
Show file tree
Hide file tree
Showing 12 changed files with 317 additions and 376 deletions.
61 changes: 36 additions & 25 deletions model/inp/ww3_grid.inp
Original file line number Diff line number Diff line change
Expand Up @@ -305,33 +305,44 @@ $ 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)
$ UGBCCFL : Turns on/off (TRUE/FALSE) the computation of the CFL number on the physical domain boundary.
$ If FALSE the explicit scheme can be much faster though stability is not guaranteed
$ (default TRUE)
$ UGOBCAUTO : TRUE: OBC points are taken from type 15 elements (default)
$ FALSE: OBC points must be listed in ww3_grid.inp
$ UGOBCDEPTH : Threshold ( < 0) depth (default -10) for OBC points if UGOBCAUTO is TRUE
$ UGOBCFILE : File name of file for reading boudary (default 'unset')
$
$ The following are TRUE/FALSE variables and only one can be TRUE.
$ By default, EXPFSN is TRUE and must be set to false to activate another option
$ EXPFSN : Activation of N scheme (default option)
$ 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
$ IMPFSN : Activation of N implicit scheme
$ EXPTOTAL : Activation of Block explicit N scheme solver
$ IMPTOTAL : Activation of fully implicit scheme, non splitting
$
$ The following TRUE/FALSE variables are only for IMPTOTAL=TRUE
$ IMPREFRACTION : Turn on implicit freq. shift (default FALSE)
$ IMPFREQSHIFT : Turn on implicit freq. shift terms (default FALSE)
$ IMPSOURCE : Turn on implicit source terms (default FALSE)
$
$ JGS_TERMINATE_MAXITER : Terminate based on max number of iterations (TRUE/FALSE, default TRUE)
$ JGS_TERMINATE_DIFFERENCE : Terminate based on the total change of the unweightet sum of wave action (TRUE/FALSE, default TRUE)
$ JGS_TERMINATE_NORM : Terminate based on the norm of the solution (TRUE/FALSE, default FALSE)
$ JGS_USE_JACOBI : Use Jacobi solver family (TRUE/FALSE, default TRUE)
$ JGS_BLOCK_GAUSS_SEIDEL : Use Block Gauss Seidel method for imptotal instead of the conservative jacobi iterator. (TRUE/FALSE, default TRUE)
$ JGS_MAXITER : Max. Number of solver iterations for JGS_TERMINATE_MAXITER (integer, default 100)
$ JGS_PMIN : % of grid points that do not need to converge during solver iteration (real, default 1)
$ JGS_DIFF_THR : Implicit solver threshold for JGS_TERMINATE_DIFFERENCE (real, default 1.0e-10)
$ JGS_NORM_THR : Norm of the solution for JGS_TERMINATE_NORM (real, default 1.0e-20)
$ JGS_LIMITER : TRUE: Use total (quasi-steady: limits whole equation) instead of local limiter (un-steady: limits only source terms)
$ FALSE: default
$ JGS_LIMITER_FUNC : 1 - old limiter (default)
$ 2 - alternatnive limiter
$ SETUP_APPLY_WLV : Compute wave setup (TRUE/FALSE, default TRUE)
$ SOLVERTHR_SETUP : Solver threshold for setup computations (default 1E-6)
$ CRIT_DEP_SETUP : Critical depth for setup computations (default 0.1)

$
$ SMC grid propagation : Namelist PSMC and default values
Expand Down
13 changes: 12 additions & 1 deletion model/src/w3iorsmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ SUBROUTINE W3IORS ( INXOUT, NDSR, DUMFPI, IMOD, FLRSTRT )
! Original non-server version writing of spectra
!
IF ( .NOT.IOSFLG .OR. (NAPROC.EQ.1.AND.NAPRST.EQ.1) ) THEN
#ifdef W3_MPI
DO JSEA=1, NSEAL
CALL INIT_GET_ISEA(ISEA, JSEA)
NREC = ISEA + 2
Expand All @@ -694,6 +695,16 @@ SUBROUTINE W3IORS ( INXOUT, NDSR, DUMFPI, IMOD, FLRSTRT )
WRITEBUFF(1:NSPEC) = VA(1:NSPEC,JSEA)
WRITE (NDSR,POS=RPOS,ERR=803,IOSTAT=IERR) WRITEBUFF
END DO
#else
DO JSEA=1, NSEA
ISEA = JSEA
NREC = ISEA + 2
RPOS = 1_8 + LRECL*(NREC-1_8)
WRITEBUFF(:) = 0.
WRITEBUFF(1:NSPEC) = VA(1:NSPEC,JSEA)
WRITE (NDSR,POS=RPOS,ERR=803,IOSTAT=IERR) WRITEBUFF
END DO
#endif
!
! I/O server version writing of spectra ( !/MPI )
!
Expand Down Expand Up @@ -843,7 +854,7 @@ SUBROUTINE W3IORS ( INXOUT, NDSR, DUMFPI, IMOD, FLRSTRT )
ELSE
#endif
VA = 0.
DO JSEA=1, NSEAL
DO JSEA=1, NSEA
CALL INIT_GET_ISEA(ISEA, JSEA)
NREC = ISEA + 2
RPOS = 1_8 + LRECL*(NREC-1_8)
Expand Down
4 changes: 2 additions & 2 deletions model/src/w3ounfmetamd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2638,8 +2638,8 @@ SUBROUTINE DEFAULT_META()
!META(1)%VARNS='air_sea_temperature_difference'
META(1)%VARNS=''
META(1)%VARNG='air_sea_temperature_difference'
META(1)%VMIN = 0
META(1)%VMAX = 400
META(1)%VMIN = -200.0
META(1)%VMAX = 200.0
! IFI=1, IFJ=5, WLV
META => GROUP(1)%FIELD(5)%META
META(1)%FSC = 0.01
Expand Down
4 changes: 2 additions & 2 deletions model/src/w3profsmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ SUBROUTINE W3XYPFSN2 ( ISP, C, LCALC, RD10, RD20, DT, AC)
IF (REFPARS(3).LT.0.5.AND.IOBPD(ITH,IP).EQ.0.AND.IOBPA(IP).EQ.0) THEN
U(IP) = AC(IP) ! restores reflected boundary values
ENDIF
#endif^
#endif
END DO
! update spectrum
AC = U
Expand Down Expand Up @@ -1266,7 +1266,7 @@ SUBROUTINE W3XYPFSNIMP ( ISP, C, LCALC, RD10, RD20, DT, AC)
DO IBI=1, NBI
IP = MAPSF(ISBPI(IBI),1)
AC(IP) = ( RD1*BBPI0(ISP,IBI) + RD2*BBPIN(ISP,IBI) ) &
*IOBPA(IP)*(1-IOBPD(ITH,IP)) / CG(IK,ISBPI(IBI)) * CLATS(ISBPI(IBI))
*IOBPA(IP)*IOBPD(ITH,IP) / CG(IK,ISBPI(IBI)) * CLATS(ISBPI(IBI))
END DO
END IF

Expand Down
4 changes: 2 additions & 2 deletions model/src/w3profsmd_pdlib.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3642,8 +3642,8 @@ SUBROUTINE calcARRAY_JACOBI_VEC(DTG,FACX,FACY,VGX,VGY)
DTK = 0
TMP3 = 0

CCOSA = FACX * ECOS
CSINA = FACX * ESIN
CCOSA = FACX * ECOS(1:NTH)
CSINA = FACX * ESIN(1:NTH)
call print_memcheck(memunit, 'memcheck_____:'//' WW3_JACOBI SECTION 0')

DO ISP = 1, NSPEC
Expand Down
31 changes: 30 additions & 1 deletion model/src/w3src4md.F90
Original file line number Diff line number Diff line change
Expand Up @@ -666,8 +666,16 @@ SUBROUTINE W3SIN4 (A, CG, K, U, USTAR, DRAT, AS, USDIR, Z0, CD, &
! I got it from, maybe just made up from drag law ...
!
#ifdef W3_STAB3
Usigma=MAX(0.,-0.025*AS)
IF ( ISNAN(AS) ) THEN
! AS is typically NaN on land and can propagate into the domain by interpolation
Usigma = 0.
ELSE
Usigma = MAX(0.,-0.025*AS)
END IF
USTARsigma=(1.0+U/(10.+U))*Usigma
#endif
#ifdef W3_T
WRITE (NDST,9003) AS, Usigma, USTARsigma, U
#endif
UST=USTAR
ISTAB=3
Expand All @@ -678,6 +686,9 @@ SUBROUTINE W3SIN4 (A, CG, K, U, USTAR, DRAT, AS, USDIR, Z0, CD, &
#endif
TAUX = UST**2* COS(USDIR)
TAUY = UST**2* SIN(USDIR)
#ifdef W3_T
WRITE (NDST,9001) ISTAB, TAUX, TAUY, UST
#endif
!
! Loop over the resolved part of the spectrum
!
Expand Down Expand Up @@ -788,6 +799,9 @@ SUBROUTINE W3SIN4 (A, CG, K, U, USTAR, DRAT, AS, USDIR, Z0, CD, &
YSTRESS=0.5*(STRESSSTAB(1,2)+STRESSSTAB(2,2))
TAUWNX=0.5*(STRESSSTABN(1,1)+STRESSSTABN(2,1))
TAUWNY=0.5*(STRESSSTABN(1,2)+STRESSSTABN(2,2))
#endif
#ifdef W3_T
WRITE (NDST,9002) SUM(D), SUM(A), XSTRESS, YSTRESS, TAUWNX, TAUWNY
#endif
S = D * A
!
Expand Down Expand Up @@ -868,6 +882,21 @@ SUBROUTINE W3SIN4 (A, CG, K, U, USTAR, DRAT, AS, USDIR, Z0, CD, &
!
#ifdef W3_T
9000 FORMAT (' TEST W3SIN4 : COMMON FACT.: ',3E10.3)
9001 FORMAT (' TEST W3SIN4 : ISTAB :',I2/ &
' TAUX :',E12.3/ &
' TAUY :',E12.3/ &
' UST :',E12.3)
9002 FORMAT (' TEST W3SIN4 : SUM(D) :',E12.3/ &
' SUM(A) :',E12.3/ &
' STRESSX :',E12.3/ &
' STRESSY :',E12.3/ &
' TAUWNX :',E12.3/ &
' TAUWNY :',E12.3)
9003 FORMAT (' TEST W3SIN4 : AS :',F8.4/ &
' Usigma :',E12.3/ &
' USTARsigma :',E12.3/ &
' U :',E12.3)

#endif
!/
!/ End of W3SIN4 ----------------------------------------------------- /
Expand Down
Loading

0 comments on commit 59c554a

Please sign in to comment.