Skip to content

Commit

Permalink
feature_brcoef: fixes BRCOEF allocation and SDB1 call
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc PEZERAT committed Nov 15, 2024
1 parent 9ad5b19 commit da2ba30
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 27 deletions.
5 changes: 4 additions & 1 deletion model/src/pdlib_field_vec.F90
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ SUBROUTINE GET_ARRAY_SIZE(TheSize)
IF ( FLGRDALL( 2, 19) ) THEN
IH = IH + 1
END IF
IF ( FLGRDALL( 2, 20) ) THEN
IH =IH + 1
END IF
IF ( FLGRDALL( 3, 1) ) THEN
DO IK=E3DF(2,1),E3DF(3,1)
IH = IH + 1
Expand Down Expand Up @@ -967,7 +970,7 @@ SUBROUTINE DO_OUTPUT_EXCHANGES(IMOD)
IF ( FLGRDALL( 2, 19) ) THEN
IH = IH + 1
Arrexch(IH,JSEA)=WNMEAN(JSEA)
END IF
END IF
IF ( FLGRDALL( 2, 20) ) THEN
IH = IH + 1
Arrexch(IH,JSEA)=BRCOEF(JSEA)
Expand Down
2 changes: 1 addition & 1 deletion model/src/w3odatmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ MODULE W3ODATMD
INTEGER :: NOUTP = -1, IOUTP = -1, IOSTYP = 1
!
INTEGER, PARAMETER :: NOGRP = 10
INTEGER, PARAMETER :: NGRPP = 20
INTEGER, PARAMETER :: NGRPP = 21
INTEGER, PARAMETER :: DIMP = 15
INTEGER :: NOGE(NOGRP)
INTEGER :: NOTYPE
Expand Down
10 changes: 5 additions & 5 deletions model/src/w3sdb1md.F90
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,11 @@ SUBROUTINE W3SDB1 (IX, A, DEPTH, EMEAN, FMEAN, WNMEAN, CG, LBREAK, S, D )
!
! 3. Breaking coefficient
!
IF (FSLOPE) THEN
BRCOEF_LOC = MAX(0.1,MIN(BRCOEF(IX),1.2))
ELSE
BRCOEF_LOC = DBLE(SDBC1)
END IF
IF (FSLOPE) THEN
BRCOEF_LOC = BRCOEF(IX)
ELSE
BRCOEF_LOC = DBLE(SDBC1)
END IF
!
! 4. Estimate the breaking coefficient ------------------------------- /
!
Expand Down
2 changes: 1 addition & 1 deletion model/src/w3srcemd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, &
IF (.NOT. FSSOURCE .or. LSLOC) THEN
#endif
#ifdef W3_DB1
CALL W3SDB1 ( IX, SPEC, DEPTH, EMEAN, FMEAN, WNMEAN, CG1, &
CALL W3SDB1 ( JSEA, SPEC, DEPTH, EMEAN, FMEAN, WNMEAN, CG1, &
LBREAK, VSDB, VDDB )
#endif
#ifdef W3_PDLIB
Expand Down
36 changes: 17 additions & 19 deletions model/src/w3wavemd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1451,23 +1451,6 @@ SUBROUTINE W3WAVE ( IMOD, ODAT, TEND, STAMP, NO_OUT &
END IF
#endif
call print_memcheck(memunit, 'memcheck_____:'//' WW3_WAVE TIME LOOP 13')
!
! Compute slope-dependant depth-induced breaking coefficient
!
CALL W3OUTG ( VA, .FALSE., .FALSE., .FALSE. )
DO JSEA=1, NSEAL
CALL INIT_GET_ISEA(ISEA, JSEA)
IX = MAPSF(ISEA,1)
IY = MAPSF(ISEA,2)
IF (LPDLIB) THEN
TANBETA = -DDDX(1,JSEA)*COS(THM(JSEA)) - DDDY(1,JSEA)*SIN(THM(JSEA))
BRCOEF(JSEA) = MAX(0.1,MIN(DBLE(SDBC1)*TANBETA,1.2))
ELSE
TANBETA = -DDDX(IY,IX)*COS(THM(JSEA)) - DDDY(IY,IX)*SIN(THM(JSEA))
BRCOEF(JSEA) = MAX(0.1,MIN(DBLE(SDBC1)*TANBETA,1.2))
ENDIF
END DO
!
#ifdef W3_PDLIB
IF (LPDLIB .and. FLSOU .and. FSSOURCE) THEN
#endif
Expand Down Expand Up @@ -1495,7 +1478,6 @@ SUBROUTINE W3WAVE ( IMOD, ODAT, TEND, STAMP, NO_OUT &


#ifdef W3_PDLIB

DO JSEA = 1, NP

CALL INIT_GET_ISEA(ISEA, JSEA)
Expand Down Expand Up @@ -1688,7 +1670,23 @@ SUBROUTINE W3WAVE ( IMOD, ODAT, TEND, STAMP, NO_OUT &
END IF
END IF
#endif

#ifdef W3_DB1
!
! Compute slope-dependant depth-induced breaking coefficient
!
CALL W3OUTG ( VA, .FALSE., .FALSE., .FALSE. )
DO JSEA=1, NSEAL
CALL INIT_GET_ISEA(ISEA, JSEA)
IX = MAPSF(ISEA,1)
IY = MAPSF(ISEA,2)
IF (LPDLIB) THEN
TANBETA = -DDDX(1,JSEA)*COS(THM(JSEA)) - DDDY(1,JSEA)*SIN(THM(JSEA))
ELSE
TANBETA = -DDDX(IY,IX)*COS(THM(JSEA)) - DDDY(IY,IX)*SIN(THM(JSEA))
END IF
BRCOEF(JSEA) = MAX(0.1,MIN(DBLE(SDBC1)*TANBETA,1.2))
END DO
#endif
!
! 3.6 Perform Propagation = = = = = = = = = = = = = = = = = = = = = = =
! 3.6.1 Preparations
Expand Down

0 comments on commit da2ba30

Please sign in to comment.