Skip to content

Commit

Permalink
fix multiple writes when waves are in slow loop
Browse files Browse the repository at this point in the history
  • Loading branch information
DeniseWorthen committed Sep 10, 2024
1 parent 553f1b1 commit 8d0f170
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions model/src/w3wavemd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ SUBROUTINE W3WAVE ( IMOD, ODAT, TEND, STAMP, NO_OUT &
!/ ------------------------------------------------------------------- /
!/ Parameter list
!/
INTEGER, INTENT(IN) :: IMOD, TEND(2),ODAT(35)
INTEGER, INTENT(IN) :: IMOD, TEND(2),ODAT(40)
LOGICAL, INTENT(IN), OPTIONAL :: STAMP, NO_OUT
#ifdef W3_OASIS
INTEGER, INTENT(IN), OPTIONAL :: ID_LCOMM
Expand Down Expand Up @@ -2300,10 +2300,6 @@ SUBROUTINE W3WAVE ( IMOD, ODAT, TEND, STAMP, NO_OUT &
END DO
IF (IT.GT.0) DTG=DTGTEMP
#endif




!
!
! 3.8 Update global time step.
Expand Down Expand Up @@ -2336,7 +2332,7 @@ SUBROUTINE W3WAVE ( IMOD, ODAT, TEND, STAMP, NO_OUT &
#endif
!
!
END DO
END DO ! DO IT = IT0, NT

#ifdef W3_TIMINGS
CALL PRINT_MY_TIME("W3WAVE, step 6.21.1")
Expand All @@ -2357,21 +2353,23 @@ SUBROUTINE W3WAVE ( IMOD, ODAT, TEND, STAMP, NO_OUT &
! Delay if data assimilation time.
!
!
if (use_historync) then
floutg = .false.
floutg2 = .false.
if (histwr) then
call w3cprt (imod)
call w3outg (va, flpfld, .true., .false. )
call write_history(tend)
if (dsec21(time,tend) == 0.0) then ! req'd in case waves are running in slow loop
if (use_historync) then
floutg = .false.
floutg2 = .false.
if (histwr) then
call w3cprt (imod)
call w3outg (va, flpfld, .true., .false. )
call write_history(tend)
end if
end if
end if

if (use_restartnc) then
if (rstwr) then
call set_user_timestring(tend,user_timestring)
fname = trim(user_restfname)//trim(user_timestring)//'.nc'
call write_restart(trim(fname), va, mapsta+8*mapst2)
if (use_restartnc) then
if (rstwr) then
call set_user_timestring(tend,user_timestring)
fname = trim(user_restfname)//trim(user_timestring)//'.nc'
call write_restart(trim(fname), va, mapsta+8*mapst2)
end if
end if
end if

Expand Down

0 comments on commit 8d0f170

Please sign in to comment.