Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug fix for SCM time index #3154

Merged
merged 1 commit into from
Sep 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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