Skip to content

Commit

Permalink
w3fld1md.F90: fix divide by zero in CRIT2 parameter (#1184)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewMasarik-NOAA committed Feb 5, 2024
1 parent ff0358a commit ba5cd68
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions model/src/w3fld1md.F90
Original file line number Diff line number Diff line change
Expand Up @@ -550,9 +550,13 @@ SUBROUTINE W3FLD1( ASPC, FPI, WNDX,WNDY, ZWND, &
TAUDIR=atan2(TAUY, TAUX)
! Note: add another criterion (stress direction) for iteration.
CRIT1=(ABS(USTAR-USTRB)*100.0)/((USTAR+USTRB)*0.5) .GT. 0.1
CRIT2=(ABS(TAUDIR-TAUDIRB)*100.0/(TAUDIR+TAUDIRB)*0.5) .GT. 0.1
IF ((TAUDIR+TAUDIRB).NE.0.) THEN
CRIT2=(ABS(TAUDIR-TAUDIRB)*100.0/(TAUDIR+TAUDIRB)*0.5) .GT. 0.1
ELSE
CRIT2=.TRUE.
ENDIF
IF (CRIT1 .OR. CRIT2) THEN
! IF ((ABS(USTAR-USTRB)*100.0)/((USTAR+USTRB)*0.5) .GT. 0.1) THEN
! IF ((ABS(USTAR-USTRB)*100.0)/((USTAR+USTRB)*0.5) .GT. 0.1) THEN
USTRB=USTAR
TAUDIRB=TAUDIR
CTR=CTR+1
Expand Down

0 comments on commit ba5cd68

Please sign in to comment.