Skip to content

Commit

Permalink
bug fix for SCM time index
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Andrew Bogenschutz committed Aug 15, 2019
1 parent ded0ee3 commit 8a730af
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions components/cam/src/control/scamMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ subroutine setiopupdate
integer bdate, bdate_varID
integer STATUS
integer next_date, next_sec, last_date, last_sec
integer next_date_print, next_sec_print
integer :: ncsec,ncdate ! current time of day,date
integer :: yr, mon, day ! year, month, and day component
integer :: start_ymd,start_tod
Expand Down Expand Up @@ -553,16 +554,16 @@ subroutine setiopupdate

doiopupdate = .false.
iopTimeIdx = iopTimeIdx
i=0
doiter=.true.
do while(doiter)
call timemgr_time_inc(bdate, 0, next_date, next_sec,inc_s=tsec(iopTimeIdx+i+1))
call timemgr_time_inc(bdate, 0, next_date, next_sec,inc_s=tsec(iopTimeIdx+1))
if (ncdate .gt. next_date .or. (ncdate .eq. next_date &
.and. ncsec .ge. next_sec)) then

doiopupdate=.true.
i=i+1
iopTimeIdx=iopTimeIdx+1
next_date_print = next_date
next_sec_print = next_sec
else
doiter=.false.
endif
Expand All @@ -576,10 +577,11 @@ subroutine setiopupdate

if (doiopupdate) then

write(iulog,*) 'iopTimeIdx =', iopTimeIdx
write(iulog,*) 'iopTimeIdx (IOP index) =', iopTimeIdx
write(iulog,*) 'nstep = ',get_nstep()
write(iulog,*) 'ncdate=',ncdate,' ncsec=',ncsec
write(iulog,*) 'next_date=',next_date,' next_sec=',next_sec
write(iulog,*) 'ncdate (E3SM date) =',ncdate,' ncsec=',ncsec
write(iulog,*) 'next_date (IOP file date) =',next_date_print,' &
next_sec=',next_sec_print
write(iulog,*)'******* do iop update'
endif

Expand Down

0 comments on commit 8a730af

Please sign in to comment.