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

flexible DT for different grid comps #1369

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
12 changes: 10 additions & 2 deletions generic/MAPL_Generic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1302,6 +1302,7 @@ subroutine handle_clock_and_main_alarm(clock, unusable, rc)
type(ESMF_Clock), intent(in) :: clock
class(KeywordEnforcer), optional, intent(in) :: unusable
integer, optional, intent(out) :: rc
character(len=3) :: alarm_ring_at_0

STATE%CLOCK = CLOCK
call ESMF_ClockGet(CLOCK, TIMESTEP = DELT, __RC__)
Expand Down Expand Up @@ -1360,8 +1361,15 @@ subroutine handle_clock_and_main_alarm(clock, unusable, rc)
ringTime = ringTime - (INT((ringTime - currTime)/TIMEINT)+1)*TIMEINT
end if

ringTime = ringTime-TSTEP ! we back off current time with clock's dt since
! we advance the clock AFTER run method
call MAPL_GetResource (STATE, alarm_ring_at_0, label='ALARM_RING_AT_0:', &
default="NO", __RC__ )

! we back off current time with clock's dt since
! we advance the clock AFTER run metho
! if the alarm ring at 0, we don't back off the time.
if (alarm_ring_at_0 == "NO") then
ringTime = ringTime-TSTEP
endif

! make sure that ringTime is not in the past
do while (ringTime < currTime)
Expand Down