From 5bfd90c2f257486c03857ea24cb406691502a4d6 Mon Sep 17 00:00:00 2001 From: Jessica Meixner Date: Wed, 25 Oct 2023 16:36:42 +0000 Subject: [PATCH] update logical so we do not use an uninitialized variable in date calculation --- 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 9347b42a5..9e7c7a12f 100644 --- a/model/src/w3wavemd.F90 +++ b/model/src/w3wavemd.F90 @@ -524,6 +524,7 @@ SUBROUTINE W3WAVE ( IMOD, ODAT, TEND, STAMP, NO_OUT & REAL :: ICEDAVE ! LOGICAL :: SBSED + LOGICAL :: CPLWRTFLG #ifdef W3_SEC1 INTEGER :: ISEC1 #endif @@ -2432,8 +2433,14 @@ SUBROUTINE W3WAVE ( IMOD, ODAT, TEND, STAMP, NO_OUT & do_startall = .true. end IF else + 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=.FALSE. ) THEN do_startall = .true. end IF end if