Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ww3 gse2 #1143

Draft
wants to merge 13 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions model/inp/ww3_grid.inp
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,8 @@ $ JGS_LIMITER : TRUE: Use total (quasi-steady: limits
$ FALSE: default
$ JGS_LIMITER_FUNC : 1 - old limiter (default)
$ 2 - alternatnive limiter
$ JGS_LGSE : T/F - turn on/off GSE correction on unstructured grids
$ JGS_GSE_TS : Time constant of the diffusion tensor, see Manual, same as for PR2
$ 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)
Expand Down
2 changes: 2 additions & 0 deletions model/nml/namelists.nml
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ $ JGS_DIFF_THR : implicit solver threshold for JGS_TE
$ 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
$ JGS_LGSE : T/F - turn on/off GSE correction on unstructured grids
$ JGS_GSE_TS : Time constant of the diffusion tensor, see Manual, same as for PR2
$ SETUP_APPLY_WLV : Compute wave setup (experimental)
$ SOLVERTHR_SETUP : Solver threshold for setup computations
$ CRIT_DEP_SETUP : Critical depths for setup computations
Expand Down
2 changes: 1 addition & 1 deletion model/src/PDLIB/yownodepool.F90
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ module yowNodepool

!> coordinates of the local + ghost nodes. range [1:npa]
real(rkind), public, target, allocatable :: x(:), y(:), z(:)
real(rkind), public, target, allocatable :: PDLIB_SI(:), PDLIB_TRIA(:), PDLIB_TRIA03(:), PDLIB_IEN(:,:)
real(rkind), public, target, allocatable :: PDLIB_SI(:), PDLIB_TRIA(:), PDLIB_TRIA03(:), PDLIB_IEN(:,:), PDLIB_IEND(:,:,:)
integer, public, target, allocatable :: PDLIB_CCON(:), PDLIB_IA(:), PDLIB_JA(:)
integer, public, target, allocatable :: PDLIB_IA_P(:), PDLIB_JA_P(:), PDLIB_JA_IE(:,:,:)
integer, public, target, allocatable :: PDLIB_POS_CELL(:), PDLIB_IE_CELL(:)
Expand Down
14 changes: 12 additions & 2 deletions model/src/PDLIB/yowpdlibmain.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1306,13 +1306,13 @@ subroutine ComputeTRIA_IEN_SI_CCON
use yowerr, only: parallel_abort
use yowDatapool, only: myrank
use yowNodepool, only: np_global, np, iplg, t_Node, ghostlg, ng, npa
use yowNodepool, only: x, y, z, PDLIB_SI, PDLIB_IEN, PDLIB_TRIA, PDLIB_CCON, PDLIB_TRIA03
use yowNodepool, only: x, y, z, PDLIB_SI, PDLIB_IEN, PDLIB_IEND, PDLIB_TRIA, PDLIB_CCON, PDLIB_TRIA03

integer I1, I2, I3, stat, IE, NI(3)
real :: DXP1, DXP2, DXP3, DYP1, DYP2, DYP3, DBLTMP, TRIA03
logical :: CROSSES_DATELINE

allocate(PDLIB_SI(npa), PDLIB_CCON(npa), PDLIB_IEN(6,ne), PDLIB_TRIA(ne), PDLIB_TRIA03(ne), stat=stat)
allocate(PDLIB_SI(npa), PDLIB_CCON(npa), PDLIB_IEN(6,ne), PDLIB_IEND(3,3,ne), PDLIB_TRIA(ne), PDLIB_TRIA03(ne), stat=stat)
if(stat/=0) call parallel_abort('SI allocation failure')

PDLIB_SI(:) = 0.0d0 ! Median Dual Patch Area of each Node
Expand Down Expand Up @@ -1350,6 +1350,16 @@ subroutine ComputeTRIA_IEN_SI_CCON
WRITE(*,*) 'AREA SMALLER ZERO IN PDLIB', IE, NE, PDLIB_TRIA(IE)
STOP
ENDIF
PDLIB_IEND(1,1,IE) = DOT_PRODUCT(PDLIB_IEN(1:2,IE),PDLIB_IEN(1:2,IE)) ! Tomaich. eq. 3.19 n1 * n1 etc.
PDLIB_IEND(1,2,IE) = DOT_PRODUCT(PDLIB_IEN(1:2,IE),PDLIB_IEN(3:4,IE))
PDLIB_IEND(1,3,IE) = DOT_PRODUCT(PDLIB_IEN(1:2,IE),PDLIB_IEN(5:6,IE))
PDLIB_IEND(2,1,IE) = DOT_PRODUCT(PDLIB_IEN(3:4,IE),PDLIB_IEN(1:2,IE))
PDLIB_IEND(2,2,IE) = DOT_PRODUCT(PDLIB_IEN(3:4,IE),PDLIB_IEN(3:4,IE))
PDLIB_IEND(2,3,IE) = DOT_PRODUCT(PDLIB_IEN(3:4,IE),PDLIB_IEN(5:6,IE))
PDLIB_IEND(3,1,IE) = DOT_PRODUCT(PDLIB_IEN(5:6,IE),PDLIB_IEN(1:2,IE))
PDLIB_IEND(3,2,IE) = DOT_PRODUCT(PDLIB_IEN(5:6,IE),PDLIB_IEN(3:4,IE))
PDLIB_IEND(3,3,IE) = DOT_PRODUCT(PDLIB_IEN(5:6,IE),PDLIB_IEN(5:6,IE))


PDLIB_CCON(I1) = PDLIB_CCON(I1) + 1
PDLIB_CCON(I2) = PDLIB_CCON(I2) + 1
Expand Down
15 changes: 9 additions & 6 deletions model/src/w3gdatmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -813,9 +813,7 @@ MODULE W3GDATMD
#ifdef W3_PR1
REAL :: DUMMY
#endif
#ifdef W3_PR2
REAL :: DTME, CLATMN
#endif
#ifdef W3_PR3
REAL :: WDCG, WDTH
#endif
Expand Down Expand Up @@ -1046,8 +1044,11 @@ MODULE W3GDATMD
LOGICAL :: B_JGS_LIMITER
LOGICAL :: B_JGS_USE_JACOBI
LOGICAL :: B_JGS_BLOCK_GAUSS_SEIDEL
LOGICAL :: B_JGS_LGSE
INTEGER :: B_JGS_GSE_METHOD
INTEGER :: B_JGS_MAXITER
INTEGER :: B_JGS_LIMITER_FUNC
REAL*8 :: B_JGS_GSE_TS
REAL*8 :: B_JGS_PMIN
REAL*8 :: B_JGS_DIFF_THR
REAL*8 :: B_JGS_NORM_THR
Expand Down Expand Up @@ -1244,9 +1245,7 @@ MODULE W3GDATMD
!/
!/ Data aliasses for structure PROP(S)
!/
#ifdef W3_PR2
REAL, POINTER :: DTME, CLATMN
#endif
#ifdef W3_PR3
REAL, POINTER :: WDCG, WDTH
#endif
Expand Down Expand Up @@ -1403,6 +1402,9 @@ MODULE W3GDATMD
LOGICAL, POINTER :: B_JGS_LIMITER
LOGICAL, POINTER :: B_JGS_USE_JACOBI
LOGICAL, POINTER :: B_JGS_BLOCK_GAUSS_SEIDEL
LOGICAL, POINTER :: B_JGS_LGSE
INTEGER, POINTER :: B_JGS_GSE_METHOD
REAL(8), POINTER :: B_JGS_GSE_TS
INTEGER, POINTER :: B_JGS_MAXITER
INTEGER, POINTER :: B_JGS_LIMITER_FUNC
REAL(8), POINTER :: B_JGS_PMIN
Expand Down Expand Up @@ -2532,10 +2534,8 @@ SUBROUTINE W3SETG ( IMOD, NDSE, NDST )
!
! Structure PROPS
!
#ifdef W3_PR2
DTME => MPARS(IMOD)%PROPS%DTME
CLATMN => MPARS(IMOD)%PROPS%CLATMN
#endif
#ifdef W3_PR3
WDCG => MPARS(IMOD)%PROPS%WDCG
WDTH => MPARS(IMOD)%PROPS%WDTH
Expand Down Expand Up @@ -2829,6 +2829,9 @@ SUBROUTINE W3SETG ( IMOD, NDSE, NDST )
B_JGS_LIMITER => MPARS(IMOD)%SCHMS%B_JGS_LIMITER
B_JGS_USE_JACOBI => MPARS(IMOD)%SCHMS%B_JGS_USE_JACOBI
B_JGS_BLOCK_GAUSS_SEIDEL => MPARS(IMOD)%SCHMS%B_JGS_BLOCK_GAUSS_SEIDEL
B_JGS_LGSE => MPARS(IMOD)%SCHMS%B_JGS_LGSE
B_JGS_GSE_METHOD => MPARS(IMOD)%SCHMS%B_JGS_GSE_METHOD
B_JGS_GSE_TS => MPARS(IMOD)%SCHMS%B_JGS_GSE_TS
B_JGS_MAXITER => MPARS(IMOD)%SCHMS%B_JGS_MAXITER
B_JGS_LIMITER_FUNC => MPARS(IMOD)%SCHMS%B_JGS_LIMITER_FUNC
B_JGS_PMIN => MPARS(IMOD)%SCHMS%B_JGS_PMIN
Expand Down
12 changes: 12 additions & 0 deletions model/src/w3gridmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,9 @@ MODULE W3GRIDMD
LOGICAL :: IMPSOURCE
LOGICAL :: SETUP_APPLY_WLV
INTEGER :: JGS_MAXITER
LOGICAL :: JGS_LGSE
INTEGER :: JGS_GSE_METHOD
REAL(8) :: JGS_GSE_TS
INTEGER :: nbSel
INTEGER :: UNSTSCHEMES(6)
INTEGER :: UNSTSCHEME
Expand Down Expand Up @@ -1089,6 +1092,9 @@ MODULE W3GRIDMD
JGS_LIMITER, &
JGS_LIMITER_FUNC, &
JGS_USE_JACOBI, &
JGS_LGSE, &
JGS_GSE_METHOD, &
JGS_GSE_TS, &
JGS_BLOCK_GAUSS_SEIDEL, &
JGS_MAXITER, &
JGS_PMIN, &
Expand Down Expand Up @@ -2432,8 +2438,11 @@ SUBROUTINE W3GRID()
JGS_TERMINATE_NORM = .FALSE.
JGS_LIMITER = .FALSE.
JGS_LIMITER_FUNC = 1
JGS_GSE_TS = 350000
JGS_BLOCK_GAUSS_SEIDEL = .TRUE.
JGS_USE_JACOBI = .TRUE.
JGS_LGSE = .FALSE.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add descriptions of the new terms to model/inp/ww3_grid.inp in the UNST namelist section: https://github.com/NOAA-EMC/WW3/blob/develop/model/inp/ww3_grid.inp#L318

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aronroland once this is done I can try to do some tests of this feature, but will need additional information before I can do so. We'll wait to run regression tests once we have testing information included in the PR. Lastly, you checked the box for "If a new feature was added, a regression test for testing the new feature is added", but I don't see the new regression test included yet, so we'll need that as well before this can be merged. That being said, as soon as I have enough information to run a test on my end I can do that.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding updates to ww3_grid.inp !

JGS_GSE_METHOD = 1
JGS_MAXITER=100
JGS_PMIN = 1
JGS_DIFF_THR = 1.E-10
Expand All @@ -2456,6 +2465,9 @@ SUBROUTINE W3GRID()
B_JGS_NORM_THR = JGS_NORM_THR
B_JGS_NLEVEL = JGS_NLEVEL
B_JGS_SOURCE_NONLINEAR = JGS_SOURCE_NONLINEAR
B_JGS_LGSE = JGS_LGSE
B_JGS_GSE_TS = JGS_GSE_TS
B_JGS_GSE_METHOD = JGS_GSE_METHOD

nbSel=0

Expand Down
Loading