Skip to content

Commit

Permalink
ww3_prnc.F90: IY out-of-range fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewMasarik-NOAA committed Jan 30, 2024
1 parent ff0358a commit b2f0452
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions model/src/ww3_prnc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1059,15 +1059,15 @@ PROGRAM W3PRNC
! Manages the simple closure of the grid
!
IF (ICLO.EQ.ICLOSE_NONE) THEN
IF (IX21(IX,1).LT.1.OR.IX21(IX,1).GT.NXI-1) WRITE(NDSO,1042) IX, IY, X, Y
IF (IX21(IX,1).LT.1.OR.IX21(IX,1).GT.NXI-1) WRITE(NDSO,1041) IX, X, Y
IX21(IX,1) = MAX ( 1 , MIN(IX21(IX,1),NXI-1) )
IX22(IX,1) = IX21(IX,1) + 1
ELSE
IX21(IX,1) = MAX ( 1 , MIN(IX21(IX,1),NXI) )
IX22(IX,1) = MOD(IX21(IX,1),NXI)+1
END IF
IY21(IX,1) = 1 + INT((Y-Y0I)/SYI)
IF (IY21(IX,1).LT.1.OR.IY21(IX,1).GT.NYI-1) WRITE(NDSO,1042) IX, IY, X, Y
IF (IY21(IX,1).LT.1.OR.IY21(IX,1).GT.NYI-1) WRITE(NDSO,1041) IX, X, Y
IY21(IX,1) = MAX ( 1 , MIN(IY21(IX,1),NYI-1) )
IY22(IX,1) = IY21(IX,1) + 1
!
Expand Down Expand Up @@ -2438,6 +2438,9 @@ PROGRAM W3PRNC
' 2MS2 2MN2 2NK2 MNS2 MSN2 2SM2 3MSN2 ' &
' M4 MS4 MN4 M6 2MS6 2MN6'/)
!
1041 FORMAT (/' *** WAVEWATCH-III WARNING W3PRNC : '/ &
' GRID POINT ',I6,2F7.2,/ &
' NOT COVERED BY INPUT GRID.'/)
1042 FORMAT (/' *** WAVEWATCH-III WARNING W3PRNC : '/ &
' GRID POINT ',2I6,2F7.2,/ &
' NOT COVERED BY INPUT GRID.'/)
Expand Down

0 comments on commit b2f0452

Please sign in to comment.