Skip to content

Commit

Permalink
Provide initial drying of cells with depth < ZLIM for SMC grid. (#1192)
Browse files Browse the repository at this point in the history
  • Loading branch information
ukmo-ccbunney committed Feb 23, 2024
1 parent 6d42025 commit e085bcf
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions model/src/w3gridmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ MODULE W3GRIDMD
#endif
!
#ifdef W3_SMC
REAL :: DVSMC
REAL :: TRNMX, TRNMY
INTEGER, ALLOCATABLE :: NLvCelsk(:), NLvUFcsk(:), NLvVFcsk(:)
INTEGER, ALLOCATABLE :: IJKCelin(:,:),IJKUFcin(:,:),IJKVFcin(:,:)
Expand Down Expand Up @@ -3944,6 +3945,12 @@ SUBROUTINE W3GRID()
IF (IDFM.EQ.2) WRITE (NDSO,973) TRIM(RFORM)
IF (FROM.EQ.'NAME' .AND. NDSG.NE.NDSI) &
WRITE (NDSO,974) TRIM(FNAME)

#ifdef W3_SMC
!Li Save the depth conversion factor for SMC grid use. JGLi03Nov2023
DVSMC = VSC
#endif

!
! 7.e Read bottom depths
!
Expand Down Expand Up @@ -5065,14 +5072,17 @@ SUBROUTINE W3GRID()
CALL EXTCDE(65)
END IF

!Li Minimum DMIN depth is used as well for SMC.
ZB(ISEA)= - MAX( DMIN, FLOAT( IJKDep(ISEA) ) )
MAPFS(IY:IY+JS-1,IX:IX+IK-1) = ISEA
MAPSTA(IY:IY+JS-1,IX:IX+IK-1) = 1
MAPST2(IY:IY+JS-1,IX:IX+IK-1) = 0
MAPSF(ISEA,1) = IX
MAPSF(ISEA,2) = IY
MAPSF(ISEA,3) = IY + (IX -1)*NY
!Li Allow land cell to be defined by ZLIM value and only reset
!Li MAPST* land values for sea points. JGLi03Nov2023
ZB(ISEA) = DVSMC * FLOAT(IJKDep(ISEA))
IF( ZB(ISEA) .LT. ZLIM ) THEN
MAPSTA(IY:IY+JS-1,IX:IX+IK-1) = 1
MAPST2(IY:IY+JS-1,IX:IX+IK-1) = 0
ENDIF
MAPFS(IY:IY+JS-1,IX:IX+IK-1) = ISEA
MAPSF(ISEA,1) = IX
MAPSF(ISEA,2) = IY
MAPSF(ISEA,3) = IY + (IX-1) * NY

!Li New variable CLATS to hold cosine latitude at cell centre.
!Li Also added CLATIS and CTHG0S for version 4.08.
Expand Down

2 comments on commit e085bcf

@EmilioEchevarria
Copy link

@EmilioEchevarria EmilioEchevarria commented on e085bcf May 4, 2024

Choose a reason for hiding this comment

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

@ukmo-ccbunney @ukmo-jianguo-li I believe this commit might have created a conflict with the spectral output when using SMC grids? I get the "OUTPUT POINT OUT OF GRID" warning for all the spectral output points I define, whereas before this commit I wasn't getting it... could it be a sign issue, which now makes WW3 interpret all output points as being on land? (apologies if it's not, the problem might be somewhere else)

@ukmo-jianguo-li
Copy link
Collaborator

@ukmo-jianguo-li ukmo-jianguo-li commented on e085bcf May 5, 2024 via email

Choose a reason for hiding this comment

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

Please sign in to comment.