@@ -426,7 +426,7 @@ end subroutine ESMF_ClockAdvance
426
426
! !INTERFACE:
427
427
! Private name; call using ESMF_ClockCreate()
428
428
function ESMF_ClockCreateNew (timeStep , startTime , keywordEnforcer , &
429
- stopTime , runDuration , runTimeStepCount , refTime , name , rc )
429
+ stopTime , runDuration , runTimeStepCount , refTime , repeatDuration , name , rc )
430
430
431
431
! !RETURN VALUE:
432
432
type (ESMF_Clock) :: ESMF_ClockCreateNew
@@ -439,6 +439,7 @@ function ESMF_ClockCreateNew(timeStep, startTime, keywordEnforcer, &
439
439
type (ESMF_TimeInterval), intent (in ), optional :: runDuration
440
440
integer , intent (in ), optional :: runTimeStepCount
441
441
type (ESMF_Time), intent (in ), optional :: refTime
442
+ type (ESMF_TimeInterval), intent (in ), optional :: repeatDuration
442
443
character (len=* ), intent (in ), optional :: name
443
444
integer , intent (out ), optional :: rc
444
445
@@ -482,6 +483,9 @@ function ESMF_ClockCreateNew(timeStep, startTime, keywordEnforcer, &
482
483
! \item[{[refTime]}]
483
484
! The {\tt ESMF\_Clock}'s reference time. Provides reference point
484
485
! for simulation time (see currSimTime in ESMF\_ClockGet() below).
486
+ ! \item[{[repeatDuration]}]
487
+ ! If specified and not 0, then makes {\tt ESMF\_Clock} a repeating clock that runs for
488
+ ! {\tt repeatDuration} and then resets back to {\tt statTime}.
485
489
! \item[{[name]}]
486
490
! The name for the newly created clock. If not specified, a
487
491
! default unique name will be generated: "ClockNNN" where NNN
@@ -518,7 +522,7 @@ function ESMF_ClockCreateNew(timeStep, startTime, keywordEnforcer, &
518
522
! invoke C to C++ entry point to allocate and initialize new clock
519
523
call c_ESMC_ClockCreateNew(ESMF_ClockCreateNew, nameLen, name, &
520
524
timeStep, startTime, stopTime, runDuration, &
521
- runTimeStepCount, refTime, localrc)
525
+ runTimeStepCount, refTime, repeatDuration, localrc)
522
526
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
523
527
ESMF_CONTEXT, rcToReturn= rc)) return
524
528
@@ -680,7 +684,8 @@ subroutine ESMF_ClockGet(clock, keywordEnforcer, &
680
684
timeStep , startTime , stopTime , &
681
685
runDuration , runTimeStepCount , refTime , currTime , prevTime , &
682
686
currSimTime , prevSimTime , calendar , calkindflag , timeZone , &
683
- advanceCount , alarmCount , direction , name , rc )
687
+ advanceCount , alarmCount , direction , repeatDuration , repeatCount , &
688
+ name , rc )
684
689
685
690
! !ARGUMENTS:
686
691
type (ESMF_Clock), intent (in ) :: clock
@@ -701,6 +706,8 @@ subroutine ESMF_ClockGet(clock, keywordEnforcer, &
701
706
integer (ESMF_KIND_I8), intent (out ), optional :: advanceCount
702
707
integer , intent (out ), optional :: alarmCount
703
708
type (ESMF_Direction_Flag), intent (out ), optional :: direction
709
+ type (ESMF_TimeInterval), intent (out ), optional :: repeatDuration
710
+ integer (ESMF_KIND_I8), intent (out ), optional :: repeatCount
704
711
character (len=* ), intent (out ), optional :: name
705
712
integer , intent (out ), optional :: rc
706
713
@@ -762,6 +769,10 @@ subroutine ESMF_ClockGet(clock, keywordEnforcer, &
762
769
! The {\tt ESMF\_Clock}'s time stepping direction. See also
763
770
! {\tt ESMF\_ClockIsReverse()}, an alternative for convenient use in
764
771
! "if" and "do while" constructs.
772
+ ! \item[{[repeatDuration]}]
773
+ ! If not 0, then how long the clock should run before going back to startTime.
774
+ ! \item[{[repeatCount]}]
775
+ ! The number of times this clock has gone back to startTime when repeating.
765
776
! \item[{[name]}]
766
777
! The name of this clock.
767
778
! \item[{[rc]}]
@@ -800,7 +811,8 @@ subroutine ESMF_ClockGet(clock, keywordEnforcer, &
800
811
runDuration, runTimeStepCount, refTime, &
801
812
currTime, prevTime, currSimTime, prevSimTime, &
802
813
calendar, calkindflag, timeZone, advanceCount, &
803
- alarmCount, direction, localrc)
814
+ alarmCount, direction, repeatDuration, repeatCount, &
815
+ localrc)
804
816
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
805
817
ESMF_CONTEXT, rcToReturn= rc)) return
806
818
@@ -821,7 +833,8 @@ subroutine ESMF_ClockGet(clock, keywordEnforcer, &
821
833
call ESMF_TimeIntervalInit(currSimTime)
822
834
call ESMF_TimeIntervalInit(prevSimTime)
823
835
call ESMF_CalendarSetInitCreated(calendar)
824
-
836
+ call ESMF_TimeIntervalInit(repeatDuration)
837
+
825
838
! Return success
826
839
if (present (rc)) rc = ESMF_SUCCESS
827
840
end subroutine ESMF_ClockGet
0 commit comments