Skip to content

Commit

Permalink
Fixed logic for masking of source calculations using PDLIB
Browse files Browse the repository at this point in the history
  • Loading branch information
ukmo-ccbunney committed Dec 13, 2024
1 parent 1190918 commit 9ca3027
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions model/src/w3srcemd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1294,18 +1294,24 @@ SUBROUTINE W3SRCE ( srce_call, IT, IMOD, &
END DO
END DO

! Set mask for computation of source terms based on MAPSTA
! and FLAGST. This originally is done in w3wavemd as a
! conditional statement around the W3SRCE call
SRC_MASK(I) = .NOT. (MAPSTA(IY(I),IX(I)) .EQ. 1 .AND. FLAGST(ISEA))

! Set SRC_MASK depednind on type of call:
IF(srce_call .EQ. srce_imp_pre) THEN
#ifdef W3_PDLIB
! This was originally in w3wavemd
IF( (IOBP_LOC(JSEA) .EQ. 1 .OR. IOBP_LOC(JSEA) .EQ. 3) &
.AND. IOBDP_LOC(JSEA) .EQ. 1 .AND. IOBPA_LOC(JSEA) .EQ. 0) THEN
SRC_MASK(I) = .TRUE.
ENDIF
! This was originally in w3wavemd
IF( (IOBP_LOC(JSEA) .EQ. 1 .OR. IOBP_LOC(JSEA) .EQ. 3) &
.AND. IOBDP_LOC(JSEA) .EQ. 1 .AND. IOBPA_LOC(JSEA) .EQ. 0) THEN
SRC_MASK(I) = .FALSE.
ELSE
SRC_MASK(I) = .TRUE.
ENDIF
#endif
ELSE ! srce_call = scre_imp_post or scre_direct
! Set mask for computation of source terms based on MAPSTA
! and FLAGST. This originally is done in w3wavemd as a
! conditional statement around the W3SRCE call
SRC_MASK(I) = .NOT. (MAPSTA(IY(I),IX(I)) .EQ. 1 .AND. FLAGST(ISEA))
ENDIF

I = I + 1
ENDDO ! Gather to local grid loop
Expand Down

0 comments on commit 9ca3027

Please sign in to comment.