Skip to content

Commit

Permalink
init_bugs2: solve neuman on boundary
Browse files Browse the repository at this point in the history
  • Loading branch information
aronroland committed Oct 23, 2023
1 parent 8eb3596 commit a3e143c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
13 changes: 9 additions & 4 deletions model/src/w3srcemd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1530,8 +1530,13 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, &
DVS = SIGN(MIN(MAXDAC,ABS(DVS)),DVS)
ENDIF
PreVS = DVS / FAKS
eVS = PreVS / CG1(IK) * CLATSL
eVD = MIN(0.,VD(ISP))
IF (IOBP_LOC(JSEA) .EQ. 3) THEN
eVS = 0
eVD = 0
ELSE
eVS = PreVS / CG1(IK) * CLATSL
eVD = MIN(0.,VD(ISP))
ENDIF
B_JAC(ISP,JSEA) = B_JAC(ISP,JSEA) + SIDT * (eVS - eVD*SPEC(ISP)*JAC)
ASPAR_JAC(ISP,PDLIB_I_DIAG(JSEA)) = ASPAR_JAC(ISP,PDLIB_I_DIAG(JSEA)) - SIDT * eVD
#ifdef W3_DB1
Expand All @@ -1544,9 +1549,9 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, &
evS = -evS
evD = 2*evD
ENDIF
#endif
B_JAC(ISP,JSEA) = B_JAC(ISP,JSEA) + SIDT * eVS
ASPAR_JAC(ISP,PDLIB_I_DIAG(JSEA)) = ASPAR_JAC(ISP,PDLIB_I_DIAG(JSEA)) - SIDT * eVD
#endif

#ifdef W3_TR1
eVS = VSTR(ISP) * JAC
Expand All @@ -1558,9 +1563,9 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, &
evS = -evS
evD = 2*evD
ENDIF
#endif
B_JAC(ISP,JSEA) = B_JAC(ISP,JSEA) + SIDT * eVS
ASPAR_JAC(ISP,PDLIB_I_DIAG(JSEA)) = ASPAR_JAC(ISP,PDLIB_I_DIAG(JSEA)) - SIDT * eVD
#endif
END DO
END DO

Expand Down
11 changes: 11 additions & 0 deletions model/src/w3wavemd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1453,6 +1453,12 @@ SUBROUTINE W3WAVE ( IMOD, ODAT, TEND, STAMP, NO_OUT &
call print_memcheck(memunit, 'memcheck_____:'//' WW3_WAVE TIME LOOP 13')
!
#ifdef W3_PDLIB

IF (LPDLIB .and. .not. FLSOU .and. .not. FSSOURCE) THEN
B_JAC = 0.
ASPAR_JAC = 0.
ENDIF

IF (LPDLIB .and. FLSOU .and. FSSOURCE) THEN
#endif

Expand Down Expand Up @@ -1484,6 +1490,10 @@ SUBROUTINE W3WAVE ( IMOD, ODAT, TEND, STAMP, NO_OUT &

CALL INIT_GET_ISEA(ISEA, JSEA)

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



IX = MAPSF(ISEA,1)
IY = MAPSF(ISEA,2)
DELA=1.
Expand Down Expand Up @@ -1556,6 +1566,7 @@ SUBROUTINE W3WAVE ( IMOD, ODAT, TEND, STAMP, NO_OUT &
WRITE(740+IAPROC,*) ' SHAVETOT=', SHAVETOT(JSEA)
FLUSH(740+IAPROC)
#endif
ENDIF
END DO ! JSEA
END IF ! PDLIB
#endif
Expand Down

0 comments on commit a3e143c

Please sign in to comment.