From 9ca3027f76e3eebd2db005e30a2cb7120ee47a66 Mon Sep 17 00:00:00 2001 From: "ukmo-chris.bunney" Date: Fri, 13 Dec 2024 13:58:48 +0000 Subject: [PATCH] Fixed logic for masking of source calculations using PDLIB --- model/src/w3srcemd.F90 | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/model/src/w3srcemd.F90 b/model/src/w3srcemd.F90 index f7e2ff3f8..2c025b90f 100644 --- a/model/src/w3srcemd.F90 +++ b/model/src/w3srcemd.F90 @@ -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