From 7149c974118149109a11e2daf10a9c5974fe7372 Mon Sep 17 00:00:00 2001 From: Jessica Meixner Date: Wed, 25 Oct 2023 16:00:22 +0000 Subject: [PATCH] insure we do not try to calculate a date on an uninitialized value --- model/src/w3wavemd.F90 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/model/src/w3wavemd.F90 b/model/src/w3wavemd.F90 index 44c80964d..b13dd04db 100644 --- a/model/src/w3wavemd.F90 +++ b/model/src/w3wavemd.F90 @@ -526,6 +526,7 @@ SUBROUTINE W3WAVE ( IMOD, ODAT, TEND, STAMP, NO_OUT & ! #ifdef W3_MPI LOGICAL :: SBSED + LOGICAL :: CPLWRTFLG #endif #ifdef W3_SEC1 INTEGER :: ISEC1 @@ -2409,8 +2410,14 @@ SUBROUTINE W3WAVE ( IMOD, ODAT, TEND, STAMP, NO_OUT & #endif ! #ifdef W3_MPI + CPLWRTFLG=.FALSE. + IF ( FLOUT(7) .AND. SBSED ) THEN + IF (DSEC21(TIME,TONEXT(:,7)).EQ.0.) THEN + CPLWRTFLG=.TRUE. + END IF + END IF IF ( ( (DSEC21(TIME,TONEXT(:,1)).EQ.0.) .AND. FLOUT(1) ) .OR. & - ( (DSEC21(TIME,TONEXT(:,7)).EQ.0.) .AND. FLOUT(7) .AND. SBSED ) ) THEN + ( CPLWRTFLG ) THEN IF (.NOT. LPDLIB) THEN IF (NRQGO.NE.0 ) THEN #endif