diff --git a/CHANGELOG.md b/CHANGELOG.md index e2e11e028613..5b365a45c158 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fixed duration of the clock to be the smaller of the user specified duration and (END_DATE - currTime) - Fixed failures to fully trap errors in - History GC - MemUtils diff --git a/gridcomps/Cap/MAPL_CapGridComp.F90 b/gridcomps/Cap/MAPL_CapGridComp.F90 index f549bf8c1461..5a908e8b1e7f 100644 --- a/gridcomps/Cap/MAPL_CapGridComp.F90 +++ b/gridcomps/Cap/MAPL_CapGridComp.F90 @@ -1678,6 +1678,7 @@ subroutine MAPL_ClockInit ( MAPLOBJ, Clock, nsteps, rc) type(ESMF_Time) :: CurrTime ! Current Current Time of Experiment type(ESMF_TimeInterval) :: timeStep ! HEARTBEAT type(ESMF_TimeInterval) :: duration + type(ESMF_TimeInterval) :: maxDuration type(ESMF_Calendar) :: cal character(ESMF_MAXSTR) :: calendar @@ -1929,6 +1930,9 @@ subroutine MAPL_ClockInit ( MAPLOBJ, Clock, nsteps, rc) rc = STATUS ) _VERIFY(STATUS) + maxDuration = EndTime - currTime + if (duration > maxDuration) duration = maxDuration + stopTime = currTime + duration ! initialize model time step