<p><b>dwj07@fsu.edu</b> 2012-11-29 15:23:06 -0700 (Thu, 29 Nov 2012)</p><p><br>
        -- BRANCH COMMIT --<br>
<br>
        Cleaning up ESMF issues between CESM and MPAS.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/cesm_coupling/src/Makefile
===================================================================
--- branches/ocean_projects/cesm_coupling/src/Makefile        2012-11-29 20:50:09 UTC (rev 2328)
+++ branches/ocean_projects/cesm_coupling/src/Makefile        2012-11-29 22:23:06 UTC (rev 2329)
@@ -29,7 +29,7 @@
mpas: reg_includes externals frame ops dycore drver
ifeq "$(CESM)" "true"
-        ar ru lib$(CORE).a external/esmf_time_f90/*.o
+#        ar ru lib$(CORE).a external/esmf_time_f90/*.o
        ar ru lib$(CORE).a framework/*.o
        ar ru lib$(CORE).a operators/*.o
        ar ru lib$(CORE).a core_$(CORE)/*.o
@@ -41,9 +41,13 @@
reg_includes:
        ( cd registry; $(MAKE) CC="$(SCC)" )
        ( cd inc; $(CPP) ../core_$(CORE)/Registry | ../registry/parse > Registry.processed)
+ifeq "$(CESM)" "true"
+externals:
+else
externals: reg_includes
        ( cd external; $(MAKE) FC="$(FC)" SFC="$(SFC)" CC="$(CC)" SCC="$(SCC)" FFLAGS="$(FFLAGS)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" NETCDF="$(NETCDF)" CORE="$(CORE)" )
+endif
frame: reg_includes externals
        ( cd framework; $(MAKE) CPPFLAGS="$(CPPFLAGS)" CPPINCLUDES="$(CPPINCLUDES)" all )
Added: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_Alarm.F90
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_Alarm.F90         (rev 0)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_Alarm.F90        2012-11-29 22:23:06 UTC (rev 2329)
@@ -0,0 +1,953 @@
+!
+! Earth System Modeling Framework
+! Copyright 2002-2003, University Corporation for Atmospheric Research,
+! Massachusetts Institute of Technology, Geophysical Fluid Dynamics
+! Laboratory, University of Michigan, National Centers for Environmental
+! Prediction, Los Alamos National Laboratory, Argonne National Laboratory,
+! NASA Goddard Space Flight Center.
+! Licensed under the University of Illinois-NCSA license.
+!
+!==============================================================================
+!
+! ESMF Alarm Module
+ module ESMF_AlarmMod
+!
+!==============================================================================
+!
+! This file contains the Alarm class definition and all Alarm class
+! methods.
+!
+!------------------------------------------------------------------------------
+! INCLUDES
+#include <ESMF_TimeMgr.inc>
+
+!===============================================================================
+!BOPI
+!
+! !MODULE: ESMF_AlarmMod
+!
+! !DESCRIPTION:
+! Part of Time Manager F90 API wrapper of C++ implemenation
+!
+! Defines F90 wrapper entry points for corresponding
+! C++ class {\tt ESMC\_Alarm}
+!
+! See {\tt ../include/ESMC\_Alarm.h} for complete description
+!
+!------------------------------------------------------------------------------
+! !USES:
+ ! inherit from ESMF base class
+ use ESMF_BaseMod
+
+ ! associated derived types
+ use ESMF_TimeIntervalMod, only : ESMF_TimeInterval, &
+ ESMF_TimeIntervalAbsValue
+ use ESMF_TimeMod, only : ESMF_Time
+
+ implicit none
+
+!------------------------------------------------------------------------------
+! !PRIVATE TYPES:
+ private
+!------------------------------------------------------------------------------
+! ! ESMF_Alarm
+!
+! ! F90 class type to match C++ Alarm class in size only;
+! ! all dereferencing within class is performed by C++ implementation
+
+! internals for ESMF_Alarm
+ type ESMF_AlarmInt
+ type(ESMF_TimeInterval) :: RingInterval
+ type(ESMF_Time) :: RingTime
+ type(ESMF_Time) :: PrevRingTime
+ type(ESMF_Time) :: StopTime
+ integer :: ID
+ integer :: AlarmMutex
+ logical :: Ringing
+ logical :: Enabled
+ logical :: RingTimeSet
+ logical :: RingIntervalSet
+ logical :: StopTimeSet
+ end type
+
+! Actual public type: this bit allows easy mimic of "deep" ESMF_AlarmCreate
+! in ESMF 2.1.0+. Note that ESMF_AlarmCreate is in a separate module to avoid
+! cyclic dependence.
+! NOTE: DO NOT ADD NON-POINTER STATE TO THIS DATA TYPE. It emulates ESMF
+! shallow-copy-masquerading-as-reference-copy insanity.
+ type ESMF_Alarm
+ type(ESMF_AlarmInt), pointer :: alarmint
+ end type
+
+!------------------------------------------------------------------------------
+! !PUBLIC TYPES:
+ public ESMF_Alarm
+ public ESMF_AlarmInt ! needed on AIX but not PGI
+!------------------------------------------------------------------------------
+
+! !PUBLIC MEMBER FUNCTIONS:
+ public ESMF_AlarmDestroy
+ public ESMF_AlarmSet
+ public ESMF_AlarmGet
+! public ESMF_AlarmGetRingInterval
+! public ESMF_AlarmSetRingInterval
+! public ESMF_AlarmGetRingTime
+! public ESMF_AlarmSetRingTime
+ public ESMF_AlarmGetPrevRingTime
+ public ESMF_AlarmSetPrevRingTime
+! public ESMF_AlarmGetStopTime
+! public ESMF_AlarmSetStopTime
+ public ESMF_AlarmEnable
+ public ESMF_AlarmDisable
+ public ESMF_AlarmRingerOn
+ public ESMF_AlarmRingerOff
+ public ESMF_AlarmIsRinging
+! public ESMF_AlarmCheckRingTime
+ public operator(==)
+
+! Required inherited and overridden ESMF_Base class methods
+
+! public ESMF_AlarmRead
+! public ESMF_AlarmWrite
+ public ESMF_AlarmValidate
+ public ESMF_AlarmPrint
+
+! !PRIVATE MEMBER FUNCTIONS:
+ private ESMF_AlarmEQ
+!EOPI
+
+!==============================================================================
+!
+! INTERFACE BLOCKS
+!
+!==============================================================================
+!BOP
+! !INTERFACE:
+ interface operator(==)
+
+! !PRIVATE MEMBER FUNCTIONS:
+ module procedure ESMF_AlarmEQ
+
+! !DESCRIPTION:
+! This interface overloads the == operator for the {\tt ESMF\_Alarm} class
+!
+!EOP
+ end interface
+!
+!------------------------------------------------------------------------------
+
+!==============================================================================
+
+ contains
+
+!==============================================================================
+
+!------------------------------------------------------------------------------
+!
+! This section includes the Set methods.
+!
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_AlarmSet - Initializes an alarm
+
+! !INTERFACE:
+ subroutine ESMF_AlarmSet(alarm, RingTime, RingInterval, PrevRingTime, &
+ StopTime, Enabled, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Alarm), intent(inout) :: alarm ! really INTENT(OUT)
+ type(ESMF_Time), intent(in), optional :: RingTime, PrevRingTime
+ type(ESMF_TimeInterval), intent(in), optional :: RingInterval
+ type(ESMF_Time), intent(in), optional :: StopTime
+ logical, intent(in), optional :: Enabled
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Initializes an {\tt ESMF\_Alarm}
+!
+! The arguments are:
+! \begin{description}
+! \item[alarm]
+! The object instance to initialize
+! \item[{[RingTime]}]
+! Optional ring time for one-shot or first repeating alarm
+! \item[{[RingInterval]}]
+! Optional ring interval for repeating alarms
+! \item[{[StopTime]}]
+! Optional stop time for repeating alarms
+! \item[Enabled]
+! Alarm enabled/disabled
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG4.1, TMG4.7
+!EOP
+ IF ( ASSOCIATED( alarm%alarmint ) ) THEN
+ alarm%alarmint%RingTimeSet = .FALSE.
+ alarm%alarmint%RingIntervalSet = .FALSE.
+ alarm%alarmint%StopTimeSet = .FALSE.
+ IF ( PRESENT( RingInterval ) ) THEN
+ ! force RingInterval to be positive
+ alarm%alarmint%RingInterval = &
+ ESMF_TimeIntervalAbsValue( RingInterval )
+ alarm%alarmint%RingIntervalSet = .TRUE.
+ ENDIF
+ IF ( PRESENT( PrevRingTime ) ) THEN
+ alarm%alarmint%PrevRingTime = PrevRingTime
+ ENDIF
+ IF ( PRESENT( RingTime ) ) THEN
+ alarm%alarmint%RingTime = RingTime
+ alarm%alarmint%RingTimeSet = .TRUE.
+ ENDIF
+ IF ( PRESENT( StopTime ) ) THEN
+ alarm%alarmint%StopTime = StopTime
+ alarm%alarmint%StopTimeSet = .TRUE.
+ ENDIF
+ alarm%alarmint%Enabled = .TRUE.
+ IF ( PRESENT( Enabled ) ) THEN
+ alarm%alarmint%Enabled = Enabled
+ ENDIF
+ IF ( PRESENT( rc ) ) THEN
+ rc = ESMF_SUCCESS
+ ENDIF
+ alarm%alarmint%Ringing = .FALSE.
+ alarm%alarmint%Enabled = .TRUE.
+ ELSE
+ IF ( PRESENT( rc ) ) rc = ESMF_FAILURE
+ ENDIF
+
+ end subroutine ESMF_AlarmSet
+
+
+
+! Deallocate memory for ESMF_Alarm
+ SUBROUTINE ESMF_AlarmDestroy( alarm, rc )
+ TYPE(ESMF_Alarm), INTENT(INOUT) :: alarm
+ INTEGER, INTENT( OUT), OPTIONAL :: rc
+ IF ( ASSOCIATED( alarm%alarmint ) ) THEN
+ DEALLOCATE( alarm%alarmint )
+ ENDIF
+ ! TBH: ignore deallocate errors, for now
+ IF ( PRESENT( rc ) ) rc = ESMF_SUCCESS
+ END SUBROUTINE ESMF_AlarmDestroy
+
+
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_AlarmGetRingInterval - Get an alarm's ring interval
+!
+! !INTERFACE:
+ subroutine ESMF_AlarmGetRingInterval(alarm, RingInterval, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Alarm), intent(in) :: alarm
+ type(ESMF_TimeInterval), intent(out) :: RingInterval
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Get an {\tt ESMF\_Alarm}'s ring interval
+!
+! The arguments are:
+! \begin{description}
+! \item[alarm]
+! The object instance to get the ring interval
+! \item[RingInterval]
+! The {\tt Alarm}'s ring interval
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+
+! !REQUIREMENTS:
+! TMG4.7
+!EOP
+ RingInterval = alarm%alarmint%RingInterval
+
+ end subroutine ESMF_AlarmGetRingInterval
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_AlarmSetRingInterval - Set an alarm's ring interval
+!
+! !INTERFACE:
+ subroutine ESMF_AlarmSetRingInterval(alarm, RingInterval, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Alarm), intent(out) :: alarm
+ type(ESMF_TimeInterval), intent(in) :: RingInterval
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Set an {\tt ESMF\_Alarm}'s ring interval
+!
+! The arguments are:
+! \begin{description}
+! \item[alarm]
+! The object instance to set the ring interval
+! \item[RingInterval]
+! The {\tt Alarm}'s ring interval
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG4.5.2, TMG4.7
+!EOP
+ CALL wrf_error_fatal( 'ESMF_AlarmSetRingInterval not supported' )
+ end subroutine ESMF_AlarmSetRingInterval
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_AlarmGetRingTime - Get an alarm's time to ring
+!
+! !INTERFACE:
+ subroutine ESMF_AlarmGetRingTime(alarm, RingTime, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Alarm), intent(in) :: alarm
+ type(ESMF_Time), intent(out) :: RingTime
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Get an {\tt ESMF\_Alarm}'s time to ring
+!
+! The arguments are:
+! \begin{description}
+! \item[alarm]
+! The object instance to get the ring time
+! \item[RingTime]
+! The {\tt ESMF\_Alarm}'s ring time
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG4.7, TMG4.8
+!EOP
+ CALL wrf_error_fatal( 'ESMF_AlarmGetRingTime not supported' )
+ end subroutine ESMF_AlarmGetRingTime
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_AlarmSetRingTime - Set an alarm's time to ring
+!
+! !INTERFACE:
+ subroutine ESMF_AlarmSetRingTime(alarm, RingTime, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Alarm), intent(out) :: alarm
+ type(ESMF_Time), intent(in) :: RingTime
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Set an {\tt ESMF\_Alarm}'s time to ring
+!
+! The arguments are:
+! \begin{description}
+! \item[alarm]
+! The object instance to set the ring time
+! \item[RingTime]
+! The {\tt ESMF\_Alarm}'s ring time to set
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG4.5.1, TMG4.7, TMG4.8
+!EOP
+ CALL wrf_error_fatal( 'ESMF_AlarmSetRingTime not supported' )
+ end subroutine ESMF_AlarmSetRingTime
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_AlarmGet - Get an alarm's parameters -- compatibility with ESMF 2.0.1
+!
+! !INTERFACE:
+ subroutine ESMF_AlarmGet(alarm, PrevRingTime, RingInterval, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Alarm), intent(in) :: alarm
+ type(ESMF_Time), intent(out), optional :: PrevRingTime
+ type(ESMF_TimeInterval), intent(out), optional :: RingInterval
+ integer, intent(out), optional :: rc
+ integer :: ierr
+
+! !DESCRIPTION:
+! Get an {\tt ESMF\_Alarm}'s previous ring time
+!
+! The arguments are:
+! \begin{description}
+! \item[alarm]
+! The object instance to get the previous ring time
+! \item[PrevRingTime]
+! The {\tt ESMF\_Alarm}'s previous ring time
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG4.7, TMG4.8
+!EOP
+
+ ierr = ESMF_SUCCESS
+
+ IF ( PRESENT(PrevRingTime) ) THEN
+ CALL ESMF_AlarmGetPrevRingTime(alarm, PrevRingTime, rc=ierr)
+ ENDIF
+ IF ( PRESENT(RingInterval) ) THEN
+ CALL ESMF_AlarmGetRingInterval(alarm, RingInterval, rc=ierr)
+ ENDIF
+
+ IF ( PRESENT(rc) ) THEN
+ rc = ierr
+ ENDIF
+
+ end subroutine ESMF_AlarmGet
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_AlarmGetPrevRingTime - Get an alarm's previous ring time
+!
+! !INTERFACE:
+ subroutine ESMF_AlarmGetPrevRingTime(alarm, PrevRingTime, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Alarm), intent(in) :: alarm
+ type(ESMF_Time), intent(out) :: PrevRingTime
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Get an {\tt ESMF\_Alarm}'s previous ring time
+!
+! The arguments are:
+! \begin{description}
+! \item[alarm]
+! The object instance to get the previous ring time
+! \item[PrevRingTime]
+! The {\tt ESMF\_Alarm}'s previous ring time
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG4.7, TMG4.8
+!EOP
+ IF ( ASSOCIATED( alarm%alarmint ) ) THEN
+ PrevRingTime = alarm%alarmint%PrevRingTime
+ IF ( PRESENT( rc ) ) rc = ESMF_SUCCESS
+ ELSE
+ IF ( PRESENT( rc ) ) rc = ESMF_FAILURE
+ ENDIF
+ end subroutine ESMF_AlarmGetPrevRingTime
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_AlarmSetPrevRingTime - Set an alarm's previous ring time
+!
+! !INTERFACE:
+ subroutine ESMF_AlarmSetPrevRingTime(alarm, PrevRingTime, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Alarm), intent(out) :: alarm
+ type(ESMF_Time), intent(in) :: PrevRingTime
+ integer, intent(out), optional :: rc
+
+ IF ( ASSOCIATED( alarm%alarmint ) ) THEN
+ alarm%alarmint%PrevRingTime = PrevRingTime
+ IF ( PRESENT( rc ) ) rc = ESMF_SUCCESS
+ ELSE
+ IF ( PRESENT( rc ) ) rc = ESMF_FAILURE
+ ENDIF
+
+ end subroutine ESMF_AlarmSetPrevRingTime
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_AlarmGetStopTime - Get an alarm's stop time
+!
+! !INTERFACE:
+ subroutine ESMF_AlarmGetStopTime(alarm, StopTime, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Alarm), intent(in) :: alarm
+ type(ESMF_Time), intent(out) :: StopTime
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Get an {\tt ESMF\_Alarm}'s stop time
+!
+! The arguments are:
+! \begin{description}
+! \item[alarm]
+! The object instance to get the stop time
+! \item[StopTime]
+! The {\tt ESMF\_Alarm}'s stop time
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG4.5.2, TMG4.7
+!EOP
+ CALL wrf_error_fatal( 'ESMF_AlarmGetStopTime not supported' )
+ end subroutine ESMF_AlarmGetStopTime
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_AlarmSetStopTime - Set an alarm's stop time
+!
+! !INTERFACE:
+ subroutine ESMF_AlarmSetStopTime(alarm, StopTime, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Alarm), intent(out) :: alarm
+ type(ESMF_Time), intent(in) :: StopTime
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Set an {\tt ESMF\_Alarm}'s stop time
+!
+! The arguments are:
+! \begin{description}
+! \item[alarm]
+! The object instance to set the stop time
+! \item[StopTime]
+! The {\tt ESMF\_Alarm}'s stop time
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG4.5.2, TMG4.7
+!EOP
+ CALL wrf_error_fatal( 'ESMF_AlarmSetStopTime not supported' )
+ end subroutine ESMF_AlarmSetStopTime
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_AlarmEnable - Enables an alarm
+
+! !INTERFACE:
+ subroutine ESMF_AlarmEnable(alarm, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Alarm), intent(inout) :: alarm ! really INTENT(OUT)
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Enables an {\tt ESMF\_Alarm} to function
+!
+! The arguments are:
+! \begin{description}
+! \item[alarm]
+! The object instance to enable
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+
+! !REQUIREMENTS:
+! TMG4.5.3
+!EOP
+ IF ( ASSOCIATED( alarm%alarmint ) ) THEN
+ alarm%alarmint%Enabled = .TRUE.
+ IF ( PRESENT( rc ) ) rc = ESMF_SUCCESS
+ ELSE
+ IF ( PRESENT( rc ) ) rc = ESMF_FAILURE
+ ENDIF
+ end subroutine ESMF_AlarmEnable
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_AlarmDisable - Disables an alarm
+
+! !INTERFACE:
+ subroutine ESMF_AlarmDisable(alarm, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Alarm), intent(inout) :: alarm ! really INTENT(OUT)
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Disables an {\tt ESMF\_Alarm}
+!
+! The arguments are:
+! \begin{description}
+! \item[alarm]
+! The object instance to disable
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+
+! !REQUIREMENTS:
+! TMG4.5.3
+!EOP
+ IF ( ASSOCIATED( alarm%alarmint ) ) THEN
+ alarm%alarmint%Enabled = .FALSE.
+ IF ( PRESENT( rc ) ) rc = ESMF_SUCCESS
+ ELSE
+ IF ( PRESENT( rc ) ) rc = ESMF_FAILURE
+ ENDIF
+ end subroutine ESMF_AlarmDisable
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_AlarmRingerOn - Turn on an alarm
+
+
+! !INTERFACE:
+ subroutine ESMF_AlarmRingerOn(alarm, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Alarm), intent(inout) :: alarm ! really INTENT(OUT)
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Turn on an {\tt ESMF\_Alarm}; sets ringing state
+!
+! The arguments are:
+! \begin{description}
+! \item[alarm]
+! The object instance to turn on
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG4.6
+!EOP
+ IF ( ASSOCIATED( alarm%alarmint ) ) THEN
+ IF ( alarm%alarmint%Enabled ) THEN
+ alarm%alarmint%Ringing = .TRUE.
+ IF ( PRESENT( rc ) ) rc = ESMF_SUCCESS
+ ELSE
+ alarm%alarmint%Ringing = .FALSE.
+ IF ( PRESENT( rc ) ) rc = ESMF_FAILURE
+ ENDIF
+ ELSE
+ IF ( PRESENT( rc ) ) rc = ESMF_FAILURE
+ ENDIF
+
+ end subroutine ESMF_AlarmRingerOn
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_AlarmRingerOff - Turn off an alarm
+
+! !INTERFACE:
+ subroutine ESMF_AlarmRingerOff(alarm, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Alarm), intent(inout) :: alarm ! really INTENT(OUT)
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Turn off an {\tt ESMF\_Alarm}; unsets ringing state
+!
+! The arguments are:
+! \begin{description}
+! \item[alarm]
+! The object instance to turn off
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+
+! !REQUIREMENTS:
+! TMG4.6
+!EOP
+ IF ( ASSOCIATED( alarm%alarmint ) ) THEN
+ alarm%alarmint%Ringing = .FALSE.
+ IF ( alarm%alarmint%Enabled ) THEN
+ IF ( PRESENT( rc ) ) rc = ESMF_SUCCESS
+ ELSE
+ IF ( PRESENT( rc ) ) rc = ESMF_FAILURE
+ ENDIF
+ ELSE
+ IF ( PRESENT( rc ) ) rc = ESMF_FAILURE
+ ENDIF
+ end subroutine ESMF_AlarmRingerOff
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_AlarmIsRinging - Check if alarm is ringing
+
+! !INTERFACE:
+ function ESMF_AlarmIsRinging(alarm, rc)
+!
+! !RETURN VALUE:
+ logical :: ESMF_AlarmIsRinging
+
+! !ARGUMENTS:
+ type(ESMF_Alarm), intent(in) :: alarm
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Check if {\tt ESMF\_Alarm} is ringing.
+!
+! The arguments are:
+! \begin{description}
+! \item[alarm]
+! The object instance to check for ringing state
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+
+! !REQUIREMENTS:
+! TMG4.4
+!EOP
+ IF ( ASSOCIATED( alarm%alarmint ) ) THEN
+ IF ( alarm%alarmint%Enabled ) THEN
+ ESMF_AlarmIsRinging = alarm%alarmint%Ringing
+ IF ( PRESENT( rc ) ) rc = ESMF_SUCCESS
+ ELSE
+ ESMF_AlarmIsRinging = .FALSE.
+ IF ( PRESENT( rc ) ) rc = ESMF_FAILURE
+ ENDIF
+ ELSE
+ IF ( PRESENT( rc ) ) rc = ESMF_FAILURE
+ ENDIF
+ end function ESMF_AlarmIsRinging
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_AlarmCheckRingTime - Method used by a clock to check whether to trigger an alarm
+!
+! !INTERFACE:
+ function ESMF_AlarmCheckRingTime(alarm, ClockCurrTime, positive, rc)
+!
+! !RETURN VALUE:
+ logical :: ESMF_AlarmCheckRingTime
+!
+! !ARGUMENTS:
+ type(ESMF_Alarm), intent(inout) :: alarm
+ type(ESMF_Time), intent(in) :: ClockCurrTime
+ integer, intent(in) :: positive
+ integer, intent(out), optional :: rc
+!
+! !DESCRIPTION:
+! Main method used by a {\tt ESMF\_Clock} to check whether to trigger
+! the {\tt ESMF\_Alarm}
+!
+! The arguments are:
+! \begin{description}
+! \item[alarm]
+! The object instance to check if time to ring
+! \item[ClockCurrTime]
+! The {\tt ESMF\_Clock}'s current time
+! \item[positive]
+! Whether to check ring time in the positive or negative direction
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+
+! !REQUIREMENTS:
+! TMG4.4, TMG4.6
+!EOP
+ CALL wrf_error_fatal( 'ESMF_AlarmCheckRingTime not supported' )
+ ESMF_AlarmCheckRingTime = .FALSE. ! keep compilers happy
+ end function ESMF_AlarmCheckRingTime
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_AlarmEQ - Compare two alarms for equality
+!
+! !INTERFACE:
+ function ESMF_AlarmEQ(alarm1, alarm2)
+!
+! !RETURN VALUE:
+ logical :: ESMF_AlarmEQ
+
+! !ARGUMENTS:
+ type(ESMF_Alarm), intent(in) :: alarm1
+ type(ESMF_Alarm), intent(in) :: alarm2
+
+! !DESCRIPTION:
+! Compare two alarms for equality; return true if equal, false otherwise
+! Maps to overloaded (==) operator interface function
+!
+! The arguments are:
+! \begin{description}
+! \item[alarm1]
+! The first {\tt ESMF\_Alarm} to compare
+! \item[alarm2]
+! The second {\tt ESMF\_Alarm} to compare
+! \end{description}
+!
+! !REQUIREMENTS:
+!EOP
+ CALL wrf_error_fatal( 'ESMF_AlarmEQ not supported ' )
+ ESMF_AlarmEQ = .FALSE. ! keep compilers happy
+ end function ESMF_AlarmEQ
+
+!------------------------------------------------------------------------------
+!
+! This section defines the overridden Read, Write, Validate and Print methods
+! from the ESMF_Base class
+!
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_AlarmRead - restores an alarm
+
+! !INTERFACE:
+ subroutine ESMF_AlarmRead(alarm, RingInterval, RingTime, &
+ PrevRingTime, StopTime, Ringing, &
+ Enabled, ID, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Alarm), intent(out) :: alarm
+ type(ESMF_TimeInterval), intent(in) :: RingInterval
+ type(ESMF_Time), intent(in) :: RingTime
+ type(ESMF_Time), intent(in) :: PrevRingTime
+ type(ESMF_Time), intent(in) :: StopTime
+ logical, intent(in) :: Ringing
+ logical, intent(in) :: Enabled
+ integer, intent(in) :: ID
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Restores an {\tt ESMF\_Alarm}
+!
+! The arguments are:
+! \begin{description}
+! \item[alarm]
+! The object instance to restore
+! \item[RingInterval]
+! The ring interval for repeating alarms
+! \item[RingTime]
+! Ring time for one-shot or first repeating alarm
+! \item[PrevRingTime]
+! The {\tt ESMF\_Alarm}'s previous ring time
+! \item[StopTime]
+! Stop time for repeating alarms
+! \item[Ringing]
+! The {\tt ESMF\_Alarm}'s ringing state
+! \item[Enabled]
+! {\tt ESMF\_Alarm} enabled/disabled
+! \item[ID]
+! The {\tt ESMF\_Alarm}'s ID
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+!EOP
+ CALL wrf_error_fatal( 'ESMF_AlarmRead not supported' )
+ end subroutine ESMF_AlarmRead
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_AlarmWrite - saves an alarm
+
+! !INTERFACE:
+ subroutine ESMF_AlarmWrite(alarm, RingInterval, RingTime, &
+ PrevRingTime, StopTime, Ringing, &
+ Enabled, ID, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Alarm), intent(in) :: alarm
+ type(ESMF_TimeInterval), intent(out) :: RingInterval
+ type(ESMF_Time), intent(out) :: RingTime
+ type(ESMF_Time), intent(out) :: PrevRingTime
+ type(ESMF_Time), intent(out) :: StopTime
+ logical, intent(out) :: Ringing
+ logical, intent(out) :: Enabled
+ integer, intent(out) :: ID
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Saves an {\tt ESMF\_Alarm}
+!
+! The arguments are:
+! \begin{description}
+! \item[alarm]
+! The object instance to save
+! \item[RingInterval]
+! Ring interval for repeating alarms
+! \item[RingTime]
+! Ring time for one-shot or first repeating alarm
+! \item[PrevRingTime]
+! The {\tt ESMF\_Alarm}'s previous ring time
+! \item[StopTime]
+! Stop time for repeating alarms
+! \item[Ringing]
+! The {\tt ESMF\_Alarm}'s ringing state
+! \item[Enabled]
+! {\tt ESMF\_Alarm} enabled/disabled
+! \item[ID]
+! The {\tt ESMF\_Alarm}'s ID
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+!EOP
+ CALL wrf_error_fatal( 'ESMF_AlarmWrite not supported' )
+ end subroutine ESMF_AlarmWrite
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_AlarmValidate - Validate an Alarm's properties
+
+! !INTERFACE:
+ subroutine ESMF_AlarmValidate(alarm, opts, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Alarm), intent(in) :: alarm
+ character (len=*), intent(in), optional :: opts
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Perform a validation check on a {\tt ESMF\_Alarm}'s properties
+!
+! The arguments are:
+! \begin{description}
+! \item[alarm]
+! {\tt ESMF\_Alarm} to validate
+! \item[{[opts]}]
+! Validate options
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMGn.n.n
+!EOP
+ CALL wrf_error_fatal( 'ESMF_AlarmValidate not supported' )
+ end subroutine ESMF_AlarmValidate
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_AlarmPrint - Print out an Alarm's properties
+
+! !INTERFACE:
+ subroutine ESMF_AlarmPrint(alarm, opts, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Alarm), intent(in) :: alarm
+ character (len=*), intent(in), optional :: opts
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! To support testing/debugging, print out a {\tt ESMF\_Alarm}'s
+! properties.
+!
+! The arguments are:
+! \begin{description}
+! \item[alarm]
+! {\tt ESMF\_Alarm} to print out
+! \item[{[opts]}]
+! Print options
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMGn.n.n
+!EOP
+ CALL wrf_error_fatal( 'ESMF_AlarmPrint not supported' )
+ end subroutine ESMF_AlarmPrint
+
+!------------------------------------------------------------------------------
+
+ end module ESMF_AlarmMod
Added: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_AlarmClock.F90
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_AlarmClock.F90         (rev 0)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_AlarmClock.F90        2012-11-29 22:23:06 UTC (rev 2329)
@@ -0,0 +1,96 @@
+!
+! Earth System Modeling Framework
+! Copyright 2002-2003, University Corporation for Atmospheric Research,
+! Massachusetts Institute of Technology, Geophysical Fluid Dynamics
+! Laboratory, University of Michigan, National Centers for Environmental
+! Prediction, Los Alamos National Laboratory, Argonne National Laboratory,
+! NASA Goddard Space Flight Center.
+! Licensed under the University of Illinois-NCSA license.
+!
+!==============================================================================
+!
+! ESMF Alarm-Clock Module
+ module ESMF_AlarmClockMod
+!
+!==============================================================================
+!
+! This file contains the AlarmCreate method.
+!
+!------------------------------------------------------------------------------
+! INCLUDES
+#include <ESMF_TimeMgr.inc>
+
+!===============================================================================
+!BOPI
+!
+! !MODULE: ESMF_AlarmClockMod
+!
+! !DESCRIPTION:
+! Separate module that uses both ESMF_AlarmMod and ESMF_ClockMod.
+! Separation is needed to avoid cyclic dependence.
+!
+! Defines F90 wrapper entry points for corresponding
+! C++ class {\tt ESMC\_Alarm}
+!
+! See {\tt ../include/ESMC\_Alarm.h} for complete description
+!
+!------------------------------------------------------------------------------
+! !USES:
+ ! inherit ESMF_Alarm and ESMF_Clock
+ use ESMF_AlarmMod, only : ESMF_Alarm, ESMF_AlarmSet
+ use ESMF_ClockMod, only : ESMF_Clock, ESMF_ClockAddAlarm
+
+ ! associated derived types
+ use ESMF_TimeIntervalMod, only : ESMF_TimeInterval
+ use ESMF_TimeMod, only : ESMF_Time
+
+ implicit none
+
+!------------------------------------------------------------------------------
+! !PRIVATE TYPES:
+ private
+!------------------------------------------------------------------------------
+
+! !PUBLIC MEMBER FUNCTIONS:
+ public ESMF_AlarmCreate
+
+!==============================================================================
+
+ contains
+
+!==============================================================================
+
+
+! Create ESMF_Alarm using ESMF 2.1.0+ semantics
+ FUNCTION ESMF_AlarmCreate( clock, RingTime, RingInterval, &
+ StopTime, Enabled, rc )
+
+ ! return value
+ type(ESMF_Alarm) :: ESMF_AlarmCreate
+ ! !ARGUMENTS:
+ type(ESMF_Clock), intent(inout), optional :: clock
+ type(ESMF_Time), intent(in), optional :: RingTime
+ type(ESMF_TimeInterval), intent(in), optional :: RingInterval
+ type(ESMF_Time), intent(in), optional :: StopTime
+ logical, intent(in), optional :: Enabled
+ integer, intent(out), optional :: rc
+ ! locals
+ type(ESMF_Alarm) :: alarmtmp
+ ! TBH: ignore allocate errors, for now
+ ALLOCATE( alarmtmp%alarmint )
+ CALL ESMF_AlarmSet( alarmtmp, &
+ RingTime=RingTime, &
+ RingInterval=RingInterval, &
+ StopTime=StopTime, &
+ Enabled=Enabled, &
+ rc=rc )
+ IF ( PRESENT ( clock ) ) THEN
+ CALL ESMF_ClockAddAlarm( clock, alarmtmp, rc )
+ ENDIF
+ ESMF_AlarmCreate = alarmtmp
+ END FUNCTION ESMF_AlarmCreate
+
+
+!------------------------------------------------------------------------------
+
+ end module ESMF_AlarmClockMod
Added: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_Base.F90
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_Base.F90         (rev 0)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_Base.F90        2012-11-29 22:23:06 UTC (rev 2329)
@@ -0,0 +1,1082 @@
+!
+! Earth System Modeling Framework
+! Copyright 2002-2003, University Corporation for Atmospheric Research,
+! Massachusetts Institute of Technology, Geophysical Fluid Dynamics
+! Laboratory, University of Michigan, National Centers for Environmental
+! Prediction, Los Alamos National Laboratory, Argonne National Laboratory,
+! NASA Goddard Space Flight Center.
+! Licensed under the University of Illinois-NCSA license.
+!
+! ESMF Base Module
+!
+! (all lines between the !BOP and !EOP markers will be included in the
+! automated document processing.)
+!------------------------------------------------------------------------------
+
+!------------------------------------------------------------------------------
+! module definition
+
+ module ESMF_BaseMod
+
+!BOP
+! !MODULE: ESMF_BaseMod - Base class for all ESMF classes
+!
+! !DESCRIPTION:
+!
+! The code in this file implements the Base defined type
+! and functions which operate on all types. This is an
+! interface to the actual C++ base class implementation in the ../src dir.
+!
+! See the ESMF Developers Guide document for more details.
+!
+!------------------------------------------------------------------------------
+
+! !USES:
+ implicit none
+!
+! !PRIVATE TYPES:
+ private
+
+!------------------------------------------------------------------------------
+!
+! Global integer parameters, used frequently
+
+ integer, parameter :: ESMF_SUCCESS = 0, ESMF_FAILURE = -1
+ integer, parameter :: ESMF_MAXSTR = 128
+ integer, parameter :: ESMF_MAXDIM = 7, &
+ ESMF_MAXDECOMPDIM=3, &
+ ESMF_MAXGRIDDIM=2
+
+ integer, parameter :: ESMF_MAJOR_VERSION = 2
+ integer, parameter :: ESMF_MINOR_VERSION = 1
+ integer, parameter :: ESMF_REVISION = 1
+ integer, parameter :: ESMF_PATCHLEVEL = 0
+ character(32), parameter :: ESMF_VERSION_STRING = "2.1.1"
+
+!------------------------------------------------------------------------------
+!
+ type ESMF_Status
+ private
+ integer :: status
+ end type
+
+ type(ESMF_Status), parameter :: ESMF_STATE_UNINIT = ESMF_Status(1), &
+ ESMF_STATE_READY = ESMF_Status(2), &
+ ESMF_STATE_UNALLOCATED = ESMF_Status(3), &
+ ESMF_STATE_ALLOCATED = ESMF_Status(4), &
+ ESMF_STATE_BUSY = ESMF_Status(5), &
+ ESMF_STATE_INVALID = ESMF_Status(6)
+
+!------------------------------------------------------------------------------
+!
+ type ESMF_Pointer
+ private
+ integer*8 :: ptr
+ end type
+
+ type(ESMF_Pointer), parameter :: ESMF_NULL_POINTER = ESMF_Pointer(0), &
+ ESMF_BAD_POINTER = ESMF_Pointer(-1)
+
+
+!------------------------------------------------------------------------------
+!
+ !! TODO: I believe if we define an assignment(=) operator to convert
+ !! a datatype into integer, then we could use the type and kind as
+ !! targets in a select case() statement and make the contents private.
+ !! (see pg 248 of the "big book")
+ type ESMF_DataType
+ !!private
+ integer :: dtype
+ end type
+
+ type(ESMF_DataType), parameter :: ESMF_DATA_INTEGER = ESMF_DataType(1), &
+ ESMF_DATA_REAL = ESMF_DataType(2), &
+ ESMF_DATA_LOGICAL = ESMF_DataType(3), &
+ ESMF_DATA_CHARACTER = ESMF_DataType(4)
+
+!------------------------------------------------------------------------------
+
+ integer, parameter :: &
+ ESMF_KIND_I1 = selected_int_kind(2), &
+ ESMF_KIND_I2 = selected_int_kind(4), &
+ ESMF_KIND_I4 = selected_int_kind(9), &
+ ESMF_KIND_I8 = selected_int_kind(18), &
+ ESMF_KIND_R4 = selected_real_kind(3,25), &
+ ESMF_KIND_R8 = selected_real_kind(6,45), &
+ ESMF_KIND_C8 = selected_real_kind(3,25), &
+ ESMF_KIND_C16 = selected_real_kind(6,45)
+
+!------------------------------------------------------------------------------
+
+ type ESMF_DataValue
+ private
+ type(ESMF_DataType) :: dt
+ integer :: rank
+ ! how do you do values of all types here ? TODO
+ ! in C++ i'd do a union w/ overloaded access funcs
+ integer :: vi
+ !integer, dimension (:), pointer :: vip
+ !real :: vr
+ !real, dimension (:), pointer :: vrp
+ !logical :: vl
+ !logical, pointer :: vlp
+ !character (len=ESMF_MAXSTR) :: vc
+ !character, pointer :: vcp
+ end type
+
+!------------------------------------------------------------------------------
+!
+ type ESMF_Attribute
+ private
+ character (len=ESMF_MAXSTR) :: attr_name
+ type (ESMF_DataType) :: attr_type
+ type (ESMF_DataValue) :: attr_value
+ end type
+
+!------------------------------------------------------------------------------
+!
+ !! TODO: this should be a shallow object, with a simple init() and
+ !! get() function, and the contents should go back to being private.
+ type ESMF_AxisIndex
+! !!private
+ integer :: l
+ integer :: r
+ integer :: max
+ integer :: decomp
+ integer :: gstart
+ end type
+
+ !! TODO: same comment as above.
+ type ESMF_MemIndex
+! !!private
+ integer :: l
+ integer :: r
+ integer :: str
+ integer :: num
+ end type
+
+!------------------------------------------------------------------------------
+!
+ type ESMF_BasePointer
+ private
+ integer*8 :: base_ptr
+ end type
+
+ integer :: global_count = 0
+
+!------------------------------------------------------------------------------
+!
+! ! WARNING: must match corresponding values in ../include/ESMC_Base.h
+ type ESMF_Logical
+ private
+ integer :: value
+ end type
+
+ type(ESMF_Logical), parameter :: ESMF_TF_UNKNOWN = ESMF_Logical(1), &
+ ESMF_TF_TRUE = ESMF_Logical(2), &
+ ESMF_TF_FALSE = ESMF_Logical(3)
+
+!------------------------------------------------------------------------------
+!
+ type ESMF_Base
+ private
+ integer :: ID
+ integer :: ref_count
+ type (ESMF_Status) :: base_status
+ character (len=ESMF_MAXSTR) :: name
+ end type
+
+! !PUBLIC TYPES:
+
+ public ESMF_STATE_INVALID
+! public ESMF_STATE_UNINIT, ESMF_STATE_READY, &
+! ESMF_STATE_UNALLOCATED, ESMF_STATE_ALLOCATED, &
+! ESMF_STATE_BUSY
+
+ public ESMF_DATA_INTEGER, ESMF_DATA_REAL, &
+ ESMF_DATA_LOGICAL, ESMF_DATA_CHARACTER
+
+ public ESMF_KIND_I1, ESMF_KIND_I2, ESMF_KIND_I4, ESMF_KIND_I8, &
+ ESMF_KIND_R4, ESMF_KIND_R8, ESMF_KIND_C8, ESMF_KIND_C16
+
+ public ESMF_NULL_POINTER, ESMF_BAD_POINTER
+
+
+ public ESMF_FAILURE, ESMF_SUCCESS
+ public ESMF_MAXSTR
+ public ESMF_MAXDIM, ESMF_MAXDECOMPDIM, ESMF_MAXGRIDDIM
+
+ public ESMF_MAJOR_VERSION, ESMF_MINOR_VERSION, ESMF_REVISION
+ public ESMF_VERSION_STRING
+
+ public ESMF_Status, ESMF_Pointer, ESMF_DataType
+ public ESMF_DataValue, ESMF_Attribute
+! public ESMF_MemIndex
+! public ESMF_BasePointer
+ public ESMF_Base
+
+ public ESMF_AxisIndex, ESMF_AxisIndexGet
+! public ESMF_AxisIndexInit
+ public ESMF_Logical
+! public ESMF_TF_TRUE, ESMF_TF_FALSE
+
+! !PUBLIC MEMBER FUNCTIONS:
+!
+! !DESCRIPTION:
+! The following routines apply to any type in the system.
+! The attribute routines can be inherited as-is. The other
+! routines need to be specialized by the higher level objects.
+!
+! Base class methods
+! public ESMF_BaseInit
+
+! public ESMF_BaseGetConfig
+! public ESMF_BaseSetConfig
+
+! public ESMF_BaseGetInstCount
+
+! public ESMF_BaseSetID
+! public ESMF_BaseGetID
+
+! public ESMF_BaseSetRefCount
+! public ESMF_BaseGetRefCount
+
+! public ESMF_BaseSetStatus
+! public ESMF_BaseGetStatus
+
+! Virtual methods to be defined by derived classes
+! public ESMF_Read
+! public ESMF_Write
+! public ESMF_Validate
+! public ESMF_Print
+
+! Attribute methods
+ public ESMF_AttributeSet
+ public ESMF_AttributeGet
+ public ESMF_AttributeGetCount
+ public ESMF_AttributeGetbyNumber
+ public ESMF_AttributeGetNameList
+ public ESMF_AttributeSetList
+ public ESMF_AttributeGetList
+ public ESMF_AttributeSetObjectList
+ public ESMF_AttributeGetObjectList
+ public ESMF_AttributeCopy
+ public ESMF_AttributeCopyAll
+
+! Misc methods
+ public ESMF_SetName
+ public ESMF_GetName
+ public ESMF_SetPointer
+ public ESMF_SetNullPointer
+ public ESMF_GetPointer
+
+! Print methods for calling by higher level print functions
+! (they have little formatting other than the actual values)
+ public ESMF_StatusString, ESMF_DataTypeString
+
+! Overloaded = operator functions
+ public operator(.eq.), operator(.ne.), assignment(=)
+!
+!
+!EOP
+
+!------------------------------------------------------------------------------
+
+! overload .eq. & .ne. with additional derived types so you can compare
+! them as if they were simple integers.
+
+
+interface operator (.eq.)
+ module procedure ESMF_sfeq
+ module procedure ESMF_dteq
+ module procedure ESMF_pteq
+ module procedure ESMF_tfeq
+ module procedure ESMF_aieq
+end interface
+
+interface operator (.ne.)
+ module procedure ESMF_sfne
+ module procedure ESMF_dtne
+ module procedure ESMF_ptne
+ module procedure ESMF_tfne
+ module procedure ESMF_aine
+end interface
+
+interface assignment (=)
+ module procedure ESMF_dtas
+ module procedure ESMF_ptas
+end interface
+
+!------------------------------------------------------------------------------
+
+ contains
+
+!------------------------------------------------------------------------------
+! function to compare two ESMF_Status flags to see if they're the same or not
+
+function ESMF_sfeq(sf1, sf2)
+ logical ESMF_sfeq
+ type(ESMF_Status), intent(in) :: sf1, sf2
+
+ ESMF_sfeq = (sf1%status .eq. sf2%status)
+end function
+
+function ESMF_sfne(sf1, sf2)
+ logical ESMF_sfne
+ type(ESMF_Status), intent(in) :: sf1, sf2
+
+ ESMF_sfne = (sf1%status .ne. sf2%status)
+end function
+
+!------------------------------------------------------------------------------
+! function to compare two ESMF_DataTypes to see if they're the same or not
+
+function ESMF_dteq(dt1, dt2)
+ logical ESMF_dteq
+ type(ESMF_DataType), intent(in) :: dt1, dt2
+
+ ESMF_dteq = (dt1%dtype .eq. dt2%dtype)
+end function
+
+function ESMF_dtne(dt1, dt2)
+ logical ESMF_dtne
+ type(ESMF_DataType), intent(in) :: dt1, dt2
+
+ ESMF_dtne = (dt1%dtype .ne. dt2%dtype)
+end function
+
+subroutine ESMF_dtas(intval, dtval)
+ integer, intent(out) :: intval
+ type(ESMF_DataType), intent(in) :: dtval
+
+ intval = dtval%dtype
+end subroutine
+
+
+!------------------------------------------------------------------------------
+! function to compare two ESMF_Pointers to see if they're the same or not
+
+function ESMF_pteq(pt1, pt2)
+ logical ESMF_pteq
+ type(ESMF_Pointer), intent(in) :: pt1, pt2
+
+ ESMF_pteq = (pt1%ptr .eq. pt2%ptr)
+end function
+
+function ESMF_ptne(pt1, pt2)
+ logical ESMF_ptne
+ type(ESMF_Pointer), intent(in) :: pt1, pt2
+
+ ESMF_ptne = (pt1%ptr .ne. pt2%ptr)
+end function
+
+subroutine ESMF_ptas(ptval, intval)
+ type(ESMF_Pointer), intent(out) :: ptval
+ integer, intent(in) :: intval
+
+ ptval%ptr = intval
+end subroutine
+
+!------------------------------------------------------------------------------
+! function to compare two ESMF_Logicals to see if they're the same or not
+! also need assignment to real f90 logical?
+
+function ESMF_tfeq(tf1, tf2)
+ logical ESMF_tfeq
+ type(ESMF_Logical), intent(in) :: tf1, tf2
+
+ ESMF_tfeq = (tf1%value .eq. tf2%value)
+end function
+
+function ESMF_tfne(tf1, tf2)
+ logical ESMF_tfne
+ type(ESMF_Logical), intent(in) :: tf1, tf2
+
+ ESMF_tfne = (tf1%value .ne. tf2%value)
+end function
+
+!------------------------------------------------------------------------------
+! function to compare two ESMF_AxisIndex to see if they're the same or not
+
+function ESMF_aieq(ai1, ai2)
+ logical ESMF_aieq
+ type(ESMF_AxisIndex), intent(in) :: ai1, ai2
+
+ ESMF_aieq = ((ai1%l .eq. ai2%l) .and. &
+ (ai1%r .eq. ai2%r) .and. &
+ (ai1%max .eq. ai2%max) .and. &
+ (ai1%decomp .eq. ai2%decomp) .and. &
+ (ai1%gstart .eq. ai2%gstart))
+
+end function
+
+function ESMF_aine(ai1, ai2)
+ logical ESMF_aine
+ type(ESMF_AxisIndex), intent(in) :: ai1, ai2
+
+ ESMF_aine = ((ai1%l .ne. ai2%l) .or. &
+ (ai1%r .ne. ai2%r) .or. &
+ (ai1%max .ne. ai2%max) .or. &
+ (ai1%decomp .ne. ai2%decomp) .or. &
+ (ai1%gstart .ne. ai2%gstart))
+
+end function
+
+!------------------------------------------------------------------------------
+!------------------------------------------------------------------------------
+!
+! Base methods
+!
+!------------------------------------------------------------------------------
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_BaseInit - initialize a Base object
+!
+! !INTERFACE:
+ subroutine ESMF_BaseInit(base, rc)
+!
+! !ARGUMENTS:
+ type(ESMF_Base) :: base
+ integer, intent(out), optional :: rc
+
+!
+! !DESCRIPTION:
+! Set initial state on a Base object.
+!
+! \begin{description}
+! \item [base]
+! In the Fortran interface, this must in fact be a {\tt Base}
+! derived type object. It is expected that all specialized
+! derived types will include a {\tt Base} object as the first
+! entry.
+! \item [{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+!
+! \end{description}
+!
+!EOP
+
+ logical :: rcpresent ! Return code present
+
+! !Initialize return code
+ rcpresent = .FALSE.
+ if(present(rc)) then
+ rcpresent = .TRUE.
+ rc = ESMF_FAILURE
+ endif
+
+ global_count = global_count + 1
+ base%ID = global_count
+ base%ref_count = 1
+ base%base_status = ESMF_STATE_READY
+ base%name = "undefined"
+
+ if (rcpresent) rc = ESMF_SUCCESS
+
+ end subroutine ESMF_BaseInit
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_SetName - set the name of this object
+!
+! !INTERFACE:
+ subroutine ESMF_SetName(anytype, name, namespace, rc)
+!
+! !ARGUMENTS:
+ type(ESMF_Base) :: anytype
+ character (len = *), intent(in), optional :: name
+ character (len = *), intent(in), optional :: namespace
+ integer, intent(out), optional :: rc
+
+!
+! !DESCRIPTION:
+! Associate a name with any object in the system.
+!
+! \begin{description}
+! \item [anytype]
+! In the Fortran interface, this must in fact be a {\tt Base}
+! derived type object. It is expected that all specialized
+! derived types will include a {\tt Base} object as the first
+! entry.
+! \item [[name]]
+! Object name. An error will be returned if a duplicate name
+! is specified. If a name is not given a unique name will be
+! generated and can be queried by the {\tt ESMF_GetName} routine.
+! \item [[namespace]]
+! Object namespace (e.g. "Application", "Component", "Grid", etc).
+! If given, the name will be checked that it is unique within
+! this namespace. If not given, the generated name will be
+! unique within this namespace. If namespace is not specified,
+! a default "global" namespace will be assumed and the same rules
+! for names will be followed.
+! \item [[rc]]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+!
+! \end{description}
+!
+!
+
+!
+!EOP
+! !REQUIREMENTS: FLD1.5, FLD1.5.3
+ logical :: rcpresent ! Return code present
+ character (len = ESMF_MAXSTR) :: ournamespace ! Namespace if not given
+ character (len = ESMF_MAXSTR) :: defaultname ! Name if not given
+ integer, save :: seqnum = 0 ! HACK - generate uniq names
+ ! but not coordinated across procs
+
+! !Initialize return code
+ rcpresent = .FALSE.
+ if(present(rc)) then
+ rcpresent = .TRUE.
+ rc = ESMF_FAILURE
+ endif
+
+! ! TODO: this code should generate a unique name if a name
+! ! is not given. If a namespace is given, the name has to
+! ! be unique within that namespace. Example namespaces could
+! ! be: Applications, Components, Fields/Bundles, Grids.
+!
+! ! Construct a default namespace if one is not given
+ if((.not. present(namespace)) .or. (namespace .eq. "")) then
+ ournamespace = "global"
+ else
+ ournamespace = namespace
+ endif
+! ! Construct a default name if one is not given
+ if((.not. present(name)) .or. (name .eq. "")) then
+
+ write(defaultname, 20) trim(ournamespace), seqnum
+20 format(A,I3.3)
+ seqnum = seqnum + 1
+ anytype%name = defaultname
+ else
+ anytype%name = name
+ endif
+
+ if (rcpresent) rc = ESMF_SUCCESS
+
+ end subroutine ESMF_SetName
+
+!-------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_GetName - get the name of this object
+!
+! !INTERFACE:
+ subroutine ESMF_GetName(anytype, name, rc)
+!
+! !ARGUMENTS:
+ type(ESMF_Base), intent(in) :: anytype ! any ESMF object/type
+ character (len = *), intent(out) :: name ! object/type name
+ integer, intent(out), optional :: rc ! return code
+
+!
+! !DESCRIPTION:
+! Return the name of any type in the system.
+
+!
+!EOP
+! !REQUIREMENTS: FLD1.5, FLD1.5.3
+
+ name = anytype%name
+ if (present(rc)) rc = ESMF_SUCCESS
+
+ end subroutine ESMF_GetName
+
+
+!-------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_AttributeSet - set attribute on an ESMF type
+!
+! !INTERFACE:
+ subroutine ESMF_AttributeSet(anytype, name, value, rc)
+!
+! !ARGUMENTS:
+ type(ESMF_Base), intent(in) :: anytype ! any ESMF type
+ character (len = *), intent(in) :: name ! attribute name
+ type(ESMF_DataValue), intent(in) :: value ! attribute value
+ integer, intent(out), optional :: rc ! return code
+
+!
+! !DESCRIPTION:
+! Associate a (name,value) pair with any type in the system.
+
+!
+!EOP
+! !REQUIREMENTS: FLD1.5, FLD1.5.3
+
+ end subroutine ESMF_AttributeSet
+
+
+!-------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_AttributeGet - get attribute from an ESMF type
+!
+! !INTERFACE:
+ subroutine ESMF_AttributeGet(anytype, name, type, value, rc)
+!
+! !ARGUMENTS:
+ type(ESMF_Base), intent(in) :: anytype ! any ESMF type
+ character (len = *), intent(in) :: name ! attribute name
+ type(ESMF_DataType), intent(out) :: type ! all possible data types
+ type(ESMF_DataValue), intent(out) :: value ! attribute value
+ integer, intent(out), optional :: rc ! return code
+
+!
+! !DESCRIPTION:
+
+!
+!EOP
+! !REQUIREMENTS: FLD1.5.1, FLD1.5.3
+
+ end subroutine ESMF_AttributeGet
+
+
+!-------------------------------------------------------------------------
+!BOP
+!
+! !IROUTINE: ESMF_AttributeGetCount - get an ESMF object's number of attributes
+!
+! !INTERFACE:
+ subroutine ESMF_AttributeGetCount(anytype, count, rc)
+!
+! !ARGUMENTS:
+ type(ESMF_Base), intent(in) :: anytype ! any ESMF type
+ integer, intent(out) :: count ! attribute count
+ integer, intent(out), optional :: rc ! return code
+
+!
+! !DESCRIPTION:
+! Returns number of attributes present.
+
+!
+!EOP
+! !REQUIREMENTS: FLD1.7.5
+
+ end subroutine ESMF_AttributeGetCount
+
+
+!-------------------------------------------------------------------------
+!BOP
+!
+! !IROUTINE: ESMF_AttributeGetbyNumber - get an ESMF object's attribute by num ber
+!
+! !INTERFACE:
+ subroutine ESMF_AttributeGetbyNumber(anytype, number, name, type, value, rc)
+!
+! !ARGUMENTS:
+ type(ESMF_Base), intent(in) :: anytype ! any ESMF type
+ integer, intent(in) :: number ! attribute number
+ character (len = *), intent(in) :: name ! attribute name
+ type(ESMF_DataType), intent(out) :: type ! all possible data types
+ type(ESMF_DataValue), intent(out) :: value ! attribute value
+ integer, intent(out), optional :: rc ! return code
+
+!
+! !DESCRIPTION:
+! Allows the caller to get attributes by number instead of by name.
+! This can be useful in iterating through all attributes in a loop.
+!
+!EOP
+! !REQUIREMENTS:
+
+ end subroutine ESMF_AttributeGetbyNumber
+
+
+!-------------------------------------------------------------------------
+!BOP
+!
+!IROUTINE: ESMF_AttributeGetNameList - get an ESMF object's attribute name list
+!
+! !INTERFACE:
+ subroutine ESMF_AttributeGetNameList(anytype, count, namelist, rc)
+!
+! !ARGUMENTS:
+ type(ESMF_Base), intent(in) :: anytype ! any ESMF type
+ integer, intent(out) :: count ! attribute count
+ character (len = *), dimension (:), intent(out) :: namelist ! attribute names
+ integer, intent(out), optional :: rc ! return code
+
+!
+! !DESCRIPTION:
+! Return a list of all attribute names without returning the values.
+
+!
+!EOP
+! !REQUIREMENTS: FLD1.7.3
+
+ end subroutine ESMF_AttributeGetNameList
+
+
+!-------------------------------------------------------------------------
+!BOP
+!
+! !IROUTINE: ESMF_AttributeSetList - set an ESMF object's attributes
+!
+! !INTERFACE:
+ subroutine ESMF_AttributeSetList(anytype, namelist, valuelist, rc)
+
+!
+! !ARGUMENTS:
+ type(ESMF_Base), intent(in) :: anytype ! any ESMF type
+ character (len = *), dimension (:), intent(in) :: namelist ! attribute names
+ type(ESMF_DataValue), dimension (:), intent(in) :: valuelist ! attribute values
+ integer, intent(out), optional :: rc ! return code
+
+!
+! !DESCRIPTION:
+! Set multiple attributes on an object in one call. Depending on what is
+! allowed by the interface, all attributes may have to have the same type.
+!
+!EOP
+! !REQUIREMENTS: (none. added for completeness)
+
+ end subroutine ESMF_AttributeSetList
+
+
+!-------------------------------------------------------------------------
+!BOP
+!
+! !IROUTINE: ESMF_AttributeGetList - get an ESMF object's attributes
+!
+! !INTERFACE:
+ subroutine ESMF_AttributeGetList(anytype, namelist, typelist, valuelist, rc)
+!
+! !ARGUMENTS:
+ type(ESMF_Base), intent(in) :: anytype ! any ESMF type
+ character (len = *), dimension (:), intent(in) :: namelist ! attribute names
+ type(ESMF_DataType), dimension (:), intent(out) :: typelist ! all possible data types
+ type(ESMF_DataValue), dimension (:), intent(out) :: valuelist ! attribute values
+ integer, intent(out), optional :: rc ! return code
+
+!
+! !DESCRIPTION:
+! Get multiple attributes from an object in a single call.
+
+!
+!EOP
+! !REQUIREMENTS: FLD1.7.4
+
+ end subroutine ESMF_AttributeGetList
+
+
+!-------------------------------------------------------------------------
+!BOP
+!
+! !IROUTINE: ESMF_AttributeSetObjectList - set an attribute on multiple ESMF objects
+!
+! !INTERFACE:
+ subroutine ESMF_AttributeSetObjectList(anytypelist, name, value, rc)
+!
+! !ARGUMENTS:
+ type(ESMF_Base), dimension (:), intent(in) :: anytypelist ! list of any ESMF types
+ character (len = *), intent(in) :: name ! attribute name
+ type(ESMF_DataValue), dimension (:), intent(in) :: value ! attribute value
+ integer, intent(out), optional :: rc ! return code
+
+!
+! !DESCRIPTION:
+! Set the same attribute on multiple objects in one call.
+
+!
+!EOP
+! !REQUIREMENTS: FLD1.5.5 (pri 2)
+
+ end subroutine ESMF_AttributeSetObjectList
+
+
+!-------------------------------------------------------------------------
+!BOP
+!
+!
+! !IROUTINE: ESMF_AttributeGetObjectList - get an attribute from multiple ESMF objects
+!
+! !INTERFACE:
+ subroutine ESMF_AttributeGetObjectList(anytypelist, name, typelist, valuelist, rc)
+!
+! !ARGUMENTS:
+ type(ESMF_Base), dimension (:), intent(in) :: anytypelist ! list of any ESMF types
+ character (len = *), intent(in) :: name ! attribute name
+ type(ESMF_DataType), dimension (:), intent(out) :: typelist ! all possible data types
+ type(ESMF_DataValue), dimension (:), intent(out) :: valuelist ! attribute values
+ integer, intent(out), optional :: rc ! return code
+
+!
+! !DESCRIPTION:
+! Get the same attribute name from multiple objects in one call.
+
+!
+!EOP
+! !REQUIREMENTS: FLD1.5.5 (pri 2)
+
+ end subroutine ESMF_AttributeGetObjectList
+
+
+!-------------------------------------------------------------------------
+!BOP
+!
+! !IROUTINE: ESMF_AttributeCopy - copy an attribute between two objects
+!
+! !INTERFACE:
+ subroutine ESMF_AttributeCopy(name, source, destination, rc)
+!
+! !ARGUMENTS:
+ character (len = *), intent(in) :: name ! attribute name
+ type(ESMF_Base), intent(in) :: source ! any ESMF type
+ type(ESMF_Base), intent(in) :: destination ! any ESMF type
+ integer, intent(out), optional :: rc ! return code
+
+!
+! !DESCRIPTION:
+! The specified attribute associated with the source object is
+! copied to the destination object. << does this assume overwriting the
+! attribute if it already exists in the output or does this require yet
+! another arg to say what to do with collisions? >>
+
+
+!
+!EOP
+! !REQUIREMENTS: FLD1.5.4
+
+ end subroutine ESMF_AttributeCopy
+
+
+!-------------------------------------------------------------------------
+!BOP
+!
+!IROUTINE: ESMC_AttributeCopyAll - copy attributes between two objects
+
+!
+! !INTERFACE:
+ subroutine ESMF_AttributeCopyAll(source, destination, rc)
+!
+! !ARGUMENTS:
+ type(ESMF_Base), intent(in) :: source ! any ESMF type
+ type(ESMF_Base), intent(in) :: destination ! any ESMF type
+ integer, intent(out), optional :: rc ! return code
+
+!
+! !DESCRIPTION:
+! All attributes associated with the source object are copied to the
+! destination object. Some attributes will have to be considered
+! {\tt read only} and won't be updated by this call. (e.g. an attribute
+! like {\tt name} must be unique and therefore can't be duplicated.)
+
+!
+!EOP
+! !REQUIREMENTS: FLD1.5.4
+
+ end subroutine ESMF_AttributeCopyAll
+
+!=========================================================================
+! Misc utility routines, perhaps belongs in a utility file?
+!-------------------------------------------------------------------------
+!BOP
+!
+!IROUTINE: ESMC_AxisIndexInit - initialize an AxisIndex object
+
+!
+! !INTERFACE:
+ subroutine ESMF_AxisIndexInit(ai, l, r, max, decomp, gstart, rc)
+!
+! !ARGUMENTS:
+ type(ESMF_AxisIndex), intent(inout) :: ai
+ integer, intent(in) :: l, r, max, decomp, gstart
+ integer, intent(out), optional :: rc
+!
+! !DESCRIPTION:
+! Set the contents of an AxisIndex type.
+
+!
+!EOP
+! !REQUIREMENTS:
+
+ ai%l = l
+ ai%r = r
+ ai%max = max
+ ai%decomp = decomp
+ ai%gstart = gstart
+
+ if (present(rc)) rc = ESMF_SUCCESS
+
+ end subroutine ESMF_AxisIndexInit
+
+!BOP
+!
+!IROUTINE: ESMC_AxisIndexInit - initialize an AxisIndex object
+
+!
+! !INTERFACE:
+ subroutine ESMF_AxisIndexGet(ai, l, r, max, decomp, gstart, rc)
+!
+! !ARGUMENTS:
+ type(ESMF_AxisIndex), intent(inout) :: ai
+ integer, intent(out), optional :: l, r, max, decomp, gstart
+ integer, intent(out), optional :: rc
+!
+! !DESCRIPTION:
+! Get the contents of an AxisIndex type.
+
+!
+!EOP
+! !REQUIREMENTS:
+
+ if (present(l)) l = ai%l
+ if (present(r)) r = ai%r
+ if (present(max)) max = ai%max
+ if (present(decomp)) decomp = ai%decomp
+ if (present(gstart)) gstart = ai%gstart
+
+ if (present(rc)) rc = ESMF_SUCCESS
+
+ end subroutine ESMF_AxisIndexGet
+
+!-------------------------------------------------------------------------
+!-------------------------------------------------------------------------
+!BOP
+!
+!IROUTINE: ESMF_SetPointer - set an opaque value
+
+!
+! !INTERFACE:
+ subroutine ESMF_SetPointer(ptype, contents, rc)
+!
+! !ARGUMENTS:
+ type(ESMF_Pointer) :: ptype
+ integer*8, intent(in) :: contents
+ integer, intent(out), optional :: rc
+
+!
+! !DESCRIPTION:
+! Set the contents of an opaque pointer type.
+
+!
+!EOP
+! !REQUIREMENTS:
+ ptype%ptr = contents
+ if (present(rc)) rc = ESMF_SUCCESS
+
+ end subroutine ESMF_SetPointer
+
+!-------------------------------------------------------------------------
+!BOP
+!
+!IROUTINE: ESMF_SetNullPointer - set an opaque value
+
+!
+! !INTERFACE:
+ subroutine ESMF_SetNullPointer(ptype, rc)
+!
+! !ARGUMENTS:
+ type(ESMF_Pointer) :: ptype
+ integer, intent(out), optional :: rc
+
+!
+! !DESCRIPTION:
+! Set the contents of an opaque pointer type.
+
+!
+!EOP
+! !REQUIREMENTS:
+ integer*8, parameter :: nullp = 0
+
+ ptype%ptr = nullp
+ if (present(rc)) rc = ESMF_SUCCESS
+
+ end subroutine ESMF_SetNullPointer
+!-------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_GetPointer - get an opaque value
+!
+! !INTERFACE:
+ function ESMF_GetPointer(ptype, rc)
+!
+! !RETURN VALUE:
+ integer*8 :: ESMF_GetPointer
+
+! !ARGUMENTS:
+ type(ESMF_Pointer), intent(in) :: ptype
+ integer, intent(out), optional :: rc
+
+!
+! !DESCRIPTION:
+! Get the contents of an opaque pointer type.
+
+!
+!EOP
+! !REQUIREMENTS:
+ ESMF_GetPointer = ptype%ptr
+ if (present(rc)) rc = ESMF_SUCCESS
+
+ end function ESMF_GetPointer
+
+!-------------------------------------------------------------------------
+! misc print routines
+!-------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_StatusString - Return status as a string
+!
+! !INTERFACE:
+ subroutine ESMF_StatusString(status, string, rc)
+!
+! !ARGUMENTS:
+ type(ESMF_Status), intent(in) :: status
+ character(len=*), intent(out) :: string
+ integer, intent(out), optional :: rc
+
+!
+! !DESCRIPTION:
+! Return a status variable as a string.
+
+!
+!EOP
+! !REQUIREMENTS:
+
+ if (status .eq. ESMF_STATE_UNINIT) string = "Uninitialized"
+ if (status .eq. ESMF_STATE_READY) string = "Ready"
+ if (status .eq. ESMF_STATE_UNALLOCATED) string = "Unallocated"
+ if (status .eq. ESMF_STATE_ALLOCATED) string = "Allocated"
+ if (status .eq. ESMF_STATE_BUSY) string = "Busy"
+ if (status .eq. ESMF_STATE_INVALID) string = "Invalid"
+
+ if (present(rc)) rc = ESMF_SUCCESS
+
+ end subroutine ESMF_StatusString
+
+!-------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_DataTypeString - Return DataType as a string
+!
+! !INTERFACE:
+ subroutine ESMF_DataTypeString(datatype, string, rc)
+!
+! !ARGUMENTS:
+ type(ESMF_DataType), intent(in) :: datatype
+ character(len=*), intent(out) :: string
+ integer, intent(out), optional :: rc
+
+!
+! !DESCRIPTION:
+! Return a datatype variable as a string.
+
+!
+!EOP
+! !REQUIREMENTS:
+
+ if (datatype .eq. ESMF_DATA_INTEGER) string = "Integer"
+ if (datatype .eq. ESMF_DATA_REAL) string = "Real"
+ if (datatype .eq. ESMF_DATA_LOGICAL) string = "Logical"
+ if (datatype .eq. ESMF_DATA_CHARACTER) string = "Character"
+
+ if (present(rc)) rc = ESMF_SUCCESS
+
+ end subroutine ESMF_DataTypeString
+
+!-------------------------------------------------------------------------
+!
+!-------------------------------------------------------------------------
+! put Print and Validate skeletons here - but they should be
+! overridden by higher level more specialized functions.
+!-------------------------------------------------------------------------
+
+ end module ESMF_BaseMod
Added: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_BaseTime.F90
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_BaseTime.F90         (rev 0)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_BaseTime.F90        2012-11-29 22:23:06 UTC (rev 2329)
@@ -0,0 +1,318 @@
+!
+! Earth System Modeling Framework
+! Copyright 2002-2003, University Corporation for Atmospheric Research,
+! Massachusetts Institute of Technology, Geophysical Fluid Dynamics
+! Laboratory, University of Michigan, National Centers for Environmental
+! Prediction, Los Alamos National Laboratory, Argonne National Laboratory,
+! NASA Goddard Space Flight Center.
+! Licensed under the University of Illinois-NCSA license.
+!
+!==============================================================================
+!
+! ESMF BaseTime Module
+ module ESMF_BaseTimeMod
+!
+!==============================================================================
+!
+! This file contains the BaseTime class definition and all BaseTime class
+! methods.
+!
+!------------------------------------------------------------------------------
+! INCLUDES
+
+#include <ESMF_TimeMgr.inc>
+!
+!===============================================================================
+!BOPI
+! !MODULE: ESMF_BaseTimeMod - Base ESMF time definition
+!
+! !DESCRIPTION:
+! Part of Time Manager F90 API wrapper of C++ implemenation
+!
+! This module serves only as the common Time definition inherited
+! by {\tt ESMF\_TimeInterval} and {\tt ESMF\_Time}
+!
+! See {\tt ../include/ESMC\_BaseTime.h} for complete description
+!
+!------------------------------------------------------------------------------
+! !USES:
+ use ESMF_BaseMod ! ESMF Base class
+ implicit none
+!
+!------------------------------------------------------------------------------
+! !PRIVATE TYPES:
+ private
+!------------------------------------------------------------------------------
+! ! ESMF_BaseTime
+!
+! ! Base class type to match C++ BaseTime class in size only;
+! ! all dereferencing within class is performed by C++ implementation
+
+ type ESMF_BaseTime
+ integer(ESMF_KIND_I8) :: S ! whole seconds
+ integer(ESMF_KIND_I8) :: Sn ! fractional seconds, numerator
+ integer(ESMF_KIND_I8) :: Sd ! fractional seconds, denominator
+ end type
+
+!------------------------------------------------------------------------------
+! !PUBLIC TYPES:
+ public ESMF_BaseTime
+!------------------------------------------------------------------------------
+!
+! !PUBLIC MEMBER FUNCTIONS:
+!
+! overloaded operators
+ public operator(+)
+ private ESMF_BaseTimeSum
+ public operator(-)
+ private ESMF_BaseTimeDifference
+ public operator(/)
+ private ESMF_BaseTimeQuotI
+ private ESMF_BaseTimeQuotI8
+ public operator(.EQ.)
+ private ESMF_BaseTimeEQ
+ public operator(.NE.)
+ private ESMF_BaseTimeNE
+ public operator(.LT.)
+ private ESMF_BaseTimeLT
+ public operator(.GT.)
+ private ESMF_BaseTimeGT
+ public operator(.LE.)
+ private ESMF_BaseTimeLE
+ public operator(.GE.)
+ private ESMF_BaseTimeGE
+
+!==============================================================================
+!
+! INTERFACE BLOCKS
+!
+!==============================================================================
+ interface operator(+)
+ module procedure ESMF_BaseTimeSum
+ end interface
+ interface operator(-)
+ module procedure ESMF_BaseTimeDifference
+ end interface
+ interface operator(/)
+ module procedure ESMF_BaseTimeQuotI,ESMF_BaseTimeQuotI8
+ end interface
+ interface operator(.EQ.)
+ module procedure ESMF_BaseTimeEQ
+ end interface
+ interface operator(.NE.)
+ module procedure ESMF_BaseTimeNE
+ end interface
+ interface operator(.LT.)
+ module procedure ESMF_BaseTimeLT
+ end interface
+ interface operator(.GT.)
+ module procedure ESMF_BaseTimeGT
+ end interface
+ interface operator(.LE.)
+ module procedure ESMF_BaseTimeLE
+ end interface
+ interface operator(.GE.)
+ module procedure ESMF_BaseTimeGE
+ end interface
+
+
+!==============================================================================
+
+ contains
+
+!==============================================================================
+
+
+! Add two basetimes
+ FUNCTION ESMF_BaseTimeSum( basetime1, basetime2 )
+ TYPE(ESMF_BaseTime) :: ESMF_BaseTimeSum
+ TYPE(ESMF_BaseTime), INTENT(IN) :: basetime1
+ TYPE(ESMF_BaseTime), INTENT(IN) :: basetime2
+ ! locals
+ INTEGER (ESMF_KIND_I8) :: Sn1, Sd1, Sn2, Sd2, lcd
+! PRINT *,'DEBUG: BEGIN ESMF_BaseTimeSum()'
+! PRINT *,'DEBUG: ESMF_BaseTimeSum(): basetime1%S = ',basetime1%S
+! PRINT *,'DEBUG: ESMF_BaseTimeSum(): basetime1%Sn = ',basetime1%Sn
+! PRINT *,'DEBUG: ESMF_BaseTimeSum(): basetime1%Sd = ',basetime1%Sd
+! PRINT *,'DEBUG: ESMF_BaseTimeSum(): basetime2%S = ',basetime2%S
+! PRINT *,'DEBUG: ESMF_BaseTimeSum(): basetime2%Sn = ',basetime2%Sn
+! PRINT *,'DEBUG: ESMF_BaseTimeSum(): basetime2%Sd = ',basetime2%Sd
+ ESMF_BaseTimeSum = basetime1
+ ESMF_BaseTimeSum%S = ESMF_BaseTimeSum%S + basetime2%S
+ Sn1 = basetime1%Sn
+ Sd1 = basetime1%Sd
+ Sn2 = basetime2%Sn
+ Sd2 = basetime2%Sd
+! PRINT *,'DEBUG: ESMF_BaseTimeSum(): Sn1 = ',Sn1
+! PRINT *,'DEBUG: ESMF_BaseTimeSum(): Sd1 = ',Sd1
+! PRINT *,'DEBUG: ESMF_BaseTimeSum(): Sn2 = ',Sn2
+! PRINT *,'DEBUG: ESMF_BaseTimeSum(): Sd2 = ',Sd2
+ IF ( ( Sd1 .EQ. 0 ) .AND. ( Sd2 .EQ. 0 ) ) THEN
+! PRINT *,'DEBUG: ESMF_BaseTimeSum(): no fractions'
+ ESMF_BaseTimeSum%Sn = 0
+ ESMF_BaseTimeSum%Sd = 0
+ ELSE IF ( ( Sd1 .NE. 0 ) .AND. ( Sd2 .EQ. 0 ) ) THEN
+ ESMF_BaseTimeSum%Sn = Sn1
+ ESMF_BaseTimeSum%Sd = Sd1
+ ELSE IF ( ( Sd1 .EQ. 0 ) .AND. ( Sd2 .NE. 0 ) ) THEN
+ ESMF_BaseTimeSum%Sn = Sn2
+ ESMF_BaseTimeSum%Sd = Sd2
+ ELSE IF ( ( Sd1 .NE. 0 ) .AND. ( Sd2 .NE. 0 ) ) THEN
+ CALL compute_lcd( Sd1 , Sd2 , lcd )
+ ESMF_BaseTimeSum%Sd = lcd
+ ESMF_BaseTimeSum%Sn = (Sn1 * lcd / Sd1) + (Sn2 * lcd / Sd2)
+ ENDIF
+! PRINT *,'DEBUG: ESMF_BaseTimeSum(): ESMF_BaseTimeSum%S = ',ESMF_BaseTimeSum%S
+! PRINT *,'DEBUG: ESMF_BaseTimeSum(): ESMF_BaseTimeSum%Sn = ',ESMF_BaseTimeSum%Sn
+! PRINT *,'DEBUG: ESMF_BaseTimeSum(): ESMF_BaseTimeSum%Sd = ',ESMF_BaseTimeSum%Sd
+ CALL normalize_basetime( ESMF_BaseTimeSum )
+! PRINT *,'DEBUG: END ESMF_BaseTimeSum()'
+ END FUNCTION ESMF_BaseTimeSum
+
+
+! Subtract two basetimes
+ FUNCTION ESMF_BaseTimeDifference( basetime1, basetime2 )
+ TYPE(ESMF_BaseTime) :: ESMF_BaseTimeDifference
+ TYPE(ESMF_BaseTime), INTENT(IN) :: basetime1
+ TYPE(ESMF_BaseTime), INTENT(IN) :: basetime2
+ ! locals
+ TYPE(ESMF_BaseTime) :: neg2
+
+ neg2%S = -basetime2%S
+ neg2%Sn = -basetime2%Sn
+ neg2%Sd = basetime2%Sd
+
+ ESMF_BaseTimeDifference = basetime1 + neg2
+
+ END FUNCTION ESMF_BaseTimeDifference
+
+
+! Divide basetime by 8-byte integer
+ FUNCTION ESMF_BaseTimeQuotI8( basetime, divisor )
+ TYPE(ESMF_BaseTime) :: ESMF_BaseTimeQuotI8
+ TYPE(ESMF_BaseTime), INTENT(IN) :: basetime
+ INTEGER(ESMF_KIND_I8), INTENT(IN) :: divisor
+ ! locals
+ INTEGER(ESMF_KIND_I8) :: d, n, dinit
+
+!PRINT *,'DEBUG ESMF_BaseTimeQuotI8() A: S,Sn,Sd = ', &
+! basetime%S,basetime%Sn,basetime%Sd
+!PRINT *,'DEBUG ESMF_BaseTimeQuotI8() A: divisor = ', divisor
+ IF ( divisor == 0_ESMF_KIND_I8 ) THEN
+ CALL wrf_error_fatal( 'ESMF_BaseTimeQuotI8: divide by zero' )
+ ENDIF
+
+!$$$ move to default constructor
+ ESMF_BaseTimeQuotI8%S = 0
+ ESMF_BaseTimeQuotI8%Sn = 0
+ ESMF_BaseTimeQuotI8%Sd = 0
+
+ ! convert to a fraction and divide by multipling the denonminator by
+ ! the divisor
+ IF ( basetime%Sd == 0 ) THEN
+ dinit = 1_ESMF_KIND_I8
+ ELSE
+ dinit = basetime%Sd
+ ENDIF
+ n = basetime%S * dinit + basetime%Sn
+ d = dinit * divisor
+!PRINT *,'DEBUG ESMF_BaseTimeQuotI8() B: n,d = ',n,d
+ CALL simplify( n, d, ESMF_BaseTimeQuotI8%Sn, ESMF_BaseTimeQuotI8%Sd )
+!PRINT *,'DEBUG ESMF_BaseTimeQuotI8() C: S,Sn,Sd = ', &
+! ESMF_BaseTimeQuotI8%S,ESMF_BaseTimeQuotI8%Sn,ESMF_BaseTimeQuotI8%Sd
+ CALL normalize_basetime( ESMF_BaseTimeQuotI8 )
+!PRINT *,'DEBUG ESMF_BaseTimeQuotI8() D: S,Sn,Sd = ', &
+! ESMF_BaseTimeQuotI8%S,ESMF_BaseTimeQuotI8%Sn,ESMF_BaseTimeQuotI8%Sd
+ END FUNCTION ESMF_BaseTimeQuotI8
+
+! Divide basetime by integer
+ FUNCTION ESMF_BaseTimeQuotI( basetime, divisor )
+ TYPE(ESMF_BaseTime) :: ESMF_BaseTimeQuotI
+ TYPE(ESMF_BaseTime), INTENT(IN) :: basetime
+ INTEGER, INTENT(IN) :: divisor
+ IF ( divisor == 0 ) THEN
+ CALL wrf_error_fatal( 'ESMF_BaseTimeQuotI: divide by zero' )
+ ENDIF
+ ESMF_BaseTimeQuotI = basetime / INT( divisor, ESMF_KIND_I8 )
+ END FUNCTION ESMF_BaseTimeQuotI
+
+
+! .EQ. for two basetimes
+ FUNCTION ESMF_BaseTimeEQ( basetime1, basetime2 )
+ LOGICAL :: ESMF_BaseTimeEQ
+ TYPE(ESMF_BaseTime), INTENT(IN) :: basetime1
+ TYPE(ESMF_BaseTime), INTENT(IN) :: basetime2
+ INTEGER :: retval
+ CALL seccmp( basetime1%S, basetime1%Sn, basetime1%Sd, &
+ basetime2%S, basetime2%Sn, basetime2%Sd, &
+ retval )
+ ESMF_BaseTimeEQ = ( retval .EQ. 0 )
+ END FUNCTION ESMF_BaseTimeEQ
+
+
+! .NE. for two basetimes
+ FUNCTION ESMF_BaseTimeNE( basetime1, basetime2 )
+ LOGICAL :: ESMF_BaseTimeNE
+ TYPE(ESMF_BaseTime), INTENT(IN) :: basetime1
+ TYPE(ESMF_BaseTime), INTENT(IN) :: basetime2
+ INTEGER :: retval
+ CALL seccmp( basetime1%S, basetime1%Sn, basetime1%Sd, &
+ basetime2%S, basetime2%Sn, basetime2%Sd, &
+ retval )
+ ESMF_BaseTimeNE = ( retval .NE. 0 )
+ END FUNCTION ESMF_BaseTimeNE
+
+
+! .LT. for two basetimes
+ FUNCTION ESMF_BaseTimeLT( basetime1, basetime2 )
+ LOGICAL :: ESMF_BaseTimeLT
+ TYPE(ESMF_BaseTime), INTENT(IN) :: basetime1
+ TYPE(ESMF_BaseTime), INTENT(IN) :: basetime2
+ INTEGER :: retval
+ CALL seccmp( basetime1%S, basetime1%Sn, basetime1%Sd, &
+ basetime2%S, basetime2%Sn, basetime2%Sd, &
+ retval )
+ ESMF_BaseTimeLT = ( retval .LT. 0 )
+ END FUNCTION ESMF_BaseTimeLT
+
+
+! .GT. for two basetimes
+ FUNCTION ESMF_BaseTimeGT( basetime1, basetime2 )
+ LOGICAL :: ESMF_BaseTimeGT
+ TYPE(ESMF_BaseTime), INTENT(IN) :: basetime1
+ TYPE(ESMF_BaseTime), INTENT(IN) :: basetime2
+ INTEGER :: retval
+ CALL seccmp( basetime1%S, basetime1%Sn, basetime1%Sd, &
+ basetime2%S, basetime2%Sn, basetime2%Sd, &
+ retval )
+ ESMF_BaseTimeGT = ( retval .GT. 0 )
+ END FUNCTION ESMF_BaseTimeGT
+
+
+! .LE. for two basetimes
+ FUNCTION ESMF_BaseTimeLE( basetime1, basetime2 )
+ LOGICAL :: ESMF_BaseTimeLE
+ TYPE(ESMF_BaseTime), INTENT(IN) :: basetime1
+ TYPE(ESMF_BaseTime), INTENT(IN) :: basetime2
+ INTEGER :: retval
+ CALL seccmp( basetime1%S, basetime1%Sn, basetime1%Sd, &
+ basetime2%S, basetime2%Sn, basetime2%Sd, &
+ retval )
+ ESMF_BaseTimeLE = ( retval .LE. 0 )
+ END FUNCTION ESMF_BaseTimeLE
+
+
+! .GE. for two basetimes
+ FUNCTION ESMF_BaseTimeGE( basetime1, basetime2 )
+ LOGICAL :: ESMF_BaseTimeGE
+ TYPE(ESMF_BaseTime), INTENT(IN) :: basetime1
+ TYPE(ESMF_BaseTime), INTENT(IN) :: basetime2
+ INTEGER :: retval
+ CALL seccmp( basetime1%S, basetime1%Sn, basetime1%Sd, &
+ basetime2%S, basetime2%Sn, basetime2%Sd, &
+ retval )
+ ESMF_BaseTimeGE = ( retval .GE. 0 )
+ END FUNCTION ESMF_BaseTimeGE
+
+
+ end module ESMF_BaseTimeMod
Added: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_Calendar.F90
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_Calendar.F90         (rev 0)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_Calendar.F90        2012-11-29 22:23:06 UTC (rev 2329)
@@ -0,0 +1,314 @@
+!
+! Earth System Modeling Framework
+! Copyright 2002-2003, University Corporation for Atmospheric Research,
+! Massachusetts Institute of Technology, Geophysical Fluid Dynamics
+! Laboratory, University of Michigan, National Centers for Environmental
+! Prediction, Los Alamos National Laboratory, Argonne National Laboratory,
+! NASA Goddard Space Flight Center.
+! Licensed under the University of Illinois-NCSA license.
+!
+!==============================================================================
+!
+! ESMF Calendar Module
+ module ESMF_CalendarMod
+!
+!==============================================================================
+!
+! This file contains the Calendar class definition and all Calendar class
+! methods.
+!
+!------------------------------------------------------------------------------
+! INCLUDES
+#include <ESMF_TimeMgr.inc>
+
+!==============================================================================
+!BOPI
+! !MODULE: ESMF_CalendarMod
+!
+! !DESCRIPTION:
+! Part of Time Manager F90 API wrapper of C++ implemenation
+!
+! Defines F90 wrapper entry points for corresponding
+! C++ class { \tt ESMC\_Calendar} implementation
+!
+! See {\tt ../include/ESMC\_Calendar.h} for complete description
+!
+!------------------------------------------------------------------------------
+! !USES:
+ ! inherit from ESMF base class
+ use ESMF_BaseMod
+
+ ! inherit from base time class
+ use ESMF_BaseTimeMod
+
+ implicit none
+!
+!------------------------------------------------------------------------------
+! !PRIVATE TYPES:
+ private
+!------------------------------------------------------------------------------
+
+
+
+ INTEGER, PARAMETER :: MONTHS_PER_YEAR = 12
+
+ INTEGER, PARAMETER :: daysPerMonthNoLeap(MONTHS_PER_YEAR) &
+ = (/31,28,31,30,31,30,31,31,30,31,30,31/)
+ INTEGER, PARAMETER :: daysPerMonthLeap(MONTHS_PER_YEAR) &
+ = (/31,29,31,30,31,30,31,31,30,31,30,31/)
+ INTEGER, PARAMETER :: daysPerMonth360(MONTHS_PER_YEAR) &
+ = (/30,30,30,30,30,30,30,30,30,30,30,30/)
+
+ INTEGER, DIMENSION(MONTHS_PER_YEAR) :: mday
+ INTEGER, DIMENSION(MONTHS_PER_YEAR) :: mdayleap
+
+ INTEGER, DIMENSION(:), POINTER :: daym
+ INTEGER, DIMENSION(:), POINTER :: daymleap
+
+ INTEGER :: mdaycum(0:MONTHS_PER_YEAR)
+ INTEGER :: mdayleapcum(0:MONTHS_PER_YEAR)
+
+ TYPE(ESMF_BaseTime), TARGET :: monthbdys(0:MONTHS_PER_YEAR)
+ TYPE(ESMF_BaseTime), TARGET :: monthbdysleap(0:MONTHS_PER_YEAR)
+
+
+!------------------------------------------------------------------------------
+! ! ESMF_CalendarType
+!
+! ! F90 "enum" type to match C++ ESMC_CalendarType enum
+
+ type ESMF_CalendarType
+ integer :: caltype
+ end type
+
+ type(ESMF_CalendarType), parameter :: &
+ ESMF_CAL_GREGORIAN = ESMF_CalendarType(1), &
+ ESMF_CAL_JULIAN = ESMF_CalendarType(2), &
+ ! like Gregorian, except Feb always has 28 days
+ ESMF_CAL_NOLEAP = ESMF_CalendarType(3), &
+ ! 12 months, 30 days each
+ ESMF_CAL_360DAY = ESMF_CalendarType(4), &
+ ! user defined
+ ESMF_CAL_GENERIC = ESMF_CalendarType(5), &
+ ! track base time seconds only
+ ESMF_CAL_NOCALENDAR = ESMF_CalendarType(6)
+
+!------------------------------------------------------------------------------
+! ! ESMF_Calendar
+!
+! ! F90 class type to match C++ Calendar class in size only;
+! ! all dereferencing within class is performed by C++ implementation
+!
+!------------------------------------------------------------------------------
+!
+! ! ESMF_DaysPerYear
+!
+ type ESMF_DaysPerYear
+ private
+ integer :: D ! whole days per year
+! Fractional days-per-year are not yet used in this implementation.
+! integer :: Dn ! fractional days per year numerator
+! integer :: Dd ! fractional days per year denominator
+ end type ! e.g. for Venus, D=0, Dn=926, Dd=1000
+!
+!------------------------------------------------------------------------------
+! ! ESMF_Calendar
+!
+!
+ type ESMF_Calendar
+ private
+ type(ESMF_CalendarType) :: Type
+! TBH: When NO_DT_COMPONENT_INIT is set, code that uses F95 compile-time
+! TBH: initialization of components of derived types is not included.
+! TBH: Some older compilers, like PGI 5.x do not support this F95 feature.
+#ifdef NO_DT_COMPONENT_INIT
+ logical :: Set
+#else
+ logical :: Set = .false.
+#endif
+ integer, dimension(MONTHS_PER_YEAR) :: DaysPerMonth
+ integer :: SecondsPerDay
+ integer :: SecondsPerYear
+ type(ESMF_DaysPerYear) :: DaysPerYear
+ end type
+
+!------------------------------------------------------------------------------
+! !PUBLIC DATA:
+ TYPE(ESMF_Calendar), public, save, pointer :: defaultCal ! Default Calendar
+
+
+!
+!------------------------------------------------------------------------------
+! !PUBLIC TYPES:
+ public MONTHS_PER_YEAR
+ public mday
+ public mdayleap
+ public monthbdys
+ public monthbdysleap
+ public daym
+ public daymleap
+ public mdaycum
+ public mdayleapcum
+ public ESMF_CalendarType
+ public ESMF_CAL_GREGORIAN, ESMF_CAL_NOLEAP, &
+ ESMF_CAL_360DAY, ESMF_CAL_NOCALENDAR
+! public ESMF_CAL_JULIAN
+! public ESMF_CAL_GENERIC
+ public ESMF_Calendar
+
+!------------------------------------------------------------------------------
+!
+! !PUBLIC MEMBER FUNCTIONS:
+ public ESMF_CalendarCreate
+ public ESMF_CalendarDestroy
+ public ESMF_GetCalendarType
+
+
+! Required inherited and overridden ESMF_Base class methods
+
+ public ESMF_CalendarInitialized ! Only in this implementation, intended
+ ! to be private within ESMF methods
+!EOPI
+
+!==============================================================================
+
+ contains
+
+
+!==============================================================================
+
+
+ type(ESMF_CalendarType) function ESMF_GetCalendarType()
+ ESMF_GetCalendarType = defaultCal % Type
+ end function ESMF_GetCalendarType
+
+
+!==============================================================================
+!BOP
+! !IROUTINE: ESMF_CalendarCreate - Create a new ESMF Calendar of built-in type
+
+! !INTERFACE:
+ ! Private name; call using ESMF_CalendarCreate()
+ function ESMF_CalendarCreate(name, calendartype, rc)
+
+! !RETURN VALUE:
+ type(ESMF_Calendar) :: ESMF_CalendarCreate
+
+! !ARGUMENTS:
+ character (len=*), intent(in), optional :: name
+ type(ESMF_CalendarType), intent(in) :: calendartype
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Creates and sets a {\tt calendar} to the given built-in
+! {\tt ESMF\_CalendarType}.
+!
+! This is a private method; invoke via the public overloaded entry point
+! {\tt ESMF\_CalendarCreate()}.
+!
+! The arguments are:
+! \begin{description}
+! \item[{[name]}]
+! The name for the newly created calendar. If not specified, a
+! default unique name will be generated: "CalendarNNN" where NNN
+! is a unique sequence number from 001 to 999.
+! \item[calendartype]
+! The built-in {\tt ESMF\_CalendarType}. Valid values are:
+! {\tt ESMF\_CAL\_360DAY}, {\tt ESMF\_CAL\_GREGORIAN},
+! {\tt ESMF\_CAL\_JULIANDAY}, {\tt ESMF\_CAL\_NOCALENDAR}, and
+! {\tt ESMF\_CAL\_NOLEAP}.
+! See the "Time Manager Reference" document for a description of
+! each calendar type.
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+!EOP
+! !REQUIREMENTS:
+! TMGn.n.n
+ type(ESMF_DaysPerYear) :: dayspy
+
+ if ( present(rc) ) rc = ESMF_FAILURE
+
+ if ( calendartype % caltype == ESMF_CAL_GREGORIAN % caltype ) then
+ ESMF_CalendarCreate % Type = ESMF_CAL_GREGORIAN
+ mday = daysPerMonthNoLeap
+         mdayleap = daysPerMonthLeap
+         allocate(daym(365))
+         allocate(daymleap(366))
+ else if ( calendartype % caltype == ESMF_CAL_NOLEAP % caltype ) then
+ ESMF_CalendarCreate % Type = ESMF_CAL_NOLEAP
+         mday = daysPerMonthNoLeap
+         mdayleap = daysPerMonthNoLeap
+         allocate(daym(365))
+         allocate(daymleap(365))
+ else if ( calendartype % caltype == ESMF_CAL_360DAY % caltype ) then
+ ESMF_CalendarCreate % Type = ESMF_CAL_360DAY
+ mday = daysPerMonth360
+         mdayleap = daysPerMonth360
+         allocate(daym(360))
+         allocate(daymleap(360))
+ else
+ write(6,*) 'Not a valid calendar type for this implementation'
+ write(6,*) 'The current implementation only supports ESMF_CAL_NOLEAP, ESMF_CAL_GREGORIAN, ESMF_CAL_360DAY'
+ return
+ end if
+
+ ESMF_CalendarCreate % Set = .true.
+ ESMF_CalendarCreate % DaysPerMonth(:) = mday(:)
+ ESMF_CalendarCreate % SecondsPerDay = SECONDS_PER_DAY
+
+!TBH: TODO: Replace DaysPerYear and SecondsPerYear with methods
+!TBH: TODO: since they only make sense for the NO_LEAP calendar!
+ dayspy % D = size(daym)
+ ESMF_CalendarCreate % DaysPerYear = dayspy
+ ESMF_CalendarCreate % SecondsPerYear = ESMF_CalendarCreate % SecondsPerDay * dayspy % D
+
+ if ( present(rc) ) rc = ESMF_SUCCESS
+
+ end function ESMF_CalendarCreate
+
+
+ subroutine ESMF_CalendarDestroy(rc)
+
+ integer, intent(out), optional :: rc
+
+ if ( present(rc) ) rc = ESMF_FAILURE
+
+ deallocate(daym)
+ deallocate(daymleap)
+
+ if ( present(rc) ) rc = ESMF_SUCCESS
+
+ end subroutine ESMF_CalendarDestroy
+
+
+
+!==============================================================================
+!BOP
+! !IROUTINE: ESMF_CalendarInitialized - check if calendar was created
+
+! !INTERFACE:
+ function ESMF_CalendarInitialized(calendar)
+
+! !RETURN VALUE:
+ logical ESMF_CalendarInitialized
+
+! !ARGUMENTS:
+ type(ESMF_Calendar), intent(in) :: calendar
+
+! !DESCRIPTION:
+!EOP
+! !REQUIREMENTS:
+! TMGn.n.n
+! Note that return value from this function will be bogus for older compilers
+! that do not support compile-time initialization of data members of Fortran
+! derived data types. For example, PGI 5.x compilers do not support this F95
+! feature. At the moment, the call to this fuction is #ifdefd out when the
+! leap-year calendar is used so this is not an issue for WRF (see
+! NO_DT_COMPONENT_INIT).
+ ESMF_CalendarInitialized = calendar%set
+
+ end function ESMF_CalendarInitialized
+
+ end module ESMF_CalendarMod
Added: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_Clock.F90
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_Clock.F90         (rev 0)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_Clock.F90        2012-11-29 22:23:06 UTC (rev 2329)
@@ -0,0 +1,1366 @@
+!
+! Earth System Modeling Framework
+! Copyright 2002-2003, University Corporation for Atmospheric Research,
+! Massachusetts Institute of Technology, Geophysical Fluid Dynamics
+! Laboratory, University of Michigan, National Centers for Environmental
+! Prediction, Los Alamos National Laboratory, Argonne National Laboratory,
+! NASA Goddard Space Flight Center.
+! Licensed under the University of Illinois-NCSA license.
+!
+!==============================================================================
+!
+! ESMF Clock Module
+ module ESMF_ClockMod
+!
+!==============================================================================
+!
+! This file contains the Clock class definition and all Clock class methods.
+!
+!------------------------------------------------------------------------------
+! INCLUDES
+#include <ESMF_TimeMgr.inc>
+
+!==============================================================================
+!BOPI
+! !MODULE: ESMF_ClockMod
+!
+! !DESCRIPTION:
+! Part of Time Manager F90 API wrapper of C++ implemenation
+!
+! Defines F90 wrapper entry points for corresponding
+! C++ class {\tt ESMC\_Time} implementation
+!
+! See {\tt ../include/ESMC\_Clock.h} for complete description
+!
+!------------------------------------------------------------------------------
+! !USES:
+ ! inherit from ESMF base class
+ use ESMF_BaseMod
+
+ ! associated derived types
+ use ESMF_TimeIntervalMod ! , only : ESMF_TimeInterval, &
+ ! ESMF_TimeIntervalIsPositive
+ use ESMF_TimeMod ! , only : ESMF_Time
+ use ESMF_AlarmMod, only : ESMF_Alarm
+
+ implicit none
+!
+!------------------------------------------------------------------------------
+! !PRIVATE TYPES:
+ private
+!------------------------------------------------------------------------------
+! ! ESMF_Clock
+!
+! ! F90 class type to match C++ Clock class in size only;
+! ! all dereferencing within class is performed by C++ implementation
+
+! internals for ESMF_Clock
+ type ESMF_ClockInt
+ type(ESMF_TimeInterval) :: TimeStep
+ type(ESMF_Time) :: StartTime
+ type(ESMF_Time) :: StopTime
+ type(ESMF_Time) :: RefTime
+ type(ESMF_Time) :: CurrTime
+ type(ESMF_Time) :: PrevTime
+ integer(ESMF_KIND_I8) :: AdvanceCount
+ integer :: ClockMutex
+ integer :: NumAlarms
+ ! Note: to mimic ESMF 2.1.0+, AlarmList is maintained
+ ! within ESMF_Clock even though copies of each alarm are
+ ! returned from ESMF_AlarmCreate() at the same time they
+ ! are copied into the AlarmList! This duplication is not
+ ! as hideous as it might be because the ESMF_Alarm type
+ ! has data members that are all POINTERs (thus the horrible
+ ! shallow-copy-masquerading-as-reference-copy hack works).
+ type(ESMF_Alarm), pointer, dimension(:) :: AlarmList
+ end type
+
+! Actual public type: this bit allows easy mimic of "deep" ESMF_ClockCreate
+! in ESMF 2.1.0+
+! NOTE: DO NOT ADD NON-POINTER STATE TO THIS DATA TYPE. It emulates ESMF
+! shallow-copy-masquerading-as-reference-copy.
+ type ESMF_Clock
+ type(ESMF_ClockInt), pointer :: clockint
+ end type
+
+!------------------------------------------------------------------------------
+! !PUBLIC TYPES:
+ public ESMF_Clock
+ public ESMF_ClockInt ! needed on AIX but not PGI
+!------------------------------------------------------------------------------
+!
+! !PUBLIC MEMBER FUNCTIONS:
+ public ESMF_ClockCreate
+ public ESMF_ClockDestroy
+ public ESMF_ClockSet
+! public ESMF_ClockSetOLD
+ public ESMF_ClockGet
+! public ESMF_ClockGetAdvanceCount
+! public ESMF_ClockGetTimeStep
+! public ESMF_ClockSetTimeStep
+! public ESMF_ClockGetCurrTime
+! public ESMF_ClockSetCurrTime
+! public ESMF_ClockGetStartTime
+! public ESMF_ClockGetStopTime
+! public ESMF_ClockGetRefTime
+! public ESMF_ClockGetPrevTime
+! public ESMF_ClockGetCurrSimTime
+! public ESMF_ClockGetPrevSimTime
+! This must be public for ESMF_AlarmClockMod...
+ public ESMF_ClockAddAlarm
+ public ESMF_ClockGetAlarmList
+! public ESMF_ClockGetNumAlarms
+! public ESMF_ClockSyncToWallClock
+ public ESMF_ClockAdvance
+ public ESMF_ClockIsStopTime
+ public ESMF_ClockStopTimeDisable
+
+! Required inherited and overridden ESMF_Base class methods
+
+! public ESMF_ClockRead
+! public ESMF_ClockWrite
+ public ESMF_ClockValidate
+ public ESMF_ClockPrint
+!EOPI
+
+!==============================================================================
+
+ contains
+
+!==============================================================================
+!
+! This section includes the Set methods.
+!
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_ClockSetOLD - Initialize a clockint
+
+! !INTERFACE:
+ subroutine ESMF_ClockSetOLD(clockint, TimeStep, StartTime, &
+ StopTime, RefTime, rc)
+
+! !ARGUMENTS:
+ type(ESMF_ClockInt), intent(out) :: clockint
+ type(ESMF_TimeInterval), intent(in), optional :: TimeStep
+ type(ESMF_Time), intent(in) :: StartTime
+ type(ESMF_Time), intent(in) :: StopTime
+ type(ESMF_Time), intent(in), optional :: RefTime
+ integer, intent(out), optional :: rc
+! Local
+ integer i
+
+! !DESCRIPTION:
+! Initialize an {\tt ESMF\_Clock}
+!
+! The arguments are:
+! \begin{description}
+! \item[clockint]
+! The object instance to initialize
+! \item[{[TimeStep]}]
+! The {\tt ESMF\_Clock}'s time step interval
+! \item[StartTime]
+! The {\tt ESMF\_Clock}'s starting time
+! \item[StopTime]
+! The {\tt ESMF\_Clock}'s stopping time
+! \item[{[RefTime]}]
+! The {\tt ESMF\_Clock}'s reference time
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG3.1, TMG3.4.4
+!EOP
+ IF ( PRESENT(TimeStep) ) clockint%TimeStep = TimeStep
+ IF ( PRESENT(RefTime) )THEN
+ clockint%RefTime = RefTime
+ ELSE
+ clockint%RefTime = StartTime
+ END IF
+ clockint%CurrTime = StartTime
+ clockint%StartTime = StartTime
+ clockint%StopTime = StopTime
+ clockint%NumAlarms = 0
+ clockint%AdvanceCount = 0
+ ALLOCATE(clockint%AlarmList(MAX_ALARMS))
+ ! TBH: This incredible hack can be removed once ESMF_*Validate()
+ ! TBH: can tell if a deep ESMF_* was created or not.
+ DO i = 1, MAX_ALARMS
+ NULLIFY( clockint%AlarmList( i )%alarmint )
+ ENDDO
+ IF ( PRESENT( rc ) ) rc = ESMF_SUCCESS
+
+ end subroutine ESMF_ClockSetOLD
+
+
+! !IROUTINE: ESMF_ClockSet - Set clock properties -- for compatibility with ESMF 2.0.1
+
+! !INTERFACE:
+ subroutine ESMF_ClockSet(clock, TimeStep, StartTime, StopTime, &
+ RefTime, CurrTime, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Clock), intent(inout) :: clock
+ type(ESMF_TimeInterval), intent(in), optional :: TimeStep
+ type(ESMF_Time), intent(in), optional :: StartTime
+ type(ESMF_Time), intent(in), optional :: StopTime
+ type(ESMF_Time), intent(in), optional :: RefTime
+ type(ESMF_Time), intent(in), optional :: CurrTime
+ integer, intent(out), optional :: rc
+! Local
+ integer ierr
+
+! !DESCRIPTION:
+! Initialize an {\tt ESMF\_Clock}
+!
+! The arguments are:
+! \begin{description}
+! \item[clock]
+! The object instance to initialize
+! \item[{[TimeStep]}]
+! The {\tt ESMF\_Clock}'s time step interval
+! \item[StartTime]
+! The {\tt ESMF\_Clock}'s starting time
+! \item[StopTime]
+! The {\tt ESMF\_Clock}'s stopping time
+! \item[{[RefTime]}]
+! The {\tt ESMF\_Clock}'s reference time
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG3.1, TMG3.4.4
+!EOP
+ ierr = ESMF_SUCCESS
+ IF ( PRESENT(TimeStep) ) THEN
+ CALL ESMF_ClockSetTimeStep ( clock, TimeStep, rc=ierr )
+ ENDIF
+ IF ( PRESENT(RefTime) ) clock%clockint%RefTime = RefTime
+ IF ( PRESENT(StartTime) ) clock%clockint%StartTime = StartTime
+ IF ( PRESENT(StopTime) ) clock%clockint%StopTime = StopTime
+ IF ( PRESENT(CurrTime) ) THEN
+ CALL ESMF_ClockSetCurrTime(clock, CurrTime, rc=ierr)
+ ENDIF
+ IF ( PRESENT(rc) ) rc = ierr
+
+ end subroutine ESMF_ClockSet
+
+
+! Create ESMF_Clock using ESMF 2.1.0+ semantics
+ FUNCTION ESMF_ClockCreate( name, TimeStep, StartTime, StopTime, &
+ RefTime, rc )
+ ! return value
+ type(ESMF_Clock) :: ESMF_ClockCreate
+ ! !ARGUMENTS:
+ character (len=*), intent(in), optional :: name
+ type(ESMF_TimeInterval), intent(in), optional :: TimeStep
+ type(ESMF_Time), intent(in) :: StartTime
+ type(ESMF_Time), intent(in) :: StopTime
+ type(ESMF_Time), intent(in), optional :: RefTime
+ integer, intent(out), optional :: rc
+ ! locals
+ type(ESMF_Clock) :: clocktmp
+ ! TBH: ignore allocate errors, for now
+ ALLOCATE( clocktmp%clockint )
+ CALL ESMF_ClockSetOLD( clocktmp%clockint, &
+ TimeStep= TimeStep, &
+ StartTime=StartTime, &
+ StopTime= StopTime, &
+ RefTime=RefTime, rc=rc )
+ ESMF_ClockCreate = clocktmp
+ END FUNCTION ESMF_ClockCreate
+
+
+! Deallocate memory for ESMF_Clock
+ SUBROUTINE ESMF_ClockDestroy( clock, rc )
+ TYPE(ESMF_Clock), INTENT(INOUT) :: clock
+ INTEGER, INTENT( OUT), OPTIONAL :: rc
+ ! TBH: ignore deallocate errors, for now
+ DEALLOCATE( clock%clockint%AlarmList )
+ DEALLOCATE( clock%clockint )
+ IF ( PRESENT( rc ) ) rc = ESMF_SUCCESS
+ END SUBROUTINE ESMF_ClockDestroy
+
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_ClockGet - Get clock properties -- for compatibility with ESMF 2.0.1
+
+! !INTERFACE:
+ subroutine ESMF_ClockGet(clock, StartTime, CurrTime, &
+ AdvanceCount, StopTime, TimeStep, &
+ PrevTime, RefTime, &
+ rc)
+
+! !ARGUMENTS:
+ type(ESMF_Clock), intent(in) :: clock
+ type(ESMF_Time), intent(out), optional :: StartTime
+ type(ESMF_Time), intent(out), optional :: CurrTime
+ type(ESMF_Time), intent(out), optional :: StopTime
+ type(ESMF_Time), intent(out), optional :: PrevTime
+ type(ESMF_Time), intent(out), optional :: RefTime
+ integer(ESMF_KIND_I8), intent(out), optional :: AdvanceCount
+ type(ESMF_TimeInterval), intent(out), optional :: TimeStep
+ integer, intent(out), optional :: rc
+ integer :: ierr
+
+! !DESCRIPTION:
+! Returns the number of times the {\tt ESMF\_Clock} has been advanced
+! (time stepped)
+!
+! The arguments are:
+! \begin{description}
+! \item[clock]
+! The object instance to get the advance count from
+! \item[StartTime]
+! The start time
+! \item[CurrTime]
+! The current time
+! \item[AdvanceCount]
+! The number of times the {\tt ESMF\_Clock} has been advanced
+! \item[StopTime]
+! The {\tt ESMF\_Clock}'s stopping time
+! \item[{[TimeStep]}]
+! The {\tt ESMF\_Clock}'s time step interval
+! \item[{[PrevTime]}]
+! The {\tt ESMF\_Clock}'s previous current time
+! \item[{[PrevTime]}]
+! The {\tt ESMF\_Clock}'s reference time
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+
+! !REQUIREMENTS:
+! TMG3.5.1
+!EOP
+ ierr = ESMF_SUCCESS
+
+ IF ( PRESENT (StartTime) ) THEN
+ CALL ESMF_ClockGetStartTime( clock, StartTime=StartTime, rc=ierr )
+ ENDIF
+ IF ( PRESENT (CurrTime) ) THEN
+ CALL ESMF_ClockGetCurrTime( clock , CurrTime, ierr )
+ ENDIF
+ IF ( PRESENT (StopTime) ) THEN
+ CALL ESMF_ClockGetStopTime( clock , StopTime, ierr )
+ ENDIF
+ IF ( PRESENT (AdvanceCount) ) THEN
+ CALL ESMF_ClockGetAdvanceCount(clock, AdvanceCount, ierr)
+ ENDIF
+ IF ( PRESENT (TimeStep) ) THEN
+ CALL ESMF_ClockGetTimeStep(clock, TimeStep, ierr)
+ ENDIF
+ IF ( PRESENT (PrevTime) ) THEN
+ CALL ESMF_ClockGetPrevTime(clock, PrevTime, ierr)
+ ENDIF
+ IF ( PRESENT (RefTime) ) THEN
+ CALL ESMF_ClockGetRefTime(clock, RefTime, ierr)
+ ENDIF
+
+ IF ( PRESENT (rc) ) THEN
+ rc = ierr
+ ENDIF
+
+ end subroutine ESMF_ClockGet
+
+
+! !IROUTINE: ESMF_ClockGetAdvanceCount - Get the clock's advance count
+
+! !INTERFACE:
+ subroutine ESMF_ClockGetAdvanceCount(clock, AdvanceCount, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Clock), intent(in) :: clock
+ integer(ESMF_KIND_I8), intent(out) :: AdvanceCount
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Returns the number of times the {\tt ESMF\_Clock} has been advanced
+! (time stepped)
+!
+! The arguments are:
+! \begin{description}
+! \item[clock]
+! The object instance to get the advance count from
+! \item[AdvanceCount]
+! The number of times the {\tt ESMF\_Clock} has been advanced
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+
+! !REQUIREMENTS:
+! TMG3.5.1
+!EOP
+
+ AdvanceCount = clock%clockint%AdvanceCount
+
+ IF ( PRESENT(rc) ) rc = ESMF_SUCCESS
+
+ end subroutine ESMF_ClockGetAdvanceCount
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_ClockGetTimeStep - Get a clock's timestep interval
+
+! !INTERFACE:
+ subroutine ESMF_ClockGetTimeStep(clock, TimeStep, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Clock), intent(in) :: clock
+ type(ESMF_TimeInterval), intent(out) :: TimeStep
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Get an {\tt ESMF\_Clock}'s timestep interval
+!
+! The arguments are:
+! \begin{description}
+! \item[clock]
+! The object instance to get the time step from
+! \item[TimeStep]
+! The time step
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG3.5.2
+!EOP
+
+ TimeStep = clock%clockint%TimeStep
+ IF ( PRESENT(rc) ) rc = ESMF_SUCCESS
+
+ end subroutine ESMF_ClockGetTimeStep
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_ClockSetTimeStep - Set a clock's timestep interval
+
+! !INTERFACE:
+ subroutine ESMF_ClockSetTimeStep(clock, TimeStep, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Clock), intent(inout) :: clock ! really INTENT(OUT)
+ type(ESMF_TimeInterval), intent(in) :: TimeStep
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Set an {\tt ESMF\_Clock}'s timestep interval
+!
+! The arguments are:
+! \begin{description}
+! \item[clock]
+! The object instance to set the time step
+! \item[TimeStep]
+! The time step
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG3.4.2
+!EOP
+
+ clock%clockint%TimeStep = TimeStep
+ IF ( PRESENT(rc) ) rc = ESMF_SUCCESS
+
+ end subroutine ESMF_ClockSetTimeStep
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_ClockGetCurrTime - Get a clock's current time
+
+! !INTERFACE:
+ subroutine ESMF_ClockGetCurrTime(clock, CurrTime, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Clock), intent(in) :: clock
+ type(ESMF_Time), intent(out) :: CurrTime
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Get an {\tt ESMF\_Clock}'s current time
+!
+! The arguments are:
+! \begin{description}
+! \item[clock]
+! The object instance to get the current time from
+! \item[CurrTime]
+! The current time
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG3.5.4
+!EOP
+
+ CurrTime = clock%clockint%CurrTime
+ IF ( PRESENT(rc) ) rc = ESMF_SUCCESS
+ end subroutine ESMF_ClockGetCurrTime
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_ClockSetCurrTime - Set a clock's current time
+
+! !INTERFACE:
+ subroutine ESMF_ClockSetCurrTime(clock, CurrTime, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Clock), intent(inout) :: clock ! really INTENT(OUT)
+ type(ESMF_Time), intent(in) :: CurrTime
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Set an {\tt ESMF\_Clock}'s current time
+!
+! The arguments are:
+! \begin{description}
+! \item[clock]
+! The object instance to set the current time from
+! \item[CurrTime]
+! The current time
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG3.4.3
+!EOP
+
+ clock%clockint%CurrTime = CurrTime
+ IF ( PRESENT(rc) ) rc = ESMF_SUCCESS
+
+ end subroutine ESMF_ClockSetCurrTime
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_ClockGetStartTime - Get a clock's start time
+
+! !INTERFACE:
+ subroutine ESMF_ClockGetStartTime(clock, StartTime, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Clock), intent(in) :: clock
+ type(ESMF_Time), intent(out) :: StartTime
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Get an {\tt ESMF\_Clock}'s start time
+!
+! The arguments are:
+! \begin{description}
+! \item[clock]
+! The object instance to get the start time from
+! \item[StartTime]
+! The start time
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG3.5.3
+!EOP
+
+ StartTime = clock%clockint%StartTime
+ IF ( PRESENT(rc) ) rc = ESMF_SUCCESS
+
+ end subroutine ESMF_ClockGetStartTime
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_ClockGetStopTime - Get a clock's stop time
+
+! !INTERFACE:
+ subroutine ESMF_ClockGetStopTime(clock, StopTime, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Clock), intent(in) :: clock
+ type(ESMF_Time), intent(out) :: StopTime
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Get an {\tt ESMF\_Clock}'s stop time
+!
+! The arguments are:
+! \begin{description}
+! \item[clock]
+! The object instance to get the stop time from
+! \item[StopTime]
+! The stop time
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG3.5.3
+!EOP
+
+ StopTime = clock%clockint%StopTime
+ IF ( PRESENT(rc) ) rc = ESMF_SUCCESS
+
+ end subroutine ESMF_ClockGetStopTime
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_ClockGetRefTime - Get a clock's reference time
+
+! !INTERFACE:
+ subroutine ESMF_ClockGetRefTime(clock, RefTime, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Clock), intent(in) :: clock
+ type(ESMF_Time), intent(out) :: RefTime
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Get an {\tt ESMF\_Clock}'s reference time
+!
+! The arguments are:
+! \begin{description}
+! \item[clock]
+! The object instance to get the reference time from
+! \item[RefTime]
+! The reference time
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG3.5.3
+!EOP
+ refTime = clock%clockint%RefTime
+ IF ( PRESENT(rc) ) rc = ESMF_SUCCESS
+ end subroutine ESMF_ClockGetRefTime
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_ClockGetPrevTime - Get a clock's previous current time
+
+! !INTERFACE:
+ subroutine ESMF_ClockGetPrevTime(clock, PrevTime, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Clock), intent(in) :: clock
+ type(ESMF_Time), intent(out) :: PrevTime
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Get an {\tt ESMF\_Clock}'s previous current time
+!
+! The arguments are:
+! \begin{description}
+! \item[clock]
+! The object instance to get the previous current time from
+! \item[PrevTime]
+! The previous current time
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG3.5.4
+!EOP
+
+! hack for bug in PGI 5.1-x
+! prevTime = Clock%clockint%CurrTime - Clock%clockint%TimeStep
+ prevTime = ESMF_TimeDec( Clock%clockint%CurrTime, &
+ Clock%clockint%TimeStep )
+
+ IF ( PRESENT(rc) ) rc = ESMF_SUCCESS
+ end subroutine ESMF_ClockGetPrevTime
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_ClockGetCurrSimTime - Get a clock's current simulation time
+
+! !INTERFACE:
+ subroutine ESMF_ClockGetCurrSimTime(clock, CurrSimTime, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Clock), intent(in) :: clock
+ type(ESMF_TimeInterval), intent(out) :: CurrSimTime
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Get an {\tt ESMF\_Clock}'s current simulation time
+!
+! The arguments are:
+! \begin{description}
+! \item[clock]
+! The object instance to get the current simulation time from
+! \item[CurrSimTime]
+! The current simulation time
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG3.5.5
+!EOP
+ CALL wrf_error_fatal( 'ESMF_ClockGetCurrSimTime not supported' )
+ end subroutine ESMF_ClockGetCurrSimTime
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_ClockGetPrevSimTime - Get a clock's previous simulation time
+
+! !INTERFACE:
+ subroutine ESMF_ClockGetPrevSimTime(clock, PrevSimTime, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Clock), intent(in) :: clock
+ type(ESMF_TimeInterval), intent(out) :: PrevSimTime
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Get an {\tt ESMF\_Clock}'s previous simulation time
+!
+! The arguments are:
+! \begin{description}
+! \item[clock]
+! The object instance to get the previous simulation time from
+! \item[PrevSimTime]
+! The previous simulation time
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG3.5.5
+!EOP
+ CALL wrf_error_fatal( 'ESMF_ClockGetPrevSimTime not supported' )
+ end subroutine ESMF_ClockGetPrevSimTime
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_ClockAddAlarm - Add an alarm to a clock's alarm list
+
+! !INTERFACE:
+ subroutine ESMF_ClockAddAlarm(clock, Alarm, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Clock), intent(inout) :: clock
+ type(ESMF_Alarm), intent(inout) :: Alarm
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Add an {\tt ESMF\_Alarm} to an {\tt ESMF\_Clock}'s {\tt ESMF\_Alarm} list
+!
+! The arguments are:
+! \begin{description}
+! \item[clock]
+! The object instance to add an {\tt ESMF\_Alarm} to
+! \item[Alarm]
+! The {\tt ESMF\_Alarm} to add to the {\tt ESMF\_Clock}'s
+! {\tt ESMF\_Alarm} list
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG4.1, TMG4.2
+!EOP
+
+ IF ( PRESENT( rc ) ) rc = ESMF_SUCCESS
+ clock%clockint%NumAlarms = clock%clockint%NumAlarms + 1
+ IF ( clock%clockint%NumAlarms > SIZE (clock%clockint%AlarmList) ) THEN
+ CALL wrf_error_fatal ( 'ESMF_ClockAddAlarm: too many alarms' )
+ ELSE IF ( .NOT. ASSOCIATED( Alarm%alarmint ) ) THEN
+ CALL wrf_error_fatal ( &
+ 'ESMF_ClockAddAlarm: alarm not created' )
+ ELSE
+ IF ( Alarm%alarmint%RingTimeSet ) THEN
+ Alarm%alarmint%PrevRingTime = Alarm%alarmint%RingTime
+!MGD: If the ring time is equal to the current time, the alarm should be ringing
+ IF (Alarm%alarmint%PrevRingTime == clock%clockint%CurrTime) THEN
+ Alarm%alarmint%Ringing = .TRUE.
+ ELSE
+ Alarm%alarmint%Ringing = .FALSE.
+ ENDIF
+ ELSE
+!TBH: This has the nasty side-effect of forcing us to explicitly turn on
+!TBH: alarms that are created with RingInterval only, if we want them to start
+!TBH: ringing right away. And this is done (see
+!TBH: COMPUTE_VORTEX_CENTER_ALARM). Straighten this out...
+ Alarm%alarmint%PrevRingTime = clock%clockint%CurrTime
+ Alarm%alarmint%Ringing = .FALSE.
+ ENDIF
+
+ ! finally, load the alarm into the list
+! write(0,*)'ESMF_ClockAddAlarm ',clock%clockint%NumAlarms
+ clock%clockint%AlarmList(clock%clockint%NumAlarms) = Alarm
+ ENDIF
+
+ end subroutine ESMF_ClockAddAlarm
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_ClockGetAlarmList - Get a clock's alarm list
+
+! !INTERFACE:
+ subroutine ESMF_ClockGetAlarmList(clock, AlarmList, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Clock), intent(in) :: clock
+ type(ESMF_Alarm), pointer :: AlarmList(:)
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Get an {\tt ESMF\_Clock}'s {\tt ESMF\_Alarm} list
+!
+! The arguments are:
+! \begin{description}
+! \item[clock]
+! The object instance to get the {\tt ESMF\_Alarm} list from
+! \item[AlarmList]
+! The {\tt ESMF\_Clock}'s {\tt ESMF\_Alarm} list
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG4.3
+!EOP
+
+ AlarmList => clock%clockint%AlarmList
+ IF ( PRESENT(rc) ) rc = ESMF_SUCCESS
+
+ end subroutine ESMF_ClockGetAlarmList
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_ClockGetNumAlarms - Get the number of alarms in a clock's alarm list
+
+! !INTERFACE:
+ subroutine ESMF_ClockGetNumAlarms(clock, NumAlarms, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Clock), intent(in) :: clock
+ integer, intent(out) :: NumAlarms
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Get the number of {\tt ESMF\_Alarm}s in an {\tt ESMF\_Clock}'s
+! {\tt ESMF\_Alarm} list
+!
+! The arguments are:
+! \begin{description}
+! \item[clock]
+! The object instance to get the number of {\tt ESMF\_Alarm}s from
+! \item[NumAlarms]
+! The number of {\tt ESMF\_Alarm}s in the {\tt ESMF\_Clock}'s
+! {\tt ESMF\_Alarm} list
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG4.3
+!EOP
+
+ NumAlarms = clock%clockint%NumAlarms
+ IF ( PRESENT(rc) ) rc = ESMF_SUCCESS
+
+ end subroutine ESMF_ClockGetNumAlarms
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_ClockSyncToWallClock - Set clock's current time to wall clock time
+
+! !INTERFACE:
+ subroutine ESMF_ClockSyncToWallClock(clock, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Clock), intent(inout) :: clock
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Set an {\tt ESMF\_Clock}'s current time to wall clock time
+!
+! The arguments are:
+! \begin{description}
+! \item[clock]
+! The object instance to synchronize to wall clock time
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG3.4.5
+!EOP
+ CALL wrf_error_fatal( 'ESMF_ClockSyncToWallClock not supported' )
+ end subroutine ESMF_ClockSyncToWallClock
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_ClockAdvance - Advance a clock's current time by one time step
+
+! !INTERFACE:
+ subroutine ESMF_ClockAdvance(clock, RingingAlarmList, &
+ NumRingingAlarms, rc)
+
+use esmf_timemod
+
+! !ARGUMENTS:
+ type(ESMF_Clock), intent(inout) :: clock
+ type(ESMF_Alarm), dimension(MAX_ALARMS), intent(out), optional :: &
+ RingingAlarmList
+ integer, intent(out), optional :: NumRingingAlarms
+ integer, intent(out), optional :: rc
+! Local
+ logical pred1, pred2, pred3
+ integer i, n
+ type(ESMF_Alarm) :: alarm
+ logical :: positive_timestep
+!
+! !DESCRIPTION:
+! Advance an {\tt ESMF\_Clock}'s current time by one time step
+!
+! The arguments are:
+! \begin{description}
+! \item[clock]
+! The object instance to advance
+! \item[{[RingingAlarmList]}]
+! Return a list of any ringing alarms after the time step
+! \item[{[NumRingingAlarms]}]
+! The number of ringing alarms returned
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG3.4.1
+!EOP
+! hack for bug in PGI 5.1-x
+! clock%clockint%CurrTime = clock%clockint%CurrTime + &
+! clock%clockint%TimeStep
+ clock%clockint%CurrTime = ESMF_TimeInc( clock%clockint%CurrTime, &
+ clock%clockint%TimeStep )
+ positive_timestep = ESMF_TimeIntervalIsPositive( clock%clockint%TimeStep )
+
+ IF ( Present(NumRingingAlarms) ) NumRingingAlarms = 0
+ clock%clockint%AdvanceCount = clock%clockint%AdvanceCount + 1
+ DO i = 1, MAX_ALARMS
+ alarm = clock%clockint%AlarmList(i)
+ ! TBH: This is really dangerous. We need to be able to NULLIFY
+ ! TBH: alarmint at compile-time (F95 synax) to make this safe.
+!$$$TBH: see if F95 compile-time pointer-nullification is supported by all
+!$$$TBH: compilers we support
+ IF ( ASSOCIATED( alarm%alarmint ) ) THEN
+ IF ( alarm%alarmint%Enabled ) THEN
+ IF ( alarm%alarmint%RingIntervalSet ) THEN
+ pred1 = .FALSE. ; pred2 = .FALSE. ; pred3 = .FALSE.
+ ! alarm cannot ring if clock has passed the alarms stop time
+ IF ( alarm%alarmint%StopTimeSet ) THEN
+!MGD we probably want the same logic for before RingTime
+!MGD IF ( positive_timestep ) THEN
+! hack for bug in PGI 5.1-x
+! PRED1 = clock%clockint%CurrTime > alarm%alarmint%StopTime
+ PRED1 = ESMF_TimeGT( clock%clockint%CurrTime, &
+ alarm%alarmint%StopTime )
+!MGD ELSE
+!MGD ! in this case time step is negative and stop time is
+!MGD ! less than start time
+!MGD! PRED1 = clock%clockint%CurrTime < alarm%alarmint%StopTime
+!MGD PRED1 = ESMF_TimeLT( clock%clockint%CurrTime, &
+!MGD alarm%alarmint%StopTime )
+!MGD ENDIF
+ ELSE IF ( alarm%alarmint%RingTimeSet .AND. .NOT. PRED1) THEN
+!MGD IF ( positive_timestep ) THEN
+!MGD PRED1 = ESMF_TimeGT( clock%clockint%CurrTime, &
+!MGD alarm%alarmint%RingTime )
+!MGD ELSE
+ PRED1 = ESMF_TimeLT( clock%clockint%CurrTime, &
+ alarm%alarmint%RingTime )
+!MGD ENDIF
+ ENDIF
+ ! one-shot alarm: check for ring time
+! TBH: Need to remove duplicated code. Need to enforce only one of
+! TBH: alarm%alarmint%RingTimeSet or alarm%alarmint%RingIntervalSet ever
+! TBH: being .TRUE. and simplify the logic. Also, the simpler
+! TBH: implementation in the duplicated code below should be sufficient.
+ IF ( alarm%alarmint%RingTimeSet ) THEN
+ IF ( positive_timestep ) THEN
+! hack for bug in PGI 5.1-x
+! PRED2 = ( alarm%alarmint%RingTime <= clock%clockint%CurrTime &
+! .AND. clock%clockint%CurrTime < alarm%alarmint%RingTime + &
+! clock%clockint%TimeStep )
+ PRED2 = ( ESMF_TimeLE( alarm%alarmint%RingTime, &
+ clock%clockint%CurrTime ) &
+ .AND. ESMF_TimeLT( clock%clockint%CurrTime, &
+ ESMF_TimeInc( alarm%alarmint%RingTime, &
+ clock%clockint%TimeStep ) ) )
+ ELSE
+ ! in this case time step is negative and stop time is
+ ! less than start time
+! hack for bug in PGI 5.1-x
+! PRED2 = ( alarm%alarmint%RingTime >= clock%clockint%CurrTime &
+! .AND. clock%clockint%CurrTime > alarm%alarmint%RingTime + &
+! clock%clockint%TimeStep )
+ PRED2 = ( ESMF_TimeGE( alarm%alarmint%RingTime, &
+ clock%clockint%CurrTime ) &
+ .AND. ESMF_TimeGT( clock%clockint%CurrTime, &
+ ESMF_TimeInc( alarm%alarmint%RingTime, &
+ clock%clockint%TimeStep ) ) )
+ ENDIF
+ ENDIF
+ ! repeating alarm: check for ring interval
+ IF ( alarm%alarmint%RingIntervalSet ) THEN
+ IF ( positive_timestep ) THEN
+! hack for bug in PGI 5.1-x
+! PRED3 = ( alarm%alarmint%PrevRingTime + alarm%alarmint%RingInterval <= &
+! clock%clockint%CurrTime )
+
+ PRED3 = ( ESMF_TimeLE( ESMF_TimeInc( &
+ alarm%alarmint%PrevRingTime, &
+ alarm%alarmint%RingInterval ), &
+ clock%clockint%CurrTime ) )
+ ELSE
+ ! in this case time step is negative and stop time is
+ ! less than start time
+ ! ring interval must always be positive
+! hack for bug in PGI 5.1-x
+! PRED3 = ( alarm%alarmint%PrevRingTime - alarm%alarmint%RingInterval >= &
+! clock%clockint%CurrTime )
+
+ PRED3 = ( ESMF_TimeGE( ESMF_TimeDec( &
+ alarm%alarmint%PrevRingTime, &
+ alarm%alarmint%RingInterval ), &
+ clock%clockint%CurrTime ) )
+ ENDIF
+ ENDIF
+ IF ( (.NOT. pred1) .AND. pred2 ) THEN
+ alarm%alarmint%Ringing = .TRUE.
+ alarm%alarmint%PrevRingTime = clock%clockint%CurrTime
+! MGD do we really want the line below?
+! alarm%alarmint%RingTimeSet = .FALSE. !it is a one time alarm, it rang, now let it resort to interval
+ IF ( PRESENT( RingingAlarmList ) .AND. &
+ PRESENT ( NumRingingAlarms ) ) THEN
+ NumRingingAlarms = NumRingingAlarms + 1
+ RingingAlarmList( NumRingingAlarms ) = alarm
+ ENDIF
+ ELSE IF ( (.NOT. pred1) .AND. pred3 ) THEN
+ alarm%alarmint%Ringing = .TRUE.
+ IF ( positive_timestep ) THEN
+! hack for bug in PGI 5.1-x
+! IF ( PRED3) alarm%alarmint%PrevRingTime = alarm%alarmint%PrevRingTime + &
+! alarm%alarmint%RingInterval
+ IF ( PRED3 ) &
+ alarm%alarmint%PrevRingTime = &
+ ESMF_TimeInc( alarm%alarmint%PrevRingTime, &
+ alarm%alarmint%RingInterval )
+ ELSE
+ ! in this case time step is negative and stop time is
+ ! less than start time
+ ! ring interval must always be positive
+! hack for bug in PGI 5.1-x
+! IF ( PRED3) alarm%alarmint%PrevRingTime = alarm%alarmint%PrevRingTime - &
+! alarm%alarmint%RingInterval
+ IF ( PRED3 ) &
+ alarm%alarmint%PrevRingTime = &
+ ESMF_TimeDec( alarm%alarmint%PrevRingTime, &
+ alarm%alarmint%RingInterval )
+ ENDIF
+ IF ( PRESENT( RingingAlarmList ) .AND. &
+ PRESENT ( NumRingingAlarms ) ) THEN
+ NumRingingAlarms = NumRingingAlarms + 1
+ RingingAlarmList( NumRingingAlarms ) = alarm
+ ENDIF
+ ENDIF
+ ELSE IF ( alarm%alarmint%RingTimeSet ) THEN
+! TBH: Need to remove duplicated code. Need to enforce only one of
+! TBH: alarm%alarmint%RingTimeSet or alarm%alarmint%RingIntervalSet ever
+! TBH: being .TRUE. and simplify the logic. Also, the simpler
+! TBH: implementation in here should be sufficient.
+ IF ( positive_timestep ) THEN
+! hack for bug in PGI 5.1-x
+! IF ( alarm%alarmint%RingTime <= clock%clockint%CurrTime ) THEN
+ IF ( ESMF_TimeLE( alarm%alarmint%RingTime, &
+ clock%clockint%CurrTime ) ) THEN
+ alarm%alarmint%RingTimeSet = .FALSE. !it is a one time alarm, it rang, now let it resort to interval
+ alarm%alarmint%Ringing = .TRUE.
+ alarm%alarmint%PrevRingTime = clock%clockint%CurrTime
+ IF ( PRESENT( RingingAlarmList ) .AND. &
+ PRESENT ( NumRingingAlarms ) ) THEN
+ NumRingingAlarms = NumRingingAlarms + 1
+ RingingAlarmList( NumRingingAlarms ) = alarm
+ ENDIF
+ ENDIF
+ ELSE
+ ! in this case time step is negative and stop time is
+ ! less than start time
+! hack for bug in PGI 5.1-x
+! IF ( alarm%alarmint%RingTime >= clock%clockint%CurrTime ) THEN
+ IF ( ESMF_TimeGE( alarm%alarmint%RingTime, &
+ clock%clockint%CurrTime ) ) THEN
+ alarm%alarmint%RingTimeSet = .FALSE. !it is a one time alarm, it rang, now let it resort to interval
+ alarm%alarmint%Ringing = .TRUE.
+ alarm%alarmint%PrevRingTime = clock%clockint%CurrTime
+ IF ( PRESENT( RingingAlarmList ) .AND. &
+ PRESENT ( NumRingingAlarms ) ) THEN
+ NumRingingAlarms = NumRingingAlarms + 1
+ RingingAlarmList( NumRingingAlarms ) = alarm
+ ENDIF
+ ENDIF
+ ENDIF
+ ENDIF
+ IF ( alarm%alarmint%StopTimeSet ) THEN
+! TBH: what is this for???
+ ENDIF
+ ENDIF
+ ENDIF
+ clock%clockint%AlarmList(i) = alarm
+ ENDDO
+ IF ( PRESENT( rc ) ) rc = ESMF_SUCCESS
+
+ end subroutine ESMF_ClockAdvance
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_ClockStopTimeDisable - NOOP for compatibility with ESMF 2.1.0+
+
+! !INTERFACE:
+ subroutine ESMF_ClockStopTimeDisable(clock, rc)
+!
+! !ARGUMENTS:
+ type(ESMF_Clock), intent(in) :: clock
+ integer, intent(out), optional :: rc
+
+ rc = ESMF_SUCCESS
+
+ end subroutine ESMF_ClockStopTimeDisable
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_ClockIsStopTime - Has the clock reached its stop time ?
+
+! !INTERFACE:
+ function ESMF_ClockIsStopTime(clock, rc)
+!
+! !RETURN VALUE:
+ logical :: ESMF_ClockIsStopTime
+
+! !ARGUMENTS:
+ type(ESMF_Clock), intent(in) :: clock
+ integer, intent(out), optional :: rc
+ logical :: positive_timestep
+
+! !DESCRIPTION:
+! Return true if {\tt ESMF\_Clock} has reached its stop time, false
+! otherwise
+!
+! The arguments are:
+! \begin{description}
+! \item[clock]
+! The object instance to check
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+
+! !REQUIREMENTS:
+! TMG3.5.6
+!EOP
+
+ positive_timestep = ESMF_TimeIntervalIsPositive( clock%clockint%TimeStep )
+ IF ( positive_timestep ) THEN
+! hack for bug in PGI 5.1-x
+! if ( clock%clockint%CurrTime .GE. clock%clockint%StopTime ) THEN
+ if ( ESMF_TimeGE( clock%clockint%CurrTime, &
+ clock%clockint%StopTime ) ) THEN
+ ESMF_ClockIsStopTime = .TRUE.
+ else
+ ESMF_ClockIsStopTime = .FALSE.
+ endif
+ ELSE
+! hack for bug in PGI 5.1-x
+! if ( clock%clockint%CurrTime .LE. clock%clockint%StopTime ) THEN
+ if ( ESMF_TimeLE( clock%clockint%CurrTime, &
+ clock%clockint%StopTime ) ) THEN
+ ESMF_ClockIsStopTime = .TRUE.
+ else
+ ESMF_ClockIsStopTime = .FALSE.
+ endif
+ ENDIF
+ IF ( PRESENT( rc ) ) rc = ESMF_SUCCESS
+
+ end function ESMF_ClockIsStopTime
+
+!------------------------------------------------------------------------------
+!
+! This section defines the overridden Read, Write, Validate and Print methods
+! from the ESMF_Base class
+!
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_ClockRead - Restores a clock
+
+! !INTERFACE:
+ subroutine ESMF_ClockRead(clock, TimeStep, StartTime, StopTime, &
+ RefTime, CurrTime, PrevTime, AdvanceCount, &
+ AlarmList, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Clock), intent(out) :: clock
+ type(ESMF_TimeInterval), intent(in) :: TimeStep
+ type(ESMF_Time), intent(in) :: StartTime
+ type(ESMF_Time), intent(in) :: StopTime
+ type(ESMF_Time), intent(in) :: RefTime
+ type(ESMF_Time), intent(in) :: CurrTime
+ type(ESMF_Time), intent(in) :: PrevTime
+ integer(ESMF_KIND_I8), intent(in) :: AdvanceCount
+ type(ESMF_Alarm), dimension(MAX_ALARMS), intent(in) :: AlarmList
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Restore an {\tt ESMF\_Clock}
+!
+! The arguments are:
+! \begin{description}
+! \item[clock]
+! The object instance to restore
+! \item[TimeStep]
+! The {\tt ESMF\_Clock}'s time step interval
+! \item[StartTime]
+! The {\tt ESMF\_Clock}'s starting time
+! \item[StopTime]
+! The {\tt ESMF\_Clock}'s stopping time
+! \item[RefTime]
+! The {\tt ESMF\_Clock}'s reference time
+! \item[CurrTime]
+! The {\tt ESMF\_Clock}'s current time
+! \item[PrevTime]
+! The {\tt ESMF\_Clock}'s previous time
+! \item[AdvanceCount]
+! The number of times the {\tt ESMF\_Clock} has been advanced
+! \item[AlarmList]
+! The {\tt ESMF\_Clock}'s {\tt ESMF\_Alarm} list
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+!EOP
+ CALL wrf_error_fatal( 'ESMF_ClockRead not supported' )
+ end subroutine ESMF_ClockRead
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_ClockWrite - Saves a clock
+
+! !INTERFACE:
+ subroutine ESMF_ClockWrite(clock, TimeStep, StartTime, StopTime, &
+ RefTime, CurrTime, PrevTime, AdvanceCount, &
+ AlarmList, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Clock), intent(in) :: clock
+ type(ESMF_TimeInterval), intent(out) :: TimeStep
+ type(ESMF_Time), intent(out) :: StartTime
+ type(ESMF_Time), intent(out) :: StopTime
+ type(ESMF_Time), intent(out) :: RefTime
+ type(ESMF_Time), intent(out) :: CurrTime
+ type(ESMF_Time), intent(out) :: PrevTime
+ integer(ESMF_KIND_I8), intent(out) :: AdvanceCount
+ type(ESMF_Alarm), dimension(MAX_ALARMS), intent(out) :: AlarmList
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Save an {\tt ESMF\_Clock}
+!
+! The arguments are:
+! \begin{description}
+! \item[clock]
+! The object instance to save
+! \item[TimeStep]
+! The {\tt ESMF\_Clock}'s time step interval
+! \item[StartTime]
+! The {\tt ESMF\_Clock}'s starting time
+! \item[StopTime]
+! The {\tt ESMF\_Clock}'s stopping time
+! \item[RefTime]
+! The {\tt ESMF\_Clock}'s reference time
+! \item[CurrTime]
+! The {\tt ESMF\_Clock}'s current time
+! \item[PrevTime]
+! The {\tt ESMF\_Clock}'s previous time
+! \item[AdvanceCount]
+! The number of times the {\tt ESMF\_Clock} has been advanced
+! \item[AlarmList]
+! The {\tt ESMF\_Clock}'s {\tt ESMF\_Alarm} list
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+!EOP
+ CALL wrf_error_fatal( 'ESMF_ClockWrite not supported' )
+ end subroutine ESMF_ClockWrite
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_ClockValidate - Validate a Clock's properties
+
+! !INTERFACE:
+ subroutine ESMF_ClockValidate(clock, opts, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Clock), intent(in) :: clock
+ character (len=*), intent(in), optional :: opts
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! Perform a validation check on an {\tt ESMF\_Clock}'s properties
+!
+! The arguments are:
+! \begin{description}
+! \item[clock]
+! {\tt ESMF\_Clock} to validate
+! \item[{[opts]}]
+! Validate options
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMGn.n.n
+!EOP
+ CALL wrf_error_fatal( 'ESMF_ClockValidate not supported' )
+ end subroutine ESMF_ClockValidate
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_ClockPrint - Print out a Clock's properties
+
+! !INTERFACE:
+ subroutine ESMF_ClockPrint(clock, opts, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Clock), intent(in) :: clock
+ character (len=*), intent(in), optional :: opts
+ integer, intent(out), optional :: rc
+
+! !DESCRIPTION:
+! To support testing/debugging, print out an {\tt ESMF\_Clock}'s
+! properties.
+!
+! The arguments are:
+! \begin{description}
+! \item[clock]
+! {\tt ESMF\_Clock} to print out
+! \item[{[opts]}]
+! Print options
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMGn.n.n
+!EOP
+ CALL wrf_error_fatal( 'ESMF_ClockPrint not supported' )
+ end subroutine ESMF_ClockPrint
+
+!------------------------------------------------------------------------------
+
+ end module ESMF_ClockMod
Added: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_Fraction.F90
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_Fraction.F90         (rev 0)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_Fraction.F90        2012-11-29 22:23:06 UTC (rev 2329)
@@ -0,0 +1,79 @@
+!
+! Earth System Modeling Framework
+! Copyright 2002-2003, University Corporation for Atmospheric Research,
+! Massachusetts Institute of Technology, Geophysical Fluid Dynamics
+! Laboratory, University of Michigan, National Centers for Environmental
+! Prediction, Los Alamos National Laboratory, Argonne National Laboratory,
+! NASA Goddard Space Flight Center.
+! Licensed under the University of Illinois-NCSA license.
+!
+! ESMF Fraction Module
+!
+!==============================================================================
+!
+! ESMF Fraction Module
+ module ESMF_FractionMod
+!
+!==============================================================================
+!
+! This file contains the Fraction class definition and all Fraction
+! class methods.
+!
+!------------------------------------------------------------------------------
+! INCLUDES
+!
+!===============================================================================
+!BOPI
+!
+! !MODULE: ESMF_FractionMod
+!
+! !DESCRIPTION:
+! Part of ESMF F90 API wrapper of C++ implemenation
+!
+! Defines F90 wrapper entry points for corresponding
+! C++ implementaion of class {\tt ESMC\_Fraction}
+!
+! See {\tt ../include/ESMC\_Fraction.h} for complete description
+!
+!------------------------------------------------------------------------------
+! !USES:
+
+ implicit none
+!
+!------------------------------------------------------------------------------
+! !PRIVATE TYPES:
+ private
+!------------------------------------------------------------------------------
+! ! ESMF_Fraction
+!
+ type ESMF_Fraction
+ private
+ integer :: n ! Integer fraction (exact) n/d; numerator
+ integer :: d ! Integer fraction (exact) n/d; denominator
+ end type
+!
+!------------------------------------------------------------------------------
+! !PUBLIC TYPES:
+ public ESMF_Fraction
+!------------------------------------------------------------------------------
+!
+! !PUBLIC MEMBER FUNCTIONS:
+
+! !PRIVATE MEMBER FUNCTIONS:
+
+!EOPI
+
+!==============================================================================
+
+! contains
+
+!==============================================================================
+!
+! Wrappers to C++ fraction routines
+!
+!------------------------------------------------------------------------------
+!
+
+!------------------------------------------------------------------------------
+
+ end module ESMF_FractionMod
Added: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_Macros.inc
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_Macros.inc         (rev 0)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_Macros.inc        2012-11-29 22:23:06 UTC (rev 2329)
@@ -0,0 +1,35 @@
+#if 0
+
+Earth System Modeling Framework
+Copyright 2002-2003, University Corporation for Atmospheric Research,
+Massachusetts Institute of Technology, Geophysical Fluid Dynamics
+Laboratory, University of Michigan, National Centers for Environmental
+Prediction, Los Alamos National Laboratory, Argonne National Laboratory,
+NASA Goddard Space Flight Center.
+Licensed under the University of Illinois-NCSA license.
+
+Do not have C++ or F90 style comments in here because this file is processed
+by both C++ and F90 compilers.
+
+These lines prevent this file from being read more than once if it
+ends up being included multiple times.
+#endif
+
+#ifndef ESMF_MACROS_INC
+#define ESMF_MACROS_INC
+
+#if 0
+
+former file contents moved to ESMF_BaseMod
+so user code can be compiled without requiring
+the preprocessor.
+
+#endif
+
+#if 0
+i left the following macro here in case it is needed for our internal use.
+#endif
+
+#define ESMF_SRCLINE __FILE__, __LINE__
+
+#endif
Added: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_Mod.F90
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_Mod.F90         (rev 0)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_Mod.F90        2012-11-29 22:23:06 UTC (rev 2329)
@@ -0,0 +1,17 @@
+! TBH: This version is for use with the ESMF library embedded in the WRF
+! TBH: distribution.
+MODULE ESMF_Mod
+ USE esmf_alarmmod
+ USE esmf_basemod
+ USE esmf_basetimemod
+ USE esmf_calendarmod
+ USE esmf_clockmod
+ USE esmf_fractionmod
+ USE esmf_timeintervalmod
+ USE esmf_timemod
+ USE esmf_alarmclockmod
+ USE esmf_stubs ! add new dummy interfaces and typedefs here as needed
+#include <ESMF_TimeMgr.inc>
+ INTEGER, PARAMETER :: ESMF_MAX_ALARMS=MAX_ALARMS
+!
+END MODULE ESMF_Mod
Added: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_Stubs.F90
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_Stubs.F90         (rev 0)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_Stubs.F90        2012-11-29 22:23:06 UTC (rev 2329)
@@ -0,0 +1,136 @@
+! Various dummy type definitions and routines for the sole purpose of
+! mimicking newer ESMF interface features without necessarily implementing
+! them.
+
+MODULE ESMF_Stubs
+
+ IMPLICIT NONE
+
+ PRIVATE
+
+! Bogus typedefs
+ TYPE ESMF_Grid
+ INTEGER :: dummy
+ END TYPE
+
+ TYPE ESMF_GridComp
+ INTEGER :: dummy
+ END TYPE
+
+ TYPE ESMF_State
+ INTEGER :: dummy
+ END TYPE
+
+ TYPE ESMF_VM
+ INTEGER :: dummy
+ END TYPE
+
+ TYPE ESMF_MsgType
+ INTEGER :: mtype
+ END TYPE
+ TYPE(ESMF_MsgType), PARAMETER :: &
+ ESMF_LOG_INFO = ESMF_MsgType(1), &
+ ESMF_LOG_WARNING = ESMF_MsgType(2), &
+ ESMF_LOG_ERROR = ESMF_MsgType(3)
+
+ TYPE ESMF_LOG
+ INTEGER :: dummy
+ END TYPE
+
+ LOGICAL, private, save :: initialized = .false.
+
+ PUBLIC ESMF_Grid, ESMF_GridComp, ESMF_State, ESMF_VM
+ PUBLIC ESMF_Initialize, ESMF_Finalize, ESMF_IsInitialized
+ PUBLIC ESMF_LogWrite, ESMF_LOG, ESMF_MsgType
+ PUBLIC ESMF_LOG_INFO, ESMF_LOG_WARNING, ESMF_LOG_ERROR
+
+CONTAINS
+
+
+! NOOP
+ SUBROUTINE ESMF_Initialize( vm, defaultCalendar, rc )
+ USE esmf_basemod
+ USE esmf_calendarmod
+ TYPE(ESMF_VM), INTENT(IN ), OPTIONAL :: vm
+ TYPE(ESMF_CalendarType), INTENT(IN ), OPTIONAL :: defaultCalendar
+ INTEGER, INTENT( OUT), OPTIONAL :: rc
+
+ TYPE(ESMF_CalendarType) :: defaultCalType
+ INTEGER :: status
+
+ IF ( PRESENT( rc ) ) rc = ESMF_FAILURE
+ ! Initialize the default time manager calendar
+ IF ( PRESENT(defaultCalendar) )THEN
+ defaultCalType = defaultCalendar
+ ELSE
+ defaultCalType = ESMF_CAL_NOLEAP
+ END IF
+ allocate( defaultCal )
+ defaultCal = ESMF_CalendarCreate( calendarType=defaultCalType, &
+ rc=status)
+
+ ! initialize tables in time manager
+ CALL initdaym
+
+ IF (status .ne. ESMF_SUCCESS) THEN
+ PRINT *, "Error initializing the default time manager calendar"
+ RETURN
+ END IF
+ initialized = .true.
+
+ IF ( PRESENT( rc ) ) rc = ESMF_SUCCESS
+ END SUBROUTINE ESMF_Initialize
+
+
+ FUNCTION ESMF_IsInitialized()
+ LOGICAL ESMF_IsInitialized
+ ESMF_IsInitialized = initialized
+ END FUNCTION ESMF_IsInitialized
+
+
+! NOOP
+ SUBROUTINE ESMF_Finalize( rc )
+ USE esmf_basemod
+ USE esmf_calendarmod
+
+ INTEGER, INTENT( OUT), OPTIONAL :: rc
+#if (defined SPMD) || (defined COUP_CSM)
+#include <mpif.h>
+#endif
+ LOGICAL :: flag
+ INTEGER :: ier
+
+ CALL ESMF_CalendarDestroy()
+
+ IF ( PRESENT( rc ) ) rc = ESMF_SUCCESS
+#if (defined SPMD) || (defined COUP_CSM)
+ CALL MPI_Finalized( flag, ier )
+ IF ( ier .ne. mpi_success )THEN
+ IF ( PRESENT( rc ) ) rc = ESMF_FAILURE
+ END IF
+ IF ( .NOT. flag ) THEN
+ CALL MPI_Finalize( ier )
+ IF ( ier .ne. mpi_success )THEN
+ IF ( PRESENT( rc ) ) rc = ESMF_FAILURE
+ END IF
+ END IF
+#endif
+ END SUBROUTINE ESMF_Finalize
+
+! NOOP
+ SUBROUTINE ESMF_LogWrite( msg, MsgType, line, file, method, log, rc )
+ USE esmf_basemod
+ CHARACTER(LEN=*), INTENT(IN) :: msg
+ TYPE(ESMF_MsgType), INTENT(IN) :: msgtype
+ INTEGER, INTENT(IN), OPTIONAL :: line
+ CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: file
+ CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: method
+ TYPE(ESMF_LOG),TARGET,OPTIONAL :: log
+ INTEGER, INTENT(OUT),OPTIONAL :: rc
+ IF ( PRESENT( rc ) ) rc = ESMF_SUCCESS
+ END SUBROUTINE ESMF_LogWrite
+
+
+END MODULE ESMF_Stubs
+
+
Added: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_Time.F90
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_Time.F90         (rev 0)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_Time.F90        2012-11-29 22:23:06 UTC (rev 2329)
@@ -0,0 +1,1188 @@
+!
+! Earth System Modeling Framework
+! Copyright 2002-2003, University Corporation for Atmospheric Research,
+! Massachusetts Institute of Technology, Geophysical Fluid Dynamics
+! Laboratory, University of Michigan, National Centers for Environmental
+! Prediction, Los Alamos National Laboratory, Argonne National Laboratory,
+! NASA Goddard Space Flight Center.
+! Licensed under the University of Illinois-NCSA license.
+!
+!==============================================================================
+!
+! ESMF Time Module
+ module ESMF_TimeMod
+!
+!==============================================================================
+!
+! This file contains the Time class definition and all Time class methods.
+!
+!------------------------------------------------------------------------------
+! INCLUDES
+#include <ESMF_TimeMgr.inc>
+
+!==============================================================================
+!BOPI
+! !MODULE: ESMF_TimeMod
+!
+! !DESCRIPTION:
+! Part of Time Manager F90 API wrapper of C++ implemenation
+!
+! Defines F90 wrapper entry points for corresponding
+! C++ class {\tt ESMC\_Time} implementation
+!
+! See {\tt ../include/ESMC\_Time.h} for complete description
+!
+!------------------------------------------------------------------------------
+! !USES:
+ ! inherit from ESMF base class
+ use ESMF_BaseMod
+
+ ! inherit from base time class
+ use ESMF_BaseTimeMod
+
+ ! associated derived types
+ use ESMF_TimeIntervalMod
+ use ESMF_CalendarMod
+ use ESMF_Stubs
+
+ implicit none
+!
+!------------------------------------------------------------------------------
+! !PRIVATE TYPES:
+ private
+!------------------------------------------------------------------------------
+! ! ESMF_Time
+!
+! ! F90 class type to match C++ Time class in size only;
+! ! all dereferencing within class is performed by C++ implementation
+
+ type ESMF_Time
+ type(ESMF_BaseTime) :: basetime ! inherit base class
+ ! time instant is expressed as year + basetime
+ integer :: YR
+ type(ESMF_Calendar), pointer :: calendar ! associated calendar
+ end type
+
+!------------------------------------------------------------------------------
+! !PUBLIC TYPES:
+ public ESMF_Time
+!------------------------------------------------------------------------------
+!
+! !PUBLIC MEMBER FUNCTIONS:
+ public ESMF_TimeGet
+ public ESMF_TimeSet
+
+! Required inherited and overridden ESMF_Base class methods
+
+ public ESMF_TimeCopy
+
+! !PRIVATE MEMBER FUNCTIONS:
+
+ private ESMF_TimeGetDayOfYear
+ private ESMF_TimeGetDayOfYearInteger
+
+! Inherited and overloaded from ESMF_BaseTime
+
+ ! NOTE: ESMF_TimeInc, ESMF_TimeDec, ESMF_TimeDiff, ESMF_TimeEQ,
+ ! ESMF_TimeNE, ESMF_TimeLT, ESMF_TimeGT, ESMF_TimeLE, and
+ ! ESMF_TimeGE are PUBLIC only to work around bugs in the
+ ! PGI 5.1-x compilers. They should all be PRIVATE.
+
+ public operator(+)
+ public ESMF_TimeInc
+
+ public operator(-)
+ public ESMF_TimeDec
+ public ESMF_TimeDec2
+ public ESMF_TimeDiff
+
+ public operator(.EQ.)
+ public ESMF_TimeEQ
+
+ public operator(.NE.)
+ public ESMF_TimeNE
+
+ public operator(.LT.)
+ public ESMF_TimeLT
+
+ public operator(.GT.)
+ public ESMF_TimeGT
+
+ public operator(.LE.)
+ public ESMF_TimeLE
+
+ public operator(.GE.)
+ public ESMF_TimeGE
+
+!EOPI
+
+!==============================================================================
+!
+! INTERFACE BLOCKS
+!
+!==============================================================================
+!BOP
+! !INTERFACE:
+ interface ESMF_TimeGetDayOfYear
+
+! !PRIVATE MEMBER FUNCTIONS:
+ module procedure ESMF_TimeGetDayOfYearInteger
+
+! !DESCRIPTION:
+! This interface overloads the {\tt ESMF\_GetDayOfYear} method
+! for the {\tt ESMF\_Time} class
+!
+!EOP
+ end interface
+!
+!------------------------------------------------------------------------------
+!BOP
+! !INTERFACE:
+ interface operator(+)
+
+! !PRIVATE MEMBER FUNCTIONS:
+ module procedure ESMF_TimeInc, ESMF_TimeInc2
+
+! !DESCRIPTION:
+! This interface overloads the + operator for the {\tt ESMF\_Time} class
+!
+!EOP
+ end interface
+!
+!------------------------------------------------------------------------------
+!BOP
+! !INTERFACE:
+ interface assignment (=)
+
+! !PRIVATE MEMBER FUNCTIONS:
+ module procedure ESMF_TimeCopy
+
+! !DESCRIPTION:
+! This interface overloads the = operator for the {\tt ESMF\_Time} class
+!
+!EOP
+ end interface
+!
+!------------------------------------------------------------------------------
+!BOP
+! !INTERFACE:
+ interface operator(-)
+
+! !PRIVATE MEMBER FUNCTIONS:
+ module procedure ESMF_TimeDec, ESMF_TimeDec2
+
+! !DESCRIPTION:
+! This interface overloads the - operator for the {\tt ESMF\_Time} class
+!
+!EOP
+ end interface
+!
+!------------------------------------------------------------------------------
+!BOP
+! !INTERFACE:
+ interface operator(-)
+
+! !PRIVATE MEMBER FUNCTIONS:
+ module procedure ESMF_TimeDiff
+
+! !DESCRIPTION:
+! This interface overloads the - operator for the {\tt ESMF\_Time} class
+!
+!EOP
+ end interface
+!
+!------------------------------------------------------------------------------
+!BOP
+! !INTERFACE:
+ interface operator(.EQ.)
+
+! !PRIVATE MEMBER FUNCTIONS:
+ module procedure ESMF_TimeEQ
+
+! !DESCRIPTION:
+! This interface overloads the .EQ. operator for the {\tt ESMF\_Time} class
+!
+!EOP
+ end interface
+!
+!------------------------------------------------------------------------------
+!BOP
+! !INTERFACE:
+ interface operator(.NE.)
+
+! !PRIVATE MEMBER FUNCTIONS:
+ module procedure ESMF_TimeNE
+
+! !DESCRIPTION:
+! This interface overloads the .NE. operator for the {\tt ESMF\_Time} class
+!
+!EOP
+ end interface
+!
+!------------------------------------------------------------------------------
+!BOP
+! !INTERFACE:
+ interface operator(.LT.)
+
+! !PRIVATE MEMBER FUNCTIONS:
+ module procedure ESMF_TimeLT
+
+! !DESCRIPTION:
+! This interface overloads the .LT. operator for the {\tt ESMF\_Time} class
+!
+!EOP
+ end interface
+!
+!------------------------------------------------------------------------------
+!BOP
+! !INTERFACE:
+ interface operator(.GT.)
+
+! !PRIVATE MEMBER FUNCTIONS:
+ module procedure ESMF_TimeGT
+
+! !DESCRIPTION:
+! This interface overloads the .GT. operator for the {\tt ESMF\_Time} class
+!
+!EOP
+ end interface
+!
+!------------------------------------------------------------------------------
+!BOP
+! !INTERFACE:
+ interface operator(.LE.)
+
+! !PRIVATE MEMBER FUNCTIONS:
+ module procedure ESMF_TimeLE
+
+! !DESCRIPTION:
+! This interface overloads the .LE. operator for the {\tt ESMF\_Time} class
+!
+!EOP
+ end interface
+!
+!------------------------------------------------------------------------------
+!BOP
+! !INTERFACE:
+ interface operator(.GE.)
+
+! !PRIVATE MEMBER FUNCTIONS:
+ module procedure ESMF_TimeGE
+
+! !DESCRIPTION:
+! This interface overloads the .GE. operator for the {\tt ESMF\_Time} class
+!
+!EOP
+ end interface
+!
+!------------------------------------------------------------------------------
+
+!==============================================================================
+
+ contains
+
+!==============================================================================
+!
+! Generic Get/Set routines which use F90 optional arguments
+!
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_TimeGet - Get value in user-specified units
+
+! !INTERFACE:
+ subroutine ESMF_TimeGet(time, YY, YRl, MM, DD, D, Dl, H, M, S, Sl, MS, &
+ US, NS, d_, h_, m_, s_, ms_, us_, ns_, Sn, Sd, &
+ dayOfYear, dayOfYear_r8, dayOfYear_intvl, &
+ timeString, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Time), intent(in) :: time
+ integer, intent(out), optional :: YY
+ integer(ESMF_KIND_I8), intent(out), optional :: YRl
+ integer, intent(out), optional :: MM
+ integer, intent(out), optional :: DD
+ integer, intent(out), optional :: D
+ integer(ESMF_KIND_I8), intent(out), optional :: Dl
+ integer, intent(out), optional :: H
+ integer, intent(out), optional :: M
+ integer, intent(out), optional :: S
+ integer(ESMF_KIND_I8), intent(out), optional :: Sl
+ integer, intent(out), optional :: MS
+ integer, intent(out), optional :: US
+ integer, intent(out), optional :: NS
+ double precision, intent(out), optional :: d_
+ double precision, intent(out), optional :: h_
+ double precision, intent(out), optional :: m_
+ double precision, intent(out), optional :: s_
+ double precision, intent(out), optional :: ms_
+ double precision, intent(out), optional :: us_
+ double precision, intent(out), optional :: ns_
+ integer, intent(out), optional :: Sn
+ integer, intent(out), optional :: Sd
+ integer, intent(out), optional :: dayOfYear
+ ! dayOfYear_r8 = 1.0 at 0Z on 1 January, 1.5 at 12Z on
+ ! 1 January, etc.
+ real(ESMF_KIND_R8), intent(out), optional :: dayOfYear_r8
+ character (len=*), intent(out), optional :: timeString
+ type(ESMF_TimeInterval), intent(out), optional :: dayOfYear_intvl
+ integer, intent(out), optional :: rc
+
+ type(ESMF_TimeInterval) :: day_step
+ integer :: ierr
+
+! !DESCRIPTION:
+! Get the value of the {\tt ESMF\_Time} in units specified by the user
+! via F90 optional arguments.
+!
+! Time manager represents and manipulates time internally with integers
+! to maintain precision. Hence, user-specified floating point values are
+! converted internally from integers.
+!
+! See {\tt ../include/ESMC\_BaseTime.h and ../include/ESMC\_Time.h} for
+! complete description.
+!
+! The arguments are:
+! \begin{description}
+! \item[time]
+! The object instance to query
+! \item[{[YY]}]
+! Integer year CCYR (>= 32-bit)
+! \item[{[YRl]}]
+! Integer year CCYR (large, >= 64-bit)
+! \item[{[MM]}]
+! Integer month 1-12
+! \item[{[DD]}]
+! Integer day of the month 1-31
+! \item[{[D]}]
+! Integer Julian days (>= 32-bit)
+! \item[{[Dl]}]
+! Integer Julian days (large, >= 64-bit)
+! \item[{[H]}]
+! Integer hours
+! \item[{[M]}]
+! Integer minutes
+! \item[{[S]}]
+! Integer seconds (>= 32-bit)
+! \item[{[Sl]}]
+! Integer seconds (large, >= 64-bit)
+! \item[{[MS]}]
+! Integer milliseconds
+! \item[{[US]}]
+! Integer microseconds
+! \item[{[NS]}]
+! Integer nanoseconds
+! \item[{[d\_]}]
+! Double precision days
+! \item[{[h\_]}]
+! Double precision hours
+! \item[{[m\_]}]
+! Double precision minutes
+! \item[{[s\_]}]
+! Double precision seconds
+! \item[{[ms\_]}]
+! Double precision milliseconds
+! \item[{[us\_]}]
+! Double precision microseconds
+! \item[{[ns\_]}]
+! Double precision nanoseconds
+! \item[{[Sn]}]
+! Integer fractional seconds - numerator
+! \item[{[Sd]}]
+! Integer fractional seconds - denominator
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG2.1, TMG2.5.1, TMG2.5.6
+!EOP
+ TYPE(ESMF_Time) :: begofyear
+ INTEGER :: year, month, dayofmonth, hour, minute, second
+ REAL(ESMF_KIND_R8) :: rsec
+
+ ierr = ESMF_SUCCESS
+
+ IF ( PRESENT( YY ) ) THEN
+ YY = time%YR
+ ENDIF
+ IF ( PRESENT( MM ) ) THEN
+ CALL timegetmonth( time, MM )
+ ENDIF
+ IF ( PRESENT( DD ) ) THEN
+ CALL timegetdayofmonth( time, DD )
+ ENDIF
+!
+!$$$ Push HMS down into ESMF_BaseTime from EVERYWHERE
+!$$$ and THEN add ESMF scaling behavior when other args are present...
+ IF ( PRESENT( H ) ) THEN
+ H = mod( time%basetime%S, SECONDS_PER_DAY ) / SECONDS_PER_HOUR
+ ENDIF
+ IF ( PRESENT( M ) ) THEN
+ M = mod( time%basetime%S, SECONDS_PER_HOUR) / SECONDS_PER_MINUTE
+ ENDIF
+ IF ( PRESENT( S ) ) THEN
+ S = mod( time%basetime%S, SECONDS_PER_MINUTE )
+ ENDIF
+ ! TBH: HACK to allow DD and S to behave as in ESMF 2.1.0+ when
+ ! TBH: both are present and H and M are not.
+ IF ( PRESENT( S ) .AND. PRESENT( DD ) ) THEN
+ IF ( ( .NOT. PRESENT( H ) ) .AND. ( .NOT. PRESENT( M ) ) ) THEN
+ S = mod( time%basetime%S, SECONDS_PER_DAY )
+ ENDIF
+ ENDIF
+ IF ( PRESENT( MS ) ) THEN
+ IF ( time%basetime%Sd /= 0 ) THEN
+ MS = NINT( ( time%basetime%Sn*1.0D0 / time%basetime%Sd*1.0D0 ) * 1000.0D0 )
+ ELSE
+ MS = 0
+ ENDIF
+ ENDIF
+ IF ( PRESENT( Sd ) .AND. PRESENT( Sn ) ) THEN
+ Sd = time%basetime%Sd
+ Sn = time%basetime%Sn
+ ENDIF
+ IF ( PRESENT( dayOfYear ) ) THEN
+ CALL ESMF_TimeGetDayOfYear( time, dayOfYear, rc=ierr )
+ ENDIF
+ IF ( PRESENT( dayOfYear_r8 ) ) THEN
+ ! 64-bit IEEE 754 has 52-bit mantisssa -- only need 25 bits to hold
+ ! number of seconds in a year...
+ rsec = REAL( time%basetime%S, ESMF_KIND_R8 )
+ IF ( time%basetime%Sd /= 0 ) THEN
+ rsec = rsec + ( REAL( time%basetime%Sn, ESMF_KIND_R8 ) / &
+ REAL( time%basetime%Sd, ESMF_KIND_R8 ) )
+ ENDIF
+ dayOfYear_r8 = rsec / REAL( SECONDS_PER_DAY, ESMF_KIND_R8 )
+ ! start at 1
+ dayOfYear_r8 = dayOfYear_r8 + 1.0_ESMF_KIND_R8
+ ENDIF
+ IF ( PRESENT( timeString ) ) THEN
+ ! This duplication for YMD is an optimization that avoids calling
+ ! timegetmonth() and timegetdayofmonth() when it is not needed.
+ year = time%YR
+ CALL timegetmonth( time, month )
+ CALL timegetdayofmonth( time, dayofmonth )
+!$$$ push HMS down into ESMF_BaseTime
+ hour = mod( time%basetime%S, SECONDS_PER_DAY ) / SECONDS_PER_HOUR
+ minute = mod( time%basetime%S, SECONDS_PER_HOUR) / SECONDS_PER_MINUTE
+ second = mod( time%basetime%S, SECONDS_PER_MINUTE )
+ CALL ESMFold_TimeGetString( year, month, dayofmonth, &
+ hour, minute, second, timeString )
+ ENDIF
+ IF ( PRESENT( dayOfYear_intvl ) ) THEN
+ year = time%YR
+ CALL ESMF_TimeSet( begofyear, yy=year, mm=1, dd=1, s=0, &
+ calendar=time%calendar, rc=ierr )
+ IF ( ierr == ESMF_FAILURE)THEN
+ rc = ierr
+ RETURN
+ END IF
+ CALL ESMF_TimeIntervalSet( day_step, d=1, s=0, rc=ierr )
+ dayOfYear_intvl = time - begofyear + day_step
+ ENDIF
+
+ IF ( PRESENT( rc ) ) THEN
+ rc = ierr
+ ENDIF
+
+ end subroutine ESMF_TimeGet
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_TimeSet - Initialize via user-specified unit set
+
+! !INTERFACE:
+ subroutine ESMF_TimeSet(time, YY, YRl, MM, DD, D, Dl, H, M, S, Sl, &
+ MS, US, NS, d_, h_, m_, s_, ms_, us_, ns_, &
+ Sn, Sd, calendar, rc)
+
+! !ARGUMENTS:
+ type(ESMF_Time), intent(inout) :: time
+ integer, intent(in), optional :: YY
+ integer(ESMF_KIND_I8), intent(in), optional :: YRl
+ integer, intent(in), optional :: MM
+ integer, intent(in), optional :: DD
+ integer, intent(in), optional :: D
+ integer(ESMF_KIND_I8), intent(in), optional :: Dl
+ integer, intent(in), optional :: H
+ integer, intent(in), optional :: M
+ integer, intent(in), optional :: S
+ integer(ESMF_KIND_I8), intent(in), optional :: Sl
+ integer, intent(in), optional :: MS
+ integer, intent(in), optional :: US
+ integer, intent(in), optional :: NS
+ double precision, intent(in), optional :: d_
+ double precision, intent(in), optional :: h_
+ double precision, intent(in), optional :: m_
+ double precision, intent(in), optional :: s_
+ double precision, intent(in), optional :: ms_
+ double precision, intent(in), optional :: us_
+ double precision, intent(in), optional :: ns_
+ integer, intent(in), optional :: Sn
+ integer, intent(in), optional :: Sd
+ type(ESMF_Calendar), intent(in), target, optional :: calendar
+ integer, intent(out), optional :: rc
+ ! locals
+ INTEGER :: ierr
+
+! !DESCRIPTION:
+! Initializes a {\tt ESMF\_Time} with a set of user-specified units
+! via F90 optional arguments.
+!
+! Time manager represents and manipulates time internally with integers
+! to maintain precision. Hence, user-specified floating point values are
+! converted internally to integers.
+!
+! See {\tt ../include/ESMC\_BaseTime.h and ../include/ESMC\_Time.h} for
+! complete description.
+!
+! The arguments are:
+! \begin{description}
+! \item[time]
+! The object instance to initialize
+! \item[{[YY]}]
+! Integer year CCYR (>= 32-bit)
+! \item[{[YRl]}]
+! Integer year CCYR (large, >= 64-bit)
+! \item[{[MM]}]
+! Integer month 1-12
+! \item[{[DD]}]
+! Integer day of the month 1-31
+! \item[{[D]}]
+! Integer Julian days (>= 32-bit)
+! \item[{[Dl]}]
+! Integer Julian days (large, >= 64-bit)
+! \item[{[H]}]
+! Integer hours
+! \item[{[M]}]
+! Integer minutes
+! \item[{[S]}]
+! Integer seconds (>= 32-bit)
+! \item[{[Sl]}]
+! Integer seconds (large, >= 64-bit)
+! \item[{[MS]}]
+! Integer milliseconds
+! \item[{[US]}]
+! Integer microseconds
+! \item[{[NS]}]
+! Integer nanoseconds
+! \item[{[d\_]}]
+! Double precision days
+! \item[{[h\_]}]
+! Double precision hours
+! \item[{[m\_]}]
+! Double precision minutes
+! \item[{[s\_]}]
+! Double precision seconds
+! \item[{[ms\_]}]
+! Double precision milliseconds
+! \item[{[us\_]}]
+! Double precision microseconds
+! \item[{[ns\_]}]
+! Double precision nanoseconds
+! \item[{[Sn]}]
+! Integer fractional seconds - numerator
+! \item[{[Sd]}]
+! Integer fractional seconds - denominator
+! \item[{[cal]}]
+! Associated {\tt Calendar}
+! \item[{[tz]}]
+! Associated timezone (hours offset from GMT, e.g. EST = -5)
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMGn.n.n
+!EOP
+! PRINT *,'DEBUG: BEGIN ESMF_TimeSet()'
+!$$$ push this down into ESMF_BaseTime constructor
+ time%basetime%S = 0
+ time%basetime%Sn = 0
+ time%basetime%Sd = 0
+
+ IF ( PRESENT( rc ) ) rc = ESMF_FAILURE
+ time%YR = 0
+ IF ( PRESENT( YY ) ) THEN
+! PRINT *,'DEBUG: ESMF_TimeSet(): YY = ',YY
+ time%YR = YY
+ ENDIF
+ IF ( PRESENT( MM ) ) THEN
+! PRINT *,'DEBUG: ESMF_TimeSet(): MM = ',MM
+ CALL timeaddmonths( time, MM, ierr )
+ IF ( ierr == ESMF_FAILURE ) THEN
+ IF ( PRESENT( rc ) ) THEN
+ rc = ESMF_FAILURE
+ RETURN
+ ENDIF
+ ENDIF
+! PRINT *,'DEBUG: ESMF_TimeSet(): back from timeaddmonths'
+ ENDIF
+ IF ( PRESENT( DD ) ) THEN
+!$$$ no check for DD in range of days of month MM yet
+!$$$ Must separate D and DD for correct interface!
+! PRINT *,'DEBUG: ESMF_TimeSet(): DD = ',DD
+ time%basetime%S = time%basetime%S + &
+ ( SECONDS_PER_DAY * INT( (DD-1), ESMF_KIND_I8 ) )
+ ENDIF
+!$$$ push H,M,S,Sn,Sd,MS down into ESMF_BaseTime constructor
+ IF ( PRESENT( H ) ) THEN
+! PRINT *,'DEBUG: ESMF_TimeSet(): H = ',H
+ time%basetime%S = time%basetime%S + &
+ ( SECONDS_PER_HOUR * INT( H, ESMF_KIND_I8 ) )
+ ENDIF
+ IF ( PRESENT( M ) ) THEN
+! PRINT *,'DEBUG: ESMF_TimeSet(): M = ',M
+ time%basetime%S = time%basetime%S + &
+ ( SECONDS_PER_MINUTE * INT( M, ESMF_KIND_I8 ) )
+ ENDIF
+ IF ( PRESENT( S ) ) THEN
+! PRINT *,'DEBUG: ESMF_TimeSet(): S = ',S
+ time%basetime%S = time%basetime%S + &
+ INT( S, ESMF_KIND_I8 )
+ ENDIF
+ IF ( PRESENT( Sn ) .AND. ( .NOT. PRESENT( Sd ) ) ) THEN
+ CALL wrf_error_fatal( &
+ "ESMF_TimeSet: Must specify Sd if Sn is specified")
+ ENDIF
+ IF ( PRESENT( Sd ) .AND. PRESENT( MS ) ) THEN
+ CALL wrf_error_fatal( &
+ "ESMF_TimeSet: Must not specify both Sd and MS")
+ ENDIF
+ time%basetime%Sn = 0
+ time%basetime%Sd = 0
+ IF ( PRESENT( MS ) ) THEN
+! PRINT *,'DEBUG: ESMF_TimeSet(): MS = ',MS
+ time%basetime%Sn = MS
+ time%basetime%Sd = 1000_ESMF_KIND_I8
+ ELSE IF ( PRESENT( Sd ) ) THEN
+! PRINT *,'DEBUG: ESMF_TimeSet(): Sd = ',Sd
+ time%basetime%Sd = Sd
+ IF ( PRESENT( Sn ) ) THEN
+! PRINT *,'DEBUG: ESMF_TimeSet(): Sn = ',Sn
+ time%basetime%Sn = Sn
+ ENDIF
+ ENDIF
+ IF ( PRESENT(calendar) )THEN
+! PRINT *,'DEBUG: ESMF_TimeSet(): using passed-in calendar'
+! Note that the ugly hack of wrapping the call to ESMF_CalendarInitialized()
+! inside this #ifdef is due to lack of support for compile-time initialization
+! of components of Fortran derived types. Some older compilers like PGI 5.1-x
+! do not support this F95 feature. In this case we only lose a safety check.
+#ifndef NO_DT_COMPONENT_INIT
+ IF ( .not. ESMF_CalendarInitialized( calendar ) )THEN
+ call wrf_error_fatal( "Error:: ESMF_CalendarCreate not "// &
+ "called on input Calendar")
+ END IF
+#endif
+ time%Calendar => calendar
+ ELSE
+! PRINT *,'DEBUG: ESMF_TimeSet(): using default calendar'
+ IF ( .not. ESMF_IsInitialized() )THEN
+ call wrf_error_fatal( "Error:: ESMF_Initialize not called")
+ END IF
+ time%Calendar => defaultCal
+ END IF
+
+! PRINT *,'DEBUG: ESMF_TimeSet(): calling normalize_time()'
+!$$$DEBUG
+!IF ( time%basetime%Sd > 0 ) THEN
+! PRINT *,'DEBUG ESMF_TimeSet() before normalize: S,Sn,Sd = ', &
+! time%basetime%S, time%basetime%Sn, time%basetime%Sd
+!ENDIF
+!$$$END DEBUG
+ CALL normalize_time( time )
+!$$$DEBUG
+!IF ( time%basetime%Sd > 0 ) THEN
+! PRINT *,'DEBUG ESMF_TimeSet() after normalize: S,Sn,Sd = ', &
+! time%basetime%S, time%basetime%Sn, time%basetime%Sd
+!ENDIF
+!$$$END DEBUG
+
+! PRINT *,'DEBUG: ESMF_TimeSet(): back from normalize_time()'
+ IF ( PRESENT( rc ) ) THEN
+ rc = ESMF_SUCCESS
+ ENDIF
+
+ end subroutine ESMF_TimeSet
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMFold_TimeGetString - Get time instant value in string format
+
+! !INTERFACE:
+ subroutine ESMFold_TimeGetString( year, month, dayofmonth, &
+ hour, minute, second, TimeString )
+
+! !ARGUMENTS:
+ integer, intent(in) :: year
+ integer, intent(in) :: month
+ integer, intent(in) :: dayofmonth
+ integer, intent(in) :: hour
+ integer, intent(in) :: minute
+ integer, intent(in) :: second
+ character*(*), intent(out) :: TimeString
+! !DESCRIPTION:
+! Convert {\tt ESMF\_Time}'s value into ISO 8601 format YYYY-MM-DDThh:mm:ss
+!
+! The arguments are:
+! \begin{description}
+! \item[time]
+! The object instance to convert
+! \item[TimeString]
+! The string to return
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG2.4.7
+!EOP
+
+!PRINT *,'DEBUG: ESMF_TimePrint(): YR,S,Sn,Sd = ',time%YR,time%basetime%S,time%basetime%Sn,time%basetime%Sd
+!PRINT *,'DEBUG: ESMF_TimePrint(): year = ',year
+!PRINT *,'DEBUG: ESMF_TimePrint(): month, dayofmonth = ',month,dayofmonth
+!PRINT *,'DEBUG: ESMF_TimePrint(): hour = ',hour
+!PRINT *,'DEBUG: ESMF_TimePrint(): minute = ',minute
+!PRINT *,'DEBUG: ESMF_TimePrint(): second = ',second
+
+!$$$here... add negative sign for YR<0
+!$$$here... add Sn, Sd ??
+#ifdef PLANET
+ write(TimeString,FMT="(I4.4,'-',I5.5,'_',I2.2,':',I2.2,':',I2.2)") &
+ year,dayofmonth,hour,minute,second
+#else
+ write(TimeString,FMT="(I4.4,'-',I2.2,'-',I2.2,'_',I2.2,':',I2.2,':',I2.2)") &
+ year,month,dayofmonth,hour,minute,second
+#endif
+
+ end subroutine ESMFold_TimeGetString
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_TimeGetDayOfYearInteger - Get time instant's day of the year as an integer value
+!
+! !INTERFACE:
+ subroutine ESMF_TimeGetDayOfYearInteger(time, DayOfYear, rc)
+!
+! !ARGUMENTS:
+ type(ESMF_Time), intent(in) :: time
+ integer, intent(out) :: DayOfYear
+ integer, intent(out), optional :: rc
+!
+! !DESCRIPTION:
+! Get the day of the year the given {\tt ESMF\_Time} instant falls on
+! (1-365). Returned as an integer value
+!
+! The arguments are:
+! \begin{description}
+! \item[time]
+! The object instance to query
+! \item[DayOfYear]
+! The {\tt ESMF\_Time} instant's day of the year (1-365)
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+!EOP
+ ! requires that time be normalized
+!$$$ bug when Sn>0? test
+!$$$ add tests
+ DayOfYear = ( time%basetime%S / SECONDS_PER_DAY ) + 1
+ IF ( PRESENT( rc ) ) rc = ESMF_SUCCESS
+ end subroutine ESMF_TimeGetDayOfYearInteger
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_TimeInc - Increment time instant with a time interval
+!
+! !INTERFACE:
+ function ESMF_TimeInc(time, timeinterval)
+!
+! !RETURN VALUE:
+ type(ESMF_Time) :: ESMF_TimeInc
+!
+! !ARGUMENTS:
+ type(ESMF_Time), intent(in) :: time
+ type(ESMF_TimeInterval), intent(in) :: timeinterval
+! !LOCAL:
+ integer :: rc
+!
+! !DESCRIPTION:
+! Increment {\tt ESMF\_Time} instant with a {\tt ESMF\_TimeInterval},
+! return resulting {\tt ESMF\_Time} instant
+!
+! Maps overloaded (+) operator interface function to
+! {\tt ESMF\_BaseTime} base class
+!
+! The arguments are:
+! \begin{description}
+! \item[time]
+! The given {\tt ESMF\_Time} to increment
+! \item[timeinterval]
+! The {\tt ESMF\_TimeInterval} to add to the given {\tt ESMF\_Time}
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG1.5.4, TMG2.4.4, TMG2.4.5, TMG2.4.6, TMG5.1, TMG5.2, TMG7.2
+!EOP
+
+ ! copy ESMF_Time specific properties (e.g. calendar, timezone)
+ ESMF_TimeInc = time
+
+ ! call ESMC_BaseTime base class function
+ call c_ESMC_BaseTimeSum(time, timeinterval, ESMF_TimeInc)
+
+ end function ESMF_TimeInc
+!
+! this is added for certain compilers that don't deal with commutativity
+!
+ function ESMF_TimeInc2(timeinterval, time)
+ type(ESMF_Time) :: ESMF_TimeInc2
+ type(ESMF_Time), intent(in) :: time
+ type(ESMF_TimeInterval), intent(in) :: timeinterval
+ ESMF_TimeInc2 = ESMF_TimeInc( time, timeinterval )
+ end function ESMF_TimeInc2
+!
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_TimeDec - Decrement time instant with a time interval
+!
+! !INTERFACE:
+ function ESMF_TimeDec(time, timeinterval)
+!
+! !RETURN VALUE:
+ type(ESMF_Time) :: ESMF_TimeDec
+!
+! !ARGUMENTS:
+ type(ESMF_Time), intent(in) :: time
+ type(ESMF_TimeInterval), intent(in) :: timeinterval
+! !LOCAL:
+ integer :: rc
+!
+! !DESCRIPTION:
+! Decrement {\tt ESMF\_Time} instant with a {\tt ESMF\_TimeInterval},
+! return resulting {\tt ESMF\_Time} instant
+!
+! Maps overloaded (-) operator interface function to
+! {\tt ESMF\_BaseTime} base class
+!
+! The arguments are:
+! \begin{description}
+! \item[time]
+! The given {\tt ESMF\_Time} to decrement
+! \item[timeinterval]
+! The {\tt ESMF\_TimeInterval} to subtract from the given
+! {\tt ESMF\_Time}
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG1.5.4, TMG2.4.4, TMG2.4.5, TMG2.4.6, TMG5.1, TMG5.2, TMG7.2
+!EOP
+
+ ! copy ESMF_Time specific properties (e.g. calendar, timezone)
+ ESMF_TimeDec = time
+
+ ! call ESMC_BaseTime base class function
+ call c_ESMC_BaseTimeDec(time, timeinterval, ESMF_TimeDec)
+
+ end function ESMF_TimeDec
+
+!
+! this is added for certain compilers that don't deal with commutativity
+!
+ function ESMF_TimeDec2(timeinterval, time)
+ type(ESMF_Time) :: ESMF_TimeDec2
+ type(ESMF_Time), intent(in) :: time
+ type(ESMF_TimeInterval), intent(in) :: timeinterval
+ ESMF_TimeDec2 = ESMF_TimeDec( time, timeinterval )
+ end function ESMF_TimeDec2
+!
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_TimeDiff - Return the difference between two time instants
+!
+! !INTERFACE:
+ function ESMF_TimeDiff(time1, time2)
+!
+! !RETURN VALUE:
+ type(ESMF_TimeInterval) :: ESMF_TimeDiff
+!
+! !ARGUMENTS:
+ type(ESMF_Time), intent(in) :: time1
+ type(ESMF_Time), intent(in) :: time2
+! !LOCAL:
+ integer :: rc
+
+! !DESCRIPTION:
+! Return the {\tt ESMF\_TimeInterval} difference between two
+! {\tt ESMF\_Time} instants
+!
+! Maps overloaded (-) operator interface function to
+! {\tt ESMF\_BaseTime} base class
+!
+! The arguments are:
+! \begin{description}
+! \item[time1]
+! The first {\tt ESMF\_Time} instant
+! \item[time2]
+! The second {\tt ESMF\_Time} instant
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG1.5.4, TMG2.4.4, TMG2.4.5, TMG2.4.6, TMG5.1, TMG5.2, TMG7.2
+!EOP
+
+ ! call ESMC_BaseTime base class function
+ CALL ESMF_TimeIntervalSet( ESMF_TimeDiff, rc=rc )
+ call c_ESMC_BaseTimeDiff(time1, time2, ESMF_TimeDiff)
+
+ end function ESMF_TimeDiff
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_TimeEQ - Compare two times for equality
+!
+! !INTERFACE:
+ function ESMF_TimeEQ(time1, time2)
+!
+! !RETURN VALUE:
+ logical :: ESMF_TimeEQ
+!
+! !ARGUMENTS:
+ type(ESMF_Time), intent(in) :: time1
+ type(ESMF_Time), intent(in) :: time2
+!
+! !DESCRIPTION:
+! Return true if both given {\tt ESMF\_Time} instants are equal, false
+! otherwise. Maps overloaded (==) operator interface function to
+! {\tt ESMF\_BaseTime} base class.
+!
+! The arguments are:
+! \begin{description}
+! \item[time1]
+! First time instant to compare
+! \item[time2]
+! Second time instant to compare
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG1.5.3, TMG2.4.3, TMG7.2
+!EOP
+
+ ! invoke C to C++ entry point for ESMF_BaseTime base class function
+ call c_ESMC_BaseTimeEQ(time1, time2, ESMF_TimeEQ)
+
+ end function ESMF_TimeEQ
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_TimeNE - Compare two times for non-equality
+!
+! !INTERFACE:
+ function ESMF_TimeNE(time1, time2)
+!
+! !RETURN VALUE:
+ logical :: ESMF_TimeNE
+!
+! !ARGUMENTS:
+ type(ESMF_Time), intent(in) :: time1
+ type(ESMF_Time), intent(in) :: time2
+
+! !DESCRIPTION:
+! Return true if both given {\tt ESMF\_Time} instants are not equal, false
+! otherwise. Maps overloaded (/=) operator interface function to
+! {\tt ESMF\_BaseTime} base class.
+!
+! The arguments are:
+! \begin{description}
+! \item[time1]
+! First time instant to compare
+! \item[time2]
+! Second time instant to compare
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG1.5.3, TMG2.4.3, TMG7.2
+!EOP
+
+ ! call ESMC_BaseTime base class function
+ call c_ESMC_BaseTimeNE(time1, time2, ESMF_TimeNE)
+
+ end function ESMF_TimeNE
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_TimeLT - Time instant 1 less than time instant 2 ?
+!
+! !INTERFACE:
+ function ESMF_TimeLT(time1, time2)
+!
+! !RETURN VALUE:
+ logical :: ESMF_TimeLT
+!
+! !ARGUMENTS:
+ type(ESMF_Time), intent(in) :: time1
+ type(ESMF_Time), intent(in) :: time2
+!
+! !DESCRIPTION:
+! Return true if first {\tt ESMF\_Time} instant is less than second
+! {\tt ESMF\_Time} instant, false otherwise. Maps overloaded (<)
+! operator interface function to {\tt ESMF\_BaseTime} base class.
+!
+! The arguments are:
+! \begin{description}
+! \item[time1]
+! First time instant to compare
+! \item[time2]
+! Second time instant to compare
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG1.5.3, TMG2.4.3, TMG7.2
+!EOP
+
+ ! call ESMC_BaseTime base class function
+ call c_ESMC_BaseTimeLT(time1, time2, ESMF_TimeLT)
+
+ end function ESMF_TimeLT
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_TimeGT - Time instant 1 greater than time instant 2 ?
+!
+! !INTERFACE:
+ function ESMF_TimeGT(time1, time2)
+!
+! !RETURN VALUE:
+ logical :: ESMF_TimeGT
+!
+! !ARGUMENTS:
+ type(ESMF_Time), intent(in) :: time1
+ type(ESMF_Time), intent(in) :: time2
+!
+! !DESCRIPTION:
+! Return true if first {\tt ESMF\_Time} instant is greater than second
+! {\tt ESMF\_Time} instant, false otherwise. Maps overloaded (>) operator
+! interface function to {\tt ESMF\_BaseTime} base class.
+!
+! The arguments are:
+! \begin{description}
+! \item[time1]
+! First time instant to compare
+! \item[time2]
+! Second time instant to compare
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG1.5.3, TMG2.4.3, TMG7.2
+!EOP
+
+ ! call ESMC_BaseTime base class function
+ call c_ESMC_BaseTimeGT(time1, time2, ESMF_TimeGT)
+
+ end function ESMF_TimeGT
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_TimeLE - Time instant 1 less than or equal to time instant 2 ?
+!
+! !INTERFACE:
+ function ESMF_TimeLE(time1, time2)
+!
+! !RETURN VALUE:
+ logical :: ESMF_TimeLE
+!
+! !ARGUMENTS:
+ type(ESMF_Time), intent(in) :: time1
+ type(ESMF_Time), intent(in) :: time2
+!
+! !DESCRIPTION:
+! Return true if first {\tt ESMF\_Time} instant is less than or equal to
+! second {\tt ESMF\_Time} instant, false otherwise. Maps overloaded (<=)
+! operator interface function to {\tt ESMF\_BaseTime} base class.
+!
+! The arguments are:
+! \begin{description}
+! \item[time1]
+! First time instant to compare
+! \item[time2]
+! Second time instant to compare
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG1.5.3, TMG2.4.3, TMG7.2
+!EOP
+
+ ! call ESMC_BaseTime base class function
+ call c_ESMC_BaseTimeLE(time1, time2, ESMF_TimeLE)
+
+ end function ESMF_TimeLE
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_TimeGE - Time instant 1 greater than or equal to time instant 2 ?
+!
+! !INTERFACE:
+ function ESMF_TimeGE(time1, time2)
+!
+! !RETURN VALUE:
+ logical :: ESMF_TimeGE
+!
+! !ARGUMENTS:
+ type(ESMF_Time), intent(in) :: time1
+ type(ESMF_Time), intent(in) :: time2
+!
+! !DESCRIPTION:
+! Return true if first {\tt ESMF\_Time} instant is greater than or equal to
+! second {\tt ESMF\_Time} instant, false otherwise. Maps overloaded (>=)
+! operator interface function to {\tt ESMF\_BaseTime} base class.
+!
+! The arguments are:
+! \begin{description}
+! \item[time1]
+! First time instant to compare
+! \item[time2]
+! Second time instant to compare
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG1.5.3, TMG2.4.3, TMG7.2
+!EOP
+
+ ! call ESMC_BaseTime base class function
+ call c_ESMC_BaseTimeGE(time1, time2, ESMF_TimeGE)
+
+ end function ESMF_TimeGE
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_TimeCopy - Copy a time-instance
+
+! !INTERFACE:
+ subroutine ESMF_TimeCopy(timeout, timein)
+
+! !ARGUMENTS:
+ type(ESMF_Time), intent(out) :: timeout
+ type(ESMF_Time), intent(in) :: timein
+
+! !DESCRIPTION:
+! Copy a time-instance to a new instance.
+!
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMGn.n.n
+!EOP
+
+ timeout%basetime = timein%basetime
+ timeout%YR = timein%YR
+ timeout%Calendar => timein%Calendar
+
+ end subroutine ESMF_TimeCopy
+
+ end module ESMF_TimeMod
Added: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_TimeInterval.F90
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_TimeInterval.F90         (rev 0)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_TimeInterval.F90        2012-11-29 22:23:06 UTC (rev 2329)
@@ -0,0 +1,1268 @@
+!
+! Earth System Modeling Framework
+! Copyright 2002-2003, University Corporation for Atmospheric Research,
+! Massachusetts Institute of Technology, Geophysical Fluid Dynamics
+! Laboratory, University of Michigan, National Centers for Environmental
+! Prediction, Los Alamos National Laboratory, Argonne National Laboratory,
+! NASA Goddard Space Flight Center.
+! Licensed under the University of Illinois-NCSA license.
+!
+!==============================================================================
+!
+! ESMF TimeInterval Module
+ module ESMF_TimeIntervalMod
+!
+!==============================================================================
+!
+! This file contains the TimeInterval class definition and all TimeInterval
+! class methods.
+!
+!------------------------------------------------------------------------------
+! INCLUDES
+#include <ESMF_TimeMgr.inc>
+!
+!===============================================================================
+!BOPI
+! !MODULE: ESMF_TimeIntervalMod
+!
+! !DESCRIPTION:
+! Part of Time Manager F90 API wrapper of C++ implemenation
+!
+! Defines F90 wrapper entry points for corresponding
+! C++ implementaion of class {\tt ESMC\_TimeInterval}
+!
+! See {\tt ../include/ESMC\_TimeInterval.h} for complete description
+!
+!------------------------------------------------------------------------------
+! !USES:
+ ! inherit from ESMF base class
+ use ESMF_BaseMod
+
+ ! inherit from base time class
+ use ESMF_BaseTimeMod
+
+ ! associated derived types
+ use ESMF_FractionMod, only : ESMF_Fraction
+ use ESMF_CalendarMod
+
+ implicit none
+!
+!------------------------------------------------------------------------------
+! !PRIVATE TYPES:
+ private
+!------------------------------------------------------------------------------
+! ! ESMF_TimeInterval
+!
+! ! F90 class type to match C++ TimeInterval class in size only;
+! ! all dereferencing within class is performed by C++ implementation
+
+ type ESMF_TimeInterval
+ ! time interval is expressed as basetime
+ type(ESMF_BaseTime) :: basetime ! inherit base class
+ ! Relative year and month fields support monthly or yearly time
+ ! intervals. Many operations are undefined when these fields are
+ ! non-zero!
+ INTEGER :: YR ! relative year
+ !jm Month has no meaning for an interval; get rid of it, 20100319
+ ! INTEGER :: MM ! relative month
+ end type
+
+!------------------------------------------------------------------------------
+! !PUBLIC TYPES:
+ public ESMF_TimeInterval
+!------------------------------------------------------------------------------
+!
+! !PUBLIC MEMBER FUNCTIONS:
+ public ESMF_TimeIntervalGet
+ public ESMF_TimeIntervalSet
+ public ESMFold_TimeIntervalGetString
+ public ESMF_TimeIntervalAbsValue
+ public ESMF_TimeIntervalNegAbsValue
+
+! Required inherited and overridden ESMF_Base class methods
+
+!!!!!!!!! added 20051012, JM
+! public WRFADDITION_TimeIntervalDIVQuot
+!!!!!!!!! renamed to simplify testing 20060320, TH
+ public ESMF_TimeIntervalDIVQuot
+
+ ! This convenience routine is only used by other modules in
+ ! esmf_time_f90.
+ public ESMF_TimeIntervalIsPositive
+
+
+! !PRIVATE MEMBER FUNCTIONS:
+
+! overloaded operator functions
+
+ public operator(/)
+ private ESMF_TimeIntervalQuotI
+
+ public operator(*)
+ private ESMF_TimeIntervalProdI
+
+! Inherited and overloaded from ESMF_BaseTime
+
+ public operator(+)
+ private ESMF_TimeIntervalSum
+
+ public operator(-)
+ private ESMF_TimeIntervalDiff
+
+ public operator(.EQ.)
+ private ESMF_TimeIntervalEQ
+
+ public operator(.NE.)
+ private ESMF_TimeIntervalNE
+
+ public operator(.LT.)
+ private ESMF_TimeIntervalLT
+
+ public operator(.GT.)
+ private ESMF_TimeIntervalGT
+
+ public operator(.LE.)
+ private ESMF_TimeIntervalLE
+
+ public operator(.GE.)
+ private ESMF_TimeIntervalGE
+!EOPI
+
+!==============================================================================
+!
+! INTERFACE BLOCKS
+!
+!==============================================================================
+!BOP
+! !INTERFACE:
+ interface operator(*)
+
+! !PRIVATE MEMBER FUNCTIONS:
+ module procedure ESMF_TimeIntervalProdI
+
+! !DESCRIPTION:
+! This interface overloads the * operator for the {\tt ESMF\_TimeInterval}
+! class
+!
+!EOP
+ end interface
+!
+!------------------------------------------------------------------------------
+!BOP
+! !INTERFACE:
+ interface operator(/)
+
+! !PRIVATE MEMBER FUNCTIONS:
+ module procedure ESMF_TimeIntervalQuotI
+
+! !DESCRIPTION:
+! This interface overloads the / operator for the
+! {\tt ESMF\_TimeInterval} class
+!
+!EOP
+ end interface
+!
+!------------------------------------------------------------------------------
+!BOP
+! !INTERFACE:
+ interface operator(+)
+
+! !PRIVATE MEMBER FUNCTIONS:
+ module procedure ESMF_TimeIntervalSum
+
+! !DESCRIPTION:
+! This interface overloads the + operator for the
+! {\tt ESMF\_TimeInterval} class
+!
+!EOP
+ end interface
+!
+!------------------------------------------------------------------------------
+!BOP
+! !INTERFACE:
+ interface operator(-)
+
+! !PRIVATE MEMBER FUNCTIONS:
+ module procedure ESMF_TimeIntervalDiff
+
+! !DESCRIPTION:
+! This interface overloads the - operator for the
+! {\tt ESMF\_TimeInterval} class
+!
+!EOP
+ end interface
+!
+!------------------------------------------------------------------------------
+!BOP
+! !INTERFACE:
+ interface operator(.EQ.)
+
+! !PRIVATE MEMBER FUNCTIONS:
+ module procedure ESMF_TimeIntervalEQ
+
+! !DESCRIPTION:
+! This interface overloads the .EQ. operator for the
+! {\tt ESMF\_TimeInterval} class
+!
+!EOP
+ end interface
+!
+!------------------------------------------------------------------------------
+!BOP
+! !INTERFACE:
+ interface operator(.NE.)
+
+! !PRIVATE MEMBER FUNCTIONS:
+ module procedure ESMF_TimeIntervalNE
+
+! !DESCRIPTION:
+! This interface overloads the .NE. operator for the
+! {\tt ESMF\_TimeInterval} class
+!
+!EOP
+ end interface
+!
+!------------------------------------------------------------------------------
+!BOP
+! !INTERFACE:
+ interface operator(.LT.)
+
+! !PRIVATE MEMBER FUNCTIONS:
+ module procedure ESMF_TimeIntervalLT
+
+! !DESCRIPTION:
+! This interface overloads the .LT. operator for the
+! {\tt ESMF\_TimeInterval} class
+!
+!EOP
+ end interface
+!
+!------------------------------------------------------------------------------
+!BOP
+! !INTERFACE:
+ interface operator(.GT.)
+
+! !PRIVATE MEMBER FUNCTIONS:
+ module procedure ESMF_TimeIntervalGT
+
+! !DESCRIPTION:
+! This interface overloads the .GT. operator for the
+! {\tt ESMF\_TimeInterval} class
+!
+!EOP
+ end interface
+!
+!------------------------------------------------------------------------------
+!BOP
+! !INTERFACE:
+ interface operator(.LE.)
+
+! !PRIVATE MEMBER FUNCTIONS:
+ module procedure ESMF_TimeIntervalLE
+
+! !DESCRIPTION:
+! This interface overloads the .LE. operator for the
+! {\tt ESMF\_TimeInterval} class
+!
+!EOP
+ end interface
+!
+!------------------------------------------------------------------------------
+!BOP
+! !INTERFACE:
+ interface operator(.GE.)
+
+! !PRIVATE MEMBER FUNCTIONS:
+ module procedure ESMF_TimeIntervalGE
+
+! !DESCRIPTION:
+! This interface overloads the .GE. operator for the
+! {\tt ESMF\_TimeInterval} class
+!
+!EOP
+ end interface
+!
+!------------------------------------------------------------------------------
+
+!==============================================================================
+
+ contains
+
+!==============================================================================
+!
+! Generic Get/Set routines which use F90 optional arguments
+!
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_TimeIntervalGet - Get value in user-specified units
+
+! !INTERFACE:
+ subroutine ESMF_TimeIntervalGet(timeinterval, D, d_r8, S, S_i8, Sn, Sd, &
+ TimeString, rc )
+
+! !ARGUMENTS:
+ type(ESMF_TimeInterval), intent(in) :: timeinterval
+ integer, intent(out), optional :: D
+ real(ESMF_KIND_R8), intent(out), optional :: d_r8
+ integer(ESMF_KIND_I8), intent(out), optional :: S_i8
+ integer, intent(out), optional :: S
+ integer, intent(out), optional :: Sn
+ integer, intent(out), optional :: Sd
+ character*(*), optional, intent(out) :: TimeString
+ integer, intent(out), optional :: rc
+
+
+! !DESCRIPTION:
+! Get the value of the {\tt ESMF\_TimeInterval} in units specified by the
+! user via F90 optional arguments.
+!
+! Time manager represents and manipulates time internally with integers
+! to maintain precision. Hence, user-specified floating point values are
+! converted internally from integers.
+!
+! See {\tt ../include/ESMC\_BaseTime.h} and
+! {\tt ../include/ESMC\_TimeInterval.h} for complete description.
+!
+! The arguments are:
+! \begin{description}
+! \item[timeinterval]
+! The object instance to query
+! \item[{[YY]}]
+! Integer years (>= 32-bit)
+! \item[{[YYl]}]
+! Integer years (large, >= 64-bit)
+! \item[{[MO]}]
+! Integer months (>= 32-bit)
+! \item[{[MOl]}]
+! Integer months (large, >= 64-bit)
+! \item[{[D]}]
+! Integer days (>= 32-bit)
+! \item[{[Dl]}]
+! Integer days (large, >= 64-bit)
+! \item[{[H]}]
+! Integer hours
+! \item[{[M]}]
+! Integer minutes
+! \item[{[S]}]
+! Integer seconds (>= 32-bit)
+! \item[{[Sl]}]
+! Integer seconds (large, >= 64-bit)
+! \item[{[MS]}]
+! Integer milliseconds
+! \item[{[US]}]
+! Integer microseconds
+! \item[{[NS]}]
+! Integer nanoseconds
+! \item[{[d\_]}]
+! Double precision days
+! \item[{[h\_]}]
+! Double precision hours
+! \item[{[m\_]}]
+! Double precision minutes
+! \item[{[s\_]}]
+! Double precision seconds
+! \item[{[ms\_]}]
+! Double precision milliseconds
+! \item[{[us\_]}]
+! Double precision microseconds
+! \item[{[ns\_]}]
+! Double precision nanoseconds
+! \item[{[Sn]}]
+! Integer fractional seconds - numerator
+! \item[{[Sd]}]
+! Integer fractional seconds - denominator
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG1.1
+!
+! Added argument to output double precision seconds, S_i8
+! William.Gustafson@pnl.gov; 9-May-2008
+!
+!EOP
+ INTEGER(ESMF_KIND_I8) :: seconds
+ INTEGER :: ierr
+
+ ierr = ESMF_SUCCESS
+ seconds = timeinterval%basetime%S
+ ! note that S is overwritten below (if present) if other args are also
+ ! present
+ IF ( PRESENT(S) ) S = seconds
+ IF ( PRESENT(S_i8) ) S_i8 = seconds
+ IF ( PRESENT( D ) ) THEN
+ D = seconds / SECONDS_PER_DAY
+ IF ( PRESENT(S) ) S = MOD( seconds, SECONDS_PER_DAY )
+ IF ( PRESENT(S_i8) ) S_i8 = MOD( seconds, SECONDS_PER_DAY )
+ ENDIF
+ IF ( PRESENT( d_r8 ) ) THEN
+ D_r8 = REAL( seconds, ESMF_KIND_R8 ) / &
+ REAL( SECONDS_PER_DAY, ESMF_KIND_R8 )
+ IF ( PRESENT(S) ) S = MOD( seconds, SECONDS_PER_DAY )
+ IF ( PRESENT(S_i8) ) S_i8 = MOD( seconds, SECONDS_PER_DAY )
+ ENDIF
+ IF ( PRESENT(Sn) ) THEN
+ Sn = timeinterval%basetime%Sn
+ ENDIF
+ IF ( PRESENT(Sd) ) THEN
+ Sd = timeinterval%basetime%Sd
+ ENDIF
+ IF ( PRESENT( timeString ) ) THEN
+ CALL ESMFold_TimeIntervalGetString( timeinterval, timeString, rc=ierr )
+ ENDIF
+ IF ( PRESENT(rc) ) rc = ierr
+
+ end subroutine ESMF_TimeIntervalGet
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_TimeIntervalSet - Initialize via user-specified unit set
+
+! !INTERFACE:
+ subroutine ESMF_TimeIntervalSet(timeinterval, YY, YYl, MM, MOl, D, Dl, &
+ H, M, S, Sl, MS, US, NS, &
+ d_, h_, m_, s_, ms_, us_, ns_, &
+ Sn, Sd, rc)
+
+! !ARGUMENTS:
+ type(ESMF_TimeInterval), intent(out) :: timeinterval
+ integer, intent(in), optional :: YY
+ integer(ESMF_KIND_I8), intent(in), optional :: YYl
+ integer, intent(in), optional :: MM
+ integer(ESMF_KIND_I8), intent(in), optional :: MOl
+ integer, intent(in), optional :: D
+ integer(ESMF_KIND_I8), intent(in), optional :: Dl
+ integer, intent(in), optional :: H
+ integer, intent(in), optional :: M
+ integer, intent(in), optional :: S
+ integer(ESMF_KIND_I8), intent(in), optional :: Sl
+ integer, intent(in), optional :: MS
+ integer, intent(in), optional :: US
+ integer, intent(in), optional :: NS
+ double precision, intent(in), optional :: d_
+ double precision, intent(in), optional :: h_
+ double precision, intent(in), optional :: m_
+ double precision, intent(in), optional :: s_
+ double precision, intent(in), optional :: ms_
+ double precision, intent(in), optional :: us_
+ double precision, intent(in), optional :: ns_
+ integer, intent(in), optional :: Sn
+ integer, intent(in), optional :: Sd
+ integer, intent(out), optional :: rc
+ ! locals
+ INTEGER :: nfeb
+
+! !DESCRIPTION:
+! Set the value of the {\tt ESMF\_TimeInterval} in units specified by
+! the user via F90 optional arguments
+!
+! Time manager represents and manipulates time internally with integers
+! to maintain precision. Hence, user-specified floating point values are
+! converted internally to integers.
+!
+! See {\tt ../include/ESMC\_BaseTime.h} and
+! {\tt ../include/ESMC\_TimeInterval.h} for complete description.
+!
+! The arguments are:
+! \begin{description}
+! \item[timeinterval]
+! The object instance to initialize
+! \item[{[YY]}]
+! Integer number of interval years (>= 32-bit)
+! \item[{[YYl]}]
+! Integer number of interval years (large, >= 64-bit)
+! \item[{[MM]}]
+! Integer number of interval months (>= 32-bit)
+! \item[{[MOl]}]
+! Integer number of interval months (large, >= 64-bit)
+! \item[{[D]}]
+! Integer number of interval days (>= 32-bit)
+! \item[{[Dl]}]
+! Integer number of interval days (large, >= 64-bit)
+! \item[{[H]}]
+! Integer hours
+! \item[{[M]}]
+! Integer minutes
+! \item[{[S]}]
+! Integer seconds (>= 32-bit)
+! \item[{[Sl]}]
+! Integer seconds (large, >= 64-bit)
+! \item[{[MS]}]
+! Integer milliseconds
+! \item[{[US]}]
+! Integer microseconds
+! \item[{[NS]}]
+! Integer nanoseconds
+! \item[{[d\_]}]
+! Double precision days
+! \item[{[h\_]}]
+! Double precision hours
+! \item[{[m\_]}]
+! Double precision minutes
+! \item[{[s\_]}]
+! Double precision seconds
+! \item[{[ms\_]}]
+! Double precision milliseconds
+! \item[{[us\_]}]
+! Double precision microseconds
+! \item[{[ns\_]}]
+! Double precision nanoseconds
+! \item[{[Sn]}]
+! Integer fractional seconds - numerator
+! \item[{[Sd]}]
+! Integer fractional seconds - denominator
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMGn.n.n
+!EOP
+
+ IF ( PRESENT(rc) ) rc = ESMF_FAILURE
+ ! note that YR and MM are relative
+ timeinterval%YR = 0
+ IF ( PRESENT( YY ) ) THEN
+ timeinterval%YR = YY
+ ENDIF
+!jm timeinterval%MM = 0
+!jm IF ( PRESENT( MM ) ) THEN
+!jm timeinterval%MM = MM
+!jm ENDIF
+!jm ! Rollover months to years
+!jm IF ( abs(timeinterval%MM) .GE. MONTHS_PER_YEAR ) THEN
+!jm timeinterval%YR = timeinterval%YR + timeinterval%MM/MONTHS_PER_YEAR
+!jm timeinterval%MM = mod(timeinterval%MM,MONTHS_PER_YEAR)
+!jm ENDIF
+
+ timeinterval%basetime%S = 0
+ ! For 365-day calendar, immediately convert years to days since we know
+ ! how to do it in this case.
+!$$$ replace this hack with something saner...
+ IF ( nfeb( 2004 ) == 28 ) THEN
+ timeinterval%basetime%S = timeinterval%basetime%S + &
+ ( 365_ESMF_KIND_I8 * &
+ INT( timeinterval%YR, ESMF_KIND_I8 ) * SECONDS_PER_DAY )
+ timeinterval%YR = 0
+ ENDIF
+ IF ( PRESENT( D ) ) THEN
+ timeinterval%basetime%S = timeinterval%basetime%S + &
+ ( SECONDS_PER_DAY * INT( D, ESMF_KIND_I8 ) )
+ ENDIF
+!$$$ Push H,M,S,Sn,Sd,MS down into BaseTime constructor from EVERYWHERE
+!$$$ and THEN add ESMF scaling behavior when other args are present...
+ IF ( PRESENT( H ) ) THEN
+ timeinterval%basetime%S = timeinterval%basetime%S + &
+ ( SECONDS_PER_HOUR * INT( H, ESMF_KIND_I8 ) )
+ ENDIF
+ IF ( PRESENT( M ) ) THEN
+ timeinterval%basetime%S = timeinterval%basetime%S + &
+ ( SECONDS_PER_MINUTE * INT( M, ESMF_KIND_I8 ) )
+ ENDIF
+ IF ( PRESENT( S ) ) THEN
+ timeinterval%basetime%S = timeinterval%basetime%S + &
+ INT( S, ESMF_KIND_I8 )
+ ENDIF
+ IF ( PRESENT( Sn ) .AND. ( .NOT. PRESENT( Sd ) ) ) THEN
+ CALL wrf_error_fatal( &
+ "ESMF_TimeIntervalSet: Must specify Sd if Sn is specified")
+ ENDIF
+ IF ( PRESENT( Sd ) .AND. PRESENT( MS ) ) THEN
+ CALL wrf_error_fatal( &
+ "ESMF_TimeIntervalSet: Must not specify both Sd and MS")
+ ENDIF
+ timeinterval%basetime%Sn = 0
+ timeinterval%basetime%Sd = 0
+ IF ( PRESENT( MS ) ) THEN
+ timeinterval%basetime%Sn = MS
+ timeinterval%basetime%Sd = 1000_ESMF_KIND_I8
+ ELSE IF ( PRESENT( Sd ) ) THEN
+ timeinterval%basetime%Sd = Sd
+ IF ( PRESENT( Sn ) ) THEN
+ timeinterval%basetime%Sn = Sn
+ ENDIF
+ ENDIF
+ CALL normalize_timeint( timeinterval )
+
+ IF ( PRESENT(rc) ) rc = ESMF_SUCCESS
+
+ end subroutine ESMF_TimeIntervalSet
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMFold_TimeIntervalGetString - Get time interval value in string format
+
+! !INTERFACE:
+ subroutine ESMFold_TimeIntervalGetString(timeinterval, TimeString, rc)
+
+! !ARGUMENTS:
+ type(ESMF_TimeInterval), intent(in) :: timeinterval
+ character*(*), intent(out) :: TimeString
+ integer, intent(out), optional :: rc
+ ! locals
+ integer :: signnormtimeint
+ LOGICAL :: negative
+ INTEGER(ESMF_KIND_I8) :: iS, iSn, iSd, H, M, S
+ character (len=1) :: signstr
+
+! !DESCRIPTION:
+! Convert {\tt ESMF\_TimeInterval}'s value into string format
+!
+! The arguments are:
+! \begin{description}
+! \item[timeinterval]
+! The object instance to convert
+! \item[TimeString]
+! The string to return
+! \item[{[rc]}]
+! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG1.5.9
+!EOP
+
+! NOTE: YR, MM, Sn, and Sd are not yet included in the returned string...
+!PRINT *,'DEBUG ESMFold_TimeIntervalGetString(): YR,MM,S,Sn,Sd = ', &
+! timeinterval%YR, &
+! timeinterval%MM, &
+! timeinterval%basetime%S, &
+! timeinterval%basetime%Sn, &
+! timeinterval%basetime%Sd
+
+ negative = ( signnormtimeint( timeInterval ) == -1 )
+ IF ( negative ) THEN
+ iS = -timeinterval%basetime%S
+ iSn = -timeinterval%basetime%Sn
+ signstr = '-'
+ ELSE
+ iS = timeinterval%basetime%S
+ iSn = timeinterval%basetime%Sn
+ signstr = ''
+ ENDIF
+ iSd = timeinterval%basetime%Sd
+
+ H = mod( iS, SECONDS_PER_DAY ) / SECONDS_PER_HOUR
+ M = mod( iS, SECONDS_PER_HOUR) / SECONDS_PER_MINUTE
+ S = mod( iS, SECONDS_PER_MINUTE )
+
+!$$$here... need to print Sn and Sd when they are used ???
+
+ write(TimeString,FMT="(A,I10.10,'_',I3.3,':',I3.3,':',I3.3)") &
+ TRIM(signstr), ( iS / SECONDS_PER_DAY ), H, M, S
+
+!write(0,*)'TimeIntervalGetString Sn ',timeinterval%basetime%Sn,' Sd ',timeinterval%basetime%Sd
+
+ rc = ESMF_SUCCESS
+
+ end subroutine ESMFold_TimeIntervalGetString
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_TimeIntervalAbsValue - Get the absolute value of a time interval
+
+! !INTERFACE:
+ function ESMF_TimeIntervalAbsValue(timeinterval)
+
+! !RETURN VALUE:
+ type(ESMF_TimeInterval) :: ESMF_TimeIntervalAbsValue
+
+! !ARGUMENTS:
+ type(ESMF_TimeInterval), intent(in) :: timeinterval
+! !LOCAL:
+ integer :: rc
+
+! !DESCRIPTION:
+! Return a {\tt ESMF\_TimeInterval}'s absolute value.
+!
+! The arguments are:
+! \begin{description}
+! \item[timeinterval]
+! The object instance to take the absolute value of.
+! Absolute value returned as value of function.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG1.5.8
+!EOP
+ CALL timeintchecknormalized( timeinterval, 'ESMF_TimeIntervalAbsValue arg1' )
+ ESMF_TimeIntervalAbsValue = timeinterval
+!$$$here... move implementation into BaseTime
+ ESMF_TimeIntervalAbsValue%basetime%S = &
+ abs(ESMF_TimeIntervalAbsValue%basetime%S)
+ ESMF_TimeIntervalAbsValue%basetime%Sn = &
+ abs(ESMF_TimeIntervalAbsValue%basetime%Sn )
+
+ end function ESMF_TimeIntervalAbsValue
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_TimeIntervalNegAbsValue - Get the negative absolute value of a time interval
+
+! !INTERFACE:
+ function ESMF_TimeIntervalNegAbsValue(timeinterval)
+
+! !RETURN VALUE:
+ type(ESMF_TimeInterval) :: ESMF_TimeIntervalNegAbsValue
+
+! !ARGUMENTS:
+ type(ESMF_TimeInterval), intent(in) :: timeinterval
+! !LOCAL:
+ integer :: rc
+
+! !DESCRIPTION:
+! Return a {\tt ESMF\_TimeInterval}'s negative absolute value.
+!
+! The arguments are:
+! \begin{description}
+! \item[timeinterval]
+! The object instance to take the negative absolute value of.
+! Negative absolute value returned as value of function.
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG1.5.8
+!EOP
+ CALL timeintchecknormalized( timeinterval, 'ESMF_TimeIntervalNegAbsValue arg1' )
+
+ ESMF_TimeIntervalNegAbsValue = timeinterval
+!$$$here... move implementation into BaseTime
+ ESMF_TimeIntervalNegAbsValue%basetime%S = &
+ -abs(ESMF_TimeIntervalNegAbsValue%basetime%S)
+ ESMF_TimeIntervalNegAbsValue%basetime%Sn = &
+ -abs(ESMF_TimeIntervalNegAbsValue%basetime%Sn )
+
+ end function ESMF_TimeIntervalNegAbsValue
+
+!------------------------------------------------------------------------------
+!
+! This section includes overloaded operators defined only for TimeInterval
+! (not inherited from BaseTime)
+! Note: these functions do not have a return code, since F90 forbids more
+! than 2 arguments for arithmetic overloaded operators
+!
+!------------------------------------------------------------------------------
+
+!!!!!!!!!!!!!!!!!! added jm 20051012
+! new WRF-specific function, Divide two time intervals and return the whole integer, without remainder
+ function ESMF_TimeIntervalDIVQuot(timeinterval1, timeinterval2)
+
+! !RETURN VALUE:
+ INTEGER :: ESMF_TimeIntervalDIVQuot
+
+! !ARGUMENTS:
+ type(ESMF_TimeInterval), intent(in) :: timeinterval1
+ type(ESMF_TimeInterval), intent(in) :: timeinterval2
+
+! !LOCAL
+ INTEGER :: retval, isgn, rc
+ type(ESMF_TimeInterval) :: zero, i1,i2
+
+! !DESCRIPTION:
+! Returns timeinterval1 divided by timeinterval2 as a fraction quotient.
+!
+! The arguments are:
+! \begin{description}
+! \item[timeinterval1]
+! The dividend
+! \item[timeinterval2]
+! The divisor
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG1.5.5
+!EOP
+
+ CALL timeintchecknormalized( timeinterval1, 'ESMF_TimeIntervalDIVQuot arg1' )
+ CALL timeintchecknormalized( timeinterval2, 'ESMF_TimeIntervalDIVQuot arg2' )
+
+ call ESMF_TimeIntervalSet( zero, rc=rc )
+ i1 = timeinterval1
+ i2 = timeinterval2
+ isgn = 1
+ if ( i1 .LT. zero ) then
+ i1 = ESMF_TimeIntervalProdI(i1, -1)
+ isgn = -isgn
+ endif
+ if ( i2 .LT. zero ) then
+ i2 = ESMF_TimeIntervalProdI(i2, -1)
+ isgn = -isgn
+ endif
+! repeated subtraction
+ retval = 0
+ DO WHILE ( i1 .GE. i2 )
+ i1 = i1 - i2
+ retval = retval + 1
+ ENDDO
+ retval = retval * isgn
+
+ ESMF_TimeIntervalDIVQuot = retval
+
+ end function ESMF_TimeIntervalDIVQuot
+!!!!!!!!!!!!!!!!!!
+
+
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_TimeIntervalQuotI - Divide time interval by an integer, return time interval result
+
+! !INTERFACE:
+ function ESMF_TimeIntervalQuotI(timeinterval, divisor)
+
+! !RETURN VALUE:
+ type(ESMF_TimeInterval) :: ESMF_TimeIntervalQuotI
+
+! !ARGUMENTS:
+ type(ESMF_TimeInterval), intent(in) :: timeinterval
+ integer, intent(in) :: divisor
+
+! !DESCRIPTION:
+! Divides a {\tt ESMF\_TimeInterval} by an integer divisor, returns
+! quotient as a {\tt ESMF\_TimeInterval}
+!
+! The arguments are:
+! \begin{description}
+! \item[timeinterval]
+! The dividend
+! \item[divisor]
+! Integer divisor
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG1.5.6, TMG5.3, TMG7.2
+!EOP
+
+!PRINT *,'DEBUG ESMF_TimeIntervalQuotI() A: S,Sn,Sd = ', &
+! timeinterval%basetime%S,timeinterval%basetime%Sn,timeinterval%basetime%Sd
+!PRINT *,'DEBUG ESMF_TimeIntervalQuotI() A: divisor = ', divisor
+
+ CALL timeintchecknormalized( timeinterval, 'ESMF_TimeIntervalQuotI arg1' )
+
+ IF ( divisor == 0 ) THEN
+ CALL wrf_error_fatal( 'ESMF_TimeIntervalQuotI: divide by zero' )
+ ENDIF
+ ESMF_TimeIntervalQuotI = timeinterval
+!PRINT *,'DEBUG ESMF_TimeIntervalQuotI() B: S,Sn,Sd = ', &
+! ESMF_TimeIntervalQuotI%basetime%S,ESMF_TimeIntervalQuotI%basetime%Sn,ESMF_TimeIntervalQuotI%basetime%Sd
+ ESMF_TimeIntervalQuotI%basetime = &
+ timeinterval%basetime / divisor
+!PRINT *,'DEBUG ESMF_TimeIntervalQuotI() C: S,Sn,Sd = ', &
+! ESMF_TimeIntervalQuotI%basetime%S,ESMF_TimeIntervalQuotI%basetime%Sn,ESMF_TimeIntervalQuotI%basetime%Sd
+
+ CALL normalize_timeint( ESMF_TimeIntervalQuotI )
+!PRINT *,'DEBUG ESMF_TimeIntervalQuotI() D: S,Sn,Sd = ', &
+! ESMF_TimeIntervalQuotI%basetime%S,ESMF_TimeIntervalQuotI%basetime%Sn,ESMF_TimeIntervalQuotI%basetime%Sd
+
+ end function ESMF_TimeIntervalQuotI
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_TimeIntervalProdI - Multiply a time interval by an integer
+
+! !INTERFACE:
+ function ESMF_TimeIntervalProdI(timeinterval, multiplier)
+
+! !RETURN VALUE:
+ type(ESMF_TimeInterval) :: ESMF_TimeIntervalProdI
+
+! !ARGUMENTS:
+ type(ESMF_TimeInterval), intent(in) :: timeinterval
+ integer, intent(in) :: multiplier
+! !LOCAL:
+ integer :: rc
+
+! !DESCRIPTION:
+! Multiply a {\tt ESMF\_TimeInterval} by an integer, return product as a
+! {\tt ESMF\_TimeInterval}
+!
+! The arguments are:
+! \begin{description}
+! \item[timeinterval]
+! The multiplicand
+! \item[mutliplier]
+! Integer multiplier
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG1.5.7, TMG7.2
+!EOP
+ CALL timeintchecknormalized( timeinterval, 'ESMF_TimeIntervalProdI arg1' )
+
+ CALL ESMF_TimeIntervalSet( ESMF_TimeIntervalProdI, rc=rc )
+!$$$move this into overloaded operator(*) in BaseTime
+ ESMF_TimeIntervalProdI%basetime%S = &
+ timeinterval%basetime%S * INT( multiplier, ESMF_KIND_I8 )
+ ESMF_TimeIntervalProdI%basetime%Sn = &
+ timeinterval%basetime%Sn * INT( multiplier, ESMF_KIND_I8 )
+ ! Don't multiply Sd
+ ESMF_TimeIntervalProdI%basetime%Sd = timeinterval%basetime%Sd
+ CALL normalize_timeint( ESMF_TimeIntervalProdI )
+
+ end function ESMF_TimeIntervalProdI
+
+!------------------------------------------------------------------------------
+!
+! This section includes the inherited ESMF_BaseTime class overloaded operators
+!
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_TimeIntervalSum - Add two time intervals together
+
+! !INTERFACE:
+ function ESMF_TimeIntervalSum(timeinterval1, timeinterval2)
+
+! !RETURN VALUE:
+ type(ESMF_TimeInterval) :: ESMF_TimeIntervalSum
+
+! !ARGUMENTS:
+ type(ESMF_TimeInterval), intent(in) :: timeinterval1
+ type(ESMF_TimeInterval), intent(in) :: timeinterval2
+! !LOCAL:
+ integer :: rc
+! !DESCRIPTION:
+! Add two {\tt ESMF\_TimeIntervals}, return sum as a
+! {\tt ESMF\_TimeInterval}. Maps overloaded (+) operator interface
+! function to {\tt ESMF\_BaseTime} base class.
+!
+! The arguments are:
+! \begin{description}
+! \item[timeinterval1]
+! The augend
+! \item[timeinterval2]
+! The addend
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG1.5.4, TMG2.4.4, TMG2.4.5, TMG2.4.6, TMG5.1, TMG5.2,
+! TMG7.2
+!EOP
+ CALL timeintchecknormalized( timeinterval1, 'ESMF_TimeIntervalSum arg1' )
+ CALL timeintchecknormalized( timeinterval2, 'ESMF_TimeIntervalSum arg2' )
+
+ ESMF_TimeIntervalSum = timeinterval1
+ ESMF_TimeIntervalSum%basetime = ESMF_TimeIntervalSum%basetime + &
+ timeinterval2%basetime
+
+ CALL normalize_timeint( ESMF_TimeIntervalSum )
+
+ end function ESMF_TimeIntervalSum
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_TimeIntervalDiff - Subtract one time interval from another
+
+! !INTERFACE:
+ function ESMF_TimeIntervalDiff(timeinterval1, timeinterval2)
+
+! !RETURN VALUE:
+ type(ESMF_TimeInterval) :: ESMF_TimeIntervalDiff
+
+! !ARGUMENTS:
+ type(ESMF_TimeInterval), intent(in) :: timeinterval1
+ type(ESMF_TimeInterval), intent(in) :: timeinterval2
+! !LOCAL:
+ integer :: rc
+! !DESCRIPTION:
+! Subtract timeinterval2 from timeinterval1, return remainder as a
+! {\tt ESMF\_TimeInterval}.
+! Map overloaded (-) operator interface function to {\tt ESMF\_BaseTime}
+! base class.
+!
+! The arguments are:
+! \begin{description}
+! \item[timeinterval1]
+! The minuend
+! \item[timeinterval2]
+! The subtrahend
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG1.5.4, TMG2.4.4, TMG2.4.5, TMG2.4.6, TMG5.1, TMG5.2, TMG7.2
+!EOP
+ CALL timeintchecknormalized( timeinterval1, 'ESMF_TimeIntervalDiff arg1' )
+ CALL timeintchecknormalized( timeinterval2, 'ESMF_TimeIntervalDiff arg2' )
+
+ ESMF_TimeIntervalDiff = timeinterval1
+ ESMF_TimeIntervalDiff%basetime = ESMF_TimeIntervalDiff%basetime - &
+ timeinterval2%basetime
+ CALL normalize_timeint( ESMF_TimeIntervalDiff )
+
+ end function ESMF_TimeIntervalDiff
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_TimeIntervalEQ - Compare two time intervals for equality
+
+! !INTERFACE:
+ function ESMF_TimeIntervalEQ(timeinterval1, timeinterval2)
+!
+! !RETURN VALUE:
+ logical :: ESMF_TimeIntervalEQ
+
+! !ARGUMENTS:
+ type(ESMF_TimeInterval), intent(in) :: timeinterval1
+ type(ESMF_TimeInterval), intent(in) :: timeinterval2
+
+!DESCRIPTION:
+! Return true if both given time intervals are equal, false otherwise.
+! Maps overloaded (==) operator interface function to {\tt ESMF\_BaseTime}
+! base class.
+!
+! The arguments are:
+! \begin{description}
+! \item[timeinterval1]
+! First time interval to compare
+! \item[timeinterval2]
+! Second time interval to compare
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG1.5.3, TMG2.4.3, TMG7.2
+!EOP
+ CALL timeintchecknormalized( timeinterval1, 'ESMF_TimeIntervalEQ arg1' )
+ CALL timeintchecknormalized( timeinterval2, 'ESMF_TimeIntervalEQ arg2' )
+
+!$$$here... move all this out of Meat.F90 ?
+ ! call ESMC_BaseTime base class function
+ call c_ESMC_BaseTimeIntEQ(timeinterval1, timeinterval2, ESMF_TimeIntervalEQ)
+
+ end function ESMF_TimeIntervalEQ
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_TimeIntervalNE - Compare two time intervals for inequality
+
+! !INTERFACE:
+ function ESMF_TimeIntervalNE(timeinterval1, timeinterval2)
+!
+! !RETURN VALUE:
+ logical :: ESMF_TimeIntervalNE
+
+! !ARGUMENTS:
+ type(ESMF_TimeInterval), intent(in) :: timeinterval1
+ type(ESMF_TimeInterval), intent(in) :: timeinterval2
+
+! !DESCRIPTION:
+! Return true if both given time intervals are not equal, false otherwise.
+! Maps overloaded (/=) operator interface function to {\tt ESMF\_BaseTime}
+! base class.
+!
+! The arguments are:
+! \begin{description}
+! \item[timeinterval1]
+! First time interval to compare
+! \item[timeinterval2]
+! Second time interval to compare
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG1.5.3, TMG2.4.3, TMG7.2
+!EOP
+ CALL timeintchecknormalized( timeinterval1, 'ESMF_TimeIntervalNE arg1' )
+ CALL timeintchecknormalized( timeinterval2, 'ESMF_TimeIntervalNE arg2' )
+
+ ! call ESMC_BaseTime base class function
+ call c_ESMC_BaseTimeIntNE(timeinterval1, timeinterval2, ESMF_TimeIntervalNE)
+
+ end function ESMF_TimeIntervalNE
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_TimeIntervalLT - Time interval 1 less than time interval 2 ?
+
+! !INTERFACE:
+ function ESMF_TimeIntervalLT(timeinterval1, timeinterval2)
+!
+! !RETURN VALUE:
+ logical :: ESMF_TimeIntervalLT
+
+! !ARGUMENTS:
+ type(ESMF_TimeInterval), intent(in) :: timeinterval1
+ type(ESMF_TimeInterval), intent(in) :: timeinterval2
+
+! !DESCRIPTION:
+! Return true if first time interval is less than second time interval,
+! false otherwise. Maps overloaded (<) operator interface function to
+! {\tt ESMF\_BaseTime} base class.
+!
+! The arguments are:
+! \begin{description}
+! \item[timeinterval1]
+! First time interval to compare
+! \item[timeinterval2]
+! Second time interval to compare
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG1.5.3, TMG2.4.3, TMG7.2
+!EOP
+ CALL timeintchecknormalized( timeinterval1, 'ESMF_TimeIntervalLT arg1' )
+ CALL timeintchecknormalized( timeinterval2, 'ESMF_TimeIntervalLT arg2' )
+
+ ! call ESMC_BaseTime base class function
+ call c_ESMC_BaseTimeIntLT(timeinterval1, timeinterval2, ESMF_TimeIntervalLT)
+
+ end function ESMF_TimeIntervalLT
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_TimeIntervalGT - Time interval 1 greater than time interval 2?
+
+! !INTERFACE:
+ function ESMF_TimeIntervalGT(timeinterval1, timeinterval2)
+!
+! !RETURN VALUE:
+ logical :: ESMF_TimeIntervalGT
+
+! !ARGUMENTS:
+ type(ESMF_TimeInterval), intent(in) :: timeinterval1
+ type(ESMF_TimeInterval), intent(in) :: timeinterval2
+
+! !DESCRIPTION:
+! Return true if first time interval is greater than second time interval,
+! false otherwise. Maps overloaded (>) operator interface function to
+! {\tt ESMF\_BaseTime} base class.
+!
+! The arguments are:
+! \begin{description}
+! \item[timeinterval1]
+! First time interval to compare
+! \item[timeinterval2]
+! Second time interval to compare
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG1.5.3, TMG2.4.3, TMG7.2
+!EOP
+ CALL timeintchecknormalized( timeinterval1, 'ESMF_TimeIntervalGT arg1' )
+ CALL timeintchecknormalized( timeinterval2, 'ESMF_TimeIntervalGT arg2' )
+
+ ! call ESMC_BaseTime base class function
+ call c_ESMC_BaseTimeIntGT(timeinterval1, timeinterval2, ESMF_TimeIntervalGT)
+
+ end function ESMF_TimeIntervalGT
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_TimeIntervalLE - Time interval 1 less than or equal to time interval 2 ?
+
+! !INTERFACE:
+ function ESMF_TimeIntervalLE(timeinterval1, timeinterval2)
+
+! !RETURN VALUE:
+ logical :: ESMF_TimeIntervalLE
+
+! !ARGUMENTS:
+ type(ESMF_TimeInterval), intent(in) :: timeinterval1
+ type(ESMF_TimeInterval), intent(in) :: timeinterval2
+
+! !DESCRIPTION:
+! Return true if first time interval is less than or equal to second time
+! interval, false otherwise.
+! Maps overloaded (<=) operator interface function to {\tt ESMF\_BaseTime}
+! base class.
+!
+! The arguments are:
+! \begin{description}
+! \item[timeinterval1]
+! First time interval to compare
+! \item[timeinterval2]
+! Second time interval to compare
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG1.5.3, TMG2.4.3, TMG7.2
+!EOP
+ CALL timeintchecknormalized( timeinterval1, 'ESMF_TimeIntervalLE arg1' )
+ CALL timeintchecknormalized( timeinterval2, 'ESMF_TimeIntervalLE arg2' )
+
+ ! call ESMC_BaseTime base class function
+ call c_ESMC_BaseTimeIntLE(timeinterval1, timeinterval2, ESMF_TimeIntervalLE)
+
+ end function ESMF_TimeIntervalLE
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_TimeIntervalGE - Time interval 1 greater than or equal to time interval 2 ?
+
+! !INTERFACE:
+ function ESMF_TimeIntervalGE(timeinterval1, timeinterval2)
+!
+! !RETURN VALUE:
+ logical :: ESMF_TimeIntervalGE
+
+! !ARGUMENTS:
+ type(ESMF_TimeInterval), intent(in) :: timeinterval1
+ type(ESMF_TimeInterval), intent(in) :: timeinterval2
+
+! !DESCRIPTION:
+! Return true if first time interval is greater than or equal to second
+! time interval, false otherwise. Maps overloaded (>=) operator interface
+! function to {\tt ESMF\_BaseTime} base class.
+!
+! The arguments are:
+! \begin{description}
+! \item[timeinterval1]
+! First time interval to compare
+! \item[timeinterval2]
+! Second time interval to compare
+! \end{description}
+!
+! !REQUIREMENTS:
+! TMG1.5.3, TMG2.4.3, TMG7.2
+!EOP
+ CALL timeintchecknormalized( timeinterval1, 'ESMF_TimeIntervalGE arg1' )
+ CALL timeintchecknormalized( timeinterval2, 'ESMF_TimeIntervalGE arg2' )
+
+ ! call ESMC_BaseTime base class function
+ call c_ESMC_BaseTimeIntGE(timeinterval1, timeinterval2, ESMF_TimeIntervalGE)
+
+ end function ESMF_TimeIntervalGE
+
+
+!------------------------------------------------------------------------------
+!BOP
+! !IROUTINE: ESMF_TimeIntervalIsPositive - Time interval greater than zero?
+
+! !INTERFACE:
+ function ESMF_TimeIntervalIsPositive(timeinterval)
+!
+! !RETURN VALUE:
+ logical :: ESMF_TimeIntervalIsPositive
+
+! !ARGUMENTS:
+ type(ESMF_TimeInterval), intent(in) :: timeinterval
+
+! !LOCALS:
+ type(ESMF_TimeInterval) :: zerotimeint
+ integer :: rcint
+
+! !DESCRIPTION:
+! Return true if time interval is greater than zero,
+! false otherwise.
+!
+! The arguments are:
+! \begin{description}
+! \item[timeinterval]
+! Time interval to compare
+! \end{description}
+!EOP
+ CALL timeintchecknormalized( timeinterval, &
+ 'ESMF_TimeIntervalIsPositive arg' )
+
+ CALL ESMF_TimeIntervalSet ( zerotimeint, rc=rcint )
+ IF ( rcint /= ESMF_SUCCESS ) THEN
+ CALL wrf_error_fatal( &
+ 'ESMF_TimeIntervalIsPositive: ESMF_TimeIntervalSet failed' )
+ ENDIF
+! hack for bug in PGI 5.1-x
+! ESMF_TimeIntervalIsPositive = timeinterval > zerotimeint
+ ESMF_TimeIntervalIsPositive = ESMF_TimeIntervalGT( timeinterval, &
+ zerotimeint )
+ end function ESMF_TimeIntervalIsPositive
+
+ end module ESMF_TimeIntervalMod
+
+
Added: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_TimeMgr.inc
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_TimeMgr.inc         (rev 0)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/ESMF_TimeMgr.inc        2012-11-29 22:23:06 UTC (rev 2329)
@@ -0,0 +1,61 @@
+#if 0
+
+Earth System Modeling Framework
+Copyright 2002-2003, University Corporation for Atmospheric Research,
+Massachusetts Institute of Technology, Geophysical Fluid Dynamics
+Laboratory, University of Michigan, National Centers for Environmental
+Prediction, Los Alamos National Laboratory, Argonne National Laboratory,
+NASA Goddard Space Flight Center.
+Licensed under the University of Illinois-NCSA license.
+
+Do not have C++ or F90 style comments in here because this file is processed
+by both C++ and F90 compilers.
+#endif
+
+#ifndef ESMF_TimeMgr_INC
+#define ESMF_TimeMgr_INC
+
+#if 0
+!BOP
+-------------------------------------------------------------------------
+
+ !DESCRIPTION:
+
+ ESMF TimeMgr include file for F90
+ The code in this file implements constants and macros for the TimeMgr...
+
+-------------------------------------------------------------------------
+!EOP
+#endif
+
+#include <ESMF_Macros.inc>
+
+#define SECONDS_PER_DAY 86400_ESMF_KIND_I8
+#define SECONDS_PER_HOUR 3600_ESMF_KIND_I8
+#define SECONDS_PER_MINUTE 60_ESMF_KIND_I8
+#define HOURS_PER_DAY 24_ESMF_KIND_I8
+
+! Note that MAX_ALARMS must match MAX_WRF_ALARMS defined in
+! ../../frame/module_domain.F !!! Eliminate this dependence with
+! grow-as-you-go AlarmList in ESMF_Clock...
+#define MAX_HISTORY 10
+#define MAX_ALARMS (2*(MAX_HISTORY)+10)
+
+! TBH: TODO: Hook this into the WRF build so WRF can use either "no-leap" or
+! TBH: Gregorian calendar. Now WRF is hard-wired to use Gregorian.
+!#undef NO_LEAP_CALENDAR
+!#ifdef COUP_CSM
+!#define NO_LEAP_CALENDAR
+!#endif
+
+! TBH: When NO_DT_COMPONENT_INIT is set, code that uses F95 compile-time
+! TBH: initialization of components of derived types is not included.
+! TBH: Some older compilers like PGI 5.x do not support this F95
+! TBH: feature.
+!#ifdef NO_LEAP_CALENDAR
+!#undef NO_DT_COMPONENT_INIT
+!#else
+!#define NO_DT_COMPONENT_INIT
+!#endif
+
+#endif
Deleted: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_Alarm.F90
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_Alarm.F90        2012-11-29 20:50:09 UTC (rev 2328)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_Alarm.F90        2012-11-29 22:23:06 UTC (rev 2329)
@@ -1,953 +0,0 @@
-!
-! Earth System Modeling Framework
-! Copyright 2002-2003, University Corporation for Atmospheric Research,
-! Massachusetts Institute of Technology, Geophysical Fluid Dynamics
-! Laboratory, University of Michigan, National Centers for Environmental
-! Prediction, Los Alamos National Laboratory, Argonne National Laboratory,
-! NASA Goddard Space Flight Center.
-! Licensed under the University of Illinois-NCSA license.
-!
-!==============================================================================
-!
-! MPAS_ESMF Alarm Module
- module MPAS_ESMF_AlarmMod
-!
-!==============================================================================
-!
-! This file contains the Alarm class definition and all Alarm class
-! methods.
-!
-!------------------------------------------------------------------------------
-! INCLUDES
-#include <MPAS_ESMF_TimeMgr.inc>
-
-!===============================================================================
-!BOPI
-!
-! !MODULE: MPAS_ESMF_AlarmMod
-!
-! !DESCRIPTION:
-! Part of Time Manager F90 API wrapper of C++ implemenation
-!
-! Defines F90 wrapper entry points for corresponding
-! C++ class {\tt ESMC\_Alarm}
-!
-! See {\tt ../include/ESMC\_Alarm.h} for complete description
-!
-!------------------------------------------------------------------------------
-! !USES:
- ! inherit from MPAS_ESMF base class
- use MPAS_ESMF_BaseMod
-
- ! associated derived types
- use MPAS_ESMF_TimeIntervalMod, only : MPAS_ESMF_TimeInterval, &
- MPAS_ESMF_TimeIntervalAbsValue
- use MPAS_ESMF_TimeMod, only : MPAS_ESMF_Time
-
- implicit none
-
-!------------------------------------------------------------------------------
-! !PRIVATE TYPES:
- private
-!------------------------------------------------------------------------------
-! ! MPAS_ESMF_Alarm
-!
-! ! F90 class type to match C++ Alarm class in size only;
-! ! all dereferencing within class is performed by C++ implementation
-
-! internals for MPAS_ESMF_Alarm
- type MPAS_ESMF_AlarmInt
- type(MPAS_ESMF_TimeInterval) :: RingInterval
- type(MPAS_ESMF_Time) :: RingTime
- type(MPAS_ESMF_Time) :: PrevRingTime
- type(MPAS_ESMF_Time) :: StopTime
- integer :: ID
- integer :: AlarmMutex
- logical :: Ringing
- logical :: Enabled
- logical :: RingTimeSet
- logical :: RingIntervalSet
- logical :: StopTimeSet
- end type
-
-! Actual public type: this bit allows easy mimic of "deep" MPAS_ESMF_AlarmCreate
-! in MPAS_ESMF 2.1.0+. Note that MPAS_ESMF_AlarmCreate is in a separate module to avoid
-! cyclic dependence.
-! NOTE: DO NOT ADD NON-POINTER STATE TO THIS DATA TYPE. It emulates MPAS_ESMF
-! shallow-copy-masquerading-as-reference-copy insanity.
- type MPAS_ESMF_Alarm
- type(MPAS_ESMF_AlarmInt), pointer :: alarmint
- end type
-
-!------------------------------------------------------------------------------
-! !PUBLIC TYPES:
- public MPAS_ESMF_Alarm
- public MPAS_ESMF_AlarmInt ! needed on AIX but not PGI
-!------------------------------------------------------------------------------
-
-! !PUBLIC MEMBER FUNCTIONS:
- public MPAS_ESMF_AlarmDestroy
- public MPAS_ESMF_AlarmSet
- public MPAS_ESMF_AlarmGet
-! public MPAS_ESMF_AlarmGetRingInterval
-! public MPAS_ESMF_AlarmSetRingInterval
-! public MPAS_ESMF_AlarmGetRingTime
-! public MPAS_ESMF_AlarmSetRingTime
- public MPAS_ESMF_AlarmGetPrevRingTime
- public MPAS_ESMF_AlarmSetPrevRingTime
-! public MPAS_ESMF_AlarmGetStopTime
-! public MPAS_ESMF_AlarmSetStopTime
- public MPAS_ESMF_AlarmEnable
- public MPAS_ESMF_AlarmDisable
- public MPAS_ESMF_AlarmRingerOn
- public MPAS_ESMF_AlarmRingerOff
- public MPAS_ESMF_AlarmIsRinging
-! public MPAS_ESMF_AlarmCheckRingTime
- public operator(==)
-
-! Required inherited and overridden MPAS_ESMF_Base class methods
-
-! public MPAS_ESMF_AlarmRead
-! public MPAS_ESMF_AlarmWrite
- public MPAS_ESMF_AlarmValidate
- public MPAS_ESMF_AlarmPrint
-
-! !PRIVATE MEMBER FUNCTIONS:
- private MPAS_ESMF_AlarmEQ
-!EOPI
-
-!==============================================================================
-!
-! INTERFACE BLOCKS
-!
-!==============================================================================
-!BOP
-! !INTERFACE:
- interface operator(==)
-
-! !PRIVATE MEMBER FUNCTIONS:
- module procedure MPAS_ESMF_AlarmEQ
-
-! !DESCRIPTION:
-! This interface overloads the == operator for the {\tt MPAS_ESMF\_Alarm} class
-!
-!EOP
- end interface
-!
-!------------------------------------------------------------------------------
-
-!==============================================================================
-
- contains
-
-!==============================================================================
-
-!------------------------------------------------------------------------------
-!
-! This section includes the Set methods.
-!
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_AlarmSet - Initializes an alarm
-
-! !INTERFACE:
- subroutine MPAS_ESMF_AlarmSet(alarm, RingTime, RingInterval, PrevRingTime, &
- StopTime, Enabled, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Alarm), intent(inout) :: alarm ! really INTENT(OUT)
- type(MPAS_ESMF_Time), intent(in), optional :: RingTime, PrevRingTime
- type(MPAS_ESMF_TimeInterval), intent(in), optional :: RingInterval
- type(MPAS_ESMF_Time), intent(in), optional :: StopTime
- logical, intent(in), optional :: Enabled
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Initializes an {\tt MPAS_ESMF\_Alarm}
-!
-! The arguments are:
-! \begin{description}
-! \item[alarm]
-! The object instance to initialize
-! \item[{[RingTime]}]
-! Optional ring time for one-shot or first repeating alarm
-! \item[{[RingInterval]}]
-! Optional ring interval for repeating alarms
-! \item[{[StopTime]}]
-! Optional stop time for repeating alarms
-! \item[Enabled]
-! Alarm enabled/disabled
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG4.1, TMG4.7
-!EOP
- IF ( ASSOCIATED( alarm%alarmint ) ) THEN
- alarm%alarmint%RingTimeSet = .FALSE.
- alarm%alarmint%RingIntervalSet = .FALSE.
- alarm%alarmint%StopTimeSet = .FALSE.
- IF ( PRESENT( RingInterval ) ) THEN
- ! force RingInterval to be positive
- alarm%alarmint%RingInterval = &
- MPAS_ESMF_TimeIntervalAbsValue( RingInterval )
- alarm%alarmint%RingIntervalSet = .TRUE.
- ENDIF
- IF ( PRESENT( PrevRingTime ) ) THEN
- alarm%alarmint%PrevRingTime = PrevRingTime
- ENDIF
- IF ( PRESENT( RingTime ) ) THEN
- alarm%alarmint%RingTime = RingTime
- alarm%alarmint%RingTimeSet = .TRUE.
- ENDIF
- IF ( PRESENT( StopTime ) ) THEN
- alarm%alarmint%StopTime = StopTime
- alarm%alarmint%StopTimeSet = .TRUE.
- ENDIF
- alarm%alarmint%Enabled = .TRUE.
- IF ( PRESENT( Enabled ) ) THEN
- alarm%alarmint%Enabled = Enabled
- ENDIF
- IF ( PRESENT( rc ) ) THEN
- rc = MPAS_ESMF_SUCCESS
- ENDIF
- alarm%alarmint%Ringing = .FALSE.
- alarm%alarmint%Enabled = .TRUE.
- ELSE
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_FAILURE
- ENDIF
-
- end subroutine MPAS_ESMF_AlarmSet
-
-
-
-! Deallocate memory for MPAS_ESMF_Alarm
- SUBROUTINE MPAS_ESMF_AlarmDestroy( alarm, rc )
- TYPE(MPAS_ESMF_Alarm), INTENT(INOUT) :: alarm
- INTEGER, INTENT( OUT), OPTIONAL :: rc
- IF ( ASSOCIATED( alarm%alarmint ) ) THEN
- DEALLOCATE( alarm%alarmint )
- ENDIF
- ! TBH: ignore deallocate errors, for now
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_SUCCESS
- END SUBROUTINE MPAS_ESMF_AlarmDestroy
-
-
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_AlarmGetRingInterval - Get an alarm's ring interval
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_AlarmGetRingInterval(alarm, RingInterval, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Alarm), intent(in) :: alarm
- type(MPAS_ESMF_TimeInterval), intent(out) :: RingInterval
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Get an {\tt MPAS_ESMF\_Alarm}'s ring interval
-!
-! The arguments are:
-! \begin{description}
-! \item[alarm]
-! The object instance to get the ring interval
-! \item[RingInterval]
-! The {\tt Alarm}'s ring interval
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-
-! !REQUIREMENTS:
-! TMG4.7
-!EOP
- RingInterval = alarm%alarmint%RingInterval
-
- end subroutine MPAS_ESMF_AlarmGetRingInterval
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_AlarmSetRingInterval - Set an alarm's ring interval
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_AlarmSetRingInterval(alarm, RingInterval, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Alarm), intent(out) :: alarm
- type(MPAS_ESMF_TimeInterval), intent(in) :: RingInterval
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Set an {\tt MPAS_ESMF\_Alarm}'s ring interval
-!
-! The arguments are:
-! \begin{description}
-! \item[alarm]
-! The object instance to set the ring interval
-! \item[RingInterval]
-! The {\tt Alarm}'s ring interval
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG4.5.2, TMG4.7
-!EOP
- CALL wrf_error_fatal( 'MPAS_ESMF_AlarmSetRingInterval not supported' )
- end subroutine MPAS_ESMF_AlarmSetRingInterval
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_AlarmGetRingTime - Get an alarm's time to ring
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_AlarmGetRingTime(alarm, RingTime, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Alarm), intent(in) :: alarm
- type(MPAS_ESMF_Time), intent(out) :: RingTime
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Get an {\tt MPAS_ESMF\_Alarm}'s time to ring
-!
-! The arguments are:
-! \begin{description}
-! \item[alarm]
-! The object instance to get the ring time
-! \item[RingTime]
-! The {\tt MPAS_ESMF\_Alarm}'s ring time
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG4.7, TMG4.8
-!EOP
- CALL wrf_error_fatal( 'MPAS_ESMF_AlarmGetRingTime not supported' )
- end subroutine MPAS_ESMF_AlarmGetRingTime
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_AlarmSetRingTime - Set an alarm's time to ring
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_AlarmSetRingTime(alarm, RingTime, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Alarm), intent(out) :: alarm
- type(MPAS_ESMF_Time), intent(in) :: RingTime
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Set an {\tt MPAS_ESMF\_Alarm}'s time to ring
-!
-! The arguments are:
-! \begin{description}
-! \item[alarm]
-! The object instance to set the ring time
-! \item[RingTime]
-! The {\tt MPAS_ESMF\_Alarm}'s ring time to set
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG4.5.1, TMG4.7, TMG4.8
-!EOP
- CALL wrf_error_fatal( 'MPAS_ESMF_AlarmSetRingTime not supported' )
- end subroutine MPAS_ESMF_AlarmSetRingTime
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_AlarmGet - Get an alarm's parameters -- compatibility with MPAS_ESMF 2.0.1
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_AlarmGet(alarm, PrevRingTime, RingInterval, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Alarm), intent(in) :: alarm
- type(MPAS_ESMF_Time), intent(out), optional :: PrevRingTime
- type(MPAS_ESMF_TimeInterval), intent(out), optional :: RingInterval
- integer, intent(out), optional :: rc
- integer :: ierr
-
-! !DESCRIPTION:
-! Get an {\tt MPAS_ESMF\_Alarm}'s previous ring time
-!
-! The arguments are:
-! \begin{description}
-! \item[alarm]
-! The object instance to get the previous ring time
-! \item[PrevRingTime]
-! The {\tt MPAS_ESMF\_Alarm}'s previous ring time
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG4.7, TMG4.8
-!EOP
-
- ierr = MPAS_ESMF_SUCCESS
-
- IF ( PRESENT(PrevRingTime) ) THEN
- CALL MPAS_ESMF_AlarmGetPrevRingTime(alarm, PrevRingTime, rc=ierr)
- ENDIF
- IF ( PRESENT(RingInterval) ) THEN
- CALL MPAS_ESMF_AlarmGetRingInterval(alarm, RingInterval, rc=ierr)
- ENDIF
-
- IF ( PRESENT(rc) ) THEN
- rc = ierr
- ENDIF
-
- end subroutine MPAS_ESMF_AlarmGet
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_AlarmGetPrevRingTime - Get an alarm's previous ring time
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_AlarmGetPrevRingTime(alarm, PrevRingTime, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Alarm), intent(in) :: alarm
- type(MPAS_ESMF_Time), intent(out) :: PrevRingTime
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Get an {\tt MPAS_ESMF\_Alarm}'s previous ring time
-!
-! The arguments are:
-! \begin{description}
-! \item[alarm]
-! The object instance to get the previous ring time
-! \item[PrevRingTime]
-! The {\tt MPAS_ESMF\_Alarm}'s previous ring time
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG4.7, TMG4.8
-!EOP
- IF ( ASSOCIATED( alarm%alarmint ) ) THEN
- PrevRingTime = alarm%alarmint%PrevRingTime
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_SUCCESS
- ELSE
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_FAILURE
- ENDIF
- end subroutine MPAS_ESMF_AlarmGetPrevRingTime
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_AlarmSetPrevRingTime - Set an alarm's previous ring time
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_AlarmSetPrevRingTime(alarm, PrevRingTime, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Alarm), intent(out) :: alarm
- type(MPAS_ESMF_Time), intent(in) :: PrevRingTime
- integer, intent(out), optional :: rc
-
- IF ( ASSOCIATED( alarm%alarmint ) ) THEN
- alarm%alarmint%PrevRingTime = PrevRingTime
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_SUCCESS
- ELSE
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_FAILURE
- ENDIF
-
- end subroutine MPAS_ESMF_AlarmSetPrevRingTime
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_AlarmGetStopTime - Get an alarm's stop time
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_AlarmGetStopTime(alarm, StopTime, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Alarm), intent(in) :: alarm
- type(MPAS_ESMF_Time), intent(out) :: StopTime
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Get an {\tt MPAS_ESMF\_Alarm}'s stop time
-!
-! The arguments are:
-! \begin{description}
-! \item[alarm]
-! The object instance to get the stop time
-! \item[StopTime]
-! The {\tt MPAS_ESMF\_Alarm}'s stop time
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG4.5.2, TMG4.7
-!EOP
- CALL wrf_error_fatal( 'MPAS_ESMF_AlarmGetStopTime not supported' )
- end subroutine MPAS_ESMF_AlarmGetStopTime
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_AlarmSetStopTime - Set an alarm's stop time
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_AlarmSetStopTime(alarm, StopTime, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Alarm), intent(out) :: alarm
- type(MPAS_ESMF_Time), intent(in) :: StopTime
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Set an {\tt MPAS_ESMF\_Alarm}'s stop time
-!
-! The arguments are:
-! \begin{description}
-! \item[alarm]
-! The object instance to set the stop time
-! \item[StopTime]
-! The {\tt MPAS_ESMF\_Alarm}'s stop time
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG4.5.2, TMG4.7
-!EOP
- CALL wrf_error_fatal( 'MPAS_ESMF_AlarmSetStopTime not supported' )
- end subroutine MPAS_ESMF_AlarmSetStopTime
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_AlarmEnable - Enables an alarm
-
-! !INTERFACE:
- subroutine MPAS_ESMF_AlarmEnable(alarm, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Alarm), intent(inout) :: alarm ! really INTENT(OUT)
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Enables an {\tt MPAS_ESMF\_Alarm} to function
-!
-! The arguments are:
-! \begin{description}
-! \item[alarm]
-! The object instance to enable
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-
-! !REQUIREMENTS:
-! TMG4.5.3
-!EOP
- IF ( ASSOCIATED( alarm%alarmint ) ) THEN
- alarm%alarmint%Enabled = .TRUE.
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_SUCCESS
- ELSE
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_FAILURE
- ENDIF
- end subroutine MPAS_ESMF_AlarmEnable
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_AlarmDisable - Disables an alarm
-
-! !INTERFACE:
- subroutine MPAS_ESMF_AlarmDisable(alarm, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Alarm), intent(inout) :: alarm ! really INTENT(OUT)
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Disables an {\tt MPAS_ESMF\_Alarm}
-!
-! The arguments are:
-! \begin{description}
-! \item[alarm]
-! The object instance to disable
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-
-! !REQUIREMENTS:
-! TMG4.5.3
-!EOP
- IF ( ASSOCIATED( alarm%alarmint ) ) THEN
- alarm%alarmint%Enabled = .FALSE.
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_SUCCESS
- ELSE
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_FAILURE
- ENDIF
- end subroutine MPAS_ESMF_AlarmDisable
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_AlarmRingerOn - Turn on an alarm
-
-
-! !INTERFACE:
- subroutine MPAS_ESMF_AlarmRingerOn(alarm, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Alarm), intent(inout) :: alarm ! really INTENT(OUT)
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Turn on an {\tt MPAS_ESMF\_Alarm}; sets ringing state
-!
-! The arguments are:
-! \begin{description}
-! \item[alarm]
-! The object instance to turn on
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG4.6
-!EOP
- IF ( ASSOCIATED( alarm%alarmint ) ) THEN
- IF ( alarm%alarmint%Enabled ) THEN
- alarm%alarmint%Ringing = .TRUE.
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_SUCCESS
- ELSE
- alarm%alarmint%Ringing = .FALSE.
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_FAILURE
- ENDIF
- ELSE
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_FAILURE
- ENDIF
-
- end subroutine MPAS_ESMF_AlarmRingerOn
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_AlarmRingerOff - Turn off an alarm
-
-! !INTERFACE:
- subroutine MPAS_ESMF_AlarmRingerOff(alarm, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Alarm), intent(inout) :: alarm ! really INTENT(OUT)
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Turn off an {\tt MPAS_ESMF\_Alarm}; unsets ringing state
-!
-! The arguments are:
-! \begin{description}
-! \item[alarm]
-! The object instance to turn off
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-
-! !REQUIREMENTS:
-! TMG4.6
-!EOP
- IF ( ASSOCIATED( alarm%alarmint ) ) THEN
- alarm%alarmint%Ringing = .FALSE.
- IF ( alarm%alarmint%Enabled ) THEN
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_SUCCESS
- ELSE
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_FAILURE
- ENDIF
- ELSE
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_FAILURE
- ENDIF
- end subroutine MPAS_ESMF_AlarmRingerOff
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_AlarmIsRinging - Check if alarm is ringing
-
-! !INTERFACE:
- function MPAS_ESMF_AlarmIsRinging(alarm, rc)
-!
-! !RETURN VALUE:
- logical :: MPAS_ESMF_AlarmIsRinging
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Alarm), intent(in) :: alarm
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Check if {\tt MPAS_ESMF\_Alarm} is ringing.
-!
-! The arguments are:
-! \begin{description}
-! \item[alarm]
-! The object instance to check for ringing state
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-
-! !REQUIREMENTS:
-! TMG4.4
-!EOP
- IF ( ASSOCIATED( alarm%alarmint ) ) THEN
- IF ( alarm%alarmint%Enabled ) THEN
- MPAS_ESMF_AlarmIsRinging = alarm%alarmint%Ringing
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_SUCCESS
- ELSE
- MPAS_ESMF_AlarmIsRinging = .FALSE.
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_FAILURE
- ENDIF
- ELSE
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_FAILURE
- ENDIF
- end function MPAS_ESMF_AlarmIsRinging
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_AlarmCheckRingTime - Method used by a clock to check whether to trigger an alarm
-!
-! !INTERFACE:
- function MPAS_ESMF_AlarmCheckRingTime(alarm, ClockCurrTime, positive, rc)
-!
-! !RETURN VALUE:
- logical :: MPAS_ESMF_AlarmCheckRingTime
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_Alarm), intent(inout) :: alarm
- type(MPAS_ESMF_Time), intent(in) :: ClockCurrTime
- integer, intent(in) :: positive
- integer, intent(out), optional :: rc
-!
-! !DESCRIPTION:
-! Main method used by a {\tt MPAS_ESMF\_Clock} to check whether to trigger
-! the {\tt MPAS_ESMF\_Alarm}
-!
-! The arguments are:
-! \begin{description}
-! \item[alarm]
-! The object instance to check if time to ring
-! \item[ClockCurrTime]
-! The {\tt MPAS_ESMF\_Clock}'s current time
-! \item[positive]
-! Whether to check ring time in the positive or negative direction
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-
-! !REQUIREMENTS:
-! TMG4.4, TMG4.6
-!EOP
- CALL wrf_error_fatal( 'MPAS_ESMF_AlarmCheckRingTime not supported' )
- MPAS_ESMF_AlarmCheckRingTime = .FALSE. ! keep compilers happy
- end function MPAS_ESMF_AlarmCheckRingTime
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_AlarmEQ - Compare two alarms for equality
-!
-! !INTERFACE:
- function MPAS_ESMF_AlarmEQ(alarm1, alarm2)
-!
-! !RETURN VALUE:
- logical :: MPAS_ESMF_AlarmEQ
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Alarm), intent(in) :: alarm1
- type(MPAS_ESMF_Alarm), intent(in) :: alarm2
-
-! !DESCRIPTION:
-! Compare two alarms for equality; return true if equal, false otherwise
-! Maps to overloaded (==) operator interface function
-!
-! The arguments are:
-! \begin{description}
-! \item[alarm1]
-! The first {\tt MPAS_ESMF\_Alarm} to compare
-! \item[alarm2]
-! The second {\tt MPAS_ESMF\_Alarm} to compare
-! \end{description}
-!
-! !REQUIREMENTS:
-!EOP
- CALL wrf_error_fatal( 'MPAS_ESMF_AlarmEQ not supported ' )
- MPAS_ESMF_AlarmEQ = .FALSE. ! keep compilers happy
- end function MPAS_ESMF_AlarmEQ
-
-!------------------------------------------------------------------------------
-!
-! This section defines the overridden Read, Write, Validate and Print methods
-! from the MPAS_ESMF_Base class
-!
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_AlarmRead - restores an alarm
-
-! !INTERFACE:
- subroutine MPAS_ESMF_AlarmRead(alarm, RingInterval, RingTime, &
- PrevRingTime, StopTime, Ringing, &
- Enabled, ID, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Alarm), intent(out) :: alarm
- type(MPAS_ESMF_TimeInterval), intent(in) :: RingInterval
- type(MPAS_ESMF_Time), intent(in) :: RingTime
- type(MPAS_ESMF_Time), intent(in) :: PrevRingTime
- type(MPAS_ESMF_Time), intent(in) :: StopTime
- logical, intent(in) :: Ringing
- logical, intent(in) :: Enabled
- integer, intent(in) :: ID
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Restores an {\tt MPAS_ESMF\_Alarm}
-!
-! The arguments are:
-! \begin{description}
-! \item[alarm]
-! The object instance to restore
-! \item[RingInterval]
-! The ring interval for repeating alarms
-! \item[RingTime]
-! Ring time for one-shot or first repeating alarm
-! \item[PrevRingTime]
-! The {\tt MPAS_ESMF\_Alarm}'s previous ring time
-! \item[StopTime]
-! Stop time for repeating alarms
-! \item[Ringing]
-! The {\tt MPAS_ESMF\_Alarm}'s ringing state
-! \item[Enabled]
-! {\tt MPAS_ESMF\_Alarm} enabled/disabled
-! \item[ID]
-! The {\tt MPAS_ESMF\_Alarm}'s ID
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-!EOP
- CALL wrf_error_fatal( 'MPAS_ESMF_AlarmRead not supported' )
- end subroutine MPAS_ESMF_AlarmRead
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_AlarmWrite - saves an alarm
-
-! !INTERFACE:
- subroutine MPAS_ESMF_AlarmWrite(alarm, RingInterval, RingTime, &
- PrevRingTime, StopTime, Ringing, &
- Enabled, ID, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Alarm), intent(in) :: alarm
- type(MPAS_ESMF_TimeInterval), intent(out) :: RingInterval
- type(MPAS_ESMF_Time), intent(out) :: RingTime
- type(MPAS_ESMF_Time), intent(out) :: PrevRingTime
- type(MPAS_ESMF_Time), intent(out) :: StopTime
- logical, intent(out) :: Ringing
- logical, intent(out) :: Enabled
- integer, intent(out) :: ID
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Saves an {\tt MPAS_ESMF\_Alarm}
-!
-! The arguments are:
-! \begin{description}
-! \item[alarm]
-! The object instance to save
-! \item[RingInterval]
-! Ring interval for repeating alarms
-! \item[RingTime]
-! Ring time for one-shot or first repeating alarm
-! \item[PrevRingTime]
-! The {\tt MPAS_ESMF\_Alarm}'s previous ring time
-! \item[StopTime]
-! Stop time for repeating alarms
-! \item[Ringing]
-! The {\tt MPAS_ESMF\_Alarm}'s ringing state
-! \item[Enabled]
-! {\tt MPAS_ESMF\_Alarm} enabled/disabled
-! \item[ID]
-! The {\tt MPAS_ESMF\_Alarm}'s ID
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-!EOP
- CALL wrf_error_fatal( 'MPAS_ESMF_AlarmWrite not supported' )
- end subroutine MPAS_ESMF_AlarmWrite
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_AlarmValidate - Validate an Alarm's properties
-
-! !INTERFACE:
- subroutine MPAS_ESMF_AlarmValidate(alarm, opts, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Alarm), intent(in) :: alarm
- character (len=*), intent(in), optional :: opts
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Perform a validation check on a {\tt MPAS_ESMF\_Alarm}'s properties
-!
-! The arguments are:
-! \begin{description}
-! \item[alarm]
-! {\tt MPAS_ESMF\_Alarm} to validate
-! \item[{[opts]}]
-! Validate options
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMGn.n.n
-!EOP
- CALL wrf_error_fatal( 'MPAS_ESMF_AlarmValidate not supported' )
- end subroutine MPAS_ESMF_AlarmValidate
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_AlarmPrint - Print out an Alarm's properties
-
-! !INTERFACE:
- subroutine MPAS_ESMF_AlarmPrint(alarm, opts, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Alarm), intent(in) :: alarm
- character (len=*), intent(in), optional :: opts
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! To support testing/debugging, print out a {\tt MPAS_ESMF\_Alarm}'s
-! properties.
-!
-! The arguments are:
-! \begin{description}
-! \item[alarm]
-! {\tt MPAS_ESMF\_Alarm} to print out
-! \item[{[opts]}]
-! Print options
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMGn.n.n
-!EOP
- CALL wrf_error_fatal( 'MPAS_ESMF_AlarmPrint not supported' )
- end subroutine MPAS_ESMF_AlarmPrint
-
-!------------------------------------------------------------------------------
-
- end module MPAS_ESMF_AlarmMod
Deleted: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_AlarmClock.F90
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_AlarmClock.F90        2012-11-29 20:50:09 UTC (rev 2328)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_AlarmClock.F90        2012-11-29 22:23:06 UTC (rev 2329)
@@ -1,96 +0,0 @@
-!
-! Earth System Modeling Framework
-! Copyright 2002-2003, University Corporation for Atmospheric Research,
-! Massachusetts Institute of Technology, Geophysical Fluid Dynamics
-! Laboratory, University of Michigan, National Centers for Environmental
-! Prediction, Los Alamos National Laboratory, Argonne National Laboratory,
-! NASA Goddard Space Flight Center.
-! Licensed under the University of Illinois-NCSA license.
-!
-!==============================================================================
-!
-! MPAS_ESMF Alarm-Clock Module
- module MPAS_ESMF_AlarmClockMod
-!
-!==============================================================================
-!
-! This file contains the AlarmCreate method.
-!
-!------------------------------------------------------------------------------
-! INCLUDES
-#include <MPAS_ESMF_TimeMgr.inc>
-
-!===============================================================================
-!BOPI
-!
-! !MODULE: MPAS_ESMF_AlarmClockMod
-!
-! !DESCRIPTION:
-! Separate module that uses both MPAS_ESMF_AlarmMod and MPAS_ESMF_ClockMod.
-! Separation is needed to avoid cyclic dependence.
-!
-! Defines F90 wrapper entry points for corresponding
-! C++ class {\tt ESMC\_Alarm}
-!
-! See {\tt ../include/ESMC\_Alarm.h} for complete description
-!
-!------------------------------------------------------------------------------
-! !USES:
- ! inherit MPAS_ESMF_Alarm and MPAS_ESMF_Clock
- use MPAS_ESMF_AlarmMod, only : MPAS_ESMF_Alarm, MPAS_ESMF_AlarmSet
- use MPAS_ESMF_ClockMod, only : MPAS_ESMF_Clock, MPAS_ESMF_ClockAddAlarm
-
- ! associated derived types
- use MPAS_ESMF_TimeIntervalMod, only : MPAS_ESMF_TimeInterval
- use MPAS_ESMF_TimeMod, only : MPAS_ESMF_Time
-
- implicit none
-
-!------------------------------------------------------------------------------
-! !PRIVATE TYPES:
- private
-!------------------------------------------------------------------------------
-
-! !PUBLIC MEMBER FUNCTIONS:
- public MPAS_ESMF_AlarmCreate
-
-!==============================================================================
-
- contains
-
-!==============================================================================
-
-
-! Create MPAS_ESMF_Alarm using MPAS_ESMF 2.1.0+ semantics
- FUNCTION MPAS_ESMF_AlarmCreate( clock, RingTime, RingInterval, &
- StopTime, Enabled, rc )
-
- ! return value
- type(MPAS_ESMF_Alarm) :: MPAS_ESMF_AlarmCreate
- ! !ARGUMENTS:
- type(MPAS_ESMF_Clock), intent(inout), optional :: clock
- type(MPAS_ESMF_Time), intent(in), optional :: RingTime
- type(MPAS_ESMF_TimeInterval), intent(in), optional :: RingInterval
- type(MPAS_ESMF_Time), intent(in), optional :: StopTime
- logical, intent(in), optional :: Enabled
- integer, intent(out), optional :: rc
- ! locals
- type(MPAS_ESMF_Alarm) :: alarmtmp
- ! TBH: ignore allocate errors, for now
- ALLOCATE( alarmtmp%alarmint )
- CALL MPAS_ESMF_AlarmSet( alarmtmp, &
- RingTime=RingTime, &
- RingInterval=RingInterval, &
- StopTime=StopTime, &
- Enabled=Enabled, &
- rc=rc )
- IF ( PRESENT ( clock ) ) THEN
- CALL MPAS_ESMF_ClockAddAlarm( clock, alarmtmp, rc )
- ENDIF
- MPAS_ESMF_AlarmCreate = alarmtmp
- END FUNCTION MPAS_ESMF_AlarmCreate
-
-
-!------------------------------------------------------------------------------
-
- end module MPAS_ESMF_AlarmClockMod
Deleted: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_Base.F90
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_Base.F90        2012-11-29 20:50:09 UTC (rev 2328)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_Base.F90        2012-11-29 22:23:06 UTC (rev 2329)
@@ -1,1082 +0,0 @@
-!
-! Earth System Modeling Framework
-! Copyright 2002-2003, University Corporation for Atmospheric Research,
-! Massachusetts Institute of Technology, Geophysical Fluid Dynamics
-! Laboratory, University of Michigan, National Centers for Environmental
-! Prediction, Los Alamos National Laboratory, Argonne National Laboratory,
-! NASA Goddard Space Flight Center.
-! Licensed under the University of Illinois-NCSA license.
-!
-! MPAS_ESMF Base Module
-!
-! (all lines between the !BOP and !EOP markers will be included in the
-! automated document processing.)
-!------------------------------------------------------------------------------
-
-!------------------------------------------------------------------------------
-! module definition
-
- module MPAS_ESMF_BaseMod
-
-!BOP
-! !MODULE: MPAS_ESMF_BaseMod - Base class for all MPAS_ESMF classes
-!
-! !DESCRIPTION:
-!
-! The code in this file implements the Base defined type
-! and functions which operate on all types. This is an
-! interface to the actual C++ base class implementation in the ../src dir.
-!
-! See the MPAS_ESMF Developers Guide document for more details.
-!
-!------------------------------------------------------------------------------
-
-! !USES:
- implicit none
-!
-! !PRIVATE TYPES:
- private
-
-!------------------------------------------------------------------------------
-!
-! Global integer parameters, used frequently
-
- integer, parameter :: MPAS_ESMF_SUCCESS = 0, MPAS_ESMF_FAILURE = -1
- integer, parameter :: MPAS_ESMF_MAXSTR = 128
- integer, parameter :: MPAS_ESMF_MAXDIM = 7, &
- MPAS_ESMF_MAXDECOMPDIM=3, &
- MPAS_ESMF_MAXGRIDDIM=2
-
- integer, parameter :: MPAS_ESMF_MAJOR_VERSION = 2
- integer, parameter :: MPAS_ESMF_MINOR_VERSION = 1
- integer, parameter :: MPAS_ESMF_REVISION = 1
- integer, parameter :: MPAS_ESMF_PATCHLEVEL = 0
- character(32), parameter :: MPAS_ESMF_VERSION_STRING = "2.1.1"
-
-!------------------------------------------------------------------------------
-!
- type MPAS_ESMF_Status
- private
- integer :: status
- end type
-
- type(MPAS_ESMF_Status), parameter :: MPAS_ESMF_STATE_UNINIT = MPAS_ESMF_Status(1), &
- MPAS_ESMF_STATE_READY = MPAS_ESMF_Status(2), &
- MPAS_ESMF_STATE_UNALLOCATED = MPAS_ESMF_Status(3), &
- MPAS_ESMF_STATE_ALLOCATED = MPAS_ESMF_Status(4), &
- MPAS_ESMF_STATE_BUSY = MPAS_ESMF_Status(5), &
- MPAS_ESMF_STATE_INVALID = MPAS_ESMF_Status(6)
-
-!------------------------------------------------------------------------------
-!
- type MPAS_ESMF_Pointer
- private
- integer*8 :: ptr
- end type
-
- type(MPAS_ESMF_Pointer), parameter :: MPAS_ESMF_NULL_POINTER = MPAS_ESMF_Pointer(0), &
- MPAS_ESMF_BAD_POINTER = MPAS_ESMF_Pointer(-1)
-
-
-!------------------------------------------------------------------------------
-!
- !! TODO: I believe if we define an assignment(=) operator to convert
- !! a datatype into integer, then we could use the type and kind as
- !! targets in a select case() statement and make the contents private.
- !! (see pg 248 of the "big book")
- type MPAS_ESMF_DataType
- !!private
- integer :: dtype
- end type
-
- type(MPAS_ESMF_DataType), parameter :: MPAS_ESMF_DATA_INTEGER = MPAS_ESMF_DataType(1), &
- MPAS_ESMF_DATA_REAL = MPAS_ESMF_DataType(2), &
- MPAS_ESMF_DATA_LOGICAL = MPAS_ESMF_DataType(3), &
- MPAS_ESMF_DATA_CHARACTER = MPAS_ESMF_DataType(4)
-
-!------------------------------------------------------------------------------
-
- integer, parameter :: &
- MPAS_ESMF_KIND_I1 = selected_int_kind(2), &
- MPAS_ESMF_KIND_I2 = selected_int_kind(4), &
- MPAS_ESMF_KIND_I4 = selected_int_kind(9), &
- MPAS_ESMF_KIND_I8 = selected_int_kind(18), &
- MPAS_ESMF_KIND_R4 = selected_real_kind(3,25), &
- MPAS_ESMF_KIND_R8 = selected_real_kind(6,45), &
- MPAS_ESMF_KIND_C8 = selected_real_kind(3,25), &
- MPAS_ESMF_KIND_C16 = selected_real_kind(6,45)
-
-!------------------------------------------------------------------------------
-
- type MPAS_ESMF_DataValue
- private
- type(MPAS_ESMF_DataType) :: dt
- integer :: rank
- ! how do you do values of all types here ? TODO
- ! in C++ i'd do a union w/ overloaded access funcs
- integer :: vi
- !integer, dimension (:), pointer :: vip
- !real :: vr
- !real, dimension (:), pointer :: vrp
- !logical :: vl
- !logical, pointer :: vlp
- !character (len=MPAS_ESMF_MAXSTR) :: vc
- !character, pointer :: vcp
- end type
-
-!------------------------------------------------------------------------------
-!
- type MPAS_ESMF_Attribute
- private
- character (len=MPAS_ESMF_MAXSTR) :: attr_name
- type (MPAS_ESMF_DataType) :: attr_type
- type (MPAS_ESMF_DataValue) :: attr_value
- end type
-
-!------------------------------------------------------------------------------
-!
- !! TODO: this should be a shallow object, with a simple init() and
- !! get() function, and the contents should go back to being private.
- type MPAS_ESMF_AxisIndex
-! !!private
- integer :: l
- integer :: r
- integer :: max
- integer :: decomp
- integer :: gstart
- end type
-
- !! TODO: same comment as above.
- type MPAS_ESMF_MemIndex
-! !!private
- integer :: l
- integer :: r
- integer :: str
- integer :: num
- end type
-
-!------------------------------------------------------------------------------
-!
- type MPAS_ESMF_BasePointer
- private
- integer*8 :: base_ptr
- end type
-
- integer :: global_count = 0
-
-!------------------------------------------------------------------------------
-!
-! ! WARNING: must match corresponding values in ../include/ESMC_Base.h
- type MPAS_ESMF_Logical
- private
- integer :: value
- end type
-
- type(MPAS_ESMF_Logical), parameter :: MPAS_ESMF_TF_UNKNOWN = MPAS_ESMF_Logical(1), &
- MPAS_ESMF_TF_TRUE = MPAS_ESMF_Logical(2), &
- MPAS_ESMF_TF_FALSE = MPAS_ESMF_Logical(3)
-
-!------------------------------------------------------------------------------
-!
- type MPAS_ESMF_Base
- private
- integer :: ID
- integer :: ref_count
- type (MPAS_ESMF_Status) :: base_status
- character (len=MPAS_ESMF_MAXSTR) :: name
- end type
-
-! !PUBLIC TYPES:
-
- public MPAS_ESMF_STATE_INVALID
-! public MPAS_ESMF_STATE_UNINIT, MPAS_ESMF_STATE_READY, &
-! MPAS_ESMF_STATE_UNALLOCATED, MPAS_ESMF_STATE_ALLOCATED, &
-! MPAS_ESMF_STATE_BUSY
-
- public MPAS_ESMF_DATA_INTEGER, MPAS_ESMF_DATA_REAL, &
- MPAS_ESMF_DATA_LOGICAL, MPAS_ESMF_DATA_CHARACTER
-
- public MPAS_ESMF_KIND_I1, MPAS_ESMF_KIND_I2, MPAS_ESMF_KIND_I4, MPAS_ESMF_KIND_I8, &
- MPAS_ESMF_KIND_R4, MPAS_ESMF_KIND_R8, MPAS_ESMF_KIND_C8, MPAS_ESMF_KIND_C16
-
- public MPAS_ESMF_NULL_POINTER, MPAS_ESMF_BAD_POINTER
-
-
- public MPAS_ESMF_FAILURE, MPAS_ESMF_SUCCESS
- public MPAS_ESMF_MAXSTR
- public MPAS_ESMF_MAXDIM, MPAS_ESMF_MAXDECOMPDIM, MPAS_ESMF_MAXGRIDDIM
-
- public MPAS_ESMF_MAJOR_VERSION, MPAS_ESMF_MINOR_VERSION, MPAS_ESMF_REVISION
- public MPAS_ESMF_VERSION_STRING
-
- public MPAS_ESMF_Status, MPAS_ESMF_Pointer, MPAS_ESMF_DataType
- public MPAS_ESMF_DataValue, MPAS_ESMF_Attribute
-! public MPAS_ESMF_MemIndex
-! public MPAS_ESMF_BasePointer
- public MPAS_ESMF_Base
-
- public MPAS_ESMF_AxisIndex, MPAS_ESMF_AxisIndexGet
-! public MPAS_ESMF_AxisIndexInit
- public MPAS_ESMF_Logical
-! public MPAS_ESMF_TF_TRUE, MPAS_ESMF_TF_FALSE
-
-! !PUBLIC MEMBER FUNCTIONS:
-!
-! !DESCRIPTION:
-! The following routines apply to any type in the system.
-! The attribute routines can be inherited as-is. The other
-! routines need to be specialized by the higher level objects.
-!
-! Base class methods
-! public MPAS_ESMF_BaseInit
-
-! public MPAS_ESMF_BaseGetConfig
-! public MPAS_ESMF_BaseSetConfig
-
-! public MPAS_ESMF_BaseGetInstCount
-
-! public MPAS_ESMF_BaseSetID
-! public MPAS_ESMF_BaseGetID
-
-! public MPAS_ESMF_BaseSetRefCount
-! public MPAS_ESMF_BaseGetRefCount
-
-! public MPAS_ESMF_BaseSetStatus
-! public MPAS_ESMF_BaseGetStatus
-
-! Virtual methods to be defined by derived classes
-! public MPAS_ESMF_Read
-! public MPAS_ESMF_Write
-! public MPAS_ESMF_Validate
-! public MPAS_ESMF_Print
-
-! Attribute methods
- public MPAS_ESMF_AttributeSet
- public MPAS_ESMF_AttributeGet
- public MPAS_ESMF_AttributeGetCount
- public MPAS_ESMF_AttributeGetbyNumber
- public MPAS_ESMF_AttributeGetNameList
- public MPAS_ESMF_AttributeSetList
- public MPAS_ESMF_AttributeGetList
- public MPAS_ESMF_AttributeSetObjectList
- public MPAS_ESMF_AttributeGetObjectList
- public MPAS_ESMF_AttributeCopy
- public MPAS_ESMF_AttributeCopyAll
-
-! Misc methods
- public MPAS_ESMF_SetName
- public MPAS_ESMF_GetName
- public MPAS_ESMF_SetPointer
- public MPAS_ESMF_SetNullPointer
- public MPAS_ESMF_GetPointer
-
-! Print methods for calling by higher level print functions
-! (they have little formatting other than the actual values)
- public MPAS_ESMF_StatusString, MPAS_ESMF_DataTypeString
-
-! Overloaded = operator functions
- public operator(.eq.), operator(.ne.), assignment(=)
-!
-!
-!EOP
-
-!------------------------------------------------------------------------------
-
-! overload .eq. & .ne. with additional derived types so you can compare
-! them as if they were simple integers.
-
-
-interface operator (.eq.)
- module procedure MPAS_ESMF_sfeq
- module procedure MPAS_ESMF_dteq
- module procedure MPAS_ESMF_pteq
- module procedure MPAS_ESMF_tfeq
- module procedure MPAS_ESMF_aieq
-end interface
-
-interface operator (.ne.)
- module procedure MPAS_ESMF_sfne
- module procedure MPAS_ESMF_dtne
- module procedure MPAS_ESMF_ptne
- module procedure MPAS_ESMF_tfne
- module procedure MPAS_ESMF_aine
-end interface
-
-interface assignment (=)
- module procedure MPAS_ESMF_dtas
- module procedure MPAS_ESMF_ptas
-end interface
-
-!------------------------------------------------------------------------------
-
- contains
-
-!------------------------------------------------------------------------------
-! function to compare two MPAS_ESMF_Status flags to see if they're the same or not
-
-function MPAS_ESMF_sfeq(sf1, sf2)
- logical MPAS_ESMF_sfeq
- type(MPAS_ESMF_Status), intent(in) :: sf1, sf2
-
- MPAS_ESMF_sfeq = (sf1%status .eq. sf2%status)
-end function
-
-function MPAS_ESMF_sfne(sf1, sf2)
- logical MPAS_ESMF_sfne
- type(MPAS_ESMF_Status), intent(in) :: sf1, sf2
-
- MPAS_ESMF_sfne = (sf1%status .ne. sf2%status)
-end function
-
-!------------------------------------------------------------------------------
-! function to compare two MPAS_ESMF_DataTypes to see if they're the same or not
-
-function MPAS_ESMF_dteq(dt1, dt2)
- logical MPAS_ESMF_dteq
- type(MPAS_ESMF_DataType), intent(in) :: dt1, dt2
-
- MPAS_ESMF_dteq = (dt1%dtype .eq. dt2%dtype)
-end function
-
-function MPAS_ESMF_dtne(dt1, dt2)
- logical MPAS_ESMF_dtne
- type(MPAS_ESMF_DataType), intent(in) :: dt1, dt2
-
- MPAS_ESMF_dtne = (dt1%dtype .ne. dt2%dtype)
-end function
-
-subroutine MPAS_ESMF_dtas(intval, dtval)
- integer, intent(out) :: intval
- type(MPAS_ESMF_DataType), intent(in) :: dtval
-
- intval = dtval%dtype
-end subroutine
-
-
-!------------------------------------------------------------------------------
-! function to compare two MPAS_ESMF_Pointers to see if they're the same or not
-
-function MPAS_ESMF_pteq(pt1, pt2)
- logical MPAS_ESMF_pteq
- type(MPAS_ESMF_Pointer), intent(in) :: pt1, pt2
-
- MPAS_ESMF_pteq = (pt1%ptr .eq. pt2%ptr)
-end function
-
-function MPAS_ESMF_ptne(pt1, pt2)
- logical MPAS_ESMF_ptne
- type(MPAS_ESMF_Pointer), intent(in) :: pt1, pt2
-
- MPAS_ESMF_ptne = (pt1%ptr .ne. pt2%ptr)
-end function
-
-subroutine MPAS_ESMF_ptas(ptval, intval)
- type(MPAS_ESMF_Pointer), intent(out) :: ptval
- integer, intent(in) :: intval
-
- ptval%ptr = intval
-end subroutine
-
-!------------------------------------------------------------------------------
-! function to compare two MPAS_ESMF_Logicals to see if they're the same or not
-! also need assignment to real f90 logical?
-
-function MPAS_ESMF_tfeq(tf1, tf2)
- logical MPAS_ESMF_tfeq
- type(MPAS_ESMF_Logical), intent(in) :: tf1, tf2
-
- MPAS_ESMF_tfeq = (tf1%value .eq. tf2%value)
-end function
-
-function MPAS_ESMF_tfne(tf1, tf2)
- logical MPAS_ESMF_tfne
- type(MPAS_ESMF_Logical), intent(in) :: tf1, tf2
-
- MPAS_ESMF_tfne = (tf1%value .ne. tf2%value)
-end function
-
-!------------------------------------------------------------------------------
-! function to compare two MPAS_ESMF_AxisIndex to see if they're the same or not
-
-function MPAS_ESMF_aieq(ai1, ai2)
- logical MPAS_ESMF_aieq
- type(MPAS_ESMF_AxisIndex), intent(in) :: ai1, ai2
-
- MPAS_ESMF_aieq = ((ai1%l .eq. ai2%l) .and. &
- (ai1%r .eq. ai2%r) .and. &
- (ai1%max .eq. ai2%max) .and. &
- (ai1%decomp .eq. ai2%decomp) .and. &
- (ai1%gstart .eq. ai2%gstart))
-
-end function
-
-function MPAS_ESMF_aine(ai1, ai2)
- logical MPAS_ESMF_aine
- type(MPAS_ESMF_AxisIndex), intent(in) :: ai1, ai2
-
- MPAS_ESMF_aine = ((ai1%l .ne. ai2%l) .or. &
- (ai1%r .ne. ai2%r) .or. &
- (ai1%max .ne. ai2%max) .or. &
- (ai1%decomp .ne. ai2%decomp) .or. &
- (ai1%gstart .ne. ai2%gstart))
-
-end function
-
-!------------------------------------------------------------------------------
-!------------------------------------------------------------------------------
-!
-! Base methods
-!
-!------------------------------------------------------------------------------
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_BaseInit - initialize a Base object
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_BaseInit(base, rc)
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_Base) :: base
- integer, intent(out), optional :: rc
-
-!
-! !DESCRIPTION:
-! Set initial state on a Base object.
-!
-! \begin{description}
-! \item [base]
-! In the Fortran interface, this must in fact be a {\tt Base}
-! derived type object. It is expected that all specialized
-! derived types will include a {\tt Base} object as the first
-! entry.
-! \item [{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-!
-! \end{description}
-!
-!EOP
-
- logical :: rcpresent ! Return code present
-
-! !Initialize return code
- rcpresent = .FALSE.
- if(present(rc)) then
- rcpresent = .TRUE.
- rc = MPAS_ESMF_FAILURE
- endif
-
- global_count = global_count + 1
- base%ID = global_count
- base%ref_count = 1
- base%base_status = MPAS_ESMF_STATE_READY
- base%name = "undefined"
-
- if (rcpresent) rc = MPAS_ESMF_SUCCESS
-
- end subroutine MPAS_ESMF_BaseInit
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_SetName - set the name of this object
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_SetName(anytype, name, namespace, rc)
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_Base) :: anytype
- character (len = *), intent(in), optional :: name
- character (len = *), intent(in), optional :: namespace
- integer, intent(out), optional :: rc
-
-!
-! !DESCRIPTION:
-! Associate a name with any object in the system.
-!
-! \begin{description}
-! \item [anytype]
-! In the Fortran interface, this must in fact be a {\tt Base}
-! derived type object. It is expected that all specialized
-! derived types will include a {\tt Base} object as the first
-! entry.
-! \item [[name]]
-! Object name. An error will be returned if a duplicate name
-! is specified. If a name is not given a unique name will be
-! generated and can be queried by the {\tt MPAS_ESMF_GetName} routine.
-! \item [[namespace]]
-! Object namespace (e.g. "Application", "Component", "Grid", etc).
-! If given, the name will be checked that it is unique within
-! this namespace. If not given, the generated name will be
-! unique within this namespace. If namespace is not specified,
-! a default "global" namespace will be assumed and the same rules
-! for names will be followed.
-! \item [[rc]]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-!
-! \end{description}
-!
-!
-
-!
-!EOP
-! !REQUIREMENTS: FLD1.5, FLD1.5.3
- logical :: rcpresent ! Return code present
- character (len = MPAS_ESMF_MAXSTR) :: ournamespace ! Namespace if not given
- character (len = MPAS_ESMF_MAXSTR) :: defaultname ! Name if not given
- integer, save :: seqnum = 0 ! HACK - generate uniq names
- ! but not coordinated across procs
-
-! !Initialize return code
- rcpresent = .FALSE.
- if(present(rc)) then
- rcpresent = .TRUE.
- rc = MPAS_ESMF_FAILURE
- endif
-
-! ! TODO: this code should generate a unique name if a name
-! ! is not given. If a namespace is given, the name has to
-! ! be unique within that namespace. Example namespaces could
-! ! be: Applications, Components, Fields/Bundles, Grids.
-!
-! ! Construct a default namespace if one is not given
- if((.not. present(namespace)) .or. (namespace .eq. "")) then
- ournamespace = "global"
- else
- ournamespace = namespace
- endif
-! ! Construct a default name if one is not given
- if((.not. present(name)) .or. (name .eq. "")) then
-
- write(defaultname, 20) trim(ournamespace), seqnum
-20 format(A,I3.3)
- seqnum = seqnum + 1
- anytype%name = defaultname
- else
- anytype%name = name
- endif
-
- if (rcpresent) rc = MPAS_ESMF_SUCCESS
-
- end subroutine MPAS_ESMF_SetName
-
-!-------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_GetName - get the name of this object
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_GetName(anytype, name, rc)
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_Base), intent(in) :: anytype ! any MPAS_ESMF object/type
- character (len = *), intent(out) :: name ! object/type name
- integer, intent(out), optional :: rc ! return code
-
-!
-! !DESCRIPTION:
-! Return the name of any type in the system.
-
-!
-!EOP
-! !REQUIREMENTS: FLD1.5, FLD1.5.3
-
- name = anytype%name
- if (present(rc)) rc = MPAS_ESMF_SUCCESS
-
- end subroutine MPAS_ESMF_GetName
-
-
-!-------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_AttributeSet - set attribute on an MPAS_ESMF type
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_AttributeSet(anytype, name, value, rc)
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_Base), intent(in) :: anytype ! any MPAS_ESMF type
- character (len = *), intent(in) :: name ! attribute name
- type(MPAS_ESMF_DataValue), intent(in) :: value ! attribute value
- integer, intent(out), optional :: rc ! return code
-
-!
-! !DESCRIPTION:
-! Associate a (name,value) pair with any type in the system.
-
-!
-!EOP
-! !REQUIREMENTS: FLD1.5, FLD1.5.3
-
- end subroutine MPAS_ESMF_AttributeSet
-
-
-!-------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_AttributeGet - get attribute from an MPAS_ESMF type
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_AttributeGet(anytype, name, type, value, rc)
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_Base), intent(in) :: anytype ! any MPAS_ESMF type
- character (len = *), intent(in) :: name ! attribute name
- type(MPAS_ESMF_DataType), intent(out) :: type ! all possible data types
- type(MPAS_ESMF_DataValue), intent(out) :: value ! attribute value
- integer, intent(out), optional :: rc ! return code
-
-!
-! !DESCRIPTION:
-
-!
-!EOP
-! !REQUIREMENTS: FLD1.5.1, FLD1.5.3
-
- end subroutine MPAS_ESMF_AttributeGet
-
-
-!-------------------------------------------------------------------------
-!BOP
-!
-! !IROUTINE: MPAS_ESMF_AttributeGetCount - get an MPAS_ESMF object's number of attributes
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_AttributeGetCount(anytype, count, rc)
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_Base), intent(in) :: anytype ! any MPAS_ESMF type
- integer, intent(out) :: count ! attribute count
- integer, intent(out), optional :: rc ! return code
-
-!
-! !DESCRIPTION:
-! Returns number of attributes present.
-
-!
-!EOP
-! !REQUIREMENTS: FLD1.7.5
-
- end subroutine MPAS_ESMF_AttributeGetCount
-
-
-!-------------------------------------------------------------------------
-!BOP
-!
-! !IROUTINE: MPAS_ESMF_AttributeGetbyNumber - get an MPAS_ESMF object's attribute by num ber
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_AttributeGetbyNumber(anytype, number, name, type, value, rc)
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_Base), intent(in) :: anytype ! any MPAS_ESMF type
- integer, intent(in) :: number ! attribute number
- character (len = *), intent(in) :: name ! attribute name
- type(MPAS_ESMF_DataType), intent(out) :: type ! all possible data types
- type(MPAS_ESMF_DataValue), intent(out) :: value ! attribute value
- integer, intent(out), optional :: rc ! return code
-
-!
-! !DESCRIPTION:
-! Allows the caller to get attributes by number instead of by name.
-! This can be useful in iterating through all attributes in a loop.
-!
-!EOP
-! !REQUIREMENTS:
-
- end subroutine MPAS_ESMF_AttributeGetbyNumber
-
-
-!-------------------------------------------------------------------------
-!BOP
-!
-!IROUTINE: MPAS_ESMF_AttributeGetNameList - get an MPAS_ESMF object's attribute name list
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_AttributeGetNameList(anytype, count, namelist, rc)
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_Base), intent(in) :: anytype ! any MPAS_ESMF type
- integer, intent(out) :: count ! attribute count
- character (len = *), dimension (:), intent(out) :: namelist ! attribute names
- integer, intent(out), optional :: rc ! return code
-
-!
-! !DESCRIPTION:
-! Return a list of all attribute names without returning the values.
-
-!
-!EOP
-! !REQUIREMENTS: FLD1.7.3
-
- end subroutine MPAS_ESMF_AttributeGetNameList
-
-
-!-------------------------------------------------------------------------
-!BOP
-!
-! !IROUTINE: MPAS_ESMF_AttributeSetList - set an MPAS_ESMF object's attributes
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_AttributeSetList(anytype, namelist, valuelist, rc)
-
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_Base), intent(in) :: anytype ! any MPAS_ESMF type
- character (len = *), dimension (:), intent(in) :: namelist ! attribute names
- type(MPAS_ESMF_DataValue), dimension (:), intent(in) :: valuelist ! attribute values
- integer, intent(out), optional :: rc ! return code
-
-!
-! !DESCRIPTION:
-! Set multiple attributes on an object in one call. Depending on what is
-! allowed by the interface, all attributes may have to have the same type.
-!
-!EOP
-! !REQUIREMENTS: (none. added for completeness)
-
- end subroutine MPAS_ESMF_AttributeSetList
-
-
-!-------------------------------------------------------------------------
-!BOP
-!
-! !IROUTINE: MPAS_ESMF_AttributeGetList - get an MPAS_ESMF object's attributes
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_AttributeGetList(anytype, namelist, typelist, valuelist, rc)
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_Base), intent(in) :: anytype ! any MPAS_ESMF type
- character (len = *), dimension (:), intent(in) :: namelist ! attribute names
- type(MPAS_ESMF_DataType), dimension (:), intent(out) :: typelist ! all possible data types
- type(MPAS_ESMF_DataValue), dimension (:), intent(out) :: valuelist ! attribute values
- integer, intent(out), optional :: rc ! return code
-
-!
-! !DESCRIPTION:
-! Get multiple attributes from an object in a single call.
-
-!
-!EOP
-! !REQUIREMENTS: FLD1.7.4
-
- end subroutine MPAS_ESMF_AttributeGetList
-
-
-!-------------------------------------------------------------------------
-!BOP
-!
-! !IROUTINE: MPAS_ESMF_AttributeSetObjectList - set an attribute on multiple MPAS_ESMF objects
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_AttributeSetObjectList(anytypelist, name, value, rc)
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_Base), dimension (:), intent(in) :: anytypelist ! list of any MPAS_ESMF types
- character (len = *), intent(in) :: name ! attribute name
- type(MPAS_ESMF_DataValue), dimension (:), intent(in) :: value ! attribute value
- integer, intent(out), optional :: rc ! return code
-
-!
-! !DESCRIPTION:
-! Set the same attribute on multiple objects in one call.
-
-!
-!EOP
-! !REQUIREMENTS: FLD1.5.5 (pri 2)
-
- end subroutine MPAS_ESMF_AttributeSetObjectList
-
-
-!-------------------------------------------------------------------------
-!BOP
-!
-!
-! !IROUTINE: MPAS_ESMF_AttributeGetObjectList - get an attribute from multiple MPAS_ESMF objects
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_AttributeGetObjectList(anytypelist, name, typelist, valuelist, rc)
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_Base), dimension (:), intent(in) :: anytypelist ! list of any MPAS_ESMF types
- character (len = *), intent(in) :: name ! attribute name
- type(MPAS_ESMF_DataType), dimension (:), intent(out) :: typelist ! all possible data types
- type(MPAS_ESMF_DataValue), dimension (:), intent(out) :: valuelist ! attribute values
- integer, intent(out), optional :: rc ! return code
-
-!
-! !DESCRIPTION:
-! Get the same attribute name from multiple objects in one call.
-
-!
-!EOP
-! !REQUIREMENTS: FLD1.5.5 (pri 2)
-
- end subroutine MPAS_ESMF_AttributeGetObjectList
-
-
-!-------------------------------------------------------------------------
-!BOP
-!
-! !IROUTINE: MPAS_ESMF_AttributeCopy - copy an attribute between two objects
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_AttributeCopy(name, source, destination, rc)
-!
-! !ARGUMENTS:
- character (len = *), intent(in) :: name ! attribute name
- type(MPAS_ESMF_Base), intent(in) :: source ! any MPAS_ESMF type
- type(MPAS_ESMF_Base), intent(in) :: destination ! any MPAS_ESMF type
- integer, intent(out), optional :: rc ! return code
-
-!
-! !DESCRIPTION:
-! The specified attribute associated with the source object is
-! copied to the destination object. << does this assume overwriting the
-! attribute if it already exists in the output or does this require yet
-! another arg to say what to do with collisions? >>
-
-
-!
-!EOP
-! !REQUIREMENTS: FLD1.5.4
-
- end subroutine MPAS_ESMF_AttributeCopy
-
-
-!-------------------------------------------------------------------------
-!BOP
-!
-!IROUTINE: ESMC_AttributeCopyAll - copy attributes between two objects
-
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_AttributeCopyAll(source, destination, rc)
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_Base), intent(in) :: source ! any MPAS_ESMF type
- type(MPAS_ESMF_Base), intent(in) :: destination ! any MPAS_ESMF type
- integer, intent(out), optional :: rc ! return code
-
-!
-! !DESCRIPTION:
-! All attributes associated with the source object are copied to the
-! destination object. Some attributes will have to be considered
-! {\tt read only} and won't be updated by this call. (e.g. an attribute
-! like {\tt name} must be unique and therefore can't be duplicated.)
-
-!
-!EOP
-! !REQUIREMENTS: FLD1.5.4
-
- end subroutine MPAS_ESMF_AttributeCopyAll
-
-!=========================================================================
-! Misc utility routines, perhaps belongs in a utility file?
-!-------------------------------------------------------------------------
-!BOP
-!
-!IROUTINE: ESMC_AxisIndexInit - initialize an AxisIndex object
-
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_AxisIndexInit(ai, l, r, max, decomp, gstart, rc)
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_AxisIndex), intent(inout) :: ai
- integer, intent(in) :: l, r, max, decomp, gstart
- integer, intent(out), optional :: rc
-!
-! !DESCRIPTION:
-! Set the contents of an AxisIndex type.
-
-!
-!EOP
-! !REQUIREMENTS:
-
- ai%l = l
- ai%r = r
- ai%max = max
- ai%decomp = decomp
- ai%gstart = gstart
-
- if (present(rc)) rc = MPAS_ESMF_SUCCESS
-
- end subroutine MPAS_ESMF_AxisIndexInit
-
-!BOP
-!
-!IROUTINE: ESMC_AxisIndexInit - initialize an AxisIndex object
-
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_AxisIndexGet(ai, l, r, max, decomp, gstart, rc)
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_AxisIndex), intent(inout) :: ai
- integer, intent(out), optional :: l, r, max, decomp, gstart
- integer, intent(out), optional :: rc
-!
-! !DESCRIPTION:
-! Get the contents of an AxisIndex type.
-
-!
-!EOP
-! !REQUIREMENTS:
-
- if (present(l)) l = ai%l
- if (present(r)) r = ai%r
- if (present(max)) max = ai%max
- if (present(decomp)) decomp = ai%decomp
- if (present(gstart)) gstart = ai%gstart
-
- if (present(rc)) rc = MPAS_ESMF_SUCCESS
-
- end subroutine MPAS_ESMF_AxisIndexGet
-
-!-------------------------------------------------------------------------
-!-------------------------------------------------------------------------
-!BOP
-!
-!IROUTINE: MPAS_ESMF_SetPointer - set an opaque value
-
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_SetPointer(ptype, contents, rc)
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_Pointer) :: ptype
- integer*8, intent(in) :: contents
- integer, intent(out), optional :: rc
-
-!
-! !DESCRIPTION:
-! Set the contents of an opaque pointer type.
-
-!
-!EOP
-! !REQUIREMENTS:
- ptype%ptr = contents
- if (present(rc)) rc = MPAS_ESMF_SUCCESS
-
- end subroutine MPAS_ESMF_SetPointer
-
-!-------------------------------------------------------------------------
-!BOP
-!
-!IROUTINE: MPAS_ESMF_SetNullPointer - set an opaque value
-
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_SetNullPointer(ptype, rc)
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_Pointer) :: ptype
- integer, intent(out), optional :: rc
-
-!
-! !DESCRIPTION:
-! Set the contents of an opaque pointer type.
-
-!
-!EOP
-! !REQUIREMENTS:
- integer*8, parameter :: nullp = 0
-
- ptype%ptr = nullp
- if (present(rc)) rc = MPAS_ESMF_SUCCESS
-
- end subroutine MPAS_ESMF_SetNullPointer
-!-------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_GetPointer - get an opaque value
-!
-! !INTERFACE:
- function MPAS_ESMF_GetPointer(ptype, rc)
-!
-! !RETURN VALUE:
- integer*8 :: MPAS_ESMF_GetPointer
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Pointer), intent(in) :: ptype
- integer, intent(out), optional :: rc
-
-!
-! !DESCRIPTION:
-! Get the contents of an opaque pointer type.
-
-!
-!EOP
-! !REQUIREMENTS:
- MPAS_ESMF_GetPointer = ptype%ptr
- if (present(rc)) rc = MPAS_ESMF_SUCCESS
-
- end function MPAS_ESMF_GetPointer
-
-!-------------------------------------------------------------------------
-! misc print routines
-!-------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_StatusString - Return status as a string
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_StatusString(status, string, rc)
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_Status), intent(in) :: status
- character(len=*), intent(out) :: string
- integer, intent(out), optional :: rc
-
-!
-! !DESCRIPTION:
-! Return a status variable as a string.
-
-!
-!EOP
-! !REQUIREMENTS:
-
- if (status .eq. MPAS_ESMF_STATE_UNINIT) string = "Uninitialized"
- if (status .eq. MPAS_ESMF_STATE_READY) string = "Ready"
- if (status .eq. MPAS_ESMF_STATE_UNALLOCATED) string = "Unallocated"
- if (status .eq. MPAS_ESMF_STATE_ALLOCATED) string = "Allocated"
- if (status .eq. MPAS_ESMF_STATE_BUSY) string = "Busy"
- if (status .eq. MPAS_ESMF_STATE_INVALID) string = "Invalid"
-
- if (present(rc)) rc = MPAS_ESMF_SUCCESS
-
- end subroutine MPAS_ESMF_StatusString
-
-!-------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_DataTypeString - Return DataType as a string
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_DataTypeString(datatype, string, rc)
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_DataType), intent(in) :: datatype
- character(len=*), intent(out) :: string
- integer, intent(out), optional :: rc
-
-!
-! !DESCRIPTION:
-! Return a datatype variable as a string.
-
-!
-!EOP
-! !REQUIREMENTS:
-
- if (datatype .eq. MPAS_ESMF_DATA_INTEGER) string = "Integer"
- if (datatype .eq. MPAS_ESMF_DATA_REAL) string = "Real"
- if (datatype .eq. MPAS_ESMF_DATA_LOGICAL) string = "Logical"
- if (datatype .eq. MPAS_ESMF_DATA_CHARACTER) string = "Character"
-
- if (present(rc)) rc = MPAS_ESMF_SUCCESS
-
- end subroutine MPAS_ESMF_DataTypeString
-
-!-------------------------------------------------------------------------
-!
-!-------------------------------------------------------------------------
-! put Print and Validate skeletons here - but they should be
-! overridden by higher level more specialized functions.
-!-------------------------------------------------------------------------
-
- end module MPAS_ESMF_BaseMod
Deleted: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_BaseTime.F90
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_BaseTime.F90        2012-11-29 20:50:09 UTC (rev 2328)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_BaseTime.F90        2012-11-29 22:23:06 UTC (rev 2329)
@@ -1,318 +0,0 @@
-!
-! Earth System Modeling Framework
-! Copyright 2002-2003, University Corporation for Atmospheric Research,
-! Massachusetts Institute of Technology, Geophysical Fluid Dynamics
-! Laboratory, University of Michigan, National Centers for Environmental
-! Prediction, Los Alamos National Laboratory, Argonne National Laboratory,
-! NASA Goddard Space Flight Center.
-! Licensed under the University of Illinois-NCSA license.
-!
-!==============================================================================
-!
-! MPAS_ESMF BaseTime Module
- module MPAS_ESMF_BaseTimeMod
-!
-!==============================================================================
-!
-! This file contains the BaseTime class definition and all BaseTime class
-! methods.
-!
-!------------------------------------------------------------------------------
-! INCLUDES
-
-#include <MPAS_ESMF_TimeMgr.inc>
-!
-!===============================================================================
-!BOPI
-! !MODULE: MPAS_ESMF_BaseTimeMod - Base MPAS_ESMF time definition
-!
-! !DESCRIPTION:
-! Part of Time Manager F90 API wrapper of C++ implemenation
-!
-! This module serves only as the common Time definition inherited
-! by {\tt MPAS_ESMF\_TimeInterval} and {\tt MPAS_ESMF\_Time}
-!
-! See {\tt ../include/ESMC\_BaseTime.h} for complete description
-!
-!------------------------------------------------------------------------------
-! !USES:
- use MPAS_ESMF_BaseMod ! MPAS_ESMF Base class
- implicit none
-!
-!------------------------------------------------------------------------------
-! !PRIVATE TYPES:
- private
-!------------------------------------------------------------------------------
-! ! MPAS_ESMF_BaseTime
-!
-! ! Base class type to match C++ BaseTime class in size only;
-! ! all dereferencing within class is performed by C++ implementation
-
- type MPAS_ESMF_BaseTime
- integer(MPAS_ESMF_KIND_I8) :: S ! whole seconds
- integer(MPAS_ESMF_KIND_I8) :: Sn ! fractional seconds, numerator
- integer(MPAS_ESMF_KIND_I8) :: Sd ! fractional seconds, denominator
- end type
-
-!------------------------------------------------------------------------------
-! !PUBLIC TYPES:
- public MPAS_ESMF_BaseTime
-!------------------------------------------------------------------------------
-!
-! !PUBLIC MEMBER FUNCTIONS:
-!
-! overloaded operators
- public operator(+)
- private MPAS_ESMF_BaseTimeSum
- public operator(-)
- private MPAS_ESMF_BaseTimeDifference
- public operator(/)
- private MPAS_ESMF_BaseTimeQuotI
- private MPAS_ESMF_BaseTimeQuotI8
- public operator(.EQ.)
- private MPAS_ESMF_BaseTimeEQ
- public operator(.NE.)
- private MPAS_ESMF_BaseTimeNE
- public operator(.LT.)
- private MPAS_ESMF_BaseTimeLT
- public operator(.GT.)
- private MPAS_ESMF_BaseTimeGT
- public operator(.LE.)
- private MPAS_ESMF_BaseTimeLE
- public operator(.GE.)
- private MPAS_ESMF_BaseTimeGE
-
-!==============================================================================
-!
-! INTERFACE BLOCKS
-!
-!==============================================================================
- interface operator(+)
- module procedure MPAS_ESMF_BaseTimeSum
- end interface
- interface operator(-)
- module procedure MPAS_ESMF_BaseTimeDifference
- end interface
- interface operator(/)
- module procedure MPAS_ESMF_BaseTimeQuotI,MPAS_ESMF_BaseTimeQuotI8
- end interface
- interface operator(.EQ.)
- module procedure MPAS_ESMF_BaseTimeEQ
- end interface
- interface operator(.NE.)
- module procedure MPAS_ESMF_BaseTimeNE
- end interface
- interface operator(.LT.)
- module procedure MPAS_ESMF_BaseTimeLT
- end interface
- interface operator(.GT.)
- module procedure MPAS_ESMF_BaseTimeGT
- end interface
- interface operator(.LE.)
- module procedure MPAS_ESMF_BaseTimeLE
- end interface
- interface operator(.GE.)
- module procedure MPAS_ESMF_BaseTimeGE
- end interface
-
-
-!==============================================================================
-
- contains
-
-!==============================================================================
-
-
-! Add two basetimes
- FUNCTION MPAS_ESMF_BaseTimeSum( basetime1, basetime2 )
- TYPE(MPAS_ESMF_BaseTime) :: MPAS_ESMF_BaseTimeSum
- TYPE(MPAS_ESMF_BaseTime), INTENT(IN) :: basetime1
- TYPE(MPAS_ESMF_BaseTime), INTENT(IN) :: basetime2
- ! locals
- INTEGER (MPAS_ESMF_KIND_I8) :: Sn1, Sd1, Sn2, Sd2, lcd
-! PRINT *,'DEBUG: BEGIN MPAS_ESMF_BaseTimeSum()'
-! PRINT *,'DEBUG: MPAS_ESMF_BaseTimeSum(): basetime1%S = ',basetime1%S
-! PRINT *,'DEBUG: MPAS_ESMF_BaseTimeSum(): basetime1%Sn = ',basetime1%Sn
-! PRINT *,'DEBUG: MPAS_ESMF_BaseTimeSum(): basetime1%Sd = ',basetime1%Sd
-! PRINT *,'DEBUG: MPAS_ESMF_BaseTimeSum(): basetime2%S = ',basetime2%S
-! PRINT *,'DEBUG: MPAS_ESMF_BaseTimeSum(): basetime2%Sn = ',basetime2%Sn
-! PRINT *,'DEBUG: MPAS_ESMF_BaseTimeSum(): basetime2%Sd = ',basetime2%Sd
- MPAS_ESMF_BaseTimeSum = basetime1
- MPAS_ESMF_BaseTimeSum%S = MPAS_ESMF_BaseTimeSum%S + basetime2%S
- Sn1 = basetime1%Sn
- Sd1 = basetime1%Sd
- Sn2 = basetime2%Sn
- Sd2 = basetime2%Sd
-! PRINT *,'DEBUG: MPAS_ESMF_BaseTimeSum(): Sn1 = ',Sn1
-! PRINT *,'DEBUG: MPAS_ESMF_BaseTimeSum(): Sd1 = ',Sd1
-! PRINT *,'DEBUG: MPAS_ESMF_BaseTimeSum(): Sn2 = ',Sn2
-! PRINT *,'DEBUG: MPAS_ESMF_BaseTimeSum(): Sd2 = ',Sd2
- IF ( ( Sd1 .EQ. 0 ) .AND. ( Sd2 .EQ. 0 ) ) THEN
-! PRINT *,'DEBUG: MPAS_ESMF_BaseTimeSum(): no fractions'
- MPAS_ESMF_BaseTimeSum%Sn = 0
- MPAS_ESMF_BaseTimeSum%Sd = 0
- ELSE IF ( ( Sd1 .NE. 0 ) .AND. ( Sd2 .EQ. 0 ) ) THEN
- MPAS_ESMF_BaseTimeSum%Sn = Sn1
- MPAS_ESMF_BaseTimeSum%Sd = Sd1
- ELSE IF ( ( Sd1 .EQ. 0 ) .AND. ( Sd2 .NE. 0 ) ) THEN
- MPAS_ESMF_BaseTimeSum%Sn = Sn2
- MPAS_ESMF_BaseTimeSum%Sd = Sd2
- ELSE IF ( ( Sd1 .NE. 0 ) .AND. ( Sd2 .NE. 0 ) ) THEN
- CALL compute_lcd( Sd1 , Sd2 , lcd )
- MPAS_ESMF_BaseTimeSum%Sd = lcd
- MPAS_ESMF_BaseTimeSum%Sn = (Sn1 * lcd / Sd1) + (Sn2 * lcd / Sd2)
- ENDIF
-! PRINT *,'DEBUG: MPAS_ESMF_BaseTimeSum(): MPAS_ESMF_BaseTimeSum%S = ',MPAS_ESMF_BaseTimeSum%S
-! PRINT *,'DEBUG: MPAS_ESMF_BaseTimeSum(): MPAS_ESMF_BaseTimeSum%Sn = ',MPAS_ESMF_BaseTimeSum%Sn
-! PRINT *,'DEBUG: MPAS_ESMF_BaseTimeSum(): MPAS_ESMF_BaseTimeSum%Sd = ',MPAS_ESMF_BaseTimeSum%Sd
- CALL normalize_basetime( MPAS_ESMF_BaseTimeSum )
-! PRINT *,'DEBUG: END MPAS_ESMF_BaseTimeSum()'
- END FUNCTION MPAS_ESMF_BaseTimeSum
-
-
-! Subtract two basetimes
- FUNCTION MPAS_ESMF_BaseTimeDifference( basetime1, basetime2 )
- TYPE(MPAS_ESMF_BaseTime) :: MPAS_ESMF_BaseTimeDifference
- TYPE(MPAS_ESMF_BaseTime), INTENT(IN) :: basetime1
- TYPE(MPAS_ESMF_BaseTime), INTENT(IN) :: basetime2
- ! locals
- TYPE(MPAS_ESMF_BaseTime) :: neg2
-
- neg2%S = -basetime2%S
- neg2%Sn = -basetime2%Sn
- neg2%Sd = basetime2%Sd
-
- MPAS_ESMF_BaseTimeDifference = basetime1 + neg2
-
- END FUNCTION MPAS_ESMF_BaseTimeDifference
-
-
-! Divide basetime by 8-byte integer
- FUNCTION MPAS_ESMF_BaseTimeQuotI8( basetime, divisor )
- TYPE(MPAS_ESMF_BaseTime) :: MPAS_ESMF_BaseTimeQuotI8
- TYPE(MPAS_ESMF_BaseTime), INTENT(IN) :: basetime
- INTEGER(MPAS_ESMF_KIND_I8), INTENT(IN) :: divisor
- ! locals
- INTEGER(MPAS_ESMF_KIND_I8) :: d, n, dinit
-
-!PRINT *,'DEBUG MPAS_ESMF_BaseTimeQuotI8() A: S,Sn,Sd = ', &
-! basetime%S,basetime%Sn,basetime%Sd
-!PRINT *,'DEBUG MPAS_ESMF_BaseTimeQuotI8() A: divisor = ', divisor
- IF ( divisor == 0_MPAS_ESMF_KIND_I8 ) THEN
- CALL wrf_error_fatal( 'MPAS_ESMF_BaseTimeQuotI8: divide by zero' )
- ENDIF
-
-!$$$ move to default constructor
- MPAS_ESMF_BaseTimeQuotI8%S = 0
- MPAS_ESMF_BaseTimeQuotI8%Sn = 0
- MPAS_ESMF_BaseTimeQuotI8%Sd = 0
-
- ! convert to a fraction and divide by multipling the denonminator by
- ! the divisor
- IF ( basetime%Sd == 0 ) THEN
- dinit = 1_MPAS_ESMF_KIND_I8
- ELSE
- dinit = basetime%Sd
- ENDIF
- n = basetime%S * dinit + basetime%Sn
- d = dinit * divisor
-!PRINT *,'DEBUG MPAS_ESMF_BaseTimeQuotI8() B: n,d = ',n,d
- CALL simplify( n, d, MPAS_ESMF_BaseTimeQuotI8%Sn, MPAS_ESMF_BaseTimeQuotI8%Sd )
-!PRINT *,'DEBUG MPAS_ESMF_BaseTimeQuotI8() C: S,Sn,Sd = ', &
-! MPAS_ESMF_BaseTimeQuotI8%S,MPAS_ESMF_BaseTimeQuotI8%Sn,MPAS_ESMF_BaseTimeQuotI8%Sd
- CALL normalize_basetime( MPAS_ESMF_BaseTimeQuotI8 )
-!PRINT *,'DEBUG MPAS_ESMF_BaseTimeQuotI8() D: S,Sn,Sd = ', &
-! MPAS_ESMF_BaseTimeQuotI8%S,MPAS_ESMF_BaseTimeQuotI8%Sn,MPAS_ESMF_BaseTimeQuotI8%Sd
- END FUNCTION MPAS_ESMF_BaseTimeQuotI8
-
-! Divide basetime by integer
- FUNCTION MPAS_ESMF_BaseTimeQuotI( basetime, divisor )
- TYPE(MPAS_ESMF_BaseTime) :: MPAS_ESMF_BaseTimeQuotI
- TYPE(MPAS_ESMF_BaseTime), INTENT(IN) :: basetime
- INTEGER, INTENT(IN) :: divisor
- IF ( divisor == 0 ) THEN
- CALL wrf_error_fatal( 'MPAS_ESMF_BaseTimeQuotI: divide by zero' )
- ENDIF
- MPAS_ESMF_BaseTimeQuotI = basetime / INT( divisor, MPAS_ESMF_KIND_I8 )
- END FUNCTION MPAS_ESMF_BaseTimeQuotI
-
-
-! .EQ. for two basetimes
- FUNCTION MPAS_ESMF_BaseTimeEQ( basetime1, basetime2 )
- LOGICAL :: MPAS_ESMF_BaseTimeEQ
- TYPE(MPAS_ESMF_BaseTime), INTENT(IN) :: basetime1
- TYPE(MPAS_ESMF_BaseTime), INTENT(IN) :: basetime2
- INTEGER :: retval
- CALL seccmp( basetime1%S, basetime1%Sn, basetime1%Sd, &
- basetime2%S, basetime2%Sn, basetime2%Sd, &
- retval )
- MPAS_ESMF_BaseTimeEQ = ( retval .EQ. 0 )
- END FUNCTION MPAS_ESMF_BaseTimeEQ
-
-
-! .NE. for two basetimes
- FUNCTION MPAS_ESMF_BaseTimeNE( basetime1, basetime2 )
- LOGICAL :: MPAS_ESMF_BaseTimeNE
- TYPE(MPAS_ESMF_BaseTime), INTENT(IN) :: basetime1
- TYPE(MPAS_ESMF_BaseTime), INTENT(IN) :: basetime2
- INTEGER :: retval
- CALL seccmp( basetime1%S, basetime1%Sn, basetime1%Sd, &
- basetime2%S, basetime2%Sn, basetime2%Sd, &
- retval )
- MPAS_ESMF_BaseTimeNE = ( retval .NE. 0 )
- END FUNCTION MPAS_ESMF_BaseTimeNE
-
-
-! .LT. for two basetimes
- FUNCTION MPAS_ESMF_BaseTimeLT( basetime1, basetime2 )
- LOGICAL :: MPAS_ESMF_BaseTimeLT
- TYPE(MPAS_ESMF_BaseTime), INTENT(IN) :: basetime1
- TYPE(MPAS_ESMF_BaseTime), INTENT(IN) :: basetime2
- INTEGER :: retval
- CALL seccmp( basetime1%S, basetime1%Sn, basetime1%Sd, &
- basetime2%S, basetime2%Sn, basetime2%Sd, &
- retval )
- MPAS_ESMF_BaseTimeLT = ( retval .LT. 0 )
- END FUNCTION MPAS_ESMF_BaseTimeLT
-
-
-! .GT. for two basetimes
- FUNCTION MPAS_ESMF_BaseTimeGT( basetime1, basetime2 )
- LOGICAL :: MPAS_ESMF_BaseTimeGT
- TYPE(MPAS_ESMF_BaseTime), INTENT(IN) :: basetime1
- TYPE(MPAS_ESMF_BaseTime), INTENT(IN) :: basetime2
- INTEGER :: retval
- CALL seccmp( basetime1%S, basetime1%Sn, basetime1%Sd, &
- basetime2%S, basetime2%Sn, basetime2%Sd, &
- retval )
- MPAS_ESMF_BaseTimeGT = ( retval .GT. 0 )
- END FUNCTION MPAS_ESMF_BaseTimeGT
-
-
-! .LE. for two basetimes
- FUNCTION MPAS_ESMF_BaseTimeLE( basetime1, basetime2 )
- LOGICAL :: MPAS_ESMF_BaseTimeLE
- TYPE(MPAS_ESMF_BaseTime), INTENT(IN) :: basetime1
- TYPE(MPAS_ESMF_BaseTime), INTENT(IN) :: basetime2
- INTEGER :: retval
- CALL seccmp( basetime1%S, basetime1%Sn, basetime1%Sd, &
- basetime2%S, basetime2%Sn, basetime2%Sd, &
- retval )
- MPAS_ESMF_BaseTimeLE = ( retval .LE. 0 )
- END FUNCTION MPAS_ESMF_BaseTimeLE
-
-
-! .GE. for two basetimes
- FUNCTION MPAS_ESMF_BaseTimeGE( basetime1, basetime2 )
- LOGICAL :: MPAS_ESMF_BaseTimeGE
- TYPE(MPAS_ESMF_BaseTime), INTENT(IN) :: basetime1
- TYPE(MPAS_ESMF_BaseTime), INTENT(IN) :: basetime2
- INTEGER :: retval
- CALL seccmp( basetime1%S, basetime1%Sn, basetime1%Sd, &
- basetime2%S, basetime2%Sn, basetime2%Sd, &
- retval )
- MPAS_ESMF_BaseTimeGE = ( retval .GE. 0 )
- END FUNCTION MPAS_ESMF_BaseTimeGE
-
-
- end module MPAS_ESMF_BaseTimeMod
Deleted: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_Calendar.F90
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_Calendar.F90        2012-11-29 20:50:09 UTC (rev 2328)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_Calendar.F90        2012-11-29 22:23:06 UTC (rev 2329)
@@ -1,314 +0,0 @@
-!
-! Earth System Modeling Framework
-! Copyright 2002-2003, University Corporation for Atmospheric Research,
-! Massachusetts Institute of Technology, Geophysical Fluid Dynamics
-! Laboratory, University of Michigan, National Centers for Environmental
-! Prediction, Los Alamos National Laboratory, Argonne National Laboratory,
-! NASA Goddard Space Flight Center.
-! Licensed under the University of Illinois-NCSA license.
-!
-!==============================================================================
-!
-! MPAS_ESMF Calendar Module
- module MPAS_ESMF_CalendarMod
-!
-!==============================================================================
-!
-! This file contains the Calendar class definition and all Calendar class
-! methods.
-!
-!------------------------------------------------------------------------------
-! INCLUDES
-#include <MPAS_ESMF_TimeMgr.inc>
-
-!==============================================================================
-!BOPI
-! !MODULE: MPAS_ESMF_CalendarMod
-!
-! !DESCRIPTION:
-! Part of Time Manager F90 API wrapper of C++ implemenation
-!
-! Defines F90 wrapper entry points for corresponding
-! C++ class { \tt ESMC\_Calendar} implementation
-!
-! See {\tt ../include/ESMC\_Calendar.h} for complete description
-!
-!------------------------------------------------------------------------------
-! !USES:
- ! inherit from MPAS_ESMF base class
- use MPAS_ESMF_BaseMod
-
- ! inherit from base time class
- use MPAS_ESMF_BaseTimeMod
-
- implicit none
-!
-!------------------------------------------------------------------------------
-! !PRIVATE TYPES:
- private
-!------------------------------------------------------------------------------
-
-
-
- INTEGER, PARAMETER :: MONTHS_PER_YEAR = 12
-
- INTEGER, PARAMETER :: daysPerMonthNoLeap(MONTHS_PER_YEAR) &
- = (/31,28,31,30,31,30,31,31,30,31,30,31/)
- INTEGER, PARAMETER :: daysPerMonthLeap(MONTHS_PER_YEAR) &
- = (/31,29,31,30,31,30,31,31,30,31,30,31/)
- INTEGER, PARAMETER :: daysPerMonth360(MONTHS_PER_YEAR) &
- = (/30,30,30,30,30,30,30,30,30,30,30,30/)
-
- INTEGER, DIMENSION(MONTHS_PER_YEAR) :: mday
- INTEGER, DIMENSION(MONTHS_PER_YEAR) :: mdayleap
-
- INTEGER, DIMENSION(:), POINTER :: daym
- INTEGER, DIMENSION(:), POINTER :: daymleap
-
- INTEGER :: mdaycum(0:MONTHS_PER_YEAR)
- INTEGER :: mdayleapcum(0:MONTHS_PER_YEAR)
-
- TYPE(MPAS_ESMF_BaseTime), TARGET :: monthbdys(0:MONTHS_PER_YEAR)
- TYPE(MPAS_ESMF_BaseTime), TARGET :: monthbdysleap(0:MONTHS_PER_YEAR)
-
-
-!------------------------------------------------------------------------------
-! ! MPAS_ESMF_CalendarType
-!
-! ! F90 "enum" type to match C++ ESMC_CalendarType enum
-
- type MPAS_ESMF_CalendarType
- integer :: caltype
- end type
-
- type(MPAS_ESMF_CalendarType), parameter :: &
- MPAS_ESMF_CAL_GREGORIAN = MPAS_ESMF_CalendarType(1), &
- MPAS_ESMF_CAL_JULIAN = MPAS_ESMF_CalendarType(2), &
- ! like Gregorian, except Feb always has 28 days
- MPAS_ESMF_CAL_NOLEAP = MPAS_ESMF_CalendarType(3), &
- ! 12 months, 30 days each
- MPAS_ESMF_CAL_360DAY = MPAS_ESMF_CalendarType(4), &
- ! user defined
- MPAS_ESMF_CAL_GENERIC = MPAS_ESMF_CalendarType(5), &
- ! track base time seconds only
- MPAS_ESMF_CAL_NOCALENDAR = MPAS_ESMF_CalendarType(6)
-
-!------------------------------------------------------------------------------
-! ! MPAS_ESMF_Calendar
-!
-! ! F90 class type to match C++ Calendar class in size only;
-! ! all dereferencing within class is performed by C++ implementation
-!
-!------------------------------------------------------------------------------
-!
-! ! MPAS_ESMF_DaysPerYear
-!
- type MPAS_ESMF_DaysPerYear
- private
- integer :: D ! whole days per year
-! Fractional days-per-year are not yet used in this implementation.
-! integer :: Dn ! fractional days per year numerator
-! integer :: Dd ! fractional days per year denominator
- end type ! e.g. for Venus, D=0, Dn=926, Dd=1000
-!
-!------------------------------------------------------------------------------
-! ! MPAS_ESMF_Calendar
-!
-!
- type MPAS_ESMF_Calendar
- private
- type(MPAS_ESMF_CalendarType) :: Type
-! TBH: When NO_DT_COMPONENT_INIT is set, code that uses F95 compile-time
-! TBH: initialization of components of derived types is not included.
-! TBH: Some older compilers, like PGI 5.x do not support this F95 feature.
-#ifdef NO_DT_COMPONENT_INIT
- logical :: Set
-#else
- logical :: Set = .false.
-#endif
- integer, dimension(MONTHS_PER_YEAR) :: DaysPerMonth
- integer :: SecondsPerDay
- integer :: SecondsPerYear
- type(MPAS_ESMF_DaysPerYear) :: DaysPerYear
- end type
-
-!------------------------------------------------------------------------------
-! !PUBLIC DATA:
- TYPE(MPAS_ESMF_Calendar), public, save, pointer :: defaultCal ! Default Calendar
-
-
-!
-!------------------------------------------------------------------------------
-! !PUBLIC TYPES:
- public MONTHS_PER_YEAR
- public mday
- public mdayleap
- public monthbdys
- public monthbdysleap
- public daym
- public daymleap
- public mdaycum
- public mdayleapcum
- public MPAS_ESMF_CalendarType
- public MPAS_ESMF_CAL_GREGORIAN, MPAS_ESMF_CAL_NOLEAP, &
- MPAS_ESMF_CAL_360DAY, MPAS_ESMF_CAL_NOCALENDAR
-! public MPAS_ESMF_CAL_JULIAN
-! public MPAS_ESMF_CAL_GENERIC
- public MPAS_ESMF_Calendar
-
-!------------------------------------------------------------------------------
-!
-! !PUBLIC MEMBER FUNCTIONS:
- public MPAS_ESMF_CalendarCreate
- public MPAS_ESMF_CalendarDestroy
- public MPAS_ESMF_GetCalendarType
-
-
-! Required inherited and overridden MPAS_ESMF_Base class methods
-
- public MPAS_ESMF_CalendarInitialized ! Only in this implementation, intended
- ! to be private within MPAS_ESMF methods
-!EOPI
-
-!==============================================================================
-
- contains
-
-
-!==============================================================================
-
-
- type(MPAS_ESMF_CalendarType) function MPAS_ESMF_GetCalendarType()
- MPAS_ESMF_GetCalendarType = defaultCal % Type
- end function MPAS_ESMF_GetCalendarType
-
-
-!==============================================================================
-!BOP
-! !IROUTINE: MPAS_ESMF_CalendarCreate - Create a new MPAS_ESMF Calendar of built-in type
-
-! !INTERFACE:
- ! Private name; call using MPAS_ESMF_CalendarCreate()
- function MPAS_ESMF_CalendarCreate(name, calendartype, rc)
-
-! !RETURN VALUE:
- type(MPAS_ESMF_Calendar) :: MPAS_ESMF_CalendarCreate
-
-! !ARGUMENTS:
- character (len=*), intent(in), optional :: name
- type(MPAS_ESMF_CalendarType), intent(in) :: calendartype
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Creates and sets a {\tt calendar} to the given built-in
-! {\tt MPAS_ESMF\_CalendarType}.
-!
-! This is a private method; invoke via the public overloaded entry point
-! {\tt MPAS_ESMF\_CalendarCreate()}.
-!
-! The arguments are:
-! \begin{description}
-! \item[{[name]}]
-! The name for the newly created calendar. If not specified, a
-! default unique name will be generated: "CalendarNNN" where NNN
-! is a unique sequence number from 001 to 999.
-! \item[calendartype]
-! The built-in {\tt MPAS_ESMF\_CalendarType}. Valid values are:
-! {\tt MPAS_ESMF\_CAL\_360DAY}, {\tt MPAS_ESMF\_CAL\_GREGORIAN},
-! {\tt MPAS_ESMF\_CAL\_JULIANDAY}, {\tt MPAS_ESMF\_CAL\_NOCALENDAR}, and
-! {\tt MPAS_ESMF\_CAL\_NOLEAP}.
-! See the "Time Manager Reference" document for a description of
-! each calendar type.
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-!EOP
-! !REQUIREMENTS:
-! TMGn.n.n
- type(MPAS_ESMF_DaysPerYear) :: dayspy
-
- if ( present(rc) ) rc = MPAS_ESMF_FAILURE
-
- if ( calendartype % caltype == MPAS_ESMF_CAL_GREGORIAN % caltype ) then
- MPAS_ESMF_CalendarCreate % Type = MPAS_ESMF_CAL_GREGORIAN
- mday = daysPerMonthNoLeap
-         mdayleap = daysPerMonthLeap
-         allocate(daym(365))
-         allocate(daymleap(366))
- else if ( calendartype % caltype == MPAS_ESMF_CAL_NOLEAP % caltype ) then
- MPAS_ESMF_CalendarCreate % Type = MPAS_ESMF_CAL_NOLEAP
-         mday = daysPerMonthNoLeap
-         mdayleap = daysPerMonthNoLeap
-         allocate(daym(365))
-         allocate(daymleap(365))
- else if ( calendartype % caltype == MPAS_ESMF_CAL_360DAY % caltype ) then
- MPAS_ESMF_CalendarCreate % Type = MPAS_ESMF_CAL_360DAY
- mday = daysPerMonth360
-         mdayleap = daysPerMonth360
-         allocate(daym(360))
-         allocate(daymleap(360))
- else
- write(6,*) 'Not a valid calendar type for this implementation'
- write(6,*) 'The current implementation only supports MPAS_ESMF_CAL_NOLEAP, MPAS_ESMF_CAL_GREGORIAN, MPAS_ESMF_CAL_360DAY'
- return
- end if
-
- MPAS_ESMF_CalendarCreate % Set = .true.
- MPAS_ESMF_CalendarCreate % DaysPerMonth(:) = mday(:)
- MPAS_ESMF_CalendarCreate % SecondsPerDay = SECONDS_PER_DAY
-
-!TBH: TODO: Replace DaysPerYear and SecondsPerYear with methods
-!TBH: TODO: since they only make sense for the NO_LEAP calendar!
- dayspy % D = size(daym)
- MPAS_ESMF_CalendarCreate % DaysPerYear = dayspy
- MPAS_ESMF_CalendarCreate % SecondsPerYear = MPAS_ESMF_CalendarCreate % SecondsPerDay * dayspy % D
-
- if ( present(rc) ) rc = MPAS_ESMF_SUCCESS
-
- end function MPAS_ESMF_CalendarCreate
-
-
- subroutine MPAS_ESMF_CalendarDestroy(rc)
-
- integer, intent(out), optional :: rc
-
- if ( present(rc) ) rc = MPAS_ESMF_FAILURE
-
- deallocate(daym)
- deallocate(daymleap)
-
- if ( present(rc) ) rc = MPAS_ESMF_SUCCESS
-
- end subroutine MPAS_ESMF_CalendarDestroy
-
-
-
-!==============================================================================
-!BOP
-! !IROUTINE: MPAS_ESMF_CalendarInitialized - check if calendar was created
-
-! !INTERFACE:
- function MPAS_ESMF_CalendarInitialized(calendar)
-
-! !RETURN VALUE:
- logical MPAS_ESMF_CalendarInitialized
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Calendar), intent(in) :: calendar
-
-! !DESCRIPTION:
-!EOP
-! !REQUIREMENTS:
-! TMGn.n.n
-! Note that return value from this function will be bogus for older compilers
-! that do not support compile-time initialization of data members of Fortran
-! derived data types. For example, PGI 5.x compilers do not support this F95
-! feature. At the moment, the call to this fuction is #ifdefd out when the
-! leap-year calendar is used so this is not an issue for WRF (see
-! NO_DT_COMPONENT_INIT).
- MPAS_ESMF_CalendarInitialized = calendar%set
-
- end function MPAS_ESMF_CalendarInitialized
-
- end module MPAS_ESMF_CalendarMod
Deleted: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_Clock.F90
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_Clock.F90        2012-11-29 20:50:09 UTC (rev 2328)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_Clock.F90        2012-11-29 22:23:06 UTC (rev 2329)
@@ -1,1366 +0,0 @@
-!
-! Earth System Modeling Framework
-! Copyright 2002-2003, University Corporation for Atmospheric Research,
-! Massachusetts Institute of Technology, Geophysical Fluid Dynamics
-! Laboratory, University of Michigan, National Centers for Environmental
-! Prediction, Los Alamos National Laboratory, Argonne National Laboratory,
-! NASA Goddard Space Flight Center.
-! Licensed under the University of Illinois-NCSA license.
-!
-!==============================================================================
-!
-! MPAS_ESMF Clock Module
- module MPAS_ESMF_ClockMod
-!
-!==============================================================================
-!
-! This file contains the Clock class definition and all Clock class methods.
-!
-!------------------------------------------------------------------------------
-! INCLUDES
-#include <MPAS_ESMF_TimeMgr.inc>
-
-!==============================================================================
-!BOPI
-! !MODULE: MPAS_ESMF_ClockMod
-!
-! !DESCRIPTION:
-! Part of Time Manager F90 API wrapper of C++ implemenation
-!
-! Defines F90 wrapper entry points for corresponding
-! C++ class {\tt ESMC\_Time} implementation
-!
-! See {\tt ../include/ESMC\_Clock.h} for complete description
-!
-!------------------------------------------------------------------------------
-! !USES:
- ! inherit from MPAS_ESMF base class
- use MPAS_ESMF_BaseMod
-
- ! associated derived types
- use MPAS_ESMF_TimeIntervalMod ! , only : MPAS_ESMF_TimeInterval, &
- ! MPAS_ESMF_TimeIntervalIsPositive
- use MPAS_ESMF_TimeMod ! , only : MPAS_ESMF_Time
- use MPAS_ESMF_AlarmMod, only : MPAS_ESMF_Alarm
-
- implicit none
-!
-!------------------------------------------------------------------------------
-! !PRIVATE TYPES:
- private
-!------------------------------------------------------------------------------
-! ! MPAS_ESMF_Clock
-!
-! ! F90 class type to match C++ Clock class in size only;
-! ! all dereferencing within class is performed by C++ implementation
-
-! internals for MPAS_ESMF_Clock
- type MPAS_ESMF_ClockInt
- type(MPAS_ESMF_TimeInterval) :: TimeStep
- type(MPAS_ESMF_Time) :: StartTime
- type(MPAS_ESMF_Time) :: StopTime
- type(MPAS_ESMF_Time) :: RefTime
- type(MPAS_ESMF_Time) :: CurrTime
- type(MPAS_ESMF_Time) :: PrevTime
- integer(MPAS_ESMF_KIND_I8) :: AdvanceCount
- integer :: ClockMutex
- integer :: NumAlarms
- ! Note: to mimic MPAS_ESMF 2.1.0+, AlarmList is maintained
- ! within MPAS_ESMF_Clock even though copies of each alarm are
- ! returned from MPAS_ESMF_AlarmCreate() at the same time they
- ! are copied into the AlarmList! This duplication is not
- ! as hideous as it might be because the MPAS_ESMF_Alarm type
- ! has data members that are all POINTERs (thus the horrible
- ! shallow-copy-masquerading-as-reference-copy hack works).
- type(MPAS_ESMF_Alarm), pointer, dimension(:) :: AlarmList
- end type
-
-! Actual public type: this bit allows easy mimic of "deep" MPAS_ESMF_ClockCreate
-! in MPAS_ESMF 2.1.0+
-! NOTE: DO NOT ADD NON-POINTER STATE TO THIS DATA TYPE. It emulates MPAS_ESMF
-! shallow-copy-masquerading-as-reference-copy.
- type MPAS_ESMF_Clock
- type(MPAS_ESMF_ClockInt), pointer :: clockint
- end type
-
-!------------------------------------------------------------------------------
-! !PUBLIC TYPES:
- public MPAS_ESMF_Clock
- public MPAS_ESMF_ClockInt ! needed on AIX but not PGI
-!------------------------------------------------------------------------------
-!
-! !PUBLIC MEMBER FUNCTIONS:
- public MPAS_ESMF_ClockCreate
- public MPAS_ESMF_ClockDestroy
- public MPAS_ESMF_ClockSet
-! public MPAS_ESMF_ClockSetOLD
- public MPAS_ESMF_ClockGet
-! public MPAS_ESMF_ClockGetAdvanceCount
-! public MPAS_ESMF_ClockGetTimeStep
-! public MPAS_ESMF_ClockSetTimeStep
-! public MPAS_ESMF_ClockGetCurrTime
-! public MPAS_ESMF_ClockSetCurrTime
-! public MPAS_ESMF_ClockGetStartTime
-! public MPAS_ESMF_ClockGetStopTime
-! public MPAS_ESMF_ClockGetRefTime
-! public MPAS_ESMF_ClockGetPrevTime
-! public MPAS_ESMF_ClockGetCurrSimTime
-! public MPAS_ESMF_ClockGetPrevSimTime
-! This must be public for MPAS_ESMF_AlarmClockMod...
- public MPAS_ESMF_ClockAddAlarm
- public MPAS_ESMF_ClockGetAlarmList
-! public MPAS_ESMF_ClockGetNumAlarms
-! public MPAS_ESMF_ClockSyncToWallClock
- public MPAS_ESMF_ClockAdvance
- public MPAS_ESMF_ClockIsStopTime
- public MPAS_ESMF_ClockStopTimeDisable
-
-! Required inherited and overridden MPAS_ESMF_Base class methods
-
-! public MPAS_ESMF_ClockRead
-! public MPAS_ESMF_ClockWrite
- public MPAS_ESMF_ClockValidate
- public MPAS_ESMF_ClockPrint
-!EOPI
-
-!==============================================================================
-
- contains
-
-!==============================================================================
-!
-! This section includes the Set methods.
-!
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_ClockSetOLD - Initialize a clockint
-
-! !INTERFACE:
- subroutine MPAS_ESMF_ClockSetOLD(clockint, TimeStep, StartTime, &
- StopTime, RefTime, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_ClockInt), intent(out) :: clockint
- type(MPAS_ESMF_TimeInterval), intent(in), optional :: TimeStep
- type(MPAS_ESMF_Time), intent(in) :: StartTime
- type(MPAS_ESMF_Time), intent(in) :: StopTime
- type(MPAS_ESMF_Time), intent(in), optional :: RefTime
- integer, intent(out), optional :: rc
-! Local
- integer i
-
-! !DESCRIPTION:
-! Initialize an {\tt MPAS_ESMF\_Clock}
-!
-! The arguments are:
-! \begin{description}
-! \item[clockint]
-! The object instance to initialize
-! \item[{[TimeStep]}]
-! The {\tt MPAS_ESMF\_Clock}'s time step interval
-! \item[StartTime]
-! The {\tt MPAS_ESMF\_Clock}'s starting time
-! \item[StopTime]
-! The {\tt MPAS_ESMF\_Clock}'s stopping time
-! \item[{[RefTime]}]
-! The {\tt MPAS_ESMF\_Clock}'s reference time
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG3.1, TMG3.4.4
-!EOP
- IF ( PRESENT(TimeStep) ) clockint%TimeStep = TimeStep
- IF ( PRESENT(RefTime) )THEN
- clockint%RefTime = RefTime
- ELSE
- clockint%RefTime = StartTime
- END IF
- clockint%CurrTime = StartTime
- clockint%StartTime = StartTime
- clockint%StopTime = StopTime
- clockint%NumAlarms = 0
- clockint%AdvanceCount = 0
- ALLOCATE(clockint%AlarmList(MAX_ALARMS))
- ! TBH: This incredible hack can be removed once MPAS_ESMF_*Validate()
- ! TBH: can tell if a deep MPAS_ESMF_* was created or not.
- DO i = 1, MAX_ALARMS
- NULLIFY( clockint%AlarmList( i )%alarmint )
- ENDDO
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_SUCCESS
-
- end subroutine MPAS_ESMF_ClockSetOLD
-
-
-! !IROUTINE: MPAS_ESMF_ClockSet - Set clock properties -- for compatibility with MPAS_ESMF 2.0.1
-
-! !INTERFACE:
- subroutine MPAS_ESMF_ClockSet(clock, TimeStep, StartTime, StopTime, &
- RefTime, CurrTime, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Clock), intent(inout) :: clock
- type(MPAS_ESMF_TimeInterval), intent(in), optional :: TimeStep
- type(MPAS_ESMF_Time), intent(in), optional :: StartTime
- type(MPAS_ESMF_Time), intent(in), optional :: StopTime
- type(MPAS_ESMF_Time), intent(in), optional :: RefTime
- type(MPAS_ESMF_Time), intent(in), optional :: CurrTime
- integer, intent(out), optional :: rc
-! Local
- integer ierr
-
-! !DESCRIPTION:
-! Initialize an {\tt MPAS_ESMF\_Clock}
-!
-! The arguments are:
-! \begin{description}
-! \item[clock]
-! The object instance to initialize
-! \item[{[TimeStep]}]
-! The {\tt MPAS_ESMF\_Clock}'s time step interval
-! \item[StartTime]
-! The {\tt MPAS_ESMF\_Clock}'s starting time
-! \item[StopTime]
-! The {\tt MPAS_ESMF\_Clock}'s stopping time
-! \item[{[RefTime]}]
-! The {\tt MPAS_ESMF\_Clock}'s reference time
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG3.1, TMG3.4.4
-!EOP
- ierr = MPAS_ESMF_SUCCESS
- IF ( PRESENT(TimeStep) ) THEN
- CALL MPAS_ESMF_ClockSetTimeStep ( clock, TimeStep, rc=ierr )
- ENDIF
- IF ( PRESENT(RefTime) ) clock%clockint%RefTime = RefTime
- IF ( PRESENT(StartTime) ) clock%clockint%StartTime = StartTime
- IF ( PRESENT(StopTime) ) clock%clockint%StopTime = StopTime
- IF ( PRESENT(CurrTime) ) THEN
- CALL MPAS_ESMF_ClockSetCurrTime(clock, CurrTime, rc=ierr)
- ENDIF
- IF ( PRESENT(rc) ) rc = ierr
-
- end subroutine MPAS_ESMF_ClockSet
-
-
-! Create MPAS_ESMF_Clock using MPAS_ESMF 2.1.0+ semantics
- FUNCTION MPAS_ESMF_ClockCreate( name, TimeStep, StartTime, StopTime, &
- RefTime, rc )
- ! return value
- type(MPAS_ESMF_Clock) :: MPAS_ESMF_ClockCreate
- ! !ARGUMENTS:
- character (len=*), intent(in), optional :: name
- type(MPAS_ESMF_TimeInterval), intent(in), optional :: TimeStep
- type(MPAS_ESMF_Time), intent(in) :: StartTime
- type(MPAS_ESMF_Time), intent(in) :: StopTime
- type(MPAS_ESMF_Time), intent(in), optional :: RefTime
- integer, intent(out), optional :: rc
- ! locals
- type(MPAS_ESMF_Clock) :: clocktmp
- ! TBH: ignore allocate errors, for now
- ALLOCATE( clocktmp%clockint )
- CALL MPAS_ESMF_ClockSetOLD( clocktmp%clockint, &
- TimeStep= TimeStep, &
- StartTime=StartTime, &
- StopTime= StopTime, &
- RefTime=RefTime, rc=rc )
- MPAS_ESMF_ClockCreate = clocktmp
- END FUNCTION MPAS_ESMF_ClockCreate
-
-
-! Deallocate memory for MPAS_ESMF_Clock
- SUBROUTINE MPAS_ESMF_ClockDestroy( clock, rc )
- TYPE(MPAS_ESMF_Clock), INTENT(INOUT) :: clock
- INTEGER, INTENT( OUT), OPTIONAL :: rc
- ! TBH: ignore deallocate errors, for now
- DEALLOCATE( clock%clockint%AlarmList )
- DEALLOCATE( clock%clockint )
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_SUCCESS
- END SUBROUTINE MPAS_ESMF_ClockDestroy
-
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_ClockGet - Get clock properties -- for compatibility with MPAS_ESMF 2.0.1
-
-! !INTERFACE:
- subroutine MPAS_ESMF_ClockGet(clock, StartTime, CurrTime, &
- AdvanceCount, StopTime, TimeStep, &
- PrevTime, RefTime, &
- rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Clock), intent(in) :: clock
- type(MPAS_ESMF_Time), intent(out), optional :: StartTime
- type(MPAS_ESMF_Time), intent(out), optional :: CurrTime
- type(MPAS_ESMF_Time), intent(out), optional :: StopTime
- type(MPAS_ESMF_Time), intent(out), optional :: PrevTime
- type(MPAS_ESMF_Time), intent(out), optional :: RefTime
- integer(MPAS_ESMF_KIND_I8), intent(out), optional :: AdvanceCount
- type(MPAS_ESMF_TimeInterval), intent(out), optional :: TimeStep
- integer, intent(out), optional :: rc
- integer :: ierr
-
-! !DESCRIPTION:
-! Returns the number of times the {\tt MPAS_ESMF\_Clock} has been advanced
-! (time stepped)
-!
-! The arguments are:
-! \begin{description}
-! \item[clock]
-! The object instance to get the advance count from
-! \item[StartTime]
-! The start time
-! \item[CurrTime]
-! The current time
-! \item[AdvanceCount]
-! The number of times the {\tt MPAS_ESMF\_Clock} has been advanced
-! \item[StopTime]
-! The {\tt MPAS_ESMF\_Clock}'s stopping time
-! \item[{[TimeStep]}]
-! The {\tt MPAS_ESMF\_Clock}'s time step interval
-! \item[{[PrevTime]}]
-! The {\tt MPAS_ESMF\_Clock}'s previous current time
-! \item[{[PrevTime]}]
-! The {\tt MPAS_ESMF\_Clock}'s reference time
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-
-! !REQUIREMENTS:
-! TMG3.5.1
-!EOP
- ierr = MPAS_ESMF_SUCCESS
-
- IF ( PRESENT (StartTime) ) THEN
- CALL MPAS_ESMF_ClockGetStartTime( clock, StartTime=StartTime, rc=ierr )
- ENDIF
- IF ( PRESENT (CurrTime) ) THEN
- CALL MPAS_ESMF_ClockGetCurrTime( clock , CurrTime, ierr )
- ENDIF
- IF ( PRESENT (StopTime) ) THEN
- CALL MPAS_ESMF_ClockGetStopTime( clock , StopTime, ierr )
- ENDIF
- IF ( PRESENT (AdvanceCount) ) THEN
- CALL MPAS_ESMF_ClockGetAdvanceCount(clock, AdvanceCount, ierr)
- ENDIF
- IF ( PRESENT (TimeStep) ) THEN
- CALL MPAS_ESMF_ClockGetTimeStep(clock, TimeStep, ierr)
- ENDIF
- IF ( PRESENT (PrevTime) ) THEN
- CALL MPAS_ESMF_ClockGetPrevTime(clock, PrevTime, ierr)
- ENDIF
- IF ( PRESENT (RefTime) ) THEN
- CALL MPAS_ESMF_ClockGetRefTime(clock, RefTime, ierr)
- ENDIF
-
- IF ( PRESENT (rc) ) THEN
- rc = ierr
- ENDIF
-
- end subroutine MPAS_ESMF_ClockGet
-
-
-! !IROUTINE: MPAS_ESMF_ClockGetAdvanceCount - Get the clock's advance count
-
-! !INTERFACE:
- subroutine MPAS_ESMF_ClockGetAdvanceCount(clock, AdvanceCount, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Clock), intent(in) :: clock
- integer(MPAS_ESMF_KIND_I8), intent(out) :: AdvanceCount
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Returns the number of times the {\tt MPAS_ESMF\_Clock} has been advanced
-! (time stepped)
-!
-! The arguments are:
-! \begin{description}
-! \item[clock]
-! The object instance to get the advance count from
-! \item[AdvanceCount]
-! The number of times the {\tt MPAS_ESMF\_Clock} has been advanced
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-
-! !REQUIREMENTS:
-! TMG3.5.1
-!EOP
-
- AdvanceCount = clock%clockint%AdvanceCount
-
- IF ( PRESENT(rc) ) rc = MPAS_ESMF_SUCCESS
-
- end subroutine MPAS_ESMF_ClockGetAdvanceCount
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_ClockGetTimeStep - Get a clock's timestep interval
-
-! !INTERFACE:
- subroutine MPAS_ESMF_ClockGetTimeStep(clock, TimeStep, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Clock), intent(in) :: clock
- type(MPAS_ESMF_TimeInterval), intent(out) :: TimeStep
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Get an {\tt MPAS_ESMF\_Clock}'s timestep interval
-!
-! The arguments are:
-! \begin{description}
-! \item[clock]
-! The object instance to get the time step from
-! \item[TimeStep]
-! The time step
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG3.5.2
-!EOP
-
- TimeStep = clock%clockint%TimeStep
- IF ( PRESENT(rc) ) rc = MPAS_ESMF_SUCCESS
-
- end subroutine MPAS_ESMF_ClockGetTimeStep
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_ClockSetTimeStep - Set a clock's timestep interval
-
-! !INTERFACE:
- subroutine MPAS_ESMF_ClockSetTimeStep(clock, TimeStep, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Clock), intent(inout) :: clock ! really INTENT(OUT)
- type(MPAS_ESMF_TimeInterval), intent(in) :: TimeStep
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Set an {\tt MPAS_ESMF\_Clock}'s timestep interval
-!
-! The arguments are:
-! \begin{description}
-! \item[clock]
-! The object instance to set the time step
-! \item[TimeStep]
-! The time step
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG3.4.2
-!EOP
-
- clock%clockint%TimeStep = TimeStep
- IF ( PRESENT(rc) ) rc = MPAS_ESMF_SUCCESS
-
- end subroutine MPAS_ESMF_ClockSetTimeStep
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_ClockGetCurrTime - Get a clock's current time
-
-! !INTERFACE:
- subroutine MPAS_ESMF_ClockGetCurrTime(clock, CurrTime, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Clock), intent(in) :: clock
- type(MPAS_ESMF_Time), intent(out) :: CurrTime
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Get an {\tt MPAS_ESMF\_Clock}'s current time
-!
-! The arguments are:
-! \begin{description}
-! \item[clock]
-! The object instance to get the current time from
-! \item[CurrTime]
-! The current time
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG3.5.4
-!EOP
-
- CurrTime = clock%clockint%CurrTime
- IF ( PRESENT(rc) ) rc = MPAS_ESMF_SUCCESS
- end subroutine MPAS_ESMF_ClockGetCurrTime
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_ClockSetCurrTime - Set a clock's current time
-
-! !INTERFACE:
- subroutine MPAS_ESMF_ClockSetCurrTime(clock, CurrTime, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Clock), intent(inout) :: clock ! really INTENT(OUT)
- type(MPAS_ESMF_Time), intent(in) :: CurrTime
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Set an {\tt MPAS_ESMF\_Clock}'s current time
-!
-! The arguments are:
-! \begin{description}
-! \item[clock]
-! The object instance to set the current time from
-! \item[CurrTime]
-! The current time
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG3.4.3
-!EOP
-
- clock%clockint%CurrTime = CurrTime
- IF ( PRESENT(rc) ) rc = MPAS_ESMF_SUCCESS
-
- end subroutine MPAS_ESMF_ClockSetCurrTime
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_ClockGetStartTime - Get a clock's start time
-
-! !INTERFACE:
- subroutine MPAS_ESMF_ClockGetStartTime(clock, StartTime, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Clock), intent(in) :: clock
- type(MPAS_ESMF_Time), intent(out) :: StartTime
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Get an {\tt MPAS_ESMF\_Clock}'s start time
-!
-! The arguments are:
-! \begin{description}
-! \item[clock]
-! The object instance to get the start time from
-! \item[StartTime]
-! The start time
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG3.5.3
-!EOP
-
- StartTime = clock%clockint%StartTime
- IF ( PRESENT(rc) ) rc = MPAS_ESMF_SUCCESS
-
- end subroutine MPAS_ESMF_ClockGetStartTime
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_ClockGetStopTime - Get a clock's stop time
-
-! !INTERFACE:
- subroutine MPAS_ESMF_ClockGetStopTime(clock, StopTime, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Clock), intent(in) :: clock
- type(MPAS_ESMF_Time), intent(out) :: StopTime
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Get an {\tt MPAS_ESMF\_Clock}'s stop time
-!
-! The arguments are:
-! \begin{description}
-! \item[clock]
-! The object instance to get the stop time from
-! \item[StopTime]
-! The stop time
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG3.5.3
-!EOP
-
- StopTime = clock%clockint%StopTime
- IF ( PRESENT(rc) ) rc = MPAS_ESMF_SUCCESS
-
- end subroutine MPAS_ESMF_ClockGetStopTime
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_ClockGetRefTime - Get a clock's reference time
-
-! !INTERFACE:
- subroutine MPAS_ESMF_ClockGetRefTime(clock, RefTime, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Clock), intent(in) :: clock
- type(MPAS_ESMF_Time), intent(out) :: RefTime
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Get an {\tt MPAS_ESMF\_Clock}'s reference time
-!
-! The arguments are:
-! \begin{description}
-! \item[clock]
-! The object instance to get the reference time from
-! \item[RefTime]
-! The reference time
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG3.5.3
-!EOP
- refTime = clock%clockint%RefTime
- IF ( PRESENT(rc) ) rc = MPAS_ESMF_SUCCESS
- end subroutine MPAS_ESMF_ClockGetRefTime
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_ClockGetPrevTime - Get a clock's previous current time
-
-! !INTERFACE:
- subroutine MPAS_ESMF_ClockGetPrevTime(clock, PrevTime, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Clock), intent(in) :: clock
- type(MPAS_ESMF_Time), intent(out) :: PrevTime
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Get an {\tt MPAS_ESMF\_Clock}'s previous current time
-!
-! The arguments are:
-! \begin{description}
-! \item[clock]
-! The object instance to get the previous current time from
-! \item[PrevTime]
-! The previous current time
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG3.5.4
-!EOP
-
-! hack for bug in PGI 5.1-x
-! prevTime = Clock%clockint%CurrTime - Clock%clockint%TimeStep
- prevTime = MPAS_ESMF_TimeDec( Clock%clockint%CurrTime, &
- Clock%clockint%TimeStep )
-
- IF ( PRESENT(rc) ) rc = MPAS_ESMF_SUCCESS
- end subroutine MPAS_ESMF_ClockGetPrevTime
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_ClockGetCurrSimTime - Get a clock's current simulation time
-
-! !INTERFACE:
- subroutine MPAS_ESMF_ClockGetCurrSimTime(clock, CurrSimTime, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Clock), intent(in) :: clock
- type(MPAS_ESMF_TimeInterval), intent(out) :: CurrSimTime
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Get an {\tt MPAS_ESMF\_Clock}'s current simulation time
-!
-! The arguments are:
-! \begin{description}
-! \item[clock]
-! The object instance to get the current simulation time from
-! \item[CurrSimTime]
-! The current simulation time
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG3.5.5
-!EOP
- CALL wrf_error_fatal( 'MPAS_ESMF_ClockGetCurrSimTime not supported' )
- end subroutine MPAS_ESMF_ClockGetCurrSimTime
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_ClockGetPrevSimTime - Get a clock's previous simulation time
-
-! !INTERFACE:
- subroutine MPAS_ESMF_ClockGetPrevSimTime(clock, PrevSimTime, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Clock), intent(in) :: clock
- type(MPAS_ESMF_TimeInterval), intent(out) :: PrevSimTime
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Get an {\tt MPAS_ESMF\_Clock}'s previous simulation time
-!
-! The arguments are:
-! \begin{description}
-! \item[clock]
-! The object instance to get the previous simulation time from
-! \item[PrevSimTime]
-! The previous simulation time
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG3.5.5
-!EOP
- CALL wrf_error_fatal( 'MPAS_ESMF_ClockGetPrevSimTime not supported' )
- end subroutine MPAS_ESMF_ClockGetPrevSimTime
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_ClockAddAlarm - Add an alarm to a clock's alarm list
-
-! !INTERFACE:
- subroutine MPAS_ESMF_ClockAddAlarm(clock, Alarm, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Clock), intent(inout) :: clock
- type(MPAS_ESMF_Alarm), intent(inout) :: Alarm
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Add an {\tt MPAS_ESMF\_Alarm} to an {\tt MPAS_ESMF\_Clock}'s {\tt MPAS_ESMF\_Alarm} list
-!
-! The arguments are:
-! \begin{description}
-! \item[clock]
-! The object instance to add an {\tt MPAS_ESMF\_Alarm} to
-! \item[Alarm]
-! The {\tt MPAS_ESMF\_Alarm} to add to the {\tt MPAS_ESMF\_Clock}'s
-! {\tt MPAS_ESMF\_Alarm} list
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG4.1, TMG4.2
-!EOP
-
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_SUCCESS
- clock%clockint%NumAlarms = clock%clockint%NumAlarms + 1
- IF ( clock%clockint%NumAlarms > SIZE (clock%clockint%AlarmList) ) THEN
- CALL wrf_error_fatal ( 'MPAS_ESMF_ClockAddAlarm: too many alarms' )
- ELSE IF ( .NOT. ASSOCIATED( Alarm%alarmint ) ) THEN
- CALL wrf_error_fatal ( &
- 'MPAS_ESMF_ClockAddAlarm: alarm not created' )
- ELSE
- IF ( Alarm%alarmint%RingTimeSet ) THEN
- Alarm%alarmint%PrevRingTime = Alarm%alarmint%RingTime
-!MGD: If the ring time is equal to the current time, the alarm should be ringing
- IF (Alarm%alarmint%PrevRingTime == clock%clockint%CurrTime) THEN
- Alarm%alarmint%Ringing = .TRUE.
- ELSE
- Alarm%alarmint%Ringing = .FALSE.
- ENDIF
- ELSE
-!TBH: This has the nasty side-effect of forcing us to explicitly turn on
-!TBH: alarms that are created with RingInterval only, if we want them to start
-!TBH: ringing right away. And this is done (see
-!TBH: COMPUTE_VORTEX_CENTER_ALARM). Straighten this out...
- Alarm%alarmint%PrevRingTime = clock%clockint%CurrTime
- Alarm%alarmint%Ringing = .FALSE.
- ENDIF
-
- ! finally, load the alarm into the list
-! write(0,*)'MPAS_ESMF_ClockAddAlarm ',clock%clockint%NumAlarms
- clock%clockint%AlarmList(clock%clockint%NumAlarms) = Alarm
- ENDIF
-
- end subroutine MPAS_ESMF_ClockAddAlarm
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_ClockGetAlarmList - Get a clock's alarm list
-
-! !INTERFACE:
- subroutine MPAS_ESMF_ClockGetAlarmList(clock, AlarmList, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Clock), intent(in) :: clock
- type(MPAS_ESMF_Alarm), pointer :: AlarmList(:)
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Get an {\tt MPAS_ESMF\_Clock}'s {\tt MPAS_ESMF\_Alarm} list
-!
-! The arguments are:
-! \begin{description}
-! \item[clock]
-! The object instance to get the {\tt MPAS_ESMF\_Alarm} list from
-! \item[AlarmList]
-! The {\tt MPAS_ESMF\_Clock}'s {\tt MPAS_ESMF\_Alarm} list
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG4.3
-!EOP
-
- AlarmList => clock%clockint%AlarmList
- IF ( PRESENT(rc) ) rc = MPAS_ESMF_SUCCESS
-
- end subroutine MPAS_ESMF_ClockGetAlarmList
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_ClockGetNumAlarms - Get the number of alarms in a clock's alarm list
-
-! !INTERFACE:
- subroutine MPAS_ESMF_ClockGetNumAlarms(clock, NumAlarms, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Clock), intent(in) :: clock
- integer, intent(out) :: NumAlarms
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Get the number of {\tt MPAS_ESMF\_Alarm}s in an {\tt MPAS_ESMF\_Clock}'s
-! {\tt MPAS_ESMF\_Alarm} list
-!
-! The arguments are:
-! \begin{description}
-! \item[clock]
-! The object instance to get the number of {\tt MPAS_ESMF\_Alarm}s from
-! \item[NumAlarms]
-! The number of {\tt MPAS_ESMF\_Alarm}s in the {\tt MPAS_ESMF\_Clock}'s
-! {\tt MPAS_ESMF\_Alarm} list
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG4.3
-!EOP
-
- NumAlarms = clock%clockint%NumAlarms
- IF ( PRESENT(rc) ) rc = MPAS_ESMF_SUCCESS
-
- end subroutine MPAS_ESMF_ClockGetNumAlarms
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_ClockSyncToWallClock - Set clock's current time to wall clock time
-
-! !INTERFACE:
- subroutine MPAS_ESMF_ClockSyncToWallClock(clock, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Clock), intent(inout) :: clock
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Set an {\tt MPAS_ESMF\_Clock}'s current time to wall clock time
-!
-! The arguments are:
-! \begin{description}
-! \item[clock]
-! The object instance to synchronize to wall clock time
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG3.4.5
-!EOP
- CALL wrf_error_fatal( 'MPAS_ESMF_ClockSyncToWallClock not supported' )
- end subroutine MPAS_ESMF_ClockSyncToWallClock
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_ClockAdvance - Advance a clock's current time by one time step
-
-! !INTERFACE:
- subroutine MPAS_ESMF_ClockAdvance(clock, RingingAlarmList, &
- NumRingingAlarms, rc)
-
-use MPAS_ESMF_timemod
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Clock), intent(inout) :: clock
- type(MPAS_ESMF_Alarm), dimension(MAX_ALARMS), intent(out), optional :: &
- RingingAlarmList
- integer, intent(out), optional :: NumRingingAlarms
- integer, intent(out), optional :: rc
-! Local
- logical pred1, pred2, pred3
- integer i, n
- type(MPAS_ESMF_Alarm) :: alarm
- logical :: positive_timestep
-!
-! !DESCRIPTION:
-! Advance an {\tt MPAS_ESMF\_Clock}'s current time by one time step
-!
-! The arguments are:
-! \begin{description}
-! \item[clock]
-! The object instance to advance
-! \item[{[RingingAlarmList]}]
-! Return a list of any ringing alarms after the time step
-! \item[{[NumRingingAlarms]}]
-! The number of ringing alarms returned
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG3.4.1
-!EOP
-! hack for bug in PGI 5.1-x
-! clock%clockint%CurrTime = clock%clockint%CurrTime + &
-! clock%clockint%TimeStep
- clock%clockint%CurrTime = MPAS_ESMF_TimeInc( clock%clockint%CurrTime, &
- clock%clockint%TimeStep )
- positive_timestep = MPAS_ESMF_TimeIntervalIsPositive( clock%clockint%TimeStep )
-
- IF ( Present(NumRingingAlarms) ) NumRingingAlarms = 0
- clock%clockint%AdvanceCount = clock%clockint%AdvanceCount + 1
- DO i = 1, MAX_ALARMS
- alarm = clock%clockint%AlarmList(i)
- ! TBH: This is really dangerous. We need to be able to NULLIFY
- ! TBH: alarmint at compile-time (F95 synax) to make this safe.
-!$$$TBH: see if F95 compile-time pointer-nullification is supported by all
-!$$$TBH: compilers we support
- IF ( ASSOCIATED( alarm%alarmint ) ) THEN
- IF ( alarm%alarmint%Enabled ) THEN
- IF ( alarm%alarmint%RingIntervalSet ) THEN
- pred1 = .FALSE. ; pred2 = .FALSE. ; pred3 = .FALSE.
- ! alarm cannot ring if clock has passed the alarms stop time
- IF ( alarm%alarmint%StopTimeSet ) THEN
-!MGD we probably want the same logic for before RingTime
-!MGD IF ( positive_timestep ) THEN
-! hack for bug in PGI 5.1-x
-! PRED1 = clock%clockint%CurrTime > alarm%alarmint%StopTime
- PRED1 = MPAS_ESMF_TimeGT( clock%clockint%CurrTime, &
- alarm%alarmint%StopTime )
-!MGD ELSE
-!MGD ! in this case time step is negative and stop time is
-!MGD ! less than start time
-!MGD! PRED1 = clock%clockint%CurrTime < alarm%alarmint%StopTime
-!MGD PRED1 = MPAS_ESMF_TimeLT( clock%clockint%CurrTime, &
-!MGD alarm%alarmint%StopTime )
-!MGD ENDIF
- ELSE IF ( alarm%alarmint%RingTimeSet .AND. .NOT. PRED1) THEN
-!MGD IF ( positive_timestep ) THEN
-!MGD PRED1 = MPAS_ESMF_TimeGT( clock%clockint%CurrTime, &
-!MGD alarm%alarmint%RingTime )
-!MGD ELSE
- PRED1 = MPAS_ESMF_TimeLT( clock%clockint%CurrTime, &
- alarm%alarmint%RingTime )
-!MGD ENDIF
- ENDIF
- ! one-shot alarm: check for ring time
-! TBH: Need to remove duplicated code. Need to enforce only one of
-! TBH: alarm%alarmint%RingTimeSet or alarm%alarmint%RingIntervalSet ever
-! TBH: being .TRUE. and simplify the logic. Also, the simpler
-! TBH: implementation in the duplicated code below should be sufficient.
- IF ( alarm%alarmint%RingTimeSet ) THEN
- IF ( positive_timestep ) THEN
-! hack for bug in PGI 5.1-x
-! PRED2 = ( alarm%alarmint%RingTime <= clock%clockint%CurrTime &
-! .AND. clock%clockint%CurrTime < alarm%alarmint%RingTime + &
-! clock%clockint%TimeStep )
- PRED2 = ( MPAS_ESMF_TimeLE( alarm%alarmint%RingTime, &
- clock%clockint%CurrTime ) &
- .AND. MPAS_ESMF_TimeLT( clock%clockint%CurrTime, &
- MPAS_ESMF_TimeInc( alarm%alarmint%RingTime, &
- clock%clockint%TimeStep ) ) )
- ELSE
- ! in this case time step is negative and stop time is
- ! less than start time
-! hack for bug in PGI 5.1-x
-! PRED2 = ( alarm%alarmint%RingTime >= clock%clockint%CurrTime &
-! .AND. clock%clockint%CurrTime > alarm%alarmint%RingTime + &
-! clock%clockint%TimeStep )
- PRED2 = ( MPAS_ESMF_TimeGE( alarm%alarmint%RingTime, &
- clock%clockint%CurrTime ) &
- .AND. MPAS_ESMF_TimeGT( clock%clockint%CurrTime, &
- MPAS_ESMF_TimeInc( alarm%alarmint%RingTime, &
- clock%clockint%TimeStep ) ) )
- ENDIF
- ENDIF
- ! repeating alarm: check for ring interval
- IF ( alarm%alarmint%RingIntervalSet ) THEN
- IF ( positive_timestep ) THEN
-! hack for bug in PGI 5.1-x
-! PRED3 = ( alarm%alarmint%PrevRingTime + alarm%alarmint%RingInterval <= &
-! clock%clockint%CurrTime )
-
- PRED3 = ( MPAS_ESMF_TimeLE( MPAS_ESMF_TimeInc( &
- alarm%alarmint%PrevRingTime, &
- alarm%alarmint%RingInterval ), &
- clock%clockint%CurrTime ) )
- ELSE
- ! in this case time step is negative and stop time is
- ! less than start time
- ! ring interval must always be positive
-! hack for bug in PGI 5.1-x
-! PRED3 = ( alarm%alarmint%PrevRingTime - alarm%alarmint%RingInterval >= &
-! clock%clockint%CurrTime )
-
- PRED3 = ( MPAS_ESMF_TimeGE( MPAS_ESMF_TimeDec( &
- alarm%alarmint%PrevRingTime, &
- alarm%alarmint%RingInterval ), &
- clock%clockint%CurrTime ) )
- ENDIF
- ENDIF
- IF ( (.NOT. pred1) .AND. pred2 ) THEN
- alarm%alarmint%Ringing = .TRUE.
- alarm%alarmint%PrevRingTime = clock%clockint%CurrTime
-! MGD do we really want the line below?
-! alarm%alarmint%RingTimeSet = .FALSE. !it is a one time alarm, it rang, now let it resort to interval
- IF ( PRESENT( RingingAlarmList ) .AND. &
- PRESENT ( NumRingingAlarms ) ) THEN
- NumRingingAlarms = NumRingingAlarms + 1
- RingingAlarmList( NumRingingAlarms ) = alarm
- ENDIF
- ELSE IF ( (.NOT. pred1) .AND. pred3 ) THEN
- alarm%alarmint%Ringing = .TRUE.
- IF ( positive_timestep ) THEN
-! hack for bug in PGI 5.1-x
-! IF ( PRED3) alarm%alarmint%PrevRingTime = alarm%alarmint%PrevRingTime + &
-! alarm%alarmint%RingInterval
- IF ( PRED3 ) &
- alarm%alarmint%PrevRingTime = &
- MPAS_ESMF_TimeInc( alarm%alarmint%PrevRingTime, &
- alarm%alarmint%RingInterval )
- ELSE
- ! in this case time step is negative and stop time is
- ! less than start time
- ! ring interval must always be positive
-! hack for bug in PGI 5.1-x
-! IF ( PRED3) alarm%alarmint%PrevRingTime = alarm%alarmint%PrevRingTime - &
-! alarm%alarmint%RingInterval
- IF ( PRED3 ) &
- alarm%alarmint%PrevRingTime = &
- MPAS_ESMF_TimeDec( alarm%alarmint%PrevRingTime, &
- alarm%alarmint%RingInterval )
- ENDIF
- IF ( PRESENT( RingingAlarmList ) .AND. &
- PRESENT ( NumRingingAlarms ) ) THEN
- NumRingingAlarms = NumRingingAlarms + 1
- RingingAlarmList( NumRingingAlarms ) = alarm
- ENDIF
- ENDIF
- ELSE IF ( alarm%alarmint%RingTimeSet ) THEN
-! TBH: Need to remove duplicated code. Need to enforce only one of
-! TBH: alarm%alarmint%RingTimeSet or alarm%alarmint%RingIntervalSet ever
-! TBH: being .TRUE. and simplify the logic. Also, the simpler
-! TBH: implementation in here should be sufficient.
- IF ( positive_timestep ) THEN
-! hack for bug in PGI 5.1-x
-! IF ( alarm%alarmint%RingTime <= clock%clockint%CurrTime ) THEN
- IF ( MPAS_ESMF_TimeLE( alarm%alarmint%RingTime, &
- clock%clockint%CurrTime ) ) THEN
- alarm%alarmint%RingTimeSet = .FALSE. !it is a one time alarm, it rang, now let it resort to interval
- alarm%alarmint%Ringing = .TRUE.
- alarm%alarmint%PrevRingTime = clock%clockint%CurrTime
- IF ( PRESENT( RingingAlarmList ) .AND. &
- PRESENT ( NumRingingAlarms ) ) THEN
- NumRingingAlarms = NumRingingAlarms + 1
- RingingAlarmList( NumRingingAlarms ) = alarm
- ENDIF
- ENDIF
- ELSE
- ! in this case time step is negative and stop time is
- ! less than start time
-! hack for bug in PGI 5.1-x
-! IF ( alarm%alarmint%RingTime >= clock%clockint%CurrTime ) THEN
- IF ( MPAS_ESMF_TimeGE( alarm%alarmint%RingTime, &
- clock%clockint%CurrTime ) ) THEN
- alarm%alarmint%RingTimeSet = .FALSE. !it is a one time alarm, it rang, now let it resort to interval
- alarm%alarmint%Ringing = .TRUE.
- alarm%alarmint%PrevRingTime = clock%clockint%CurrTime
- IF ( PRESENT( RingingAlarmList ) .AND. &
- PRESENT ( NumRingingAlarms ) ) THEN
- NumRingingAlarms = NumRingingAlarms + 1
- RingingAlarmList( NumRingingAlarms ) = alarm
- ENDIF
- ENDIF
- ENDIF
- ENDIF
- IF ( alarm%alarmint%StopTimeSet ) THEN
-! TBH: what is this for???
- ENDIF
- ENDIF
- ENDIF
- clock%clockint%AlarmList(i) = alarm
- ENDDO
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_SUCCESS
-
- end subroutine MPAS_ESMF_ClockAdvance
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_ClockStopTimeDisable - NOOP for compatibility with MPAS_ESMF 2.1.0+
-
-! !INTERFACE:
- subroutine MPAS_ESMF_ClockStopTimeDisable(clock, rc)
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_Clock), intent(in) :: clock
- integer, intent(out), optional :: rc
-
- rc = MPAS_ESMF_SUCCESS
-
- end subroutine MPAS_ESMF_ClockStopTimeDisable
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_ClockIsStopTime - Has the clock reached its stop time ?
-
-! !INTERFACE:
- function MPAS_ESMF_ClockIsStopTime(clock, rc)
-!
-! !RETURN VALUE:
- logical :: MPAS_ESMF_ClockIsStopTime
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Clock), intent(in) :: clock
- integer, intent(out), optional :: rc
- logical :: positive_timestep
-
-! !DESCRIPTION:
-! Return true if {\tt MPAS_ESMF\_Clock} has reached its stop time, false
-! otherwise
-!
-! The arguments are:
-! \begin{description}
-! \item[clock]
-! The object instance to check
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-
-! !REQUIREMENTS:
-! TMG3.5.6
-!EOP
-
- positive_timestep = MPAS_ESMF_TimeIntervalIsPositive( clock%clockint%TimeStep )
- IF ( positive_timestep ) THEN
-! hack for bug in PGI 5.1-x
-! if ( clock%clockint%CurrTime .GE. clock%clockint%StopTime ) THEN
- if ( MPAS_ESMF_TimeGE( clock%clockint%CurrTime, &
- clock%clockint%StopTime ) ) THEN
- MPAS_ESMF_ClockIsStopTime = .TRUE.
- else
- MPAS_ESMF_ClockIsStopTime = .FALSE.
- endif
- ELSE
-! hack for bug in PGI 5.1-x
-! if ( clock%clockint%CurrTime .LE. clock%clockint%StopTime ) THEN
- if ( MPAS_ESMF_TimeLE( clock%clockint%CurrTime, &
- clock%clockint%StopTime ) ) THEN
- MPAS_ESMF_ClockIsStopTime = .TRUE.
- else
- MPAS_ESMF_ClockIsStopTime = .FALSE.
- endif
- ENDIF
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_SUCCESS
-
- end function MPAS_ESMF_ClockIsStopTime
-
-!------------------------------------------------------------------------------
-!
-! This section defines the overridden Read, Write, Validate and Print methods
-! from the MPAS_ESMF_Base class
-!
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_ClockRead - Restores a clock
-
-! !INTERFACE:
- subroutine MPAS_ESMF_ClockRead(clock, TimeStep, StartTime, StopTime, &
- RefTime, CurrTime, PrevTime, AdvanceCount, &
- AlarmList, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Clock), intent(out) :: clock
- type(MPAS_ESMF_TimeInterval), intent(in) :: TimeStep
- type(MPAS_ESMF_Time), intent(in) :: StartTime
- type(MPAS_ESMF_Time), intent(in) :: StopTime
- type(MPAS_ESMF_Time), intent(in) :: RefTime
- type(MPAS_ESMF_Time), intent(in) :: CurrTime
- type(MPAS_ESMF_Time), intent(in) :: PrevTime
- integer(MPAS_ESMF_KIND_I8), intent(in) :: AdvanceCount
- type(MPAS_ESMF_Alarm), dimension(MAX_ALARMS), intent(in) :: AlarmList
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Restore an {\tt MPAS_ESMF\_Clock}
-!
-! The arguments are:
-! \begin{description}
-! \item[clock]
-! The object instance to restore
-! \item[TimeStep]
-! The {\tt MPAS_ESMF\_Clock}'s time step interval
-! \item[StartTime]
-! The {\tt MPAS_ESMF\_Clock}'s starting time
-! \item[StopTime]
-! The {\tt MPAS_ESMF\_Clock}'s stopping time
-! \item[RefTime]
-! The {\tt MPAS_ESMF\_Clock}'s reference time
-! \item[CurrTime]
-! The {\tt MPAS_ESMF\_Clock}'s current time
-! \item[PrevTime]
-! The {\tt MPAS_ESMF\_Clock}'s previous time
-! \item[AdvanceCount]
-! The number of times the {\tt MPAS_ESMF\_Clock} has been advanced
-! \item[AlarmList]
-! The {\tt MPAS_ESMF\_Clock}'s {\tt MPAS_ESMF\_Alarm} list
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-!EOP
- CALL wrf_error_fatal( 'MPAS_ESMF_ClockRead not supported' )
- end subroutine MPAS_ESMF_ClockRead
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_ClockWrite - Saves a clock
-
-! !INTERFACE:
- subroutine MPAS_ESMF_ClockWrite(clock, TimeStep, StartTime, StopTime, &
- RefTime, CurrTime, PrevTime, AdvanceCount, &
- AlarmList, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Clock), intent(in) :: clock
- type(MPAS_ESMF_TimeInterval), intent(out) :: TimeStep
- type(MPAS_ESMF_Time), intent(out) :: StartTime
- type(MPAS_ESMF_Time), intent(out) :: StopTime
- type(MPAS_ESMF_Time), intent(out) :: RefTime
- type(MPAS_ESMF_Time), intent(out) :: CurrTime
- type(MPAS_ESMF_Time), intent(out) :: PrevTime
- integer(MPAS_ESMF_KIND_I8), intent(out) :: AdvanceCount
- type(MPAS_ESMF_Alarm), dimension(MAX_ALARMS), intent(out) :: AlarmList
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Save an {\tt MPAS_ESMF\_Clock}
-!
-! The arguments are:
-! \begin{description}
-! \item[clock]
-! The object instance to save
-! \item[TimeStep]
-! The {\tt MPAS_ESMF\_Clock}'s time step interval
-! \item[StartTime]
-! The {\tt MPAS_ESMF\_Clock}'s starting time
-! \item[StopTime]
-! The {\tt MPAS_ESMF\_Clock}'s stopping time
-! \item[RefTime]
-! The {\tt MPAS_ESMF\_Clock}'s reference time
-! \item[CurrTime]
-! The {\tt MPAS_ESMF\_Clock}'s current time
-! \item[PrevTime]
-! The {\tt MPAS_ESMF\_Clock}'s previous time
-! \item[AdvanceCount]
-! The number of times the {\tt MPAS_ESMF\_Clock} has been advanced
-! \item[AlarmList]
-! The {\tt MPAS_ESMF\_Clock}'s {\tt MPAS_ESMF\_Alarm} list
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-!EOP
- CALL wrf_error_fatal( 'MPAS_ESMF_ClockWrite not supported' )
- end subroutine MPAS_ESMF_ClockWrite
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_ClockValidate - Validate a Clock's properties
-
-! !INTERFACE:
- subroutine MPAS_ESMF_ClockValidate(clock, opts, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Clock), intent(in) :: clock
- character (len=*), intent(in), optional :: opts
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! Perform a validation check on an {\tt MPAS_ESMF\_Clock}'s properties
-!
-! The arguments are:
-! \begin{description}
-! \item[clock]
-! {\tt MPAS_ESMF\_Clock} to validate
-! \item[{[opts]}]
-! Validate options
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMGn.n.n
-!EOP
- CALL wrf_error_fatal( 'MPAS_ESMF_ClockValidate not supported' )
- end subroutine MPAS_ESMF_ClockValidate
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_ClockPrint - Print out a Clock's properties
-
-! !INTERFACE:
- subroutine MPAS_ESMF_ClockPrint(clock, opts, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Clock), intent(in) :: clock
- character (len=*), intent(in), optional :: opts
- integer, intent(out), optional :: rc
-
-! !DESCRIPTION:
-! To support testing/debugging, print out an {\tt MPAS_ESMF\_Clock}'s
-! properties.
-!
-! The arguments are:
-! \begin{description}
-! \item[clock]
-! {\tt MPAS_ESMF\_Clock} to print out
-! \item[{[opts]}]
-! Print options
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMGn.n.n
-!EOP
- CALL wrf_error_fatal( 'MPAS_ESMF_ClockPrint not supported' )
- end subroutine MPAS_ESMF_ClockPrint
-
-!------------------------------------------------------------------------------
-
- end module MPAS_ESMF_ClockMod
Deleted: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_Fraction.F90
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_Fraction.F90        2012-11-29 20:50:09 UTC (rev 2328)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_Fraction.F90        2012-11-29 22:23:06 UTC (rev 2329)
@@ -1,79 +0,0 @@
-!
-! Earth System Modeling Framework
-! Copyright 2002-2003, University Corporation for Atmospheric Research,
-! Massachusetts Institute of Technology, Geophysical Fluid Dynamics
-! Laboratory, University of Michigan, National Centers for Environmental
-! Prediction, Los Alamos National Laboratory, Argonne National Laboratory,
-! NASA Goddard Space Flight Center.
-! Licensed under the University of Illinois-NCSA license.
-!
-! MPAS_ESMF Fraction Module
-!
-!==============================================================================
-!
-! MPAS_ESMF Fraction Module
- module MPAS_ESMF_FractionMod
-!
-!==============================================================================
-!
-! This file contains the Fraction class definition and all Fraction
-! class methods.
-!
-!------------------------------------------------------------------------------
-! INCLUDES
-!
-!===============================================================================
-!BOPI
-!
-! !MODULE: MPAS_ESMF_FractionMod
-!
-! !DESCRIPTION:
-! Part of MPAS_ESMF F90 API wrapper of C++ implemenation
-!
-! Defines F90 wrapper entry points for corresponding
-! C++ implementaion of class {\tt ESMC\_Fraction}
-!
-! See {\tt ../include/ESMC\_Fraction.h} for complete description
-!
-!------------------------------------------------------------------------------
-! !USES:
-
- implicit none
-!
-!------------------------------------------------------------------------------
-! !PRIVATE TYPES:
- private
-!------------------------------------------------------------------------------
-! ! MPAS_ESMF_Fraction
-!
- type MPAS_ESMF_Fraction
- private
- integer :: n ! Integer fraction (exact) n/d; numerator
- integer :: d ! Integer fraction (exact) n/d; denominator
- end type
-!
-!------------------------------------------------------------------------------
-! !PUBLIC TYPES:
- public MPAS_ESMF_Fraction
-!------------------------------------------------------------------------------
-!
-! !PUBLIC MEMBER FUNCTIONS:
-
-! !PRIVATE MEMBER FUNCTIONS:
-
-!EOPI
-
-!==============================================================================
-
-! contains
-
-!==============================================================================
-!
-! Wrappers to C++ fraction routines
-!
-!------------------------------------------------------------------------------
-!
-
-!------------------------------------------------------------------------------
-
- end module MPAS_ESMF_FractionMod
Deleted: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_Macros.inc
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_Macros.inc        2012-11-29 20:50:09 UTC (rev 2328)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_Macros.inc        2012-11-29 22:23:06 UTC (rev 2329)
@@ -1,35 +0,0 @@
-#if 0
-
-Earth System Modeling Framework
-Copyright 2002-2003, University Corporation for Atmospheric Research,
-Massachusetts Institute of Technology, Geophysical Fluid Dynamics
-Laboratory, University of Michigan, National Centers for Environmental
-Prediction, Los Alamos National Laboratory, Argonne National Laboratory,
-NASA Goddard Space Flight Center.
-Licensed under the University of Illinois-NCSA license.
-
-Do not have C++ or F90 style comments in here because this file is processed
-by both C++ and F90 compilers.
-
-These lines prevent this file from being read more than once if it
-ends up being included multiple times.
-#endif
-
-#ifndef MPAS_ESMF_MACROS_INC
-#define MPAS_ESMF_MACROS_INC
-
-#if 0
-
-former file contents moved to MPAS_ESMF_BaseMod
-so user code can be compiled without requiring
-the preprocessor.
-
-#endif
-
-#if 0
-i left the following macro here in case it is needed for our internal use.
-#endif
-
-#define MPAS_ESMF_SRCLINE __FILE__, __LINE__
-
-#endif
Deleted: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_Mod.F90
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_Mod.F90        2012-11-29 20:50:09 UTC (rev 2328)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_Mod.F90        2012-11-29 22:23:06 UTC (rev 2329)
@@ -1,17 +0,0 @@
-! TBH: This version is for use with the MPAS_ESMF library embedded in the WRF
-! TBH: distribution.
-MODULE MPAS_ESMF_Mod
- USE MPAS_ESMF_alarmmod
- USE MPAS_ESMF_basemod
- USE MPAS_ESMF_basetimemod
- USE MPAS_ESMF_calendarmod
- USE MPAS_ESMF_clockmod
- USE MPAS_ESMF_fractionmod
- USE MPAS_ESMF_timeintervalmod
- USE MPAS_ESMF_timemod
- USE MPAS_ESMF_alarmclockmod
- USE MPAS_ESMF_stubs ! add new dummy interfaces and typedefs here as needed
-#include <MPAS_ESMF_TimeMgr.inc>
- INTEGER, PARAMETER :: MPAS_ESMF_MAX_ALARMS=MAX_ALARMS
-!
-END MODULE MPAS_ESMF_Mod
Deleted: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_Stubs.F90
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_Stubs.F90        2012-11-29 20:50:09 UTC (rev 2328)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_Stubs.F90        2012-11-29 22:23:06 UTC (rev 2329)
@@ -1,136 +0,0 @@
-! Various dummy type definitions and routines for the sole purpose of
-! mimicking newer MPAS_ESMF interface features without necessarily implementing
-! them.
-
-MODULE MPAS_ESMF_Stubs
-
- IMPLICIT NONE
-
- PRIVATE
-
-! Bogus typedefs
- TYPE MPAS_ESMF_Grid
- INTEGER :: dummy
- END TYPE
-
- TYPE MPAS_ESMF_GridComp
- INTEGER :: dummy
- END TYPE
-
- TYPE MPAS_ESMF_State
- INTEGER :: dummy
- END TYPE
-
- TYPE MPAS_ESMF_VM
- INTEGER :: dummy
- END TYPE
-
- TYPE MPAS_ESMF_MsgType
- INTEGER :: mtype
- END TYPE
- TYPE(MPAS_ESMF_MsgType), PARAMETER :: &
- MPAS_ESMF_LOG_INFO = MPAS_ESMF_MsgType(1), &
- MPAS_ESMF_LOG_WARNING = MPAS_ESMF_MsgType(2), &
- MPAS_ESMF_LOG_ERROR = MPAS_ESMF_MsgType(3)
-
- TYPE MPAS_ESMF_LOG
- INTEGER :: dummy
- END TYPE
-
- LOGICAL, private, save :: initialized = .false.
-
- PUBLIC MPAS_ESMF_Grid, MPAS_ESMF_GridComp, MPAS_ESMF_State, MPAS_ESMF_VM
- PUBLIC MPAS_ESMF_Initialize, MPAS_ESMF_Finalize, MPAS_ESMF_IsInitialized
- PUBLIC MPAS_ESMF_LogWrite, MPAS_ESMF_LOG, MPAS_ESMF_MsgType
- PUBLIC MPAS_ESMF_LOG_INFO, MPAS_ESMF_LOG_WARNING, MPAS_ESMF_LOG_ERROR
-
-CONTAINS
-
-
-! NOOP
- SUBROUTINE MPAS_ESMF_Initialize( vm, defaultCalendar, rc )
- USE MPAS_ESMF_basemod
- USE MPAS_ESMF_calendarmod
- TYPE(MPAS_ESMF_VM), INTENT(IN ), OPTIONAL :: vm
- TYPE(MPAS_ESMF_CalendarType), INTENT(IN ), OPTIONAL :: defaultCalendar
- INTEGER, INTENT( OUT), OPTIONAL :: rc
-
- TYPE(MPAS_ESMF_CalendarType) :: defaultCalType
- INTEGER :: status
-
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_FAILURE
- ! Initialize the default time manager calendar
- IF ( PRESENT(defaultCalendar) )THEN
- defaultCalType = defaultCalendar
- ELSE
- defaultCalType = MPAS_ESMF_CAL_NOLEAP
- END IF
- allocate( defaultCal )
- defaultCal = MPAS_ESMF_CalendarCreate( calendarType=defaultCalType, &
- rc=status)
-
- ! initialize tables in time manager
- CALL initdaym
-
- IF (status .ne. MPAS_ESMF_SUCCESS) THEN
- PRINT *, "Error initializing the default time manager calendar"
- RETURN
- END IF
- initialized = .true.
-
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_SUCCESS
- END SUBROUTINE MPAS_ESMF_Initialize
-
-
- FUNCTION MPAS_ESMF_IsInitialized()
- LOGICAL MPAS_ESMF_IsInitialized
- MPAS_ESMF_IsInitialized = initialized
- END FUNCTION MPAS_ESMF_IsInitialized
-
-
-! NOOP
- SUBROUTINE MPAS_ESMF_Finalize( rc )
- USE MPAS_ESMF_basemod
- USE MPAS_ESMF_calendarmod
-
- INTEGER, INTENT( OUT), OPTIONAL :: rc
-#if (defined SPMD) || (defined COUP_CSM)
-#include <mpif.h>
-#endif
- LOGICAL :: flag
- INTEGER :: ier
-
- CALL MPAS_ESMF_CalendarDestroy()
-
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_SUCCESS
-#if (defined SPMD) || (defined COUP_CSM)
- CALL MPI_Finalized( flag, ier )
- IF ( ier .ne. mpi_success )THEN
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_FAILURE
- END IF
- IF ( .NOT. flag ) THEN
- CALL MPI_Finalize( ier )
- IF ( ier .ne. mpi_success )THEN
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_FAILURE
- END IF
- END IF
-#endif
- END SUBROUTINE MPAS_ESMF_Finalize
-
-! NOOP
- SUBROUTINE MPAS_ESMF_LogWrite( msg, MsgType, line, file, method, log, rc )
- USE MPAS_ESMF_basemod
- CHARACTER(LEN=*), INTENT(IN) :: msg
- TYPE(MPAS_ESMF_MsgType), INTENT(IN) :: msgtype
- INTEGER, INTENT(IN), OPTIONAL :: line
- CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: file
- CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: method
- TYPE(MPAS_ESMF_LOG),TARGET,OPTIONAL :: log
- INTEGER, INTENT(OUT),OPTIONAL :: rc
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_SUCCESS
- END SUBROUTINE MPAS_ESMF_LogWrite
-
-
-END MODULE MPAS_ESMF_Stubs
-
-
Deleted: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_Time.F90
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_Time.F90        2012-11-29 20:50:09 UTC (rev 2328)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_Time.F90        2012-11-29 22:23:06 UTC (rev 2329)
@@ -1,1188 +0,0 @@
-!
-! Earth System Modeling Framework
-! Copyright 2002-2003, University Corporation for Atmospheric Research,
-! Massachusetts Institute of Technology, Geophysical Fluid Dynamics
-! Laboratory, University of Michigan, National Centers for Environmental
-! Prediction, Los Alamos National Laboratory, Argonne National Laboratory,
-! NASA Goddard Space Flight Center.
-! Licensed under the University of Illinois-NCSA license.
-!
-!==============================================================================
-!
-! MPAS_ESMF Time Module
- module MPAS_ESMF_TimeMod
-!
-!==============================================================================
-!
-! This file contains the Time class definition and all Time class methods.
-!
-!------------------------------------------------------------------------------
-! INCLUDES
-#include <MPAS_ESMF_TimeMgr.inc>
-
-!==============================================================================
-!BOPI
-! !MODULE: MPAS_ESMF_TimeMod
-!
-! !DESCRIPTION:
-! Part of Time Manager F90 API wrapper of C++ implemenation
-!
-! Defines F90 wrapper entry points for corresponding
-! C++ class {\tt ESMC\_Time} implementation
-!
-! See {\tt ../include/ESMC\_Time.h} for complete description
-!
-!------------------------------------------------------------------------------
-! !USES:
- ! inherit from MPAS_ESMF base class
- use MPAS_ESMF_BaseMod
-
- ! inherit from base time class
- use MPAS_ESMF_BaseTimeMod
-
- ! associated derived types
- use MPAS_ESMF_TimeIntervalMod
- use MPAS_ESMF_CalendarMod
- use MPAS_ESMF_Stubs
-
- implicit none
-!
-!------------------------------------------------------------------------------
-! !PRIVATE TYPES:
- private
-!------------------------------------------------------------------------------
-! ! MPAS_ESMF_Time
-!
-! ! F90 class type to match C++ Time class in size only;
-! ! all dereferencing within class is performed by C++ implementation
-
- type MPAS_ESMF_Time
- type(MPAS_ESMF_BaseTime) :: basetime ! inherit base class
- ! time instant is expressed as year + basetime
- integer :: YR
- type(MPAS_ESMF_Calendar), pointer :: calendar ! associated calendar
- end type
-
-!------------------------------------------------------------------------------
-! !PUBLIC TYPES:
- public MPAS_ESMF_Time
-!------------------------------------------------------------------------------
-!
-! !PUBLIC MEMBER FUNCTIONS:
- public MPAS_ESMF_TimeGet
- public MPAS_ESMF_TimeSet
-
-! Required inherited and overridden MPAS_ESMF_Base class methods
-
- public MPAS_ESMF_TimeCopy
-
-! !PRIVATE MEMBER FUNCTIONS:
-
- private MPAS_ESMF_TimeGetDayOfYear
- private MPAS_ESMF_TimeGetDayOfYearInteger
-
-! Inherited and overloaded from MPAS_ESMF_BaseTime
-
- ! NOTE: MPAS_ESMF_TimeInc, MPAS_ESMF_TimeDec, MPAS_ESMF_TimeDiff, MPAS_ESMF_TimeEQ,
- ! MPAS_ESMF_TimeNE, MPAS_ESMF_TimeLT, MPAS_ESMF_TimeGT, MPAS_ESMF_TimeLE, and
- ! MPAS_ESMF_TimeGE are PUBLIC only to work around bugs in the
- ! PGI 5.1-x compilers. They should all be PRIVATE.
-
- public operator(+)
- public MPAS_ESMF_TimeInc
-
- public operator(-)
- public MPAS_ESMF_TimeDec
- public MPAS_ESMF_TimeDec2
- public MPAS_ESMF_TimeDiff
-
- public operator(.EQ.)
- public MPAS_ESMF_TimeEQ
-
- public operator(.NE.)
- public MPAS_ESMF_TimeNE
-
- public operator(.LT.)
- public MPAS_ESMF_TimeLT
-
- public operator(.GT.)
- public MPAS_ESMF_TimeGT
-
- public operator(.LE.)
- public MPAS_ESMF_TimeLE
-
- public operator(.GE.)
- public MPAS_ESMF_TimeGE
-
-!EOPI
-
-!==============================================================================
-!
-! INTERFACE BLOCKS
-!
-!==============================================================================
-!BOP
-! !INTERFACE:
- interface MPAS_ESMF_TimeGetDayOfYear
-
-! !PRIVATE MEMBER FUNCTIONS:
- module procedure MPAS_ESMF_TimeGetDayOfYearInteger
-
-! !DESCRIPTION:
-! This interface overloads the {\tt MPAS_ESMF\_GetDayOfYear} method
-! for the {\tt MPAS_ESMF\_Time} class
-!
-!EOP
- end interface
-!
-!------------------------------------------------------------------------------
-!BOP
-! !INTERFACE:
- interface operator(+)
-
-! !PRIVATE MEMBER FUNCTIONS:
- module procedure MPAS_ESMF_TimeInc, MPAS_ESMF_TimeInc2
-
-! !DESCRIPTION:
-! This interface overloads the + operator for the {\tt MPAS_ESMF\_Time} class
-!
-!EOP
- end interface
-!
-!------------------------------------------------------------------------------
-!BOP
-! !INTERFACE:
- interface assignment (=)
-
-! !PRIVATE MEMBER FUNCTIONS:
- module procedure MPAS_ESMF_TimeCopy
-
-! !DESCRIPTION:
-! This interface overloads the = operator for the {\tt MPAS_ESMF\_Time} class
-!
-!EOP
- end interface
-!
-!------------------------------------------------------------------------------
-!BOP
-! !INTERFACE:
- interface operator(-)
-
-! !PRIVATE MEMBER FUNCTIONS:
- module procedure MPAS_ESMF_TimeDec, MPAS_ESMF_TimeDec2
-
-! !DESCRIPTION:
-! This interface overloads the - operator for the {\tt MPAS_ESMF\_Time} class
-!
-!EOP
- end interface
-!
-!------------------------------------------------------------------------------
-!BOP
-! !INTERFACE:
- interface operator(-)
-
-! !PRIVATE MEMBER FUNCTIONS:
- module procedure MPAS_ESMF_TimeDiff
-
-! !DESCRIPTION:
-! This interface overloads the - operator for the {\tt MPAS_ESMF\_Time} class
-!
-!EOP
- end interface
-!
-!------------------------------------------------------------------------------
-!BOP
-! !INTERFACE:
- interface operator(.EQ.)
-
-! !PRIVATE MEMBER FUNCTIONS:
- module procedure MPAS_ESMF_TimeEQ
-
-! !DESCRIPTION:
-! This interface overloads the .EQ. operator for the {\tt MPAS_ESMF\_Time} class
-!
-!EOP
- end interface
-!
-!------------------------------------------------------------------------------
-!BOP
-! !INTERFACE:
- interface operator(.NE.)
-
-! !PRIVATE MEMBER FUNCTIONS:
- module procedure MPAS_ESMF_TimeNE
-
-! !DESCRIPTION:
-! This interface overloads the .NE. operator for the {\tt MPAS_ESMF\_Time} class
-!
-!EOP
- end interface
-!
-!------------------------------------------------------------------------------
-!BOP
-! !INTERFACE:
- interface operator(.LT.)
-
-! !PRIVATE MEMBER FUNCTIONS:
- module procedure MPAS_ESMF_TimeLT
-
-! !DESCRIPTION:
-! This interface overloads the .LT. operator for the {\tt MPAS_ESMF\_Time} class
-!
-!EOP
- end interface
-!
-!------------------------------------------------------------------------------
-!BOP
-! !INTERFACE:
- interface operator(.GT.)
-
-! !PRIVATE MEMBER FUNCTIONS:
- module procedure MPAS_ESMF_TimeGT
-
-! !DESCRIPTION:
-! This interface overloads the .GT. operator for the {\tt MPAS_ESMF\_Time} class
-!
-!EOP
- end interface
-!
-!------------------------------------------------------------------------------
-!BOP
-! !INTERFACE:
- interface operator(.LE.)
-
-! !PRIVATE MEMBER FUNCTIONS:
- module procedure MPAS_ESMF_TimeLE
-
-! !DESCRIPTION:
-! This interface overloads the .LE. operator for the {\tt MPAS_ESMF\_Time} class
-!
-!EOP
- end interface
-!
-!------------------------------------------------------------------------------
-!BOP
-! !INTERFACE:
- interface operator(.GE.)
-
-! !PRIVATE MEMBER FUNCTIONS:
- module procedure MPAS_ESMF_TimeGE
-
-! !DESCRIPTION:
-! This interface overloads the .GE. operator for the {\tt MPAS_ESMF\_Time} class
-!
-!EOP
- end interface
-!
-!------------------------------------------------------------------------------
-
-!==============================================================================
-
- contains
-
-!==============================================================================
-!
-! Generic Get/Set routines which use F90 optional arguments
-!
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_TimeGet - Get value in user-specified units
-
-! !INTERFACE:
- subroutine MPAS_ESMF_TimeGet(time, YY, YRl, MM, DD, D, Dl, H, M, S, Sl, MS, &
- US, NS, d_, h_, m_, s_, ms_, us_, ns_, Sn, Sd, &
- dayOfYear, dayOfYear_r8, dayOfYear_intvl, &
- timeString, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Time), intent(in) :: time
- integer, intent(out), optional :: YY
- integer(MPAS_ESMF_KIND_I8), intent(out), optional :: YRl
- integer, intent(out), optional :: MM
- integer, intent(out), optional :: DD
- integer, intent(out), optional :: D
- integer(MPAS_ESMF_KIND_I8), intent(out), optional :: Dl
- integer, intent(out), optional :: H
- integer, intent(out), optional :: M
- integer, intent(out), optional :: S
- integer(MPAS_ESMF_KIND_I8), intent(out), optional :: Sl
- integer, intent(out), optional :: MS
- integer, intent(out), optional :: US
- integer, intent(out), optional :: NS
- double precision, intent(out), optional :: d_
- double precision, intent(out), optional :: h_
- double precision, intent(out), optional :: m_
- double precision, intent(out), optional :: s_
- double precision, intent(out), optional :: ms_
- double precision, intent(out), optional :: us_
- double precision, intent(out), optional :: ns_
- integer, intent(out), optional :: Sn
- integer, intent(out), optional :: Sd
- integer, intent(out), optional :: dayOfYear
- ! dayOfYear_r8 = 1.0 at 0Z on 1 January, 1.5 at 12Z on
- ! 1 January, etc.
- real(MPAS_ESMF_KIND_R8), intent(out), optional :: dayOfYear_r8
- character (len=*), intent(out), optional :: timeString
- type(MPAS_ESMF_TimeInterval), intent(out), optional :: dayOfYear_intvl
- integer, intent(out), optional :: rc
-
- type(MPAS_ESMF_TimeInterval) :: day_step
- integer :: ierr
-
-! !DESCRIPTION:
-! Get the value of the {\tt MPAS_ESMF\_Time} in units specified by the user
-! via F90 optional arguments.
-!
-! Time manager represents and manipulates time internally with integers
-! to maintain precision. Hence, user-specified floating point values are
-! converted internally from integers.
-!
-! See {\tt ../include/ESMC\_BaseTime.h and ../include/ESMC\_Time.h} for
-! complete description.
-!
-! The arguments are:
-! \begin{description}
-! \item[time]
-! The object instance to query
-! \item[{[YY]}]
-! Integer year CCYR (>= 32-bit)
-! \item[{[YRl]}]
-! Integer year CCYR (large, >= 64-bit)
-! \item[{[MM]}]
-! Integer month 1-12
-! \item[{[DD]}]
-! Integer day of the month 1-31
-! \item[{[D]}]
-! Integer Julian days (>= 32-bit)
-! \item[{[Dl]}]
-! Integer Julian days (large, >= 64-bit)
-! \item[{[H]}]
-! Integer hours
-! \item[{[M]}]
-! Integer minutes
-! \item[{[S]}]
-! Integer seconds (>= 32-bit)
-! \item[{[Sl]}]
-! Integer seconds (large, >= 64-bit)
-! \item[{[MS]}]
-! Integer milliseconds
-! \item[{[US]}]
-! Integer microseconds
-! \item[{[NS]}]
-! Integer nanoseconds
-! \item[{[d\_]}]
-! Double precision days
-! \item[{[h\_]}]
-! Double precision hours
-! \item[{[m\_]}]
-! Double precision minutes
-! \item[{[s\_]}]
-! Double precision seconds
-! \item[{[ms\_]}]
-! Double precision milliseconds
-! \item[{[us\_]}]
-! Double precision microseconds
-! \item[{[ns\_]}]
-! Double precision nanoseconds
-! \item[{[Sn]}]
-! Integer fractional seconds - numerator
-! \item[{[Sd]}]
-! Integer fractional seconds - denominator
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG2.1, TMG2.5.1, TMG2.5.6
-!EOP
- TYPE(MPAS_ESMF_Time) :: begofyear
- INTEGER :: year, month, dayofmonth, hour, minute, second
- REAL(MPAS_ESMF_KIND_R8) :: rsec
-
- ierr = MPAS_ESMF_SUCCESS
-
- IF ( PRESENT( YY ) ) THEN
- YY = time%YR
- ENDIF
- IF ( PRESENT( MM ) ) THEN
- CALL timegetmonth( time, MM )
- ENDIF
- IF ( PRESENT( DD ) ) THEN
- CALL timegetdayofmonth( time, DD )
- ENDIF
-!
-!$$$ Push HMS down into MPAS_ESMF_BaseTime from EVERYWHERE
-!$$$ and THEN add MPAS_ESMF scaling behavior when other args are present...
- IF ( PRESENT( H ) ) THEN
- H = mod( time%basetime%S, SECONDS_PER_DAY ) / SECONDS_PER_HOUR
- ENDIF
- IF ( PRESENT( M ) ) THEN
- M = mod( time%basetime%S, SECONDS_PER_HOUR) / SECONDS_PER_MINUTE
- ENDIF
- IF ( PRESENT( S ) ) THEN
- S = mod( time%basetime%S, SECONDS_PER_MINUTE )
- ENDIF
- ! TBH: HACK to allow DD and S to behave as in MPAS_ESMF 2.1.0+ when
- ! TBH: both are present and H and M are not.
- IF ( PRESENT( S ) .AND. PRESENT( DD ) ) THEN
- IF ( ( .NOT. PRESENT( H ) ) .AND. ( .NOT. PRESENT( M ) ) ) THEN
- S = mod( time%basetime%S, SECONDS_PER_DAY )
- ENDIF
- ENDIF
- IF ( PRESENT( MS ) ) THEN
- IF ( time%basetime%Sd /= 0 ) THEN
- MS = NINT( ( time%basetime%Sn*1.0D0 / time%basetime%Sd*1.0D0 ) * 1000.0D0 )
- ELSE
- MS = 0
- ENDIF
- ENDIF
- IF ( PRESENT( Sd ) .AND. PRESENT( Sn ) ) THEN
- Sd = time%basetime%Sd
- Sn = time%basetime%Sn
- ENDIF
- IF ( PRESENT( dayOfYear ) ) THEN
- CALL MPAS_ESMF_TimeGetDayOfYear( time, dayOfYear, rc=ierr )
- ENDIF
- IF ( PRESENT( dayOfYear_r8 ) ) THEN
- ! 64-bit IEEE 754 has 52-bit mantisssa -- only need 25 bits to hold
- ! number of seconds in a year...
- rsec = REAL( time%basetime%S, MPAS_ESMF_KIND_R8 )
- IF ( time%basetime%Sd /= 0 ) THEN
- rsec = rsec + ( REAL( time%basetime%Sn, MPAS_ESMF_KIND_R8 ) / &
- REAL( time%basetime%Sd, MPAS_ESMF_KIND_R8 ) )
- ENDIF
- dayOfYear_r8 = rsec / REAL( SECONDS_PER_DAY, MPAS_ESMF_KIND_R8 )
- ! start at 1
- dayOfYear_r8 = dayOfYear_r8 + 1.0_MPAS_ESMF_KIND_R8
- ENDIF
- IF ( PRESENT( timeString ) ) THEN
- ! This duplication for YMD is an optimization that avoids calling
- ! timegetmonth() and timegetdayofmonth() when it is not needed.
- year = time%YR
- CALL timegetmonth( time, month )
- CALL timegetdayofmonth( time, dayofmonth )
-!$$$ push HMS down into MPAS_ESMF_BaseTime
- hour = mod( time%basetime%S, SECONDS_PER_DAY ) / SECONDS_PER_HOUR
- minute = mod( time%basetime%S, SECONDS_PER_HOUR) / SECONDS_PER_MINUTE
- second = mod( time%basetime%S, SECONDS_PER_MINUTE )
- CALL MPAS_ESMFold_TimeGetString( year, month, dayofmonth, &
- hour, minute, second, timeString )
- ENDIF
- IF ( PRESENT( dayOfYear_intvl ) ) THEN
- year = time%YR
- CALL MPAS_ESMF_TimeSet( begofyear, yy=year, mm=1, dd=1, s=0, &
- calendar=time%calendar, rc=ierr )
- IF ( ierr == MPAS_ESMF_FAILURE)THEN
- rc = ierr
- RETURN
- END IF
- CALL MPAS_ESMF_TimeIntervalSet( day_step, d=1, s=0, rc=ierr )
- dayOfYear_intvl = time - begofyear + day_step
- ENDIF
-
- IF ( PRESENT( rc ) ) THEN
- rc = ierr
- ENDIF
-
- end subroutine MPAS_ESMF_TimeGet
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_TimeSet - Initialize via user-specified unit set
-
-! !INTERFACE:
- subroutine MPAS_ESMF_TimeSet(time, YY, YRl, MM, DD, D, Dl, H, M, S, Sl, &
- MS, US, NS, d_, h_, m_, s_, ms_, us_, ns_, &
- Sn, Sd, calendar, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Time), intent(inout) :: time
- integer, intent(in), optional :: YY
- integer(MPAS_ESMF_KIND_I8), intent(in), optional :: YRl
- integer, intent(in), optional :: MM
- integer, intent(in), optional :: DD
- integer, intent(in), optional :: D
- integer(MPAS_ESMF_KIND_I8), intent(in), optional :: Dl
- integer, intent(in), optional :: H
- integer, intent(in), optional :: M
- integer, intent(in), optional :: S
- integer(MPAS_ESMF_KIND_I8), intent(in), optional :: Sl
- integer, intent(in), optional :: MS
- integer, intent(in), optional :: US
- integer, intent(in), optional :: NS
- double precision, intent(in), optional :: d_
- double precision, intent(in), optional :: h_
- double precision, intent(in), optional :: m_
- double precision, intent(in), optional :: s_
- double precision, intent(in), optional :: ms_
- double precision, intent(in), optional :: us_
- double precision, intent(in), optional :: ns_
- integer, intent(in), optional :: Sn
- integer, intent(in), optional :: Sd
- type(MPAS_ESMF_Calendar), intent(in), target, optional :: calendar
- integer, intent(out), optional :: rc
- ! locals
- INTEGER :: ierr
-
-! !DESCRIPTION:
-! Initializes a {\tt MPAS_ESMF\_Time} with a set of user-specified units
-! via F90 optional arguments.
-!
-! Time manager represents and manipulates time internally with integers
-! to maintain precision. Hence, user-specified floating point values are
-! converted internally to integers.
-!
-! See {\tt ../include/ESMC\_BaseTime.h and ../include/ESMC\_Time.h} for
-! complete description.
-!
-! The arguments are:
-! \begin{description}
-! \item[time]
-! The object instance to initialize
-! \item[{[YY]}]
-! Integer year CCYR (>= 32-bit)
-! \item[{[YRl]}]
-! Integer year CCYR (large, >= 64-bit)
-! \item[{[MM]}]
-! Integer month 1-12
-! \item[{[DD]}]
-! Integer day of the month 1-31
-! \item[{[D]}]
-! Integer Julian days (>= 32-bit)
-! \item[{[Dl]}]
-! Integer Julian days (large, >= 64-bit)
-! \item[{[H]}]
-! Integer hours
-! \item[{[M]}]
-! Integer minutes
-! \item[{[S]}]
-! Integer seconds (>= 32-bit)
-! \item[{[Sl]}]
-! Integer seconds (large, >= 64-bit)
-! \item[{[MS]}]
-! Integer milliseconds
-! \item[{[US]}]
-! Integer microseconds
-! \item[{[NS]}]
-! Integer nanoseconds
-! \item[{[d\_]}]
-! Double precision days
-! \item[{[h\_]}]
-! Double precision hours
-! \item[{[m\_]}]
-! Double precision minutes
-! \item[{[s\_]}]
-! Double precision seconds
-! \item[{[ms\_]}]
-! Double precision milliseconds
-! \item[{[us\_]}]
-! Double precision microseconds
-! \item[{[ns\_]}]
-! Double precision nanoseconds
-! \item[{[Sn]}]
-! Integer fractional seconds - numerator
-! \item[{[Sd]}]
-! Integer fractional seconds - denominator
-! \item[{[cal]}]
-! Associated {\tt Calendar}
-! \item[{[tz]}]
-! Associated timezone (hours offset from GMT, e.g. EST = -5)
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMGn.n.n
-!EOP
-! PRINT *,'DEBUG: BEGIN MPAS_ESMF_TimeSet()'
-!$$$ push this down into MPAS_ESMF_BaseTime constructor
- time%basetime%S = 0
- time%basetime%Sn = 0
- time%basetime%Sd = 0
-
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_FAILURE
- time%YR = 0
- IF ( PRESENT( YY ) ) THEN
-! PRINT *,'DEBUG: MPAS_ESMF_TimeSet(): YY = ',YY
- time%YR = YY
- ENDIF
- IF ( PRESENT( MM ) ) THEN
-! PRINT *,'DEBUG: MPAS_ESMF_TimeSet(): MM = ',MM
- CALL timeaddmonths( time, MM, ierr )
- IF ( ierr == MPAS_ESMF_FAILURE ) THEN
- IF ( PRESENT( rc ) ) THEN
- rc = MPAS_ESMF_FAILURE
- RETURN
- ENDIF
- ENDIF
-! PRINT *,'DEBUG: MPAS_ESMF_TimeSet(): back from timeaddmonths'
- ENDIF
- IF ( PRESENT( DD ) ) THEN
-!$$$ no check for DD in range of days of month MM yet
-!$$$ Must separate D and DD for correct interface!
-! PRINT *,'DEBUG: MPAS_ESMF_TimeSet(): DD = ',DD
- time%basetime%S = time%basetime%S + &
- ( SECONDS_PER_DAY * INT( (DD-1), MPAS_ESMF_KIND_I8 ) )
- ENDIF
-!$$$ push H,M,S,Sn,Sd,MS down into MPAS_ESMF_BaseTime constructor
- IF ( PRESENT( H ) ) THEN
-! PRINT *,'DEBUG: MPAS_ESMF_TimeSet(): H = ',H
- time%basetime%S = time%basetime%S + &
- ( SECONDS_PER_HOUR * INT( H, MPAS_ESMF_KIND_I8 ) )
- ENDIF
- IF ( PRESENT( M ) ) THEN
-! PRINT *,'DEBUG: MPAS_ESMF_TimeSet(): M = ',M
- time%basetime%S = time%basetime%S + &
- ( SECONDS_PER_MINUTE * INT( M, MPAS_ESMF_KIND_I8 ) )
- ENDIF
- IF ( PRESENT( S ) ) THEN
-! PRINT *,'DEBUG: MPAS_ESMF_TimeSet(): S = ',S
- time%basetime%S = time%basetime%S + &
- INT( S, MPAS_ESMF_KIND_I8 )
- ENDIF
- IF ( PRESENT( Sn ) .AND. ( .NOT. PRESENT( Sd ) ) ) THEN
- CALL wrf_error_fatal( &
- "MPAS_ESMF_TimeSet: Must specify Sd if Sn is specified")
- ENDIF
- IF ( PRESENT( Sd ) .AND. PRESENT( MS ) ) THEN
- CALL wrf_error_fatal( &
- "MPAS_ESMF_TimeSet: Must not specify both Sd and MS")
- ENDIF
- time%basetime%Sn = 0
- time%basetime%Sd = 0
- IF ( PRESENT( MS ) ) THEN
-! PRINT *,'DEBUG: MPAS_ESMF_TimeSet(): MS = ',MS
- time%basetime%Sn = MS
- time%basetime%Sd = 1000_MPAS_ESMF_KIND_I8
- ELSE IF ( PRESENT( Sd ) ) THEN
-! PRINT *,'DEBUG: MPAS_ESMF_TimeSet(): Sd = ',Sd
- time%basetime%Sd = Sd
- IF ( PRESENT( Sn ) ) THEN
-! PRINT *,'DEBUG: MPAS_ESMF_TimeSet(): Sn = ',Sn
- time%basetime%Sn = Sn
- ENDIF
- ENDIF
- IF ( PRESENT(calendar) )THEN
-! PRINT *,'DEBUG: MPAS_ESMF_TimeSet(): using passed-in calendar'
-! Note that the ugly hack of wrapping the call to MPAS_ESMF_CalendarInitialized()
-! inside this #ifdef is due to lack of support for compile-time initialization
-! of components of Fortran derived types. Some older compilers like PGI 5.1-x
-! do not support this F95 feature. In this case we only lose a safety check.
-#ifndef NO_DT_COMPONENT_INIT
- IF ( .not. MPAS_ESMF_CalendarInitialized( calendar ) )THEN
- call wrf_error_fatal( "Error:: MPAS_ESMF_CalendarCreate not "// &
- "called on input Calendar")
- END IF
-#endif
- time%Calendar => calendar
- ELSE
-! PRINT *,'DEBUG: MPAS_ESMF_TimeSet(): using default calendar'
- IF ( .not. MPAS_ESMF_IsInitialized() )THEN
- call wrf_error_fatal( "Error:: MPAS_ESMF_Initialize not called")
- END IF
- time%Calendar => defaultCal
- END IF
-
-! PRINT *,'DEBUG: MPAS_ESMF_TimeSet(): calling normalize_time()'
-!$$$DEBUG
-!IF ( time%basetime%Sd > 0 ) THEN
-! PRINT *,'DEBUG MPAS_ESMF_TimeSet() before normalize: S,Sn,Sd = ', &
-! time%basetime%S, time%basetime%Sn, time%basetime%Sd
-!ENDIF
-!$$$END DEBUG
- CALL normalize_time( time )
-!$$$DEBUG
-!IF ( time%basetime%Sd > 0 ) THEN
-! PRINT *,'DEBUG MPAS_ESMF_TimeSet() after normalize: S,Sn,Sd = ', &
-! time%basetime%S, time%basetime%Sn, time%basetime%Sd
-!ENDIF
-!$$$END DEBUG
-
-! PRINT *,'DEBUG: MPAS_ESMF_TimeSet(): back from normalize_time()'
- IF ( PRESENT( rc ) ) THEN
- rc = MPAS_ESMF_SUCCESS
- ENDIF
-
- end subroutine MPAS_ESMF_TimeSet
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMFold_TimeGetString - Get time instant value in string format
-
-! !INTERFACE:
- subroutine MPAS_ESMFold_TimeGetString( year, month, dayofmonth, &
- hour, minute, second, TimeString )
-
-! !ARGUMENTS:
- integer, intent(in) :: year
- integer, intent(in) :: month
- integer, intent(in) :: dayofmonth
- integer, intent(in) :: hour
- integer, intent(in) :: minute
- integer, intent(in) :: second
- character*(*), intent(out) :: TimeString
-! !DESCRIPTION:
-! Convert {\tt MPAS_ESMF\_Time}'s value into ISO 8601 format YYYY-MM-DDThh:mm:ss
-!
-! The arguments are:
-! \begin{description}
-! \item[time]
-! The object instance to convert
-! \item[TimeString]
-! The string to return
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG2.4.7
-!EOP
-
-!PRINT *,'DEBUG: MPAS_ESMF_TimePrint(): YR,S,Sn,Sd = ',time%YR,time%basetime%S,time%basetime%Sn,time%basetime%Sd
-!PRINT *,'DEBUG: MPAS_ESMF_TimePrint(): year = ',year
-!PRINT *,'DEBUG: MPAS_ESMF_TimePrint(): month, dayofmonth = ',month,dayofmonth
-!PRINT *,'DEBUG: MPAS_ESMF_TimePrint(): hour = ',hour
-!PRINT *,'DEBUG: MPAS_ESMF_TimePrint(): minute = ',minute
-!PRINT *,'DEBUG: MPAS_ESMF_TimePrint(): second = ',second
-
-!$$$here... add negative sign for YR<0
-!$$$here... add Sn, Sd ??
-#ifdef PLANET
- write(TimeString,FMT="(I4.4,'-',I5.5,'_',I2.2,':',I2.2,':',I2.2)") &
- year,dayofmonth,hour,minute,second
-#else
- write(TimeString,FMT="(I4.4,'-',I2.2,'-',I2.2,'_',I2.2,':',I2.2,':',I2.2)") &
- year,month,dayofmonth,hour,minute,second
-#endif
-
- end subroutine MPAS_ESMFold_TimeGetString
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_TimeGetDayOfYearInteger - Get time instant's day of the year as an integer value
-!
-! !INTERFACE:
- subroutine MPAS_ESMF_TimeGetDayOfYearInteger(time, DayOfYear, rc)
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_Time), intent(in) :: time
- integer, intent(out) :: DayOfYear
- integer, intent(out), optional :: rc
-!
-! !DESCRIPTION:
-! Get the day of the year the given {\tt MPAS_ESMF\_Time} instant falls on
-! (1-365). Returned as an integer value
-!
-! The arguments are:
-! \begin{description}
-! \item[time]
-! The object instance to query
-! \item[DayOfYear]
-! The {\tt MPAS_ESMF\_Time} instant's day of the year (1-365)
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-!EOP
- ! requires that time be normalized
-!$$$ bug when Sn>0? test
-!$$$ add tests
- DayOfYear = ( time%basetime%S / SECONDS_PER_DAY ) + 1
- IF ( PRESENT( rc ) ) rc = MPAS_ESMF_SUCCESS
- end subroutine MPAS_ESMF_TimeGetDayOfYearInteger
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_TimeInc - Increment time instant with a time interval
-!
-! !INTERFACE:
- function MPAS_ESMF_TimeInc(time, timeinterval)
-!
-! !RETURN VALUE:
- type(MPAS_ESMF_Time) :: MPAS_ESMF_TimeInc
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_Time), intent(in) :: time
- type(MPAS_ESMF_TimeInterval), intent(in) :: timeinterval
-! !LOCAL:
- integer :: rc
-!
-! !DESCRIPTION:
-! Increment {\tt MPAS_ESMF\_Time} instant with a {\tt MPAS_ESMF\_TimeInterval},
-! return resulting {\tt MPAS_ESMF\_Time} instant
-!
-! Maps overloaded (+) operator interface function to
-! {\tt MPAS_ESMF\_BaseTime} base class
-!
-! The arguments are:
-! \begin{description}
-! \item[time]
-! The given {\tt MPAS_ESMF\_Time} to increment
-! \item[timeinterval]
-! The {\tt MPAS_ESMF\_TimeInterval} to add to the given {\tt MPAS_ESMF\_Time}
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG1.5.4, TMG2.4.4, TMG2.4.5, TMG2.4.6, TMG5.1, TMG5.2, TMG7.2
-!EOP
-
- ! copy MPAS_ESMF_Time specific properties (e.g. calendar, timezone)
- MPAS_ESMF_TimeInc = time
-
- ! call ESMC_BaseTime base class function
- call c_ESMC_BaseTimeSum(time, timeinterval, MPAS_ESMF_TimeInc)
-
- end function MPAS_ESMF_TimeInc
-!
-! this is added for certain compilers that don't deal with commutativity
-!
- function MPAS_ESMF_TimeInc2(timeinterval, time)
- type(MPAS_ESMF_Time) :: MPAS_ESMF_TimeInc2
- type(MPAS_ESMF_Time), intent(in) :: time
- type(MPAS_ESMF_TimeInterval), intent(in) :: timeinterval
- MPAS_ESMF_TimeInc2 = MPAS_ESMF_TimeInc( time, timeinterval )
- end function MPAS_ESMF_TimeInc2
-!
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_TimeDec - Decrement time instant with a time interval
-!
-! !INTERFACE:
- function MPAS_ESMF_TimeDec(time, timeinterval)
-!
-! !RETURN VALUE:
- type(MPAS_ESMF_Time) :: MPAS_ESMF_TimeDec
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_Time), intent(in) :: time
- type(MPAS_ESMF_TimeInterval), intent(in) :: timeinterval
-! !LOCAL:
- integer :: rc
-!
-! !DESCRIPTION:
-! Decrement {\tt MPAS_ESMF\_Time} instant with a {\tt MPAS_ESMF\_TimeInterval},
-! return resulting {\tt MPAS_ESMF\_Time} instant
-!
-! Maps overloaded (-) operator interface function to
-! {\tt MPAS_ESMF\_BaseTime} base class
-!
-! The arguments are:
-! \begin{description}
-! \item[time]
-! The given {\tt MPAS_ESMF\_Time} to decrement
-! \item[timeinterval]
-! The {\tt MPAS_ESMF\_TimeInterval} to subtract from the given
-! {\tt MPAS_ESMF\_Time}
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG1.5.4, TMG2.4.4, TMG2.4.5, TMG2.4.6, TMG5.1, TMG5.2, TMG7.2
-!EOP
-
- ! copy MPAS_ESMF_Time specific properties (e.g. calendar, timezone)
- MPAS_ESMF_TimeDec = time
-
- ! call ESMC_BaseTime base class function
- call c_ESMC_BaseTimeDec(time, timeinterval, MPAS_ESMF_TimeDec)
-
- end function MPAS_ESMF_TimeDec
-
-!
-! this is added for certain compilers that don't deal with commutativity
-!
- function MPAS_ESMF_TimeDec2(timeinterval, time)
- type(MPAS_ESMF_Time) :: MPAS_ESMF_TimeDec2
- type(MPAS_ESMF_Time), intent(in) :: time
- type(MPAS_ESMF_TimeInterval), intent(in) :: timeinterval
- MPAS_ESMF_TimeDec2 = MPAS_ESMF_TimeDec( time, timeinterval )
- end function MPAS_ESMF_TimeDec2
-!
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_TimeDiff - Return the difference between two time instants
-!
-! !INTERFACE:
- function MPAS_ESMF_TimeDiff(time1, time2)
-!
-! !RETURN VALUE:
- type(MPAS_ESMF_TimeInterval) :: MPAS_ESMF_TimeDiff
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_Time), intent(in) :: time1
- type(MPAS_ESMF_Time), intent(in) :: time2
-! !LOCAL:
- integer :: rc
-
-! !DESCRIPTION:
-! Return the {\tt MPAS_ESMF\_TimeInterval} difference between two
-! {\tt MPAS_ESMF\_Time} instants
-!
-! Maps overloaded (-) operator interface function to
-! {\tt MPAS_ESMF\_BaseTime} base class
-!
-! The arguments are:
-! \begin{description}
-! \item[time1]
-! The first {\tt MPAS_ESMF\_Time} instant
-! \item[time2]
-! The second {\tt MPAS_ESMF\_Time} instant
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG1.5.4, TMG2.4.4, TMG2.4.5, TMG2.4.6, TMG5.1, TMG5.2, TMG7.2
-!EOP
-
- ! call ESMC_BaseTime base class function
- CALL MPAS_ESMF_TimeIntervalSet( MPAS_ESMF_TimeDiff, rc=rc )
- call c_ESMC_BaseTimeDiff(time1, time2, MPAS_ESMF_TimeDiff)
-
- end function MPAS_ESMF_TimeDiff
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_TimeEQ - Compare two times for equality
-!
-! !INTERFACE:
- function MPAS_ESMF_TimeEQ(time1, time2)
-!
-! !RETURN VALUE:
- logical :: MPAS_ESMF_TimeEQ
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_Time), intent(in) :: time1
- type(MPAS_ESMF_Time), intent(in) :: time2
-!
-! !DESCRIPTION:
-! Return true if both given {\tt MPAS_ESMF\_Time} instants are equal, false
-! otherwise. Maps overloaded (==) operator interface function to
-! {\tt MPAS_ESMF\_BaseTime} base class.
-!
-! The arguments are:
-! \begin{description}
-! \item[time1]
-! First time instant to compare
-! \item[time2]
-! Second time instant to compare
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG1.5.3, TMG2.4.3, TMG7.2
-!EOP
-
- ! invoke C to C++ entry point for MPAS_ESMF_BaseTime base class function
- call c_ESMC_BaseTimeEQ(time1, time2, MPAS_ESMF_TimeEQ)
-
- end function MPAS_ESMF_TimeEQ
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_TimeNE - Compare two times for non-equality
-!
-! !INTERFACE:
- function MPAS_ESMF_TimeNE(time1, time2)
-!
-! !RETURN VALUE:
- logical :: MPAS_ESMF_TimeNE
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_Time), intent(in) :: time1
- type(MPAS_ESMF_Time), intent(in) :: time2
-
-! !DESCRIPTION:
-! Return true if both given {\tt MPAS_ESMF\_Time} instants are not equal, false
-! otherwise. Maps overloaded (/=) operator interface function to
-! {\tt MPAS_ESMF\_BaseTime} base class.
-!
-! The arguments are:
-! \begin{description}
-! \item[time1]
-! First time instant to compare
-! \item[time2]
-! Second time instant to compare
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG1.5.3, TMG2.4.3, TMG7.2
-!EOP
-
- ! call ESMC_BaseTime base class function
- call c_ESMC_BaseTimeNE(time1, time2, MPAS_ESMF_TimeNE)
-
- end function MPAS_ESMF_TimeNE
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_TimeLT - Time instant 1 less than time instant 2 ?
-!
-! !INTERFACE:
- function MPAS_ESMF_TimeLT(time1, time2)
-!
-! !RETURN VALUE:
- logical :: MPAS_ESMF_TimeLT
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_Time), intent(in) :: time1
- type(MPAS_ESMF_Time), intent(in) :: time2
-!
-! !DESCRIPTION:
-! Return true if first {\tt MPAS_ESMF\_Time} instant is less than second
-! {\tt MPAS_ESMF\_Time} instant, false otherwise. Maps overloaded (<)
-! operator interface function to {\tt MPAS_ESMF\_BaseTime} base class.
-!
-! The arguments are:
-! \begin{description}
-! \item[time1]
-! First time instant to compare
-! \item[time2]
-! Second time instant to compare
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG1.5.3, TMG2.4.3, TMG7.2
-!EOP
-
- ! call ESMC_BaseTime base class function
- call c_ESMC_BaseTimeLT(time1, time2, MPAS_ESMF_TimeLT)
-
- end function MPAS_ESMF_TimeLT
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_TimeGT - Time instant 1 greater than time instant 2 ?
-!
-! !INTERFACE:
- function MPAS_ESMF_TimeGT(time1, time2)
-!
-! !RETURN VALUE:
- logical :: MPAS_ESMF_TimeGT
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_Time), intent(in) :: time1
- type(MPAS_ESMF_Time), intent(in) :: time2
-!
-! !DESCRIPTION:
-! Return true if first {\tt MPAS_ESMF\_Time} instant is greater than second
-! {\tt MPAS_ESMF\_Time} instant, false otherwise. Maps overloaded (>) operator
-! interface function to {\tt MPAS_ESMF\_BaseTime} base class.
-!
-! The arguments are:
-! \begin{description}
-! \item[time1]
-! First time instant to compare
-! \item[time2]
-! Second time instant to compare
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG1.5.3, TMG2.4.3, TMG7.2
-!EOP
-
- ! call ESMC_BaseTime base class function
- call c_ESMC_BaseTimeGT(time1, time2, MPAS_ESMF_TimeGT)
-
- end function MPAS_ESMF_TimeGT
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_TimeLE - Time instant 1 less than or equal to time instant 2 ?
-!
-! !INTERFACE:
- function MPAS_ESMF_TimeLE(time1, time2)
-!
-! !RETURN VALUE:
- logical :: MPAS_ESMF_TimeLE
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_Time), intent(in) :: time1
- type(MPAS_ESMF_Time), intent(in) :: time2
-!
-! !DESCRIPTION:
-! Return true if first {\tt MPAS_ESMF\_Time} instant is less than or equal to
-! second {\tt MPAS_ESMF\_Time} instant, false otherwise. Maps overloaded (<=)
-! operator interface function to {\tt MPAS_ESMF\_BaseTime} base class.
-!
-! The arguments are:
-! \begin{description}
-! \item[time1]
-! First time instant to compare
-! \item[time2]
-! Second time instant to compare
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG1.5.3, TMG2.4.3, TMG7.2
-!EOP
-
- ! call ESMC_BaseTime base class function
- call c_ESMC_BaseTimeLE(time1, time2, MPAS_ESMF_TimeLE)
-
- end function MPAS_ESMF_TimeLE
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_TimeGE - Time instant 1 greater than or equal to time instant 2 ?
-!
-! !INTERFACE:
- function MPAS_ESMF_TimeGE(time1, time2)
-!
-! !RETURN VALUE:
- logical :: MPAS_ESMF_TimeGE
-!
-! !ARGUMENTS:
- type(MPAS_ESMF_Time), intent(in) :: time1
- type(MPAS_ESMF_Time), intent(in) :: time2
-!
-! !DESCRIPTION:
-! Return true if first {\tt MPAS_ESMF\_Time} instant is greater than or equal to
-! second {\tt MPAS_ESMF\_Time} instant, false otherwise. Maps overloaded (>=)
-! operator interface function to {\tt MPAS_ESMF\_BaseTime} base class.
-!
-! The arguments are:
-! \begin{description}
-! \item[time1]
-! First time instant to compare
-! \item[time2]
-! Second time instant to compare
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG1.5.3, TMG2.4.3, TMG7.2
-!EOP
-
- ! call ESMC_BaseTime base class function
- call c_ESMC_BaseTimeGE(time1, time2, MPAS_ESMF_TimeGE)
-
- end function MPAS_ESMF_TimeGE
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_TimeCopy - Copy a time-instance
-
-! !INTERFACE:
- subroutine MPAS_ESMF_TimeCopy(timeout, timein)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_Time), intent(out) :: timeout
- type(MPAS_ESMF_Time), intent(in) :: timein
-
-! !DESCRIPTION:
-! Copy a time-instance to a new instance.
-!
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMGn.n.n
-!EOP
-
- timeout%basetime = timein%basetime
- timeout%YR = timein%YR
- timeout%Calendar => timein%Calendar
-
- end subroutine MPAS_ESMF_TimeCopy
-
- end module MPAS_ESMF_TimeMod
Deleted: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_TimeInterval.F90
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_TimeInterval.F90        2012-11-29 20:50:09 UTC (rev 2328)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_TimeInterval.F90        2012-11-29 22:23:06 UTC (rev 2329)
@@ -1,1268 +0,0 @@
-!
-! Earth System Modeling Framework
-! Copyright 2002-2003, University Corporation for Atmospheric Research,
-! Massachusetts Institute of Technology, Geophysical Fluid Dynamics
-! Laboratory, University of Michigan, National Centers for Environmental
-! Prediction, Los Alamos National Laboratory, Argonne National Laboratory,
-! NASA Goddard Space Flight Center.
-! Licensed under the University of Illinois-NCSA license.
-!
-!==============================================================================
-!
-! MPAS_ESMF TimeInterval Module
- module MPAS_ESMF_TimeIntervalMod
-!
-!==============================================================================
-!
-! This file contains the TimeInterval class definition and all TimeInterval
-! class methods.
-!
-!------------------------------------------------------------------------------
-! INCLUDES
-#include <MPAS_ESMF_TimeMgr.inc>
-!
-!===============================================================================
-!BOPI
-! !MODULE: MPAS_ESMF_TimeIntervalMod
-!
-! !DESCRIPTION:
-! Part of Time Manager F90 API wrapper of C++ implemenation
-!
-! Defines F90 wrapper entry points for corresponding
-! C++ implementaion of class {\tt ESMC\_TimeInterval}
-!
-! See {\tt ../include/ESMC\_TimeInterval.h} for complete description
-!
-!------------------------------------------------------------------------------
-! !USES:
- ! inherit from MPAS_ESMF base class
- use MPAS_ESMF_BaseMod
-
- ! inherit from base time class
- use MPAS_ESMF_BaseTimeMod
-
- ! associated derived types
- use MPAS_ESMF_FractionMod, only : MPAS_ESMF_Fraction
- use MPAS_ESMF_CalendarMod
-
- implicit none
-!
-!------------------------------------------------------------------------------
-! !PRIVATE TYPES:
- private
-!------------------------------------------------------------------------------
-! ! MPAS_ESMF_TimeInterval
-!
-! ! F90 class type to match C++ TimeInterval class in size only;
-! ! all dereferencing within class is performed by C++ implementation
-
- type MPAS_ESMF_TimeInterval
- ! time interval is expressed as basetime
- type(MPAS_ESMF_BaseTime) :: basetime ! inherit base class
- ! Relative year and month fields support monthly or yearly time
- ! intervals. Many operations are undefined when these fields are
- ! non-zero!
- INTEGER :: YR ! relative year
- !jm Month has no meaning for an interval; get rid of it, 20100319
- ! INTEGER :: MM ! relative month
- end type
-
-!------------------------------------------------------------------------------
-! !PUBLIC TYPES:
- public MPAS_ESMF_TimeInterval
-!------------------------------------------------------------------------------
-!
-! !PUBLIC MEMBER FUNCTIONS:
- public MPAS_ESMF_TimeIntervalGet
- public MPAS_ESMF_TimeIntervalSet
- public MPAS_ESMFold_TimeIntervalGetString
- public MPAS_ESMF_TimeIntervalAbsValue
- public MPAS_ESMF_TimeIntervalNegAbsValue
-
-! Required inherited and overridden MPAS_ESMF_Base class methods
-
-!!!!!!!!! added 20051012, JM
-! public WRFADDITION_TimeIntervalDIVQuot
-!!!!!!!!! renamed to simplify testing 20060320, TH
- public MPAS_ESMF_TimeIntervalDIVQuot
-
- ! This convenience routine is only used by other modules in
- ! MPAS_ESMF_time_f90.
- public MPAS_ESMF_TimeIntervalIsPositive
-
-
-! !PRIVATE MEMBER FUNCTIONS:
-
-! overloaded operator functions
-
- public operator(/)
- private MPAS_ESMF_TimeIntervalQuotI
-
- public operator(*)
- private MPAS_ESMF_TimeIntervalProdI
-
-! Inherited and overloaded from MPAS_ESMF_BaseTime
-
- public operator(+)
- private MPAS_ESMF_TimeIntervalSum
-
- public operator(-)
- private MPAS_ESMF_TimeIntervalDiff
-
- public operator(.EQ.)
- private MPAS_ESMF_TimeIntervalEQ
-
- public operator(.NE.)
- private MPAS_ESMF_TimeIntervalNE
-
- public operator(.LT.)
- private MPAS_ESMF_TimeIntervalLT
-
- public operator(.GT.)
- private MPAS_ESMF_TimeIntervalGT
-
- public operator(.LE.)
- private MPAS_ESMF_TimeIntervalLE
-
- public operator(.GE.)
- private MPAS_ESMF_TimeIntervalGE
-!EOPI
-
-!==============================================================================
-!
-! INTERFACE BLOCKS
-!
-!==============================================================================
-!BOP
-! !INTERFACE:
- interface operator(*)
-
-! !PRIVATE MEMBER FUNCTIONS:
- module procedure MPAS_ESMF_TimeIntervalProdI
-
-! !DESCRIPTION:
-! This interface overloads the * operator for the {\tt MPAS_ESMF\_TimeInterval}
-! class
-!
-!EOP
- end interface
-!
-!------------------------------------------------------------------------------
-!BOP
-! !INTERFACE:
- interface operator(/)
-
-! !PRIVATE MEMBER FUNCTIONS:
- module procedure MPAS_ESMF_TimeIntervalQuotI
-
-! !DESCRIPTION:
-! This interface overloads the / operator for the
-! {\tt MPAS_ESMF\_TimeInterval} class
-!
-!EOP
- end interface
-!
-!------------------------------------------------------------------------------
-!BOP
-! !INTERFACE:
- interface operator(+)
-
-! !PRIVATE MEMBER FUNCTIONS:
- module procedure MPAS_ESMF_TimeIntervalSum
-
-! !DESCRIPTION:
-! This interface overloads the + operator for the
-! {\tt MPAS_ESMF\_TimeInterval} class
-!
-!EOP
- end interface
-!
-!------------------------------------------------------------------------------
-!BOP
-! !INTERFACE:
- interface operator(-)
-
-! !PRIVATE MEMBER FUNCTIONS:
- module procedure MPAS_ESMF_TimeIntervalDiff
-
-! !DESCRIPTION:
-! This interface overloads the - operator for the
-! {\tt MPAS_ESMF\_TimeInterval} class
-!
-!EOP
- end interface
-!
-!------------------------------------------------------------------------------
-!BOP
-! !INTERFACE:
- interface operator(.EQ.)
-
-! !PRIVATE MEMBER FUNCTIONS:
- module procedure MPAS_ESMF_TimeIntervalEQ
-
-! !DESCRIPTION:
-! This interface overloads the .EQ. operator for the
-! {\tt MPAS_ESMF\_TimeInterval} class
-!
-!EOP
- end interface
-!
-!------------------------------------------------------------------------------
-!BOP
-! !INTERFACE:
- interface operator(.NE.)
-
-! !PRIVATE MEMBER FUNCTIONS:
- module procedure MPAS_ESMF_TimeIntervalNE
-
-! !DESCRIPTION:
-! This interface overloads the .NE. operator for the
-! {\tt MPAS_ESMF\_TimeInterval} class
-!
-!EOP
- end interface
-!
-!------------------------------------------------------------------------------
-!BOP
-! !INTERFACE:
- interface operator(.LT.)
-
-! !PRIVATE MEMBER FUNCTIONS:
- module procedure MPAS_ESMF_TimeIntervalLT
-
-! !DESCRIPTION:
-! This interface overloads the .LT. operator for the
-! {\tt MPAS_ESMF\_TimeInterval} class
-!
-!EOP
- end interface
-!
-!------------------------------------------------------------------------------
-!BOP
-! !INTERFACE:
- interface operator(.GT.)
-
-! !PRIVATE MEMBER FUNCTIONS:
- module procedure MPAS_ESMF_TimeIntervalGT
-
-! !DESCRIPTION:
-! This interface overloads the .GT. operator for the
-! {\tt MPAS_ESMF\_TimeInterval} class
-!
-!EOP
- end interface
-!
-!------------------------------------------------------------------------------
-!BOP
-! !INTERFACE:
- interface operator(.LE.)
-
-! !PRIVATE MEMBER FUNCTIONS:
- module procedure MPAS_ESMF_TimeIntervalLE
-
-! !DESCRIPTION:
-! This interface overloads the .LE. operator for the
-! {\tt MPAS_ESMF\_TimeInterval} class
-!
-!EOP
- end interface
-!
-!------------------------------------------------------------------------------
-!BOP
-! !INTERFACE:
- interface operator(.GE.)
-
-! !PRIVATE MEMBER FUNCTIONS:
- module procedure MPAS_ESMF_TimeIntervalGE
-
-! !DESCRIPTION:
-! This interface overloads the .GE. operator for the
-! {\tt MPAS_ESMF\_TimeInterval} class
-!
-!EOP
- end interface
-!
-!------------------------------------------------------------------------------
-
-!==============================================================================
-
- contains
-
-!==============================================================================
-!
-! Generic Get/Set routines which use F90 optional arguments
-!
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_TimeIntervalGet - Get value in user-specified units
-
-! !INTERFACE:
- subroutine MPAS_ESMF_TimeIntervalGet(timeinterval, D, d_r8, S, S_i8, Sn, Sd, &
- TimeString, rc )
-
-! !ARGUMENTS:
- type(MPAS_ESMF_TimeInterval), intent(in) :: timeinterval
- integer, intent(out), optional :: D
- real(MPAS_ESMF_KIND_R8), intent(out), optional :: d_r8
- integer(MPAS_ESMF_KIND_I8), intent(out), optional :: S_i8
- integer, intent(out), optional :: S
- integer, intent(out), optional :: Sn
- integer, intent(out), optional :: Sd
- character*(*), optional, intent(out) :: TimeString
- integer, intent(out), optional :: rc
-
-
-! !DESCRIPTION:
-! Get the value of the {\tt MPAS_ESMF\_TimeInterval} in units specified by the
-! user via F90 optional arguments.
-!
-! Time manager represents and manipulates time internally with integers
-! to maintain precision. Hence, user-specified floating point values are
-! converted internally from integers.
-!
-! See {\tt ../include/ESMC\_BaseTime.h} and
-! {\tt ../include/ESMC\_TimeInterval.h} for complete description.
-!
-! The arguments are:
-! \begin{description}
-! \item[timeinterval]
-! The object instance to query
-! \item[{[YY]}]
-! Integer years (>= 32-bit)
-! \item[{[YYl]}]
-! Integer years (large, >= 64-bit)
-! \item[{[MO]}]
-! Integer months (>= 32-bit)
-! \item[{[MOl]}]
-! Integer months (large, >= 64-bit)
-! \item[{[D]}]
-! Integer days (>= 32-bit)
-! \item[{[Dl]}]
-! Integer days (large, >= 64-bit)
-! \item[{[H]}]
-! Integer hours
-! \item[{[M]}]
-! Integer minutes
-! \item[{[S]}]
-! Integer seconds (>= 32-bit)
-! \item[{[Sl]}]
-! Integer seconds (large, >= 64-bit)
-! \item[{[MS]}]
-! Integer milliseconds
-! \item[{[US]}]
-! Integer microseconds
-! \item[{[NS]}]
-! Integer nanoseconds
-! \item[{[d\_]}]
-! Double precision days
-! \item[{[h\_]}]
-! Double precision hours
-! \item[{[m\_]}]
-! Double precision minutes
-! \item[{[s\_]}]
-! Double precision seconds
-! \item[{[ms\_]}]
-! Double precision milliseconds
-! \item[{[us\_]}]
-! Double precision microseconds
-! \item[{[ns\_]}]
-! Double precision nanoseconds
-! \item[{[Sn]}]
-! Integer fractional seconds - numerator
-! \item[{[Sd]}]
-! Integer fractional seconds - denominator
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG1.1
-!
-! Added argument to output double precision seconds, S_i8
-! William.Gustafson@pnl.gov; 9-May-2008
-!
-!EOP
- INTEGER(MPAS_ESMF_KIND_I8) :: seconds
- INTEGER :: ierr
-
- ierr = MPAS_ESMF_SUCCESS
- seconds = timeinterval%basetime%S
- ! note that S is overwritten below (if present) if other args are also
- ! present
- IF ( PRESENT(S) ) S = seconds
- IF ( PRESENT(S_i8) ) S_i8 = seconds
- IF ( PRESENT( D ) ) THEN
- D = seconds / SECONDS_PER_DAY
- IF ( PRESENT(S) ) S = MOD( seconds, SECONDS_PER_DAY )
- IF ( PRESENT(S_i8) ) S_i8 = MOD( seconds, SECONDS_PER_DAY )
- ENDIF
- IF ( PRESENT( d_r8 ) ) THEN
- D_r8 = REAL( seconds, MPAS_ESMF_KIND_R8 ) / &
- REAL( SECONDS_PER_DAY, MPAS_ESMF_KIND_R8 )
- IF ( PRESENT(S) ) S = MOD( seconds, SECONDS_PER_DAY )
- IF ( PRESENT(S_i8) ) S_i8 = MOD( seconds, SECONDS_PER_DAY )
- ENDIF
- IF ( PRESENT(Sn) ) THEN
- Sn = timeinterval%basetime%Sn
- ENDIF
- IF ( PRESENT(Sd) ) THEN
- Sd = timeinterval%basetime%Sd
- ENDIF
- IF ( PRESENT( timeString ) ) THEN
- CALL MPAS_ESMFold_TimeIntervalGetString( timeinterval, timeString, rc=ierr )
- ENDIF
- IF ( PRESENT(rc) ) rc = ierr
-
- end subroutine MPAS_ESMF_TimeIntervalGet
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_TimeIntervalSet - Initialize via user-specified unit set
-
-! !INTERFACE:
- subroutine MPAS_ESMF_TimeIntervalSet(timeinterval, YY, YYl, MM, MOl, D, Dl, &
- H, M, S, Sl, MS, US, NS, &
- d_, h_, m_, s_, ms_, us_, ns_, &
- Sn, Sd, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_TimeInterval), intent(out) :: timeinterval
- integer, intent(in), optional :: YY
- integer(MPAS_ESMF_KIND_I8), intent(in), optional :: YYl
- integer, intent(in), optional :: MM
- integer(MPAS_ESMF_KIND_I8), intent(in), optional :: MOl
- integer, intent(in), optional :: D
- integer(MPAS_ESMF_KIND_I8), intent(in), optional :: Dl
- integer, intent(in), optional :: H
- integer, intent(in), optional :: M
- integer, intent(in), optional :: S
- integer(MPAS_ESMF_KIND_I8), intent(in), optional :: Sl
- integer, intent(in), optional :: MS
- integer, intent(in), optional :: US
- integer, intent(in), optional :: NS
- double precision, intent(in), optional :: d_
- double precision, intent(in), optional :: h_
- double precision, intent(in), optional :: m_
- double precision, intent(in), optional :: s_
- double precision, intent(in), optional :: ms_
- double precision, intent(in), optional :: us_
- double precision, intent(in), optional :: ns_
- integer, intent(in), optional :: Sn
- integer, intent(in), optional :: Sd
- integer, intent(out), optional :: rc
- ! locals
- INTEGER :: nfeb
-
-! !DESCRIPTION:
-! Set the value of the {\tt MPAS_ESMF\_TimeInterval} in units specified by
-! the user via F90 optional arguments
-!
-! Time manager represents and manipulates time internally with integers
-! to maintain precision. Hence, user-specified floating point values are
-! converted internally to integers.
-!
-! See {\tt ../include/ESMC\_BaseTime.h} and
-! {\tt ../include/ESMC\_TimeInterval.h} for complete description.
-!
-! The arguments are:
-! \begin{description}
-! \item[timeinterval]
-! The object instance to initialize
-! \item[{[YY]}]
-! Integer number of interval years (>= 32-bit)
-! \item[{[YYl]}]
-! Integer number of interval years (large, >= 64-bit)
-! \item[{[MM]}]
-! Integer number of interval months (>= 32-bit)
-! \item[{[MOl]}]
-! Integer number of interval months (large, >= 64-bit)
-! \item[{[D]}]
-! Integer number of interval days (>= 32-bit)
-! \item[{[Dl]}]
-! Integer number of interval days (large, >= 64-bit)
-! \item[{[H]}]
-! Integer hours
-! \item[{[M]}]
-! Integer minutes
-! \item[{[S]}]
-! Integer seconds (>= 32-bit)
-! \item[{[Sl]}]
-! Integer seconds (large, >= 64-bit)
-! \item[{[MS]}]
-! Integer milliseconds
-! \item[{[US]}]
-! Integer microseconds
-! \item[{[NS]}]
-! Integer nanoseconds
-! \item[{[d\_]}]
-! Double precision days
-! \item[{[h\_]}]
-! Double precision hours
-! \item[{[m\_]}]
-! Double precision minutes
-! \item[{[s\_]}]
-! Double precision seconds
-! \item[{[ms\_]}]
-! Double precision milliseconds
-! \item[{[us\_]}]
-! Double precision microseconds
-! \item[{[ns\_]}]
-! Double precision nanoseconds
-! \item[{[Sn]}]
-! Integer fractional seconds - numerator
-! \item[{[Sd]}]
-! Integer fractional seconds - denominator
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMGn.n.n
-!EOP
-
- IF ( PRESENT(rc) ) rc = MPAS_ESMF_FAILURE
- ! note that YR and MM are relative
- timeinterval%YR = 0
- IF ( PRESENT( YY ) ) THEN
- timeinterval%YR = YY
- ENDIF
-!jm timeinterval%MM = 0
-!jm IF ( PRESENT( MM ) ) THEN
-!jm timeinterval%MM = MM
-!jm ENDIF
-!jm ! Rollover months to years
-!jm IF ( abs(timeinterval%MM) .GE. MONTHS_PER_YEAR ) THEN
-!jm timeinterval%YR = timeinterval%YR + timeinterval%MM/MONTHS_PER_YEAR
-!jm timeinterval%MM = mod(timeinterval%MM,MONTHS_PER_YEAR)
-!jm ENDIF
-
- timeinterval%basetime%S = 0
- ! For 365-day calendar, immediately convert years to days since we know
- ! how to do it in this case.
-!$$$ replace this hack with something saner...
- IF ( nfeb( 2004 ) == 28 ) THEN
- timeinterval%basetime%S = timeinterval%basetime%S + &
- ( 365_MPAS_ESMF_KIND_I8 * &
- INT( timeinterval%YR, MPAS_ESMF_KIND_I8 ) * SECONDS_PER_DAY )
- timeinterval%YR = 0
- ENDIF
- IF ( PRESENT( D ) ) THEN
- timeinterval%basetime%S = timeinterval%basetime%S + &
- ( SECONDS_PER_DAY * INT( D, MPAS_ESMF_KIND_I8 ) )
- ENDIF
-!$$$ Push H,M,S,Sn,Sd,MS down into BaseTime constructor from EVERYWHERE
-!$$$ and THEN add MPAS_ESMF scaling behavior when other args are present...
- IF ( PRESENT( H ) ) THEN
- timeinterval%basetime%S = timeinterval%basetime%S + &
- ( SECONDS_PER_HOUR * INT( H, MPAS_ESMF_KIND_I8 ) )
- ENDIF
- IF ( PRESENT( M ) ) THEN
- timeinterval%basetime%S = timeinterval%basetime%S + &
- ( SECONDS_PER_MINUTE * INT( M, MPAS_ESMF_KIND_I8 ) )
- ENDIF
- IF ( PRESENT( S ) ) THEN
- timeinterval%basetime%S = timeinterval%basetime%S + &
- INT( S, MPAS_ESMF_KIND_I8 )
- ENDIF
- IF ( PRESENT( Sn ) .AND. ( .NOT. PRESENT( Sd ) ) ) THEN
- CALL wrf_error_fatal( &
- "MPAS_ESMF_TimeIntervalSet: Must specify Sd if Sn is specified")
- ENDIF
- IF ( PRESENT( Sd ) .AND. PRESENT( MS ) ) THEN
- CALL wrf_error_fatal( &
- "MPAS_ESMF_TimeIntervalSet: Must not specify both Sd and MS")
- ENDIF
- timeinterval%basetime%Sn = 0
- timeinterval%basetime%Sd = 0
- IF ( PRESENT( MS ) ) THEN
- timeinterval%basetime%Sn = MS
- timeinterval%basetime%Sd = 1000_MPAS_ESMF_KIND_I8
- ELSE IF ( PRESENT( Sd ) ) THEN
- timeinterval%basetime%Sd = Sd
- IF ( PRESENT( Sn ) ) THEN
- timeinterval%basetime%Sn = Sn
- ENDIF
- ENDIF
- CALL normalize_timeint( timeinterval )
-
- IF ( PRESENT(rc) ) rc = MPAS_ESMF_SUCCESS
-
- end subroutine MPAS_ESMF_TimeIntervalSet
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMFold_TimeIntervalGetString - Get time interval value in string format
-
-! !INTERFACE:
- subroutine MPAS_ESMFold_TimeIntervalGetString(timeinterval, TimeString, rc)
-
-! !ARGUMENTS:
- type(MPAS_ESMF_TimeInterval), intent(in) :: timeinterval
- character*(*), intent(out) :: TimeString
- integer, intent(out), optional :: rc
- ! locals
- integer :: signnormtimeint
- LOGICAL :: negative
- INTEGER(MPAS_ESMF_KIND_I8) :: iS, iSn, iSd, H, M, S
- character (len=1) :: signstr
-
-! !DESCRIPTION:
-! Convert {\tt MPAS_ESMF\_TimeInterval}'s value into string format
-!
-! The arguments are:
-! \begin{description}
-! \item[timeinterval]
-! The object instance to convert
-! \item[TimeString]
-! The string to return
-! \item[{[rc]}]
-! Return code; equals {\tt MPAS_ESMF\_SUCCESS} if there are no errors.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG1.5.9
-!EOP
-
-! NOTE: YR, MM, Sn, and Sd are not yet included in the returned string...
-!PRINT *,'DEBUG MPAS_ESMFold_TimeIntervalGetString(): YR,MM,S,Sn,Sd = ', &
-! timeinterval%YR, &
-! timeinterval%MM, &
-! timeinterval%basetime%S, &
-! timeinterval%basetime%Sn, &
-! timeinterval%basetime%Sd
-
- negative = ( signnormtimeint( timeInterval ) == -1 )
- IF ( negative ) THEN
- iS = -timeinterval%basetime%S
- iSn = -timeinterval%basetime%Sn
- signstr = '-'
- ELSE
- iS = timeinterval%basetime%S
- iSn = timeinterval%basetime%Sn
- signstr = ''
- ENDIF
- iSd = timeinterval%basetime%Sd
-
- H = mod( iS, SECONDS_PER_DAY ) / SECONDS_PER_HOUR
- M = mod( iS, SECONDS_PER_HOUR) / SECONDS_PER_MINUTE
- S = mod( iS, SECONDS_PER_MINUTE )
-
-!$$$here... need to print Sn and Sd when they are used ???
-
- write(TimeString,FMT="(A,I10.10,'_',I3.3,':',I3.3,':',I3.3)") &
- TRIM(signstr), ( iS / SECONDS_PER_DAY ), H, M, S
-
-!write(0,*)'TimeIntervalGetString Sn ',timeinterval%basetime%Sn,' Sd ',timeinterval%basetime%Sd
-
- rc = MPAS_ESMF_SUCCESS
-
- end subroutine MPAS_ESMFold_TimeIntervalGetString
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_TimeIntervalAbsValue - Get the absolute value of a time interval
-
-! !INTERFACE:
- function MPAS_ESMF_TimeIntervalAbsValue(timeinterval)
-
-! !RETURN VALUE:
- type(MPAS_ESMF_TimeInterval) :: MPAS_ESMF_TimeIntervalAbsValue
-
-! !ARGUMENTS:
- type(MPAS_ESMF_TimeInterval), intent(in) :: timeinterval
-! !LOCAL:
- integer :: rc
-
-! !DESCRIPTION:
-! Return a {\tt MPAS_ESMF\_TimeInterval}'s absolute value.
-!
-! The arguments are:
-! \begin{description}
-! \item[timeinterval]
-! The object instance to take the absolute value of.
-! Absolute value returned as value of function.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG1.5.8
-!EOP
- CALL timeintchecknormalized( timeinterval, 'MPAS_ESMF_TimeIntervalAbsValue arg1' )
- MPAS_ESMF_TimeIntervalAbsValue = timeinterval
-!$$$here... move implementation into BaseTime
- MPAS_ESMF_TimeIntervalAbsValue%basetime%S = &
- abs(MPAS_ESMF_TimeIntervalAbsValue%basetime%S)
- MPAS_ESMF_TimeIntervalAbsValue%basetime%Sn = &
- abs(MPAS_ESMF_TimeIntervalAbsValue%basetime%Sn )
-
- end function MPAS_ESMF_TimeIntervalAbsValue
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_TimeIntervalNegAbsValue - Get the negative absolute value of a time interval
-
-! !INTERFACE:
- function MPAS_ESMF_TimeIntervalNegAbsValue(timeinterval)
-
-! !RETURN VALUE:
- type(MPAS_ESMF_TimeInterval) :: MPAS_ESMF_TimeIntervalNegAbsValue
-
-! !ARGUMENTS:
- type(MPAS_ESMF_TimeInterval), intent(in) :: timeinterval
-! !LOCAL:
- integer :: rc
-
-! !DESCRIPTION:
-! Return a {\tt MPAS_ESMF\_TimeInterval}'s negative absolute value.
-!
-! The arguments are:
-! \begin{description}
-! \item[timeinterval]
-! The object instance to take the negative absolute value of.
-! Negative absolute value returned as value of function.
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG1.5.8
-!EOP
- CALL timeintchecknormalized( timeinterval, 'MPAS_ESMF_TimeIntervalNegAbsValue arg1' )
-
- MPAS_ESMF_TimeIntervalNegAbsValue = timeinterval
-!$$$here... move implementation into BaseTime
- MPAS_ESMF_TimeIntervalNegAbsValue%basetime%S = &
- -abs(MPAS_ESMF_TimeIntervalNegAbsValue%basetime%S)
- MPAS_ESMF_TimeIntervalNegAbsValue%basetime%Sn = &
- -abs(MPAS_ESMF_TimeIntervalNegAbsValue%basetime%Sn )
-
- end function MPAS_ESMF_TimeIntervalNegAbsValue
-
-!------------------------------------------------------------------------------
-!
-! This section includes overloaded operators defined only for TimeInterval
-! (not inherited from BaseTime)
-! Note: these functions do not have a return code, since F90 forbids more
-! than 2 arguments for arithmetic overloaded operators
-!
-!------------------------------------------------------------------------------
-
-!!!!!!!!!!!!!!!!!! added jm 20051012
-! new WRF-specific function, Divide two time intervals and return the whole integer, without remainder
- function MPAS_ESMF_TimeIntervalDIVQuot(timeinterval1, timeinterval2)
-
-! !RETURN VALUE:
- INTEGER :: MPAS_ESMF_TimeIntervalDIVQuot
-
-! !ARGUMENTS:
- type(MPAS_ESMF_TimeInterval), intent(in) :: timeinterval1
- type(MPAS_ESMF_TimeInterval), intent(in) :: timeinterval2
-
-! !LOCAL
- INTEGER :: retval, isgn, rc
- type(MPAS_ESMF_TimeInterval) :: zero, i1,i2
-
-! !DESCRIPTION:
-! Returns timeinterval1 divided by timeinterval2 as a fraction quotient.
-!
-! The arguments are:
-! \begin{description}
-! \item[timeinterval1]
-! The dividend
-! \item[timeinterval2]
-! The divisor
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG1.5.5
-!EOP
-
- CALL timeintchecknormalized( timeinterval1, 'MPAS_ESMF_TimeIntervalDIVQuot arg1' )
- CALL timeintchecknormalized( timeinterval2, 'MPAS_ESMF_TimeIntervalDIVQuot arg2' )
-
- call MPAS_ESMF_TimeIntervalSet( zero, rc=rc )
- i1 = timeinterval1
- i2 = timeinterval2
- isgn = 1
- if ( i1 .LT. zero ) then
- i1 = MPAS_ESMF_TimeIntervalProdI(i1, -1)
- isgn = -isgn
- endif
- if ( i2 .LT. zero ) then
- i2 = MPAS_ESMF_TimeIntervalProdI(i2, -1)
- isgn = -isgn
- endif
-! repeated subtraction
- retval = 0
- DO WHILE ( i1 .GE. i2 )
- i1 = i1 - i2
- retval = retval + 1
- ENDDO
- retval = retval * isgn
-
- MPAS_ESMF_TimeIntervalDIVQuot = retval
-
- end function MPAS_ESMF_TimeIntervalDIVQuot
-!!!!!!!!!!!!!!!!!!
-
-
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_TimeIntervalQuotI - Divide time interval by an integer, return time interval result
-
-! !INTERFACE:
- function MPAS_ESMF_TimeIntervalQuotI(timeinterval, divisor)
-
-! !RETURN VALUE:
- type(MPAS_ESMF_TimeInterval) :: MPAS_ESMF_TimeIntervalQuotI
-
-! !ARGUMENTS:
- type(MPAS_ESMF_TimeInterval), intent(in) :: timeinterval
- integer, intent(in) :: divisor
-
-! !DESCRIPTION:
-! Divides a {\tt MPAS_ESMF\_TimeInterval} by an integer divisor, returns
-! quotient as a {\tt MPAS_ESMF\_TimeInterval}
-!
-! The arguments are:
-! \begin{description}
-! \item[timeinterval]
-! The dividend
-! \item[divisor]
-! Integer divisor
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG1.5.6, TMG5.3, TMG7.2
-!EOP
-
-!PRINT *,'DEBUG MPAS_ESMF_TimeIntervalQuotI() A: S,Sn,Sd = ', &
-! timeinterval%basetime%S,timeinterval%basetime%Sn,timeinterval%basetime%Sd
-!PRINT *,'DEBUG MPAS_ESMF_TimeIntervalQuotI() A: divisor = ', divisor
-
- CALL timeintchecknormalized( timeinterval, 'MPAS_ESMF_TimeIntervalQuotI arg1' )
-
- IF ( divisor == 0 ) THEN
- CALL wrf_error_fatal( 'MPAS_ESMF_TimeIntervalQuotI: divide by zero' )
- ENDIF
- MPAS_ESMF_TimeIntervalQuotI = timeinterval
-!PRINT *,'DEBUG MPAS_ESMF_TimeIntervalQuotI() B: S,Sn,Sd = ', &
-! MPAS_ESMF_TimeIntervalQuotI%basetime%S,MPAS_ESMF_TimeIntervalQuotI%basetime%Sn,MPAS_ESMF_TimeIntervalQuotI%basetime%Sd
- MPAS_ESMF_TimeIntervalQuotI%basetime = &
- timeinterval%basetime / divisor
-!PRINT *,'DEBUG MPAS_ESMF_TimeIntervalQuotI() C: S,Sn,Sd = ', &
-! MPAS_ESMF_TimeIntervalQuotI%basetime%S,MPAS_ESMF_TimeIntervalQuotI%basetime%Sn,MPAS_ESMF_TimeIntervalQuotI%basetime%Sd
-
- CALL normalize_timeint( MPAS_ESMF_TimeIntervalQuotI )
-!PRINT *,'DEBUG MPAS_ESMF_TimeIntervalQuotI() D: S,Sn,Sd = ', &
-! MPAS_ESMF_TimeIntervalQuotI%basetime%S,MPAS_ESMF_TimeIntervalQuotI%basetime%Sn,MPAS_ESMF_TimeIntervalQuotI%basetime%Sd
-
- end function MPAS_ESMF_TimeIntervalQuotI
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_TimeIntervalProdI - Multiply a time interval by an integer
-
-! !INTERFACE:
- function MPAS_ESMF_TimeIntervalProdI(timeinterval, multiplier)
-
-! !RETURN VALUE:
- type(MPAS_ESMF_TimeInterval) :: MPAS_ESMF_TimeIntervalProdI
-
-! !ARGUMENTS:
- type(MPAS_ESMF_TimeInterval), intent(in) :: timeinterval
- integer, intent(in) :: multiplier
-! !LOCAL:
- integer :: rc
-
-! !DESCRIPTION:
-! Multiply a {\tt MPAS_ESMF\_TimeInterval} by an integer, return product as a
-! {\tt MPAS_ESMF\_TimeInterval}
-!
-! The arguments are:
-! \begin{description}
-! \item[timeinterval]
-! The multiplicand
-! \item[mutliplier]
-! Integer multiplier
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG1.5.7, TMG7.2
-!EOP
- CALL timeintchecknormalized( timeinterval, 'MPAS_ESMF_TimeIntervalProdI arg1' )
-
- CALL MPAS_ESMF_TimeIntervalSet( MPAS_ESMF_TimeIntervalProdI, rc=rc )
-!$$$move this into overloaded operator(*) in BaseTime
- MPAS_ESMF_TimeIntervalProdI%basetime%S = &
- timeinterval%basetime%S * INT( multiplier, MPAS_ESMF_KIND_I8 )
- MPAS_ESMF_TimeIntervalProdI%basetime%Sn = &
- timeinterval%basetime%Sn * INT( multiplier, MPAS_ESMF_KIND_I8 )
- ! Don't multiply Sd
- MPAS_ESMF_TimeIntervalProdI%basetime%Sd = timeinterval%basetime%Sd
- CALL normalize_timeint( MPAS_ESMF_TimeIntervalProdI )
-
- end function MPAS_ESMF_TimeIntervalProdI
-
-!------------------------------------------------------------------------------
-!
-! This section includes the inherited MPAS_ESMF_BaseTime class overloaded operators
-!
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_TimeIntervalSum - Add two time intervals together
-
-! !INTERFACE:
- function MPAS_ESMF_TimeIntervalSum(timeinterval1, timeinterval2)
-
-! !RETURN VALUE:
- type(MPAS_ESMF_TimeInterval) :: MPAS_ESMF_TimeIntervalSum
-
-! !ARGUMENTS:
- type(MPAS_ESMF_TimeInterval), intent(in) :: timeinterval1
- type(MPAS_ESMF_TimeInterval), intent(in) :: timeinterval2
-! !LOCAL:
- integer :: rc
-! !DESCRIPTION:
-! Add two {\tt MPAS_ESMF\_TimeIntervals}, return sum as a
-! {\tt MPAS_ESMF\_TimeInterval}. Maps overloaded (+) operator interface
-! function to {\tt MPAS_ESMF\_BaseTime} base class.
-!
-! The arguments are:
-! \begin{description}
-! \item[timeinterval1]
-! The augend
-! \item[timeinterval2]
-! The addend
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG1.5.4, TMG2.4.4, TMG2.4.5, TMG2.4.6, TMG5.1, TMG5.2,
-! TMG7.2
-!EOP
- CALL timeintchecknormalized( timeinterval1, 'MPAS_ESMF_TimeIntervalSum arg1' )
- CALL timeintchecknormalized( timeinterval2, 'MPAS_ESMF_TimeIntervalSum arg2' )
-
- MPAS_ESMF_TimeIntervalSum = timeinterval1
- MPAS_ESMF_TimeIntervalSum%basetime = MPAS_ESMF_TimeIntervalSum%basetime + &
- timeinterval2%basetime
-
- CALL normalize_timeint( MPAS_ESMF_TimeIntervalSum )
-
- end function MPAS_ESMF_TimeIntervalSum
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_TimeIntervalDiff - Subtract one time interval from another
-
-! !INTERFACE:
- function MPAS_ESMF_TimeIntervalDiff(timeinterval1, timeinterval2)
-
-! !RETURN VALUE:
- type(MPAS_ESMF_TimeInterval) :: MPAS_ESMF_TimeIntervalDiff
-
-! !ARGUMENTS:
- type(MPAS_ESMF_TimeInterval), intent(in) :: timeinterval1
- type(MPAS_ESMF_TimeInterval), intent(in) :: timeinterval2
-! !LOCAL:
- integer :: rc
-! !DESCRIPTION:
-! Subtract timeinterval2 from timeinterval1, return remainder as a
-! {\tt MPAS_ESMF\_TimeInterval}.
-! Map overloaded (-) operator interface function to {\tt MPAS_ESMF\_BaseTime}
-! base class.
-!
-! The arguments are:
-! \begin{description}
-! \item[timeinterval1]
-! The minuend
-! \item[timeinterval2]
-! The subtrahend
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG1.5.4, TMG2.4.4, TMG2.4.5, TMG2.4.6, TMG5.1, TMG5.2, TMG7.2
-!EOP
- CALL timeintchecknormalized( timeinterval1, 'MPAS_ESMF_TimeIntervalDiff arg1' )
- CALL timeintchecknormalized( timeinterval2, 'MPAS_ESMF_TimeIntervalDiff arg2' )
-
- MPAS_ESMF_TimeIntervalDiff = timeinterval1
- MPAS_ESMF_TimeIntervalDiff%basetime = MPAS_ESMF_TimeIntervalDiff%basetime - &
- timeinterval2%basetime
- CALL normalize_timeint( MPAS_ESMF_TimeIntervalDiff )
-
- end function MPAS_ESMF_TimeIntervalDiff
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_TimeIntervalEQ - Compare two time intervals for equality
-
-! !INTERFACE:
- function MPAS_ESMF_TimeIntervalEQ(timeinterval1, timeinterval2)
-!
-! !RETURN VALUE:
- logical :: MPAS_ESMF_TimeIntervalEQ
-
-! !ARGUMENTS:
- type(MPAS_ESMF_TimeInterval), intent(in) :: timeinterval1
- type(MPAS_ESMF_TimeInterval), intent(in) :: timeinterval2
-
-!DESCRIPTION:
-! Return true if both given time intervals are equal, false otherwise.
-! Maps overloaded (==) operator interface function to {\tt MPAS_ESMF\_BaseTime}
-! base class.
-!
-! The arguments are:
-! \begin{description}
-! \item[timeinterval1]
-! First time interval to compare
-! \item[timeinterval2]
-! Second time interval to compare
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG1.5.3, TMG2.4.3, TMG7.2
-!EOP
- CALL timeintchecknormalized( timeinterval1, 'MPAS_ESMF_TimeIntervalEQ arg1' )
- CALL timeintchecknormalized( timeinterval2, 'MPAS_ESMF_TimeIntervalEQ arg2' )
-
-!$$$here... move all this out of Meat.F90 ?
- ! call ESMC_BaseTime base class function
- call c_ESMC_BaseTimeIntEQ(timeinterval1, timeinterval2, MPAS_ESMF_TimeIntervalEQ)
-
- end function MPAS_ESMF_TimeIntervalEQ
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_TimeIntervalNE - Compare two time intervals for inequality
-
-! !INTERFACE:
- function MPAS_ESMF_TimeIntervalNE(timeinterval1, timeinterval2)
-!
-! !RETURN VALUE:
- logical :: MPAS_ESMF_TimeIntervalNE
-
-! !ARGUMENTS:
- type(MPAS_ESMF_TimeInterval), intent(in) :: timeinterval1
- type(MPAS_ESMF_TimeInterval), intent(in) :: timeinterval2
-
-! !DESCRIPTION:
-! Return true if both given time intervals are not equal, false otherwise.
-! Maps overloaded (/=) operator interface function to {\tt MPAS_ESMF\_BaseTime}
-! base class.
-!
-! The arguments are:
-! \begin{description}
-! \item[timeinterval1]
-! First time interval to compare
-! \item[timeinterval2]
-! Second time interval to compare
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG1.5.3, TMG2.4.3, TMG7.2
-!EOP
- CALL timeintchecknormalized( timeinterval1, 'MPAS_ESMF_TimeIntervalNE arg1' )
- CALL timeintchecknormalized( timeinterval2, 'MPAS_ESMF_TimeIntervalNE arg2' )
-
- ! call ESMC_BaseTime base class function
- call c_ESMC_BaseTimeIntNE(timeinterval1, timeinterval2, MPAS_ESMF_TimeIntervalNE)
-
- end function MPAS_ESMF_TimeIntervalNE
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_TimeIntervalLT - Time interval 1 less than time interval 2 ?
-
-! !INTERFACE:
- function MPAS_ESMF_TimeIntervalLT(timeinterval1, timeinterval2)
-!
-! !RETURN VALUE:
- logical :: MPAS_ESMF_TimeIntervalLT
-
-! !ARGUMENTS:
- type(MPAS_ESMF_TimeInterval), intent(in) :: timeinterval1
- type(MPAS_ESMF_TimeInterval), intent(in) :: timeinterval2
-
-! !DESCRIPTION:
-! Return true if first time interval is less than second time interval,
-! false otherwise. Maps overloaded (<) operator interface function to
-! {\tt MPAS_ESMF\_BaseTime} base class.
-!
-! The arguments are:
-! \begin{description}
-! \item[timeinterval1]
-! First time interval to compare
-! \item[timeinterval2]
-! Second time interval to compare
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG1.5.3, TMG2.4.3, TMG7.2
-!EOP
- CALL timeintchecknormalized( timeinterval1, 'MPAS_ESMF_TimeIntervalLT arg1' )
- CALL timeintchecknormalized( timeinterval2, 'MPAS_ESMF_TimeIntervalLT arg2' )
-
- ! call ESMC_BaseTime base class function
- call c_ESMC_BaseTimeIntLT(timeinterval1, timeinterval2, MPAS_ESMF_TimeIntervalLT)
-
- end function MPAS_ESMF_TimeIntervalLT
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_TimeIntervalGT - Time interval 1 greater than time interval 2?
-
-! !INTERFACE:
- function MPAS_ESMF_TimeIntervalGT(timeinterval1, timeinterval2)
-!
-! !RETURN VALUE:
- logical :: MPAS_ESMF_TimeIntervalGT
-
-! !ARGUMENTS:
- type(MPAS_ESMF_TimeInterval), intent(in) :: timeinterval1
- type(MPAS_ESMF_TimeInterval), intent(in) :: timeinterval2
-
-! !DESCRIPTION:
-! Return true if first time interval is greater than second time interval,
-! false otherwise. Maps overloaded (>) operator interface function to
-! {\tt MPAS_ESMF\_BaseTime} base class.
-!
-! The arguments are:
-! \begin{description}
-! \item[timeinterval1]
-! First time interval to compare
-! \item[timeinterval2]
-! Second time interval to compare
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG1.5.3, TMG2.4.3, TMG7.2
-!EOP
- CALL timeintchecknormalized( timeinterval1, 'MPAS_ESMF_TimeIntervalGT arg1' )
- CALL timeintchecknormalized( timeinterval2, 'MPAS_ESMF_TimeIntervalGT arg2' )
-
- ! call ESMC_BaseTime base class function
- call c_ESMC_BaseTimeIntGT(timeinterval1, timeinterval2, MPAS_ESMF_TimeIntervalGT)
-
- end function MPAS_ESMF_TimeIntervalGT
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_TimeIntervalLE - Time interval 1 less than or equal to time interval 2 ?
-
-! !INTERFACE:
- function MPAS_ESMF_TimeIntervalLE(timeinterval1, timeinterval2)
-
-! !RETURN VALUE:
- logical :: MPAS_ESMF_TimeIntervalLE
-
-! !ARGUMENTS:
- type(MPAS_ESMF_TimeInterval), intent(in) :: timeinterval1
- type(MPAS_ESMF_TimeInterval), intent(in) :: timeinterval2
-
-! !DESCRIPTION:
-! Return true if first time interval is less than or equal to second time
-! interval, false otherwise.
-! Maps overloaded (<=) operator interface function to {\tt MPAS_ESMF\_BaseTime}
-! base class.
-!
-! The arguments are:
-! \begin{description}
-! \item[timeinterval1]
-! First time interval to compare
-! \item[timeinterval2]
-! Second time interval to compare
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG1.5.3, TMG2.4.3, TMG7.2
-!EOP
- CALL timeintchecknormalized( timeinterval1, 'MPAS_ESMF_TimeIntervalLE arg1' )
- CALL timeintchecknormalized( timeinterval2, 'MPAS_ESMF_TimeIntervalLE arg2' )
-
- ! call ESMC_BaseTime base class function
- call c_ESMC_BaseTimeIntLE(timeinterval1, timeinterval2, MPAS_ESMF_TimeIntervalLE)
-
- end function MPAS_ESMF_TimeIntervalLE
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_TimeIntervalGE - Time interval 1 greater than or equal to time interval 2 ?
-
-! !INTERFACE:
- function MPAS_ESMF_TimeIntervalGE(timeinterval1, timeinterval2)
-!
-! !RETURN VALUE:
- logical :: MPAS_ESMF_TimeIntervalGE
-
-! !ARGUMENTS:
- type(MPAS_ESMF_TimeInterval), intent(in) :: timeinterval1
- type(MPAS_ESMF_TimeInterval), intent(in) :: timeinterval2
-
-! !DESCRIPTION:
-! Return true if first time interval is greater than or equal to second
-! time interval, false otherwise. Maps overloaded (>=) operator interface
-! function to {\tt MPAS_ESMF\_BaseTime} base class.
-!
-! The arguments are:
-! \begin{description}
-! \item[timeinterval1]
-! First time interval to compare
-! \item[timeinterval2]
-! Second time interval to compare
-! \end{description}
-!
-! !REQUIREMENTS:
-! TMG1.5.3, TMG2.4.3, TMG7.2
-!EOP
- CALL timeintchecknormalized( timeinterval1, 'MPAS_ESMF_TimeIntervalGE arg1' )
- CALL timeintchecknormalized( timeinterval2, 'MPAS_ESMF_TimeIntervalGE arg2' )
-
- ! call ESMC_BaseTime base class function
- call c_ESMC_BaseTimeIntGE(timeinterval1, timeinterval2, MPAS_ESMF_TimeIntervalGE)
-
- end function MPAS_ESMF_TimeIntervalGE
-
-
-!------------------------------------------------------------------------------
-!BOP
-! !IROUTINE: MPAS_ESMF_TimeIntervalIsPositive - Time interval greater than zero?
-
-! !INTERFACE:
- function MPAS_ESMF_TimeIntervalIsPositive(timeinterval)
-!
-! !RETURN VALUE:
- logical :: MPAS_ESMF_TimeIntervalIsPositive
-
-! !ARGUMENTS:
- type(MPAS_ESMF_TimeInterval), intent(in) :: timeinterval
-
-! !LOCALS:
- type(MPAS_ESMF_TimeInterval) :: zerotimeint
- integer :: rcint
-
-! !DESCRIPTION:
-! Return true if time interval is greater than zero,
-! false otherwise.
-!
-! The arguments are:
-! \begin{description}
-! \item[timeinterval]
-! Time interval to compare
-! \end{description}
-!EOP
- CALL timeintchecknormalized( timeinterval, &
- 'MPAS_ESMF_TimeIntervalIsPositive arg' )
-
- CALL MPAS_ESMF_TimeIntervalSet ( zerotimeint, rc=rcint )
- IF ( rcint /= MPAS_ESMF_SUCCESS ) THEN
- CALL wrf_error_fatal( &
- 'MPAS_ESMF_TimeIntervalIsPositive: MPAS_ESMF_TimeIntervalSet failed' )
- ENDIF
-! hack for bug in PGI 5.1-x
-! MPAS_ESMF_TimeIntervalIsPositive = timeinterval > zerotimeint
- MPAS_ESMF_TimeIntervalIsPositive = MPAS_ESMF_TimeIntervalGT( timeinterval, &
- zerotimeint )
- end function MPAS_ESMF_TimeIntervalIsPositive
-
- end module MPAS_ESMF_TimeIntervalMod
-
-
Deleted: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_TimeMgr.inc
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_TimeMgr.inc        2012-11-29 20:50:09 UTC (rev 2328)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/MPAS_ESMF_TimeMgr.inc        2012-11-29 22:23:06 UTC (rev 2329)
@@ -1,61 +0,0 @@
-#if 0
-
-Earth System Modeling Framework
-Copyright 2002-2003, University Corporation for Atmospheric Research,
-Massachusetts Institute of Technology, Geophysical Fluid Dynamics
-Laboratory, University of Michigan, National Centers for Environmental
-Prediction, Los Alamos National Laboratory, Argonne National Laboratory,
-NASA Goddard Space Flight Center.
-Licensed under the University of Illinois-NCSA license.
-
-Do not have C++ or F90 style comments in here because this file is processed
-by both C++ and F90 compilers.
-#endif
-
-#ifndef MPAS_ESMF_TimeMgr_INC
-#define MPAS_ESMF_TimeMgr_INC
-
-#if 0
-!BOP
--------------------------------------------------------------------------
-
- !DESCRIPTION:
-
- MPAS_ESMF TimeMgr include file for F90
- The code in this file implements constants and macros for the TimeMgr...
-
--------------------------------------------------------------------------
-!EOP
-#endif
-
-#include <MPAS_ESMF_Macros.inc>
-
-#define SECONDS_PER_DAY 86400_MPAS_ESMF_KIND_I8
-#define SECONDS_PER_HOUR 3600_MPAS_ESMF_KIND_I8
-#define SECONDS_PER_MINUTE 60_MPAS_ESMF_KIND_I8
-#define HOURS_PER_DAY 24_MPAS_ESMF_KIND_I8
-
-! Note that MAX_ALARMS must match MAX_WRF_ALARMS defined in
-! ../../frame/module_domain.F !!! Eliminate this dependence with
-! grow-as-you-go AlarmList in MPAS_ESMF_Clock...
-#define MAX_HISTORY 10
-#define MAX_ALARMS (2*(MAX_HISTORY)+10)
-
-! TBH: TODO: Hook this into the WRF build so WRF can use either "no-leap" or
-! TBH: Gregorian calendar. Now WRF is hard-wired to use Gregorian.
-!#undef NO_LEAP_CALENDAR
-!#ifdef COUP_CSM
-!#define NO_LEAP_CALENDAR
-!#endif
-
-! TBH: When NO_DT_COMPONENT_INIT is set, code that uses F95 compile-time
-! TBH: initialization of components of derived types is not included.
-! TBH: Some older compilers like PGI 5.x do not support this F95
-! TBH: feature.
-!#ifdef NO_LEAP_CALENDAR
-!#undef NO_DT_COMPONENT_INIT
-!#else
-!#define NO_DT_COMPONENT_INIT
-!#endif
-
-#endif
Deleted: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/Makefile
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/Makefile        2012-11-29 20:50:09 UTC (rev 2328)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/Makefile        2012-11-29 22:23:06 UTC (rev 2329)
@@ -1,104 +0,0 @@
-# To build this by itself, use the make target MPAS_ESMF_time_f90_only
-# from the top-level WRF Makefile.
-# > cd ../..
-# configure
-# make MPAS_ESMF_time_f90_only
-
-.SUFFIXES: .F90 .o .f
-
-# get rid of single quotes after comments
-# WARNING: This will break if a quoted string is followed by a comment that has
-# a single quote.
-SED_FTN = sed -e "/\!.*'/s/'//g"
-
-RM = /bin/rm -f
-AR = ar
-RANLIB = ranlib
-FGREP = fgrep -iq
-
-OBJS = MPAS_ESMF_Alarm.o MPAS_ESMF_BaseTime.o MPAS_ESMF_Clock.o MPAS_ESMF_Time.o \
- Meat.o MPAS_ESMF_Base.o MPAS_ESMF_Calendar.o MPAS_ESMF_Fraction.o \
- MPAS_ESMF_TimeInterval.o MPAS_ESMF_Stubs.o MPAS_ESMF_Mod.o \
- module_symbols_util.o \
-        module_utility.o MPAS_ESMF_AlarmClock.o
-
-default: libmpas_esmf_time.a
-
-tests: Test1_MPAS_ESMF.exe Test1_WRFU.exe
-
-libmpas_esmf_time.a : $(OBJS)
-        $(RM) libmpas_esmf_time.a
-        if [ "$(AR)" != "lib.exe" ] ; then \
- $(AR) ru libmpas_esmf_time.a $(OBJS) ; \
- else \
- $(AR) /out:libmpas_esmf_time.a $(OBJS) ; \
- fi
-        $(RANLIB) libmpas_esmf_time.a
-
-Test1_MPAS_ESMF.f : Test1.F90
-        $(RM) Test1_MPAS_ESMF.b Test1_MPAS_ESMF.f
-        cp Test1.F90 Test1_MPAS_ESMF.b
-        $(CPP) -C -P -I. Test1_MPAS_ESMF.b > Test1_MPAS_ESMF.f
-
-Test1_MPAS_ESMF.exe : libmpas_esmf_time.a Test1_MPAS_ESMF.o
-        $(FC) -o Test1_MPAS_ESMF.exe Test1_MPAS_ESMF.o libmpas_esmf_time.a
-
-Test1_WRFU.f : Test1.F90
-        $(RM) Test1_WRFU.b Test1_WRFU.f
-        sed -e "s/MPAS_ESMF_Mod/module_utility/g" -e "s/MPAS_ESMF_/WRFU_/g" Test1.F90 > Test1_WRFU.b
-        $(CPP) -C -P -I. Test1_WRFU.b > Test1_WRFU.f
-
-Test1_WRFU.exe : libmpas_esmf_time.a Test1_WRFU.o
-        $(FC) -o Test1_WRFU.exe Test1_WRFU.o libmpas_esmf_time.a
-
-.F90.o :
-        $(RM) $@
-        $(SED_FTN) $*.F90 > $*.b
-        $(CPP) -C -P -I. $*.b > $*.f
-        $(RM) $*.b
-        $(FC) -o $@ -c $*.f
-
-.F90.f :
-        $(RM) $@
-        $(SED_FTN) $*.F90 > $*.b
-        $(CPP) -C -P -I. $*.b > $*.f
-        $(RM) $*.b
-
-.f.o :
-        $(RM) $@
-        $(RM) $*.b
-        $(FC) -c $*.f
-
-clean : testclean
-
-testclean:
-        $(RM) *.b *.f *.o *.obj *.i libmpas_esmf_time.a *.mod Test1*.exe
-
-superclean: testclean
-        $(RM) Test1*.out make_tests.out
-
-# DEPENDENCIES : only dependencies after this line
-
-#$$$ update dependencies!
-
-MPAS_ESMF_Alarm.o : MPAS_ESMF_BaseTime.o MPAS_ESMF_Time.o MPAS_ESMF_TimeInterval.o
-MPAS_ESMF_BaseTime.o : MPAS_ESMF_Base.o
-MPAS_ESMF_Clock.o : MPAS_ESMF_BaseTime.o MPAS_ESMF_Time.o MPAS_ESMF_TimeInterval.o
-MPAS_ESMF_AlarmClock.o : MPAS_ESMF_Alarm.o MPAS_ESMF_Clock.o
-MPAS_ESMF_Time.o : MPAS_ESMF_BaseTime.o MPAS_ESMF_TimeInterval.o MPAS_ESMF_Calendar.o \
- MPAS_ESMF_Stubs.o
-MPAS_ESMF_Base.o :
-MPAS_ESMF_Calendar.o : MPAS_ESMF_BaseTime.o
-MPAS_ESMF_Fraction.o : MPAS_ESMF_BaseTime.o
-MPAS_ESMF_TimeInterval.o : MPAS_ESMF_BaseTime.o MPAS_ESMF_Calendar.o MPAS_ESMF_Fraction.o
-MPAS_ESMF_Mod.o : MPAS_ESMF_Alarm.o MPAS_ESMF_BaseTime.o MPAS_ESMF_Clock.o MPAS_ESMF_Time.o \
- MPAS_ESMF_Base.o MPAS_ESMF_Calendar.o MPAS_ESMF_Fraction.o \
- MPAS_ESMF_TimeInterval.o Meat.o MPAS_ESMF_Stubs.o MPAS_ESMF_AlarmClock.o
-Meat.o : MPAS_ESMF_Alarm.o MPAS_ESMF_BaseTime.o MPAS_ESMF_Clock.o MPAS_ESMF_Time.o \
- MPAS_ESMF_Base.o MPAS_ESMF_Calendar.o MPAS_ESMF_Fraction.o \
- MPAS_ESMF_TimeInterval.o
-MPAS_ESMF_Stubs.o : MPAS_ESMF_Base.o MPAS_ESMF_Calendar.o
-module_utility.o : MPAS_ESMF_Mod.o module_symbols_util.o
-module_symbols_util.o : MPAS_ESMF_Mod.o
-Test1.o : module_utility.o
-
Added: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/Makefile
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/Makefile         (rev 0)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/Makefile        2012-11-29 22:23:06 UTC (rev 2329)
@@ -0,0 +1,104 @@
+# To build this by itself, use the make target esmf_time_f90_only
+# from the top-level WRF Makefile.
+# > cd ../..
+# configure
+# make esmf_time_f90_only
+
+.SUFFIXES: .F90 .o .f
+
+# get rid of single quotes after comments
+# WARNING: This will break if a quoted string is followed by a comment that has
+# a single quote.
+SED_FTN = sed -e "/\!.*'/s/'//g"
+
+RM = /bin/rm -f
+AR = ar
+RANLIB = ranlib
+FGREP = fgrep -iq
+
+OBJS = ESMF_Alarm.o ESMF_BaseTime.o ESMF_Clock.o ESMF_Time.o \
+ Meat.o ESMF_Base.o ESMF_Calendar.o ESMF_Fraction.o \
+ ESMF_TimeInterval.o ESMF_Stubs.o ESMF_Mod.o \
+ module_symbols_util.o \
+        module_utility.o ESMF_AlarmClock.o
+
+default: libesmf_time.a
+
+tests: Test1_ESMF.exe Test1_WRFU.exe
+
+libesmf_time.a : $(OBJS)
+        $(RM) libesmf_time.a
+        if [ "$(AR)" != "lib.exe" ] ; then \
+ $(AR) ru libesmf_time.a $(OBJS) ; \
+ else \
+ $(AR) /out:libesmf_time.a $(OBJS) ; \
+ fi
+        $(RANLIB) libesmf_time.a
+
+Test1_ESMF.f : Test1.F90
+        $(RM) Test1_ESMF.b Test1_ESMF.f
+        cp Test1.F90 Test1_ESMF.b
+        $(CPP) -C -P -I. Test1_ESMF.b > Test1_ESMF.f
+
+Test1_ESMF.exe : libesmf_time.a Test1_ESMF.o
+        $(FC) -o Test1_ESMF.exe Test1_ESMF.o libesmf_time.a
+
+Test1_WRFU.f : Test1.F90
+        $(RM) Test1_WRFU.b Test1_WRFU.f
+        sed -e "s/ESMF_Mod/module_utility/g" -e "s/ESMF_/WRFU_/g" Test1.F90 > Test1_WRFU.b
+        $(CPP) -C -P -I. Test1_WRFU.b > Test1_WRFU.f
+
+Test1_WRFU.exe : libesmf_time.a Test1_WRFU.o
+        $(FC) -o Test1_WRFU.exe Test1_WRFU.o libesmf_time.a
+
+.F90.o :
+        $(RM) $@
+        $(SED_FTN) $*.F90 > $*.b
+        $(CPP) -C -P -I. $*.b > $*.f
+        $(RM) $*.b
+        $(FC) -o $@ -c $*.f
+
+.F90.f :
+        $(RM) $@
+        $(SED_FTN) $*.F90 > $*.b
+        $(CPP) -C -P -I. $*.b > $*.f
+        $(RM) $*.b
+
+.f.o :
+        $(RM) $@
+        $(RM) $*.b
+        $(FC) -c $*.f
+
+clean : testclean
+
+testclean:
+        $(RM) *.b *.f *.o *.obj *.i libesmf_time.a *.mod Test1*.exe
+
+superclean: testclean
+        $(RM) Test1*.out make_tests.out
+
+# DEPENDENCIES : only dependencies after this line
+
+#$$$ update dependencies!
+
+ESMF_Alarm.o : ESMF_BaseTime.o ESMF_Time.o ESMF_TimeInterval.o
+ESMF_BaseTime.o : ESMF_Base.o
+ESMF_Clock.o : ESMF_BaseTime.o ESMF_Time.o ESMF_TimeInterval.o
+ESMF_AlarmClock.o : ESMF_Alarm.o ESMF_Clock.o
+ESMF_Time.o : ESMF_BaseTime.o ESMF_TimeInterval.o ESMF_Calendar.o \
+ ESMF_Stubs.o
+ESMF_Base.o :
+ESMF_Calendar.o : ESMF_BaseTime.o
+ESMF_Fraction.o : ESMF_BaseTime.o
+ESMF_TimeInterval.o : ESMF_BaseTime.o ESMF_Calendar.o ESMF_Fraction.o
+ESMF_Mod.o : ESMF_Alarm.o ESMF_BaseTime.o ESMF_Clock.o ESMF_Time.o \
+ ESMF_Base.o ESMF_Calendar.o ESMF_Fraction.o \
+ ESMF_TimeInterval.o Meat.o ESMF_Stubs.o ESMF_AlarmClock.o
+Meat.o : ESMF_Alarm.o ESMF_BaseTime.o ESMF_Clock.o ESMF_Time.o \
+ ESMF_Base.o ESMF_Calendar.o ESMF_Fraction.o \
+ ESMF_TimeInterval.o
+ESMF_Stubs.o : ESMF_Base.o ESMF_Calendar.o
+module_utility.o : ESMF_Mod.o module_symbols_util.o
+module_symbols_util.o : ESMF_Mod.o
+Test1.o : module_utility.o
+
Deleted: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/Meat.F90
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/Meat.F90        2012-11-29 20:50:09 UTC (rev 2328)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/Meat.F90        2012-11-29 22:23:06 UTC (rev 2329)
@@ -1,928 +0,0 @@
-#include <MPAS_ESMF_TimeMgr.inc>
-
-! Factor so abs(Sn) < Sd and ensure that signs of S and Sn match.
-! Also, enforce consistency.
-! YR and MM fields are ignored.
-
-SUBROUTINE normalize_basetime( basetime )
- USE MPAS_ESMF_basemod
- USE MPAS_ESMF_basetimemod
- IMPLICIT NONE
- TYPE(MPAS_ESMF_BaseTime), INTENT(INOUT) :: basetime
-!PRINT *,'DEBUG: BEGIN normalize_basetime()'
- ! Consistency check...
- IF ( basetime%Sd < 0 ) THEN
- CALL wrf_error_fatal( &
- 'normalize_basetime: denominator of seconds cannot be negative' )
- ENDIF
- IF ( ( basetime%Sd == 0 ) .AND. ( basetime%Sn .NE. 0 ) ) THEN
- CALL wrf_error_fatal( &
- 'normalize_basetime: denominator of seconds cannot be zero when numerator is non-zero' )
- ENDIF
- ! factor so abs(Sn) < Sd
- IF ( basetime%Sd > 0 ) THEN
- IF ( ABS( basetime%Sn ) .GE. basetime%Sd ) THEN
-!PRINT *,'DEBUG: normalize_basetime() A1: S,Sn,Sd = ',basetime%S,basetime%Sn,basetime%Sd
- basetime%S = basetime%S + ( basetime%Sn / basetime%Sd )
- basetime%Sn = mod( basetime%Sn, basetime%Sd )
-!PRINT *,'DEBUG: normalize_basetime() A2: S,Sn,Sd = ',basetime%S,basetime%Sn,basetime%Sd
- ENDIF
- ! change sign of Sn if it does not match S
- IF ( ( basetime%S > 0 ) .AND. ( basetime%Sn < 0 ) ) THEN
-!PRINT *,'DEBUG: normalize_basetime() B1: S,Sn,Sd = ',basetime%S,basetime%Sn,basetime%Sd
- basetime%S = basetime%S - 1_MPAS_ESMF_KIND_I8
- basetime%Sn = basetime%Sn + basetime%Sd
-!PRINT *,'DEBUG: normalize_basetime() B2: S,Sn,Sd = ',basetime%S,basetime%Sn,basetime%Sd
- ENDIF
- IF ( ( basetime%S < 0 ) .AND. ( basetime%Sn > 0 ) ) THEN
-!PRINT *,'DEBUG: normalize_basetime() C1: S,Sn,Sd = ',basetime%S,basetime%Sn,basetime%Sd
- basetime%S = basetime%S + 1_MPAS_ESMF_KIND_I8
- basetime%Sn = basetime%Sn - basetime%Sd
-!PRINT *,'DEBUG: normalize_basetime() C2: S,Sn,Sd = ',basetime%S,basetime%Sn,basetime%Sd
- ENDIF
- ENDIF
-!PRINT *,'DEBUG: END normalize_basetime()'
-END SUBROUTINE normalize_basetime
-
-
-
-! A normalized time has time%basetime >= 0, time%basetime less than the current
-! year expressed as a timeInterval, and time%YR can take any value
-SUBROUTINE normalize_time( time )
- USE MPAS_ESMF_basemod
- USE MPAS_ESMF_basetimemod
- USE MPAS_ESMF_timemod
- IMPLICIT NONE
- TYPE(MPAS_ESMF_Time), INTENT(INOUT) :: time
- INTEGER(MPAS_ESMF_KIND_I8) :: nsecondsinyear
- ! locals
- TYPE(MPAS_ESMF_BaseTime) :: cmptime, zerotime
- INTEGER :: rc
- LOGICAL :: done
-
- ! first, normalize basetime
- ! this will force abs(Sn) < Sd and ensure that signs of S and Sn match
- CALL normalize_basetime( time%basetime )
-
-!$$$ add tests for these edge cases
-
- ! next, underflow negative seconds into YEARS
- ! time%basetime must end up non-negative
-!$$$ push this down into MPAS_ESMF_BaseTime constructor
- zerotime%S = 0
- zerotime%Sn = 0
- zerotime%Sd = 0
- DO WHILE ( time%basetime < zerotime )
- time%YR = time%YR - 1
-!$$$ push this down into MPAS_ESMF_BaseTime constructor
- cmptime%S = nsecondsinyear( time%YR )
- cmptime%Sn = 0
- cmptime%Sd = 0
- time%basetime = time%basetime + cmptime
- ENDDO
-
- ! next, overflow seconds into YEARS
- done = .FALSE.
- DO WHILE ( .NOT. done )
-!$$$ push this down into MPAS_ESMF_BaseTime constructor
- cmptime%S = nsecondsinyear( time%YR )
- cmptime%Sn = 0
- cmptime%Sd = 0
- IF ( time%basetime >= cmptime ) THEN
- time%basetime = time%basetime - cmptime
- time%YR = time%YR + 1
- ELSE
- done = .TRUE.
- ENDIF
- ENDDO
-END SUBROUTINE normalize_time
-
-
-
-SUBROUTINE normalize_timeint( timeInt )
- USE MPAS_ESMF_basetimemod
- USE MPAS_ESMF_timeintervalmod
- IMPLICIT NONE
- TYPE(MPAS_ESMF_TimeInterval), INTENT(INOUT) :: timeInt
-
- ! normalize basetime
- ! this will force abs(Sn) < Sd and ensure that signs of S and Sn match
- ! YR and MM are ignored
- CALL normalize_basetime( timeInt%basetime )
-END SUBROUTINE normalize_timeint
-
-
-
-
-FUNCTION signnormtimeint ( timeInt )
- ! Compute the sign of a time interval.
- ! YR and MM fields are *IGNORED*.
- ! returns 1, 0, or -1 or exits if timeInt fields have inconsistent signs.
- USE MPAS_ESMF_basemod
- USE MPAS_ESMF_basetimemod
- USE MPAS_ESMF_timeintervalmod
- IMPLICIT NONE
- TYPE(MPAS_ESMF_TimeInterval), INTENT(IN) :: timeInt
- INTEGER :: signnormtimeint
- LOGICAL :: positive, negative
-
- positive = .FALSE.
- negative = .FALSE.
- signnormtimeint = 0
- ! Note that Sd is required to be non-negative. This is enforced in
- ! normalize_timeint().
- ! Note that Sn is required to be zero when Sd is zero. This is enforced
- ! in normalize_timeint().
- IF ( ( timeInt%basetime%S > 0 ) .OR. &
- ( timeInt%basetime%Sn > 0 ) ) THEN
- positive = .TRUE.
- ENDIF
- IF ( ( timeInt%basetime%S < 0 ) .OR. &
- ( timeInt%basetime%Sn < 0 ) ) THEN
- negative = .TRUE.
- ENDIF
- IF ( positive .AND. negative ) THEN
- CALL wrf_error_fatal( &
- 'signnormtimeint: signs of fields cannot be mixed' )
- ELSE IF ( positive ) THEN
- signnormtimeint = 1
- ELSE IF ( negative ) THEN
- signnormtimeint = -1
- ENDIF
-END FUNCTION signnormtimeint
-
-
-! Exits with error message if timeInt is not normalized.
-SUBROUTINE timeintchecknormalized( timeInt, msgstr )
- USE MPAS_ESMF_timeintervalmod
- IMPLICIT NONE
- TYPE(MPAS_ESMF_TimeInterval), INTENT(IN) :: timeInt
- CHARACTER(LEN=*), INTENT(IN) :: msgstr
- ! locals
- CHARACTER(LEN=256) :: outstr
- IF ( ( timeInt%YR /= 0 ) ) THEN
- outstr = 'un-normalized TimeInterval not allowed: '//TRIM(msgstr)
- CALL wrf_error_fatal( outstr )
- ENDIF
-END SUBROUTINE timeintchecknormalized
-
-
-! added from share/module_date_time in WRF.
-FUNCTION nfeb ( year ) RESULT (num_days)
- USE MPAS_ESMF_CalendarMod
-
- ! Compute the number of days in February for the given year
- IMPLICIT NONE
- INTEGER :: year
- INTEGER :: num_days
-
- type(MPAS_ESMF_CalendarType) :: calendarType
-
- calendarType = MPAS_ESMF_GetCalendarType()
-
- IF (calendarType % caltype == MPAS_ESMF_CAL_NOLEAP % caltype) then
- num_days = 28
- ELSE IF (calendarType % caltype == MPAS_ESMF_CAL_360DAY % caltype) then
- num_days = 30
- ELSE
- num_days = 28 ! By default, February has 28 days ...
- IF (MOD(year,4).eq.0) THEN
- num_days = 29 ! But every four years, it has 29 days ...
- IF (MOD(year,100).eq.0) THEN
- num_days = 28 ! Except every 100 years, when it has 28 days ...
- IF (MOD(year,400).eq.0) THEN
- num_days = 29 ! Except every 400 years, when it has 29 days.
- END IF
- END IF
- END IF
- END IF
-
-END FUNCTION nfeb
-
-
-
-FUNCTION ndaysinyear ( year ) RESULT (num_diy)
- ! Compute the number of days in the given year
- IMPLICIT NONE
- INTEGER, INTENT(IN) :: year
- INTEGER :: num_diy
- INTEGER :: nfeb
-#if defined MARS
- num_diy = 669
-#elif defined TITAN
- num_diy = 686
-#else
- IF ( nfeb( year ) .EQ. 29 ) THEN
- num_diy = 366
- ELSE IF ( nfeb( year ) .EQ. 30 ) THEN
- num_diy = 360
- ELSE
- num_diy = 365
- ENDIF
-#endif
-END FUNCTION ndaysinyear
-
-
-
-FUNCTION nsecondsinyear ( year ) RESULT (numseconds)
- ! Compute the number of seconds in the given year
- USE MPAS_ESMF_basemod
- IMPLICIT NONE
- INTEGER, INTENT(IN) :: year
- INTEGER(MPAS_ESMF_KIND_I8) :: numseconds
- INTEGER :: ndaysinyear
- numseconds = SECONDS_PER_DAY * INT( ndaysinyear(year) , MPAS_ESMF_KIND_I8 )
-END FUNCTION nsecondsinyear
-
-
-
-SUBROUTINE initdaym
- USE MPAS_ESMF_basemod
- USE MPAS_ESMF_basetimemod
- USE MPAS_ESMF_CalendarMod, only : months_per_year, mday, daym, mdaycum, monthbdys, &
- mdayleap, mdayleapcum, monthbdysleap, daymleap
- IMPLICIT NONE
- INTEGER i,j,m
- m = 1
- mdaycum(0) = 0
-!$$$ push this down into MPAS_ESMF_BaseTime constructor
- monthbdys(0)%S = 0
- monthbdys(0)%Sn = 0
- monthbdys(0)%Sd = 0
- DO i = 1,MONTHS_PER_YEAR
- DO j = 1,mday(i)
- daym(m) = i
- m = m + 1
- ENDDO
- mdaycum(i) = mdaycum(i-1) + mday(i)
-!$$$ push this down into MPAS_ESMF_BaseTime constructor
- monthbdys(i)%S = SECONDS_PER_DAY * INT( mdaycum(i), MPAS_ESMF_KIND_I8 )
- monthbdys(i)%Sn = 0
- monthbdys(i)%Sd = 0
- ENDDO
- m = 1
- mdayleapcum(0) = 0
-!$$$ push this down into MPAS_ESMF_BaseTime constructor
- monthbdysleap(0)%S = 0
- monthbdysleap(0)%Sn = 0
- monthbdysleap(0)%Sd = 0
- DO i = 1,MONTHS_PER_YEAR
- DO j = 1,mdayleap(i)
- daymleap(m) = i
- m = m + 1
- ENDDO
- mdayleapcum(i) = mdayleapcum(i-1) + mdayleap(i)
-!$$$ push this down into MPAS_ESMF_BaseTime constructor
- monthbdysleap(i)%S = SECONDS_PER_DAY * INT( mdayleapcum(i), MPAS_ESMF_KIND_I8 )
- monthbdysleap(i)%Sn = 0
- monthbdysleap(i)%Sd = 0
- ENDDO
-END SUBROUTINE initdaym
-
-
-!$$$ useful, but not used at the moment...
-SUBROUTINE compute_dayinyear(YR,MM,DD,dayinyear)
- use MPAS_ESMF_CalendarMod, only : mday
-IMPLICIT NONE
- INTEGER, INTENT(IN) :: YR,MM,DD ! DD is day of month
- INTEGER, INTENT(OUT) :: dayinyear
- INTEGER i
- integer nfeb
-
-#ifdef PLANET
- dayinyear = DD
-#else
- dayinyear = 0
- DO i = 1,MM-1
- if (i.eq.2) then
- dayinyear = dayinyear + nfeb(YR)
- else
- dayinyear = dayinyear + mday(i)
- endif
- ENDDO
- dayinyear = dayinyear + DD
-#endif
-END SUBROUTINE compute_dayinyear
-
-
-
-SUBROUTINE timegetmonth( time, MM )
- USE MPAS_ESMF_basemod
- USE MPAS_ESMF_basetimemod
- USE MPAS_ESMF_timemod
- USE MPAS_ESMF_CalendarMod, only : MONTHS_PER_YEAR, monthbdys, monthbdysleap
- IMPLICIT NONE
- TYPE(MPAS_ESMF_Time), INTENT(IN) :: time
- INTEGER, INTENT(OUT) :: MM
- ! locals
- INTEGER :: nfeb
- INTEGER :: i
-#if defined PLANET
- MM = 0
-#else
- MM = -1
- IF ( nfeb(time%YR) == 29 ) THEN
- DO i = 1,MONTHS_PER_YEAR
- IF ( ( time%basetime >= monthbdysleap(i-1) ) .AND. ( time%basetime < monthbdysleap(i) ) ) THEN
- MM = i
- EXIT
- ENDIF
- ENDDO
- ELSE
- DO i = 1,MONTHS_PER_YEAR
- IF ( ( time%basetime >= monthbdys(i-1) ) .AND. ( time%basetime < monthbdys(i) ) ) THEN
- MM = i
- EXIT
- ENDIF
- ENDDO
- ENDIF
-#endif
- IF ( MM == -1 ) THEN
- CALL wrf_error_fatal( 'timegetmonth: could not extract month of year from time' )
- ENDIF
-END SUBROUTINE timegetmonth
-
-
-!$$$ may need to change dependencies in Makefile...
-
-SUBROUTINE timegetdayofmonth( time, DD )
- USE MPAS_ESMF_basemod
- USE MPAS_ESMF_basetimemod
- USE MPAS_ESMF_timemod
- USE MPAS_ESMF_calendarmod, only : monthbdys, monthbdysleap
- IMPLICIT NONE
- TYPE(MPAS_ESMF_Time), INTENT(IN) :: time
- INTEGER, INTENT(OUT) :: DD
- ! locals
- INTEGER :: nfeb
- INTEGER :: MM
- TYPE(MPAS_ESMF_BaseTime) :: tmpbasetime
-#if defined PLANET
- tmpbasetime = time%basetime
-#else
- CALL timegetmonth( time, MM )
- IF ( nfeb(time%YR) == 29 ) THEN
- tmpbasetime = time%basetime - monthbdysleap(MM-1)
- ELSE
- tmpbasetime = time%basetime - monthbdys(MM-1)
- ENDIF
-#endif
- DD = ( tmpbasetime%S / SECONDS_PER_DAY ) + 1
-END SUBROUTINE timegetdayofmonth
-
-
-! Increment Time by number of seconds between start of year and start
-! of month MM.
-! 1 <= MM <= 12
-! Time is NOT normalized.
-SUBROUTINE timeaddmonths( time, MM, ierr )
- USE MPAS_ESMF_basemod
- USE MPAS_ESMF_basetimemod
- USE MPAS_ESMF_timemod
- USE MPAS_ESMF_calendarmod, only : MONTHS_PER_YEAR, monthbdys, monthbdysleap
- IMPLICIT NONE
- TYPE(MPAS_ESMF_Time), INTENT(INOUT) :: time
- INTEGER, INTENT(IN) :: MM
- INTEGER, INTENT(OUT) :: ierr
- ! locals
- INTEGER :: nfeb
- ierr = MPAS_ESMF_SUCCESS
-! PRINT *,'DEBUG: BEGIN timeaddmonths()'
-#if defined PLANET
-! time%basetime = time%basetime
-#else
- IF ( ( MM < 1 ) .OR. ( MM > MONTHS_PER_YEAR ) ) THEN
- ierr = MPAS_ESMF_FAILURE
- ELSE
- IF ( nfeb(time%YR) == 29 ) THEN
- time%basetime = time%basetime + monthbdysleap(MM-1)
- ELSE
- time%basetime = time%basetime + monthbdys(MM-1)
- ENDIF
- ENDIF
-#endif
-END SUBROUTINE timeaddmonths
-
-
-! Increment Time by number of seconds in the current month.
-! Time is NOT normalized.
-SUBROUTINE timeincmonth( time )
- USE MPAS_ESMF_basemod
- USE MPAS_ESMF_basetimemod
- USE MPAS_ESMF_timemod
- USE MPAS_ESMF_calendarmod, only : mday, mdayleap
- IMPLICIT NONE
- TYPE(MPAS_ESMF_Time), INTENT(INOUT) :: time
- ! locals
- INTEGER :: nfeb
- INTEGER :: MM
-#if defined PLANET
-! time%basetime%S = time%basetime%S
-#else
- CALL timegetmonth( time, MM )
- IF ( nfeb(time%YR) == 29 ) THEN
- time%basetime%S = time%basetime%S + &
- ( INT( mdayleap(MM), MPAS_ESMF_KIND_I8 ) * SECONDS_PER_DAY )
- ELSE
- time%basetime%S = time%basetime%S + &
- ( INT( mday(MM), MPAS_ESMF_KIND_I8 ) * SECONDS_PER_DAY )
- ENDIF
-#endif
-END SUBROUTINE timeincmonth
-
-
-
-! Decrement Time by number of seconds in the previous month.
-! Time is NOT normalized.
-SUBROUTINE timedecmonth( time )
- USE MPAS_ESMF_basemod
- USE MPAS_ESMF_basetimemod
- USE MPAS_ESMF_timemod
- USE MPAS_ESMF_calendarmod, only : mday, months_per_year, mdayleap
- IMPLICIT NONE
- TYPE(MPAS_ESMF_Time), INTENT(INOUT) :: time
- ! locals
- INTEGER :: nfeb
- INTEGER :: MM
-#if defined PLANET
-! time%basetime%S = time%basetime%S
-#else
- CALL timegetmonth( time, MM ) ! current month, 1-12
- ! find previous month
- MM = MM - 1
- IF ( MM == 0 ) THEN
- ! wrap around Jan -> Dec
- MM = MONTHS_PER_YEAR
- ENDIF
- IF ( nfeb(time%YR) == 29 ) THEN
- time%basetime%S = time%basetime%S - &
- ( INT( mdayleap(MM), MPAS_ESMF_KIND_I8 ) * SECONDS_PER_DAY )
- ELSE
- time%basetime%S = time%basetime%S - &
- ( INT( mday(MM), MPAS_ESMF_KIND_I8 ) * SECONDS_PER_DAY )
- ENDIF
-#endif
-END SUBROUTINE timedecmonth
-
-
-
-! spaceship operator for Times
-SUBROUTINE timecmp(time1, time2, retval )
- USE MPAS_ESMF_basemod
- USE MPAS_ESMF_basetimemod
- USE MPAS_ESMF_timemod
- IMPLICIT NONE
- INTEGER, INTENT(OUT) :: retval
-!
-! !ARGUMENTS:
- TYPE(MPAS_ESMF_Time), INTENT(IN) :: time1
- TYPE(MPAS_ESMF_Time), INTENT(IN) :: time2
- IF ( time1%YR .GT. time2%YR ) THEN ; retval = 1 ; RETURN ; ENDIF
- IF ( time1%YR .LT. time2%YR ) THEN ; retval = -1 ; RETURN ; ENDIF
- CALL seccmp( time1%basetime%S, time1%basetime%Sn, time1%basetime%Sd, &
- time2%basetime%S, time2%basetime%Sn, time2%basetime%Sd, &
- retval )
-END SUBROUTINE timecmp
-
-
-
-! spaceship operator for TimeIntervals
-SUBROUTINE timeintcmp(timeint1, timeint2, retval )
- USE MPAS_ESMF_basemod
- USE MPAS_ESMF_basetimemod
- USE MPAS_ESMF_timeintervalmod
- IMPLICIT NONE
- INTEGER, INTENT(OUT) :: retval
-!
-! !ARGUMENTS:
- TYPE(MPAS_ESMF_TimeInterval), INTENT(IN) :: timeint1
- TYPE(MPAS_ESMF_TimeInterval), INTENT(IN) :: timeint2
- CALL timeintchecknormalized( timeint1, 'timeintcmp arg1' )
- CALL timeintchecknormalized( timeint2, 'timeintcmp arg2' )
- CALL seccmp( timeint1%basetime%S, timeint1%basetime%Sn, &
- timeint1%basetime%Sd, &
- timeint2%basetime%S, timeint2%basetime%Sn, &
- timeint2%basetime%Sd, retval )
-END SUBROUTINE timeintcmp
-
-
-
-! spaceship operator for seconds + Sn/Sd
-SUBROUTINE seccmp(S1, Sn1, Sd1, S2, Sn2, Sd2, retval )
- USE MPAS_ESMF_basemod
- IMPLICIT NONE
- INTEGER, INTENT(OUT) :: retval
-!
-! !ARGUMENTS:
- INTEGER(MPAS_ESMF_KIND_I8), INTENT(IN) :: S1, Sn1, Sd1
- INTEGER(MPAS_ESMF_KIND_I8), INTENT(IN) :: S2, Sn2, Sd2
-! local
- INTEGER(MPAS_ESMF_KIND_I8) :: lcd, n1, n2
-
- n1 = Sn1
- n2 = Sn2
- if ( ( n1 .ne. 0 ) .or. ( n2 .ne. 0 ) ) then
- CALL compute_lcd( Sd1, Sd2, lcd )
- if ( Sd1 .ne. 0 ) n1 = n1 * ( lcd / Sd1 )
- if ( Sd2 .ne. 0 ) n2 = n2 * ( lcd / Sd2 )
- endif
-
- if ( S1 .GT. S2 ) retval = 1
- if ( S1 .LT. S2 ) retval = -1
- IF ( S1 .EQ. S2 ) THEN
- IF (n1 .GT. n2) retval = 1
- IF (n1 .LT. n2) retval = -1
- IF (n1 .EQ. n2) retval = 0
- ENDIF
-END SUBROUTINE seccmp
-
-
-SUBROUTINE c_esmc_basetimeeq (time1, time2, outflag)
- USE MPAS_ESMF_alarmmod
- USE MPAS_ESMF_basemod
- USE MPAS_ESMF_basetimemod
- USE MPAS_ESMF_calendarmod
- USE MPAS_ESMF_clockmod
- USE MPAS_ESMF_fractionmod
- USE MPAS_ESMF_timeintervalmod
- USE MPAS_ESMF_timemod
-IMPLICIT NONE
- logical, intent(OUT) :: outflag
- type(MPAS_ESMF_Time), intent(in) :: time1
- type(MPAS_ESMF_Time), intent(in) :: time2
- integer res
- CALL timecmp(time1,time2,res)
- outflag = (res .EQ. 0)
-END SUBROUTINE c_esmc_basetimeeq
-SUBROUTINE c_esmc_basetimege(time1, time2, outflag)
- USE MPAS_ESMF_alarmmod
- USE MPAS_ESMF_basemod
- USE MPAS_ESMF_basetimemod
- USE MPAS_ESMF_calendarmod
- USE MPAS_ESMF_clockmod
- USE MPAS_ESMF_fractionmod
- USE MPAS_ESMF_timeintervalmod
- USE MPAS_ESMF_timemod
- logical, intent(OUT) :: outflag
- type(MPAS_ESMF_Time), intent(in) :: time1
- type(MPAS_ESMF_Time), intent(in) :: time2
- integer res
- CALL timecmp(time1,time2,res)
- outflag = (res .EQ. 1 .OR. res .EQ. 0)
-END SUBROUTINE c_esmc_basetimege
-SUBROUTINE c_esmc_basetimegt(time1, time2, outflag)
- USE MPAS_ESMF_alarmmod
- USE MPAS_ESMF_basemod
- USE MPAS_ESMF_basetimemod
- USE MPAS_ESMF_calendarmod
- USE MPAS_ESMF_clockmod
- USE MPAS_ESMF_fractionmod
- USE MPAS_ESMF_timeintervalmod
- USE MPAS_ESMF_timemod
-IMPLICIT NONE
- logical, intent(OUT) :: outflag
- type(MPAS_ESMF_Time), intent(in) :: time1
- type(MPAS_ESMF_Time), intent(in) :: time2
- integer res
- CALL timecmp(time1,time2,res)
- outflag = (res .EQ. 1)
-END SUBROUTINE c_esmc_basetimegt
-SUBROUTINE c_esmc_basetimele(time1, time2, outflag)
- USE MPAS_ESMF_alarmmod
- USE MPAS_ESMF_basemod
- USE MPAS_ESMF_basetimemod
- USE MPAS_ESMF_calendarmod
- USE MPAS_ESMF_clockmod
- USE MPAS_ESMF_fractionmod
- USE MPAS_ESMF_timeintervalmod
- USE MPAS_ESMF_timemod
-IMPLICIT NONE
- logical, intent(OUT) :: outflag
- type(MPAS_ESMF_Time), intent(in) :: time1
- type(MPAS_ESMF_Time), intent(in) :: time2
- integer res
- CALL timecmp(time1,time2,res)
- outflag = (res .EQ. -1 .OR. res .EQ. 0)
-END SUBROUTINE c_esmc_basetimele
-SUBROUTINE c_esmc_basetimelt(time1, time2, outflag)
- USE MPAS_ESMF_alarmmod
- USE MPAS_ESMF_basemod
- USE MPAS_ESMF_basetimemod
- USE MPAS_ESMF_calendarmod
- USE MPAS_ESMF_clockmod
- USE MPAS_ESMF_fractionmod
- USE MPAS_ESMF_timeintervalmod
- USE MPAS_ESMF_timemod
-IMPLICIT NONE
- logical, intent(OUT) :: outflag
- type(MPAS_ESMF_Time), intent(in) :: time1
- type(MPAS_ESMF_Time), intent(in) :: time2
- integer res
- CALL timecmp(time1,time2,res)
- outflag = (res .EQ. -1)
-END SUBROUTINE c_esmc_basetimelt
-SUBROUTINE c_esmc_basetimene(time1, time2, outflag)
- USE MPAS_ESMF_alarmmod
- USE MPAS_ESMF_basemod
- USE MPAS_ESMF_basetimemod
- USE MPAS_ESMF_calendarmod
- USE MPAS_ESMF_clockmod
- USE MPAS_ESMF_fractionmod
- USE MPAS_ESMF_timeintervalmod
- USE MPAS_ESMF_timemod
-IMPLICIT NONE
- logical, intent(OUT) :: outflag
- type(MPAS_ESMF_Time), intent(in) :: time1
- type(MPAS_ESMF_Time), intent(in) :: time2
- integer res
- CALL timecmp(time1,time2,res)
- outflag = (res .NE. 0)
-END SUBROUTINE c_esmc_basetimene
-
-SUBROUTINE c_esmc_basetimeinteq(timeint1, timeint2, outflag)
- USE MPAS_ESMF_timeintervalmod
- IMPLICIT NONE
- LOGICAL, INTENT(OUT) :: outflag
- TYPE(MPAS_ESMF_TimeInterval), INTENT(IN) :: timeint1
- TYPE(MPAS_ESMF_TimeInterval), INTENT(IN) :: timeint2
- INTEGER :: res
- CALL timeintcmp(timeint1,timeint2,res)
- outflag = (res .EQ. 0)
-END SUBROUTINE c_esmc_basetimeinteq
-SUBROUTINE c_esmc_basetimeintne(timeint1, timeint2, outflag)
- USE MPAS_ESMF_timeintervalmod
- IMPLICIT NONE
- LOGICAL, INTENT(OUT) :: outflag
- TYPE(MPAS_ESMF_TimeInterval), INTENT(IN) :: timeint1
- TYPE(MPAS_ESMF_TimeInterval), INTENT(IN) :: timeint2
- INTEGER :: res
- CALL timeintcmp(timeint1,timeint2,res)
- outflag = (res .NE. 0)
-END SUBROUTINE c_esmc_basetimeintne
-SUBROUTINE c_esmc_basetimeintlt(timeint1, timeint2, outflag)
- USE MPAS_ESMF_timeintervalmod
- IMPLICIT NONE
- LOGICAL, INTENT(OUT) :: outflag
- TYPE(MPAS_ESMF_TimeInterval), INTENT(IN) :: timeint1
- TYPE(MPAS_ESMF_TimeInterval), INTENT(IN) :: timeint2
- INTEGER :: res
- CALL timeintcmp(timeint1,timeint2,res)
- outflag = (res .LT. 0)
-END SUBROUTINE c_esmc_basetimeintlt
-SUBROUTINE c_esmc_basetimeintgt(timeint1, timeint2, outflag)
- USE MPAS_ESMF_timeintervalmod
- IMPLICIT NONE
- LOGICAL, INTENT(OUT) :: outflag
- TYPE(MPAS_ESMF_TimeInterval), INTENT(IN) :: timeint1
- TYPE(MPAS_ESMF_TimeInterval), INTENT(IN) :: timeint2
- INTEGER :: res
- CALL timeintcmp(timeint1,timeint2,res)
- outflag = (res .GT. 0)
-END SUBROUTINE c_esmc_basetimeintgt
-SUBROUTINE c_esmc_basetimeintle(timeint1, timeint2, outflag)
- USE MPAS_ESMF_timeintervalmod
- IMPLICIT NONE
- LOGICAL, INTENT(OUT) :: outflag
- TYPE(MPAS_ESMF_TimeInterval), INTENT(IN) :: timeint1
- TYPE(MPAS_ESMF_TimeInterval), INTENT(IN) :: timeint2
- INTEGER :: res
- CALL timeintcmp(timeint1,timeint2,res)
- outflag = (res .LE. 0)
-END SUBROUTINE c_esmc_basetimeintle
-SUBROUTINE c_esmc_basetimeintge(timeint1, timeint2, outflag)
- USE MPAS_ESMF_timeintervalmod
- IMPLICIT NONE
- LOGICAL, INTENT(OUT) :: outflag
- TYPE(MPAS_ESMF_TimeInterval), INTENT(IN) :: timeint1
- TYPE(MPAS_ESMF_TimeInterval), INTENT(IN) :: timeint2
- INTEGER :: res
- CALL timeintcmp(timeint1,timeint2,res)
- outflag = (res .GE. 0)
-END SUBROUTINE c_esmc_basetimeintge
-
-SUBROUTINE compute_lcd( e1, e2, lcd )
- USE MPAS_ESMF_basemod
- IMPLICIT NONE
- INTEGER(MPAS_ESMF_KIND_I8), INTENT(IN) :: e1, e2
- INTEGER(MPAS_ESMF_KIND_I8), INTENT(OUT) :: lcd
- INTEGER, PARAMETER :: nprimes = 9
- INTEGER(MPAS_ESMF_KIND_I8), DIMENSION(nprimes), PARAMETER :: primes = (/2,3,5,7,11,13,17,19,23/)
- INTEGER i
- INTEGER(MPAS_ESMF_KIND_I8) d1, d2, p
-
- d1 = e1 ; d2 = e2
- IF ( d1 .EQ. 0 .AND. d2 .EQ. 0 ) THEN ; lcd = 1 ; RETURN ; ENDIF
- IF ( d1 .EQ. 0 ) d1 = d2
- IF ( d2 .EQ. 0 ) d2 = d1
- IF ( d1 .EQ. d2 ) THEN ; lcd = d1 ; RETURN ; ENDIF
- lcd = d1 * d2
- DO i = 1, nprimes
- p = primes(i)
- DO WHILE (lcd/p .NE. 0 .AND. &
- mod(lcd/p,d1) .EQ. 0 .AND. mod(lcd/p,d2) .EQ. 0)
- lcd = lcd / p
- END DO
- ENDDO
-END SUBROUTINE compute_lcd
-
-SUBROUTINE simplify( ni, di, no, do )
- USE MPAS_ESMF_basemod
- IMPLICIT NONE
- INTEGER(MPAS_ESMF_KIND_I8), INTENT(IN) :: ni, di
- INTEGER(MPAS_ESMF_KIND_I8), INTENT(OUT) :: no, do
- INTEGER, PARAMETER :: nprimes = 9
- INTEGER(MPAS_ESMF_KIND_I8), DIMENSION(nprimes), PARAMETER :: primes = (/2,3,5,7,11,13,17,19,23/)
- INTEGER(MPAS_ESMF_KIND_I8) :: pr, d, n
- INTEGER :: np
- LOGICAL keepgoing
- IF ( ni .EQ. 0 ) THEN
- do = 1
- no = 0
- RETURN
- ENDIF
- IF ( mod( di , ni ) .EQ. 0 ) THEN
- do = di / ni
- no = 1
- RETURN
- ENDIF
- d = di
- n = ni
- DO np = 1, nprimes
- pr = primes(np)
- keepgoing = .TRUE.
- DO WHILE ( keepgoing )
- keepgoing = .FALSE.
- IF ( d/pr .NE. 0 .AND. n/pr .NE. 0 .AND. MOD(d,pr) .EQ. 0 .AND. MOD(n,pr) .EQ. 0 ) THEN
- d = d / pr
- n = n / pr
- keepgoing = .TRUE.
- ENDIF
- ENDDO
- ENDDO
- do = d
- no = n
- RETURN
-END SUBROUTINE simplify
-
-
-!$$$ this should be named "c_esmc_timesum" or something less misleading
-SUBROUTINE c_esmc_basetimesum( time1, timeinterval, timeOut )
- USE MPAS_ESMF_basemod
- USE MPAS_ESMF_basetimemod
- USE MPAS_ESMF_timeintervalmod
- USE MPAS_ESMF_timemod
- IMPLICIT NONE
- TYPE(MPAS_ESMF_Time), INTENT(IN) :: time1
- TYPE(MPAS_ESMF_TimeInterval), INTENT(IN) :: timeinterval
- TYPE(MPAS_ESMF_Time), INTENT(INOUT) :: timeOut
- ! locals
- INTEGER :: m
- timeOut = time1
- timeOut%basetime = timeOut%basetime + timeinterval%basetime
-#if 0
-!jm Month has no meaning for a timeinterval; removed 20100319
-#if defined PLANET
- ! Do nothing...
-#else
- DO m = 1, abs(timeinterval%MM)
- IF ( timeinterval%MM > 0 ) THEN
- CALL timeincmonth( timeOut )
- ELSE
- CALL timedecmonth( timeOut )
- ENDIF
- ENDDO
-#endif
-#endif
- timeOut%YR = timeOut%YR + timeinterval%YR
- CALL normalize_time( timeOut )
-END SUBROUTINE c_esmc_basetimesum
-
-
-!$$$ this should be named "c_esmc_timedec" or something less misleading
-SUBROUTINE c_esmc_basetimedec( time1, timeinterval, timeOut )
- USE MPAS_ESMF_basemod
- USE MPAS_ESMF_basetimemod
- USE MPAS_ESMF_timeintervalmod
- USE MPAS_ESMF_timemod
- IMPLICIT NONE
- TYPE(MPAS_ESMF_Time), INTENT(IN) :: time1
- TYPE(MPAS_ESMF_TimeInterval), INTENT(IN) :: timeinterval
- TYPE(MPAS_ESMF_Time), INTENT(OUT) :: timeOut
- ! locals
- TYPE (MPAS_ESMF_TimeInterval) :: neginterval
- neginterval = timeinterval
-!$$$push this down into a unary negation operator on TimeInterval
- neginterval%basetime%S = -neginterval%basetime%S
- neginterval%basetime%Sn = -neginterval%basetime%Sn
- neginterval%YR = -neginterval%YR
-#if 0
-!jm month has no meaning for an interval; removed 20100319
-#ifndef PLANET
- neginterval%MM = -neginterval%MM
-#endif
-#endif
- timeOut = time1 + neginterval
-END SUBROUTINE c_esmc_basetimedec
-
-
-!$$$ this should be named "c_esmc_timediff" or something less misleading
-SUBROUTINE c_esmc_basetimediff( time1, time2, timeIntOut )
- USE MPAS_ESMF_basemod
- USE MPAS_ESMF_basetimemod
- USE MPAS_ESMF_timeintervalmod
- USE MPAS_ESMF_timemod
- IMPLICIT NONE
- TYPE(MPAS_ESMF_Time), INTENT(IN) :: time1
- TYPE(MPAS_ESMF_Time), INTENT(IN) :: time2
- TYPE(MPAS_ESMF_TimeInterval), INTENT(OUT) :: timeIntOut
- ! locals
- INTEGER(MPAS_ESMF_KIND_I8) :: nsecondsinyear
- INTEGER :: yr
- CALL MPAS_ESMF_TimeIntervalSet( timeIntOut )
- timeIntOut%basetime = time1%basetime - time2%basetime
- ! convert difference in years to basetime...
- IF ( time1%YR > time2%YR ) THEN
- DO yr = time2%YR, ( time1%YR - 1 )
- timeIntOut%basetime%S = timeIntOut%basetime%S + nsecondsinyear( yr )
- ENDDO
- ELSE IF ( time2%YR > time1%YR ) THEN
- DO yr = time1%YR, ( time2%YR - 1 )
- timeIntOut%basetime%S = timeIntOut%basetime%S - nsecondsinyear( yr )
- ENDDO
- ENDIF
-!$$$ add tests for multi-year differences
- CALL normalize_timeint( timeIntOut )
-END SUBROUTINE c_esmc_basetimediff
-
-
-! some extra wrf stuff
-
-
-! Convert fraction to string with leading sign.
-! If fraction simplifies to a whole number or if
-! denominator is zero, return empty string.
-! INTEGER*8 interface.
-SUBROUTINE fraction_to_stringi8( numerator, denominator, frac_str )
- USE MPAS_ESMF_basemod
- IMPLICIT NONE
- INTEGER(MPAS_ESMF_KIND_I8), INTENT(IN) :: numerator
- INTEGER(MPAS_ESMF_KIND_I8), INTENT(IN) :: denominator
- CHARACTER (LEN=*), INTENT(OUT) :: frac_str
- IF ( denominator > 0 ) THEN
- IF ( mod( numerator, denominator ) /= 0 ) THEN
- IF ( numerator > 0 ) THEN
- WRITE(frac_str,FMT="('+',I2.2,'/',I2.2)") abs(numerator), denominator
- ELSE ! numerator < 0
- WRITE(frac_str,FMT="('-',I2.2,'/',I2.2)") abs(numerator), denominator
- ENDIF
- ELSE ! includes numerator == 0 case
- frac_str = ''
- ENDIF
- ELSE ! no-fraction case
- frac_str = ''
- ENDIF
-END SUBROUTINE fraction_to_stringi8
-
-
-! Convert fraction to string with leading sign.
-! If fraction simplifies to a whole number or if
-! denominator is zero, return empty string.
-! INTEGER interface.
-SUBROUTINE fraction_to_string( numerator, denominator, frac_str )
- USE MPAS_ESMF_basemod
- IMPLICIT NONE
- INTEGER, INTENT(IN) :: numerator
- INTEGER, INTENT(IN) :: denominator
- CHARACTER (LEN=*), INTENT(OUT) :: frac_str
- ! locals
- INTEGER(MPAS_ESMF_KIND_I8) :: numerator_i8, denominator_i8
- numerator_i8 = INT( numerator, MPAS_ESMF_KIND_I8 )
- denominator_i8 = INT( denominator, MPAS_ESMF_KIND_I8 )
- CALL fraction_to_stringi8( numerator_i8, denominator_i8, frac_str )
-END SUBROUTINE fraction_to_string
-
-
-SUBROUTINE print_a_time( time )
- use MPAS_ESMF_basemod
- use MPAS_ESMF_Timemod
- IMPLICIT NONE
- type(MPAS_ESMF_Time) time
- character*128 :: s
- integer rc
- CALL MPAS_ESMF_TimeGet( time, timeString=s, rc=rc )
- print *,'Print a time|',TRIM(s),'|'
- return
-END SUBROUTINE print_a_time
-
-SUBROUTINE print_a_timeinterval( time )
- use MPAS_ESMF_basemod
- use MPAS_ESMF_TimeIntervalmod
- IMPLICIT NONE
- type(MPAS_ESMF_TimeInterval) time
- character*128 :: s
- integer rc
- CALL MPAS_ESMFold_TimeIntervalGetString( time, s, rc )
- print *,'Print a time interval|',TRIM(s),'|'
- return
-END SUBROUTINE print_a_timeinterval
-
Added: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/Meat.F90
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/Meat.F90         (rev 0)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/Meat.F90        2012-11-29 22:23:06 UTC (rev 2329)
@@ -0,0 +1,928 @@
+#include <ESMF_TimeMgr.inc>
+
+! Factor so abs(Sn) < Sd and ensure that signs of S and Sn match.
+! Also, enforce consistency.
+! YR and MM fields are ignored.
+
+SUBROUTINE normalize_basetime( basetime )
+ USE esmf_basemod
+ USE esmf_basetimemod
+ IMPLICIT NONE
+ TYPE(ESMF_BaseTime), INTENT(INOUT) :: basetime
+!PRINT *,'DEBUG: BEGIN normalize_basetime()'
+ ! Consistency check...
+ IF ( basetime%Sd < 0 ) THEN
+ CALL wrf_error_fatal( &
+ 'normalize_basetime: denominator of seconds cannot be negative' )
+ ENDIF
+ IF ( ( basetime%Sd == 0 ) .AND. ( basetime%Sn .NE. 0 ) ) THEN
+ CALL wrf_error_fatal( &
+ 'normalize_basetime: denominator of seconds cannot be zero when numerator is non-zero' )
+ ENDIF
+ ! factor so abs(Sn) < Sd
+ IF ( basetime%Sd > 0 ) THEN
+ IF ( ABS( basetime%Sn ) .GE. basetime%Sd ) THEN
+!PRINT *,'DEBUG: normalize_basetime() A1: S,Sn,Sd = ',basetime%S,basetime%Sn,basetime%Sd
+ basetime%S = basetime%S + ( basetime%Sn / basetime%Sd )
+ basetime%Sn = mod( basetime%Sn, basetime%Sd )
+!PRINT *,'DEBUG: normalize_basetime() A2: S,Sn,Sd = ',basetime%S,basetime%Sn,basetime%Sd
+ ENDIF
+ ! change sign of Sn if it does not match S
+ IF ( ( basetime%S > 0 ) .AND. ( basetime%Sn < 0 ) ) THEN
+!PRINT *,'DEBUG: normalize_basetime() B1: S,Sn,Sd = ',basetime%S,basetime%Sn,basetime%Sd
+ basetime%S = basetime%S - 1_ESMF_KIND_I8
+ basetime%Sn = basetime%Sn + basetime%Sd
+!PRINT *,'DEBUG: normalize_basetime() B2: S,Sn,Sd = ',basetime%S,basetime%Sn,basetime%Sd
+ ENDIF
+ IF ( ( basetime%S < 0 ) .AND. ( basetime%Sn > 0 ) ) THEN
+!PRINT *,'DEBUG: normalize_basetime() C1: S,Sn,Sd = ',basetime%S,basetime%Sn,basetime%Sd
+ basetime%S = basetime%S + 1_ESMF_KIND_I8
+ basetime%Sn = basetime%Sn - basetime%Sd
+!PRINT *,'DEBUG: normalize_basetime() C2: S,Sn,Sd = ',basetime%S,basetime%Sn,basetime%Sd
+ ENDIF
+ ENDIF
+!PRINT *,'DEBUG: END normalize_basetime()'
+END SUBROUTINE normalize_basetime
+
+
+
+! A normalized time has time%basetime >= 0, time%basetime less than the current
+! year expressed as a timeInterval, and time%YR can take any value
+SUBROUTINE normalize_time( time )
+ USE esmf_basemod
+ USE esmf_basetimemod
+ USE esmf_timemod
+ IMPLICIT NONE
+ TYPE(ESMF_Time), INTENT(INOUT) :: time
+ INTEGER(ESMF_KIND_I8) :: nsecondsinyear
+ ! locals
+ TYPE(ESMF_BaseTime) :: cmptime, zerotime
+ INTEGER :: rc
+ LOGICAL :: done
+
+ ! first, normalize basetime
+ ! this will force abs(Sn) < Sd and ensure that signs of S and Sn match
+ CALL normalize_basetime( time%basetime )
+
+!$$$ add tests for these edge cases
+
+ ! next, underflow negative seconds into YEARS
+ ! time%basetime must end up non-negative
+!$$$ push this down into ESMF_BaseTime constructor
+ zerotime%S = 0
+ zerotime%Sn = 0
+ zerotime%Sd = 0
+ DO WHILE ( time%basetime < zerotime )
+ time%YR = time%YR - 1
+!$$$ push this down into ESMF_BaseTime constructor
+ cmptime%S = nsecondsinyear( time%YR )
+ cmptime%Sn = 0
+ cmptime%Sd = 0
+ time%basetime = time%basetime + cmptime
+ ENDDO
+
+ ! next, overflow seconds into YEARS
+ done = .FALSE.
+ DO WHILE ( .NOT. done )
+!$$$ push this down into ESMF_BaseTime constructor
+ cmptime%S = nsecondsinyear( time%YR )
+ cmptime%Sn = 0
+ cmptime%Sd = 0
+ IF ( time%basetime >= cmptime ) THEN
+ time%basetime = time%basetime - cmptime
+ time%YR = time%YR + 1
+ ELSE
+ done = .TRUE.
+ ENDIF
+ ENDDO
+END SUBROUTINE normalize_time
+
+
+
+SUBROUTINE normalize_timeint( timeInt )
+ USE esmf_basetimemod
+ USE esmf_timeintervalmod
+ IMPLICIT NONE
+ TYPE(ESMF_TimeInterval), INTENT(INOUT) :: timeInt
+
+ ! normalize basetime
+ ! this will force abs(Sn) < Sd and ensure that signs of S and Sn match
+ ! YR and MM are ignored
+ CALL normalize_basetime( timeInt%basetime )
+END SUBROUTINE normalize_timeint
+
+
+
+
+FUNCTION signnormtimeint ( timeInt )
+ ! Compute the sign of a time interval.
+ ! YR and MM fields are *IGNORED*.
+ ! returns 1, 0, or -1 or exits if timeInt fields have inconsistent signs.
+ USE esmf_basemod
+ USE esmf_basetimemod
+ USE esmf_timeintervalmod
+ IMPLICIT NONE
+ TYPE(ESMF_TimeInterval), INTENT(IN) :: timeInt
+ INTEGER :: signnormtimeint
+ LOGICAL :: positive, negative
+
+ positive = .FALSE.
+ negative = .FALSE.
+ signnormtimeint = 0
+ ! Note that Sd is required to be non-negative. This is enforced in
+ ! normalize_timeint().
+ ! Note that Sn is required to be zero when Sd is zero. This is enforced
+ ! in normalize_timeint().
+ IF ( ( timeInt%basetime%S > 0 ) .OR. &
+ ( timeInt%basetime%Sn > 0 ) ) THEN
+ positive = .TRUE.
+ ENDIF
+ IF ( ( timeInt%basetime%S < 0 ) .OR. &
+ ( timeInt%basetime%Sn < 0 ) ) THEN
+ negative = .TRUE.
+ ENDIF
+ IF ( positive .AND. negative ) THEN
+ CALL wrf_error_fatal( &
+ 'signnormtimeint: signs of fields cannot be mixed' )
+ ELSE IF ( positive ) THEN
+ signnormtimeint = 1
+ ELSE IF ( negative ) THEN
+ signnormtimeint = -1
+ ENDIF
+END FUNCTION signnormtimeint
+
+
+! Exits with error message if timeInt is not normalized.
+SUBROUTINE timeintchecknormalized( timeInt, msgstr )
+ USE esmf_timeintervalmod
+ IMPLICIT NONE
+ TYPE(ESMF_TimeInterval), INTENT(IN) :: timeInt
+ CHARACTER(LEN=*), INTENT(IN) :: msgstr
+ ! locals
+ CHARACTER(LEN=256) :: outstr
+ IF ( ( timeInt%YR /= 0 ) ) THEN
+ outstr = 'un-normalized TimeInterval not allowed: '//TRIM(msgstr)
+ CALL wrf_error_fatal( outstr )
+ ENDIF
+END SUBROUTINE timeintchecknormalized
+
+
+! added from share/module_date_time in WRF.
+FUNCTION nfeb ( year ) RESULT (num_days)
+ USE ESMF_CalendarMod
+
+ ! Compute the number of days in February for the given year
+ IMPLICIT NONE
+ INTEGER :: year
+ INTEGER :: num_days
+
+ type(ESMF_CalendarType) :: calendarType
+
+ calendarType = ESMF_GetCalendarType()
+
+ IF (calendarType % caltype == ESMF_CAL_NOLEAP % caltype) then
+ num_days = 28
+ ELSE IF (calendarType % caltype == ESMF_CAL_360DAY % caltype) then
+ num_days = 30
+ ELSE
+ num_days = 28 ! By default, February has 28 days ...
+ IF (MOD(year,4).eq.0) THEN
+ num_days = 29 ! But every four years, it has 29 days ...
+ IF (MOD(year,100).eq.0) THEN
+ num_days = 28 ! Except every 100 years, when it has 28 days ...
+ IF (MOD(year,400).eq.0) THEN
+ num_days = 29 ! Except every 400 years, when it has 29 days.
+ END IF
+ END IF
+ END IF
+ END IF
+
+END FUNCTION nfeb
+
+
+
+FUNCTION ndaysinyear ( year ) RESULT (num_diy)
+ ! Compute the number of days in the given year
+ IMPLICIT NONE
+ INTEGER, INTENT(IN) :: year
+ INTEGER :: num_diy
+ INTEGER :: nfeb
+#if defined MARS
+ num_diy = 669
+#elif defined TITAN
+ num_diy = 686
+#else
+ IF ( nfeb( year ) .EQ. 29 ) THEN
+ num_diy = 366
+ ELSE IF ( nfeb( year ) .EQ. 30 ) THEN
+ num_diy = 360
+ ELSE
+ num_diy = 365
+ ENDIF
+#endif
+END FUNCTION ndaysinyear
+
+
+
+FUNCTION nsecondsinyear ( year ) RESULT (numseconds)
+ ! Compute the number of seconds in the given year
+ USE esmf_basemod
+ IMPLICIT NONE
+ INTEGER, INTENT(IN) :: year
+ INTEGER(ESMF_KIND_I8) :: numseconds
+ INTEGER :: ndaysinyear
+ numseconds = SECONDS_PER_DAY * INT( ndaysinyear(year) , ESMF_KIND_I8 )
+END FUNCTION nsecondsinyear
+
+
+
+SUBROUTINE initdaym
+ USE esmf_basemod
+ USE esmf_basetimemod
+ USE ESMF_CalendarMod, only : months_per_year, mday, daym, mdaycum, monthbdys, &
+ mdayleap, mdayleapcum, monthbdysleap, daymleap
+ IMPLICIT NONE
+ INTEGER i,j,m
+ m = 1
+ mdaycum(0) = 0
+!$$$ push this down into ESMF_BaseTime constructor
+ monthbdys(0)%S = 0
+ monthbdys(0)%Sn = 0
+ monthbdys(0)%Sd = 0
+ DO i = 1,MONTHS_PER_YEAR
+ DO j = 1,mday(i)
+ daym(m) = i
+ m = m + 1
+ ENDDO
+ mdaycum(i) = mdaycum(i-1) + mday(i)
+!$$$ push this down into ESMF_BaseTime constructor
+ monthbdys(i)%S = SECONDS_PER_DAY * INT( mdaycum(i), ESMF_KIND_I8 )
+ monthbdys(i)%Sn = 0
+ monthbdys(i)%Sd = 0
+ ENDDO
+ m = 1
+ mdayleapcum(0) = 0
+!$$$ push this down into ESMF_BaseTime constructor
+ monthbdysleap(0)%S = 0
+ monthbdysleap(0)%Sn = 0
+ monthbdysleap(0)%Sd = 0
+ DO i = 1,MONTHS_PER_YEAR
+ DO j = 1,mdayleap(i)
+ daymleap(m) = i
+ m = m + 1
+ ENDDO
+ mdayleapcum(i) = mdayleapcum(i-1) + mdayleap(i)
+!$$$ push this down into ESMF_BaseTime constructor
+ monthbdysleap(i)%S = SECONDS_PER_DAY * INT( mdayleapcum(i), ESMF_KIND_I8 )
+ monthbdysleap(i)%Sn = 0
+ monthbdysleap(i)%Sd = 0
+ ENDDO
+END SUBROUTINE initdaym
+
+
+!$$$ useful, but not used at the moment...
+SUBROUTINE compute_dayinyear(YR,MM,DD,dayinyear)
+ use ESMF_CalendarMod, only : mday
+IMPLICIT NONE
+ INTEGER, INTENT(IN) :: YR,MM,DD ! DD is day of month
+ INTEGER, INTENT(OUT) :: dayinyear
+ INTEGER i
+ integer nfeb
+
+#ifdef PLANET
+ dayinyear = DD
+#else
+ dayinyear = 0
+ DO i = 1,MM-1
+ if (i.eq.2) then
+ dayinyear = dayinyear + nfeb(YR)
+ else
+ dayinyear = dayinyear + mday(i)
+ endif
+ ENDDO
+ dayinyear = dayinyear + DD
+#endif
+END SUBROUTINE compute_dayinyear
+
+
+
+SUBROUTINE timegetmonth( time, MM )
+ USE esmf_basemod
+ USE esmf_basetimemod
+ USE esmf_timemod
+ USE ESMF_CalendarMod, only : MONTHS_PER_YEAR, monthbdys, monthbdysleap
+ IMPLICIT NONE
+ TYPE(ESMF_Time), INTENT(IN) :: time
+ INTEGER, INTENT(OUT) :: MM
+ ! locals
+ INTEGER :: nfeb
+ INTEGER :: i
+#if defined PLANET
+ MM = 0
+#else
+ MM = -1
+ IF ( nfeb(time%YR) == 29 ) THEN
+ DO i = 1,MONTHS_PER_YEAR
+ IF ( ( time%basetime >= monthbdysleap(i-1) ) .AND. ( time%basetime < monthbdysleap(i) ) ) THEN
+ MM = i
+ EXIT
+ ENDIF
+ ENDDO
+ ELSE
+ DO i = 1,MONTHS_PER_YEAR
+ IF ( ( time%basetime >= monthbdys(i-1) ) .AND. ( time%basetime < monthbdys(i) ) ) THEN
+ MM = i
+ EXIT
+ ENDIF
+ ENDDO
+ ENDIF
+#endif
+ IF ( MM == -1 ) THEN
+ CALL wrf_error_fatal( 'timegetmonth: could not extract month of year from time' )
+ ENDIF
+END SUBROUTINE timegetmonth
+
+
+!$$$ may need to change dependencies in Makefile...
+
+SUBROUTINE timegetdayofmonth( time, DD )
+ USE esmf_basemod
+ USE esmf_basetimemod
+ USE esmf_timemod
+ USE esmf_calendarmod, only : monthbdys, monthbdysleap
+ IMPLICIT NONE
+ TYPE(ESMF_Time), INTENT(IN) :: time
+ INTEGER, INTENT(OUT) :: DD
+ ! locals
+ INTEGER :: nfeb
+ INTEGER :: MM
+ TYPE(ESMF_BaseTime) :: tmpbasetime
+#if defined PLANET
+ tmpbasetime = time%basetime
+#else
+ CALL timegetmonth( time, MM )
+ IF ( nfeb(time%YR) == 29 ) THEN
+ tmpbasetime = time%basetime - monthbdysleap(MM-1)
+ ELSE
+ tmpbasetime = time%basetime - monthbdys(MM-1)
+ ENDIF
+#endif
+ DD = ( tmpbasetime%S / SECONDS_PER_DAY ) + 1
+END SUBROUTINE timegetdayofmonth
+
+
+! Increment Time by number of seconds between start of year and start
+! of month MM.
+! 1 <= MM <= 12
+! Time is NOT normalized.
+SUBROUTINE timeaddmonths( time, MM, ierr )
+ USE esmf_basemod
+ USE esmf_basetimemod
+ USE esmf_timemod
+ USE esmf_calendarmod, only : MONTHS_PER_YEAR, monthbdys, monthbdysleap
+ IMPLICIT NONE
+ TYPE(ESMF_Time), INTENT(INOUT) :: time
+ INTEGER, INTENT(IN) :: MM
+ INTEGER, INTENT(OUT) :: ierr
+ ! locals
+ INTEGER :: nfeb
+ ierr = ESMF_SUCCESS
+! PRINT *,'DEBUG: BEGIN timeaddmonths()'
+#if defined PLANET
+! time%basetime = time%basetime
+#else
+ IF ( ( MM < 1 ) .OR. ( MM > MONTHS_PER_YEAR ) ) THEN
+ ierr = ESMF_FAILURE
+ ELSE
+ IF ( nfeb(time%YR) == 29 ) THEN
+ time%basetime = time%basetime + monthbdysleap(MM-1)
+ ELSE
+ time%basetime = time%basetime + monthbdys(MM-1)
+ ENDIF
+ ENDIF
+#endif
+END SUBROUTINE timeaddmonths
+
+
+! Increment Time by number of seconds in the current month.
+! Time is NOT normalized.
+SUBROUTINE timeincmonth( time )
+ USE esmf_basemod
+ USE esmf_basetimemod
+ USE esmf_timemod
+ USE esmf_calendarmod, only : mday, mdayleap
+ IMPLICIT NONE
+ TYPE(ESMF_Time), INTENT(INOUT) :: time
+ ! locals
+ INTEGER :: nfeb
+ INTEGER :: MM
+#if defined PLANET
+! time%basetime%S = time%basetime%S
+#else
+ CALL timegetmonth( time, MM )
+ IF ( nfeb(time%YR) == 29 ) THEN
+ time%basetime%S = time%basetime%S + &
+ ( INT( mdayleap(MM), ESMF_KIND_I8 ) * SECONDS_PER_DAY )
+ ELSE
+ time%basetime%S = time%basetime%S + &
+ ( INT( mday(MM), ESMF_KIND_I8 ) * SECONDS_PER_DAY )
+ ENDIF
+#endif
+END SUBROUTINE timeincmonth
+
+
+
+! Decrement Time by number of seconds in the previous month.
+! Time is NOT normalized.
+SUBROUTINE timedecmonth( time )
+ USE esmf_basemod
+ USE esmf_basetimemod
+ USE esmf_timemod
+ USE esmf_calendarmod, only : mday, months_per_year, mdayleap
+ IMPLICIT NONE
+ TYPE(ESMF_Time), INTENT(INOUT) :: time
+ ! locals
+ INTEGER :: nfeb
+ INTEGER :: MM
+#if defined PLANET
+! time%basetime%S = time%basetime%S
+#else
+ CALL timegetmonth( time, MM ) ! current month, 1-12
+ ! find previous month
+ MM = MM - 1
+ IF ( MM == 0 ) THEN
+ ! wrap around Jan -> Dec
+ MM = MONTHS_PER_YEAR
+ ENDIF
+ IF ( nfeb(time%YR) == 29 ) THEN
+ time%basetime%S = time%basetime%S - &
+ ( INT( mdayleap(MM), ESMF_KIND_I8 ) * SECONDS_PER_DAY )
+ ELSE
+ time%basetime%S = time%basetime%S - &
+ ( INT( mday(MM), ESMF_KIND_I8 ) * SECONDS_PER_DAY )
+ ENDIF
+#endif
+END SUBROUTINE timedecmonth
+
+
+
+! spaceship operator for Times
+SUBROUTINE timecmp(time1, time2, retval )
+ USE esmf_basemod
+ USE esmf_basetimemod
+ USE esmf_timemod
+ IMPLICIT NONE
+ INTEGER, INTENT(OUT) :: retval
+!
+! !ARGUMENTS:
+ TYPE(ESMF_Time), INTENT(IN) :: time1
+ TYPE(ESMF_Time), INTENT(IN) :: time2
+ IF ( time1%YR .GT. time2%YR ) THEN ; retval = 1 ; RETURN ; ENDIF
+ IF ( time1%YR .LT. time2%YR ) THEN ; retval = -1 ; RETURN ; ENDIF
+ CALL seccmp( time1%basetime%S, time1%basetime%Sn, time1%basetime%Sd, &
+ time2%basetime%S, time2%basetime%Sn, time2%basetime%Sd, &
+ retval )
+END SUBROUTINE timecmp
+
+
+
+! spaceship operator for TimeIntervals
+SUBROUTINE timeintcmp(timeint1, timeint2, retval )
+ USE esmf_basemod
+ USE esmf_basetimemod
+ USE esmf_timeintervalmod
+ IMPLICIT NONE
+ INTEGER, INTENT(OUT) :: retval
+!
+! !ARGUMENTS:
+ TYPE(ESMF_TimeInterval), INTENT(IN) :: timeint1
+ TYPE(ESMF_TimeInterval), INTENT(IN) :: timeint2
+ CALL timeintchecknormalized( timeint1, 'timeintcmp arg1' )
+ CALL timeintchecknormalized( timeint2, 'timeintcmp arg2' )
+ CALL seccmp( timeint1%basetime%S, timeint1%basetime%Sn, &
+ timeint1%basetime%Sd, &
+ timeint2%basetime%S, timeint2%basetime%Sn, &
+ timeint2%basetime%Sd, retval )
+END SUBROUTINE timeintcmp
+
+
+
+! spaceship operator for seconds + Sn/Sd
+SUBROUTINE seccmp(S1, Sn1, Sd1, S2, Sn2, Sd2, retval )
+ USE esmf_basemod
+ IMPLICIT NONE
+ INTEGER, INTENT(OUT) :: retval
+!
+! !ARGUMENTS:
+ INTEGER(ESMF_KIND_I8), INTENT(IN) :: S1, Sn1, Sd1
+ INTEGER(ESMF_KIND_I8), INTENT(IN) :: S2, Sn2, Sd2
+! local
+ INTEGER(ESMF_KIND_I8) :: lcd, n1, n2
+
+ n1 = Sn1
+ n2 = Sn2
+ if ( ( n1 .ne. 0 ) .or. ( n2 .ne. 0 ) ) then
+ CALL compute_lcd( Sd1, Sd2, lcd )
+ if ( Sd1 .ne. 0 ) n1 = n1 * ( lcd / Sd1 )
+ if ( Sd2 .ne. 0 ) n2 = n2 * ( lcd / Sd2 )
+ endif
+
+ if ( S1 .GT. S2 ) retval = 1
+ if ( S1 .LT. S2 ) retval = -1
+ IF ( S1 .EQ. S2 ) THEN
+ IF (n1 .GT. n2) retval = 1
+ IF (n1 .LT. n2) retval = -1
+ IF (n1 .EQ. n2) retval = 0
+ ENDIF
+END SUBROUTINE seccmp
+
+
+SUBROUTINE c_esmc_basetimeeq (time1, time2, outflag)
+ USE esmf_alarmmod
+ USE esmf_basemod
+ USE esmf_basetimemod
+ USE esmf_calendarmod
+ USE esmf_clockmod
+ USE esmf_fractionmod
+ USE esmf_timeintervalmod
+ USE esmf_timemod
+IMPLICIT NONE
+ logical, intent(OUT) :: outflag
+ type(ESMF_Time), intent(in) :: time1
+ type(ESMF_Time), intent(in) :: time2
+ integer res
+ CALL timecmp(time1,time2,res)
+ outflag = (res .EQ. 0)
+END SUBROUTINE c_esmc_basetimeeq
+SUBROUTINE c_esmc_basetimege(time1, time2, outflag)
+ USE esmf_alarmmod
+ USE esmf_basemod
+ USE esmf_basetimemod
+ USE esmf_calendarmod
+ USE esmf_clockmod
+ USE esmf_fractionmod
+ USE esmf_timeintervalmod
+ USE esmf_timemod
+ logical, intent(OUT) :: outflag
+ type(ESMF_Time), intent(in) :: time1
+ type(ESMF_Time), intent(in) :: time2
+ integer res
+ CALL timecmp(time1,time2,res)
+ outflag = (res .EQ. 1 .OR. res .EQ. 0)
+END SUBROUTINE c_esmc_basetimege
+SUBROUTINE c_esmc_basetimegt(time1, time2, outflag)
+ USE esmf_alarmmod
+ USE esmf_basemod
+ USE esmf_basetimemod
+ USE esmf_calendarmod
+ USE esmf_clockmod
+ USE esmf_fractionmod
+ USE esmf_timeintervalmod
+ USE esmf_timemod
+IMPLICIT NONE
+ logical, intent(OUT) :: outflag
+ type(ESMF_Time), intent(in) :: time1
+ type(ESMF_Time), intent(in) :: time2
+ integer res
+ CALL timecmp(time1,time2,res)
+ outflag = (res .EQ. 1)
+END SUBROUTINE c_esmc_basetimegt
+SUBROUTINE c_esmc_basetimele(time1, time2, outflag)
+ USE esmf_alarmmod
+ USE esmf_basemod
+ USE esmf_basetimemod
+ USE esmf_calendarmod
+ USE esmf_clockmod
+ USE esmf_fractionmod
+ USE esmf_timeintervalmod
+ USE esmf_timemod
+IMPLICIT NONE
+ logical, intent(OUT) :: outflag
+ type(ESMF_Time), intent(in) :: time1
+ type(ESMF_Time), intent(in) :: time2
+ integer res
+ CALL timecmp(time1,time2,res)
+ outflag = (res .EQ. -1 .OR. res .EQ. 0)
+END SUBROUTINE c_esmc_basetimele
+SUBROUTINE c_esmc_basetimelt(time1, time2, outflag)
+ USE esmf_alarmmod
+ USE esmf_basemod
+ USE esmf_basetimemod
+ USE esmf_calendarmod
+ USE esmf_clockmod
+ USE esmf_fractionmod
+ USE esmf_timeintervalmod
+ USE esmf_timemod
+IMPLICIT NONE
+ logical, intent(OUT) :: outflag
+ type(ESMF_Time), intent(in) :: time1
+ type(ESMF_Time), intent(in) :: time2
+ integer res
+ CALL timecmp(time1,time2,res)
+ outflag = (res .EQ. -1)
+END SUBROUTINE c_esmc_basetimelt
+SUBROUTINE c_esmc_basetimene(time1, time2, outflag)
+ USE esmf_alarmmod
+ USE esmf_basemod
+ USE esmf_basetimemod
+ USE esmf_calendarmod
+ USE esmf_clockmod
+ USE esmf_fractionmod
+ USE esmf_timeintervalmod
+ USE esmf_timemod
+IMPLICIT NONE
+ logical, intent(OUT) :: outflag
+ type(ESMF_Time), intent(in) :: time1
+ type(ESMF_Time), intent(in) :: time2
+ integer res
+ CALL timecmp(time1,time2,res)
+ outflag = (res .NE. 0)
+END SUBROUTINE c_esmc_basetimene
+
+SUBROUTINE c_esmc_basetimeinteq(timeint1, timeint2, outflag)
+ USE esmf_timeintervalmod
+ IMPLICIT NONE
+ LOGICAL, INTENT(OUT) :: outflag
+ TYPE(ESMF_TimeInterval), INTENT(IN) :: timeint1
+ TYPE(ESMF_TimeInterval), INTENT(IN) :: timeint2
+ INTEGER :: res
+ CALL timeintcmp(timeint1,timeint2,res)
+ outflag = (res .EQ. 0)
+END SUBROUTINE c_esmc_basetimeinteq
+SUBROUTINE c_esmc_basetimeintne(timeint1, timeint2, outflag)
+ USE esmf_timeintervalmod
+ IMPLICIT NONE
+ LOGICAL, INTENT(OUT) :: outflag
+ TYPE(ESMF_TimeInterval), INTENT(IN) :: timeint1
+ TYPE(ESMF_TimeInterval), INTENT(IN) :: timeint2
+ INTEGER :: res
+ CALL timeintcmp(timeint1,timeint2,res)
+ outflag = (res .NE. 0)
+END SUBROUTINE c_esmc_basetimeintne
+SUBROUTINE c_esmc_basetimeintlt(timeint1, timeint2, outflag)
+ USE esmf_timeintervalmod
+ IMPLICIT NONE
+ LOGICAL, INTENT(OUT) :: outflag
+ TYPE(ESMF_TimeInterval), INTENT(IN) :: timeint1
+ TYPE(ESMF_TimeInterval), INTENT(IN) :: timeint2
+ INTEGER :: res
+ CALL timeintcmp(timeint1,timeint2,res)
+ outflag = (res .LT. 0)
+END SUBROUTINE c_esmc_basetimeintlt
+SUBROUTINE c_esmc_basetimeintgt(timeint1, timeint2, outflag)
+ USE esmf_timeintervalmod
+ IMPLICIT NONE
+ LOGICAL, INTENT(OUT) :: outflag
+ TYPE(ESMF_TimeInterval), INTENT(IN) :: timeint1
+ TYPE(ESMF_TimeInterval), INTENT(IN) :: timeint2
+ INTEGER :: res
+ CALL timeintcmp(timeint1,timeint2,res)
+ outflag = (res .GT. 0)
+END SUBROUTINE c_esmc_basetimeintgt
+SUBROUTINE c_esmc_basetimeintle(timeint1, timeint2, outflag)
+ USE esmf_timeintervalmod
+ IMPLICIT NONE
+ LOGICAL, INTENT(OUT) :: outflag
+ TYPE(ESMF_TimeInterval), INTENT(IN) :: timeint1
+ TYPE(ESMF_TimeInterval), INTENT(IN) :: timeint2
+ INTEGER :: res
+ CALL timeintcmp(timeint1,timeint2,res)
+ outflag = (res .LE. 0)
+END SUBROUTINE c_esmc_basetimeintle
+SUBROUTINE c_esmc_basetimeintge(timeint1, timeint2, outflag)
+ USE esmf_timeintervalmod
+ IMPLICIT NONE
+ LOGICAL, INTENT(OUT) :: outflag
+ TYPE(ESMF_TimeInterval), INTENT(IN) :: timeint1
+ TYPE(ESMF_TimeInterval), INTENT(IN) :: timeint2
+ INTEGER :: res
+ CALL timeintcmp(timeint1,timeint2,res)
+ outflag = (res .GE. 0)
+END SUBROUTINE c_esmc_basetimeintge
+
+SUBROUTINE compute_lcd( e1, e2, lcd )
+ USE esmf_basemod
+ IMPLICIT NONE
+ INTEGER(ESMF_KIND_I8), INTENT(IN) :: e1, e2
+ INTEGER(ESMF_KIND_I8), INTENT(OUT) :: lcd
+ INTEGER, PARAMETER :: nprimes = 9
+ INTEGER(ESMF_KIND_I8), DIMENSION(nprimes), PARAMETER :: primes = (/2,3,5,7,11,13,17,19,23/)
+ INTEGER i
+ INTEGER(ESMF_KIND_I8) d1, d2, p
+
+ d1 = e1 ; d2 = e2
+ IF ( d1 .EQ. 0 .AND. d2 .EQ. 0 ) THEN ; lcd = 1 ; RETURN ; ENDIF
+ IF ( d1 .EQ. 0 ) d1 = d2
+ IF ( d2 .EQ. 0 ) d2 = d1
+ IF ( d1 .EQ. d2 ) THEN ; lcd = d1 ; RETURN ; ENDIF
+ lcd = d1 * d2
+ DO i = 1, nprimes
+ p = primes(i)
+ DO WHILE (lcd/p .NE. 0 .AND. &
+ mod(lcd/p,d1) .EQ. 0 .AND. mod(lcd/p,d2) .EQ. 0)
+ lcd = lcd / p
+ END DO
+ ENDDO
+END SUBROUTINE compute_lcd
+
+SUBROUTINE simplify( ni, di, no, do )
+ USE esmf_basemod
+ IMPLICIT NONE
+ INTEGER(ESMF_KIND_I8), INTENT(IN) :: ni, di
+ INTEGER(ESMF_KIND_I8), INTENT(OUT) :: no, do
+ INTEGER, PARAMETER :: nprimes = 9
+ INTEGER(ESMF_KIND_I8), DIMENSION(nprimes), PARAMETER :: primes = (/2,3,5,7,11,13,17,19,23/)
+ INTEGER(ESMF_KIND_I8) :: pr, d, n
+ INTEGER :: np
+ LOGICAL keepgoing
+ IF ( ni .EQ. 0 ) THEN
+ do = 1
+ no = 0
+ RETURN
+ ENDIF
+ IF ( mod( di , ni ) .EQ. 0 ) THEN
+ do = di / ni
+ no = 1
+ RETURN
+ ENDIF
+ d = di
+ n = ni
+ DO np = 1, nprimes
+ pr = primes(np)
+ keepgoing = .TRUE.
+ DO WHILE ( keepgoing )
+ keepgoing = .FALSE.
+ IF ( d/pr .NE. 0 .AND. n/pr .NE. 0 .AND. MOD(d,pr) .EQ. 0 .AND. MOD(n,pr) .EQ. 0 ) THEN
+ d = d / pr
+ n = n / pr
+ keepgoing = .TRUE.
+ ENDIF
+ ENDDO
+ ENDDO
+ do = d
+ no = n
+ RETURN
+END SUBROUTINE simplify
+
+
+!$$$ this should be named "c_esmc_timesum" or something less misleading
+SUBROUTINE c_esmc_basetimesum( time1, timeinterval, timeOut )
+ USE esmf_basemod
+ USE esmf_basetimemod
+ USE esmf_timeintervalmod
+ USE esmf_timemod
+ IMPLICIT NONE
+ TYPE(ESMF_Time), INTENT(IN) :: time1
+ TYPE(ESMF_TimeInterval), INTENT(IN) :: timeinterval
+ TYPE(ESMF_Time), INTENT(INOUT) :: timeOut
+ ! locals
+ INTEGER :: m
+ timeOut = time1
+ timeOut%basetime = timeOut%basetime + timeinterval%basetime
+#if 0
+!jm Month has no meaning for a timeinterval; removed 20100319
+#if defined PLANET
+ ! Do nothing...
+#else
+ DO m = 1, abs(timeinterval%MM)
+ IF ( timeinterval%MM > 0 ) THEN
+ CALL timeincmonth( timeOut )
+ ELSE
+ CALL timedecmonth( timeOut )
+ ENDIF
+ ENDDO
+#endif
+#endif
+ timeOut%YR = timeOut%YR + timeinterval%YR
+ CALL normalize_time( timeOut )
+END SUBROUTINE c_esmc_basetimesum
+
+
+!$$$ this should be named "c_esmc_timedec" or something less misleading
+SUBROUTINE c_esmc_basetimedec( time1, timeinterval, timeOut )
+ USE esmf_basemod
+ USE esmf_basetimemod
+ USE esmf_timeintervalmod
+ USE esmf_timemod
+ IMPLICIT NONE
+ TYPE(ESMF_Time), INTENT(IN) :: time1
+ TYPE(ESMF_TimeInterval), INTENT(IN) :: timeinterval
+ TYPE(ESMF_Time), INTENT(OUT) :: timeOut
+ ! locals
+ TYPE (ESMF_TimeInterval) :: neginterval
+ neginterval = timeinterval
+!$$$push this down into a unary negation operator on TimeInterval
+ neginterval%basetime%S = -neginterval%basetime%S
+ neginterval%basetime%Sn = -neginterval%basetime%Sn
+ neginterval%YR = -neginterval%YR
+#if 0
+!jm month has no meaning for an interval; removed 20100319
+#ifndef PLANET
+ neginterval%MM = -neginterval%MM
+#endif
+#endif
+ timeOut = time1 + neginterval
+END SUBROUTINE c_esmc_basetimedec
+
+
+!$$$ this should be named "c_esmc_timediff" or something less misleading
+SUBROUTINE c_esmc_basetimediff( time1, time2, timeIntOut )
+ USE esmf_basemod
+ USE esmf_basetimemod
+ USE esmf_timeintervalmod
+ USE esmf_timemod
+ IMPLICIT NONE
+ TYPE(ESMF_Time), INTENT(IN) :: time1
+ TYPE(ESMF_Time), INTENT(IN) :: time2
+ TYPE(ESMF_TimeInterval), INTENT(OUT) :: timeIntOut
+ ! locals
+ INTEGER(ESMF_KIND_I8) :: nsecondsinyear
+ INTEGER :: yr
+ CALL ESMF_TimeIntervalSet( timeIntOut )
+ timeIntOut%basetime = time1%basetime - time2%basetime
+ ! convert difference in years to basetime...
+ IF ( time1%YR > time2%YR ) THEN
+ DO yr = time2%YR, ( time1%YR - 1 )
+ timeIntOut%basetime%S = timeIntOut%basetime%S + nsecondsinyear( yr )
+ ENDDO
+ ELSE IF ( time2%YR > time1%YR ) THEN
+ DO yr = time1%YR, ( time2%YR - 1 )
+ timeIntOut%basetime%S = timeIntOut%basetime%S - nsecondsinyear( yr )
+ ENDDO
+ ENDIF
+!$$$ add tests for multi-year differences
+ CALL normalize_timeint( timeIntOut )
+END SUBROUTINE c_esmc_basetimediff
+
+
+! some extra wrf stuff
+
+
+! Convert fraction to string with leading sign.
+! If fraction simplifies to a whole number or if
+! denominator is zero, return empty string.
+! INTEGER*8 interface.
+SUBROUTINE fraction_to_stringi8( numerator, denominator, frac_str )
+ USE ESMF_basemod
+ IMPLICIT NONE
+ INTEGER(ESMF_KIND_I8), INTENT(IN) :: numerator
+ INTEGER(ESMF_KIND_I8), INTENT(IN) :: denominator
+ CHARACTER (LEN=*), INTENT(OUT) :: frac_str
+ IF ( denominator > 0 ) THEN
+ IF ( mod( numerator, denominator ) /= 0 ) THEN
+ IF ( numerator > 0 ) THEN
+ WRITE(frac_str,FMT="('+',I2.2,'/',I2.2)") abs(numerator), denominator
+ ELSE ! numerator < 0
+ WRITE(frac_str,FMT="('-',I2.2,'/',I2.2)") abs(numerator), denominator
+ ENDIF
+ ELSE ! includes numerator == 0 case
+ frac_str = ''
+ ENDIF
+ ELSE ! no-fraction case
+ frac_str = ''
+ ENDIF
+END SUBROUTINE fraction_to_stringi8
+
+
+! Convert fraction to string with leading sign.
+! If fraction simplifies to a whole number or if
+! denominator is zero, return empty string.
+! INTEGER interface.
+SUBROUTINE fraction_to_string( numerator, denominator, frac_str )
+ USE ESMF_basemod
+ IMPLICIT NONE
+ INTEGER, INTENT(IN) :: numerator
+ INTEGER, INTENT(IN) :: denominator
+ CHARACTER (LEN=*), INTENT(OUT) :: frac_str
+ ! locals
+ INTEGER(ESMF_KIND_I8) :: numerator_i8, denominator_i8
+ numerator_i8 = INT( numerator, ESMF_KIND_I8 )
+ denominator_i8 = INT( denominator, ESMF_KIND_I8 )
+ CALL fraction_to_stringi8( numerator_i8, denominator_i8, frac_str )
+END SUBROUTINE fraction_to_string
+
+
+SUBROUTINE print_a_time( time )
+ use ESMF_basemod
+ use ESMF_Timemod
+ IMPLICIT NONE
+ type(ESMF_Time) time
+ character*128 :: s
+ integer rc
+ CALL ESMF_TimeGet( time, timeString=s, rc=rc )
+ print *,'Print a time|',TRIM(s),'|'
+ return
+END SUBROUTINE print_a_time
+
+SUBROUTINE print_a_timeinterval( time )
+ use ESMF_basemod
+ use ESMF_TimeIntervalmod
+ IMPLICIT NONE
+ type(ESMF_TimeInterval) time
+ character*128 :: s
+ integer rc
+ CALL ESMFold_TimeIntervalGetString( time, s, rc )
+ print *,'Print a time interval|',TRIM(s),'|'
+ return
+END SUBROUTINE print_a_timeinterval
+
Deleted: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/Test1.F90
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/Test1.F90        2012-11-29 20:50:09 UTC (rev 2328)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/Test1.F90        2012-11-29 22:23:06 UTC (rev 2329)
@@ -1,1718 +0,0 @@
-!
-! Sub-system tests for MPAS_ESMF_time_f90
-!
-! Someday, switch over to funit!
-!
-
-MODULE my_tests
- USE MPAS_ESMF_Mod
- IMPLICIT NONE
-
- ! Set this to .TRUE. to make wrf_error_fatal3() print a message on failure
- ! instead of stopping the program. Use for testing only (since we cannot
- ! catch exceptions in Fortran90!!)
- LOGICAL :: WRF_ERROR_FATAL_PRINT = .FALSE.
-
-CONTAINS
-
- ! Test printing of an MPAS_ESMF_Time or MPAS_ESMF_TimeInterval object.
- !
- ! Correct results are also passed in through this interface and compared
- ! with computed results. PASS/FAIL messages are printed.
- !
- SUBROUTINE test_print( t_yy, t_mm, t_dd, t_h, t_m, t_s, t_sn, t_sd, &
- ti_yy, ti_mm, ti_dd, ti_h, ti_m, ti_s, ti_sn, ti_sd, &
- res_str, testname, expect_error )
- INTEGER, INTENT(IN), OPTIONAL :: t_YY
- INTEGER, INTENT(IN), OPTIONAL :: t_MM ! month
- INTEGER, INTENT(IN), OPTIONAL :: t_DD ! day of month
- INTEGER, INTENT(IN), OPTIONAL :: t_H
- INTEGER, INTENT(IN), OPTIONAL :: t_M
- INTEGER, INTENT(IN), OPTIONAL :: t_S
- INTEGER, INTENT(IN), OPTIONAL :: t_Sn
- INTEGER, INTENT(IN), OPTIONAL :: t_Sd
- INTEGER, INTENT(IN), OPTIONAL :: ti_YY
- INTEGER, INTENT(IN), OPTIONAL :: ti_MM ! month
- INTEGER, INTENT(IN), OPTIONAL :: ti_DD ! day of month
- INTEGER, INTENT(IN), OPTIONAL :: ti_H
- INTEGER, INTENT(IN), OPTIONAL :: ti_M
- INTEGER, INTENT(IN), OPTIONAL :: ti_S
- INTEGER, INTENT(IN), OPTIONAL :: ti_Sn
- INTEGER, INTENT(IN), OPTIONAL :: ti_Sd
- CHARACTER (LEN=*), INTENT(IN) :: res_str
- CHARACTER (LEN=*), INTENT(IN), OPTIONAL :: testname
- LOGICAL, OPTIONAL, INTENT(IN) :: expect_error
- ! locals
- INTEGER :: it_YY
- INTEGER :: it_MM ! month
- INTEGER :: it_DD ! day of month
- INTEGER :: it_H
- INTEGER :: it_M
- INTEGER :: it_S
- INTEGER :: it_Sn
- INTEGER :: it_Sd
- INTEGER :: iti_YY
- INTEGER :: iti_MM ! month
- INTEGER :: iti_DD ! day of month
- INTEGER :: iti_H
- INTEGER :: iti_M
- INTEGER :: iti_S
- INTEGER :: iti_Sn
- INTEGER :: iti_Sd
- LOGICAL :: is_t
- LOGICAL :: is_ti
- CHARACTER (LEN=512) :: itestname
- LOGICAL :: iexpect_error
- INTEGER rc
- TYPE(MPAS_ESMF_Time) :: t
- TYPE(MPAS_ESMF_TimeInterval) :: ti
- CHARACTER(LEN=MPAS_ESMF_MAXSTR) :: str, computed_str, frac_str
- CHARACTER(LEN=17) :: type_str
- INTEGER :: res_len, computed_len, Sn, Sd
- LOGICAL :: test_passed
-
-! PRINT *,'DEBUG: BEGIN test_print()'
- it_YY = 0
- it_MM = 1
- it_DD = 1
- it_H = 0
- it_M = 0
- it_S = 0
- it_Sn = 0
- it_Sd = 0
- iti_YY = 0
- iti_MM = 0
- iti_DD = 0
- iti_H = 0
- iti_M = 0
- iti_S = 0
- iti_Sn = 0
- iti_Sd = 0
- itestname = ''
- iexpect_error = .FALSE.
-
- IF ( PRESENT( t_YY ) ) it_YY = t_YY
- IF ( PRESENT( t_MM ) ) it_MM = t_MM
- IF ( PRESENT( t_DD ) ) it_DD = t_DD
- IF ( PRESENT( t_H ) ) it_H = t_H
- IF ( PRESENT( t_M ) ) it_M = t_M
- IF ( PRESENT( t_S ) ) it_S = t_S
- IF ( PRESENT( t_Sn ) ) it_Sn = t_Sn
- IF ( PRESENT( t_Sd ) ) it_Sd = t_Sd
- IF ( PRESENT( ti_YY ) ) iti_YY = ti_YY
- IF ( PRESENT( ti_MM ) ) iti_MM = ti_MM
- IF ( PRESENT( ti_DD ) ) iti_DD = ti_DD
- IF ( PRESENT( ti_H ) ) iti_H = ti_H
- IF ( PRESENT( ti_M ) ) iti_M = ti_M
- IF ( PRESENT( ti_S ) ) iti_S = ti_S
- IF ( PRESENT( ti_Sn ) ) iti_Sn = ti_Sn
- IF ( PRESENT( ti_Sd ) ) iti_Sd = ti_Sd
- IF ( PRESENT( testname ) ) itestname = TRIM(testname)
- IF ( PRESENT( expect_error ) ) iexpect_error = expect_error
-
- ! Ensure that optional arguments are consistent...
- is_t = ( PRESENT( t_YY ) .OR. PRESENT( t_MM ) .OR. &
- PRESENT( t_DD ) .OR. PRESENT( t_H ) .OR. &
- PRESENT( t_M ) .OR. PRESENT( t_S ) .OR. &
- PRESENT( t_Sn ) .OR. PRESENT( t_Sd ) )
- is_ti = ( PRESENT( ti_YY ) .OR. PRESENT( ti_MM ) .OR. &
- PRESENT( ti_DD ) .OR. PRESENT( ti_H ) .OR. &
- PRESENT( ti_M ) .OR. PRESENT( ti_S ) .OR. &
- PRESENT( ti_Sn ) .OR. PRESENT( ti_Sd ) )
- IF ( is_t .EQV. is_ti ) THEN
- CALL wrf_error_fatal3( __FILE__ , __LINE__ , &
- 'ERROR test_print: inconsistent args' )
- ENDIF
-
-!PRINT *,'DEBUG: test_print(): init objects'
- ! Initialize object to be tested
- ! modify behavior of wrf_error_fatal3 for tests expected to fail
- IF ( iexpect_error ) WRF_ERROR_FATAL_PRINT = .TRUE.
- Sn = 0
- Sd = 0
- IF ( is_t ) THEN
- type_str = 'MPAS_ESMF_Time'
-!PRINT *,'DEBUG: test_print(): calling MPAS_ESMF_TimeSet()'
-!PRINT *,'DEBUG: test_print(): YY,MM,DD,H,M,S,Sn,Sd = ', it_YY,it_MM,it_DD,it_H,it_M,it_S,it_Sn,it_Sd
- CALL MPAS_ESMF_TimeSet( t, YY=it_YY, MM=it_MM, DD=it_DD , &
- H=it_H, M=it_M, S=it_S, Sn=it_Sn, Sd=it_Sd, rc=rc )
-!PRINT *,'DEBUG: test_print(): back from MPAS_ESMF_TimeSet()'
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestname)//'MPAS_ESMF_TimeSet() ', &
- __FILE__ , &
- __LINE__ )
-!PRINT *,'DEBUG: test_print(): calling MPAS_ESMF_TimeGet()'
- CALL MPAS_ESMF_TimeGet( t, timeString=computed_str, Sn=Sn, Sd=Sd, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestname)//'MPAS_ESMF_TimeGet() ', &
- __FILE__ , &
- __LINE__ )
-!PRINT *,'DEBUG: test_print(): back from MPAS_ESMF_TimeGet(), computed_str = ',TRIM(computed_str)
- ELSE
- type_str = 'MPAS_ESMF_TimeInterval'
-!PRINT *,'DEBUG: test_print(): calling MPAS_ESMF_TimeIntervalSet()'
- CALL MPAS_ESMF_TimeIntervalSet( ti, YY=iti_YY, MM=iti_MM, &
- D=iti_DD , &
- H=iti_H, M=iti_M, &
- S=iti_S, Sn=iti_Sn, Sd=iti_Sd, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestname)//'MPAS_ESMF_TimeIntervalSet() ', &
- __FILE__ , &
- __LINE__ )
-!PRINT *,'DEBUG: test_print(): calling MPAS_ESMF_TimeIntervalGet()'
- CALL MPAS_ESMF_TimeIntervalGet( ti, timeString=computed_str, Sn=Sn, Sd=Sd, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestname)//'MPAS_ESMF_TimeGet() ', &
- __FILE__ , &
- __LINE__ )
- ENDIF
- ! handle fractions
- IF ( Sd > 0 ) THEN
- IF ( Sn > 0 ) THEN
- WRITE(frac_str,FMT="('+',I2.2,'/',I2.2)") abs(Sn), Sd
- ELSE IF ( Sn < 0 ) THEN
- WRITE(frac_str,FMT="('-',I2.2,'/',I2.2)") abs(Sn), Sd
- ELSE
- frac_str = ''
- ENDIF
- computed_str = TRIM(computed_str)//TRIM(frac_str)
- ENDIF
- ! restore default behavior of wrf_error_fatal3
- IF ( iexpect_error ) WRF_ERROR_FATAL_PRINT = .FALSE.
-!PRINT *,'DEBUG: test_print(): done init objects'
-
-!PRINT *,'DEBUG: test_print(): check result'
- ! check result
- test_passed = .FALSE.
- res_len = LEN_TRIM(res_str)
- computed_len = LEN_TRIM(computed_str)
- IF ( res_len == computed_len ) THEN
- IF ( computed_str(1:computed_len) == res_str(1:res_len) ) THEN
- test_passed = .TRUE.
- ENDIF
- ENDIF
- IF ( test_passed ) THEN
- WRITE(*,FMT='(A)') 'PASS: '//TRIM(itestname)
- ELSE
- WRITE(*,'(9A)') 'FAIL: ',TRIM(itestname),': printing ',TRIM(type_str), &
- ' expected <', TRIM(res_str),'> but computed <',TRIM(computed_str),'>'
- ENDIF
-!PRINT *,'DEBUG: END test_print()'
-
- END SUBROUTINE test_print
-
-
-
- ! Test the following arithmetic operations on MPAS_ESMF_Time and
- ! MPAS_ESMF_TimeInterval objects:
- ! MPAS_ESMF_Time = MPAS_ESMF_Time + MPAS_ESMF_TimeInterval
- ! MPAS_ESMF_Time = MPAS_ESMF_TimeInterval + MPAS_ESMF_Time
- ! MPAS_ESMF_Time = MPAS_ESMF_Time - MPAS_ESMF_TimeInterval
- ! MPAS_ESMF_TimeInterval = MPAS_ESMF_Time - MPAS_ESMF_Time
- ! MPAS_ESMF_TimeInterval = MPAS_ESMF_TimeInterval + MPAS_ESMF_TimeInterval
- ! MPAS_ESMF_TimeInterval = MPAS_ESMF_TimeInterval - MPAS_ESMF_TimeInterval
- ! MPAS_ESMF_TimeInterval = MPAS_ESMF_TimeInterval * INTEGER
- ! MPAS_ESMF_TimeInterval = MPAS_ESMF_TimeInterval / INTEGER
- !
- ! Correct results are also passed in through this interface and compared
- ! with computed results. PASS/FAIL messages are printed.
- !
- ! Operations are expressed as res = op1 +|- op2
- !
- SUBROUTINE test_arithmetic( add_op, multiply_op, &
- op1_t_yy, op1_t_mm, op1_t_dd, op1_t_h, op1_t_m, op1_t_s, op1_t_sn, op1_t_sd, &
- op1_ti_yy, op1_ti_mm, op1_ti_dd, op1_ti_h, op1_ti_m, op1_ti_s, op1_ti_sn, op1_ti_sd, &
- op2_t_yy, op2_t_mm, op2_t_dd, op2_t_h, op2_t_m, op2_t_s, op2_t_sn, op2_t_sd, &
- op2_ti_yy, op2_ti_mm, op2_ti_dd, op2_ti_h, op2_ti_m, op2_ti_s, op2_ti_sn, op2_ti_sd, &
- op2_int, &
- res_t_yy, res_t_mm, res_t_dd, res_t_h, res_t_m, res_t_s, res_t_sn, res_t_sd, &
- res_ti_yy, res_ti_mm, res_ti_dd, res_ti_h, res_ti_m, res_ti_s, res_ti_sn, res_ti_sd, &
- res_int, testname, expect_error )
- LOGICAL, INTENT(IN), OPTIONAL :: add_op ! .TRUE.=add, .FALSE.=subtract
- LOGICAL, INTENT(IN), OPTIONAL :: multiply_op ! .TRUE.=multiply, .FALSE.=divide
- INTEGER, INTENT(IN), OPTIONAL :: op1_t_YY
- INTEGER, INTENT(IN), OPTIONAL :: op1_t_MM ! month
- INTEGER, INTENT(IN), OPTIONAL :: op1_t_DD ! day of month
- INTEGER, INTENT(IN), OPTIONAL :: op1_t_H
- INTEGER, INTENT(IN), OPTIONAL :: op1_t_M
- INTEGER, INTENT(IN), OPTIONAL :: op1_t_S
- INTEGER, INTENT(IN), OPTIONAL :: op1_t_Sn
- INTEGER, INTENT(IN), OPTIONAL :: op1_t_Sd
- INTEGER, INTENT(IN), OPTIONAL :: op1_ti_YY
- INTEGER, INTENT(IN), OPTIONAL :: op1_ti_MM ! month
- INTEGER, INTENT(IN), OPTIONAL :: op1_ti_DD ! day of month
- INTEGER, INTENT(IN), OPTIONAL :: op1_ti_H
- INTEGER, INTENT(IN), OPTIONAL :: op1_ti_M
- INTEGER, INTENT(IN), OPTIONAL :: op1_ti_S
- INTEGER, INTENT(IN), OPTIONAL :: op1_ti_Sn
- INTEGER, INTENT(IN), OPTIONAL :: op1_ti_Sd
- INTEGER, INTENT(IN), OPTIONAL :: op2_t_YY
- INTEGER, INTENT(IN), OPTIONAL :: op2_t_MM ! month
- INTEGER, INTENT(IN), OPTIONAL :: op2_t_DD ! day of month
- INTEGER, INTENT(IN), OPTIONAL :: op2_t_H
- INTEGER, INTENT(IN), OPTIONAL :: op2_t_M
- INTEGER, INTENT(IN), OPTIONAL :: op2_t_S
- INTEGER, INTENT(IN), OPTIONAL :: op2_t_Sn
- INTEGER, INTENT(IN), OPTIONAL :: op2_t_Sd
- INTEGER, INTENT(IN), OPTIONAL :: op2_ti_YY
- INTEGER, INTENT(IN), OPTIONAL :: op2_ti_MM ! month
- INTEGER, INTENT(IN), OPTIONAL :: op2_ti_DD ! day of month
- INTEGER, INTENT(IN), OPTIONAL :: op2_ti_H
- INTEGER, INTENT(IN), OPTIONAL :: op2_ti_M
- INTEGER, INTENT(IN), OPTIONAL :: op2_ti_S
- INTEGER, INTENT(IN), OPTIONAL :: op2_ti_Sn
- INTEGER, INTENT(IN), OPTIONAL :: op2_ti_Sd
- INTEGER, INTENT(IN), OPTIONAL :: op2_int
- INTEGER, INTENT(IN), OPTIONAL :: res_t_YY
- INTEGER, INTENT(IN), OPTIONAL :: res_t_MM ! month
- INTEGER, INTENT(IN), OPTIONAL :: res_t_DD ! day of month
- INTEGER, INTENT(IN), OPTIONAL :: res_t_H
- INTEGER, INTENT(IN), OPTIONAL :: res_t_M
- INTEGER, INTENT(IN), OPTIONAL :: res_t_S
- INTEGER, INTENT(IN), OPTIONAL :: res_t_Sn
- INTEGER, INTENT(IN), OPTIONAL :: res_t_Sd
- INTEGER, INTENT(IN), OPTIONAL :: res_ti_YY
- INTEGER, INTENT(IN), OPTIONAL :: res_ti_MM ! month
- INTEGER, INTENT(IN), OPTIONAL :: res_ti_DD ! day of month
- INTEGER, INTENT(IN), OPTIONAL :: res_ti_H
- INTEGER, INTENT(IN), OPTIONAL :: res_ti_M
- INTEGER, INTENT(IN), OPTIONAL :: res_ti_S
- INTEGER, INTENT(IN), OPTIONAL :: res_ti_Sn
- INTEGER, INTENT(IN), OPTIONAL :: res_ti_Sd
- INTEGER, INTENT(IN), OPTIONAL :: res_int
- CHARACTER (LEN=*), OPTIONAL, INTENT(IN) :: testname
- LOGICAL, OPTIONAL, INTENT(IN) :: expect_error
- ! locals
- LOGICAL :: iadd_op
- LOGICAL :: isubtract_op
- LOGICAL :: imultiply_op
- LOGICAL :: idivide_op
- INTEGER :: iop1_t_YY
- INTEGER :: iop1_t_MM ! month
- INTEGER :: iop1_t_DD ! day of month
- INTEGER :: iop1_t_H
- INTEGER :: iop1_t_M
- INTEGER :: iop1_t_S
- INTEGER :: iop1_t_Sn
- INTEGER :: iop1_t_Sd
- INTEGER :: iop1_ti_YY
- INTEGER :: iop1_ti_MM ! month
- INTEGER :: iop1_ti_DD ! day of month
- INTEGER :: iop1_ti_H
- INTEGER :: iop1_ti_M
- INTEGER :: iop1_ti_S
- INTEGER :: iop1_ti_Sn
- INTEGER :: iop1_ti_Sd
- INTEGER :: iop2_t_YY
- INTEGER :: iop2_t_MM ! month
- INTEGER :: iop2_t_DD ! day of month
- INTEGER :: iop2_t_H
- INTEGER :: iop2_t_M
- INTEGER :: iop2_t_S
- INTEGER :: iop2_t_Sn
- INTEGER :: iop2_t_Sd
- INTEGER :: iop2_ti_YY
- INTEGER :: iop2_ti_MM ! month
- INTEGER :: iop2_ti_DD ! day of month
- INTEGER :: iop2_ti_H
- INTEGER :: iop2_ti_M
- INTEGER :: iop2_ti_S
- INTEGER :: iop2_ti_Sn
- INTEGER :: iop2_ti_Sd
- INTEGER :: ires_t_YY
- INTEGER :: ires_t_MM ! month
- INTEGER :: ires_t_DD ! day of month
- INTEGER :: ires_t_H
- INTEGER :: ires_t_M
- INTEGER :: ires_t_S
- INTEGER :: ires_t_Sn
- INTEGER :: ires_t_Sd
- INTEGER :: ires_ti_YY
- INTEGER :: ires_ti_MM ! month
- INTEGER :: ires_ti_DD ! day of month
- INTEGER :: ires_ti_H
- INTEGER :: ires_ti_M
- INTEGER :: ires_ti_S
- INTEGER :: ires_ti_Sn
- INTEGER :: ires_ti_Sd
- LOGICAL :: op1_is_t , op2_is_t , res_is_t
- LOGICAL :: op1_is_ti, op2_is_ti, res_is_ti, op2_is_int
- LOGICAL :: res_is_int
- INTEGER :: num_ops, num_op1, num_op2, num_res
- LOGICAL :: unsupported_op, test_passed
- CHARACTER (LEN=512) :: itestname
- LOGICAL :: iexpect_error
- INTEGER :: rc
- INTEGER :: computed_int, Sn, Sd
- TYPE(MPAS_ESMF_Time) :: op1_t , op2_t , res_t, computed_t
- TYPE(MPAS_ESMF_TimeInterval) :: op1_ti, op2_ti, res_ti, computed_ti
- CHARACTER(LEN=MPAS_ESMF_MAXSTR) :: str, op1_str, op2_str, res_str, computed_str, frac_str
- CHARACTER(LEN=1) :: op_str
- CHARACTER(LEN=17) :: op1_type_str, op2_type_str, res_type_str
-
- iadd_op = .FALSE.
- isubtract_op = .FALSE.
- imultiply_op = .FALSE.
- idivide_op = .FALSE.
- iop1_t_YY = 0
- iop1_t_MM = 1
- iop1_t_DD = 1
- iop1_t_H = 0
- iop1_t_M = 0
- iop1_t_S = 0
- iop1_t_Sn = 0
- iop1_t_Sd = 0
- iop1_ti_YY = 0
- iop1_ti_MM = 0
- iop1_ti_DD = 0
- iop1_ti_H = 0
- iop1_ti_M = 0
- iop1_ti_S = 0
- iop1_ti_Sn = 0
- iop1_ti_Sd = 0
- iop2_t_YY = 0
- iop2_t_MM = 1
- iop2_t_DD = 1
- iop2_t_H = 0
- iop2_t_M = 0
- iop2_t_S = 0
- iop2_t_Sn = 0
- iop2_t_Sd = 0
- iop2_ti_YY = 0
- iop2_ti_MM = 0
- iop2_ti_DD = 0
- iop2_ti_H = 0
- iop2_ti_M = 0
- iop2_ti_S = 0
- iop2_ti_Sn = 0
- iop2_ti_Sd = 0
- ires_t_YY = 0
- ires_t_MM = 1
- ires_t_DD = 1
- ires_t_H = 0
- ires_t_M = 0
- ires_t_S = 0
- ires_t_Sn = 0
- ires_t_Sd = 0
- ires_ti_YY = 0
- ires_ti_MM = 0
- ires_ti_DD = 0
- ires_ti_H = 0
- ires_ti_M = 0
- ires_ti_S = 0
- ires_ti_Sn = 0
- ires_ti_Sd = 0
- itestname = ''
- iexpect_error = .FALSE.
-
- IF ( PRESENT( add_op ) ) THEN
- iadd_op = add_op
- isubtract_op = ( .NOT. add_op )
- ENDIF
- IF ( PRESENT( multiply_op ) ) THEN
- imultiply_op = multiply_op
- idivide_op = ( .NOT. multiply_op )
- ENDIF
- num_ops = 0
- IF ( iadd_op ) num_ops = num_ops + 1
- IF ( isubtract_op ) num_ops = num_ops + 1
- IF ( imultiply_op ) num_ops = num_ops + 1
- IF ( idivide_op ) num_ops = num_ops + 1
- IF ( num_ops /= 1 ) THEN
- CALL wrf_error_fatal3( __FILE__ , __LINE__ , &
- 'ERROR test_arithmetic: inconsistent operation' )
- ENDIF
- IF ( PRESENT( op1_t_YY ) ) iop1_t_YY = op1_t_YY
- IF ( PRESENT( op1_t_MM ) ) iop1_t_MM = op1_t_MM
- IF ( PRESENT( op1_t_DD ) ) iop1_t_DD = op1_t_DD
- IF ( PRESENT( op1_t_H ) ) iop1_t_H = op1_t_H
- IF ( PRESENT( op1_t_M ) ) iop1_t_M = op1_t_M
- IF ( PRESENT( op1_t_S ) ) iop1_t_S = op1_t_S
- IF ( PRESENT( op1_t_Sn ) ) iop1_t_Sn = op1_t_Sn
- IF ( PRESENT( op1_t_Sd ) ) iop1_t_Sd = op1_t_Sd
- IF ( PRESENT( op1_ti_YY ) ) iop1_ti_YY = op1_ti_YY
- IF ( PRESENT( op1_ti_MM ) ) iop1_ti_MM = op1_ti_MM
- IF ( PRESENT( op1_ti_DD ) ) iop1_ti_DD = op1_ti_DD
- IF ( PRESENT( op1_ti_H ) ) iop1_ti_H = op1_ti_H
- IF ( PRESENT( op1_ti_M ) ) iop1_ti_M = op1_ti_M
- IF ( PRESENT( op1_ti_S ) ) iop1_ti_S = op1_ti_S
- IF ( PRESENT( op1_ti_Sn ) ) iop1_ti_Sn = op1_ti_Sn
- IF ( PRESENT( op1_ti_Sd ) ) iop1_ti_Sd = op1_ti_Sd
- IF ( PRESENT( op2_t_YY ) ) iop2_t_YY = op2_t_YY
- IF ( PRESENT( op2_t_MM ) ) iop2_t_MM = op2_t_MM
- IF ( PRESENT( op2_t_DD ) ) iop2_t_DD = op2_t_DD
- IF ( PRESENT( op2_t_H ) ) iop2_t_H = op2_t_H
- IF ( PRESENT( op2_t_M ) ) iop2_t_M = op2_t_M
- IF ( PRESENT( op2_t_S ) ) iop2_t_S = op2_t_S
- IF ( PRESENT( op2_t_Sn ) ) iop2_t_Sn = op2_t_Sn
- IF ( PRESENT( op2_t_Sd ) ) iop2_t_Sd = op2_t_Sd
- IF ( PRESENT( op2_ti_YY ) ) iop2_ti_YY = op2_ti_YY
- IF ( PRESENT( op2_ti_MM ) ) iop2_ti_MM = op2_ti_MM
- IF ( PRESENT( op2_ti_DD ) ) iop2_ti_DD = op2_ti_DD
- IF ( PRESENT( op2_ti_H ) ) iop2_ti_H = op2_ti_H
- IF ( PRESENT( op2_ti_M ) ) iop2_ti_M = op2_ti_M
- IF ( PRESENT( op2_ti_S ) ) iop2_ti_S = op2_ti_S
- IF ( PRESENT( op2_ti_Sn ) ) iop2_ti_Sn = op2_ti_Sn
- IF ( PRESENT( op2_ti_Sd ) ) iop2_ti_Sd = op2_ti_Sd
- IF ( PRESENT( res_t_YY ) ) ires_t_YY = res_t_YY
- IF ( PRESENT( res_t_MM ) ) ires_t_MM = res_t_MM
- IF ( PRESENT( res_t_DD ) ) ires_t_DD = res_t_DD
- IF ( PRESENT( res_t_H ) ) ires_t_H = res_t_H
- IF ( PRESENT( res_t_M ) ) ires_t_M = res_t_M
- IF ( PRESENT( res_t_S ) ) ires_t_S = res_t_S
- IF ( PRESENT( res_t_Sn ) ) ires_t_Sn = res_t_Sn
- IF ( PRESENT( res_t_Sd ) ) ires_t_Sd = res_t_Sd
- IF ( PRESENT( res_ti_YY ) ) ires_ti_YY = res_ti_YY
- IF ( PRESENT( res_ti_MM ) ) ires_ti_MM = res_ti_MM
- IF ( PRESENT( res_ti_DD ) ) ires_ti_DD = res_ti_DD
- IF ( PRESENT( res_ti_H ) ) ires_ti_H = res_ti_H
- IF ( PRESENT( res_ti_M ) ) ires_ti_M = res_ti_M
- IF ( PRESENT( res_ti_S ) ) ires_ti_S = res_ti_S
- IF ( PRESENT( res_ti_Sn ) ) ires_ti_Sn = res_ti_Sn
- IF ( PRESENT( res_ti_Sd ) ) ires_ti_Sd = res_ti_Sd
- IF ( PRESENT( testname ) ) itestname = TRIM(testname)
- IF ( PRESENT( expect_error ) ) iexpect_error = expect_error
-
- ! Ensure that optional arguments are consistent...
- op1_is_t = ( PRESENT( op1_t_YY ) .OR. PRESENT( op1_t_MM ) .OR. &
- PRESENT( op1_t_DD ) .OR. PRESENT( op1_t_H ) .OR. &
- PRESENT( op1_t_M ) .OR. PRESENT( op1_t_S ) .OR. &
- PRESENT( op1_t_Sn ) .OR. PRESENT( op1_t_Sd ) )
- op1_is_ti = ( PRESENT( op1_ti_YY ) .OR. PRESENT( op1_ti_MM ) .OR. &
- PRESENT( op1_ti_DD ) .OR. PRESENT( op1_ti_H ) .OR. &
- PRESENT( op1_ti_M ) .OR. PRESENT( op1_ti_S ) .OR. &
- PRESENT( op1_ti_Sn ) .OR. PRESENT( op1_ti_Sd ) )
- op2_is_t = ( PRESENT( op2_t_YY ) .OR. PRESENT( op2_t_MM ) .OR. &
- PRESENT( op2_t_DD ) .OR. PRESENT( op2_t_H ) .OR. &
- PRESENT( op2_t_M ) .OR. PRESENT( op2_t_S ) .OR. &
- PRESENT( op2_t_Sn ) .OR. PRESENT( op2_t_Sd ) )
- op2_is_ti = ( PRESENT( op2_ti_YY ) .OR. PRESENT( op2_ti_MM ) .OR. &
- PRESENT( op2_ti_DD ) .OR. PRESENT( op2_ti_H ) .OR. &
- PRESENT( op2_ti_M ) .OR. PRESENT( op2_ti_S ) .OR. &
- PRESENT( op2_ti_Sn ) .OR. PRESENT( op2_ti_Sd ) )
- op2_is_int = ( PRESENT( op2_int ) )
- res_is_t = ( PRESENT( res_t_YY ) .OR. PRESENT( res_t_MM ) .OR. &
- PRESENT( res_t_DD ) .OR. PRESENT( res_t_H ) .OR. &
- PRESENT( res_t_M ) .OR. PRESENT( res_t_S ) .OR. &
- PRESENT( res_t_Sn ) .OR. PRESENT( res_t_Sd ) )
- res_is_ti = ( PRESENT( res_ti_YY ) .OR. PRESENT( res_ti_MM ) .OR. &
- PRESENT( res_ti_DD ) .OR. PRESENT( res_ti_H ) .OR. &
- PRESENT( res_ti_M ) .OR. PRESENT( res_ti_S ) .OR. &
- PRESENT( res_ti_Sn ) .OR. PRESENT( res_ti_Sd ) )
- res_is_int = ( PRESENT( res_int ) )
- num_op1 = 0
- IF ( op1_is_t ) num_op1 = num_op1 + 1
- IF ( op1_is_ti ) num_op1 = num_op1 + 1
- IF ( num_op1 /= 1 ) THEN
- CALL wrf_error_fatal3( __FILE__ , __LINE__ , &
- 'ERROR test_arithmetic: inconsistent args for op1' )
- ENDIF
- num_op2 = 0
- IF ( op2_is_t ) num_op2 = num_op2 + 1
- IF ( op2_is_ti ) num_op2 = num_op2 + 1
- IF ( op2_is_int ) num_op2 = num_op2 + 1
- IF ( num_op2 /= 1 ) THEN
- CALL wrf_error_fatal3( __FILE__ , __LINE__ , &
- 'ERROR test_arithmetic: inconsistent args for op2' )
- ENDIF
- num_res = 0
- IF ( res_is_t ) num_res = num_res + 1
- IF ( res_is_ti ) num_res = num_res + 1
- IF ( res_is_int ) num_res = num_res + 1
- IF ( num_res /= 1 ) THEN
- CALL wrf_error_fatal3( __FILE__ , __LINE__ , &
- 'ERROR test_arithmetic: inconsistent args for result' )
- ENDIF
-
- ! Initialize op1
- IF ( op1_is_t ) THEN
- op1_type_str = 'MPAS_ESMF_Time'
- CALL MPAS_ESMF_TimeSet( op1_t, YY=iop1_t_YY, MM=iop1_t_MM, DD=iop1_t_DD , &
- H=iop1_t_H, M=iop1_t_M, S=iop1_t_S, Sn=iop1_t_Sn, Sd=iop1_t_Sd, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestname)//'MPAS_ESMF_TimeSet() ', &
- __FILE__ , &
- __LINE__ )
- CALL MPAS_ESMF_TimeGet( op1_t, timeString=op1_str, Sn=Sn, Sd=Sd, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestname)//'MPAS_ESMF_TimeGet() ', &
- __FILE__ , &
- __LINE__ )
- ! handle fractions
- CALL fraction_to_string( Sn, Sd, frac_str )
- op1_str = TRIM(op1_str)//TRIM(frac_str)
- ELSE
- op1_type_str = 'MPAS_ESMF_TimeInterval'
- CALL MPAS_ESMF_TimeIntervalSet( op1_ti, YY=iop1_ti_YY, MM=iop1_ti_MM, &
- D=iop1_ti_DD , &
- H=iop1_ti_H, M=iop1_ti_M, &
- S=iop1_ti_S, Sn=iop1_ti_Sn, Sd=iop1_ti_Sd, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestname)//'MPAS_ESMF_TimeIntervalSet() ', &
- __FILE__ , &
- __LINE__ )
- CALL MPAS_ESMF_TimeIntervalGet( op1_ti, timeString=op1_str, Sn=Sn, Sd=Sd, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestname)//'MPAS_ESMF_TimeGet() ', &
- __FILE__ , &
- __LINE__ )
- ! handle fractions
- CALL fraction_to_string( Sn, Sd, frac_str )
- op1_str = TRIM(op1_str)//TRIM(frac_str)
- ENDIF
- ! Initialize op2
- IF ( op2_is_t ) THEN
- op2_type_str = 'MPAS_ESMF_Time'
- CALL MPAS_ESMF_TimeSet( op2_t, YY=iop2_t_YY, MM=iop2_t_MM, DD=iop2_t_DD , &
- H=iop2_t_H, M=iop2_t_M, S=iop2_t_S, Sn=iop2_t_Sn, Sd=iop2_t_Sd, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestname)//'MPAS_ESMF_TimeSet() ', &
- __FILE__ , &
- __LINE__ )
- CALL MPAS_ESMF_TimeGet( op2_t, timeString=op2_str, Sn=Sn, Sd=Sd, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestname)//'MPAS_ESMF_TimeGet() ', &
- __FILE__ , &
- __LINE__ )
- ! handle fractions
- CALL fraction_to_string( Sn, Sd, frac_str )
- op2_str = TRIM(op2_str)//TRIM(frac_str)
- ELSE IF ( op2_is_ti ) THEN
- op2_type_str = 'MPAS_ESMF_TimeInterval'
- CALL MPAS_ESMF_TimeIntervalSet( op2_ti, YY=iop2_ti_YY, MM=iop2_ti_MM, &
- D=iop2_ti_DD , &
- H=iop2_ti_H, M=iop2_ti_M, &
- S=iop2_ti_S, Sn=iop2_ti_Sn, Sd=iop2_ti_Sd, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestname)//'MPAS_ESMF_TimeIntervalSet() ', &
- __FILE__ , &
- __LINE__ )
- CALL MPAS_ESMF_TimeIntervalGet( op2_ti, timeString=op2_str, Sn=Sn, Sd=Sd, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestname)//'MPAS_ESMF_TimeGet() ', &
- __FILE__ , &
- __LINE__ )
- ! handle fractions
- CALL fraction_to_string( Sn, Sd, frac_str )
- op2_str = TRIM(op2_str)//TRIM(frac_str)
- ELSE
- op2_type_str = 'INTEGER'
- IF ( op2_int > 0 ) THEN
- WRITE(op2_str,FMT="('+',I8.8)") ABS(op2_int)
- ELSE
- WRITE(op2_str,FMT="('-',I8.8)") ABS(op2_int)
- ENDIF
- ENDIF
- ! Initialize res
- IF ( res_is_t ) THEN ! result is MPAS_ESMF_Time
- res_type_str = 'MPAS_ESMF_Time'
- CALL MPAS_ESMF_TimeSet( res_t, YY=ires_t_YY, MM=ires_t_MM, DD=ires_t_DD , &
- H=ires_t_H, M=ires_t_M, S=ires_t_S, Sn=ires_t_Sn, Sd=ires_t_Sd, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestname)//'MPAS_ESMF_TimeSet() ', &
- __FILE__ , &
- __LINE__ )
- CALL MPAS_ESMF_TimeGet( res_t, timeString=res_str, Sn=Sn, Sd=Sd, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestname)//'MPAS_ESMF_TimeGet() ', &
- __FILE__ , &
- __LINE__ )
- ! handle fractions
- CALL fraction_to_string( Sn, Sd, frac_str )
- res_str = TRIM(res_str)//TRIM(frac_str)
- ELSE IF ( res_is_ti ) THEN ! result is MPAS_ESMF_TimeInterval
- res_type_str = 'MPAS_ESMF_TimeInterval'
- CALL MPAS_ESMF_TimeIntervalSet( res_ti, YY=ires_ti_YY, MM=ires_ti_MM, &
- D=ires_ti_DD , &
- H=ires_ti_H, M=ires_ti_M, &
- S=ires_ti_S, Sn=ires_ti_Sn, Sd=ires_ti_Sd, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestname)//'MPAS_ESMF_TimeIntervalSet() ', &
- __FILE__ , &
- __LINE__ )
- CALL MPAS_ESMF_TimeIntervalGet( res_ti, timeString=res_str, Sn=Sn, Sd=Sd, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestname)//'MPAS_ESMF_TimeGet() ', &
- __FILE__ , &
- __LINE__ )
- ! handle fractions
- CALL fraction_to_string( Sn, Sd, frac_str )
- res_str = TRIM(res_str)//TRIM(frac_str)
- ELSE ! result is INTEGER
- res_type_str = 'INTEGER'
- IF ( res_int > 0 ) THEN
- WRITE(res_str,FMT="('+',I8.8)") ABS(res_int)
- ELSE
- WRITE(res_str,FMT="('-',I8.8)") ABS(res_int)
- ENDIF
- ENDIF
-
- ! perform requested operation
- unsupported_op = .FALSE.
- ! modify behavior of wrf_error_fatal3 for operator being tested
- IF ( iexpect_error ) WRF_ERROR_FATAL_PRINT = .TRUE.
- ! add
- IF ( iadd_op ) THEN
- op_str = '+'
- IF ( res_is_t ) THEN ! result is MPAS_ESMF_Time
- IF ( op1_is_t .AND. op2_is_ti ) THEN
- ! MPAS_ESMF_Time = MPAS_ESMF_Time + MPAS_ESMF_TimeInterval
- computed_t = op1_t + op2_ti
- ELSE IF ( op1_is_ti .AND. op2_is_t ) THEN
- ! MPAS_ESMF_Time = MPAS_ESMF_TimeInterval + MPAS_ESMF_Time
- computed_t = op1_ti + op2_t
- ELSE
- unsupported_op = .TRUE.
- ENDIF
- ELSE ! result is MPAS_ESMF_TimeInterval
- IF ( op1_is_ti .AND. op2_is_ti ) THEN
- ! MPAS_ESMF_TimeInterval = MPAS_ESMF_TimeInterval + MPAS_ESMF_TimeInterval
- computed_ti = op1_ti + op2_ti
- ELSE
- unsupported_op = .TRUE.
- ENDIF
- ENDIF
- ! subtract
- ELSE IF ( isubtract_op ) THEN
- op_str = '-'
- IF ( res_is_t ) THEN ! result is MPAS_ESMF_Time
- IF ( op1_is_t .AND. op2_is_ti ) THEN
- ! MPAS_ESMF_Time = MPAS_ESMF_Time - MPAS_ESMF_TimeInterval
- computed_t = op1_t - op2_ti
- ELSE
- unsupported_op = .TRUE.
- ENDIF
- ELSE ! result is MPAS_ESMF_TimeInterval
- IF ( op1_is_t .AND. op2_is_t ) THEN
- ! MPAS_ESMF_TimeInterval = MPAS_ESMF_Time - MPAS_ESMF_Time
- computed_ti = op1_t - op2_t
- ELSE IF ( op1_is_ti .AND. op2_is_ti ) THEN
- ! MPAS_ESMF_TimeInterval = MPAS_ESMF_TimeInterval - MPAS_ESMF_TimeInterval
- computed_ti = op1_ti - op2_ti
- ELSE
- unsupported_op = .TRUE.
- ENDIF
- ENDIF
- ELSE IF ( imultiply_op ) THEN
- op_str = '*'
- IF ( res_is_ti ) THEN ! result is MPAS_ESMF_TimeInterval
- IF ( op1_is_ti .AND. op2_is_int ) THEN
- ! MPAS_ESMF_TimeInterval = MPAS_ESMF_TimeInterval * INTEGER
- computed_ti = op1_ti * op2_int
- ELSE
- unsupported_op = .TRUE.
- ENDIF
- ENDIF
- ELSE IF ( idivide_op ) THEN
- op_str = '/'
- IF ( res_is_ti ) THEN ! result is MPAS_ESMF_TimeInterval
- IF ( op1_is_ti .AND. op2_is_int ) THEN
- ! MPAS_ESMF_TimeInterval = MPAS_ESMF_TimeInterval / INTEGER
- computed_ti = op1_ti / op2_int
- ELSE
- unsupported_op = .TRUE.
- ENDIF
- ELSE IF ( res_is_int ) THEN ! result is INTEGER
- IF ( op1_is_ti .AND. op2_is_ti ) THEN
- ! INTEGER = MPAS_ESMF_TimeInterval / MPAS_ESMF_TimeInterval
- ! number of whole time intervals
- computed_int = MPAS_ESMF_TimeIntervalDIVQuot( op1_ti , op2_ti )
- ELSE
- unsupported_op = .TRUE.
- ENDIF
- ENDIF
- ENDIF
- ! restore default behavior of wrf_error_fatal3
- IF ( iexpect_error ) WRF_ERROR_FATAL_PRINT = .FALSE.
- IF ( unsupported_op ) THEN
- WRITE(str,*) 'ERROR test_arithmetic ',TRIM(itestname), &
- ': unsupported operation (', &
- TRIM(res_type_str),' = ',TRIM(op1_type_str),' ',TRIM(op_str),' ', &
- TRIM(op2_type_str),')'
- CALL wrf_error_fatal3( __FILE__ , __LINE__ , str )
- ENDIF
-
- ! check result
- test_passed = .FALSE.
- IF ( res_is_t ) THEN ! result is MPAS_ESMF_Time
- IF ( computed_t == res_t ) THEN
- test_passed = .TRUE.
- ELSE
- CALL MPAS_ESMF_TimeGet( computed_t, timeString=computed_str, Sn=Sn, Sd=Sd, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestname)//'MPAS_ESMF_TimeGet() ', &
- __FILE__ , &
- __LINE__ )
- ! handle fractions
- CALL fraction_to_string( Sn, Sd, frac_str )
- computed_str = TRIM(computed_str)//TRIM(frac_str)
- ENDIF
- ELSE IF ( res_is_ti ) THEN ! result is MPAS_ESMF_TimeInterval
- IF ( computed_ti == res_ti ) THEN
- test_passed = .TRUE.
- ELSE
- CALL MPAS_ESMF_TimeIntervalGet( computed_ti, timeString=computed_str, Sn=Sn, Sd=Sd, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestname)//'MPAS_ESMF_TimeGet() ', &
- __FILE__ , &
- __LINE__ )
- ! handle fractions
- CALL fraction_to_string( Sn, Sd, frac_str )
- computed_str = TRIM(computed_str)//TRIM(frac_str)
- ENDIF
- ELSE ! result is INTEGER
- IF ( computed_int == res_int ) THEN
- test_passed = .TRUE.
- ELSE
- IF ( computed_int > 0 ) THEN
- WRITE(computed_str,FMT="('+',I8.8)") ABS(computed_int)
- ELSE
- WRITE(computed_str,FMT="('-',I8.8)") ABS(computed_int)
- ENDIF
- ENDIF
- ENDIF
- IF ( test_passed ) THEN
- WRITE(*,FMT='(A)') 'PASS: '//TRIM(itestname)
- ELSE
- WRITE(*,*) 'FAIL: ',TRIM(itestname),': (', &
- TRIM(res_type_str),' = ',TRIM(op1_type_str),' ',TRIM(op_str),' ', &
- TRIM(op2_type_str),') expected ', &
- TRIM(res_str),' = ',TRIM(op1_str),' ',TRIM(op_str),' ', &
- TRIM(op2_str),' but computed ',TRIM(computed_str)
- ENDIF
-
- END SUBROUTINE test_arithmetic
-
-
-
- ! simple clock creation and advance with add-subtract tests thrown in
- ! no self checks (yet)
- SUBROUTINE test_clock_advance( &
- start_yy, start_mm, start_dd, start_h, start_m, start_s, &
- stop_yy, stop_mm, stop_dd, stop_h, stop_m, stop_s, &
- timestep_d, timestep_h, timestep_m, timestep_s, timestep_sn, timestep_sd, &
- testname, increment_S, increment_Sn, increment_Sd )
- INTEGER, INTENT(IN), OPTIONAL :: start_YY
- INTEGER, INTENT(IN), OPTIONAL :: start_MM ! month
- INTEGER, INTENT(IN), OPTIONAL :: start_DD ! day of month
- INTEGER, INTENT(IN), OPTIONAL :: start_H
- INTEGER, INTENT(IN), OPTIONAL :: start_M
- INTEGER, INTENT(IN), OPTIONAL :: start_S
- INTEGER, INTENT(IN), OPTIONAL :: stop_YY
- INTEGER, INTENT(IN), OPTIONAL :: stop_MM ! month
- INTEGER, INTENT(IN), OPTIONAL :: stop_DD ! day of month
- INTEGER, INTENT(IN), OPTIONAL :: stop_H
- INTEGER, INTENT(IN), OPTIONAL :: stop_M
- INTEGER, INTENT(IN), OPTIONAL :: stop_S
- INTEGER, INTENT(IN), OPTIONAL :: timestep_D ! day
- INTEGER, INTENT(IN), OPTIONAL :: timestep_H
- INTEGER, INTENT(IN), OPTIONAL :: timestep_M
- INTEGER, INTENT(IN), OPTIONAL :: timestep_S
- INTEGER, INTENT(IN), OPTIONAL :: timestep_Sn
- INTEGER, INTENT(IN), OPTIONAL :: timestep_Sd
- CHARACTER (LEN=*), OPTIONAL, INTENT(IN) :: testname
- INTEGER, INTENT(IN), OPTIONAL :: increment_S ! add and subtract this
- INTEGER, INTENT(IN), OPTIONAL :: increment_Sn ! value each time step
- INTEGER, INTENT(IN), OPTIONAL :: increment_Sd
-
- ! locals
- INTEGER :: istart_YY
- INTEGER :: istart_MM ! month
- INTEGER :: istart_DD ! day of month
- INTEGER :: istart_H
- INTEGER :: istart_M
- INTEGER :: istart_S
- INTEGER :: istop_YY
- INTEGER :: istop_MM ! month
- INTEGER :: istop_DD ! day of month
- INTEGER :: istop_H
- INTEGER :: istop_M
- INTEGER :: istop_S
- INTEGER :: itimestep_D ! day
- INTEGER :: itimestep_H
- INTEGER :: itimestep_M
- INTEGER :: itimestep_S
- INTEGER :: itimestep_Sn
- INTEGER :: itimestep_Sd
- CHARACTER (LEN=512) :: itestname, itestfullname
- INTEGER :: iincrement_S
- INTEGER :: iincrement_Sn
- INTEGER :: iincrement_Sd
- INTEGER :: Sn, Sd
- INTEGER rc
- TYPE(MPAS_ESMF_Time) :: start_time, stop_time, current_time
- TYPE(MPAS_ESMF_Clock), POINTER :: domain_clock
- TYPE(MPAS_ESMF_TimeInterval) :: timestep, increment
- TYPE(MPAS_ESMF_Time) :: add_time, subtract_time
- INTEGER :: itimestep
- REAL(MPAS_ESMF_KIND_R8) :: dayr8
- CHARACTER(LEN=MPAS_ESMF_MAXSTR) :: str, frac_str
-
- istart_YY = 0
- istart_MM = 1
- istart_DD = 1
- istart_H = 0
- istart_M = 0
- istart_S = 0
- istop_YY = 0
- istop_MM = 1
- istop_DD = 1
- istop_H = 0
- istop_M = 0
- istop_S = 0
- itimestep_D = 0
- itimestep_H = 0
- itimestep_M = 0
- itimestep_S = 0
- itimestep_Sn = 0
- itimestep_Sd = 0
- itestname = ''
- iincrement_S = 0
- iincrement_Sn = 0
- iincrement_Sd = 0
-
- IF ( PRESENT( start_YY ) ) istart_YY = start_YY
- IF ( PRESENT( start_MM ) ) istart_MM = start_MM
- IF ( PRESENT( start_DD ) ) istart_DD = start_DD
- IF ( PRESENT( start_H ) ) istart_H = start_H
- IF ( PRESENT( start_M ) ) istart_M = start_M
- IF ( PRESENT( start_S ) ) istart_S = start_S
- IF ( PRESENT( stop_YY ) ) istop_YY = stop_YY
- IF ( PRESENT( stop_MM ) ) istop_MM = stop_MM
- IF ( PRESENT( stop_DD ) ) istop_DD = stop_DD
- IF ( PRESENT( stop_H ) ) istop_H = stop_H
- IF ( PRESENT( stop_M ) ) istop_M = stop_M
- IF ( PRESENT( stop_S ) ) istop_S = stop_S
- IF ( PRESENT( timestep_D ) ) itimestep_D = timestep_D
- IF ( PRESENT( timestep_H ) ) itimestep_H = timestep_H
- IF ( PRESENT( timestep_M ) ) itimestep_M = timestep_M
- IF ( PRESENT( timestep_S ) ) itimestep_S = timestep_S
- IF ( PRESENT( timestep_Sn ) ) itimestep_Sn = timestep_Sn
- IF ( PRESENT( timestep_Sd ) ) itimestep_Sd = timestep_Sd
- IF ( PRESENT( testname ) ) itestname = TRIM(testname)//'_'
- IF ( PRESENT( increment_S ) ) iincrement_S = increment_S
- IF ( PRESENT( increment_Sn ) ) iincrement_Sn = increment_Sn
- IF ( PRESENT( increment_Sd ) ) iincrement_Sd = increment_Sd
-
- ! Initialize start time, stop time, time step, clock for simple case.
- itestfullname = TRIM(itestname)//'SETUP'
- CALL MPAS_ESMF_TimeSet( start_time, YY=istart_YY, MM=istart_MM, DD=istart_DD , &
- H=istart_H, M=istart_M, S=istart_S, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestfullname)//'MPAS_ESMF_TimeSet() ', &
- __FILE__ , &
- __LINE__ )
-
- CALL MPAS_ESMF_TimeGet( start_time, timeString=str, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestfullname)//'MPAS_ESMF_TimeGet() ', &
- __FILE__ , &
- __LINE__ )
- WRITE(*,FMT='(A,A,A,A)') TRIM(itestfullname),': start_time = <',TRIM(str),'>'
-
- CALL MPAS_ESMF_TimeSet( stop_time, YY=istop_YY, MM=istop_MM, DD=istop_DD , &
- H=istop_H, M=istop_M, S=istop_S, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestfullname)//'MPAS_ESMF_TimeSet() ', &
- __FILE__ , &
- __LINE__ )
-
- CALL MPAS_ESMF_TimeGet( stop_time, timeString=str, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestfullname)//'MPAS_ESMF_TimeGet() ', &
- __FILE__ , &
- __LINE__ )
- WRITE(*,FMT='(A,A,A,A)') TRIM(itestfullname),': stop_time = <',TRIM(str),'>'
-
- CALL MPAS_ESMF_TimeIntervalSet( timestep, D=itimestep_D, H=itimestep_H, &
- M=itimestep_M, S=itimestep_S, &
- Sn=itimestep_Sn, Sd=itimestep_Sd, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestfullname)//'MPAS_ESMF_TimeIntervalSet() ', &
- __FILE__ , &
- __LINE__ )
-
- CALL MPAS_ESMF_TimeIntervalGet( timestep, timeString=str, Sn=Sn, Sd=Sd, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestfullname)//'MPAS_ESMF_TimeIntervalGet() ', &
- __FILE__ , &
- __LINE__ )
- ! handle fractions
- CALL fraction_to_string( Sn, Sd, frac_str )
- str = TRIM(str)//TRIM(frac_str)
- WRITE(*,FMT='(A,A,A,A)') TRIM(itestfullname),': timestep = <',TRIM(str),'>'
-
- CALL MPAS_ESMF_TimeIntervalSet( increment, S=iincrement_S, &
- Sn=iincrement_Sn, Sd=iincrement_Sd, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestfullname)//'MPAS_ESMF_TimeIntervalSet() ', &
- __FILE__ , &
- __LINE__ )
-
- CALL MPAS_ESMF_TimeIntervalGet( increment, timeString=str, Sn=Sn, Sd=Sd, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestfullname)//'MPAS_ESMF_TimeIntervalGet() ', &
- __FILE__ , &
- __LINE__ )
- ! handle fractions
- CALL fraction_to_string( Sn, Sd, frac_str )
- str = TRIM(str)//TRIM(frac_str)
- WRITE(*,FMT='(A,A,A,A)') TRIM(itestfullname),': increment = <',TRIM(str),'>'
-
- ALLOCATE( domain_clock )
- domain_clock = MPAS_ESMF_ClockCreate( TimeStep= timestep, &
- StartTime=start_time, &
- StopTime= stop_time, &
- rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestfullname)//'MPAS_ESMF_ClockCreate() ', &
- __FILE__ , &
- __LINE__ )
-
- CALL MPAS_ESMF_ClockGet( domain_clock, CurrTime=current_time, &
- rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestfullname)//'MPAS_ESMF_ClockGet() ', &
- __FILE__ , &
- __LINE__ )
-
- CALL MPAS_ESMF_TimeGet( current_time, timeString=str, Sn=Sn, Sd=Sd, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestfullname)//'MPAS_ESMF_TimeGet() ', &
- __FILE__ , &
- __LINE__ )
- CALL fraction_to_string( Sn, Sd, frac_str )
- str = TRIM(str)//TRIM(frac_str)
- WRITE(*,FMT='(A,A,A,A)') TRIM(itestfullname),': clock current_time = <',TRIM(str),'>'
-
- CALL MPAS_ESMF_TimeGet( current_time, dayOfYear_r8=dayr8, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestfullname)//'MPAS_ESMF_TimeGet() ', &
- __FILE__ , &
- __LINE__ )
- WRITE(*,FMT='(A,A,F10.6,A)') TRIM(itestfullname),': current_time dayOfYear_r8 = < ',dayr8,' >'
-
- subtract_time = current_time - increment
- CALL MPAS_ESMF_TimeGet( subtract_time, timeString=str, Sn=Sn, Sd=Sd, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestfullname)//'MPAS_ESMF_TimeGet() ', &
- __FILE__ , &
- __LINE__ )
- CALL fraction_to_string( Sn, Sd, frac_str )
- str = TRIM(str)//TRIM(frac_str)
- WRITE(*,FMT='(A,A,A,A)') TRIM(itestfullname),': current_time-increment = <',TRIM(str),'>'
-
- add_time = current_time + increment
- CALL MPAS_ESMF_TimeGet( add_time, timeString=str, Sn=Sn, Sd=Sd, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestfullname)//'MPAS_ESMF_TimeGet() ', &
- __FILE__ , &
- __LINE__ )
- CALL fraction_to_string( Sn, Sd, frac_str )
- str = TRIM(str)//TRIM(frac_str)
- WRITE(*,FMT='(A,A,A,A)') TRIM(itestfullname),': current_time+increment = <',TRIM(str),'>'
-
- ! Advance clock.
- itestfullname = TRIM(itestname)//'ADVANCE'
- itimestep = 0
- DO WHILE ( .NOT. MPAS_ESMF_ClockIsStopTime(domain_clock ,rc=rc) )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestfullname)//'MPAS_ESMF_ClockIsStopTime() ', &
- __FILE__ , &
- __LINE__ )
- itimestep = itimestep + 1
-
- CALL MPAS_ESMF_ClockAdvance( domain_clock, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestfullname)//'MPAS_ESMF_ClockAdvance() ', &
- __FILE__ , &
- __LINE__ )
-
- CALL MPAS_ESMF_ClockGet( domain_clock, CurrTime=current_time, &
- rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestfullname)//'MPAS_ESMF_ClockGet() ', &
- __FILE__ , &
- __LINE__ )
-
- CALL MPAS_ESMF_TimeGet( current_time, timeString=str, Sn=Sn, Sd=Sd, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestfullname)//'MPAS_ESMF_TimeGet() ', &
- __FILE__ , &
- __LINE__ )
- CALL fraction_to_string( Sn, Sd, frac_str )
- str = TRIM(str)//TRIM(frac_str)
- WRITE(*,FMT='(A,A,I6.6,A,A,A)') TRIM(itestfullname),': count = ', &
- itimestep,' current_time = <',TRIM(str),'>'
-
- subtract_time = current_time - increment
- CALL MPAS_ESMF_TimeGet( subtract_time, timeString=str, Sn=Sn, Sd=Sd, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestfullname)//'MPAS_ESMF_TimeGet() ', &
- __FILE__ , &
- __LINE__ )
- CALL fraction_to_string( Sn, Sd, frac_str )
- str = TRIM(str)//TRIM(frac_str)
- WRITE(*,FMT='(A,A,A,A)') TRIM(itestfullname),': current_time-increment = <',TRIM(str),'>'
-
- add_time = current_time + increment
- CALL MPAS_ESMF_TimeGet( add_time, timeString=str, Sn=Sn, Sd=Sd, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- TRIM(itestfullname)//'MPAS_ESMF_TimeGet() ', &
- __FILE__ , &
- __LINE__ )
- CALL fraction_to_string( Sn, Sd, frac_str )
- str = TRIM(str)//TRIM(frac_str)
- WRITE(*,FMT='(A,A,A,A)') TRIM(itestfullname),': current_time+increment = <',TRIM(str),'>'
-
- ENDDO
-
- DEALLOCATE( domain_clock )
-
- END SUBROUTINE test_clock_advance
-
-END MODULE my_tests
-
-
-#if defined( TIME_F90_ONLY )
-
-! TBH: Improve the build of Test1.exe to use WRF versions of these
-! TBH: routines and remove these hacked-in duplicates!!
-
-SUBROUTINE wrf_abort
- IMPLICIT NONE
-#if defined( DM_PARALLEL ) && ! defined( STUBMPI )
- INCLUDE 'mpif.h'
- INTEGER ierr
- CALL mpi_abort(MPI_COMM_WORLD,1,ierr)
-#else
- STOP
-#endif
-END SUBROUTINE wrf_abort
-
-SUBROUTINE wrf_message( str )
- IMPLICIT NONE
- CHARACTER*(*) str
-#if defined( DM_PARALLEL ) && ! defined( STUBMPI)
- write(0,*) str
-#endif
- print*, str
-END SUBROUTINE wrf_message
-
-! intentionally write to stderr only
-SUBROUTINE wrf_message2( str )
- IMPLICIT NONE
- CHARACTER*(*) str
- write(0,*) str
-END SUBROUTINE wrf_message2
-
-SUBROUTINE wrf_error_fatal3( file_str, line, str )
- USE my_tests
- IMPLICIT NONE
- CHARACTER*(*) file_str
- INTEGER , INTENT (IN) :: line ! only print file and line if line > 0
- CHARACTER*(*) str
- CHARACTER*256 :: line_str
- write(line_str,'(i6)') line
- ! special behavior for testing since Fortran cannot catch exceptions
- IF ( WRF_ERROR_FATAL_PRINT ) THEN
- ! just print message and continue
- CALL wrf_message( 'ERROR IN FILE: '//TRIM(file_str)//' LINE: '//TRIM(line_str) )
- ELSE
- ! normal behavior
-#if defined( DM_PARALLEL ) && ! defined( STUBMPI )
- CALL wrf_message( '-------------- FATAL CALLED ---------------' )
- ! only print file and line if line is positive
- IF ( line > 0 ) THEN
- CALL wrf_message( 'FATAL CALLED FROM FILE: '//file_str//' LINE: '//TRIM(line_str) )
- ENDIF
- CALL wrf_message( str )
- CALL wrf_message( '-------------------------------------------' )
-#else
- CALL wrf_message2( '-------------- FATAL CALLED ---------------' )
- ! only print file and line if line is positive
- IF ( line > 0 ) THEN
- CALL wrf_message( 'FATAL CALLED FROM FILE: '//file_str//' LINE: '//TRIM(line_str) )
- ENDIF
- CALL wrf_message2( str )
- CALL wrf_message2( '-------------------------------------------' )
-#endif
- CALL wrf_abort
- ENDIF
-END SUBROUTINE wrf_error_fatal3
-
-SUBROUTINE wrf_error_fatal( str )
- IMPLICIT NONE
- CHARACTER*(*) str
- CALL wrf_error_fatal3 ( ' ', 0, str )
-END SUBROUTINE wrf_error_fatal
-
-#endif
-
-
-! Check to see if expected value == actual value
-! If not, print message and exit.
-SUBROUTINE test_check_error( expected, actual, str, file_str, line )
- IMPLICIT NONE
- INTEGER , INTENT (IN) :: expected
- INTEGER , INTENT (IN) :: actual
- CHARACTER*(*) str
- CHARACTER*(*) file_str
- INTEGER , INTENT (IN) :: line
- CHARACTER (LEN=512) :: rc_str
- CHARACTER (LEN=512) :: str_with_rc
- IF ( expected .ne. actual ) THEN
- WRITE (rc_str,*) ' Routine returned error code = ',actual
- str_with_rc = 'FAIL: '//TRIM(str)//TRIM(rc_str)
- CALL wrf_error_fatal3( file_str, line, str_with_rc )
- ENDIF
-END SUBROUTINE test_check_error
-
-
-
-PROGRAM time_manager_test
- USE MPAS_ESMF_Mod
- USE my_tests
- IMPLICIT NONE
- INTEGER :: rc
-
- PRINT *,'BEGIN TEST SUITE'
-
- CALL MPAS_ESMF_Initialize( defaultCalendar=MPAS_ESMF_CAL_GREGORIAN, rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- 'MPAS_ESMF_Initialize() ', &
- __FILE__ , &
- __LINE__ )
-! PRINT *,'DEBUG: back from MPAS_ESMF_Initialize(), rc = ',rc
-
-! CALL test_print( t_yy, t_mm, t_dd, t_h, t_m, t_s, &
-! ti_yy, ti_mm, ti_dd, ti_h, ti_m, ti_s, &
-! res_str, testname )
-
- ! Print times
- ! "vanilla" tests
-! PRINT *,'DEBUG: calling 1st test_print()'
- CALL test_print( t_yy=2001, t_mm=12, t_dd=3, t_h=1, t_m=20, t_s=10, &
- res_str='2001-12-03_01:20:10', testname='printT_1' )
-! PRINT *,'DEBUG: back from 1st test_print()'
- CALL test_print( t_yy=0, t_mm=1, t_dd=1, t_h=0, t_m=0, t_s=0, &
- res_str='0000-01-01_00:00:00', testname='printT_2' )
- CALL test_print( t_yy=2003, t_mm=12, t_dd=30, t_h=23, t_m=59, t_s=50, &
- res_str='2003-12-30_23:59:50', testname='printT_3' )
- CALL test_print( t_yy=2003, t_mm=12, t_dd=31, t_h=23, t_m=59, t_s=50, &
- res_str='2003-12-31_23:59:50', testname='printT_4' )
- CALL test_print( t_yy=2004, t_mm=12, t_dd=30, t_h=23, t_m=59, t_s=50, &
- res_str='2004-12-30_23:59:50', testname='printT_5' )
- CALL test_print( t_yy=2004, t_mm=12, t_dd=31, t_h=23, t_m=59, t_s=50, &
- res_str='2004-12-31_23:59:50', testname='printT_6' )
-!$$$ NOTE that this fails -- need to fix up output string for negative year
-! CALL test_print( t_yy=-2004, t_mm=12, t_dd=31, t_h=23, t_m=59, t_s=50, &
-! res_str='-2004-12-31_23:59:50', testname='printT_6' )
-
- ! these test default behavior of test harness
- CALL test_print( t_s=0, &
- res_str='0000-01-01_00:00:00', testname='printT_D1' )
- CALL test_print( t_yy=0, &
- res_str='0000-01-01_00:00:00', testname='printT_D2' )
-
- ! fractions
- CALL test_print( t_yy=2001, t_mm=12, t_dd=3, t_h=1, t_m=20, t_s=10, &
- t_sn=1, t_sd=3, &
- res_str='2001-12-03_01:20:10+01/03', testname='printT_F1' )
- CALL test_print( t_yy=2001, t_mm=12, t_dd=3, t_h=1, t_m=20, t_s=10, &
- t_sn=4, t_sd=3, &
- res_str='2001-12-03_01:20:11+01/03', testname='printT_F2' )
- CALL test_print( t_yy=2001, t_mm=12, t_dd=3, t_h=1, t_m=20, t_s=10, &
- t_sn=12, t_sd=3, &
- res_str='2001-12-03_01:20:14', testname='printT_F3' )
- CALL test_print( t_yy=2001, t_mm=12, t_dd=3, t_h=1, t_m=20, t_s=10, &
- t_sn=-1, t_sd=3, &
- res_str='2001-12-03_01:20:09+02/03', testname='printT_F4' )
-
- ! ERROR, MM out of range
-!$$$here... fix so this just prints "ERROR: <testname>" in failure case
-!$$$here... also need "expect_fail" to reverse sense of PASS/FAIL message for
-!$$$here... tests that should fail
-! CALL test_print( t_yy=2001, t_mm=13, t_dd=3, t_h=1, t_m=20, t_s=10, &
-! res_str='2002-01-03_01:20:10', testname='printT_E1', expect_error=.TRUE. )
-
- ! Print time intervals
- ! "vanilla" tests
- CALL test_print( ti_yy=0, ti_mm=0, ti_dd=0, ti_h=0, ti_m=0, ti_s=0, &
- res_str='0000000000_000:000:000', testname='printTI_1' )
- CALL test_print( ti_yy=0, ti_mm=0, ti_dd=500, ti_h=0, ti_m=0, ti_s=7270, &
- res_str='0000000500_002:001:010', testname='printTI_2' )
-
- ! these test default behavior of test harness
- CALL test_print( ti_s=0, &
- res_str='0000000000_000:000:000', testname='printTI_D1' )
- CALL test_print( ti_yy=0, &
- res_str='0000000000_000:000:000', testname='printTI_D2' )
-
- ! these test negative values
- CALL test_print( ti_yy=0000, ti_mm=0, ti_dd=-3, ti_h=-1, ti_m=-20, ti_s=-10, &
- res_str='-0000000003_001:020:010', testname='printTI_N1' )
-
- ! these test mixed values
- CALL test_print( ti_yy=0000, ti_mm=0, ti_dd=-3, ti_h=1, ti_m=20, ti_s=10, &
- res_str='-0000000002_022:039:050', testname='printTI_M1' )
-
- ! fractions
- CALL test_print( ti_yy=0000, ti_mm=0, ti_dd=3, ti_h=1, ti_m=20, ti_s=10, &
- ti_sn=1, ti_sd=3, &
- res_str='0000000003_001:020:010+01/03', testname='printTI_F1' )
- CALL test_print( ti_yy=0000, ti_mm=0, ti_dd=3, ti_h=1, ti_m=20, ti_s=10, &
- ti_sn=5, ti_sd=3, &
- res_str='0000000003_001:020:011+02/03', testname='printTI_F2' )
- CALL test_print( ti_yy=0000, ti_mm=0, ti_dd=-3, ti_h=-1, ti_m=-20, ti_s=-10, &
- ti_sn=-1, ti_sd=3, &
- res_str='-0000000003_001:020:010-01/03', testname='printTI_F3' )
- CALL test_print( ti_yy=0000, ti_mm=0, ti_dd=-3, ti_h=-1, ti_m=-20, ti_s=-10, &
- ti_sn=1, ti_sd=3, &
- res_str='-0000000003_001:020:009-02/03', testname='printTI_F4' )
-
- ! these test non-normalized values
-! CALL test_print( ti_yy=2001, ti_mm=1, ti_dd=3, ti_h=1, ti_m=20, ti_s=10, &
-! res_str='02001-001-003_001:020:010', testname='printTI_NN1', expect_error=.TRUE. )
-! CALL test_print( ti_yy=2001, ti_mm=12, ti_dd=3, ti_h=1, ti_m=20, ti_s=10, &
-! res_str='02002-000-003_001:020:010', testname='printTI_NN2', expect_error=.TRUE. )
-! CALL test_print( ti_yy=2002, ti_mm=5, ti_dd=500, ti_h=0, ti_m=0, ti_s=7270, &
-! res_str='02002-005-500_002:001:010', testname='printTI_NN3', expect_error=.TRUE. )
-
- ! Addition tests
- ! MPAS_ESMF_Time = MPAS_ESMF_Time + MPAS_ESMF_TimeInterval
- CALL test_arithmetic( add_op=.TRUE., &
- op1_t_yy=2001, op1_t_mm=12, op1_t_dd=3, op1_t_h=1, op1_t_m=20, op1_t_s=10, &
- op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=0, op2_ti_h=3, op2_ti_m=10, op2_ti_s=10, &
- res_t_yy=2001, res_t_mm=12, res_t_dd=3, res_t_h=4, res_t_m=30, res_t_s=20, &
- testname='AddT_T_TI1' )
- CALL test_arithmetic( add_op=.TRUE., &
- op1_t_yy=2001, op1_t_mm=12, op1_t_dd=31, op1_t_h=22, op1_t_m=30, op1_t_s=00, &
- op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=0, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
- res_t_yy=2002, res_t_mm= 1, res_t_dd=1, res_t_h=2, res_t_m=40, res_t_s=10, &
- testname='AddT_T_TI2' )
- CALL test_arithmetic( add_op=.TRUE., &
- op1_t_yy=2003, op1_t_mm=12, op1_t_dd=31, op1_t_h=22, op1_t_m=30, op1_t_s=00, &
- op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=0, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
- res_t_yy=2004, res_t_mm= 1, res_t_dd=1, res_t_h=2, res_t_m=40, res_t_s=10, &
- testname='AddT_T_TI3' )
- CALL test_arithmetic( add_op=.TRUE., &
- op1_t_yy=2004, op1_t_mm=12, op1_t_dd=31, op1_t_h=22, op1_t_m=30, op1_t_s=00, &
- op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=0, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
- res_t_yy=2005, res_t_mm= 1, res_t_dd=1, res_t_h=2, res_t_m=40, res_t_s=10, &
- testname='AddT_T_TI4' )
- ! this case hung after the CCSM contribution
- CALL test_arithmetic( add_op=.TRUE., &
- op1_t_yy=2004, op1_t_mm=12, op1_t_dd=30, op1_t_h=22, op1_t_m=30, op1_t_s=00, &
- op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=0, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
- res_t_yy=2004, res_t_mm=12, res_t_dd=31, res_t_h=2, res_t_m=40, res_t_s=10, &
- testname='AddT_T_TI5' )
-! NOTE: CCSM folks need to decide what it means to add "1 month" to Feb. 29. And all the
-! other very similar cases. Then, write this unit test!
-! CALL test_arithmetic( add_op=.TRUE., &
-! op1_t_yy=2004, op1_t_mm=12, op1_t_dd=31, op1_t_h=22, op1_t_m=30, op1_t_s=00, &
-! op2_ti_yy= 2, op2_ti_mm= 0, op2_ti_dd=0, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
-! res_t_yy=2007, res_t_mm= 1, res_t_dd=1, res_t_h=2, res_t_m=40, res_t_s=10, &
-! testname='AddT_T_TI6' )
- CALL test_arithmetic( add_op=.TRUE., &
- op1_t_yy=2004, op1_t_mm=12, op1_t_dd=30, op1_t_h=4, op1_t_m=30, op1_t_s=00, &
- op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=365, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
- res_t_yy=2005, res_t_mm=12, res_t_dd=30, res_t_h=8, res_t_m=40, res_t_s=10, &
- testname='AddT_T_TI7' )
- CALL test_arithmetic( add_op=.TRUE., &
- op1_t_yy=2004, op1_t_mm=12, op1_t_dd=30, op1_t_h=4, op1_t_m=30, op1_t_s=00, &
- op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=367, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
- res_t_yy=2006, res_t_mm=01, res_t_dd=01, res_t_h=8, res_t_m=40, res_t_s=10, &
- testname='AddT_T_TI8' )
- CALL test_arithmetic( add_op=.TRUE., &
- op1_t_yy=2003, op1_t_mm=12, op1_t_dd=30, op1_t_h=4, op1_t_m=30, op1_t_s=00, &
- op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=365, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
- res_t_yy=2004, res_t_mm=12, res_t_dd=29, res_t_h=8, res_t_m=40, res_t_s=10, &
- testname='AddT_T_TI9' )
- CALL test_arithmetic( add_op=.TRUE., &
- op1_t_yy=2003, op1_t_mm=12, op1_t_dd=30, op1_t_h=4, op1_t_m=30, op1_t_s=00, &
- op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=366, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
- res_t_yy=2004, res_t_mm=12, res_t_dd=30, res_t_h=8, res_t_m=40, res_t_s=10, &
- testname='AddT_T_TI10' )
- CALL test_arithmetic( add_op=.TRUE., &
- op1_t_yy=2003, op1_t_mm=12, op1_t_dd=30, op1_t_h=4, op1_t_m=30, op1_t_s=00, &
- op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=367, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
- res_t_yy=2004, res_t_mm=12, res_t_dd=31, res_t_h=8, res_t_m=40, res_t_s=10, &
- testname='AddT_T_TI11' )
- CALL test_arithmetic( add_op=.TRUE., &
- op1_t_yy=2003, op1_t_mm=12, op1_t_dd=30, op1_t_h=4, op1_t_m=30, op1_t_s=00, &
- op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=368, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
- res_t_yy=2005, res_t_mm=01, res_t_dd=01, res_t_h=8, res_t_m=40, res_t_s=10, &
- testname='AddT_T_TI12' )
- CALL test_arithmetic( add_op=.TRUE., &
- op1_t_yy=2004, op1_t_mm=03, op1_t_dd=30, op1_t_h=4, op1_t_m=30, op1_t_s=00, &
- op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=365, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
- res_t_yy=2005, res_t_mm=03, res_t_dd=30, res_t_h=8, res_t_m=40, res_t_s=10, &
- testname='AddT_T_TI13' )
- CALL test_arithmetic( add_op=.TRUE., &
- op1_t_yy=2004, op1_t_mm=03, op1_t_dd=30, op1_t_h=4, op1_t_m=30, op1_t_s=00, &
- op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=365, op2_ti_h=22, op2_ti_m=10, op2_ti_s=10, &
- res_t_yy=2005, res_t_mm=03, res_t_dd=31, res_t_h=2, res_t_m=40, res_t_s=10, &
- testname='AddT_T_TI14' )
- CALL test_arithmetic( add_op=.TRUE., &
- op1_t_yy=2004, op1_t_mm=03, op1_t_dd=30, op1_t_h=4, op1_t_m=30, op1_t_s=00, &
- op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=366, op2_ti_h=22, op2_ti_m=10, op2_ti_s=10, &
- res_t_yy=2005, res_t_mm=04, res_t_dd=01, res_t_h=2, res_t_m=40, res_t_s=10, &
- testname='AddT_T_TI15' )
- ! MPAS_ESMF_Time = MPAS_ESMF_Time + MPAS_ESMF_TimeInterval with fractions
- CALL test_arithmetic( add_op=.TRUE., &
- op1_t_yy=2004, op1_t_mm=12, op1_t_dd=31, op1_t_h=22, op1_t_m=30, op1_t_s=00, &
- op1_t_sn=01, op1_t_sd=03, &
- op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=0, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
- op2_ti_sn=01, op2_ti_sd=03, &
- res_t_yy=2005, res_t_mm= 1, res_t_dd=1, res_t_h=2, res_t_m=40, res_t_s=10, &
- res_t_sn=02, res_t_sd=03, &
- testname='AddT_T_TI_F1' )
- ! this should fail (and does)
-! CALL test_arithmetic( add_op=.TRUE., &
-! op1_t_yy=2004, op1_t_mm=12, op1_t_dd=31, op1_t_h=22, op1_t_m=30, op1_t_s=00, &
-! op1_t_sn=01, op1_t_sd=03, &
-! op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=0, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
-! op2_ti_sn=01, op2_ti_sd=03, &
-! res_t_yy=2005, res_t_mm= 1, res_t_dd=1, res_t_h=2, res_t_m=40, res_t_s=10, &
-! res_t_sn=01, res_t_sd=03, &
-! testname='AddT_T_TI_F2' )
- ! MPAS_ESMF_Time = MPAS_ESMF_TimeInterval + MPAS_ESMF_Time
- CALL test_arithmetic( add_op=.TRUE., &
- op1_ti_yy= 0, op1_ti_mm= 0, op1_ti_dd=0, op1_ti_h=3, op1_ti_m=10, op1_ti_s=10, &
- op2_t_yy=2001, op2_t_mm=12, op2_t_dd=3, op2_t_h=1, op2_t_m=20, op2_t_s=10, &
- res_t_yy=2001, res_t_mm=12, res_t_dd=3, res_t_h=4, res_t_m=30, res_t_s=20, &
- testname='AddT_TI_T1' )
- CALL test_arithmetic( add_op=.TRUE., &
- op1_ti_yy= 0, op1_ti_mm= 0, op1_ti_dd=0, op1_ti_h=4, op1_ti_m=10, op1_ti_s=10, &
- op2_t_yy=2001, op2_t_mm=12, op2_t_dd=31, op2_t_h=22, op2_t_m=30, op2_t_s=00, &
- res_t_yy=2002, res_t_mm= 1, res_t_dd=1, res_t_h=2, res_t_m=40, res_t_s=10, &
- testname='AddT_TI_T2' )
- ! MPAS_ESMF_TimeInterval = MPAS_ESMF_TimeInterval + MPAS_ESMF_TimeInterval
- CALL test_arithmetic( add_op=.TRUE., &
- op1_ti_yy=0000, op1_ti_mm=00, op1_ti_dd=3, op1_ti_h=1, op1_ti_m=20, op1_ti_s=10, &
- op2_ti_yy=0000, op2_ti_mm=00, op2_ti_dd=1, op2_ti_h=1, op2_ti_m=10, op2_ti_s=10, &
- res_ti_yy=0000, res_ti_mm=00, res_ti_dd=4, res_ti_h=2, res_ti_m=30, res_ti_s=20, &
- testname='AddTI_TI_TI1' )
- CALL test_arithmetic( add_op=.TRUE., &
- op1_ti_yy=0000, op1_ti_mm=00, op1_ti_dd=-3, op1_ti_h=-1, op1_ti_m=-20, op1_ti_s=-10, &
- op2_ti_yy=0000, op2_ti_mm=00, op2_ti_dd=1, op2_ti_h=1, op2_ti_m=10, op2_ti_s=10, &
- res_ti_yy=0000, res_ti_mm=00, res_ti_dd=-2, res_ti_h=0, res_ti_m=-10, res_ti_s=00, &
- testname='AddTI_TI_TI2' )
- CALL test_arithmetic( add_op=.TRUE., &
- op1_ti_yy=0000, op1_ti_mm=00, op1_ti_dd=-3, op1_ti_h=-1, op1_ti_m=-20, op1_ti_s=-10, &
- op2_ti_yy=0000, op2_ti_mm=00, op2_ti_dd=-1, op2_ti_h=-1, op2_ti_m=-10, op2_ti_s=-10, &
- res_ti_yy=0000, res_ti_mm=00, res_ti_dd=-4, res_ti_h=-2, res_ti_m=-30, res_ti_s=-20, &
- testname='AddTI_TI_TI3' )
-
- ! Subtraction tests
- ! MPAS_ESMF_Time = MPAS_ESMF_Time - MPAS_ESMF_TimeInterval
- CALL test_arithmetic( add_op=.FALSE., &
- op1_t_yy=2001, op1_t_mm=12, op1_t_dd=3, op1_t_h=1, op1_t_m=20, op1_t_s=10, &
- op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=0, op2_ti_h=3, op2_ti_m=10, op2_ti_s=10, &
- res_t_yy=2001, res_t_mm=12, res_t_dd=2, res_t_h=22, res_t_m=10, res_t_s=0, &
- testname='SubtractT_T_TI1' )
- CALL test_arithmetic( add_op=.FALSE., &
- op1_t_yy=2005, op1_t_mm=1, op1_t_dd=1, op1_t_h=0, op1_t_m=00, op1_t_s=0, &
- op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=0, op2_ti_h=0, op2_ti_m=00, op2_ti_s=10, &
- res_t_yy=2004, res_t_mm=12, res_t_dd=31, res_t_h=23, res_t_m=59, res_t_s=50, &
- testname='SubtractT_T_TI2' )
- CALL test_arithmetic( add_op=.FALSE., &
- op1_t_yy=2004, op1_t_mm=1, op1_t_dd=1, op1_t_h=0, op1_t_m=00, op1_t_s=0, &
- op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=0, op2_ti_h=0, op2_ti_m=00, op2_ti_s=10, &
- res_t_yy=2003, res_t_mm=12, res_t_dd=31, res_t_h=23, res_t_m=59, res_t_s=50, &
- testname='SubtractT_T_TI3' )
- CALL test_arithmetic( add_op=.FALSE., &
- op1_t_yy=2003, op1_t_mm=1, op1_t_dd=1, op1_t_h=0, op1_t_m=00, op1_t_s=0, &
- op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=0, op2_ti_h=0, op2_ti_m=00, op2_ti_s=10, &
- res_t_yy=2002, res_t_mm=12, res_t_dd=31, res_t_h=23, res_t_m=59, res_t_s=50, &
- testname='SubtractT_T_TI4' )
- CALL test_arithmetic( add_op=.FALSE., &
- op1_t_yy=2005, op1_t_mm=04, op1_t_dd=01, op1_t_h=2, op1_t_m=40, op1_t_s=10, &
- op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=366, op2_ti_h=22, op2_ti_m=10, op2_ti_s=10, &
- res_t_yy=2004, res_t_mm=03, res_t_dd=30, res_t_h=4, res_t_m=30, res_t_s=00, &
- testname='SubtractT_T_TI5' )
- CALL test_arithmetic( add_op=.FALSE., &
- op1_t_yy=2006, op1_t_mm=01, op1_t_dd=01, op1_t_h=8, op1_t_m=40, op1_t_s=10, &
- op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=367, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
- res_t_yy=2004, res_t_mm=12, res_t_dd=30, res_t_h=4, res_t_m=30, res_t_s=00, &
- testname='SubtractT_T_TI6' )
- ! MPAS_ESMF_Time = MPAS_ESMF_Time - MPAS_ESMF_TimeInterval with fractions
- CALL test_arithmetic( add_op=.FALSE., &
- op1_t_yy=2005, op1_t_mm=01, op1_t_dd=01, op1_t_h=00, op1_t_m=00, op1_t_s=00, &
- op1_t_sn=00, op1_t_sd=00, &
- op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=0, op2_ti_h=0, op2_ti_m=00, op2_ti_s=01, &
- op2_ti_sn=01, op2_ti_sd=03, &
- res_t_yy=2004, res_t_mm=12, res_t_dd=31, res_t_h=23, res_t_m=59, res_t_s=58, &
- res_t_sn=02, res_t_sd=03, &
- testname='SubtractT_T_TI_F1' )
- ! MPAS_ESMF_TimeInterval = MPAS_ESMF_Time - MPAS_ESMF_Time
- CALL test_arithmetic( add_op=.FALSE., &
- op1_t_yy=2001, op1_t_mm=12, op1_t_dd=3, op1_t_h=1, op1_t_m=20, op1_t_s=10, &
- op2_t_yy=2001, op2_t_mm=12, op2_t_dd=1, op2_t_h=1, op2_t_m=10, op2_t_s=10, &
- res_ti_yy=0000, res_ti_mm=00, res_ti_dd=2, res_ti_h=0, res_ti_m=10, res_ti_s=0, &
- testname='SubtractTI_T_T1' )
- CALL test_arithmetic( add_op=.FALSE., &
- op1_t_yy=2002, op1_t_mm=1, op1_t_dd=1, op1_t_h=0, op1_t_m=00, op1_t_s=00, &
- op2_t_yy=2001, op2_t_mm=12, op2_t_dd=31, op2_t_h=23, op2_t_m=59, op2_t_s=50, &
- res_ti_yy=0000, res_ti_mm=00, res_ti_dd=0, res_ti_h=0, res_ti_m=00, res_ti_s=10, &
- testname='SubtractTI_T_T2' )
- CALL test_arithmetic( add_op=.FALSE., &
- op1_t_yy=2005, op1_t_mm=1, op1_t_dd=1, op1_t_h=0, op1_t_m=00, op1_t_s=00, &
- op2_t_yy=2004, op2_t_mm=12, op2_t_dd=31, op2_t_h=23, op2_t_m=59, op2_t_s=50, &
- res_ti_yy=0000, res_ti_mm=00, res_ti_dd=0, res_ti_h=0, res_ti_m=00, res_ti_s=10, &
- testname='SubtractTI_T_T3' )
- CALL test_arithmetic( add_op=.FALSE., &
- op1_t_yy=2003, op1_t_mm=03, op1_t_dd=01, op1_t_h=00, op1_t_m=00, op1_t_s=00, &
- op2_t_yy=2003, op2_t_mm=02, op2_t_dd=28, op2_t_h=23, op2_t_m=59, op2_t_s=50, &
- res_ti_yy=0000, res_ti_mm=00, res_ti_dd=0, res_ti_h=0, res_ti_m=00, res_ti_s=10, &
- testname='SubtractTI_T_T4' )
- CALL test_arithmetic( add_op=.FALSE., &
- op1_t_yy=2004, op1_t_mm=03, op1_t_dd=01, op1_t_h=00, op1_t_m=00, op1_t_s=00, &
- op2_t_yy=2004, op2_t_mm=02, op2_t_dd=28, op2_t_h=23, op2_t_m=59, op2_t_s=50, &
- res_ti_yy=0000, res_ti_mm=00, res_ti_dd=1, res_ti_h=0, res_ti_m=00, res_ti_s=10, &
- testname='SubtractTI_T_T5' )
- CALL test_arithmetic( add_op=.FALSE., &
- op1_t_yy=2002, op1_t_mm=02, op1_t_dd=28, op1_t_h=00, op1_t_m=00, op1_t_s=00, &
- op2_t_yy=2002, op2_t_mm=02, op2_t_dd=28, op2_t_h=00, op2_t_m=00, op2_t_s=00, &
- res_ti_yy=0000, res_ti_mm=00, res_ti_dd=0, res_ti_h=0, res_ti_m=00, res_ti_s=00, &
- testname='SubtractTI_T_T6' )
- CALL test_arithmetic( add_op=.FALSE., &
- op1_t_yy=2003, op1_t_mm=02, op1_t_dd=28, op1_t_h=00, op1_t_m=00, op1_t_s=00, &
- op2_t_yy=2002, op2_t_mm=02, op2_t_dd=28, op2_t_h=00, op2_t_m=00, op2_t_s=00, &
- res_ti_yy=0000, res_ti_mm=00, res_ti_dd=365, res_ti_h=0, res_ti_m=00, res_ti_s=00, &
- testname='SubtractTI_T_T7' )
- CALL test_arithmetic( add_op=.FALSE., &
- op1_t_yy=2004, op1_t_mm=02, op1_t_dd=28, op1_t_h=00, op1_t_m=00, op1_t_s=00, &
- op2_t_yy=2003, op2_t_mm=02, op2_t_dd=28, op2_t_h=00, op2_t_m=00, op2_t_s=00, &
- res_ti_yy=0000, res_ti_mm=00, res_ti_dd=365, res_ti_h=0, res_ti_m=00, res_ti_s=00, &
- testname='SubtractTI_T_T8' )
- CALL test_arithmetic( add_op=.FALSE., &
- op1_t_yy=2005, op1_t_mm=02, op1_t_dd=28, op1_t_h=00, op1_t_m=00, op1_t_s=00, &
- op2_t_yy=2004, op2_t_mm=02, op2_t_dd=28, op2_t_h=00, op2_t_m=00, op2_t_s=00, &
- res_ti_yy=0000, res_ti_mm=00, res_ti_dd=366, res_ti_h=0, res_ti_m=00, res_ti_s=00, &
- testname='SubtractTI_T_T9' )
- CALL test_arithmetic( add_op=.FALSE., &
- op1_t_yy=2003, op1_t_mm=03, op1_t_dd=01, op1_t_h=00, op1_t_m=00, op1_t_s=00, &
- op2_t_yy=2002, op2_t_mm=02, op2_t_dd=28, op2_t_h=00, op2_t_m=00, op2_t_s=00, &
- res_ti_yy=0000, res_ti_mm=00, res_ti_dd=366, res_ti_h=0, res_ti_m=00, res_ti_s=00, &
- testname='SubtractTI_T_T10' )
- CALL test_arithmetic( add_op=.FALSE., &
- op1_t_yy=2005, op1_t_mm=03, op1_t_dd=01, op1_t_h=00, op1_t_m=00, op1_t_s=00, &
- op2_t_yy=2004, op2_t_mm=02, op2_t_dd=28, op2_t_h=00, op2_t_m=00, op2_t_s=00, &
- res_ti_yy=0000, res_ti_mm=00, res_ti_dd=367, res_ti_h=0, res_ti_m=00, res_ti_s=00, &
- testname='SubtractTI_T_T11' )
- CALL test_arithmetic( add_op=.FALSE., &
- op1_t_yy=2005, op1_t_mm=03, op1_t_dd=01, op1_t_h=00, op1_t_m=00, op1_t_s=00, &
- op2_t_yy=2004, op2_t_mm=02, op2_t_dd=28, op2_t_h=23, op2_t_m=59, op2_t_s=50, &
- res_ti_yy=0000, res_ti_mm=00, res_ti_dd=366, res_ti_h=0, res_ti_m=00, res_ti_s=10, &
- testname='SubtractTI_T_T12' )
- CALL test_arithmetic( add_op=.FALSE., &
- op1_t_yy=2004, op1_t_mm=02, op1_t_dd=28, op1_t_h=23, op1_t_m=59, op1_t_s=50, &
- op2_t_yy=2005, op2_t_mm=03, op2_t_dd=01, op2_t_h=00, op2_t_m=00, op2_t_s=00, &
- res_ti_yy=0000, res_ti_mm=00, res_ti_dd=-366, res_ti_h=0, res_ti_m=00, res_ti_s=-10, &
- testname='SubtractTI_T_T13' )
- CALL test_arithmetic( add_op=.FALSE., &
- op1_t_yy=-2002, op1_t_mm=02, op1_t_dd=28, op1_t_h=00, op1_t_m=00, op1_t_s=00, &
- op2_t_yy=-2002, op2_t_mm=02, op2_t_dd=28, op2_t_h=00, op2_t_m=00, op2_t_s=00, &
- res_ti_yy=0000, res_ti_mm=00, res_ti_dd=0, res_ti_h=0, res_ti_m=00, res_ti_s=00, &
- testname='SubtractTI_T_T14' )
- ! MPAS_ESMF_TimeInterval = MPAS_ESMF_TimeInterval - MPAS_ESMF_TimeInterval
- CALL test_arithmetic( add_op=.FALSE., &
- op1_ti_yy=0000, op1_ti_mm=00, op1_ti_dd=3, op1_ti_h=1, op1_ti_m=20, op1_ti_s=10, &
- op2_ti_yy=0000, op2_ti_mm=00, op2_ti_dd=1, op2_ti_h=1, op2_ti_m=10, op2_ti_s=10, &
- res_ti_yy=0000, res_ti_mm=00, res_ti_dd=2, res_ti_h=0, res_ti_m=10, res_ti_s=0, &
- testname='SubtractTI_TI_TI1' )
- CALL test_arithmetic( add_op=.FALSE., &
- op1_ti_yy=0000, op1_ti_mm=00, op1_ti_dd=3, op1_ti_h=1, op1_ti_m=20, op1_ti_s=10, &
- op2_ti_yy=0000, op2_ti_mm=00, op2_ti_dd=-1, op2_ti_h=-1, op2_ti_m=-10, op2_ti_s=-10, &
- res_ti_yy=0000, res_ti_mm=00, res_ti_dd=4, res_ti_h=2, res_ti_m=30, res_ti_s=20, &
- testname='SubtractTI_TI_TI2' )
- CALL test_arithmetic( add_op=.FALSE., &
- op1_ti_yy=0000, op1_ti_mm=00, op1_ti_dd=-1, op1_ti_h=-1, op1_ti_m=-10, op1_ti_s=-10, &
- op2_ti_yy=0000, op2_ti_mm=00, op2_ti_dd=-3, op2_ti_h=-1, op2_ti_m=-20, op2_ti_s=-10, &
- res_ti_yy=0000, res_ti_mm=00, res_ti_dd=2, res_ti_h=0, res_ti_m=10, res_ti_s=00, &
- testname='SubtractTI_TI_TI3' )
- ! Negative result MPAS_ESMF_TimeInterval = MPAS_ESMF_TimeInterval - MPAS_ESMF_TimeInterval
- CALL test_arithmetic( add_op=.FALSE., &
- op1_ti_yy=0000, op1_ti_mm=00, op1_ti_dd=1, op1_ti_h=1, op1_ti_m=10, op1_ti_s=10, &
- op2_ti_yy=0000, op2_ti_mm=00, op2_ti_dd=3, op2_ti_h=1, op2_ti_m=20, op2_ti_s=10, &
- res_ti_yy=0000, res_ti_mm=00, res_ti_dd=-2, res_ti_h=0, res_ti_m=-10, res_ti_s=0, &
- testname='SubtractTI_TI_TIN1' )
- CALL test_arithmetic( add_op=.FALSE., &
- op1_ti_yy=0000, op1_ti_mm=00, op1_ti_dd=-1, op1_ti_h=-1, op1_ti_m=-10, op1_ti_s=-10, &
- op2_ti_yy=0000, op2_ti_mm=00, op2_ti_dd=3, op2_ti_h=1, op2_ti_m=20, op2_ti_s=10, &
- res_ti_yy=0000, res_ti_mm=00, res_ti_dd=-4, res_ti_h=-2, res_ti_m=-30, res_ti_s=-20, &
- testname='SubtractTI_TI_TIN2' )
-
- ! Un-normalized MPAS_ESMF_TimeInterval = MPAS_ESMF_TimeInterval - MPAS_ESMF_TimeInterval
- ! this is an error
-! CALL test_arithmetic( add_op=.FALSE., &
-! op1_ti_yy=2001, op1_ti_mm=11, op1_ti_dd=3, op1_ti_h=1, op1_ti_m=20, op1_ti_s=10, &
-! op2_ti_yy=2001, op2_ti_mm=11, op2_ti_dd=1, op2_ti_h=1, op2_ti_m=10, op2_ti_s=10, &
-! res_ti_yy=0000, res_ti_mm=00, res_ti_dd=2, res_ti_h=0, res_ti_m=10, res_ti_s=0, &
-! testname='SubtractTI_TI_TIU1', expect_error=.TRUE. )
-
- ! this one should FAIL, and does
-! CALL test_arithmetic( add_op=.TRUE., &
-! op1_t_yy=2001, op1_t_mm=12, op1_t_dd=3, op1_t_h=1, op1_t_m=20, op1_t_s=10, &
-! op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=0, op2_ti_h=3, op2_ti_m=10, op2_ti_s=10, &
-! res_t_yy=2002, res_t_mm=12, res_t_dd=3, res_t_h=4, res_t_m=30, res_t_s=20, &
-! testname='AddTT1' )
-
- ! Multiplication tests
- ! MPAS_ESMF_TimeInterval = MPAS_ESMF_TimeInterval * INTEGER
- CALL test_arithmetic( multiply_op=.TRUE., &
- op1_ti_dd=3, op1_ti_h=12, op1_ti_m=18, op1_ti_s=33, &
- op2_int=2, &
- res_ti_dd=6, res_ti_h=24, res_ti_m=37, res_ti_s=06, &
- testname='MultiplyTI_TI_INT1' )
- CALL test_arithmetic( multiply_op=.TRUE., &
- op1_ti_dd=350, op1_ti_h=23, op1_ti_m=50, op1_ti_s=50, &
- op2_int=2, &
- res_ti_dd=701, res_ti_h=23, res_ti_m=41, res_ti_s=40,&
- testname='MultiplyTI_TI_INT2' )
- CALL test_arithmetic( multiply_op=.TRUE., &
- op1_ti_s=01, op1_ti_sn=03, op1_ti_sd=04, &
- op2_int=8, &
- res_ti_s=14, &
- testname='MultiplyTI_TI_INT3' )
-
- ! Division tests
- ! MPAS_ESMF_TimeInterval = MPAS_ESMF_TimeInterval / INTEGER
- CALL test_arithmetic( multiply_op=.FALSE., &
- op1_ti_dd=3, op1_ti_h=12, op1_ti_m=18, op1_ti_s=33, &
- op2_int=3, &
- res_ti_dd=1, res_ti_h=04, res_ti_m=06, res_ti_s=11, &
- testname='DivideTI_TI_INT1' )
- CALL test_arithmetic( multiply_op=.FALSE., &
- op1_ti_dd=3, op1_ti_h=12, op1_ti_m=18, op1_ti_s=33, &
- op2_int=4, &
- res_ti_dd=0, res_ti_h=21, res_ti_m=04, res_ti_s=38, &
- res_ti_sn=1, res_ti_sd=4, &
- testname='DivideTI_TI_INT2' )
- CALL test_arithmetic( multiply_op=.FALSE., &
- op1_ti_s=01, op1_ti_sn=03, op1_ti_sd=04, &
- op2_int=5, &
- res_ti_s=0, res_ti_sn=7, res_ti_sd=20, &
- testname='DivideTI_TI_INT3' )
- ! INTEGER = MPAS_ESMF_TimeInterval / MPAS_ESMF_TimeInterval
- ! this operator truncates to whole integers
- CALL test_arithmetic( multiply_op=.FALSE., &
- op1_ti_dd=3, op1_ti_h=12, op1_ti_m=18, op1_ti_s=33, &
- op2_ti_dd=3, op2_ti_h=12, op2_ti_m=18, op2_ti_s=33, &
- res_int=1, &
- testname='DivideINT_TI_TI1' )
- CALL test_arithmetic( multiply_op=.FALSE., &
- op1_ti_dd=6, op1_ti_h=24, op1_ti_m=36, op1_ti_s=66, &
- op2_ti_dd=3, op2_ti_h=12, op2_ti_m=18, op2_ti_s=33, &
- res_int=2, &
- testname='DivideINT_TI_TI2' )
- CALL test_arithmetic( multiply_op=.FALSE., &
- op1_ti_dd=0, op1_ti_h=00, op1_ti_m=00, op1_ti_s=00, &
- op2_ti_dd=3, op2_ti_h=12, op2_ti_m=18, op2_ti_s=33, &
- res_int=0, &
- testname='DivideINT_TI_TI3' )
- CALL test_arithmetic( multiply_op=.FALSE., &
- op1_ti_dd=1, op1_ti_h=00, op1_ti_m=00, op1_ti_s=00, &
- op2_ti_dd=0, op2_ti_h=01, op2_ti_m=00, op2_ti_s=00, &
- res_int=24, &
- testname='DivideINT_TI_TI4' )
- CALL test_arithmetic( multiply_op=.FALSE., &
- op1_ti_dd=1, op1_ti_h=00, op1_ti_m=00, op1_ti_s=00, &
- op2_ti_dd=0, op2_ti_h=00, op2_ti_m=01, op2_ti_s=00, &
- res_int=1440, &
- testname='DivideINT_TI_TI5' )
- CALL test_arithmetic( multiply_op=.FALSE., &
- op1_ti_dd=1, op1_ti_h=00, op1_ti_m=00, op1_ti_s=00, &
- op2_ti_dd=0, op2_ti_h=00, op2_ti_m=00, op2_ti_s=01, &
- res_int=86400, &
- testname='DivideINT_TI_TI6' )
- ! rounding
- CALL test_arithmetic( multiply_op=.FALSE., &
- op1_ti_dd=0, op1_ti_h=00, op1_ti_m=00, op1_ti_s=03, &
- op2_ti_dd=0, op2_ti_h=00, op2_ti_m=00, op2_ti_s=02, &
- res_int=1, &
- testname='DivideINT_TI_TIR1' )
- CALL test_arithmetic( multiply_op=.FALSE., &
- op1_ti_dd=1, op1_ti_h=00, op1_ti_m=00, op1_ti_s=02, &
- op2_ti_dd=1, op2_ti_h=00, op2_ti_m=00, op2_ti_s=03, &
- res_int=0, &
- testname='DivideINT_TI_TIR2' )
- ! fractional operands
- CALL test_arithmetic( multiply_op=.FALSE., &
- op1_ti_m=00, op1_ti_s=00, op1_ti_sn=03, op1_ti_sd=04, &
- op2_ti_m=00, op2_ti_s=00, op2_ti_sn=03, op2_ti_sd=04, &
- res_int=1, &
- testname='DivideINT_TI_TIF1' )
- CALL test_arithmetic( multiply_op=.FALSE., &
- op1_ti_m=00, op1_ti_s=00, op1_ti_sn=06, op1_ti_sd=08, &
- op2_ti_m=00, op2_ti_s=00, op2_ti_sn=03, op2_ti_sd=04, &
- res_int=1, &
- testname='DivideINT_TI_TIF2' )
- CALL test_arithmetic( multiply_op=.FALSE., &
- op1_ti_m=00, op1_ti_s=00, op1_ti_sn=03, op1_ti_sd=04, &
- op2_ti_m=00, op2_ti_s=00, op2_ti_sn=04, op2_ti_sd=03, &
- res_int=0, &
- testname='DivideINT_TI_TIF3' )
- CALL test_arithmetic( multiply_op=.FALSE., &
- op1_ti_m=00, op1_ti_s=02, op1_ti_sn=03, op1_ti_sd=04, &
- op2_ti_m=00, op2_ti_s=01, op2_ti_sn=01, op2_ti_sd=03, &
- res_int=2, &
- testname='DivideINT_TI_TIF4' )
- ! negative operands
- CALL test_arithmetic( multiply_op=.FALSE., &
- op1_ti_dd=-6, op1_ti_h=-24, op1_ti_m=-36, op1_ti_s=-66, &
- op2_ti_dd=3, op2_ti_h=12, op2_ti_m=18, op2_ti_s=33, &
- res_int=-2, &
- testname='DivideINT_TI_TIN1' )
- CALL test_arithmetic( multiply_op=.FALSE., &
- op1_ti_dd=6, op1_ti_h=24, op1_ti_m=36, op1_ti_s=66, &
- op2_ti_dd=-3, op2_ti_h=-12, op2_ti_m=-18, op2_ti_s=-33, &
- res_int=-2, &
- testname='DivideINT_TI_TIN2' )
- CALL test_arithmetic( multiply_op=.FALSE., &
- op1_ti_dd=-6, op1_ti_h=-24, op1_ti_m=-36, op1_ti_s=-66, &
- op2_ti_dd=-3, op2_ti_h=-12, op2_ti_m=-18, op2_ti_s=-33, &
- res_int=2, &
- testname='DivideINT_TI_TIN3' )
-
-!$$$here... modify these to add self-test PASS/FAIL output
- CALL test_clock_advance( &
- start_yy=2002, start_mm=12, start_dd=27, start_h=3, start_m=0, start_s=0, &
- stop_yy=2002, stop_mm=12, stop_dd=28, stop_h=8, stop_m=0, stop_s=0, &
- timestep_d=0, timestep_h=0, timestep_m=0, timestep_s=600, &
- testname="SimpleClockAdvance" )
-
- CALL test_clock_advance( &
- start_yy=2003, start_mm=12, start_dd=29, start_h=9, start_m=0, start_s=0, &
- stop_yy=2004, stop_mm=1, stop_dd=2, stop_h=9, stop_m=0, stop_s=0, &
- timestep_d=0, timestep_h=0, timestep_m=0, timestep_s=3600, &
- testname="StdYearClockAdvance", increment_S=10 )
-
- CALL test_clock_advance( &
- start_yy=2004, start_mm=12, start_dd=29, start_h=9, start_m=0, start_s=0, &
- stop_yy=2005, stop_mm=1, stop_dd=2, stop_h=9, stop_m=0, stop_s=0, &
- timestep_d=0, timestep_h=0, timestep_m=0, timestep_s=3600, &
- testname="LeapYearClockAdvance", increment_S=10 )
-
- ! NRCM domain 3 case: 120 seconds / 9
- ! 18 timesteps through end of leap year
- CALL test_clock_advance( &
- start_yy=2004, start_mm=12, start_dd=31, start_h=23, start_m=58, start_s=0,&
- stop_yy=2005, stop_mm=1, stop_dd=1, stop_h=0, stop_m=2, stop_s=0, &
- timestep_d=0, timestep_h=0, timestep_m=0, timestep_s=13, &
- timestep_sn=1, timestep_sd=3, &
- testname="LeapYearFractionClockAdvance", &
- increment_S=1, increment_Sn=1, increment_Sd=3 )
-
- CALL MPAS_ESMF_Finalize( rc=rc )
- CALL test_check_error( MPAS_ESMF_SUCCESS, rc, &
- 'MPAS_ESMF_Finalize() ', &
- __FILE__ , &
- __LINE__ )
-
- PRINT *,'END TEST SUITE'
-
-END PROGRAM time_manager_test
-
Added: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/Test1.F90
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/Test1.F90         (rev 0)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/Test1.F90        2012-11-29 22:23:06 UTC (rev 2329)
@@ -0,0 +1,1718 @@
+!
+! Sub-system tests for esmf_time_f90
+!
+! Someday, switch over to funit!
+!
+
+MODULE my_tests
+ USE ESMF_Mod
+ IMPLICIT NONE
+
+ ! Set this to .TRUE. to make wrf_error_fatal3() print a message on failure
+ ! instead of stopping the program. Use for testing only (since we cannot
+ ! catch exceptions in Fortran90!!)
+ LOGICAL :: WRF_ERROR_FATAL_PRINT = .FALSE.
+
+CONTAINS
+
+ ! Test printing of an ESMF_Time or ESMF_TimeInterval object.
+ !
+ ! Correct results are also passed in through this interface and compared
+ ! with computed results. PASS/FAIL messages are printed.
+ !
+ SUBROUTINE test_print( t_yy, t_mm, t_dd, t_h, t_m, t_s, t_sn, t_sd, &
+ ti_yy, ti_mm, ti_dd, ti_h, ti_m, ti_s, ti_sn, ti_sd, &
+ res_str, testname, expect_error )
+ INTEGER, INTENT(IN), OPTIONAL :: t_YY
+ INTEGER, INTENT(IN), OPTIONAL :: t_MM ! month
+ INTEGER, INTENT(IN), OPTIONAL :: t_DD ! day of month
+ INTEGER, INTENT(IN), OPTIONAL :: t_H
+ INTEGER, INTENT(IN), OPTIONAL :: t_M
+ INTEGER, INTENT(IN), OPTIONAL :: t_S
+ INTEGER, INTENT(IN), OPTIONAL :: t_Sn
+ INTEGER, INTENT(IN), OPTIONAL :: t_Sd
+ INTEGER, INTENT(IN), OPTIONAL :: ti_YY
+ INTEGER, INTENT(IN), OPTIONAL :: ti_MM ! month
+ INTEGER, INTENT(IN), OPTIONAL :: ti_DD ! day of month
+ INTEGER, INTENT(IN), OPTIONAL :: ti_H
+ INTEGER, INTENT(IN), OPTIONAL :: ti_M
+ INTEGER, INTENT(IN), OPTIONAL :: ti_S
+ INTEGER, INTENT(IN), OPTIONAL :: ti_Sn
+ INTEGER, INTENT(IN), OPTIONAL :: ti_Sd
+ CHARACTER (LEN=*), INTENT(IN) :: res_str
+ CHARACTER (LEN=*), INTENT(IN), OPTIONAL :: testname
+ LOGICAL, OPTIONAL, INTENT(IN) :: expect_error
+ ! locals
+ INTEGER :: it_YY
+ INTEGER :: it_MM ! month
+ INTEGER :: it_DD ! day of month
+ INTEGER :: it_H
+ INTEGER :: it_M
+ INTEGER :: it_S
+ INTEGER :: it_Sn
+ INTEGER :: it_Sd
+ INTEGER :: iti_YY
+ INTEGER :: iti_MM ! month
+ INTEGER :: iti_DD ! day of month
+ INTEGER :: iti_H
+ INTEGER :: iti_M
+ INTEGER :: iti_S
+ INTEGER :: iti_Sn
+ INTEGER :: iti_Sd
+ LOGICAL :: is_t
+ LOGICAL :: is_ti
+ CHARACTER (LEN=512) :: itestname
+ LOGICAL :: iexpect_error
+ INTEGER rc
+ TYPE(ESMF_Time) :: t
+ TYPE(ESMF_TimeInterval) :: ti
+ CHARACTER(LEN=ESMF_MAXSTR) :: str, computed_str, frac_str
+ CHARACTER(LEN=17) :: type_str
+ INTEGER :: res_len, computed_len, Sn, Sd
+ LOGICAL :: test_passed
+
+! PRINT *,'DEBUG: BEGIN test_print()'
+ it_YY = 0
+ it_MM = 1
+ it_DD = 1
+ it_H = 0
+ it_M = 0
+ it_S = 0
+ it_Sn = 0
+ it_Sd = 0
+ iti_YY = 0
+ iti_MM = 0
+ iti_DD = 0
+ iti_H = 0
+ iti_M = 0
+ iti_S = 0
+ iti_Sn = 0
+ iti_Sd = 0
+ itestname = ''
+ iexpect_error = .FALSE.
+
+ IF ( PRESENT( t_YY ) ) it_YY = t_YY
+ IF ( PRESENT( t_MM ) ) it_MM = t_MM
+ IF ( PRESENT( t_DD ) ) it_DD = t_DD
+ IF ( PRESENT( t_H ) ) it_H = t_H
+ IF ( PRESENT( t_M ) ) it_M = t_M
+ IF ( PRESENT( t_S ) ) it_S = t_S
+ IF ( PRESENT( t_Sn ) ) it_Sn = t_Sn
+ IF ( PRESENT( t_Sd ) ) it_Sd = t_Sd
+ IF ( PRESENT( ti_YY ) ) iti_YY = ti_YY
+ IF ( PRESENT( ti_MM ) ) iti_MM = ti_MM
+ IF ( PRESENT( ti_DD ) ) iti_DD = ti_DD
+ IF ( PRESENT( ti_H ) ) iti_H = ti_H
+ IF ( PRESENT( ti_M ) ) iti_M = ti_M
+ IF ( PRESENT( ti_S ) ) iti_S = ti_S
+ IF ( PRESENT( ti_Sn ) ) iti_Sn = ti_Sn
+ IF ( PRESENT( ti_Sd ) ) iti_Sd = ti_Sd
+ IF ( PRESENT( testname ) ) itestname = TRIM(testname)
+ IF ( PRESENT( expect_error ) ) iexpect_error = expect_error
+
+ ! Ensure that optional arguments are consistent...
+ is_t = ( PRESENT( t_YY ) .OR. PRESENT( t_MM ) .OR. &
+ PRESENT( t_DD ) .OR. PRESENT( t_H ) .OR. &
+ PRESENT( t_M ) .OR. PRESENT( t_S ) .OR. &
+ PRESENT( t_Sn ) .OR. PRESENT( t_Sd ) )
+ is_ti = ( PRESENT( ti_YY ) .OR. PRESENT( ti_MM ) .OR. &
+ PRESENT( ti_DD ) .OR. PRESENT( ti_H ) .OR. &
+ PRESENT( ti_M ) .OR. PRESENT( ti_S ) .OR. &
+ PRESENT( ti_Sn ) .OR. PRESENT( ti_Sd ) )
+ IF ( is_t .EQV. is_ti ) THEN
+ CALL wrf_error_fatal3( __FILE__ , __LINE__ , &
+ 'ERROR test_print: inconsistent args' )
+ ENDIF
+
+!PRINT *,'DEBUG: test_print(): init objects'
+ ! Initialize object to be tested
+ ! modify behavior of wrf_error_fatal3 for tests expected to fail
+ IF ( iexpect_error ) WRF_ERROR_FATAL_PRINT = .TRUE.
+ Sn = 0
+ Sd = 0
+ IF ( is_t ) THEN
+ type_str = 'ESMF_Time'
+!PRINT *,'DEBUG: test_print(): calling ESMF_TimeSet()'
+!PRINT *,'DEBUG: test_print(): YY,MM,DD,H,M,S,Sn,Sd = ', it_YY,it_MM,it_DD,it_H,it_M,it_S,it_Sn,it_Sd
+ CALL ESMF_TimeSet( t, YY=it_YY, MM=it_MM, DD=it_DD , &
+ H=it_H, M=it_M, S=it_S, Sn=it_Sn, Sd=it_Sd, rc=rc )
+!PRINT *,'DEBUG: test_print(): back from ESMF_TimeSet()'
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestname)//'ESMF_TimeSet() ', &
+ __FILE__ , &
+ __LINE__ )
+!PRINT *,'DEBUG: test_print(): calling ESMF_TimeGet()'
+ CALL ESMF_TimeGet( t, timeString=computed_str, Sn=Sn, Sd=Sd, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestname)//'ESMF_TimeGet() ', &
+ __FILE__ , &
+ __LINE__ )
+!PRINT *,'DEBUG: test_print(): back from ESMF_TimeGet(), computed_str = ',TRIM(computed_str)
+ ELSE
+ type_str = 'ESMF_TimeInterval'
+!PRINT *,'DEBUG: test_print(): calling ESMF_TimeIntervalSet()'
+ CALL ESMF_TimeIntervalSet( ti, YY=iti_YY, MM=iti_MM, &
+ D=iti_DD , &
+ H=iti_H, M=iti_M, &
+ S=iti_S, Sn=iti_Sn, Sd=iti_Sd, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestname)//'ESMF_TimeIntervalSet() ', &
+ __FILE__ , &
+ __LINE__ )
+!PRINT *,'DEBUG: test_print(): calling ESMF_TimeIntervalGet()'
+ CALL ESMF_TimeIntervalGet( ti, timeString=computed_str, Sn=Sn, Sd=Sd, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestname)//'ESMF_TimeGet() ', &
+ __FILE__ , &
+ __LINE__ )
+ ENDIF
+ ! handle fractions
+ IF ( Sd > 0 ) THEN
+ IF ( Sn > 0 ) THEN
+ WRITE(frac_str,FMT="('+',I2.2,'/',I2.2)") abs(Sn), Sd
+ ELSE IF ( Sn < 0 ) THEN
+ WRITE(frac_str,FMT="('-',I2.2,'/',I2.2)") abs(Sn), Sd
+ ELSE
+ frac_str = ''
+ ENDIF
+ computed_str = TRIM(computed_str)//TRIM(frac_str)
+ ENDIF
+ ! restore default behavior of wrf_error_fatal3
+ IF ( iexpect_error ) WRF_ERROR_FATAL_PRINT = .FALSE.
+!PRINT *,'DEBUG: test_print(): done init objects'
+
+!PRINT *,'DEBUG: test_print(): check result'
+ ! check result
+ test_passed = .FALSE.
+ res_len = LEN_TRIM(res_str)
+ computed_len = LEN_TRIM(computed_str)
+ IF ( res_len == computed_len ) THEN
+ IF ( computed_str(1:computed_len) == res_str(1:res_len) ) THEN
+ test_passed = .TRUE.
+ ENDIF
+ ENDIF
+ IF ( test_passed ) THEN
+ WRITE(*,FMT='(A)') 'PASS: '//TRIM(itestname)
+ ELSE
+ WRITE(*,'(9A)') 'FAIL: ',TRIM(itestname),': printing ',TRIM(type_str), &
+ ' expected <', TRIM(res_str),'> but computed <',TRIM(computed_str),'>'
+ ENDIF
+!PRINT *,'DEBUG: END test_print()'
+
+ END SUBROUTINE test_print
+
+
+
+ ! Test the following arithmetic operations on ESMF_Time and
+ ! ESMF_TimeInterval objects:
+ ! ESMF_Time = ESMF_Time + ESMF_TimeInterval
+ ! ESMF_Time = ESMF_TimeInterval + ESMF_Time
+ ! ESMF_Time = ESMF_Time - ESMF_TimeInterval
+ ! ESMF_TimeInterval = ESMF_Time - ESMF_Time
+ ! ESMF_TimeInterval = ESMF_TimeInterval + ESMF_TimeInterval
+ ! ESMF_TimeInterval = ESMF_TimeInterval - ESMF_TimeInterval
+ ! ESMF_TimeInterval = ESMF_TimeInterval * INTEGER
+ ! ESMF_TimeInterval = ESMF_TimeInterval / INTEGER
+ !
+ ! Correct results are also passed in through this interface and compared
+ ! with computed results. PASS/FAIL messages are printed.
+ !
+ ! Operations are expressed as res = op1 +|- op2
+ !
+ SUBROUTINE test_arithmetic( add_op, multiply_op, &
+ op1_t_yy, op1_t_mm, op1_t_dd, op1_t_h, op1_t_m, op1_t_s, op1_t_sn, op1_t_sd, &
+ op1_ti_yy, op1_ti_mm, op1_ti_dd, op1_ti_h, op1_ti_m, op1_ti_s, op1_ti_sn, op1_ti_sd, &
+ op2_t_yy, op2_t_mm, op2_t_dd, op2_t_h, op2_t_m, op2_t_s, op2_t_sn, op2_t_sd, &
+ op2_ti_yy, op2_ti_mm, op2_ti_dd, op2_ti_h, op2_ti_m, op2_ti_s, op2_ti_sn, op2_ti_sd, &
+ op2_int, &
+ res_t_yy, res_t_mm, res_t_dd, res_t_h, res_t_m, res_t_s, res_t_sn, res_t_sd, &
+ res_ti_yy, res_ti_mm, res_ti_dd, res_ti_h, res_ti_m, res_ti_s, res_ti_sn, res_ti_sd, &
+ res_int, testname, expect_error )
+ LOGICAL, INTENT(IN), OPTIONAL :: add_op ! .TRUE.=add, .FALSE.=subtract
+ LOGICAL, INTENT(IN), OPTIONAL :: multiply_op ! .TRUE.=multiply, .FALSE.=divide
+ INTEGER, INTENT(IN), OPTIONAL :: op1_t_YY
+ INTEGER, INTENT(IN), OPTIONAL :: op1_t_MM ! month
+ INTEGER, INTENT(IN), OPTIONAL :: op1_t_DD ! day of month
+ INTEGER, INTENT(IN), OPTIONAL :: op1_t_H
+ INTEGER, INTENT(IN), OPTIONAL :: op1_t_M
+ INTEGER, INTENT(IN), OPTIONAL :: op1_t_S
+ INTEGER, INTENT(IN), OPTIONAL :: op1_t_Sn
+ INTEGER, INTENT(IN), OPTIONAL :: op1_t_Sd
+ INTEGER, INTENT(IN), OPTIONAL :: op1_ti_YY
+ INTEGER, INTENT(IN), OPTIONAL :: op1_ti_MM ! month
+ INTEGER, INTENT(IN), OPTIONAL :: op1_ti_DD ! day of month
+ INTEGER, INTENT(IN), OPTIONAL :: op1_ti_H
+ INTEGER, INTENT(IN), OPTIONAL :: op1_ti_M
+ INTEGER, INTENT(IN), OPTIONAL :: op1_ti_S
+ INTEGER, INTENT(IN), OPTIONAL :: op1_ti_Sn
+ INTEGER, INTENT(IN), OPTIONAL :: op1_ti_Sd
+ INTEGER, INTENT(IN), OPTIONAL :: op2_t_YY
+ INTEGER, INTENT(IN), OPTIONAL :: op2_t_MM ! month
+ INTEGER, INTENT(IN), OPTIONAL :: op2_t_DD ! day of month
+ INTEGER, INTENT(IN), OPTIONAL :: op2_t_H
+ INTEGER, INTENT(IN), OPTIONAL :: op2_t_M
+ INTEGER, INTENT(IN), OPTIONAL :: op2_t_S
+ INTEGER, INTENT(IN), OPTIONAL :: op2_t_Sn
+ INTEGER, INTENT(IN), OPTIONAL :: op2_t_Sd
+ INTEGER, INTENT(IN), OPTIONAL :: op2_ti_YY
+ INTEGER, INTENT(IN), OPTIONAL :: op2_ti_MM ! month
+ INTEGER, INTENT(IN), OPTIONAL :: op2_ti_DD ! day of month
+ INTEGER, INTENT(IN), OPTIONAL :: op2_ti_H
+ INTEGER, INTENT(IN), OPTIONAL :: op2_ti_M
+ INTEGER, INTENT(IN), OPTIONAL :: op2_ti_S
+ INTEGER, INTENT(IN), OPTIONAL :: op2_ti_Sn
+ INTEGER, INTENT(IN), OPTIONAL :: op2_ti_Sd
+ INTEGER, INTENT(IN), OPTIONAL :: op2_int
+ INTEGER, INTENT(IN), OPTIONAL :: res_t_YY
+ INTEGER, INTENT(IN), OPTIONAL :: res_t_MM ! month
+ INTEGER, INTENT(IN), OPTIONAL :: res_t_DD ! day of month
+ INTEGER, INTENT(IN), OPTIONAL :: res_t_H
+ INTEGER, INTENT(IN), OPTIONAL :: res_t_M
+ INTEGER, INTENT(IN), OPTIONAL :: res_t_S
+ INTEGER, INTENT(IN), OPTIONAL :: res_t_Sn
+ INTEGER, INTENT(IN), OPTIONAL :: res_t_Sd
+ INTEGER, INTENT(IN), OPTIONAL :: res_ti_YY
+ INTEGER, INTENT(IN), OPTIONAL :: res_ti_MM ! month
+ INTEGER, INTENT(IN), OPTIONAL :: res_ti_DD ! day of month
+ INTEGER, INTENT(IN), OPTIONAL :: res_ti_H
+ INTEGER, INTENT(IN), OPTIONAL :: res_ti_M
+ INTEGER, INTENT(IN), OPTIONAL :: res_ti_S
+ INTEGER, INTENT(IN), OPTIONAL :: res_ti_Sn
+ INTEGER, INTENT(IN), OPTIONAL :: res_ti_Sd
+ INTEGER, INTENT(IN), OPTIONAL :: res_int
+ CHARACTER (LEN=*), OPTIONAL, INTENT(IN) :: testname
+ LOGICAL, OPTIONAL, INTENT(IN) :: expect_error
+ ! locals
+ LOGICAL :: iadd_op
+ LOGICAL :: isubtract_op
+ LOGICAL :: imultiply_op
+ LOGICAL :: idivide_op
+ INTEGER :: iop1_t_YY
+ INTEGER :: iop1_t_MM ! month
+ INTEGER :: iop1_t_DD ! day of month
+ INTEGER :: iop1_t_H
+ INTEGER :: iop1_t_M
+ INTEGER :: iop1_t_S
+ INTEGER :: iop1_t_Sn
+ INTEGER :: iop1_t_Sd
+ INTEGER :: iop1_ti_YY
+ INTEGER :: iop1_ti_MM ! month
+ INTEGER :: iop1_ti_DD ! day of month
+ INTEGER :: iop1_ti_H
+ INTEGER :: iop1_ti_M
+ INTEGER :: iop1_ti_S
+ INTEGER :: iop1_ti_Sn
+ INTEGER :: iop1_ti_Sd
+ INTEGER :: iop2_t_YY
+ INTEGER :: iop2_t_MM ! month
+ INTEGER :: iop2_t_DD ! day of month
+ INTEGER :: iop2_t_H
+ INTEGER :: iop2_t_M
+ INTEGER :: iop2_t_S
+ INTEGER :: iop2_t_Sn
+ INTEGER :: iop2_t_Sd
+ INTEGER :: iop2_ti_YY
+ INTEGER :: iop2_ti_MM ! month
+ INTEGER :: iop2_ti_DD ! day of month
+ INTEGER :: iop2_ti_H
+ INTEGER :: iop2_ti_M
+ INTEGER :: iop2_ti_S
+ INTEGER :: iop2_ti_Sn
+ INTEGER :: iop2_ti_Sd
+ INTEGER :: ires_t_YY
+ INTEGER :: ires_t_MM ! month
+ INTEGER :: ires_t_DD ! day of month
+ INTEGER :: ires_t_H
+ INTEGER :: ires_t_M
+ INTEGER :: ires_t_S
+ INTEGER :: ires_t_Sn
+ INTEGER :: ires_t_Sd
+ INTEGER :: ires_ti_YY
+ INTEGER :: ires_ti_MM ! month
+ INTEGER :: ires_ti_DD ! day of month
+ INTEGER :: ires_ti_H
+ INTEGER :: ires_ti_M
+ INTEGER :: ires_ti_S
+ INTEGER :: ires_ti_Sn
+ INTEGER :: ires_ti_Sd
+ LOGICAL :: op1_is_t , op2_is_t , res_is_t
+ LOGICAL :: op1_is_ti, op2_is_ti, res_is_ti, op2_is_int
+ LOGICAL :: res_is_int
+ INTEGER :: num_ops, num_op1, num_op2, num_res
+ LOGICAL :: unsupported_op, test_passed
+ CHARACTER (LEN=512) :: itestname
+ LOGICAL :: iexpect_error
+ INTEGER :: rc
+ INTEGER :: computed_int, Sn, Sd
+ TYPE(ESMF_Time) :: op1_t , op2_t , res_t, computed_t
+ TYPE(ESMF_TimeInterval) :: op1_ti, op2_ti, res_ti, computed_ti
+ CHARACTER(LEN=ESMF_MAXSTR) :: str, op1_str, op2_str, res_str, computed_str, frac_str
+ CHARACTER(LEN=1) :: op_str
+ CHARACTER(LEN=17) :: op1_type_str, op2_type_str, res_type_str
+
+ iadd_op = .FALSE.
+ isubtract_op = .FALSE.
+ imultiply_op = .FALSE.
+ idivide_op = .FALSE.
+ iop1_t_YY = 0
+ iop1_t_MM = 1
+ iop1_t_DD = 1
+ iop1_t_H = 0
+ iop1_t_M = 0
+ iop1_t_S = 0
+ iop1_t_Sn = 0
+ iop1_t_Sd = 0
+ iop1_ti_YY = 0
+ iop1_ti_MM = 0
+ iop1_ti_DD = 0
+ iop1_ti_H = 0
+ iop1_ti_M = 0
+ iop1_ti_S = 0
+ iop1_ti_Sn = 0
+ iop1_ti_Sd = 0
+ iop2_t_YY = 0
+ iop2_t_MM = 1
+ iop2_t_DD = 1
+ iop2_t_H = 0
+ iop2_t_M = 0
+ iop2_t_S = 0
+ iop2_t_Sn = 0
+ iop2_t_Sd = 0
+ iop2_ti_YY = 0
+ iop2_ti_MM = 0
+ iop2_ti_DD = 0
+ iop2_ti_H = 0
+ iop2_ti_M = 0
+ iop2_ti_S = 0
+ iop2_ti_Sn = 0
+ iop2_ti_Sd = 0
+ ires_t_YY = 0
+ ires_t_MM = 1
+ ires_t_DD = 1
+ ires_t_H = 0
+ ires_t_M = 0
+ ires_t_S = 0
+ ires_t_Sn = 0
+ ires_t_Sd = 0
+ ires_ti_YY = 0
+ ires_ti_MM = 0
+ ires_ti_DD = 0
+ ires_ti_H = 0
+ ires_ti_M = 0
+ ires_ti_S = 0
+ ires_ti_Sn = 0
+ ires_ti_Sd = 0
+ itestname = ''
+ iexpect_error = .FALSE.
+
+ IF ( PRESENT( add_op ) ) THEN
+ iadd_op = add_op
+ isubtract_op = ( .NOT. add_op )
+ ENDIF
+ IF ( PRESENT( multiply_op ) ) THEN
+ imultiply_op = multiply_op
+ idivide_op = ( .NOT. multiply_op )
+ ENDIF
+ num_ops = 0
+ IF ( iadd_op ) num_ops = num_ops + 1
+ IF ( isubtract_op ) num_ops = num_ops + 1
+ IF ( imultiply_op ) num_ops = num_ops + 1
+ IF ( idivide_op ) num_ops = num_ops + 1
+ IF ( num_ops /= 1 ) THEN
+ CALL wrf_error_fatal3( __FILE__ , __LINE__ , &
+ 'ERROR test_arithmetic: inconsistent operation' )
+ ENDIF
+ IF ( PRESENT( op1_t_YY ) ) iop1_t_YY = op1_t_YY
+ IF ( PRESENT( op1_t_MM ) ) iop1_t_MM = op1_t_MM
+ IF ( PRESENT( op1_t_DD ) ) iop1_t_DD = op1_t_DD
+ IF ( PRESENT( op1_t_H ) ) iop1_t_H = op1_t_H
+ IF ( PRESENT( op1_t_M ) ) iop1_t_M = op1_t_M
+ IF ( PRESENT( op1_t_S ) ) iop1_t_S = op1_t_S
+ IF ( PRESENT( op1_t_Sn ) ) iop1_t_Sn = op1_t_Sn
+ IF ( PRESENT( op1_t_Sd ) ) iop1_t_Sd = op1_t_Sd
+ IF ( PRESENT( op1_ti_YY ) ) iop1_ti_YY = op1_ti_YY
+ IF ( PRESENT( op1_ti_MM ) ) iop1_ti_MM = op1_ti_MM
+ IF ( PRESENT( op1_ti_DD ) ) iop1_ti_DD = op1_ti_DD
+ IF ( PRESENT( op1_ti_H ) ) iop1_ti_H = op1_ti_H
+ IF ( PRESENT( op1_ti_M ) ) iop1_ti_M = op1_ti_M
+ IF ( PRESENT( op1_ti_S ) ) iop1_ti_S = op1_ti_S
+ IF ( PRESENT( op1_ti_Sn ) ) iop1_ti_Sn = op1_ti_Sn
+ IF ( PRESENT( op1_ti_Sd ) ) iop1_ti_Sd = op1_ti_Sd
+ IF ( PRESENT( op2_t_YY ) ) iop2_t_YY = op2_t_YY
+ IF ( PRESENT( op2_t_MM ) ) iop2_t_MM = op2_t_MM
+ IF ( PRESENT( op2_t_DD ) ) iop2_t_DD = op2_t_DD
+ IF ( PRESENT( op2_t_H ) ) iop2_t_H = op2_t_H
+ IF ( PRESENT( op2_t_M ) ) iop2_t_M = op2_t_M
+ IF ( PRESENT( op2_t_S ) ) iop2_t_S = op2_t_S
+ IF ( PRESENT( op2_t_Sn ) ) iop2_t_Sn = op2_t_Sn
+ IF ( PRESENT( op2_t_Sd ) ) iop2_t_Sd = op2_t_Sd
+ IF ( PRESENT( op2_ti_YY ) ) iop2_ti_YY = op2_ti_YY
+ IF ( PRESENT( op2_ti_MM ) ) iop2_ti_MM = op2_ti_MM
+ IF ( PRESENT( op2_ti_DD ) ) iop2_ti_DD = op2_ti_DD
+ IF ( PRESENT( op2_ti_H ) ) iop2_ti_H = op2_ti_H
+ IF ( PRESENT( op2_ti_M ) ) iop2_ti_M = op2_ti_M
+ IF ( PRESENT( op2_ti_S ) ) iop2_ti_S = op2_ti_S
+ IF ( PRESENT( op2_ti_Sn ) ) iop2_ti_Sn = op2_ti_Sn
+ IF ( PRESENT( op2_ti_Sd ) ) iop2_ti_Sd = op2_ti_Sd
+ IF ( PRESENT( res_t_YY ) ) ires_t_YY = res_t_YY
+ IF ( PRESENT( res_t_MM ) ) ires_t_MM = res_t_MM
+ IF ( PRESENT( res_t_DD ) ) ires_t_DD = res_t_DD
+ IF ( PRESENT( res_t_H ) ) ires_t_H = res_t_H
+ IF ( PRESENT( res_t_M ) ) ires_t_M = res_t_M
+ IF ( PRESENT( res_t_S ) ) ires_t_S = res_t_S
+ IF ( PRESENT( res_t_Sn ) ) ires_t_Sn = res_t_Sn
+ IF ( PRESENT( res_t_Sd ) ) ires_t_Sd = res_t_Sd
+ IF ( PRESENT( res_ti_YY ) ) ires_ti_YY = res_ti_YY
+ IF ( PRESENT( res_ti_MM ) ) ires_ti_MM = res_ti_MM
+ IF ( PRESENT( res_ti_DD ) ) ires_ti_DD = res_ti_DD
+ IF ( PRESENT( res_ti_H ) ) ires_ti_H = res_ti_H
+ IF ( PRESENT( res_ti_M ) ) ires_ti_M = res_ti_M
+ IF ( PRESENT( res_ti_S ) ) ires_ti_S = res_ti_S
+ IF ( PRESENT( res_ti_Sn ) ) ires_ti_Sn = res_ti_Sn
+ IF ( PRESENT( res_ti_Sd ) ) ires_ti_Sd = res_ti_Sd
+ IF ( PRESENT( testname ) ) itestname = TRIM(testname)
+ IF ( PRESENT( expect_error ) ) iexpect_error = expect_error
+
+ ! Ensure that optional arguments are consistent...
+ op1_is_t = ( PRESENT( op1_t_YY ) .OR. PRESENT( op1_t_MM ) .OR. &
+ PRESENT( op1_t_DD ) .OR. PRESENT( op1_t_H ) .OR. &
+ PRESENT( op1_t_M ) .OR. PRESENT( op1_t_S ) .OR. &
+ PRESENT( op1_t_Sn ) .OR. PRESENT( op1_t_Sd ) )
+ op1_is_ti = ( PRESENT( op1_ti_YY ) .OR. PRESENT( op1_ti_MM ) .OR. &
+ PRESENT( op1_ti_DD ) .OR. PRESENT( op1_ti_H ) .OR. &
+ PRESENT( op1_ti_M ) .OR. PRESENT( op1_ti_S ) .OR. &
+ PRESENT( op1_ti_Sn ) .OR. PRESENT( op1_ti_Sd ) )
+ op2_is_t = ( PRESENT( op2_t_YY ) .OR. PRESENT( op2_t_MM ) .OR. &
+ PRESENT( op2_t_DD ) .OR. PRESENT( op2_t_H ) .OR. &
+ PRESENT( op2_t_M ) .OR. PRESENT( op2_t_S ) .OR. &
+ PRESENT( op2_t_Sn ) .OR. PRESENT( op2_t_Sd ) )
+ op2_is_ti = ( PRESENT( op2_ti_YY ) .OR. PRESENT( op2_ti_MM ) .OR. &
+ PRESENT( op2_ti_DD ) .OR. PRESENT( op2_ti_H ) .OR. &
+ PRESENT( op2_ti_M ) .OR. PRESENT( op2_ti_S ) .OR. &
+ PRESENT( op2_ti_Sn ) .OR. PRESENT( op2_ti_Sd ) )
+ op2_is_int = ( PRESENT( op2_int ) )
+ res_is_t = ( PRESENT( res_t_YY ) .OR. PRESENT( res_t_MM ) .OR. &
+ PRESENT( res_t_DD ) .OR. PRESENT( res_t_H ) .OR. &
+ PRESENT( res_t_M ) .OR. PRESENT( res_t_S ) .OR. &
+ PRESENT( res_t_Sn ) .OR. PRESENT( res_t_Sd ) )
+ res_is_ti = ( PRESENT( res_ti_YY ) .OR. PRESENT( res_ti_MM ) .OR. &
+ PRESENT( res_ti_DD ) .OR. PRESENT( res_ti_H ) .OR. &
+ PRESENT( res_ti_M ) .OR. PRESENT( res_ti_S ) .OR. &
+ PRESENT( res_ti_Sn ) .OR. PRESENT( res_ti_Sd ) )
+ res_is_int = ( PRESENT( res_int ) )
+ num_op1 = 0
+ IF ( op1_is_t ) num_op1 = num_op1 + 1
+ IF ( op1_is_ti ) num_op1 = num_op1 + 1
+ IF ( num_op1 /= 1 ) THEN
+ CALL wrf_error_fatal3( __FILE__ , __LINE__ , &
+ 'ERROR test_arithmetic: inconsistent args for op1' )
+ ENDIF
+ num_op2 = 0
+ IF ( op2_is_t ) num_op2 = num_op2 + 1
+ IF ( op2_is_ti ) num_op2 = num_op2 + 1
+ IF ( op2_is_int ) num_op2 = num_op2 + 1
+ IF ( num_op2 /= 1 ) THEN
+ CALL wrf_error_fatal3( __FILE__ , __LINE__ , &
+ 'ERROR test_arithmetic: inconsistent args for op2' )
+ ENDIF
+ num_res = 0
+ IF ( res_is_t ) num_res = num_res + 1
+ IF ( res_is_ti ) num_res = num_res + 1
+ IF ( res_is_int ) num_res = num_res + 1
+ IF ( num_res /= 1 ) THEN
+ CALL wrf_error_fatal3( __FILE__ , __LINE__ , &
+ 'ERROR test_arithmetic: inconsistent args for result' )
+ ENDIF
+
+ ! Initialize op1
+ IF ( op1_is_t ) THEN
+ op1_type_str = 'ESMF_Time'
+ CALL ESMF_TimeSet( op1_t, YY=iop1_t_YY, MM=iop1_t_MM, DD=iop1_t_DD , &
+ H=iop1_t_H, M=iop1_t_M, S=iop1_t_S, Sn=iop1_t_Sn, Sd=iop1_t_Sd, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestname)//'ESMF_TimeSet() ', &
+ __FILE__ , &
+ __LINE__ )
+ CALL ESMF_TimeGet( op1_t, timeString=op1_str, Sn=Sn, Sd=Sd, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestname)//'ESMF_TimeGet() ', &
+ __FILE__ , &
+ __LINE__ )
+ ! handle fractions
+ CALL fraction_to_string( Sn, Sd, frac_str )
+ op1_str = TRIM(op1_str)//TRIM(frac_str)
+ ELSE
+ op1_type_str = 'ESMF_TimeInterval'
+ CALL ESMF_TimeIntervalSet( op1_ti, YY=iop1_ti_YY, MM=iop1_ti_MM, &
+ D=iop1_ti_DD , &
+ H=iop1_ti_H, M=iop1_ti_M, &
+ S=iop1_ti_S, Sn=iop1_ti_Sn, Sd=iop1_ti_Sd, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestname)//'ESMF_TimeIntervalSet() ', &
+ __FILE__ , &
+ __LINE__ )
+ CALL ESMF_TimeIntervalGet( op1_ti, timeString=op1_str, Sn=Sn, Sd=Sd, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestname)//'ESMF_TimeGet() ', &
+ __FILE__ , &
+ __LINE__ )
+ ! handle fractions
+ CALL fraction_to_string( Sn, Sd, frac_str )
+ op1_str = TRIM(op1_str)//TRIM(frac_str)
+ ENDIF
+ ! Initialize op2
+ IF ( op2_is_t ) THEN
+ op2_type_str = 'ESMF_Time'
+ CALL ESMF_TimeSet( op2_t, YY=iop2_t_YY, MM=iop2_t_MM, DD=iop2_t_DD , &
+ H=iop2_t_H, M=iop2_t_M, S=iop2_t_S, Sn=iop2_t_Sn, Sd=iop2_t_Sd, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestname)//'ESMF_TimeSet() ', &
+ __FILE__ , &
+ __LINE__ )
+ CALL ESMF_TimeGet( op2_t, timeString=op2_str, Sn=Sn, Sd=Sd, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestname)//'ESMF_TimeGet() ', &
+ __FILE__ , &
+ __LINE__ )
+ ! handle fractions
+ CALL fraction_to_string( Sn, Sd, frac_str )
+ op2_str = TRIM(op2_str)//TRIM(frac_str)
+ ELSE IF ( op2_is_ti ) THEN
+ op2_type_str = 'ESMF_TimeInterval'
+ CALL ESMF_TimeIntervalSet( op2_ti, YY=iop2_ti_YY, MM=iop2_ti_MM, &
+ D=iop2_ti_DD , &
+ H=iop2_ti_H, M=iop2_ti_M, &
+ S=iop2_ti_S, Sn=iop2_ti_Sn, Sd=iop2_ti_Sd, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestname)//'ESMF_TimeIntervalSet() ', &
+ __FILE__ , &
+ __LINE__ )
+ CALL ESMF_TimeIntervalGet( op2_ti, timeString=op2_str, Sn=Sn, Sd=Sd, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestname)//'ESMF_TimeGet() ', &
+ __FILE__ , &
+ __LINE__ )
+ ! handle fractions
+ CALL fraction_to_string( Sn, Sd, frac_str )
+ op2_str = TRIM(op2_str)//TRIM(frac_str)
+ ELSE
+ op2_type_str = 'INTEGER'
+ IF ( op2_int > 0 ) THEN
+ WRITE(op2_str,FMT="('+',I8.8)") ABS(op2_int)
+ ELSE
+ WRITE(op2_str,FMT="('-',I8.8)") ABS(op2_int)
+ ENDIF
+ ENDIF
+ ! Initialize res
+ IF ( res_is_t ) THEN ! result is ESMF_Time
+ res_type_str = 'ESMF_Time'
+ CALL ESMF_TimeSet( res_t, YY=ires_t_YY, MM=ires_t_MM, DD=ires_t_DD , &
+ H=ires_t_H, M=ires_t_M, S=ires_t_S, Sn=ires_t_Sn, Sd=ires_t_Sd, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestname)//'ESMF_TimeSet() ', &
+ __FILE__ , &
+ __LINE__ )
+ CALL ESMF_TimeGet( res_t, timeString=res_str, Sn=Sn, Sd=Sd, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestname)//'ESMF_TimeGet() ', &
+ __FILE__ , &
+ __LINE__ )
+ ! handle fractions
+ CALL fraction_to_string( Sn, Sd, frac_str )
+ res_str = TRIM(res_str)//TRIM(frac_str)
+ ELSE IF ( res_is_ti ) THEN ! result is ESMF_TimeInterval
+ res_type_str = 'ESMF_TimeInterval'
+ CALL ESMF_TimeIntervalSet( res_ti, YY=ires_ti_YY, MM=ires_ti_MM, &
+ D=ires_ti_DD , &
+ H=ires_ti_H, M=ires_ti_M, &
+ S=ires_ti_S, Sn=ires_ti_Sn, Sd=ires_ti_Sd, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestname)//'ESMF_TimeIntervalSet() ', &
+ __FILE__ , &
+ __LINE__ )
+ CALL ESMF_TimeIntervalGet( res_ti, timeString=res_str, Sn=Sn, Sd=Sd, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestname)//'ESMF_TimeGet() ', &
+ __FILE__ , &
+ __LINE__ )
+ ! handle fractions
+ CALL fraction_to_string( Sn, Sd, frac_str )
+ res_str = TRIM(res_str)//TRIM(frac_str)
+ ELSE ! result is INTEGER
+ res_type_str = 'INTEGER'
+ IF ( res_int > 0 ) THEN
+ WRITE(res_str,FMT="('+',I8.8)") ABS(res_int)
+ ELSE
+ WRITE(res_str,FMT="('-',I8.8)") ABS(res_int)
+ ENDIF
+ ENDIF
+
+ ! perform requested operation
+ unsupported_op = .FALSE.
+ ! modify behavior of wrf_error_fatal3 for operator being tested
+ IF ( iexpect_error ) WRF_ERROR_FATAL_PRINT = .TRUE.
+ ! add
+ IF ( iadd_op ) THEN
+ op_str = '+'
+ IF ( res_is_t ) THEN ! result is ESMF_Time
+ IF ( op1_is_t .AND. op2_is_ti ) THEN
+ ! ESMF_Time = ESMF_Time + ESMF_TimeInterval
+ computed_t = op1_t + op2_ti
+ ELSE IF ( op1_is_ti .AND. op2_is_t ) THEN
+ ! ESMF_Time = ESMF_TimeInterval + ESMF_Time
+ computed_t = op1_ti + op2_t
+ ELSE
+ unsupported_op = .TRUE.
+ ENDIF
+ ELSE ! result is ESMF_TimeInterval
+ IF ( op1_is_ti .AND. op2_is_ti ) THEN
+ ! ESMF_TimeInterval = ESMF_TimeInterval + ESMF_TimeInterval
+ computed_ti = op1_ti + op2_ti
+ ELSE
+ unsupported_op = .TRUE.
+ ENDIF
+ ENDIF
+ ! subtract
+ ELSE IF ( isubtract_op ) THEN
+ op_str = '-'
+ IF ( res_is_t ) THEN ! result is ESMF_Time
+ IF ( op1_is_t .AND. op2_is_ti ) THEN
+ ! ESMF_Time = ESMF_Time - ESMF_TimeInterval
+ computed_t = op1_t - op2_ti
+ ELSE
+ unsupported_op = .TRUE.
+ ENDIF
+ ELSE ! result is ESMF_TimeInterval
+ IF ( op1_is_t .AND. op2_is_t ) THEN
+ ! ESMF_TimeInterval = ESMF_Time - ESMF_Time
+ computed_ti = op1_t - op2_t
+ ELSE IF ( op1_is_ti .AND. op2_is_ti ) THEN
+ ! ESMF_TimeInterval = ESMF_TimeInterval - ESMF_TimeInterval
+ computed_ti = op1_ti - op2_ti
+ ELSE
+ unsupported_op = .TRUE.
+ ENDIF
+ ENDIF
+ ELSE IF ( imultiply_op ) THEN
+ op_str = '*'
+ IF ( res_is_ti ) THEN ! result is ESMF_TimeInterval
+ IF ( op1_is_ti .AND. op2_is_int ) THEN
+ ! ESMF_TimeInterval = ESMF_TimeInterval * INTEGER
+ computed_ti = op1_ti * op2_int
+ ELSE
+ unsupported_op = .TRUE.
+ ENDIF
+ ENDIF
+ ELSE IF ( idivide_op ) THEN
+ op_str = '/'
+ IF ( res_is_ti ) THEN ! result is ESMF_TimeInterval
+ IF ( op1_is_ti .AND. op2_is_int ) THEN
+ ! ESMF_TimeInterval = ESMF_TimeInterval / INTEGER
+ computed_ti = op1_ti / op2_int
+ ELSE
+ unsupported_op = .TRUE.
+ ENDIF
+ ELSE IF ( res_is_int ) THEN ! result is INTEGER
+ IF ( op1_is_ti .AND. op2_is_ti ) THEN
+ ! INTEGER = ESMF_TimeInterval / ESMF_TimeInterval
+ ! number of whole time intervals
+ computed_int = ESMF_TimeIntervalDIVQuot( op1_ti , op2_ti )
+ ELSE
+ unsupported_op = .TRUE.
+ ENDIF
+ ENDIF
+ ENDIF
+ ! restore default behavior of wrf_error_fatal3
+ IF ( iexpect_error ) WRF_ERROR_FATAL_PRINT = .FALSE.
+ IF ( unsupported_op ) THEN
+ WRITE(str,*) 'ERROR test_arithmetic ',TRIM(itestname), &
+ ': unsupported operation (', &
+ TRIM(res_type_str),' = ',TRIM(op1_type_str),' ',TRIM(op_str),' ', &
+ TRIM(op2_type_str),')'
+ CALL wrf_error_fatal3( __FILE__ , __LINE__ , str )
+ ENDIF
+
+ ! check result
+ test_passed = .FALSE.
+ IF ( res_is_t ) THEN ! result is ESMF_Time
+ IF ( computed_t == res_t ) THEN
+ test_passed = .TRUE.
+ ELSE
+ CALL ESMF_TimeGet( computed_t, timeString=computed_str, Sn=Sn, Sd=Sd, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestname)//'ESMF_TimeGet() ', &
+ __FILE__ , &
+ __LINE__ )
+ ! handle fractions
+ CALL fraction_to_string( Sn, Sd, frac_str )
+ computed_str = TRIM(computed_str)//TRIM(frac_str)
+ ENDIF
+ ELSE IF ( res_is_ti ) THEN ! result is ESMF_TimeInterval
+ IF ( computed_ti == res_ti ) THEN
+ test_passed = .TRUE.
+ ELSE
+ CALL ESMF_TimeIntervalGet( computed_ti, timeString=computed_str, Sn=Sn, Sd=Sd, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestname)//'ESMF_TimeGet() ', &
+ __FILE__ , &
+ __LINE__ )
+ ! handle fractions
+ CALL fraction_to_string( Sn, Sd, frac_str )
+ computed_str = TRIM(computed_str)//TRIM(frac_str)
+ ENDIF
+ ELSE ! result is INTEGER
+ IF ( computed_int == res_int ) THEN
+ test_passed = .TRUE.
+ ELSE
+ IF ( computed_int > 0 ) THEN
+ WRITE(computed_str,FMT="('+',I8.8)") ABS(computed_int)
+ ELSE
+ WRITE(computed_str,FMT="('-',I8.8)") ABS(computed_int)
+ ENDIF
+ ENDIF
+ ENDIF
+ IF ( test_passed ) THEN
+ WRITE(*,FMT='(A)') 'PASS: '//TRIM(itestname)
+ ELSE
+ WRITE(*,*) 'FAIL: ',TRIM(itestname),': (', &
+ TRIM(res_type_str),' = ',TRIM(op1_type_str),' ',TRIM(op_str),' ', &
+ TRIM(op2_type_str),') expected ', &
+ TRIM(res_str),' = ',TRIM(op1_str),' ',TRIM(op_str),' ', &
+ TRIM(op2_str),' but computed ',TRIM(computed_str)
+ ENDIF
+
+ END SUBROUTINE test_arithmetic
+
+
+
+ ! simple clock creation and advance with add-subtract tests thrown in
+ ! no self checks (yet)
+ SUBROUTINE test_clock_advance( &
+ start_yy, start_mm, start_dd, start_h, start_m, start_s, &
+ stop_yy, stop_mm, stop_dd, stop_h, stop_m, stop_s, &
+ timestep_d, timestep_h, timestep_m, timestep_s, timestep_sn, timestep_sd, &
+ testname, increment_S, increment_Sn, increment_Sd )
+ INTEGER, INTENT(IN), OPTIONAL :: start_YY
+ INTEGER, INTENT(IN), OPTIONAL :: start_MM ! month
+ INTEGER, INTENT(IN), OPTIONAL :: start_DD ! day of month
+ INTEGER, INTENT(IN), OPTIONAL :: start_H
+ INTEGER, INTENT(IN), OPTIONAL :: start_M
+ INTEGER, INTENT(IN), OPTIONAL :: start_S
+ INTEGER, INTENT(IN), OPTIONAL :: stop_YY
+ INTEGER, INTENT(IN), OPTIONAL :: stop_MM ! month
+ INTEGER, INTENT(IN), OPTIONAL :: stop_DD ! day of month
+ INTEGER, INTENT(IN), OPTIONAL :: stop_H
+ INTEGER, INTENT(IN), OPTIONAL :: stop_M
+ INTEGER, INTENT(IN), OPTIONAL :: stop_S
+ INTEGER, INTENT(IN), OPTIONAL :: timestep_D ! day
+ INTEGER, INTENT(IN), OPTIONAL :: timestep_H
+ INTEGER, INTENT(IN), OPTIONAL :: timestep_M
+ INTEGER, INTENT(IN), OPTIONAL :: timestep_S
+ INTEGER, INTENT(IN), OPTIONAL :: timestep_Sn
+ INTEGER, INTENT(IN), OPTIONAL :: timestep_Sd
+ CHARACTER (LEN=*), OPTIONAL, INTENT(IN) :: testname
+ INTEGER, INTENT(IN), OPTIONAL :: increment_S ! add and subtract this
+ INTEGER, INTENT(IN), OPTIONAL :: increment_Sn ! value each time step
+ INTEGER, INTENT(IN), OPTIONAL :: increment_Sd
+
+ ! locals
+ INTEGER :: istart_YY
+ INTEGER :: istart_MM ! month
+ INTEGER :: istart_DD ! day of month
+ INTEGER :: istart_H
+ INTEGER :: istart_M
+ INTEGER :: istart_S
+ INTEGER :: istop_YY
+ INTEGER :: istop_MM ! month
+ INTEGER :: istop_DD ! day of month
+ INTEGER :: istop_H
+ INTEGER :: istop_M
+ INTEGER :: istop_S
+ INTEGER :: itimestep_D ! day
+ INTEGER :: itimestep_H
+ INTEGER :: itimestep_M
+ INTEGER :: itimestep_S
+ INTEGER :: itimestep_Sn
+ INTEGER :: itimestep_Sd
+ CHARACTER (LEN=512) :: itestname, itestfullname
+ INTEGER :: iincrement_S
+ INTEGER :: iincrement_Sn
+ INTEGER :: iincrement_Sd
+ INTEGER :: Sn, Sd
+ INTEGER rc
+ TYPE(ESMF_Time) :: start_time, stop_time, current_time
+ TYPE(ESMF_Clock), POINTER :: domain_clock
+ TYPE(ESMF_TimeInterval) :: timestep, increment
+ TYPE(ESMF_Time) :: add_time, subtract_time
+ INTEGER :: itimestep
+ REAL(ESMF_KIND_R8) :: dayr8
+ CHARACTER(LEN=ESMF_MAXSTR) :: str, frac_str
+
+ istart_YY = 0
+ istart_MM = 1
+ istart_DD = 1
+ istart_H = 0
+ istart_M = 0
+ istart_S = 0
+ istop_YY = 0
+ istop_MM = 1
+ istop_DD = 1
+ istop_H = 0
+ istop_M = 0
+ istop_S = 0
+ itimestep_D = 0
+ itimestep_H = 0
+ itimestep_M = 0
+ itimestep_S = 0
+ itimestep_Sn = 0
+ itimestep_Sd = 0
+ itestname = ''
+ iincrement_S = 0
+ iincrement_Sn = 0
+ iincrement_Sd = 0
+
+ IF ( PRESENT( start_YY ) ) istart_YY = start_YY
+ IF ( PRESENT( start_MM ) ) istart_MM = start_MM
+ IF ( PRESENT( start_DD ) ) istart_DD = start_DD
+ IF ( PRESENT( start_H ) ) istart_H = start_H
+ IF ( PRESENT( start_M ) ) istart_M = start_M
+ IF ( PRESENT( start_S ) ) istart_S = start_S
+ IF ( PRESENT( stop_YY ) ) istop_YY = stop_YY
+ IF ( PRESENT( stop_MM ) ) istop_MM = stop_MM
+ IF ( PRESENT( stop_DD ) ) istop_DD = stop_DD
+ IF ( PRESENT( stop_H ) ) istop_H = stop_H
+ IF ( PRESENT( stop_M ) ) istop_M = stop_M
+ IF ( PRESENT( stop_S ) ) istop_S = stop_S
+ IF ( PRESENT( timestep_D ) ) itimestep_D = timestep_D
+ IF ( PRESENT( timestep_H ) ) itimestep_H = timestep_H
+ IF ( PRESENT( timestep_M ) ) itimestep_M = timestep_M
+ IF ( PRESENT( timestep_S ) ) itimestep_S = timestep_S
+ IF ( PRESENT( timestep_Sn ) ) itimestep_Sn = timestep_Sn
+ IF ( PRESENT( timestep_Sd ) ) itimestep_Sd = timestep_Sd
+ IF ( PRESENT( testname ) ) itestname = TRIM(testname)//'_'
+ IF ( PRESENT( increment_S ) ) iincrement_S = increment_S
+ IF ( PRESENT( increment_Sn ) ) iincrement_Sn = increment_Sn
+ IF ( PRESENT( increment_Sd ) ) iincrement_Sd = increment_Sd
+
+ ! Initialize start time, stop time, time step, clock for simple case.
+ itestfullname = TRIM(itestname)//'SETUP'
+ CALL ESMF_TimeSet( start_time, YY=istart_YY, MM=istart_MM, DD=istart_DD , &
+ H=istart_H, M=istart_M, S=istart_S, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestfullname)//'ESMF_TimeSet() ', &
+ __FILE__ , &
+ __LINE__ )
+
+ CALL ESMF_TimeGet( start_time, timeString=str, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestfullname)//'ESMF_TimeGet() ', &
+ __FILE__ , &
+ __LINE__ )
+ WRITE(*,FMT='(A,A,A,A)') TRIM(itestfullname),': start_time = <',TRIM(str),'>'
+
+ CALL ESMF_TimeSet( stop_time, YY=istop_YY, MM=istop_MM, DD=istop_DD , &
+ H=istop_H, M=istop_M, S=istop_S, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestfullname)//'ESMF_TimeSet() ', &
+ __FILE__ , &
+ __LINE__ )
+
+ CALL ESMF_TimeGet( stop_time, timeString=str, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestfullname)//'ESMF_TimeGet() ', &
+ __FILE__ , &
+ __LINE__ )
+ WRITE(*,FMT='(A,A,A,A)') TRIM(itestfullname),': stop_time = <',TRIM(str),'>'
+
+ CALL ESMF_TimeIntervalSet( timestep, D=itimestep_D, H=itimestep_H, &
+ M=itimestep_M, S=itimestep_S, &
+ Sn=itimestep_Sn, Sd=itimestep_Sd, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestfullname)//'ESMF_TimeIntervalSet() ', &
+ __FILE__ , &
+ __LINE__ )
+
+ CALL ESMF_TimeIntervalGet( timestep, timeString=str, Sn=Sn, Sd=Sd, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestfullname)//'ESMF_TimeIntervalGet() ', &
+ __FILE__ , &
+ __LINE__ )
+ ! handle fractions
+ CALL fraction_to_string( Sn, Sd, frac_str )
+ str = TRIM(str)//TRIM(frac_str)
+ WRITE(*,FMT='(A,A,A,A)') TRIM(itestfullname),': timestep = <',TRIM(str),'>'
+
+ CALL ESMF_TimeIntervalSet( increment, S=iincrement_S, &
+ Sn=iincrement_Sn, Sd=iincrement_Sd, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestfullname)//'ESMF_TimeIntervalSet() ', &
+ __FILE__ , &
+ __LINE__ )
+
+ CALL ESMF_TimeIntervalGet( increment, timeString=str, Sn=Sn, Sd=Sd, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestfullname)//'ESMF_TimeIntervalGet() ', &
+ __FILE__ , &
+ __LINE__ )
+ ! handle fractions
+ CALL fraction_to_string( Sn, Sd, frac_str )
+ str = TRIM(str)//TRIM(frac_str)
+ WRITE(*,FMT='(A,A,A,A)') TRIM(itestfullname),': increment = <',TRIM(str),'>'
+
+ ALLOCATE( domain_clock )
+ domain_clock = ESMF_ClockCreate( TimeStep= timestep, &
+ StartTime=start_time, &
+ StopTime= stop_time, &
+ rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestfullname)//'ESMF_ClockCreate() ', &
+ __FILE__ , &
+ __LINE__ )
+
+ CALL ESMF_ClockGet( domain_clock, CurrTime=current_time, &
+ rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestfullname)//'ESMF_ClockGet() ', &
+ __FILE__ , &
+ __LINE__ )
+
+ CALL ESMF_TimeGet( current_time, timeString=str, Sn=Sn, Sd=Sd, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestfullname)//'ESMF_TimeGet() ', &
+ __FILE__ , &
+ __LINE__ )
+ CALL fraction_to_string( Sn, Sd, frac_str )
+ str = TRIM(str)//TRIM(frac_str)
+ WRITE(*,FMT='(A,A,A,A)') TRIM(itestfullname),': clock current_time = <',TRIM(str),'>'
+
+ CALL ESMF_TimeGet( current_time, dayOfYear_r8=dayr8, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestfullname)//'ESMF_TimeGet() ', &
+ __FILE__ , &
+ __LINE__ )
+ WRITE(*,FMT='(A,A,F10.6,A)') TRIM(itestfullname),': current_time dayOfYear_r8 = < ',dayr8,' >'
+
+ subtract_time = current_time - increment
+ CALL ESMF_TimeGet( subtract_time, timeString=str, Sn=Sn, Sd=Sd, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestfullname)//'ESMF_TimeGet() ', &
+ __FILE__ , &
+ __LINE__ )
+ CALL fraction_to_string( Sn, Sd, frac_str )
+ str = TRIM(str)//TRIM(frac_str)
+ WRITE(*,FMT='(A,A,A,A)') TRIM(itestfullname),': current_time-increment = <',TRIM(str),'>'
+
+ add_time = current_time + increment
+ CALL ESMF_TimeGet( add_time, timeString=str, Sn=Sn, Sd=Sd, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestfullname)//'ESMF_TimeGet() ', &
+ __FILE__ , &
+ __LINE__ )
+ CALL fraction_to_string( Sn, Sd, frac_str )
+ str = TRIM(str)//TRIM(frac_str)
+ WRITE(*,FMT='(A,A,A,A)') TRIM(itestfullname),': current_time+increment = <',TRIM(str),'>'
+
+ ! Advance clock.
+ itestfullname = TRIM(itestname)//'ADVANCE'
+ itimestep = 0
+ DO WHILE ( .NOT. ESMF_ClockIsStopTime(domain_clock ,rc=rc) )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestfullname)//'ESMF_ClockIsStopTime() ', &
+ __FILE__ , &
+ __LINE__ )
+ itimestep = itimestep + 1
+
+ CALL ESMF_ClockAdvance( domain_clock, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestfullname)//'ESMF_ClockAdvance() ', &
+ __FILE__ , &
+ __LINE__ )
+
+ CALL ESMF_ClockGet( domain_clock, CurrTime=current_time, &
+ rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestfullname)//'ESMF_ClockGet() ', &
+ __FILE__ , &
+ __LINE__ )
+
+ CALL ESMF_TimeGet( current_time, timeString=str, Sn=Sn, Sd=Sd, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestfullname)//'ESMF_TimeGet() ', &
+ __FILE__ , &
+ __LINE__ )
+ CALL fraction_to_string( Sn, Sd, frac_str )
+ str = TRIM(str)//TRIM(frac_str)
+ WRITE(*,FMT='(A,A,I6.6,A,A,A)') TRIM(itestfullname),': count = ', &
+ itimestep,' current_time = <',TRIM(str),'>'
+
+ subtract_time = current_time - increment
+ CALL ESMF_TimeGet( subtract_time, timeString=str, Sn=Sn, Sd=Sd, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestfullname)//'ESMF_TimeGet() ', &
+ __FILE__ , &
+ __LINE__ )
+ CALL fraction_to_string( Sn, Sd, frac_str )
+ str = TRIM(str)//TRIM(frac_str)
+ WRITE(*,FMT='(A,A,A,A)') TRIM(itestfullname),': current_time-increment = <',TRIM(str),'>'
+
+ add_time = current_time + increment
+ CALL ESMF_TimeGet( add_time, timeString=str, Sn=Sn, Sd=Sd, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ TRIM(itestfullname)//'ESMF_TimeGet() ', &
+ __FILE__ , &
+ __LINE__ )
+ CALL fraction_to_string( Sn, Sd, frac_str )
+ str = TRIM(str)//TRIM(frac_str)
+ WRITE(*,FMT='(A,A,A,A)') TRIM(itestfullname),': current_time+increment = <',TRIM(str),'>'
+
+ ENDDO
+
+ DEALLOCATE( domain_clock )
+
+ END SUBROUTINE test_clock_advance
+
+END MODULE my_tests
+
+
+#if defined( TIME_F90_ONLY )
+
+! TBH: Improve the build of Test1.exe to use WRF versions of these
+! TBH: routines and remove these hacked-in duplicates!!
+
+SUBROUTINE wrf_abort
+ IMPLICIT NONE
+#if defined( DM_PARALLEL ) && ! defined( STUBMPI )
+ INCLUDE 'mpif.h'
+ INTEGER ierr
+ CALL mpi_abort(MPI_COMM_WORLD,1,ierr)
+#else
+ STOP
+#endif
+END SUBROUTINE wrf_abort
+
+SUBROUTINE wrf_message( str )
+ IMPLICIT NONE
+ CHARACTER*(*) str
+#if defined( DM_PARALLEL ) && ! defined( STUBMPI)
+ write(0,*) str
+#endif
+ print*, str
+END SUBROUTINE wrf_message
+
+! intentionally write to stderr only
+SUBROUTINE wrf_message2( str )
+ IMPLICIT NONE
+ CHARACTER*(*) str
+ write(0,*) str
+END SUBROUTINE wrf_message2
+
+SUBROUTINE wrf_error_fatal3( file_str, line, str )
+ USE my_tests
+ IMPLICIT NONE
+ CHARACTER*(*) file_str
+ INTEGER , INTENT (IN) :: line ! only print file and line if line > 0
+ CHARACTER*(*) str
+ CHARACTER*256 :: line_str
+ write(line_str,'(i6)') line
+ ! special behavior for testing since Fortran cannot catch exceptions
+ IF ( WRF_ERROR_FATAL_PRINT ) THEN
+ ! just print message and continue
+ CALL wrf_message( 'ERROR IN FILE: '//TRIM(file_str)//' LINE: '//TRIM(line_str) )
+ ELSE
+ ! normal behavior
+#if defined( DM_PARALLEL ) && ! defined( STUBMPI )
+ CALL wrf_message( '-------------- FATAL CALLED ---------------' )
+ ! only print file and line if line is positive
+ IF ( line > 0 ) THEN
+ CALL wrf_message( 'FATAL CALLED FROM FILE: '//file_str//' LINE: '//TRIM(line_str) )
+ ENDIF
+ CALL wrf_message( str )
+ CALL wrf_message( '-------------------------------------------' )
+#else
+ CALL wrf_message2( '-------------- FATAL CALLED ---------------' )
+ ! only print file and line if line is positive
+ IF ( line > 0 ) THEN
+ CALL wrf_message( 'FATAL CALLED FROM FILE: '//file_str//' LINE: '//TRIM(line_str) )
+ ENDIF
+ CALL wrf_message2( str )
+ CALL wrf_message2( '-------------------------------------------' )
+#endif
+ CALL wrf_abort
+ ENDIF
+END SUBROUTINE wrf_error_fatal3
+
+SUBROUTINE wrf_error_fatal( str )
+ IMPLICIT NONE
+ CHARACTER*(*) str
+ CALL wrf_error_fatal3 ( ' ', 0, str )
+END SUBROUTINE wrf_error_fatal
+
+#endif
+
+
+! Check to see if expected value == actual value
+! If not, print message and exit.
+SUBROUTINE test_check_error( expected, actual, str, file_str, line )
+ IMPLICIT NONE
+ INTEGER , INTENT (IN) :: expected
+ INTEGER , INTENT (IN) :: actual
+ CHARACTER*(*) str
+ CHARACTER*(*) file_str
+ INTEGER , INTENT (IN) :: line
+ CHARACTER (LEN=512) :: rc_str
+ CHARACTER (LEN=512) :: str_with_rc
+ IF ( expected .ne. actual ) THEN
+ WRITE (rc_str,*) ' Routine returned error code = ',actual
+ str_with_rc = 'FAIL: '//TRIM(str)//TRIM(rc_str)
+ CALL wrf_error_fatal3( file_str, line, str_with_rc )
+ ENDIF
+END SUBROUTINE test_check_error
+
+
+
+PROGRAM time_manager_test
+ USE ESMF_Mod
+ USE my_tests
+ IMPLICIT NONE
+ INTEGER :: rc
+
+ PRINT *,'BEGIN TEST SUITE'
+
+ CALL ESMF_Initialize( defaultCalendar=ESMF_CAL_GREGORIAN, rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ 'ESMF_Initialize() ', &
+ __FILE__ , &
+ __LINE__ )
+! PRINT *,'DEBUG: back from ESMF_Initialize(), rc = ',rc
+
+! CALL test_print( t_yy, t_mm, t_dd, t_h, t_m, t_s, &
+! ti_yy, ti_mm, ti_dd, ti_h, ti_m, ti_s, &
+! res_str, testname )
+
+ ! Print times
+ ! "vanilla" tests
+! PRINT *,'DEBUG: calling 1st test_print()'
+ CALL test_print( t_yy=2001, t_mm=12, t_dd=3, t_h=1, t_m=20, t_s=10, &
+ res_str='2001-12-03_01:20:10', testname='printT_1' )
+! PRINT *,'DEBUG: back from 1st test_print()'
+ CALL test_print( t_yy=0, t_mm=1, t_dd=1, t_h=0, t_m=0, t_s=0, &
+ res_str='0000-01-01_00:00:00', testname='printT_2' )
+ CALL test_print( t_yy=2003, t_mm=12, t_dd=30, t_h=23, t_m=59, t_s=50, &
+ res_str='2003-12-30_23:59:50', testname='printT_3' )
+ CALL test_print( t_yy=2003, t_mm=12, t_dd=31, t_h=23, t_m=59, t_s=50, &
+ res_str='2003-12-31_23:59:50', testname='printT_4' )
+ CALL test_print( t_yy=2004, t_mm=12, t_dd=30, t_h=23, t_m=59, t_s=50, &
+ res_str='2004-12-30_23:59:50', testname='printT_5' )
+ CALL test_print( t_yy=2004, t_mm=12, t_dd=31, t_h=23, t_m=59, t_s=50, &
+ res_str='2004-12-31_23:59:50', testname='printT_6' )
+!$$$ NOTE that this fails -- need to fix up output string for negative year
+! CALL test_print( t_yy=-2004, t_mm=12, t_dd=31, t_h=23, t_m=59, t_s=50, &
+! res_str='-2004-12-31_23:59:50', testname='printT_6' )
+
+ ! these test default behavior of test harness
+ CALL test_print( t_s=0, &
+ res_str='0000-01-01_00:00:00', testname='printT_D1' )
+ CALL test_print( t_yy=0, &
+ res_str='0000-01-01_00:00:00', testname='printT_D2' )
+
+ ! fractions
+ CALL test_print( t_yy=2001, t_mm=12, t_dd=3, t_h=1, t_m=20, t_s=10, &
+ t_sn=1, t_sd=3, &
+ res_str='2001-12-03_01:20:10+01/03', testname='printT_F1' )
+ CALL test_print( t_yy=2001, t_mm=12, t_dd=3, t_h=1, t_m=20, t_s=10, &
+ t_sn=4, t_sd=3, &
+ res_str='2001-12-03_01:20:11+01/03', testname='printT_F2' )
+ CALL test_print( t_yy=2001, t_mm=12, t_dd=3, t_h=1, t_m=20, t_s=10, &
+ t_sn=12, t_sd=3, &
+ res_str='2001-12-03_01:20:14', testname='printT_F3' )
+ CALL test_print( t_yy=2001, t_mm=12, t_dd=3, t_h=1, t_m=20, t_s=10, &
+ t_sn=-1, t_sd=3, &
+ res_str='2001-12-03_01:20:09+02/03', testname='printT_F4' )
+
+ ! ERROR, MM out of range
+!$$$here... fix so this just prints "ERROR: <testname>" in failure case
+!$$$here... also need "expect_fail" to reverse sense of PASS/FAIL message for
+!$$$here... tests that should fail
+! CALL test_print( t_yy=2001, t_mm=13, t_dd=3, t_h=1, t_m=20, t_s=10, &
+! res_str='2002-01-03_01:20:10', testname='printT_E1', expect_error=.TRUE. )
+
+ ! Print time intervals
+ ! "vanilla" tests
+ CALL test_print( ti_yy=0, ti_mm=0, ti_dd=0, ti_h=0, ti_m=0, ti_s=0, &
+ res_str='0000000000_000:000:000', testname='printTI_1' )
+ CALL test_print( ti_yy=0, ti_mm=0, ti_dd=500, ti_h=0, ti_m=0, ti_s=7270, &
+ res_str='0000000500_002:001:010', testname='printTI_2' )
+
+ ! these test default behavior of test harness
+ CALL test_print( ti_s=0, &
+ res_str='0000000000_000:000:000', testname='printTI_D1' )
+ CALL test_print( ti_yy=0, &
+ res_str='0000000000_000:000:000', testname='printTI_D2' )
+
+ ! these test negative values
+ CALL test_print( ti_yy=0000, ti_mm=0, ti_dd=-3, ti_h=-1, ti_m=-20, ti_s=-10, &
+ res_str='-0000000003_001:020:010', testname='printTI_N1' )
+
+ ! these test mixed values
+ CALL test_print( ti_yy=0000, ti_mm=0, ti_dd=-3, ti_h=1, ti_m=20, ti_s=10, &
+ res_str='-0000000002_022:039:050', testname='printTI_M1' )
+
+ ! fractions
+ CALL test_print( ti_yy=0000, ti_mm=0, ti_dd=3, ti_h=1, ti_m=20, ti_s=10, &
+ ti_sn=1, ti_sd=3, &
+ res_str='0000000003_001:020:010+01/03', testname='printTI_F1' )
+ CALL test_print( ti_yy=0000, ti_mm=0, ti_dd=3, ti_h=1, ti_m=20, ti_s=10, &
+ ti_sn=5, ti_sd=3, &
+ res_str='0000000003_001:020:011+02/03', testname='printTI_F2' )
+ CALL test_print( ti_yy=0000, ti_mm=0, ti_dd=-3, ti_h=-1, ti_m=-20, ti_s=-10, &
+ ti_sn=-1, ti_sd=3, &
+ res_str='-0000000003_001:020:010-01/03', testname='printTI_F3' )
+ CALL test_print( ti_yy=0000, ti_mm=0, ti_dd=-3, ti_h=-1, ti_m=-20, ti_s=-10, &
+ ti_sn=1, ti_sd=3, &
+ res_str='-0000000003_001:020:009-02/03', testname='printTI_F4' )
+
+ ! these test non-normalized values
+! CALL test_print( ti_yy=2001, ti_mm=1, ti_dd=3, ti_h=1, ti_m=20, ti_s=10, &
+! res_str='02001-001-003_001:020:010', testname='printTI_NN1', expect_error=.TRUE. )
+! CALL test_print( ti_yy=2001, ti_mm=12, ti_dd=3, ti_h=1, ti_m=20, ti_s=10, &
+! res_str='02002-000-003_001:020:010', testname='printTI_NN2', expect_error=.TRUE. )
+! CALL test_print( ti_yy=2002, ti_mm=5, ti_dd=500, ti_h=0, ti_m=0, ti_s=7270, &
+! res_str='02002-005-500_002:001:010', testname='printTI_NN3', expect_error=.TRUE. )
+
+ ! Addition tests
+ ! ESMF_Time = ESMF_Time + ESMF_TimeInterval
+ CALL test_arithmetic( add_op=.TRUE., &
+ op1_t_yy=2001, op1_t_mm=12, op1_t_dd=3, op1_t_h=1, op1_t_m=20, op1_t_s=10, &
+ op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=0, op2_ti_h=3, op2_ti_m=10, op2_ti_s=10, &
+ res_t_yy=2001, res_t_mm=12, res_t_dd=3, res_t_h=4, res_t_m=30, res_t_s=20, &
+ testname='AddT_T_TI1' )
+ CALL test_arithmetic( add_op=.TRUE., &
+ op1_t_yy=2001, op1_t_mm=12, op1_t_dd=31, op1_t_h=22, op1_t_m=30, op1_t_s=00, &
+ op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=0, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
+ res_t_yy=2002, res_t_mm= 1, res_t_dd=1, res_t_h=2, res_t_m=40, res_t_s=10, &
+ testname='AddT_T_TI2' )
+ CALL test_arithmetic( add_op=.TRUE., &
+ op1_t_yy=2003, op1_t_mm=12, op1_t_dd=31, op1_t_h=22, op1_t_m=30, op1_t_s=00, &
+ op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=0, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
+ res_t_yy=2004, res_t_mm= 1, res_t_dd=1, res_t_h=2, res_t_m=40, res_t_s=10, &
+ testname='AddT_T_TI3' )
+ CALL test_arithmetic( add_op=.TRUE., &
+ op1_t_yy=2004, op1_t_mm=12, op1_t_dd=31, op1_t_h=22, op1_t_m=30, op1_t_s=00, &
+ op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=0, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
+ res_t_yy=2005, res_t_mm= 1, res_t_dd=1, res_t_h=2, res_t_m=40, res_t_s=10, &
+ testname='AddT_T_TI4' )
+ ! this case hung after the CCSM contribution
+ CALL test_arithmetic( add_op=.TRUE., &
+ op1_t_yy=2004, op1_t_mm=12, op1_t_dd=30, op1_t_h=22, op1_t_m=30, op1_t_s=00, &
+ op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=0, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
+ res_t_yy=2004, res_t_mm=12, res_t_dd=31, res_t_h=2, res_t_m=40, res_t_s=10, &
+ testname='AddT_T_TI5' )
+! NOTE: CCSM folks need to decide what it means to add "1 month" to Feb. 29. And all the
+! other very similar cases. Then, write this unit test!
+! CALL test_arithmetic( add_op=.TRUE., &
+! op1_t_yy=2004, op1_t_mm=12, op1_t_dd=31, op1_t_h=22, op1_t_m=30, op1_t_s=00, &
+! op2_ti_yy= 2, op2_ti_mm= 0, op2_ti_dd=0, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
+! res_t_yy=2007, res_t_mm= 1, res_t_dd=1, res_t_h=2, res_t_m=40, res_t_s=10, &
+! testname='AddT_T_TI6' )
+ CALL test_arithmetic( add_op=.TRUE., &
+ op1_t_yy=2004, op1_t_mm=12, op1_t_dd=30, op1_t_h=4, op1_t_m=30, op1_t_s=00, &
+ op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=365, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
+ res_t_yy=2005, res_t_mm=12, res_t_dd=30, res_t_h=8, res_t_m=40, res_t_s=10, &
+ testname='AddT_T_TI7' )
+ CALL test_arithmetic( add_op=.TRUE., &
+ op1_t_yy=2004, op1_t_mm=12, op1_t_dd=30, op1_t_h=4, op1_t_m=30, op1_t_s=00, &
+ op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=367, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
+ res_t_yy=2006, res_t_mm=01, res_t_dd=01, res_t_h=8, res_t_m=40, res_t_s=10, &
+ testname='AddT_T_TI8' )
+ CALL test_arithmetic( add_op=.TRUE., &
+ op1_t_yy=2003, op1_t_mm=12, op1_t_dd=30, op1_t_h=4, op1_t_m=30, op1_t_s=00, &
+ op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=365, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
+ res_t_yy=2004, res_t_mm=12, res_t_dd=29, res_t_h=8, res_t_m=40, res_t_s=10, &
+ testname='AddT_T_TI9' )
+ CALL test_arithmetic( add_op=.TRUE., &
+ op1_t_yy=2003, op1_t_mm=12, op1_t_dd=30, op1_t_h=4, op1_t_m=30, op1_t_s=00, &
+ op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=366, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
+ res_t_yy=2004, res_t_mm=12, res_t_dd=30, res_t_h=8, res_t_m=40, res_t_s=10, &
+ testname='AddT_T_TI10' )
+ CALL test_arithmetic( add_op=.TRUE., &
+ op1_t_yy=2003, op1_t_mm=12, op1_t_dd=30, op1_t_h=4, op1_t_m=30, op1_t_s=00, &
+ op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=367, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
+ res_t_yy=2004, res_t_mm=12, res_t_dd=31, res_t_h=8, res_t_m=40, res_t_s=10, &
+ testname='AddT_T_TI11' )
+ CALL test_arithmetic( add_op=.TRUE., &
+ op1_t_yy=2003, op1_t_mm=12, op1_t_dd=30, op1_t_h=4, op1_t_m=30, op1_t_s=00, &
+ op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=368, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
+ res_t_yy=2005, res_t_mm=01, res_t_dd=01, res_t_h=8, res_t_m=40, res_t_s=10, &
+ testname='AddT_T_TI12' )
+ CALL test_arithmetic( add_op=.TRUE., &
+ op1_t_yy=2004, op1_t_mm=03, op1_t_dd=30, op1_t_h=4, op1_t_m=30, op1_t_s=00, &
+ op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=365, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
+ res_t_yy=2005, res_t_mm=03, res_t_dd=30, res_t_h=8, res_t_m=40, res_t_s=10, &
+ testname='AddT_T_TI13' )
+ CALL test_arithmetic( add_op=.TRUE., &
+ op1_t_yy=2004, op1_t_mm=03, op1_t_dd=30, op1_t_h=4, op1_t_m=30, op1_t_s=00, &
+ op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=365, op2_ti_h=22, op2_ti_m=10, op2_ti_s=10, &
+ res_t_yy=2005, res_t_mm=03, res_t_dd=31, res_t_h=2, res_t_m=40, res_t_s=10, &
+ testname='AddT_T_TI14' )
+ CALL test_arithmetic( add_op=.TRUE., &
+ op1_t_yy=2004, op1_t_mm=03, op1_t_dd=30, op1_t_h=4, op1_t_m=30, op1_t_s=00, &
+ op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=366, op2_ti_h=22, op2_ti_m=10, op2_ti_s=10, &
+ res_t_yy=2005, res_t_mm=04, res_t_dd=01, res_t_h=2, res_t_m=40, res_t_s=10, &
+ testname='AddT_T_TI15' )
+ ! ESMF_Time = ESMF_Time + ESMF_TimeInterval with fractions
+ CALL test_arithmetic( add_op=.TRUE., &
+ op1_t_yy=2004, op1_t_mm=12, op1_t_dd=31, op1_t_h=22, op1_t_m=30, op1_t_s=00, &
+ op1_t_sn=01, op1_t_sd=03, &
+ op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=0, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
+ op2_ti_sn=01, op2_ti_sd=03, &
+ res_t_yy=2005, res_t_mm= 1, res_t_dd=1, res_t_h=2, res_t_m=40, res_t_s=10, &
+ res_t_sn=02, res_t_sd=03, &
+ testname='AddT_T_TI_F1' )
+ ! this should fail (and does)
+! CALL test_arithmetic( add_op=.TRUE., &
+! op1_t_yy=2004, op1_t_mm=12, op1_t_dd=31, op1_t_h=22, op1_t_m=30, op1_t_s=00, &
+! op1_t_sn=01, op1_t_sd=03, &
+! op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=0, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
+! op2_ti_sn=01, op2_ti_sd=03, &
+! res_t_yy=2005, res_t_mm= 1, res_t_dd=1, res_t_h=2, res_t_m=40, res_t_s=10, &
+! res_t_sn=01, res_t_sd=03, &
+! testname='AddT_T_TI_F2' )
+ ! ESMF_Time = ESMF_TimeInterval + ESMF_Time
+ CALL test_arithmetic( add_op=.TRUE., &
+ op1_ti_yy= 0, op1_ti_mm= 0, op1_ti_dd=0, op1_ti_h=3, op1_ti_m=10, op1_ti_s=10, &
+ op2_t_yy=2001, op2_t_mm=12, op2_t_dd=3, op2_t_h=1, op2_t_m=20, op2_t_s=10, &
+ res_t_yy=2001, res_t_mm=12, res_t_dd=3, res_t_h=4, res_t_m=30, res_t_s=20, &
+ testname='AddT_TI_T1' )
+ CALL test_arithmetic( add_op=.TRUE., &
+ op1_ti_yy= 0, op1_ti_mm= 0, op1_ti_dd=0, op1_ti_h=4, op1_ti_m=10, op1_ti_s=10, &
+ op2_t_yy=2001, op2_t_mm=12, op2_t_dd=31, op2_t_h=22, op2_t_m=30, op2_t_s=00, &
+ res_t_yy=2002, res_t_mm= 1, res_t_dd=1, res_t_h=2, res_t_m=40, res_t_s=10, &
+ testname='AddT_TI_T2' )
+ ! ESMF_TimeInterval = ESMF_TimeInterval + ESMF_TimeInterval
+ CALL test_arithmetic( add_op=.TRUE., &
+ op1_ti_yy=0000, op1_ti_mm=00, op1_ti_dd=3, op1_ti_h=1, op1_ti_m=20, op1_ti_s=10, &
+ op2_ti_yy=0000, op2_ti_mm=00, op2_ti_dd=1, op2_ti_h=1, op2_ti_m=10, op2_ti_s=10, &
+ res_ti_yy=0000, res_ti_mm=00, res_ti_dd=4, res_ti_h=2, res_ti_m=30, res_ti_s=20, &
+ testname='AddTI_TI_TI1' )
+ CALL test_arithmetic( add_op=.TRUE., &
+ op1_ti_yy=0000, op1_ti_mm=00, op1_ti_dd=-3, op1_ti_h=-1, op1_ti_m=-20, op1_ti_s=-10, &
+ op2_ti_yy=0000, op2_ti_mm=00, op2_ti_dd=1, op2_ti_h=1, op2_ti_m=10, op2_ti_s=10, &
+ res_ti_yy=0000, res_ti_mm=00, res_ti_dd=-2, res_ti_h=0, res_ti_m=-10, res_ti_s=00, &
+ testname='AddTI_TI_TI2' )
+ CALL test_arithmetic( add_op=.TRUE., &
+ op1_ti_yy=0000, op1_ti_mm=00, op1_ti_dd=-3, op1_ti_h=-1, op1_ti_m=-20, op1_ti_s=-10, &
+ op2_ti_yy=0000, op2_ti_mm=00, op2_ti_dd=-1, op2_ti_h=-1, op2_ti_m=-10, op2_ti_s=-10, &
+ res_ti_yy=0000, res_ti_mm=00, res_ti_dd=-4, res_ti_h=-2, res_ti_m=-30, res_ti_s=-20, &
+ testname='AddTI_TI_TI3' )
+
+ ! Subtraction tests
+ ! ESMF_Time = ESMF_Time - ESMF_TimeInterval
+ CALL test_arithmetic( add_op=.FALSE., &
+ op1_t_yy=2001, op1_t_mm=12, op1_t_dd=3, op1_t_h=1, op1_t_m=20, op1_t_s=10, &
+ op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=0, op2_ti_h=3, op2_ti_m=10, op2_ti_s=10, &
+ res_t_yy=2001, res_t_mm=12, res_t_dd=2, res_t_h=22, res_t_m=10, res_t_s=0, &
+ testname='SubtractT_T_TI1' )
+ CALL test_arithmetic( add_op=.FALSE., &
+ op1_t_yy=2005, op1_t_mm=1, op1_t_dd=1, op1_t_h=0, op1_t_m=00, op1_t_s=0, &
+ op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=0, op2_ti_h=0, op2_ti_m=00, op2_ti_s=10, &
+ res_t_yy=2004, res_t_mm=12, res_t_dd=31, res_t_h=23, res_t_m=59, res_t_s=50, &
+ testname='SubtractT_T_TI2' )
+ CALL test_arithmetic( add_op=.FALSE., &
+ op1_t_yy=2004, op1_t_mm=1, op1_t_dd=1, op1_t_h=0, op1_t_m=00, op1_t_s=0, &
+ op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=0, op2_ti_h=0, op2_ti_m=00, op2_ti_s=10, &
+ res_t_yy=2003, res_t_mm=12, res_t_dd=31, res_t_h=23, res_t_m=59, res_t_s=50, &
+ testname='SubtractT_T_TI3' )
+ CALL test_arithmetic( add_op=.FALSE., &
+ op1_t_yy=2003, op1_t_mm=1, op1_t_dd=1, op1_t_h=0, op1_t_m=00, op1_t_s=0, &
+ op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=0, op2_ti_h=0, op2_ti_m=00, op2_ti_s=10, &
+ res_t_yy=2002, res_t_mm=12, res_t_dd=31, res_t_h=23, res_t_m=59, res_t_s=50, &
+ testname='SubtractT_T_TI4' )
+ CALL test_arithmetic( add_op=.FALSE., &
+ op1_t_yy=2005, op1_t_mm=04, op1_t_dd=01, op1_t_h=2, op1_t_m=40, op1_t_s=10, &
+ op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=366, op2_ti_h=22, op2_ti_m=10, op2_ti_s=10, &
+ res_t_yy=2004, res_t_mm=03, res_t_dd=30, res_t_h=4, res_t_m=30, res_t_s=00, &
+ testname='SubtractT_T_TI5' )
+ CALL test_arithmetic( add_op=.FALSE., &
+ op1_t_yy=2006, op1_t_mm=01, op1_t_dd=01, op1_t_h=8, op1_t_m=40, op1_t_s=10, &
+ op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=367, op2_ti_h=4, op2_ti_m=10, op2_ti_s=10, &
+ res_t_yy=2004, res_t_mm=12, res_t_dd=30, res_t_h=4, res_t_m=30, res_t_s=00, &
+ testname='SubtractT_T_TI6' )
+ ! ESMF_Time = ESMF_Time - ESMF_TimeInterval with fractions
+ CALL test_arithmetic( add_op=.FALSE., &
+ op1_t_yy=2005, op1_t_mm=01, op1_t_dd=01, op1_t_h=00, op1_t_m=00, op1_t_s=00, &
+ op1_t_sn=00, op1_t_sd=00, &
+ op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=0, op2_ti_h=0, op2_ti_m=00, op2_ti_s=01, &
+ op2_ti_sn=01, op2_ti_sd=03, &
+ res_t_yy=2004, res_t_mm=12, res_t_dd=31, res_t_h=23, res_t_m=59, res_t_s=58, &
+ res_t_sn=02, res_t_sd=03, &
+ testname='SubtractT_T_TI_F1' )
+ ! ESMF_TimeInterval = ESMF_Time - ESMF_Time
+ CALL test_arithmetic( add_op=.FALSE., &
+ op1_t_yy=2001, op1_t_mm=12, op1_t_dd=3, op1_t_h=1, op1_t_m=20, op1_t_s=10, &
+ op2_t_yy=2001, op2_t_mm=12, op2_t_dd=1, op2_t_h=1, op2_t_m=10, op2_t_s=10, &
+ res_ti_yy=0000, res_ti_mm=00, res_ti_dd=2, res_ti_h=0, res_ti_m=10, res_ti_s=0, &
+ testname='SubtractTI_T_T1' )
+ CALL test_arithmetic( add_op=.FALSE., &
+ op1_t_yy=2002, op1_t_mm=1, op1_t_dd=1, op1_t_h=0, op1_t_m=00, op1_t_s=00, &
+ op2_t_yy=2001, op2_t_mm=12, op2_t_dd=31, op2_t_h=23, op2_t_m=59, op2_t_s=50, &
+ res_ti_yy=0000, res_ti_mm=00, res_ti_dd=0, res_ti_h=0, res_ti_m=00, res_ti_s=10, &
+ testname='SubtractTI_T_T2' )
+ CALL test_arithmetic( add_op=.FALSE., &
+ op1_t_yy=2005, op1_t_mm=1, op1_t_dd=1, op1_t_h=0, op1_t_m=00, op1_t_s=00, &
+ op2_t_yy=2004, op2_t_mm=12, op2_t_dd=31, op2_t_h=23, op2_t_m=59, op2_t_s=50, &
+ res_ti_yy=0000, res_ti_mm=00, res_ti_dd=0, res_ti_h=0, res_ti_m=00, res_ti_s=10, &
+ testname='SubtractTI_T_T3' )
+ CALL test_arithmetic( add_op=.FALSE., &
+ op1_t_yy=2003, op1_t_mm=03, op1_t_dd=01, op1_t_h=00, op1_t_m=00, op1_t_s=00, &
+ op2_t_yy=2003, op2_t_mm=02, op2_t_dd=28, op2_t_h=23, op2_t_m=59, op2_t_s=50, &
+ res_ti_yy=0000, res_ti_mm=00, res_ti_dd=0, res_ti_h=0, res_ti_m=00, res_ti_s=10, &
+ testname='SubtractTI_T_T4' )
+ CALL test_arithmetic( add_op=.FALSE., &
+ op1_t_yy=2004, op1_t_mm=03, op1_t_dd=01, op1_t_h=00, op1_t_m=00, op1_t_s=00, &
+ op2_t_yy=2004, op2_t_mm=02, op2_t_dd=28, op2_t_h=23, op2_t_m=59, op2_t_s=50, &
+ res_ti_yy=0000, res_ti_mm=00, res_ti_dd=1, res_ti_h=0, res_ti_m=00, res_ti_s=10, &
+ testname='SubtractTI_T_T5' )
+ CALL test_arithmetic( add_op=.FALSE., &
+ op1_t_yy=2002, op1_t_mm=02, op1_t_dd=28, op1_t_h=00, op1_t_m=00, op1_t_s=00, &
+ op2_t_yy=2002, op2_t_mm=02, op2_t_dd=28, op2_t_h=00, op2_t_m=00, op2_t_s=00, &
+ res_ti_yy=0000, res_ti_mm=00, res_ti_dd=0, res_ti_h=0, res_ti_m=00, res_ti_s=00, &
+ testname='SubtractTI_T_T6' )
+ CALL test_arithmetic( add_op=.FALSE., &
+ op1_t_yy=2003, op1_t_mm=02, op1_t_dd=28, op1_t_h=00, op1_t_m=00, op1_t_s=00, &
+ op2_t_yy=2002, op2_t_mm=02, op2_t_dd=28, op2_t_h=00, op2_t_m=00, op2_t_s=00, &
+ res_ti_yy=0000, res_ti_mm=00, res_ti_dd=365, res_ti_h=0, res_ti_m=00, res_ti_s=00, &
+ testname='SubtractTI_T_T7' )
+ CALL test_arithmetic( add_op=.FALSE., &
+ op1_t_yy=2004, op1_t_mm=02, op1_t_dd=28, op1_t_h=00, op1_t_m=00, op1_t_s=00, &
+ op2_t_yy=2003, op2_t_mm=02, op2_t_dd=28, op2_t_h=00, op2_t_m=00, op2_t_s=00, &
+ res_ti_yy=0000, res_ti_mm=00, res_ti_dd=365, res_ti_h=0, res_ti_m=00, res_ti_s=00, &
+ testname='SubtractTI_T_T8' )
+ CALL test_arithmetic( add_op=.FALSE., &
+ op1_t_yy=2005, op1_t_mm=02, op1_t_dd=28, op1_t_h=00, op1_t_m=00, op1_t_s=00, &
+ op2_t_yy=2004, op2_t_mm=02, op2_t_dd=28, op2_t_h=00, op2_t_m=00, op2_t_s=00, &
+ res_ti_yy=0000, res_ti_mm=00, res_ti_dd=366, res_ti_h=0, res_ti_m=00, res_ti_s=00, &
+ testname='SubtractTI_T_T9' )
+ CALL test_arithmetic( add_op=.FALSE., &
+ op1_t_yy=2003, op1_t_mm=03, op1_t_dd=01, op1_t_h=00, op1_t_m=00, op1_t_s=00, &
+ op2_t_yy=2002, op2_t_mm=02, op2_t_dd=28, op2_t_h=00, op2_t_m=00, op2_t_s=00, &
+ res_ti_yy=0000, res_ti_mm=00, res_ti_dd=366, res_ti_h=0, res_ti_m=00, res_ti_s=00, &
+ testname='SubtractTI_T_T10' )
+ CALL test_arithmetic( add_op=.FALSE., &
+ op1_t_yy=2005, op1_t_mm=03, op1_t_dd=01, op1_t_h=00, op1_t_m=00, op1_t_s=00, &
+ op2_t_yy=2004, op2_t_mm=02, op2_t_dd=28, op2_t_h=00, op2_t_m=00, op2_t_s=00, &
+ res_ti_yy=0000, res_ti_mm=00, res_ti_dd=367, res_ti_h=0, res_ti_m=00, res_ti_s=00, &
+ testname='SubtractTI_T_T11' )
+ CALL test_arithmetic( add_op=.FALSE., &
+ op1_t_yy=2005, op1_t_mm=03, op1_t_dd=01, op1_t_h=00, op1_t_m=00, op1_t_s=00, &
+ op2_t_yy=2004, op2_t_mm=02, op2_t_dd=28, op2_t_h=23, op2_t_m=59, op2_t_s=50, &
+ res_ti_yy=0000, res_ti_mm=00, res_ti_dd=366, res_ti_h=0, res_ti_m=00, res_ti_s=10, &
+ testname='SubtractTI_T_T12' )
+ CALL test_arithmetic( add_op=.FALSE., &
+ op1_t_yy=2004, op1_t_mm=02, op1_t_dd=28, op1_t_h=23, op1_t_m=59, op1_t_s=50, &
+ op2_t_yy=2005, op2_t_mm=03, op2_t_dd=01, op2_t_h=00, op2_t_m=00, op2_t_s=00, &
+ res_ti_yy=0000, res_ti_mm=00, res_ti_dd=-366, res_ti_h=0, res_ti_m=00, res_ti_s=-10, &
+ testname='SubtractTI_T_T13' )
+ CALL test_arithmetic( add_op=.FALSE., &
+ op1_t_yy=-2002, op1_t_mm=02, op1_t_dd=28, op1_t_h=00, op1_t_m=00, op1_t_s=00, &
+ op2_t_yy=-2002, op2_t_mm=02, op2_t_dd=28, op2_t_h=00, op2_t_m=00, op2_t_s=00, &
+ res_ti_yy=0000, res_ti_mm=00, res_ti_dd=0, res_ti_h=0, res_ti_m=00, res_ti_s=00, &
+ testname='SubtractTI_T_T14' )
+ ! ESMF_TimeInterval = ESMF_TimeInterval - ESMF_TimeInterval
+ CALL test_arithmetic( add_op=.FALSE., &
+ op1_ti_yy=0000, op1_ti_mm=00, op1_ti_dd=3, op1_ti_h=1, op1_ti_m=20, op1_ti_s=10, &
+ op2_ti_yy=0000, op2_ti_mm=00, op2_ti_dd=1, op2_ti_h=1, op2_ti_m=10, op2_ti_s=10, &
+ res_ti_yy=0000, res_ti_mm=00, res_ti_dd=2, res_ti_h=0, res_ti_m=10, res_ti_s=0, &
+ testname='SubtractTI_TI_TI1' )
+ CALL test_arithmetic( add_op=.FALSE., &
+ op1_ti_yy=0000, op1_ti_mm=00, op1_ti_dd=3, op1_ti_h=1, op1_ti_m=20, op1_ti_s=10, &
+ op2_ti_yy=0000, op2_ti_mm=00, op2_ti_dd=-1, op2_ti_h=-1, op2_ti_m=-10, op2_ti_s=-10, &
+ res_ti_yy=0000, res_ti_mm=00, res_ti_dd=4, res_ti_h=2, res_ti_m=30, res_ti_s=20, &
+ testname='SubtractTI_TI_TI2' )
+ CALL test_arithmetic( add_op=.FALSE., &
+ op1_ti_yy=0000, op1_ti_mm=00, op1_ti_dd=-1, op1_ti_h=-1, op1_ti_m=-10, op1_ti_s=-10, &
+ op2_ti_yy=0000, op2_ti_mm=00, op2_ti_dd=-3, op2_ti_h=-1, op2_ti_m=-20, op2_ti_s=-10, &
+ res_ti_yy=0000, res_ti_mm=00, res_ti_dd=2, res_ti_h=0, res_ti_m=10, res_ti_s=00, &
+ testname='SubtractTI_TI_TI3' )
+ ! Negative result ESMF_TimeInterval = ESMF_TimeInterval - ESMF_TimeInterval
+ CALL test_arithmetic( add_op=.FALSE., &
+ op1_ti_yy=0000, op1_ti_mm=00, op1_ti_dd=1, op1_ti_h=1, op1_ti_m=10, op1_ti_s=10, &
+ op2_ti_yy=0000, op2_ti_mm=00, op2_ti_dd=3, op2_ti_h=1, op2_ti_m=20, op2_ti_s=10, &
+ res_ti_yy=0000, res_ti_mm=00, res_ti_dd=-2, res_ti_h=0, res_ti_m=-10, res_ti_s=0, &
+ testname='SubtractTI_TI_TIN1' )
+ CALL test_arithmetic( add_op=.FALSE., &
+ op1_ti_yy=0000, op1_ti_mm=00, op1_ti_dd=-1, op1_ti_h=-1, op1_ti_m=-10, op1_ti_s=-10, &
+ op2_ti_yy=0000, op2_ti_mm=00, op2_ti_dd=3, op2_ti_h=1, op2_ti_m=20, op2_ti_s=10, &
+ res_ti_yy=0000, res_ti_mm=00, res_ti_dd=-4, res_ti_h=-2, res_ti_m=-30, res_ti_s=-20, &
+ testname='SubtractTI_TI_TIN2' )
+
+ ! Un-normalized ESMF_TimeInterval = ESMF_TimeInterval - ESMF_TimeInterval
+ ! this is an error
+! CALL test_arithmetic( add_op=.FALSE., &
+! op1_ti_yy=2001, op1_ti_mm=11, op1_ti_dd=3, op1_ti_h=1, op1_ti_m=20, op1_ti_s=10, &
+! op2_ti_yy=2001, op2_ti_mm=11, op2_ti_dd=1, op2_ti_h=1, op2_ti_m=10, op2_ti_s=10, &
+! res_ti_yy=0000, res_ti_mm=00, res_ti_dd=2, res_ti_h=0, res_ti_m=10, res_ti_s=0, &
+! testname='SubtractTI_TI_TIU1', expect_error=.TRUE. )
+
+ ! this one should FAIL, and does
+! CALL test_arithmetic( add_op=.TRUE., &
+! op1_t_yy=2001, op1_t_mm=12, op1_t_dd=3, op1_t_h=1, op1_t_m=20, op1_t_s=10, &
+! op2_ti_yy= 0, op2_ti_mm= 0, op2_ti_dd=0, op2_ti_h=3, op2_ti_m=10, op2_ti_s=10, &
+! res_t_yy=2002, res_t_mm=12, res_t_dd=3, res_t_h=4, res_t_m=30, res_t_s=20, &
+! testname='AddTT1' )
+
+ ! Multiplication tests
+ ! ESMF_TimeInterval = ESMF_TimeInterval * INTEGER
+ CALL test_arithmetic( multiply_op=.TRUE., &
+ op1_ti_dd=3, op1_ti_h=12, op1_ti_m=18, op1_ti_s=33, &
+ op2_int=2, &
+ res_ti_dd=6, res_ti_h=24, res_ti_m=37, res_ti_s=06, &
+ testname='MultiplyTI_TI_INT1' )
+ CALL test_arithmetic( multiply_op=.TRUE., &
+ op1_ti_dd=350, op1_ti_h=23, op1_ti_m=50, op1_ti_s=50, &
+ op2_int=2, &
+ res_ti_dd=701, res_ti_h=23, res_ti_m=41, res_ti_s=40,&
+ testname='MultiplyTI_TI_INT2' )
+ CALL test_arithmetic( multiply_op=.TRUE., &
+ op1_ti_s=01, op1_ti_sn=03, op1_ti_sd=04, &
+ op2_int=8, &
+ res_ti_s=14, &
+ testname='MultiplyTI_TI_INT3' )
+
+ ! Division tests
+ ! ESMF_TimeInterval = ESMF_TimeInterval / INTEGER
+ CALL test_arithmetic( multiply_op=.FALSE., &
+ op1_ti_dd=3, op1_ti_h=12, op1_ti_m=18, op1_ti_s=33, &
+ op2_int=3, &
+ res_ti_dd=1, res_ti_h=04, res_ti_m=06, res_ti_s=11, &
+ testname='DivideTI_TI_INT1' )
+ CALL test_arithmetic( multiply_op=.FALSE., &
+ op1_ti_dd=3, op1_ti_h=12, op1_ti_m=18, op1_ti_s=33, &
+ op2_int=4, &
+ res_ti_dd=0, res_ti_h=21, res_ti_m=04, res_ti_s=38, &
+ res_ti_sn=1, res_ti_sd=4, &
+ testname='DivideTI_TI_INT2' )
+ CALL test_arithmetic( multiply_op=.FALSE., &
+ op1_ti_s=01, op1_ti_sn=03, op1_ti_sd=04, &
+ op2_int=5, &
+ res_ti_s=0, res_ti_sn=7, res_ti_sd=20, &
+ testname='DivideTI_TI_INT3' )
+ ! INTEGER = ESMF_TimeInterval / ESMF_TimeInterval
+ ! this operator truncates to whole integers
+ CALL test_arithmetic( multiply_op=.FALSE., &
+ op1_ti_dd=3, op1_ti_h=12, op1_ti_m=18, op1_ti_s=33, &
+ op2_ti_dd=3, op2_ti_h=12, op2_ti_m=18, op2_ti_s=33, &
+ res_int=1, &
+ testname='DivideINT_TI_TI1' )
+ CALL test_arithmetic( multiply_op=.FALSE., &
+ op1_ti_dd=6, op1_ti_h=24, op1_ti_m=36, op1_ti_s=66, &
+ op2_ti_dd=3, op2_ti_h=12, op2_ti_m=18, op2_ti_s=33, &
+ res_int=2, &
+ testname='DivideINT_TI_TI2' )
+ CALL test_arithmetic( multiply_op=.FALSE., &
+ op1_ti_dd=0, op1_ti_h=00, op1_ti_m=00, op1_ti_s=00, &
+ op2_ti_dd=3, op2_ti_h=12, op2_ti_m=18, op2_ti_s=33, &
+ res_int=0, &
+ testname='DivideINT_TI_TI3' )
+ CALL test_arithmetic( multiply_op=.FALSE., &
+ op1_ti_dd=1, op1_ti_h=00, op1_ti_m=00, op1_ti_s=00, &
+ op2_ti_dd=0, op2_ti_h=01, op2_ti_m=00, op2_ti_s=00, &
+ res_int=24, &
+ testname='DivideINT_TI_TI4' )
+ CALL test_arithmetic( multiply_op=.FALSE., &
+ op1_ti_dd=1, op1_ti_h=00, op1_ti_m=00, op1_ti_s=00, &
+ op2_ti_dd=0, op2_ti_h=00, op2_ti_m=01, op2_ti_s=00, &
+ res_int=1440, &
+ testname='DivideINT_TI_TI5' )
+ CALL test_arithmetic( multiply_op=.FALSE., &
+ op1_ti_dd=1, op1_ti_h=00, op1_ti_m=00, op1_ti_s=00, &
+ op2_ti_dd=0, op2_ti_h=00, op2_ti_m=00, op2_ti_s=01, &
+ res_int=86400, &
+ testname='DivideINT_TI_TI6' )
+ ! rounding
+ CALL test_arithmetic( multiply_op=.FALSE., &
+ op1_ti_dd=0, op1_ti_h=00, op1_ti_m=00, op1_ti_s=03, &
+ op2_ti_dd=0, op2_ti_h=00, op2_ti_m=00, op2_ti_s=02, &
+ res_int=1, &
+ testname='DivideINT_TI_TIR1' )
+ CALL test_arithmetic( multiply_op=.FALSE., &
+ op1_ti_dd=1, op1_ti_h=00, op1_ti_m=00, op1_ti_s=02, &
+ op2_ti_dd=1, op2_ti_h=00, op2_ti_m=00, op2_ti_s=03, &
+ res_int=0, &
+ testname='DivideINT_TI_TIR2' )
+ ! fractional operands
+ CALL test_arithmetic( multiply_op=.FALSE., &
+ op1_ti_m=00, op1_ti_s=00, op1_ti_sn=03, op1_ti_sd=04, &
+ op2_ti_m=00, op2_ti_s=00, op2_ti_sn=03, op2_ti_sd=04, &
+ res_int=1, &
+ testname='DivideINT_TI_TIF1' )
+ CALL test_arithmetic( multiply_op=.FALSE., &
+ op1_ti_m=00, op1_ti_s=00, op1_ti_sn=06, op1_ti_sd=08, &
+ op2_ti_m=00, op2_ti_s=00, op2_ti_sn=03, op2_ti_sd=04, &
+ res_int=1, &
+ testname='DivideINT_TI_TIF2' )
+ CALL test_arithmetic( multiply_op=.FALSE., &
+ op1_ti_m=00, op1_ti_s=00, op1_ti_sn=03, op1_ti_sd=04, &
+ op2_ti_m=00, op2_ti_s=00, op2_ti_sn=04, op2_ti_sd=03, &
+ res_int=0, &
+ testname='DivideINT_TI_TIF3' )
+ CALL test_arithmetic( multiply_op=.FALSE., &
+ op1_ti_m=00, op1_ti_s=02, op1_ti_sn=03, op1_ti_sd=04, &
+ op2_ti_m=00, op2_ti_s=01, op2_ti_sn=01, op2_ti_sd=03, &
+ res_int=2, &
+ testname='DivideINT_TI_TIF4' )
+ ! negative operands
+ CALL test_arithmetic( multiply_op=.FALSE., &
+ op1_ti_dd=-6, op1_ti_h=-24, op1_ti_m=-36, op1_ti_s=-66, &
+ op2_ti_dd=3, op2_ti_h=12, op2_ti_m=18, op2_ti_s=33, &
+ res_int=-2, &
+ testname='DivideINT_TI_TIN1' )
+ CALL test_arithmetic( multiply_op=.FALSE., &
+ op1_ti_dd=6, op1_ti_h=24, op1_ti_m=36, op1_ti_s=66, &
+ op2_ti_dd=-3, op2_ti_h=-12, op2_ti_m=-18, op2_ti_s=-33, &
+ res_int=-2, &
+ testname='DivideINT_TI_TIN2' )
+ CALL test_arithmetic( multiply_op=.FALSE., &
+ op1_ti_dd=-6, op1_ti_h=-24, op1_ti_m=-36, op1_ti_s=-66, &
+ op2_ti_dd=-3, op2_ti_h=-12, op2_ti_m=-18, op2_ti_s=-33, &
+ res_int=2, &
+ testname='DivideINT_TI_TIN3' )
+
+!$$$here... modify these to add self-test PASS/FAIL output
+ CALL test_clock_advance( &
+ start_yy=2002, start_mm=12, start_dd=27, start_h=3, start_m=0, start_s=0, &
+ stop_yy=2002, stop_mm=12, stop_dd=28, stop_h=8, stop_m=0, stop_s=0, &
+ timestep_d=0, timestep_h=0, timestep_m=0, timestep_s=600, &
+ testname="SimpleClockAdvance" )
+
+ CALL test_clock_advance( &
+ start_yy=2003, start_mm=12, start_dd=29, start_h=9, start_m=0, start_s=0, &
+ stop_yy=2004, stop_mm=1, stop_dd=2, stop_h=9, stop_m=0, stop_s=0, &
+ timestep_d=0, timestep_h=0, timestep_m=0, timestep_s=3600, &
+ testname="StdYearClockAdvance", increment_S=10 )
+
+ CALL test_clock_advance( &
+ start_yy=2004, start_mm=12, start_dd=29, start_h=9, start_m=0, start_s=0, &
+ stop_yy=2005, stop_mm=1, stop_dd=2, stop_h=9, stop_m=0, stop_s=0, &
+ timestep_d=0, timestep_h=0, timestep_m=0, timestep_s=3600, &
+ testname="LeapYearClockAdvance", increment_S=10 )
+
+ ! NRCM domain 3 case: 120 seconds / 9
+ ! 18 timesteps through end of leap year
+ CALL test_clock_advance( &
+ start_yy=2004, start_mm=12, start_dd=31, start_h=23, start_m=58, start_s=0,&
+ stop_yy=2005, stop_mm=1, stop_dd=1, stop_h=0, stop_m=2, stop_s=0, &
+ timestep_d=0, timestep_h=0, timestep_m=0, timestep_s=13, &
+ timestep_sn=1, timestep_sd=3, &
+ testname="LeapYearFractionClockAdvance", &
+ increment_S=1, increment_Sn=1, increment_Sd=3 )
+
+ CALL ESMF_Finalize( rc=rc )
+ CALL test_check_error( ESMF_SUCCESS, rc, &
+ 'ESMF_Finalize() ', &
+ __FILE__ , &
+ __LINE__ )
+
+ PRINT *,'END TEST SUITE'
+
+END PROGRAM time_manager_test
+
Deleted: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/Test1.out.correct
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/Test1.out.correct        2012-11-29 20:50:09 UTC (rev 2328)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/Test1.out.correct        2012-11-29 22:23:06 UTC (rev 2329)
@@ -1,1275 +0,0 @@
- BEGIN TEST SUITE
-PASS: printT_1
-PASS: printT_2
-PASS: printT_3
-PASS: printT_4
-PASS: printT_5
-PASS: printT_6
-PASS: printT_D1
-PASS: printT_D2
-PASS: printT_F1
-PASS: printT_F2
-PASS: printT_F3
-PASS: printT_F4
-PASS: printTI_1
-PASS: printTI_2
-PASS: printTI_D1
-PASS: printTI_D2
-PASS: printTI_N1
-PASS: printTI_M1
-PASS: printTI_F1
-PASS: printTI_F2
-PASS: printTI_F3
-PASS: printTI_F4
-PASS: AddT_T_TI1
-PASS: AddT_T_TI2
-PASS: AddT_T_TI3
-PASS: AddT_T_TI4
-PASS: AddT_T_TI5
-PASS: AddT_T_TI7
-PASS: AddT_T_TI8
-PASS: AddT_T_TI9
-PASS: AddT_T_TI10
-PASS: AddT_T_TI11
-PASS: AddT_T_TI12
-PASS: AddT_T_TI13
-PASS: AddT_T_TI14
-PASS: AddT_T_TI15
-PASS: AddT_T_TI_F1
-PASS: AddT_TI_T1
-PASS: AddT_TI_T2
-PASS: AddTI_TI_TI1
-PASS: AddTI_TI_TI2
-PASS: AddTI_TI_TI3
-PASS: SubtractT_T_TI1
-PASS: SubtractT_T_TI2
-PASS: SubtractT_T_TI3
-PASS: SubtractT_T_TI4
-PASS: SubtractT_T_TI5
-PASS: SubtractT_T_TI6
-PASS: SubtractT_T_TI_F1
-PASS: SubtractTI_T_T1
-PASS: SubtractTI_T_T2
-PASS: SubtractTI_T_T3
-PASS: SubtractTI_T_T4
-PASS: SubtractTI_T_T5
-PASS: SubtractTI_T_T6
-PASS: SubtractTI_T_T7
-PASS: SubtractTI_T_T8
-PASS: SubtractTI_T_T9
-PASS: SubtractTI_T_T10
-PASS: SubtractTI_T_T11
-PASS: SubtractTI_T_T12
-PASS: SubtractTI_T_T13
-PASS: SubtractTI_T_T14
-PASS: SubtractTI_TI_TI1
-PASS: SubtractTI_TI_TI2
-PASS: SubtractTI_TI_TI3
-PASS: SubtractTI_TI_TIN1
-PASS: SubtractTI_TI_TIN2
-PASS: MultiplyTI_TI_INT1
-PASS: MultiplyTI_TI_INT2
-PASS: MultiplyTI_TI_INT3
-PASS: DivideTI_TI_INT1
-PASS: DivideTI_TI_INT2
-PASS: DivideTI_TI_INT3
-PASS: DivideINT_TI_TI1
-PASS: DivideINT_TI_TI2
-PASS: DivideINT_TI_TI3
-PASS: DivideINT_TI_TI4
-PASS: DivideINT_TI_TI5
-PASS: DivideINT_TI_TI6
-PASS: DivideINT_TI_TIR1
-PASS: DivideINT_TI_TIR2
-PASS: DivideINT_TI_TIF1
-PASS: DivideINT_TI_TIF2
-PASS: DivideINT_TI_TIF3
-PASS: DivideINT_TI_TIF4
-PASS: DivideINT_TI_TIN1
-PASS: DivideINT_TI_TIN2
-PASS: DivideINT_TI_TIN3
-SimpleClockAdvance_SETUP: start_time = <2002-12-27_03:00:00>
-SimpleClockAdvance_SETUP: stop_time = <2002-12-28_08:00:00>
-SimpleClockAdvance_SETUP: timestep = <0000000000_000:010:000>
-SimpleClockAdvance_SETUP: increment = <0000000000_000:000:000>
-SimpleClockAdvance_SETUP: clock current_time = <2002-12-27_03:00:00>
-SimpleClockAdvance_SETUP: current_time dayOfYear_r8 = < 361.125000 >
-SimpleClockAdvance_SETUP: current_time-increment = <2002-12-27_03:00:00>
-SimpleClockAdvance_SETUP: current_time+increment = <2002-12-27_03:00:00>
-SimpleClockAdvance_ADVANCE: count = 000001 current_time = <2002-12-27_03:10:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_03:10:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_03:10:00>
-SimpleClockAdvance_ADVANCE: count = 000002 current_time = <2002-12-27_03:20:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_03:20:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_03:20:00>
-SimpleClockAdvance_ADVANCE: count = 000003 current_time = <2002-12-27_03:30:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_03:30:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_03:30:00>
-SimpleClockAdvance_ADVANCE: count = 000004 current_time = <2002-12-27_03:40:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_03:40:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_03:40:00>
-SimpleClockAdvance_ADVANCE: count = 000005 current_time = <2002-12-27_03:50:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_03:50:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_03:50:00>
-SimpleClockAdvance_ADVANCE: count = 000006 current_time = <2002-12-27_04:00:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_04:00:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_04:00:00>
-SimpleClockAdvance_ADVANCE: count = 000007 current_time = <2002-12-27_04:10:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_04:10:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_04:10:00>
-SimpleClockAdvance_ADVANCE: count = 000008 current_time = <2002-12-27_04:20:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_04:20:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_04:20:00>
-SimpleClockAdvance_ADVANCE: count = 000009 current_time = <2002-12-27_04:30:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_04:30:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_04:30:00>
-SimpleClockAdvance_ADVANCE: count = 000010 current_time = <2002-12-27_04:40:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_04:40:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_04:40:00>
-SimpleClockAdvance_ADVANCE: count = 000011 current_time = <2002-12-27_04:50:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_04:50:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_04:50:00>
-SimpleClockAdvance_ADVANCE: count = 000012 current_time = <2002-12-27_05:00:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_05:00:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_05:00:00>
-SimpleClockAdvance_ADVANCE: count = 000013 current_time = <2002-12-27_05:10:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_05:10:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_05:10:00>
-SimpleClockAdvance_ADVANCE: count = 000014 current_time = <2002-12-27_05:20:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_05:20:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_05:20:00>
-SimpleClockAdvance_ADVANCE: count = 000015 current_time = <2002-12-27_05:30:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_05:30:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_05:30:00>
-SimpleClockAdvance_ADVANCE: count = 000016 current_time = <2002-12-27_05:40:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_05:40:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_05:40:00>
-SimpleClockAdvance_ADVANCE: count = 000017 current_time = <2002-12-27_05:50:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_05:50:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_05:50:00>
-SimpleClockAdvance_ADVANCE: count = 000018 current_time = <2002-12-27_06:00:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_06:00:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_06:00:00>
-SimpleClockAdvance_ADVANCE: count = 000019 current_time = <2002-12-27_06:10:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_06:10:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_06:10:00>
-SimpleClockAdvance_ADVANCE: count = 000020 current_time = <2002-12-27_06:20:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_06:20:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_06:20:00>
-SimpleClockAdvance_ADVANCE: count = 000021 current_time = <2002-12-27_06:30:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_06:30:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_06:30:00>
-SimpleClockAdvance_ADVANCE: count = 000022 current_time = <2002-12-27_06:40:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_06:40:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_06:40:00>
-SimpleClockAdvance_ADVANCE: count = 000023 current_time = <2002-12-27_06:50:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_06:50:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_06:50:00>
-SimpleClockAdvance_ADVANCE: count = 000024 current_time = <2002-12-27_07:00:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_07:00:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_07:00:00>
-SimpleClockAdvance_ADVANCE: count = 000025 current_time = <2002-12-27_07:10:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_07:10:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_07:10:00>
-SimpleClockAdvance_ADVANCE: count = 000026 current_time = <2002-12-27_07:20:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_07:20:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_07:20:00>
-SimpleClockAdvance_ADVANCE: count = 000027 current_time = <2002-12-27_07:30:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_07:30:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_07:30:00>
-SimpleClockAdvance_ADVANCE: count = 000028 current_time = <2002-12-27_07:40:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_07:40:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_07:40:00>
-SimpleClockAdvance_ADVANCE: count = 000029 current_time = <2002-12-27_07:50:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_07:50:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_07:50:00>
-SimpleClockAdvance_ADVANCE: count = 000030 current_time = <2002-12-27_08:00:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_08:00:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_08:00:00>
-SimpleClockAdvance_ADVANCE: count = 000031 current_time = <2002-12-27_08:10:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_08:10:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_08:10:00>
-SimpleClockAdvance_ADVANCE: count = 000032 current_time = <2002-12-27_08:20:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_08:20:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_08:20:00>
-SimpleClockAdvance_ADVANCE: count = 000033 current_time = <2002-12-27_08:30:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_08:30:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_08:30:00>
-SimpleClockAdvance_ADVANCE: count = 000034 current_time = <2002-12-27_08:40:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_08:40:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_08:40:00>
-SimpleClockAdvance_ADVANCE: count = 000035 current_time = <2002-12-27_08:50:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_08:50:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_08:50:00>
-SimpleClockAdvance_ADVANCE: count = 000036 current_time = <2002-12-27_09:00:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_09:00:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_09:00:00>
-SimpleClockAdvance_ADVANCE: count = 000037 current_time = <2002-12-27_09:10:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_09:10:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_09:10:00>
-SimpleClockAdvance_ADVANCE: count = 000038 current_time = <2002-12-27_09:20:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_09:20:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_09:20:00>
-SimpleClockAdvance_ADVANCE: count = 000039 current_time = <2002-12-27_09:30:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_09:30:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_09:30:00>
-SimpleClockAdvance_ADVANCE: count = 000040 current_time = <2002-12-27_09:40:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_09:40:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_09:40:00>
-SimpleClockAdvance_ADVANCE: count = 000041 current_time = <2002-12-27_09:50:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_09:50:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_09:50:00>
-SimpleClockAdvance_ADVANCE: count = 000042 current_time = <2002-12-27_10:00:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_10:00:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_10:00:00>
-SimpleClockAdvance_ADVANCE: count = 000043 current_time = <2002-12-27_10:10:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_10:10:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_10:10:00>
-SimpleClockAdvance_ADVANCE: count = 000044 current_time = <2002-12-27_10:20:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_10:20:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_10:20:00>
-SimpleClockAdvance_ADVANCE: count = 000045 current_time = <2002-12-27_10:30:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_10:30:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_10:30:00>
-SimpleClockAdvance_ADVANCE: count = 000046 current_time = <2002-12-27_10:40:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_10:40:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_10:40:00>
-SimpleClockAdvance_ADVANCE: count = 000047 current_time = <2002-12-27_10:50:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_10:50:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_10:50:00>
-SimpleClockAdvance_ADVANCE: count = 000048 current_time = <2002-12-27_11:00:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_11:00:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_11:00:00>
-SimpleClockAdvance_ADVANCE: count = 000049 current_time = <2002-12-27_11:10:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_11:10:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_11:10:00>
-SimpleClockAdvance_ADVANCE: count = 000050 current_time = <2002-12-27_11:20:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_11:20:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_11:20:00>
-SimpleClockAdvance_ADVANCE: count = 000051 current_time = <2002-12-27_11:30:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_11:30:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_11:30:00>
-SimpleClockAdvance_ADVANCE: count = 000052 current_time = <2002-12-27_11:40:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_11:40:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_11:40:00>
-SimpleClockAdvance_ADVANCE: count = 000053 current_time = <2002-12-27_11:50:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_11:50:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_11:50:00>
-SimpleClockAdvance_ADVANCE: count = 000054 current_time = <2002-12-27_12:00:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_12:00:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_12:00:00>
-SimpleClockAdvance_ADVANCE: count = 000055 current_time = <2002-12-27_12:10:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_12:10:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_12:10:00>
-SimpleClockAdvance_ADVANCE: count = 000056 current_time = <2002-12-27_12:20:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_12:20:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_12:20:00>
-SimpleClockAdvance_ADVANCE: count = 000057 current_time = <2002-12-27_12:30:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_12:30:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_12:30:00>
-SimpleClockAdvance_ADVANCE: count = 000058 current_time = <2002-12-27_12:40:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_12:40:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_12:40:00>
-SimpleClockAdvance_ADVANCE: count = 000059 current_time = <2002-12-27_12:50:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_12:50:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_12:50:00>
-SimpleClockAdvance_ADVANCE: count = 000060 current_time = <2002-12-27_13:00:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_13:00:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_13:00:00>
-SimpleClockAdvance_ADVANCE: count = 000061 current_time = <2002-12-27_13:10:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_13:10:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_13:10:00>
-SimpleClockAdvance_ADVANCE: count = 000062 current_time = <2002-12-27_13:20:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_13:20:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_13:20:00>
-SimpleClockAdvance_ADVANCE: count = 000063 current_time = <2002-12-27_13:30:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_13:30:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_13:30:00>
-SimpleClockAdvance_ADVANCE: count = 000064 current_time = <2002-12-27_13:40:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_13:40:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_13:40:00>
-SimpleClockAdvance_ADVANCE: count = 000065 current_time = <2002-12-27_13:50:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_13:50:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_13:50:00>
-SimpleClockAdvance_ADVANCE: count = 000066 current_time = <2002-12-27_14:00:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_14:00:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_14:00:00>
-SimpleClockAdvance_ADVANCE: count = 000067 current_time = <2002-12-27_14:10:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_14:10:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_14:10:00>
-SimpleClockAdvance_ADVANCE: count = 000068 current_time = <2002-12-27_14:20:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_14:20:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_14:20:00>
-SimpleClockAdvance_ADVANCE: count = 000069 current_time = <2002-12-27_14:30:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_14:30:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_14:30:00>
-SimpleClockAdvance_ADVANCE: count = 000070 current_time = <2002-12-27_14:40:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_14:40:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_14:40:00>
-SimpleClockAdvance_ADVANCE: count = 000071 current_time = <2002-12-27_14:50:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_14:50:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_14:50:00>
-SimpleClockAdvance_ADVANCE: count = 000072 current_time = <2002-12-27_15:00:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_15:00:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_15:00:00>
-SimpleClockAdvance_ADVANCE: count = 000073 current_time = <2002-12-27_15:10:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_15:10:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_15:10:00>
-SimpleClockAdvance_ADVANCE: count = 000074 current_time = <2002-12-27_15:20:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_15:20:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_15:20:00>
-SimpleClockAdvance_ADVANCE: count = 000075 current_time = <2002-12-27_15:30:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_15:30:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_15:30:00>
-SimpleClockAdvance_ADVANCE: count = 000076 current_time = <2002-12-27_15:40:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_15:40:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_15:40:00>
-SimpleClockAdvance_ADVANCE: count = 000077 current_time = <2002-12-27_15:50:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_15:50:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_15:50:00>
-SimpleClockAdvance_ADVANCE: count = 000078 current_time = <2002-12-27_16:00:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_16:00:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_16:00:00>
-SimpleClockAdvance_ADVANCE: count = 000079 current_time = <2002-12-27_16:10:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_16:10:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_16:10:00>
-SimpleClockAdvance_ADVANCE: count = 000080 current_time = <2002-12-27_16:20:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_16:20:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_16:20:00>
-SimpleClockAdvance_ADVANCE: count = 000081 current_time = <2002-12-27_16:30:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_16:30:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_16:30:00>
-SimpleClockAdvance_ADVANCE: count = 000082 current_time = <2002-12-27_16:40:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_16:40:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_16:40:00>
-SimpleClockAdvance_ADVANCE: count = 000083 current_time = <2002-12-27_16:50:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_16:50:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_16:50:00>
-SimpleClockAdvance_ADVANCE: count = 000084 current_time = <2002-12-27_17:00:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_17:00:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_17:00:00>
-SimpleClockAdvance_ADVANCE: count = 000085 current_time = <2002-12-27_17:10:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_17:10:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_17:10:00>
-SimpleClockAdvance_ADVANCE: count = 000086 current_time = <2002-12-27_17:20:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_17:20:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_17:20:00>
-SimpleClockAdvance_ADVANCE: count = 000087 current_time = <2002-12-27_17:30:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_17:30:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_17:30:00>
-SimpleClockAdvance_ADVANCE: count = 000088 current_time = <2002-12-27_17:40:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_17:40:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_17:40:00>
-SimpleClockAdvance_ADVANCE: count = 000089 current_time = <2002-12-27_17:50:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_17:50:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_17:50:00>
-SimpleClockAdvance_ADVANCE: count = 000090 current_time = <2002-12-27_18:00:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_18:00:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_18:00:00>
-SimpleClockAdvance_ADVANCE: count = 000091 current_time = <2002-12-27_18:10:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_18:10:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_18:10:00>
-SimpleClockAdvance_ADVANCE: count = 000092 current_time = <2002-12-27_18:20:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_18:20:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_18:20:00>
-SimpleClockAdvance_ADVANCE: count = 000093 current_time = <2002-12-27_18:30:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_18:30:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_18:30:00>
-SimpleClockAdvance_ADVANCE: count = 000094 current_time = <2002-12-27_18:40:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_18:40:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_18:40:00>
-SimpleClockAdvance_ADVANCE: count = 000095 current_time = <2002-12-27_18:50:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_18:50:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_18:50:00>
-SimpleClockAdvance_ADVANCE: count = 000096 current_time = <2002-12-27_19:00:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_19:00:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_19:00:00>
-SimpleClockAdvance_ADVANCE: count = 000097 current_time = <2002-12-27_19:10:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_19:10:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_19:10:00>
-SimpleClockAdvance_ADVANCE: count = 000098 current_time = <2002-12-27_19:20:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_19:20:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_19:20:00>
-SimpleClockAdvance_ADVANCE: count = 000099 current_time = <2002-12-27_19:30:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_19:30:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_19:30:00>
-SimpleClockAdvance_ADVANCE: count = 000100 current_time = <2002-12-27_19:40:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_19:40:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_19:40:00>
-SimpleClockAdvance_ADVANCE: count = 000101 current_time = <2002-12-27_19:50:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_19:50:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_19:50:00>
-SimpleClockAdvance_ADVANCE: count = 000102 current_time = <2002-12-27_20:00:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_20:00:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_20:00:00>
-SimpleClockAdvance_ADVANCE: count = 000103 current_time = <2002-12-27_20:10:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_20:10:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_20:10:00>
-SimpleClockAdvance_ADVANCE: count = 000104 current_time = <2002-12-27_20:20:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_20:20:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_20:20:00>
-SimpleClockAdvance_ADVANCE: count = 000105 current_time = <2002-12-27_20:30:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_20:30:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_20:30:00>
-SimpleClockAdvance_ADVANCE: count = 000106 current_time = <2002-12-27_20:40:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_20:40:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_20:40:00>
-SimpleClockAdvance_ADVANCE: count = 000107 current_time = <2002-12-27_20:50:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_20:50:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_20:50:00>
-SimpleClockAdvance_ADVANCE: count = 000108 current_time = <2002-12-27_21:00:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_21:00:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_21:00:00>
-SimpleClockAdvance_ADVANCE: count = 000109 current_time = <2002-12-27_21:10:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_21:10:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_21:10:00>
-SimpleClockAdvance_ADVANCE: count = 000110 current_time = <2002-12-27_21:20:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_21:20:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_21:20:00>
-SimpleClockAdvance_ADVANCE: count = 000111 current_time = <2002-12-27_21:30:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_21:30:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_21:30:00>
-SimpleClockAdvance_ADVANCE: count = 000112 current_time = <2002-12-27_21:40:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_21:40:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_21:40:00>
-SimpleClockAdvance_ADVANCE: count = 000113 current_time = <2002-12-27_21:50:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_21:50:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_21:50:00>
-SimpleClockAdvance_ADVANCE: count = 000114 current_time = <2002-12-27_22:00:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_22:00:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_22:00:00>
-SimpleClockAdvance_ADVANCE: count = 000115 current_time = <2002-12-27_22:10:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_22:10:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_22:10:00>
-SimpleClockAdvance_ADVANCE: count = 000116 current_time = <2002-12-27_22:20:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_22:20:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_22:20:00>
-SimpleClockAdvance_ADVANCE: count = 000117 current_time = <2002-12-27_22:30:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_22:30:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_22:30:00>
-SimpleClockAdvance_ADVANCE: count = 000118 current_time = <2002-12-27_22:40:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_22:40:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_22:40:00>
-SimpleClockAdvance_ADVANCE: count = 000119 current_time = <2002-12-27_22:50:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_22:50:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_22:50:00>
-SimpleClockAdvance_ADVANCE: count = 000120 current_time = <2002-12-27_23:00:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_23:00:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_23:00:00>
-SimpleClockAdvance_ADVANCE: count = 000121 current_time = <2002-12-27_23:10:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_23:10:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_23:10:00>
-SimpleClockAdvance_ADVANCE: count = 000122 current_time = <2002-12-27_23:20:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_23:20:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_23:20:00>
-SimpleClockAdvance_ADVANCE: count = 000123 current_time = <2002-12-27_23:30:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_23:30:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_23:30:00>
-SimpleClockAdvance_ADVANCE: count = 000124 current_time = <2002-12-27_23:40:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_23:40:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_23:40:00>
-SimpleClockAdvance_ADVANCE: count = 000125 current_time = <2002-12-27_23:50:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_23:50:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_23:50:00>
-SimpleClockAdvance_ADVANCE: count = 000126 current_time = <2002-12-28_00:00:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_00:00:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_00:00:00>
-SimpleClockAdvance_ADVANCE: count = 000127 current_time = <2002-12-28_00:10:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_00:10:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_00:10:00>
-SimpleClockAdvance_ADVANCE: count = 000128 current_time = <2002-12-28_00:20:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_00:20:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_00:20:00>
-SimpleClockAdvance_ADVANCE: count = 000129 current_time = <2002-12-28_00:30:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_00:30:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_00:30:00>
-SimpleClockAdvance_ADVANCE: count = 000130 current_time = <2002-12-28_00:40:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_00:40:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_00:40:00>
-SimpleClockAdvance_ADVANCE: count = 000131 current_time = <2002-12-28_00:50:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_00:50:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_00:50:00>
-SimpleClockAdvance_ADVANCE: count = 000132 current_time = <2002-12-28_01:00:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_01:00:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_01:00:00>
-SimpleClockAdvance_ADVANCE: count = 000133 current_time = <2002-12-28_01:10:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_01:10:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_01:10:00>
-SimpleClockAdvance_ADVANCE: count = 000134 current_time = <2002-12-28_01:20:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_01:20:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_01:20:00>
-SimpleClockAdvance_ADVANCE: count = 000135 current_time = <2002-12-28_01:30:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_01:30:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_01:30:00>
-SimpleClockAdvance_ADVANCE: count = 000136 current_time = <2002-12-28_01:40:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_01:40:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_01:40:00>
-SimpleClockAdvance_ADVANCE: count = 000137 current_time = <2002-12-28_01:50:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_01:50:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_01:50:00>
-SimpleClockAdvance_ADVANCE: count = 000138 current_time = <2002-12-28_02:00:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_02:00:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_02:00:00>
-SimpleClockAdvance_ADVANCE: count = 000139 current_time = <2002-12-28_02:10:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_02:10:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_02:10:00>
-SimpleClockAdvance_ADVANCE: count = 000140 current_time = <2002-12-28_02:20:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_02:20:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_02:20:00>
-SimpleClockAdvance_ADVANCE: count = 000141 current_time = <2002-12-28_02:30:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_02:30:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_02:30:00>
-SimpleClockAdvance_ADVANCE: count = 000142 current_time = <2002-12-28_02:40:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_02:40:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_02:40:00>
-SimpleClockAdvance_ADVANCE: count = 000143 current_time = <2002-12-28_02:50:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_02:50:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_02:50:00>
-SimpleClockAdvance_ADVANCE: count = 000144 current_time = <2002-12-28_03:00:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_03:00:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_03:00:00>
-SimpleClockAdvance_ADVANCE: count = 000145 current_time = <2002-12-28_03:10:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_03:10:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_03:10:00>
-SimpleClockAdvance_ADVANCE: count = 000146 current_time = <2002-12-28_03:20:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_03:20:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_03:20:00>
-SimpleClockAdvance_ADVANCE: count = 000147 current_time = <2002-12-28_03:30:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_03:30:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_03:30:00>
-SimpleClockAdvance_ADVANCE: count = 000148 current_time = <2002-12-28_03:40:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_03:40:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_03:40:00>
-SimpleClockAdvance_ADVANCE: count = 000149 current_time = <2002-12-28_03:50:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_03:50:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_03:50:00>
-SimpleClockAdvance_ADVANCE: count = 000150 current_time = <2002-12-28_04:00:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_04:00:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_04:00:00>
-SimpleClockAdvance_ADVANCE: count = 000151 current_time = <2002-12-28_04:10:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_04:10:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_04:10:00>
-SimpleClockAdvance_ADVANCE: count = 000152 current_time = <2002-12-28_04:20:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_04:20:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_04:20:00>
-SimpleClockAdvance_ADVANCE: count = 000153 current_time = <2002-12-28_04:30:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_04:30:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_04:30:00>
-SimpleClockAdvance_ADVANCE: count = 000154 current_time = <2002-12-28_04:40:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_04:40:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_04:40:00>
-SimpleClockAdvance_ADVANCE: count = 000155 current_time = <2002-12-28_04:50:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_04:50:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_04:50:00>
-SimpleClockAdvance_ADVANCE: count = 000156 current_time = <2002-12-28_05:00:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_05:00:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_05:00:00>
-SimpleClockAdvance_ADVANCE: count = 000157 current_time = <2002-12-28_05:10:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_05:10:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_05:10:00>
-SimpleClockAdvance_ADVANCE: count = 000158 current_time = <2002-12-28_05:20:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_05:20:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_05:20:00>
-SimpleClockAdvance_ADVANCE: count = 000159 current_time = <2002-12-28_05:30:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_05:30:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_05:30:00>
-SimpleClockAdvance_ADVANCE: count = 000160 current_time = <2002-12-28_05:40:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_05:40:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_05:40:00>
-SimpleClockAdvance_ADVANCE: count = 000161 current_time = <2002-12-28_05:50:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_05:50:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_05:50:00>
-SimpleClockAdvance_ADVANCE: count = 000162 current_time = <2002-12-28_06:00:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_06:00:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_06:00:00>
-SimpleClockAdvance_ADVANCE: count = 000163 current_time = <2002-12-28_06:10:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_06:10:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_06:10:00>
-SimpleClockAdvance_ADVANCE: count = 000164 current_time = <2002-12-28_06:20:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_06:20:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_06:20:00>
-SimpleClockAdvance_ADVANCE: count = 000165 current_time = <2002-12-28_06:30:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_06:30:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_06:30:00>
-SimpleClockAdvance_ADVANCE: count = 000166 current_time = <2002-12-28_06:40:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_06:40:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_06:40:00>
-SimpleClockAdvance_ADVANCE: count = 000167 current_time = <2002-12-28_06:50:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_06:50:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_06:50:00>
-SimpleClockAdvance_ADVANCE: count = 000168 current_time = <2002-12-28_07:00:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_07:00:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_07:00:00>
-SimpleClockAdvance_ADVANCE: count = 000169 current_time = <2002-12-28_07:10:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_07:10:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_07:10:00>
-SimpleClockAdvance_ADVANCE: count = 000170 current_time = <2002-12-28_07:20:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_07:20:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_07:20:00>
-SimpleClockAdvance_ADVANCE: count = 000171 current_time = <2002-12-28_07:30:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_07:30:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_07:30:00>
-SimpleClockAdvance_ADVANCE: count = 000172 current_time = <2002-12-28_07:40:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_07:40:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_07:40:00>
-SimpleClockAdvance_ADVANCE: count = 000173 current_time = <2002-12-28_07:50:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_07:50:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_07:50:00>
-SimpleClockAdvance_ADVANCE: count = 000174 current_time = <2002-12-28_08:00:00>
-SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_08:00:00>
-SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_08:00:00>
-StdYearClockAdvance_SETUP: start_time = <2003-12-29_09:00:00>
-StdYearClockAdvance_SETUP: stop_time = <2004-01-02_09:00:00>
-StdYearClockAdvance_SETUP: timestep = <0000000000_001:000:000>
-StdYearClockAdvance_SETUP: increment = <0000000000_000:000:010>
-StdYearClockAdvance_SETUP: clock current_time = <2003-12-29_09:00:00>
-StdYearClockAdvance_SETUP: current_time dayOfYear_r8 = < 363.375000 >
-StdYearClockAdvance_SETUP: current_time-increment = <2003-12-29_08:59:50>
-StdYearClockAdvance_SETUP: current_time+increment = <2003-12-29_09:00:10>
-StdYearClockAdvance_ADVANCE: count = 000001 current_time = <2003-12-29_10:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_09:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-29_10:00:10>
-StdYearClockAdvance_ADVANCE: count = 000002 current_time = <2003-12-29_11:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_10:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-29_11:00:10>
-StdYearClockAdvance_ADVANCE: count = 000003 current_time = <2003-12-29_12:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_11:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-29_12:00:10>
-StdYearClockAdvance_ADVANCE: count = 000004 current_time = <2003-12-29_13:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_12:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-29_13:00:10>
-StdYearClockAdvance_ADVANCE: count = 000005 current_time = <2003-12-29_14:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_13:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-29_14:00:10>
-StdYearClockAdvance_ADVANCE: count = 000006 current_time = <2003-12-29_15:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_14:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-29_15:00:10>
-StdYearClockAdvance_ADVANCE: count = 000007 current_time = <2003-12-29_16:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_15:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-29_16:00:10>
-StdYearClockAdvance_ADVANCE: count = 000008 current_time = <2003-12-29_17:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_16:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-29_17:00:10>
-StdYearClockAdvance_ADVANCE: count = 000009 current_time = <2003-12-29_18:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_17:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-29_18:00:10>
-StdYearClockAdvance_ADVANCE: count = 000010 current_time = <2003-12-29_19:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_18:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-29_19:00:10>
-StdYearClockAdvance_ADVANCE: count = 000011 current_time = <2003-12-29_20:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_19:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-29_20:00:10>
-StdYearClockAdvance_ADVANCE: count = 000012 current_time = <2003-12-29_21:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_20:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-29_21:00:10>
-StdYearClockAdvance_ADVANCE: count = 000013 current_time = <2003-12-29_22:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_21:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-29_22:00:10>
-StdYearClockAdvance_ADVANCE: count = 000014 current_time = <2003-12-29_23:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_22:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-29_23:00:10>
-StdYearClockAdvance_ADVANCE: count = 000015 current_time = <2003-12-30_00:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_23:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_00:00:10>
-StdYearClockAdvance_ADVANCE: count = 000016 current_time = <2003-12-30_01:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_00:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_01:00:10>
-StdYearClockAdvance_ADVANCE: count = 000017 current_time = <2003-12-30_02:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_01:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_02:00:10>
-StdYearClockAdvance_ADVANCE: count = 000018 current_time = <2003-12-30_03:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_02:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_03:00:10>
-StdYearClockAdvance_ADVANCE: count = 000019 current_time = <2003-12-30_04:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_03:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_04:00:10>
-StdYearClockAdvance_ADVANCE: count = 000020 current_time = <2003-12-30_05:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_04:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_05:00:10>
-StdYearClockAdvance_ADVANCE: count = 000021 current_time = <2003-12-30_06:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_05:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_06:00:10>
-StdYearClockAdvance_ADVANCE: count = 000022 current_time = <2003-12-30_07:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_06:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_07:00:10>
-StdYearClockAdvance_ADVANCE: count = 000023 current_time = <2003-12-30_08:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_07:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_08:00:10>
-StdYearClockAdvance_ADVANCE: count = 000024 current_time = <2003-12-30_09:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_08:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_09:00:10>
-StdYearClockAdvance_ADVANCE: count = 000025 current_time = <2003-12-30_10:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_09:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_10:00:10>
-StdYearClockAdvance_ADVANCE: count = 000026 current_time = <2003-12-30_11:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_10:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_11:00:10>
-StdYearClockAdvance_ADVANCE: count = 000027 current_time = <2003-12-30_12:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_11:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_12:00:10>
-StdYearClockAdvance_ADVANCE: count = 000028 current_time = <2003-12-30_13:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_12:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_13:00:10>
-StdYearClockAdvance_ADVANCE: count = 000029 current_time = <2003-12-30_14:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_13:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_14:00:10>
-StdYearClockAdvance_ADVANCE: count = 000030 current_time = <2003-12-30_15:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_14:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_15:00:10>
-StdYearClockAdvance_ADVANCE: count = 000031 current_time = <2003-12-30_16:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_15:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_16:00:10>
-StdYearClockAdvance_ADVANCE: count = 000032 current_time = <2003-12-30_17:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_16:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_17:00:10>
-StdYearClockAdvance_ADVANCE: count = 000033 current_time = <2003-12-30_18:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_17:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_18:00:10>
-StdYearClockAdvance_ADVANCE: count = 000034 current_time = <2003-12-30_19:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_18:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_19:00:10>
-StdYearClockAdvance_ADVANCE: count = 000035 current_time = <2003-12-30_20:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_19:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_20:00:10>
-StdYearClockAdvance_ADVANCE: count = 000036 current_time = <2003-12-30_21:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_20:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_21:00:10>
-StdYearClockAdvance_ADVANCE: count = 000037 current_time = <2003-12-30_22:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_21:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_22:00:10>
-StdYearClockAdvance_ADVANCE: count = 000038 current_time = <2003-12-30_23:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_22:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_23:00:10>
-StdYearClockAdvance_ADVANCE: count = 000039 current_time = <2003-12-31_00:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_23:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_00:00:10>
-StdYearClockAdvance_ADVANCE: count = 000040 current_time = <2003-12-31_01:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_00:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_01:00:10>
-StdYearClockAdvance_ADVANCE: count = 000041 current_time = <2003-12-31_02:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_01:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_02:00:10>
-StdYearClockAdvance_ADVANCE: count = 000042 current_time = <2003-12-31_03:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_02:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_03:00:10>
-StdYearClockAdvance_ADVANCE: count = 000043 current_time = <2003-12-31_04:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_03:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_04:00:10>
-StdYearClockAdvance_ADVANCE: count = 000044 current_time = <2003-12-31_05:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_04:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_05:00:10>
-StdYearClockAdvance_ADVANCE: count = 000045 current_time = <2003-12-31_06:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_05:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_06:00:10>
-StdYearClockAdvance_ADVANCE: count = 000046 current_time = <2003-12-31_07:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_06:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_07:00:10>
-StdYearClockAdvance_ADVANCE: count = 000047 current_time = <2003-12-31_08:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_07:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_08:00:10>
-StdYearClockAdvance_ADVANCE: count = 000048 current_time = <2003-12-31_09:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_08:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_09:00:10>
-StdYearClockAdvance_ADVANCE: count = 000049 current_time = <2003-12-31_10:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_09:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_10:00:10>
-StdYearClockAdvance_ADVANCE: count = 000050 current_time = <2003-12-31_11:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_10:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_11:00:10>
-StdYearClockAdvance_ADVANCE: count = 000051 current_time = <2003-12-31_12:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_11:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_12:00:10>
-StdYearClockAdvance_ADVANCE: count = 000052 current_time = <2003-12-31_13:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_12:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_13:00:10>
-StdYearClockAdvance_ADVANCE: count = 000053 current_time = <2003-12-31_14:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_13:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_14:00:10>
-StdYearClockAdvance_ADVANCE: count = 000054 current_time = <2003-12-31_15:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_14:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_15:00:10>
-StdYearClockAdvance_ADVANCE: count = 000055 current_time = <2003-12-31_16:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_15:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_16:00:10>
-StdYearClockAdvance_ADVANCE: count = 000056 current_time = <2003-12-31_17:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_16:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_17:00:10>
-StdYearClockAdvance_ADVANCE: count = 000057 current_time = <2003-12-31_18:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_17:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_18:00:10>
-StdYearClockAdvance_ADVANCE: count = 000058 current_time = <2003-12-31_19:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_18:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_19:00:10>
-StdYearClockAdvance_ADVANCE: count = 000059 current_time = <2003-12-31_20:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_19:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_20:00:10>
-StdYearClockAdvance_ADVANCE: count = 000060 current_time = <2003-12-31_21:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_20:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_21:00:10>
-StdYearClockAdvance_ADVANCE: count = 000061 current_time = <2003-12-31_22:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_21:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_22:00:10>
-StdYearClockAdvance_ADVANCE: count = 000062 current_time = <2003-12-31_23:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_22:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_23:00:10>
-StdYearClockAdvance_ADVANCE: count = 000063 current_time = <2004-01-01_00:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_23:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_00:00:10>
-StdYearClockAdvance_ADVANCE: count = 000064 current_time = <2004-01-01_01:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_00:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_01:00:10>
-StdYearClockAdvance_ADVANCE: count = 000065 current_time = <2004-01-01_02:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_01:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_02:00:10>
-StdYearClockAdvance_ADVANCE: count = 000066 current_time = <2004-01-01_03:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_02:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_03:00:10>
-StdYearClockAdvance_ADVANCE: count = 000067 current_time = <2004-01-01_04:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_03:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_04:00:10>
-StdYearClockAdvance_ADVANCE: count = 000068 current_time = <2004-01-01_05:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_04:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_05:00:10>
-StdYearClockAdvance_ADVANCE: count = 000069 current_time = <2004-01-01_06:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_05:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_06:00:10>
-StdYearClockAdvance_ADVANCE: count = 000070 current_time = <2004-01-01_07:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_06:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_07:00:10>
-StdYearClockAdvance_ADVANCE: count = 000071 current_time = <2004-01-01_08:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_07:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_08:00:10>
-StdYearClockAdvance_ADVANCE: count = 000072 current_time = <2004-01-01_09:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_08:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_09:00:10>
-StdYearClockAdvance_ADVANCE: count = 000073 current_time = <2004-01-01_10:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_09:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_10:00:10>
-StdYearClockAdvance_ADVANCE: count = 000074 current_time = <2004-01-01_11:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_10:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_11:00:10>
-StdYearClockAdvance_ADVANCE: count = 000075 current_time = <2004-01-01_12:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_11:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_12:00:10>
-StdYearClockAdvance_ADVANCE: count = 000076 current_time = <2004-01-01_13:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_12:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_13:00:10>
-StdYearClockAdvance_ADVANCE: count = 000077 current_time = <2004-01-01_14:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_13:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_14:00:10>
-StdYearClockAdvance_ADVANCE: count = 000078 current_time = <2004-01-01_15:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_14:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_15:00:10>
-StdYearClockAdvance_ADVANCE: count = 000079 current_time = <2004-01-01_16:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_15:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_16:00:10>
-StdYearClockAdvance_ADVANCE: count = 000080 current_time = <2004-01-01_17:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_16:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_17:00:10>
-StdYearClockAdvance_ADVANCE: count = 000081 current_time = <2004-01-01_18:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_17:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_18:00:10>
-StdYearClockAdvance_ADVANCE: count = 000082 current_time = <2004-01-01_19:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_18:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_19:00:10>
-StdYearClockAdvance_ADVANCE: count = 000083 current_time = <2004-01-01_20:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_19:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_20:00:10>
-StdYearClockAdvance_ADVANCE: count = 000084 current_time = <2004-01-01_21:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_20:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_21:00:10>
-StdYearClockAdvance_ADVANCE: count = 000085 current_time = <2004-01-01_22:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_21:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_22:00:10>
-StdYearClockAdvance_ADVANCE: count = 000086 current_time = <2004-01-01_23:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_22:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_23:00:10>
-StdYearClockAdvance_ADVANCE: count = 000087 current_time = <2004-01-02_00:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_23:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-02_00:00:10>
-StdYearClockAdvance_ADVANCE: count = 000088 current_time = <2004-01-02_01:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-02_00:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-02_01:00:10>
-StdYearClockAdvance_ADVANCE: count = 000089 current_time = <2004-01-02_02:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-02_01:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-02_02:00:10>
-StdYearClockAdvance_ADVANCE: count = 000090 current_time = <2004-01-02_03:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-02_02:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-02_03:00:10>
-StdYearClockAdvance_ADVANCE: count = 000091 current_time = <2004-01-02_04:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-02_03:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-02_04:00:10>
-StdYearClockAdvance_ADVANCE: count = 000092 current_time = <2004-01-02_05:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-02_04:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-02_05:00:10>
-StdYearClockAdvance_ADVANCE: count = 000093 current_time = <2004-01-02_06:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-02_05:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-02_06:00:10>
-StdYearClockAdvance_ADVANCE: count = 000094 current_time = <2004-01-02_07:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-02_06:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-02_07:00:10>
-StdYearClockAdvance_ADVANCE: count = 000095 current_time = <2004-01-02_08:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-02_07:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-02_08:00:10>
-StdYearClockAdvance_ADVANCE: count = 000096 current_time = <2004-01-02_09:00:00>
-StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-02_08:59:50>
-StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-02_09:00:10>
-LeapYearClockAdvance_SETUP: start_time = <2004-12-29_09:00:00>
-LeapYearClockAdvance_SETUP: stop_time = <2005-01-02_09:00:00>
-LeapYearClockAdvance_SETUP: timestep = <0000000000_001:000:000>
-LeapYearClockAdvance_SETUP: increment = <0000000000_000:000:010>
-LeapYearClockAdvance_SETUP: clock current_time = <2004-12-29_09:00:00>
-LeapYearClockAdvance_SETUP: current_time dayOfYear_r8 = < 364.375000 >
-LeapYearClockAdvance_SETUP: current_time-increment = <2004-12-29_08:59:50>
-LeapYearClockAdvance_SETUP: current_time+increment = <2004-12-29_09:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000001 current_time = <2004-12-29_10:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_09:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-29_10:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000002 current_time = <2004-12-29_11:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_10:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-29_11:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000003 current_time = <2004-12-29_12:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_11:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-29_12:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000004 current_time = <2004-12-29_13:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_12:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-29_13:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000005 current_time = <2004-12-29_14:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_13:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-29_14:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000006 current_time = <2004-12-29_15:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_14:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-29_15:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000007 current_time = <2004-12-29_16:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_15:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-29_16:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000008 current_time = <2004-12-29_17:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_16:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-29_17:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000009 current_time = <2004-12-29_18:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_17:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-29_18:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000010 current_time = <2004-12-29_19:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_18:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-29_19:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000011 current_time = <2004-12-29_20:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_19:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-29_20:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000012 current_time = <2004-12-29_21:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_20:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-29_21:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000013 current_time = <2004-12-29_22:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_21:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-29_22:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000014 current_time = <2004-12-29_23:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_22:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-29_23:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000015 current_time = <2004-12-30_00:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_23:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_00:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000016 current_time = <2004-12-30_01:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_00:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_01:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000017 current_time = <2004-12-30_02:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_01:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_02:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000018 current_time = <2004-12-30_03:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_02:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_03:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000019 current_time = <2004-12-30_04:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_03:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_04:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000020 current_time = <2004-12-30_05:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_04:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_05:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000021 current_time = <2004-12-30_06:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_05:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_06:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000022 current_time = <2004-12-30_07:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_06:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_07:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000023 current_time = <2004-12-30_08:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_07:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_08:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000024 current_time = <2004-12-30_09:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_08:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_09:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000025 current_time = <2004-12-30_10:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_09:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_10:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000026 current_time = <2004-12-30_11:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_10:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_11:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000027 current_time = <2004-12-30_12:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_11:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_12:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000028 current_time = <2004-12-30_13:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_12:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_13:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000029 current_time = <2004-12-30_14:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_13:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_14:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000030 current_time = <2004-12-30_15:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_14:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_15:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000031 current_time = <2004-12-30_16:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_15:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_16:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000032 current_time = <2004-12-30_17:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_16:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_17:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000033 current_time = <2004-12-30_18:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_17:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_18:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000034 current_time = <2004-12-30_19:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_18:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_19:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000035 current_time = <2004-12-30_20:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_19:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_20:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000036 current_time = <2004-12-30_21:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_20:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_21:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000037 current_time = <2004-12-30_22:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_21:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_22:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000038 current_time = <2004-12-30_23:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_22:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_23:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000039 current_time = <2004-12-31_00:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_23:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_00:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000040 current_time = <2004-12-31_01:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_00:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_01:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000041 current_time = <2004-12-31_02:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_01:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_02:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000042 current_time = <2004-12-31_03:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_02:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_03:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000043 current_time = <2004-12-31_04:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_03:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_04:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000044 current_time = <2004-12-31_05:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_04:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_05:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000045 current_time = <2004-12-31_06:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_05:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_06:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000046 current_time = <2004-12-31_07:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_06:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_07:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000047 current_time = <2004-12-31_08:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_07:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_08:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000048 current_time = <2004-12-31_09:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_08:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_09:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000049 current_time = <2004-12-31_10:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_09:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_10:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000050 current_time = <2004-12-31_11:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_10:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_11:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000051 current_time = <2004-12-31_12:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_11:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_12:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000052 current_time = <2004-12-31_13:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_12:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_13:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000053 current_time = <2004-12-31_14:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_13:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_14:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000054 current_time = <2004-12-31_15:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_14:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_15:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000055 current_time = <2004-12-31_16:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_15:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_16:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000056 current_time = <2004-12-31_17:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_16:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_17:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000057 current_time = <2004-12-31_18:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_17:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_18:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000058 current_time = <2004-12-31_19:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_18:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_19:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000059 current_time = <2004-12-31_20:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_19:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_20:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000060 current_time = <2004-12-31_21:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_20:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_21:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000061 current_time = <2004-12-31_22:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_21:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_22:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000062 current_time = <2004-12-31_23:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_22:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_23:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000063 current_time = <2005-01-01_00:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_23:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_00:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000064 current_time = <2005-01-01_01:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_00:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_01:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000065 current_time = <2005-01-01_02:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_01:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_02:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000066 current_time = <2005-01-01_03:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_02:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_03:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000067 current_time = <2005-01-01_04:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_03:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_04:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000068 current_time = <2005-01-01_05:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_04:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_05:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000069 current_time = <2005-01-01_06:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_05:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_06:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000070 current_time = <2005-01-01_07:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_06:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_07:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000071 current_time = <2005-01-01_08:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_07:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_08:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000072 current_time = <2005-01-01_09:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_08:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_09:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000073 current_time = <2005-01-01_10:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_09:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_10:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000074 current_time = <2005-01-01_11:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_10:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_11:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000075 current_time = <2005-01-01_12:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_11:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_12:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000076 current_time = <2005-01-01_13:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_12:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_13:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000077 current_time = <2005-01-01_14:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_13:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_14:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000078 current_time = <2005-01-01_15:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_14:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_15:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000079 current_time = <2005-01-01_16:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_15:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_16:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000080 current_time = <2005-01-01_17:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_16:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_17:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000081 current_time = <2005-01-01_18:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_17:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_18:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000082 current_time = <2005-01-01_19:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_18:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_19:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000083 current_time = <2005-01-01_20:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_19:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_20:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000084 current_time = <2005-01-01_21:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_20:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_21:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000085 current_time = <2005-01-01_22:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_21:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_22:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000086 current_time = <2005-01-01_23:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_22:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_23:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000087 current_time = <2005-01-02_00:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_23:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-02_00:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000088 current_time = <2005-01-02_01:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-02_00:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-02_01:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000089 current_time = <2005-01-02_02:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-02_01:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-02_02:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000090 current_time = <2005-01-02_03:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-02_02:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-02_03:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000091 current_time = <2005-01-02_04:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-02_03:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-02_04:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000092 current_time = <2005-01-02_05:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-02_04:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-02_05:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000093 current_time = <2005-01-02_06:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-02_05:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-02_06:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000094 current_time = <2005-01-02_07:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-02_06:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-02_07:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000095 current_time = <2005-01-02_08:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-02_07:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-02_08:00:10>
-LeapYearClockAdvance_ADVANCE: count = 000096 current_time = <2005-01-02_09:00:00>
-LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-02_08:59:50>
-LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-02_09:00:10>
-LeapYearFractionClockAdvance_SETUP: start_time = <2004-12-31_23:58:00>
-LeapYearFractionClockAdvance_SETUP: stop_time = <2005-01-01_00:02:00>
-LeapYearFractionClockAdvance_SETUP: timestep = <0000000000_000:000:013+01/03>
-LeapYearFractionClockAdvance_SETUP: increment = <0000000000_000:000:001+01/03>
-LeapYearFractionClockAdvance_SETUP: clock current_time = <2004-12-31_23:58:00>
-LeapYearFractionClockAdvance_SETUP: current_time dayOfYear_r8 = < 366.998611 >
-LeapYearFractionClockAdvance_SETUP: current_time-increment = <2004-12-31_23:57:58+02/03>
-LeapYearFractionClockAdvance_SETUP: current_time+increment = <2004-12-31_23:58:01+01/03>
-LeapYearFractionClockAdvance_ADVANCE: count = 000001 current_time = <2004-12-31_23:58:13+01/03>
-LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2004-12-31_23:58:12>
-LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2004-12-31_23:58:14+02/03>
-LeapYearFractionClockAdvance_ADVANCE: count = 000002 current_time = <2004-12-31_23:58:26+02/03>
-LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2004-12-31_23:58:25+01/03>
-LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2004-12-31_23:58:28>
-LeapYearFractionClockAdvance_ADVANCE: count = 000003 current_time = <2004-12-31_23:58:40>
-LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2004-12-31_23:58:38+02/03>
-LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2004-12-31_23:58:41+01/03>
-LeapYearFractionClockAdvance_ADVANCE: count = 000004 current_time = <2004-12-31_23:58:53+01/03>
-LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2004-12-31_23:58:52>
-LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2004-12-31_23:58:54+02/03>
-LeapYearFractionClockAdvance_ADVANCE: count = 000005 current_time = <2004-12-31_23:59:06+02/03>
-LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2004-12-31_23:59:05+01/03>
-LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2004-12-31_23:59:08>
-LeapYearFractionClockAdvance_ADVANCE: count = 000006 current_time = <2004-12-31_23:59:20>
-LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2004-12-31_23:59:18+02/03>
-LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2004-12-31_23:59:21+01/03>
-LeapYearFractionClockAdvance_ADVANCE: count = 000007 current_time = <2004-12-31_23:59:33+01/03>
-LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2004-12-31_23:59:32>
-LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2004-12-31_23:59:34+02/03>
-LeapYearFractionClockAdvance_ADVANCE: count = 000008 current_time = <2004-12-31_23:59:46+02/03>
-LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2004-12-31_23:59:45+01/03>
-LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2004-12-31_23:59:48>
-LeapYearFractionClockAdvance_ADVANCE: count = 000009 current_time = <2005-01-01_00:00:00>
-LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2004-12-31_23:59:58+02/03>
-LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2005-01-01_00:00:01+01/03>
-LeapYearFractionClockAdvance_ADVANCE: count = 000010 current_time = <2005-01-01_00:00:13+01/03>
-LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2005-01-01_00:00:12>
-LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2005-01-01_00:00:14+02/03>
-LeapYearFractionClockAdvance_ADVANCE: count = 000011 current_time = <2005-01-01_00:00:26+02/03>
-LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2005-01-01_00:00:25+01/03>
-LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2005-01-01_00:00:28>
-LeapYearFractionClockAdvance_ADVANCE: count = 000012 current_time = <2005-01-01_00:00:40>
-LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2005-01-01_00:00:38+02/03>
-LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2005-01-01_00:00:41+01/03>
-LeapYearFractionClockAdvance_ADVANCE: count = 000013 current_time = <2005-01-01_00:00:53+01/03>
-LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2005-01-01_00:00:52>
-LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2005-01-01_00:00:54+02/03>
-LeapYearFractionClockAdvance_ADVANCE: count = 000014 current_time = <2005-01-01_00:01:06+02/03>
-LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2005-01-01_00:01:05+01/03>
-LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2005-01-01_00:01:08>
-LeapYearFractionClockAdvance_ADVANCE: count = 000015 current_time = <2005-01-01_00:01:20>
-LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2005-01-01_00:01:18+02/03>
-LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2005-01-01_00:01:21+01/03>
-LeapYearFractionClockAdvance_ADVANCE: count = 000016 current_time = <2005-01-01_00:01:33+01/03>
-LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2005-01-01_00:01:32>
-LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2005-01-01_00:01:34+02/03>
-LeapYearFractionClockAdvance_ADVANCE: count = 000017 current_time = <2005-01-01_00:01:46+02/03>
-LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2005-01-01_00:01:45+01/03>
-LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2005-01-01_00:01:48>
-LeapYearFractionClockAdvance_ADVANCE: count = 000018 current_time = <2005-01-01_00:02:00>
-LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2005-01-01_00:01:58+02/03>
-LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2005-01-01_00:02:01+01/03>
- END TEST SUITE
Added: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/Test1.out.correct
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/Test1.out.correct         (rev 0)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/Test1.out.correct        2012-11-29 22:23:06 UTC (rev 2329)
@@ -0,0 +1,1275 @@
+ BEGIN TEST SUITE
+PASS: printT_1
+PASS: printT_2
+PASS: printT_3
+PASS: printT_4
+PASS: printT_5
+PASS: printT_6
+PASS: printT_D1
+PASS: printT_D2
+PASS: printT_F1
+PASS: printT_F2
+PASS: printT_F3
+PASS: printT_F4
+PASS: printTI_1
+PASS: printTI_2
+PASS: printTI_D1
+PASS: printTI_D2
+PASS: printTI_N1
+PASS: printTI_M1
+PASS: printTI_F1
+PASS: printTI_F2
+PASS: printTI_F3
+PASS: printTI_F4
+PASS: AddT_T_TI1
+PASS: AddT_T_TI2
+PASS: AddT_T_TI3
+PASS: AddT_T_TI4
+PASS: AddT_T_TI5
+PASS: AddT_T_TI7
+PASS: AddT_T_TI8
+PASS: AddT_T_TI9
+PASS: AddT_T_TI10
+PASS: AddT_T_TI11
+PASS: AddT_T_TI12
+PASS: AddT_T_TI13
+PASS: AddT_T_TI14
+PASS: AddT_T_TI15
+PASS: AddT_T_TI_F1
+PASS: AddT_TI_T1
+PASS: AddT_TI_T2
+PASS: AddTI_TI_TI1
+PASS: AddTI_TI_TI2
+PASS: AddTI_TI_TI3
+PASS: SubtractT_T_TI1
+PASS: SubtractT_T_TI2
+PASS: SubtractT_T_TI3
+PASS: SubtractT_T_TI4
+PASS: SubtractT_T_TI5
+PASS: SubtractT_T_TI6
+PASS: SubtractT_T_TI_F1
+PASS: SubtractTI_T_T1
+PASS: SubtractTI_T_T2
+PASS: SubtractTI_T_T3
+PASS: SubtractTI_T_T4
+PASS: SubtractTI_T_T5
+PASS: SubtractTI_T_T6
+PASS: SubtractTI_T_T7
+PASS: SubtractTI_T_T8
+PASS: SubtractTI_T_T9
+PASS: SubtractTI_T_T10
+PASS: SubtractTI_T_T11
+PASS: SubtractTI_T_T12
+PASS: SubtractTI_T_T13
+PASS: SubtractTI_T_T14
+PASS: SubtractTI_TI_TI1
+PASS: SubtractTI_TI_TI2
+PASS: SubtractTI_TI_TI3
+PASS: SubtractTI_TI_TIN1
+PASS: SubtractTI_TI_TIN2
+PASS: MultiplyTI_TI_INT1
+PASS: MultiplyTI_TI_INT2
+PASS: MultiplyTI_TI_INT3
+PASS: DivideTI_TI_INT1
+PASS: DivideTI_TI_INT2
+PASS: DivideTI_TI_INT3
+PASS: DivideINT_TI_TI1
+PASS: DivideINT_TI_TI2
+PASS: DivideINT_TI_TI3
+PASS: DivideINT_TI_TI4
+PASS: DivideINT_TI_TI5
+PASS: DivideINT_TI_TI6
+PASS: DivideINT_TI_TIR1
+PASS: DivideINT_TI_TIR2
+PASS: DivideINT_TI_TIF1
+PASS: DivideINT_TI_TIF2
+PASS: DivideINT_TI_TIF3
+PASS: DivideINT_TI_TIF4
+PASS: DivideINT_TI_TIN1
+PASS: DivideINT_TI_TIN2
+PASS: DivideINT_TI_TIN3
+SimpleClockAdvance_SETUP: start_time = <2002-12-27_03:00:00>
+SimpleClockAdvance_SETUP: stop_time = <2002-12-28_08:00:00>
+SimpleClockAdvance_SETUP: timestep = <0000000000_000:010:000>
+SimpleClockAdvance_SETUP: increment = <0000000000_000:000:000>
+SimpleClockAdvance_SETUP: clock current_time = <2002-12-27_03:00:00>
+SimpleClockAdvance_SETUP: current_time dayOfYear_r8 = < 361.125000 >
+SimpleClockAdvance_SETUP: current_time-increment = <2002-12-27_03:00:00>
+SimpleClockAdvance_SETUP: current_time+increment = <2002-12-27_03:00:00>
+SimpleClockAdvance_ADVANCE: count = 000001 current_time = <2002-12-27_03:10:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_03:10:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_03:10:00>
+SimpleClockAdvance_ADVANCE: count = 000002 current_time = <2002-12-27_03:20:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_03:20:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_03:20:00>
+SimpleClockAdvance_ADVANCE: count = 000003 current_time = <2002-12-27_03:30:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_03:30:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_03:30:00>
+SimpleClockAdvance_ADVANCE: count = 000004 current_time = <2002-12-27_03:40:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_03:40:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_03:40:00>
+SimpleClockAdvance_ADVANCE: count = 000005 current_time = <2002-12-27_03:50:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_03:50:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_03:50:00>
+SimpleClockAdvance_ADVANCE: count = 000006 current_time = <2002-12-27_04:00:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_04:00:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_04:00:00>
+SimpleClockAdvance_ADVANCE: count = 000007 current_time = <2002-12-27_04:10:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_04:10:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_04:10:00>
+SimpleClockAdvance_ADVANCE: count = 000008 current_time = <2002-12-27_04:20:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_04:20:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_04:20:00>
+SimpleClockAdvance_ADVANCE: count = 000009 current_time = <2002-12-27_04:30:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_04:30:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_04:30:00>
+SimpleClockAdvance_ADVANCE: count = 000010 current_time = <2002-12-27_04:40:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_04:40:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_04:40:00>
+SimpleClockAdvance_ADVANCE: count = 000011 current_time = <2002-12-27_04:50:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_04:50:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_04:50:00>
+SimpleClockAdvance_ADVANCE: count = 000012 current_time = <2002-12-27_05:00:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_05:00:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_05:00:00>
+SimpleClockAdvance_ADVANCE: count = 000013 current_time = <2002-12-27_05:10:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_05:10:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_05:10:00>
+SimpleClockAdvance_ADVANCE: count = 000014 current_time = <2002-12-27_05:20:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_05:20:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_05:20:00>
+SimpleClockAdvance_ADVANCE: count = 000015 current_time = <2002-12-27_05:30:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_05:30:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_05:30:00>
+SimpleClockAdvance_ADVANCE: count = 000016 current_time = <2002-12-27_05:40:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_05:40:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_05:40:00>
+SimpleClockAdvance_ADVANCE: count = 000017 current_time = <2002-12-27_05:50:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_05:50:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_05:50:00>
+SimpleClockAdvance_ADVANCE: count = 000018 current_time = <2002-12-27_06:00:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_06:00:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_06:00:00>
+SimpleClockAdvance_ADVANCE: count = 000019 current_time = <2002-12-27_06:10:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_06:10:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_06:10:00>
+SimpleClockAdvance_ADVANCE: count = 000020 current_time = <2002-12-27_06:20:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_06:20:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_06:20:00>
+SimpleClockAdvance_ADVANCE: count = 000021 current_time = <2002-12-27_06:30:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_06:30:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_06:30:00>
+SimpleClockAdvance_ADVANCE: count = 000022 current_time = <2002-12-27_06:40:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_06:40:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_06:40:00>
+SimpleClockAdvance_ADVANCE: count = 000023 current_time = <2002-12-27_06:50:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_06:50:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_06:50:00>
+SimpleClockAdvance_ADVANCE: count = 000024 current_time = <2002-12-27_07:00:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_07:00:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_07:00:00>
+SimpleClockAdvance_ADVANCE: count = 000025 current_time = <2002-12-27_07:10:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_07:10:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_07:10:00>
+SimpleClockAdvance_ADVANCE: count = 000026 current_time = <2002-12-27_07:20:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_07:20:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_07:20:00>
+SimpleClockAdvance_ADVANCE: count = 000027 current_time = <2002-12-27_07:30:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_07:30:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_07:30:00>
+SimpleClockAdvance_ADVANCE: count = 000028 current_time = <2002-12-27_07:40:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_07:40:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_07:40:00>
+SimpleClockAdvance_ADVANCE: count = 000029 current_time = <2002-12-27_07:50:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_07:50:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_07:50:00>
+SimpleClockAdvance_ADVANCE: count = 000030 current_time = <2002-12-27_08:00:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_08:00:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_08:00:00>
+SimpleClockAdvance_ADVANCE: count = 000031 current_time = <2002-12-27_08:10:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_08:10:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_08:10:00>
+SimpleClockAdvance_ADVANCE: count = 000032 current_time = <2002-12-27_08:20:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_08:20:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_08:20:00>
+SimpleClockAdvance_ADVANCE: count = 000033 current_time = <2002-12-27_08:30:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_08:30:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_08:30:00>
+SimpleClockAdvance_ADVANCE: count = 000034 current_time = <2002-12-27_08:40:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_08:40:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_08:40:00>
+SimpleClockAdvance_ADVANCE: count = 000035 current_time = <2002-12-27_08:50:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_08:50:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_08:50:00>
+SimpleClockAdvance_ADVANCE: count = 000036 current_time = <2002-12-27_09:00:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_09:00:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_09:00:00>
+SimpleClockAdvance_ADVANCE: count = 000037 current_time = <2002-12-27_09:10:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_09:10:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_09:10:00>
+SimpleClockAdvance_ADVANCE: count = 000038 current_time = <2002-12-27_09:20:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_09:20:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_09:20:00>
+SimpleClockAdvance_ADVANCE: count = 000039 current_time = <2002-12-27_09:30:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_09:30:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_09:30:00>
+SimpleClockAdvance_ADVANCE: count = 000040 current_time = <2002-12-27_09:40:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_09:40:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_09:40:00>
+SimpleClockAdvance_ADVANCE: count = 000041 current_time = <2002-12-27_09:50:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_09:50:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_09:50:00>
+SimpleClockAdvance_ADVANCE: count = 000042 current_time = <2002-12-27_10:00:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_10:00:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_10:00:00>
+SimpleClockAdvance_ADVANCE: count = 000043 current_time = <2002-12-27_10:10:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_10:10:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_10:10:00>
+SimpleClockAdvance_ADVANCE: count = 000044 current_time = <2002-12-27_10:20:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_10:20:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_10:20:00>
+SimpleClockAdvance_ADVANCE: count = 000045 current_time = <2002-12-27_10:30:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_10:30:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_10:30:00>
+SimpleClockAdvance_ADVANCE: count = 000046 current_time = <2002-12-27_10:40:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_10:40:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_10:40:00>
+SimpleClockAdvance_ADVANCE: count = 000047 current_time = <2002-12-27_10:50:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_10:50:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_10:50:00>
+SimpleClockAdvance_ADVANCE: count = 000048 current_time = <2002-12-27_11:00:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_11:00:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_11:00:00>
+SimpleClockAdvance_ADVANCE: count = 000049 current_time = <2002-12-27_11:10:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_11:10:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_11:10:00>
+SimpleClockAdvance_ADVANCE: count = 000050 current_time = <2002-12-27_11:20:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_11:20:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_11:20:00>
+SimpleClockAdvance_ADVANCE: count = 000051 current_time = <2002-12-27_11:30:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_11:30:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_11:30:00>
+SimpleClockAdvance_ADVANCE: count = 000052 current_time = <2002-12-27_11:40:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_11:40:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_11:40:00>
+SimpleClockAdvance_ADVANCE: count = 000053 current_time = <2002-12-27_11:50:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_11:50:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_11:50:00>
+SimpleClockAdvance_ADVANCE: count = 000054 current_time = <2002-12-27_12:00:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_12:00:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_12:00:00>
+SimpleClockAdvance_ADVANCE: count = 000055 current_time = <2002-12-27_12:10:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_12:10:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_12:10:00>
+SimpleClockAdvance_ADVANCE: count = 000056 current_time = <2002-12-27_12:20:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_12:20:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_12:20:00>
+SimpleClockAdvance_ADVANCE: count = 000057 current_time = <2002-12-27_12:30:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_12:30:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_12:30:00>
+SimpleClockAdvance_ADVANCE: count = 000058 current_time = <2002-12-27_12:40:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_12:40:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_12:40:00>
+SimpleClockAdvance_ADVANCE: count = 000059 current_time = <2002-12-27_12:50:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_12:50:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_12:50:00>
+SimpleClockAdvance_ADVANCE: count = 000060 current_time = <2002-12-27_13:00:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_13:00:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_13:00:00>
+SimpleClockAdvance_ADVANCE: count = 000061 current_time = <2002-12-27_13:10:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_13:10:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_13:10:00>
+SimpleClockAdvance_ADVANCE: count = 000062 current_time = <2002-12-27_13:20:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_13:20:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_13:20:00>
+SimpleClockAdvance_ADVANCE: count = 000063 current_time = <2002-12-27_13:30:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_13:30:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_13:30:00>
+SimpleClockAdvance_ADVANCE: count = 000064 current_time = <2002-12-27_13:40:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_13:40:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_13:40:00>
+SimpleClockAdvance_ADVANCE: count = 000065 current_time = <2002-12-27_13:50:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_13:50:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_13:50:00>
+SimpleClockAdvance_ADVANCE: count = 000066 current_time = <2002-12-27_14:00:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_14:00:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_14:00:00>
+SimpleClockAdvance_ADVANCE: count = 000067 current_time = <2002-12-27_14:10:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_14:10:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_14:10:00>
+SimpleClockAdvance_ADVANCE: count = 000068 current_time = <2002-12-27_14:20:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_14:20:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_14:20:00>
+SimpleClockAdvance_ADVANCE: count = 000069 current_time = <2002-12-27_14:30:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_14:30:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_14:30:00>
+SimpleClockAdvance_ADVANCE: count = 000070 current_time = <2002-12-27_14:40:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_14:40:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_14:40:00>
+SimpleClockAdvance_ADVANCE: count = 000071 current_time = <2002-12-27_14:50:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_14:50:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_14:50:00>
+SimpleClockAdvance_ADVANCE: count = 000072 current_time = <2002-12-27_15:00:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_15:00:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_15:00:00>
+SimpleClockAdvance_ADVANCE: count = 000073 current_time = <2002-12-27_15:10:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_15:10:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_15:10:00>
+SimpleClockAdvance_ADVANCE: count = 000074 current_time = <2002-12-27_15:20:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_15:20:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_15:20:00>
+SimpleClockAdvance_ADVANCE: count = 000075 current_time = <2002-12-27_15:30:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_15:30:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_15:30:00>
+SimpleClockAdvance_ADVANCE: count = 000076 current_time = <2002-12-27_15:40:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_15:40:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_15:40:00>
+SimpleClockAdvance_ADVANCE: count = 000077 current_time = <2002-12-27_15:50:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_15:50:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_15:50:00>
+SimpleClockAdvance_ADVANCE: count = 000078 current_time = <2002-12-27_16:00:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_16:00:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_16:00:00>
+SimpleClockAdvance_ADVANCE: count = 000079 current_time = <2002-12-27_16:10:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_16:10:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_16:10:00>
+SimpleClockAdvance_ADVANCE: count = 000080 current_time = <2002-12-27_16:20:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_16:20:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_16:20:00>
+SimpleClockAdvance_ADVANCE: count = 000081 current_time = <2002-12-27_16:30:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_16:30:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_16:30:00>
+SimpleClockAdvance_ADVANCE: count = 000082 current_time = <2002-12-27_16:40:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_16:40:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_16:40:00>
+SimpleClockAdvance_ADVANCE: count = 000083 current_time = <2002-12-27_16:50:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_16:50:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_16:50:00>
+SimpleClockAdvance_ADVANCE: count = 000084 current_time = <2002-12-27_17:00:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_17:00:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_17:00:00>
+SimpleClockAdvance_ADVANCE: count = 000085 current_time = <2002-12-27_17:10:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_17:10:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_17:10:00>
+SimpleClockAdvance_ADVANCE: count = 000086 current_time = <2002-12-27_17:20:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_17:20:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_17:20:00>
+SimpleClockAdvance_ADVANCE: count = 000087 current_time = <2002-12-27_17:30:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_17:30:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_17:30:00>
+SimpleClockAdvance_ADVANCE: count = 000088 current_time = <2002-12-27_17:40:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_17:40:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_17:40:00>
+SimpleClockAdvance_ADVANCE: count = 000089 current_time = <2002-12-27_17:50:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_17:50:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_17:50:00>
+SimpleClockAdvance_ADVANCE: count = 000090 current_time = <2002-12-27_18:00:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_18:00:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_18:00:00>
+SimpleClockAdvance_ADVANCE: count = 000091 current_time = <2002-12-27_18:10:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_18:10:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_18:10:00>
+SimpleClockAdvance_ADVANCE: count = 000092 current_time = <2002-12-27_18:20:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_18:20:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_18:20:00>
+SimpleClockAdvance_ADVANCE: count = 000093 current_time = <2002-12-27_18:30:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_18:30:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_18:30:00>
+SimpleClockAdvance_ADVANCE: count = 000094 current_time = <2002-12-27_18:40:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_18:40:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_18:40:00>
+SimpleClockAdvance_ADVANCE: count = 000095 current_time = <2002-12-27_18:50:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_18:50:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_18:50:00>
+SimpleClockAdvance_ADVANCE: count = 000096 current_time = <2002-12-27_19:00:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_19:00:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_19:00:00>
+SimpleClockAdvance_ADVANCE: count = 000097 current_time = <2002-12-27_19:10:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_19:10:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_19:10:00>
+SimpleClockAdvance_ADVANCE: count = 000098 current_time = <2002-12-27_19:20:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_19:20:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_19:20:00>
+SimpleClockAdvance_ADVANCE: count = 000099 current_time = <2002-12-27_19:30:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_19:30:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_19:30:00>
+SimpleClockAdvance_ADVANCE: count = 000100 current_time = <2002-12-27_19:40:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_19:40:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_19:40:00>
+SimpleClockAdvance_ADVANCE: count = 000101 current_time = <2002-12-27_19:50:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_19:50:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_19:50:00>
+SimpleClockAdvance_ADVANCE: count = 000102 current_time = <2002-12-27_20:00:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_20:00:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_20:00:00>
+SimpleClockAdvance_ADVANCE: count = 000103 current_time = <2002-12-27_20:10:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_20:10:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_20:10:00>
+SimpleClockAdvance_ADVANCE: count = 000104 current_time = <2002-12-27_20:20:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_20:20:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_20:20:00>
+SimpleClockAdvance_ADVANCE: count = 000105 current_time = <2002-12-27_20:30:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_20:30:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_20:30:00>
+SimpleClockAdvance_ADVANCE: count = 000106 current_time = <2002-12-27_20:40:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_20:40:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_20:40:00>
+SimpleClockAdvance_ADVANCE: count = 000107 current_time = <2002-12-27_20:50:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_20:50:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_20:50:00>
+SimpleClockAdvance_ADVANCE: count = 000108 current_time = <2002-12-27_21:00:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_21:00:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_21:00:00>
+SimpleClockAdvance_ADVANCE: count = 000109 current_time = <2002-12-27_21:10:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_21:10:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_21:10:00>
+SimpleClockAdvance_ADVANCE: count = 000110 current_time = <2002-12-27_21:20:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_21:20:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_21:20:00>
+SimpleClockAdvance_ADVANCE: count = 000111 current_time = <2002-12-27_21:30:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_21:30:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_21:30:00>
+SimpleClockAdvance_ADVANCE: count = 000112 current_time = <2002-12-27_21:40:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_21:40:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_21:40:00>
+SimpleClockAdvance_ADVANCE: count = 000113 current_time = <2002-12-27_21:50:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_21:50:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_21:50:00>
+SimpleClockAdvance_ADVANCE: count = 000114 current_time = <2002-12-27_22:00:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_22:00:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_22:00:00>
+SimpleClockAdvance_ADVANCE: count = 000115 current_time = <2002-12-27_22:10:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_22:10:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_22:10:00>
+SimpleClockAdvance_ADVANCE: count = 000116 current_time = <2002-12-27_22:20:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_22:20:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_22:20:00>
+SimpleClockAdvance_ADVANCE: count = 000117 current_time = <2002-12-27_22:30:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_22:30:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_22:30:00>
+SimpleClockAdvance_ADVANCE: count = 000118 current_time = <2002-12-27_22:40:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_22:40:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_22:40:00>
+SimpleClockAdvance_ADVANCE: count = 000119 current_time = <2002-12-27_22:50:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_22:50:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_22:50:00>
+SimpleClockAdvance_ADVANCE: count = 000120 current_time = <2002-12-27_23:00:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_23:00:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_23:00:00>
+SimpleClockAdvance_ADVANCE: count = 000121 current_time = <2002-12-27_23:10:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_23:10:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_23:10:00>
+SimpleClockAdvance_ADVANCE: count = 000122 current_time = <2002-12-27_23:20:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_23:20:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_23:20:00>
+SimpleClockAdvance_ADVANCE: count = 000123 current_time = <2002-12-27_23:30:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_23:30:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_23:30:00>
+SimpleClockAdvance_ADVANCE: count = 000124 current_time = <2002-12-27_23:40:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_23:40:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_23:40:00>
+SimpleClockAdvance_ADVANCE: count = 000125 current_time = <2002-12-27_23:50:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-27_23:50:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-27_23:50:00>
+SimpleClockAdvance_ADVANCE: count = 000126 current_time = <2002-12-28_00:00:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_00:00:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_00:00:00>
+SimpleClockAdvance_ADVANCE: count = 000127 current_time = <2002-12-28_00:10:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_00:10:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_00:10:00>
+SimpleClockAdvance_ADVANCE: count = 000128 current_time = <2002-12-28_00:20:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_00:20:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_00:20:00>
+SimpleClockAdvance_ADVANCE: count = 000129 current_time = <2002-12-28_00:30:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_00:30:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_00:30:00>
+SimpleClockAdvance_ADVANCE: count = 000130 current_time = <2002-12-28_00:40:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_00:40:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_00:40:00>
+SimpleClockAdvance_ADVANCE: count = 000131 current_time = <2002-12-28_00:50:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_00:50:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_00:50:00>
+SimpleClockAdvance_ADVANCE: count = 000132 current_time = <2002-12-28_01:00:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_01:00:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_01:00:00>
+SimpleClockAdvance_ADVANCE: count = 000133 current_time = <2002-12-28_01:10:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_01:10:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_01:10:00>
+SimpleClockAdvance_ADVANCE: count = 000134 current_time = <2002-12-28_01:20:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_01:20:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_01:20:00>
+SimpleClockAdvance_ADVANCE: count = 000135 current_time = <2002-12-28_01:30:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_01:30:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_01:30:00>
+SimpleClockAdvance_ADVANCE: count = 000136 current_time = <2002-12-28_01:40:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_01:40:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_01:40:00>
+SimpleClockAdvance_ADVANCE: count = 000137 current_time = <2002-12-28_01:50:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_01:50:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_01:50:00>
+SimpleClockAdvance_ADVANCE: count = 000138 current_time = <2002-12-28_02:00:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_02:00:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_02:00:00>
+SimpleClockAdvance_ADVANCE: count = 000139 current_time = <2002-12-28_02:10:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_02:10:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_02:10:00>
+SimpleClockAdvance_ADVANCE: count = 000140 current_time = <2002-12-28_02:20:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_02:20:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_02:20:00>
+SimpleClockAdvance_ADVANCE: count = 000141 current_time = <2002-12-28_02:30:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_02:30:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_02:30:00>
+SimpleClockAdvance_ADVANCE: count = 000142 current_time = <2002-12-28_02:40:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_02:40:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_02:40:00>
+SimpleClockAdvance_ADVANCE: count = 000143 current_time = <2002-12-28_02:50:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_02:50:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_02:50:00>
+SimpleClockAdvance_ADVANCE: count = 000144 current_time = <2002-12-28_03:00:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_03:00:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_03:00:00>
+SimpleClockAdvance_ADVANCE: count = 000145 current_time = <2002-12-28_03:10:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_03:10:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_03:10:00>
+SimpleClockAdvance_ADVANCE: count = 000146 current_time = <2002-12-28_03:20:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_03:20:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_03:20:00>
+SimpleClockAdvance_ADVANCE: count = 000147 current_time = <2002-12-28_03:30:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_03:30:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_03:30:00>
+SimpleClockAdvance_ADVANCE: count = 000148 current_time = <2002-12-28_03:40:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_03:40:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_03:40:00>
+SimpleClockAdvance_ADVANCE: count = 000149 current_time = <2002-12-28_03:50:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_03:50:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_03:50:00>
+SimpleClockAdvance_ADVANCE: count = 000150 current_time = <2002-12-28_04:00:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_04:00:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_04:00:00>
+SimpleClockAdvance_ADVANCE: count = 000151 current_time = <2002-12-28_04:10:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_04:10:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_04:10:00>
+SimpleClockAdvance_ADVANCE: count = 000152 current_time = <2002-12-28_04:20:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_04:20:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_04:20:00>
+SimpleClockAdvance_ADVANCE: count = 000153 current_time = <2002-12-28_04:30:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_04:30:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_04:30:00>
+SimpleClockAdvance_ADVANCE: count = 000154 current_time = <2002-12-28_04:40:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_04:40:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_04:40:00>
+SimpleClockAdvance_ADVANCE: count = 000155 current_time = <2002-12-28_04:50:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_04:50:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_04:50:00>
+SimpleClockAdvance_ADVANCE: count = 000156 current_time = <2002-12-28_05:00:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_05:00:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_05:00:00>
+SimpleClockAdvance_ADVANCE: count = 000157 current_time = <2002-12-28_05:10:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_05:10:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_05:10:00>
+SimpleClockAdvance_ADVANCE: count = 000158 current_time = <2002-12-28_05:20:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_05:20:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_05:20:00>
+SimpleClockAdvance_ADVANCE: count = 000159 current_time = <2002-12-28_05:30:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_05:30:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_05:30:00>
+SimpleClockAdvance_ADVANCE: count = 000160 current_time = <2002-12-28_05:40:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_05:40:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_05:40:00>
+SimpleClockAdvance_ADVANCE: count = 000161 current_time = <2002-12-28_05:50:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_05:50:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_05:50:00>
+SimpleClockAdvance_ADVANCE: count = 000162 current_time = <2002-12-28_06:00:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_06:00:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_06:00:00>
+SimpleClockAdvance_ADVANCE: count = 000163 current_time = <2002-12-28_06:10:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_06:10:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_06:10:00>
+SimpleClockAdvance_ADVANCE: count = 000164 current_time = <2002-12-28_06:20:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_06:20:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_06:20:00>
+SimpleClockAdvance_ADVANCE: count = 000165 current_time = <2002-12-28_06:30:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_06:30:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_06:30:00>
+SimpleClockAdvance_ADVANCE: count = 000166 current_time = <2002-12-28_06:40:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_06:40:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_06:40:00>
+SimpleClockAdvance_ADVANCE: count = 000167 current_time = <2002-12-28_06:50:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_06:50:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_06:50:00>
+SimpleClockAdvance_ADVANCE: count = 000168 current_time = <2002-12-28_07:00:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_07:00:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_07:00:00>
+SimpleClockAdvance_ADVANCE: count = 000169 current_time = <2002-12-28_07:10:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_07:10:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_07:10:00>
+SimpleClockAdvance_ADVANCE: count = 000170 current_time = <2002-12-28_07:20:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_07:20:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_07:20:00>
+SimpleClockAdvance_ADVANCE: count = 000171 current_time = <2002-12-28_07:30:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_07:30:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_07:30:00>
+SimpleClockAdvance_ADVANCE: count = 000172 current_time = <2002-12-28_07:40:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_07:40:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_07:40:00>
+SimpleClockAdvance_ADVANCE: count = 000173 current_time = <2002-12-28_07:50:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_07:50:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_07:50:00>
+SimpleClockAdvance_ADVANCE: count = 000174 current_time = <2002-12-28_08:00:00>
+SimpleClockAdvance_ADVANCE: current_time-increment = <2002-12-28_08:00:00>
+SimpleClockAdvance_ADVANCE: current_time+increment = <2002-12-28_08:00:00>
+StdYearClockAdvance_SETUP: start_time = <2003-12-29_09:00:00>
+StdYearClockAdvance_SETUP: stop_time = <2004-01-02_09:00:00>
+StdYearClockAdvance_SETUP: timestep = <0000000000_001:000:000>
+StdYearClockAdvance_SETUP: increment = <0000000000_000:000:010>
+StdYearClockAdvance_SETUP: clock current_time = <2003-12-29_09:00:00>
+StdYearClockAdvance_SETUP: current_time dayOfYear_r8 = < 363.375000 >
+StdYearClockAdvance_SETUP: current_time-increment = <2003-12-29_08:59:50>
+StdYearClockAdvance_SETUP: current_time+increment = <2003-12-29_09:00:10>
+StdYearClockAdvance_ADVANCE: count = 000001 current_time = <2003-12-29_10:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_09:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-29_10:00:10>
+StdYearClockAdvance_ADVANCE: count = 000002 current_time = <2003-12-29_11:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_10:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-29_11:00:10>
+StdYearClockAdvance_ADVANCE: count = 000003 current_time = <2003-12-29_12:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_11:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-29_12:00:10>
+StdYearClockAdvance_ADVANCE: count = 000004 current_time = <2003-12-29_13:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_12:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-29_13:00:10>
+StdYearClockAdvance_ADVANCE: count = 000005 current_time = <2003-12-29_14:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_13:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-29_14:00:10>
+StdYearClockAdvance_ADVANCE: count = 000006 current_time = <2003-12-29_15:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_14:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-29_15:00:10>
+StdYearClockAdvance_ADVANCE: count = 000007 current_time = <2003-12-29_16:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_15:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-29_16:00:10>
+StdYearClockAdvance_ADVANCE: count = 000008 current_time = <2003-12-29_17:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_16:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-29_17:00:10>
+StdYearClockAdvance_ADVANCE: count = 000009 current_time = <2003-12-29_18:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_17:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-29_18:00:10>
+StdYearClockAdvance_ADVANCE: count = 000010 current_time = <2003-12-29_19:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_18:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-29_19:00:10>
+StdYearClockAdvance_ADVANCE: count = 000011 current_time = <2003-12-29_20:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_19:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-29_20:00:10>
+StdYearClockAdvance_ADVANCE: count = 000012 current_time = <2003-12-29_21:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_20:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-29_21:00:10>
+StdYearClockAdvance_ADVANCE: count = 000013 current_time = <2003-12-29_22:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_21:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-29_22:00:10>
+StdYearClockAdvance_ADVANCE: count = 000014 current_time = <2003-12-29_23:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_22:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-29_23:00:10>
+StdYearClockAdvance_ADVANCE: count = 000015 current_time = <2003-12-30_00:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-29_23:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_00:00:10>
+StdYearClockAdvance_ADVANCE: count = 000016 current_time = <2003-12-30_01:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_00:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_01:00:10>
+StdYearClockAdvance_ADVANCE: count = 000017 current_time = <2003-12-30_02:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_01:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_02:00:10>
+StdYearClockAdvance_ADVANCE: count = 000018 current_time = <2003-12-30_03:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_02:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_03:00:10>
+StdYearClockAdvance_ADVANCE: count = 000019 current_time = <2003-12-30_04:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_03:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_04:00:10>
+StdYearClockAdvance_ADVANCE: count = 000020 current_time = <2003-12-30_05:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_04:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_05:00:10>
+StdYearClockAdvance_ADVANCE: count = 000021 current_time = <2003-12-30_06:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_05:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_06:00:10>
+StdYearClockAdvance_ADVANCE: count = 000022 current_time = <2003-12-30_07:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_06:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_07:00:10>
+StdYearClockAdvance_ADVANCE: count = 000023 current_time = <2003-12-30_08:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_07:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_08:00:10>
+StdYearClockAdvance_ADVANCE: count = 000024 current_time = <2003-12-30_09:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_08:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_09:00:10>
+StdYearClockAdvance_ADVANCE: count = 000025 current_time = <2003-12-30_10:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_09:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_10:00:10>
+StdYearClockAdvance_ADVANCE: count = 000026 current_time = <2003-12-30_11:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_10:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_11:00:10>
+StdYearClockAdvance_ADVANCE: count = 000027 current_time = <2003-12-30_12:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_11:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_12:00:10>
+StdYearClockAdvance_ADVANCE: count = 000028 current_time = <2003-12-30_13:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_12:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_13:00:10>
+StdYearClockAdvance_ADVANCE: count = 000029 current_time = <2003-12-30_14:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_13:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_14:00:10>
+StdYearClockAdvance_ADVANCE: count = 000030 current_time = <2003-12-30_15:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_14:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_15:00:10>
+StdYearClockAdvance_ADVANCE: count = 000031 current_time = <2003-12-30_16:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_15:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_16:00:10>
+StdYearClockAdvance_ADVANCE: count = 000032 current_time = <2003-12-30_17:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_16:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_17:00:10>
+StdYearClockAdvance_ADVANCE: count = 000033 current_time = <2003-12-30_18:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_17:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_18:00:10>
+StdYearClockAdvance_ADVANCE: count = 000034 current_time = <2003-12-30_19:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_18:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_19:00:10>
+StdYearClockAdvance_ADVANCE: count = 000035 current_time = <2003-12-30_20:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_19:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_20:00:10>
+StdYearClockAdvance_ADVANCE: count = 000036 current_time = <2003-12-30_21:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_20:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_21:00:10>
+StdYearClockAdvance_ADVANCE: count = 000037 current_time = <2003-12-30_22:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_21:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_22:00:10>
+StdYearClockAdvance_ADVANCE: count = 000038 current_time = <2003-12-30_23:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_22:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-30_23:00:10>
+StdYearClockAdvance_ADVANCE: count = 000039 current_time = <2003-12-31_00:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-30_23:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_00:00:10>
+StdYearClockAdvance_ADVANCE: count = 000040 current_time = <2003-12-31_01:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_00:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_01:00:10>
+StdYearClockAdvance_ADVANCE: count = 000041 current_time = <2003-12-31_02:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_01:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_02:00:10>
+StdYearClockAdvance_ADVANCE: count = 000042 current_time = <2003-12-31_03:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_02:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_03:00:10>
+StdYearClockAdvance_ADVANCE: count = 000043 current_time = <2003-12-31_04:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_03:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_04:00:10>
+StdYearClockAdvance_ADVANCE: count = 000044 current_time = <2003-12-31_05:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_04:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_05:00:10>
+StdYearClockAdvance_ADVANCE: count = 000045 current_time = <2003-12-31_06:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_05:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_06:00:10>
+StdYearClockAdvance_ADVANCE: count = 000046 current_time = <2003-12-31_07:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_06:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_07:00:10>
+StdYearClockAdvance_ADVANCE: count = 000047 current_time = <2003-12-31_08:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_07:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_08:00:10>
+StdYearClockAdvance_ADVANCE: count = 000048 current_time = <2003-12-31_09:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_08:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_09:00:10>
+StdYearClockAdvance_ADVANCE: count = 000049 current_time = <2003-12-31_10:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_09:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_10:00:10>
+StdYearClockAdvance_ADVANCE: count = 000050 current_time = <2003-12-31_11:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_10:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_11:00:10>
+StdYearClockAdvance_ADVANCE: count = 000051 current_time = <2003-12-31_12:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_11:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_12:00:10>
+StdYearClockAdvance_ADVANCE: count = 000052 current_time = <2003-12-31_13:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_12:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_13:00:10>
+StdYearClockAdvance_ADVANCE: count = 000053 current_time = <2003-12-31_14:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_13:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_14:00:10>
+StdYearClockAdvance_ADVANCE: count = 000054 current_time = <2003-12-31_15:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_14:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_15:00:10>
+StdYearClockAdvance_ADVANCE: count = 000055 current_time = <2003-12-31_16:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_15:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_16:00:10>
+StdYearClockAdvance_ADVANCE: count = 000056 current_time = <2003-12-31_17:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_16:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_17:00:10>
+StdYearClockAdvance_ADVANCE: count = 000057 current_time = <2003-12-31_18:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_17:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_18:00:10>
+StdYearClockAdvance_ADVANCE: count = 000058 current_time = <2003-12-31_19:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_18:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_19:00:10>
+StdYearClockAdvance_ADVANCE: count = 000059 current_time = <2003-12-31_20:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_19:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_20:00:10>
+StdYearClockAdvance_ADVANCE: count = 000060 current_time = <2003-12-31_21:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_20:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_21:00:10>
+StdYearClockAdvance_ADVANCE: count = 000061 current_time = <2003-12-31_22:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_21:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_22:00:10>
+StdYearClockAdvance_ADVANCE: count = 000062 current_time = <2003-12-31_23:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_22:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2003-12-31_23:00:10>
+StdYearClockAdvance_ADVANCE: count = 000063 current_time = <2004-01-01_00:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2003-12-31_23:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_00:00:10>
+StdYearClockAdvance_ADVANCE: count = 000064 current_time = <2004-01-01_01:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_00:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_01:00:10>
+StdYearClockAdvance_ADVANCE: count = 000065 current_time = <2004-01-01_02:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_01:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_02:00:10>
+StdYearClockAdvance_ADVANCE: count = 000066 current_time = <2004-01-01_03:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_02:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_03:00:10>
+StdYearClockAdvance_ADVANCE: count = 000067 current_time = <2004-01-01_04:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_03:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_04:00:10>
+StdYearClockAdvance_ADVANCE: count = 000068 current_time = <2004-01-01_05:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_04:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_05:00:10>
+StdYearClockAdvance_ADVANCE: count = 000069 current_time = <2004-01-01_06:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_05:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_06:00:10>
+StdYearClockAdvance_ADVANCE: count = 000070 current_time = <2004-01-01_07:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_06:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_07:00:10>
+StdYearClockAdvance_ADVANCE: count = 000071 current_time = <2004-01-01_08:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_07:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_08:00:10>
+StdYearClockAdvance_ADVANCE: count = 000072 current_time = <2004-01-01_09:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_08:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_09:00:10>
+StdYearClockAdvance_ADVANCE: count = 000073 current_time = <2004-01-01_10:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_09:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_10:00:10>
+StdYearClockAdvance_ADVANCE: count = 000074 current_time = <2004-01-01_11:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_10:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_11:00:10>
+StdYearClockAdvance_ADVANCE: count = 000075 current_time = <2004-01-01_12:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_11:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_12:00:10>
+StdYearClockAdvance_ADVANCE: count = 000076 current_time = <2004-01-01_13:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_12:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_13:00:10>
+StdYearClockAdvance_ADVANCE: count = 000077 current_time = <2004-01-01_14:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_13:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_14:00:10>
+StdYearClockAdvance_ADVANCE: count = 000078 current_time = <2004-01-01_15:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_14:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_15:00:10>
+StdYearClockAdvance_ADVANCE: count = 000079 current_time = <2004-01-01_16:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_15:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_16:00:10>
+StdYearClockAdvance_ADVANCE: count = 000080 current_time = <2004-01-01_17:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_16:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_17:00:10>
+StdYearClockAdvance_ADVANCE: count = 000081 current_time = <2004-01-01_18:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_17:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_18:00:10>
+StdYearClockAdvance_ADVANCE: count = 000082 current_time = <2004-01-01_19:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_18:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_19:00:10>
+StdYearClockAdvance_ADVANCE: count = 000083 current_time = <2004-01-01_20:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_19:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_20:00:10>
+StdYearClockAdvance_ADVANCE: count = 000084 current_time = <2004-01-01_21:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_20:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_21:00:10>
+StdYearClockAdvance_ADVANCE: count = 000085 current_time = <2004-01-01_22:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_21:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_22:00:10>
+StdYearClockAdvance_ADVANCE: count = 000086 current_time = <2004-01-01_23:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_22:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-01_23:00:10>
+StdYearClockAdvance_ADVANCE: count = 000087 current_time = <2004-01-02_00:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-01_23:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-02_00:00:10>
+StdYearClockAdvance_ADVANCE: count = 000088 current_time = <2004-01-02_01:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-02_00:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-02_01:00:10>
+StdYearClockAdvance_ADVANCE: count = 000089 current_time = <2004-01-02_02:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-02_01:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-02_02:00:10>
+StdYearClockAdvance_ADVANCE: count = 000090 current_time = <2004-01-02_03:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-02_02:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-02_03:00:10>
+StdYearClockAdvance_ADVANCE: count = 000091 current_time = <2004-01-02_04:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-02_03:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-02_04:00:10>
+StdYearClockAdvance_ADVANCE: count = 000092 current_time = <2004-01-02_05:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-02_04:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-02_05:00:10>
+StdYearClockAdvance_ADVANCE: count = 000093 current_time = <2004-01-02_06:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-02_05:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-02_06:00:10>
+StdYearClockAdvance_ADVANCE: count = 000094 current_time = <2004-01-02_07:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-02_06:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-02_07:00:10>
+StdYearClockAdvance_ADVANCE: count = 000095 current_time = <2004-01-02_08:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-02_07:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-02_08:00:10>
+StdYearClockAdvance_ADVANCE: count = 000096 current_time = <2004-01-02_09:00:00>
+StdYearClockAdvance_ADVANCE: current_time-increment = <2004-01-02_08:59:50>
+StdYearClockAdvance_ADVANCE: current_time+increment = <2004-01-02_09:00:10>
+LeapYearClockAdvance_SETUP: start_time = <2004-12-29_09:00:00>
+LeapYearClockAdvance_SETUP: stop_time = <2005-01-02_09:00:00>
+LeapYearClockAdvance_SETUP: timestep = <0000000000_001:000:000>
+LeapYearClockAdvance_SETUP: increment = <0000000000_000:000:010>
+LeapYearClockAdvance_SETUP: clock current_time = <2004-12-29_09:00:00>
+LeapYearClockAdvance_SETUP: current_time dayOfYear_r8 = < 364.375000 >
+LeapYearClockAdvance_SETUP: current_time-increment = <2004-12-29_08:59:50>
+LeapYearClockAdvance_SETUP: current_time+increment = <2004-12-29_09:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000001 current_time = <2004-12-29_10:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_09:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-29_10:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000002 current_time = <2004-12-29_11:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_10:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-29_11:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000003 current_time = <2004-12-29_12:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_11:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-29_12:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000004 current_time = <2004-12-29_13:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_12:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-29_13:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000005 current_time = <2004-12-29_14:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_13:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-29_14:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000006 current_time = <2004-12-29_15:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_14:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-29_15:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000007 current_time = <2004-12-29_16:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_15:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-29_16:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000008 current_time = <2004-12-29_17:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_16:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-29_17:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000009 current_time = <2004-12-29_18:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_17:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-29_18:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000010 current_time = <2004-12-29_19:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_18:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-29_19:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000011 current_time = <2004-12-29_20:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_19:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-29_20:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000012 current_time = <2004-12-29_21:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_20:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-29_21:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000013 current_time = <2004-12-29_22:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_21:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-29_22:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000014 current_time = <2004-12-29_23:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_22:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-29_23:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000015 current_time = <2004-12-30_00:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-29_23:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_00:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000016 current_time = <2004-12-30_01:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_00:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_01:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000017 current_time = <2004-12-30_02:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_01:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_02:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000018 current_time = <2004-12-30_03:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_02:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_03:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000019 current_time = <2004-12-30_04:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_03:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_04:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000020 current_time = <2004-12-30_05:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_04:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_05:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000021 current_time = <2004-12-30_06:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_05:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_06:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000022 current_time = <2004-12-30_07:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_06:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_07:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000023 current_time = <2004-12-30_08:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_07:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_08:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000024 current_time = <2004-12-30_09:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_08:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_09:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000025 current_time = <2004-12-30_10:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_09:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_10:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000026 current_time = <2004-12-30_11:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_10:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_11:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000027 current_time = <2004-12-30_12:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_11:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_12:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000028 current_time = <2004-12-30_13:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_12:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_13:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000029 current_time = <2004-12-30_14:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_13:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_14:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000030 current_time = <2004-12-30_15:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_14:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_15:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000031 current_time = <2004-12-30_16:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_15:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_16:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000032 current_time = <2004-12-30_17:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_16:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_17:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000033 current_time = <2004-12-30_18:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_17:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_18:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000034 current_time = <2004-12-30_19:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_18:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_19:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000035 current_time = <2004-12-30_20:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_19:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_20:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000036 current_time = <2004-12-30_21:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_20:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_21:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000037 current_time = <2004-12-30_22:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_21:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_22:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000038 current_time = <2004-12-30_23:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_22:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-30_23:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000039 current_time = <2004-12-31_00:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-30_23:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_00:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000040 current_time = <2004-12-31_01:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_00:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_01:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000041 current_time = <2004-12-31_02:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_01:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_02:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000042 current_time = <2004-12-31_03:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_02:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_03:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000043 current_time = <2004-12-31_04:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_03:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_04:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000044 current_time = <2004-12-31_05:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_04:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_05:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000045 current_time = <2004-12-31_06:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_05:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_06:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000046 current_time = <2004-12-31_07:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_06:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_07:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000047 current_time = <2004-12-31_08:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_07:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_08:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000048 current_time = <2004-12-31_09:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_08:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_09:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000049 current_time = <2004-12-31_10:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_09:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_10:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000050 current_time = <2004-12-31_11:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_10:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_11:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000051 current_time = <2004-12-31_12:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_11:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_12:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000052 current_time = <2004-12-31_13:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_12:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_13:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000053 current_time = <2004-12-31_14:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_13:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_14:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000054 current_time = <2004-12-31_15:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_14:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_15:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000055 current_time = <2004-12-31_16:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_15:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_16:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000056 current_time = <2004-12-31_17:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_16:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_17:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000057 current_time = <2004-12-31_18:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_17:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_18:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000058 current_time = <2004-12-31_19:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_18:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_19:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000059 current_time = <2004-12-31_20:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_19:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_20:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000060 current_time = <2004-12-31_21:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_20:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_21:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000061 current_time = <2004-12-31_22:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_21:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_22:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000062 current_time = <2004-12-31_23:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_22:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2004-12-31_23:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000063 current_time = <2005-01-01_00:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2004-12-31_23:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_00:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000064 current_time = <2005-01-01_01:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_00:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_01:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000065 current_time = <2005-01-01_02:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_01:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_02:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000066 current_time = <2005-01-01_03:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_02:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_03:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000067 current_time = <2005-01-01_04:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_03:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_04:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000068 current_time = <2005-01-01_05:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_04:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_05:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000069 current_time = <2005-01-01_06:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_05:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_06:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000070 current_time = <2005-01-01_07:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_06:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_07:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000071 current_time = <2005-01-01_08:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_07:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_08:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000072 current_time = <2005-01-01_09:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_08:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_09:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000073 current_time = <2005-01-01_10:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_09:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_10:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000074 current_time = <2005-01-01_11:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_10:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_11:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000075 current_time = <2005-01-01_12:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_11:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_12:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000076 current_time = <2005-01-01_13:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_12:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_13:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000077 current_time = <2005-01-01_14:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_13:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_14:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000078 current_time = <2005-01-01_15:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_14:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_15:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000079 current_time = <2005-01-01_16:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_15:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_16:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000080 current_time = <2005-01-01_17:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_16:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_17:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000081 current_time = <2005-01-01_18:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_17:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_18:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000082 current_time = <2005-01-01_19:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_18:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_19:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000083 current_time = <2005-01-01_20:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_19:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_20:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000084 current_time = <2005-01-01_21:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_20:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_21:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000085 current_time = <2005-01-01_22:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_21:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_22:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000086 current_time = <2005-01-01_23:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_22:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-01_23:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000087 current_time = <2005-01-02_00:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-01_23:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-02_00:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000088 current_time = <2005-01-02_01:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-02_00:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-02_01:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000089 current_time = <2005-01-02_02:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-02_01:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-02_02:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000090 current_time = <2005-01-02_03:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-02_02:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-02_03:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000091 current_time = <2005-01-02_04:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-02_03:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-02_04:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000092 current_time = <2005-01-02_05:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-02_04:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-02_05:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000093 current_time = <2005-01-02_06:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-02_05:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-02_06:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000094 current_time = <2005-01-02_07:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-02_06:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-02_07:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000095 current_time = <2005-01-02_08:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-02_07:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-02_08:00:10>
+LeapYearClockAdvance_ADVANCE: count = 000096 current_time = <2005-01-02_09:00:00>
+LeapYearClockAdvance_ADVANCE: current_time-increment = <2005-01-02_08:59:50>
+LeapYearClockAdvance_ADVANCE: current_time+increment = <2005-01-02_09:00:10>
+LeapYearFractionClockAdvance_SETUP: start_time = <2004-12-31_23:58:00>
+LeapYearFractionClockAdvance_SETUP: stop_time = <2005-01-01_00:02:00>
+LeapYearFractionClockAdvance_SETUP: timestep = <0000000000_000:000:013+01/03>
+LeapYearFractionClockAdvance_SETUP: increment = <0000000000_000:000:001+01/03>
+LeapYearFractionClockAdvance_SETUP: clock current_time = <2004-12-31_23:58:00>
+LeapYearFractionClockAdvance_SETUP: current_time dayOfYear_r8 = < 366.998611 >
+LeapYearFractionClockAdvance_SETUP: current_time-increment = <2004-12-31_23:57:58+02/03>
+LeapYearFractionClockAdvance_SETUP: current_time+increment = <2004-12-31_23:58:01+01/03>
+LeapYearFractionClockAdvance_ADVANCE: count = 000001 current_time = <2004-12-31_23:58:13+01/03>
+LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2004-12-31_23:58:12>
+LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2004-12-31_23:58:14+02/03>
+LeapYearFractionClockAdvance_ADVANCE: count = 000002 current_time = <2004-12-31_23:58:26+02/03>
+LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2004-12-31_23:58:25+01/03>
+LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2004-12-31_23:58:28>
+LeapYearFractionClockAdvance_ADVANCE: count = 000003 current_time = <2004-12-31_23:58:40>
+LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2004-12-31_23:58:38+02/03>
+LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2004-12-31_23:58:41+01/03>
+LeapYearFractionClockAdvance_ADVANCE: count = 000004 current_time = <2004-12-31_23:58:53+01/03>
+LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2004-12-31_23:58:52>
+LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2004-12-31_23:58:54+02/03>
+LeapYearFractionClockAdvance_ADVANCE: count = 000005 current_time = <2004-12-31_23:59:06+02/03>
+LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2004-12-31_23:59:05+01/03>
+LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2004-12-31_23:59:08>
+LeapYearFractionClockAdvance_ADVANCE: count = 000006 current_time = <2004-12-31_23:59:20>
+LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2004-12-31_23:59:18+02/03>
+LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2004-12-31_23:59:21+01/03>
+LeapYearFractionClockAdvance_ADVANCE: count = 000007 current_time = <2004-12-31_23:59:33+01/03>
+LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2004-12-31_23:59:32>
+LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2004-12-31_23:59:34+02/03>
+LeapYearFractionClockAdvance_ADVANCE: count = 000008 current_time = <2004-12-31_23:59:46+02/03>
+LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2004-12-31_23:59:45+01/03>
+LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2004-12-31_23:59:48>
+LeapYearFractionClockAdvance_ADVANCE: count = 000009 current_time = <2005-01-01_00:00:00>
+LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2004-12-31_23:59:58+02/03>
+LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2005-01-01_00:00:01+01/03>
+LeapYearFractionClockAdvance_ADVANCE: count = 000010 current_time = <2005-01-01_00:00:13+01/03>
+LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2005-01-01_00:00:12>
+LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2005-01-01_00:00:14+02/03>
+LeapYearFractionClockAdvance_ADVANCE: count = 000011 current_time = <2005-01-01_00:00:26+02/03>
+LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2005-01-01_00:00:25+01/03>
+LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2005-01-01_00:00:28>
+LeapYearFractionClockAdvance_ADVANCE: count = 000012 current_time = <2005-01-01_00:00:40>
+LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2005-01-01_00:00:38+02/03>
+LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2005-01-01_00:00:41+01/03>
+LeapYearFractionClockAdvance_ADVANCE: count = 000013 current_time = <2005-01-01_00:00:53+01/03>
+LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2005-01-01_00:00:52>
+LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2005-01-01_00:00:54+02/03>
+LeapYearFractionClockAdvance_ADVANCE: count = 000014 current_time = <2005-01-01_00:01:06+02/03>
+LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2005-01-01_00:01:05+01/03>
+LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2005-01-01_00:01:08>
+LeapYearFractionClockAdvance_ADVANCE: count = 000015 current_time = <2005-01-01_00:01:20>
+LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2005-01-01_00:01:18+02/03>
+LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2005-01-01_00:01:21+01/03>
+LeapYearFractionClockAdvance_ADVANCE: count = 000016 current_time = <2005-01-01_00:01:33+01/03>
+LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2005-01-01_00:01:32>
+LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2005-01-01_00:01:34+02/03>
+LeapYearFractionClockAdvance_ADVANCE: count = 000017 current_time = <2005-01-01_00:01:46+02/03>
+LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2005-01-01_00:01:45+01/03>
+LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2005-01-01_00:01:48>
+LeapYearFractionClockAdvance_ADVANCE: count = 000018 current_time = <2005-01-01_00:02:00>
+LeapYearFractionClockAdvance_ADVANCE: current_time-increment = <2005-01-01_00:01:58+02/03>
+LeapYearFractionClockAdvance_ADVANCE: current_time+increment = <2005-01-01_00:02:01+01/03>
+ END TEST SUITE
Modified: branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/module_symbols_util.F90
===================================================================
--- branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/module_symbols_util.F90        2012-11-29 20:50:09 UTC (rev 2328)
+++ branches/ocean_projects/cesm_coupling/src/external/esmf_time_f90/module_symbols_util.F90        2012-11-29 22:23:06 UTC (rev 2329)
@@ -1,5 +1,5 @@
!
-! NOTE: This file will be removed once encapsulation of bare MPAS_ESMF
+! NOTE: This file will be removed once encapsulation of bare ESMF
! calls is complete within WRF non-external source code.
!
! NOTE: This file was automatically generated by the findsymbol script
@@ -8,119 +8,119 @@
! 1) Run the findsymbol script on a machine that has Ruby installed to
! generate this file. Type "findsymbol -h" for help using findsymbol.
! For example:
-! >> hender IN loquat:/loquat2/hender/Ruby/FortranTools/ >> findsymbol -d /users/hender/Tasks/WRF_MPAS_ESMF/WRFV2_20050512_1410_WORK/WRFV2/external/MPAS_ESMF_time_f90 -S MPAS_ESMF_ -p -g WRFU_ -o MPAS_ESMF_Mod -n module_symbols_util > & ! module_symbols_util.F90
+! >> hender IN loquat:/loquat2/hender/Ruby/FortranTools/ >> findsymbol -d /users/hender/Tasks/WRF_ESMF/WRFV2_20050512_1410_WORK/WRFV2/external/esmf_time_f90 -S ESMF_ -p -g WRFU_ -o ESMF_Mod -n module_symbols_util > & ! module_symbols_util.F90
!
! 2) Added this comment block by hand.
!
MODULE module_symbols_util
- USE MPAS_ESMF_Mod, WRFU_ALARM => MPAS_ESMF_ALARM
- USE MPAS_ESMF_Mod, WRFU_ALARMCREATE => MPAS_ESMF_ALARMCREATE
- USE MPAS_ESMF_Mod, WRFU_ALARMDESTROY => MPAS_ESMF_ALARMDESTROY
- USE MPAS_ESMF_Mod, WRFU_ALARMDISABLE => MPAS_ESMF_ALARMDISABLE
- USE MPAS_ESMF_Mod, WRFU_ALARMENABLE => MPAS_ESMF_ALARMENABLE
- USE MPAS_ESMF_Mod, WRFU_ALARMGET => MPAS_ESMF_ALARMGET
- USE MPAS_ESMF_Mod, WRFU_ALARMISRINGING => MPAS_ESMF_ALARMISRINGING
- USE MPAS_ESMF_Mod, WRFU_ALARMPRINT => MPAS_ESMF_ALARMPRINT
- USE MPAS_ESMF_Mod, WRFU_ALARMRINGEROFF => MPAS_ESMF_ALARMRINGEROFF
- USE MPAS_ESMF_Mod, WRFU_ALARMRINGERON => MPAS_ESMF_ALARMRINGERON
- USE MPAS_ESMF_Mod, WRFU_ALARMSET => MPAS_ESMF_ALARMSET
- USE MPAS_ESMF_Mod, WRFU_ALARMVALIDATE => MPAS_ESMF_ALARMVALIDATE
- USE MPAS_ESMF_Mod, WRFU_ATTRIBUTE => MPAS_ESMF_ATTRIBUTE
- USE MPAS_ESMF_Mod, WRFU_ATTRIBUTECOPY => MPAS_ESMF_ATTRIBUTECOPY
- USE MPAS_ESMF_Mod, WRFU_ATTRIBUTECOPYALL => MPAS_ESMF_ATTRIBUTECOPYALL
- USE MPAS_ESMF_Mod, WRFU_ATTRIBUTEGET => MPAS_ESMF_ATTRIBUTEGET
- USE MPAS_ESMF_Mod, WRFU_ATTRIBUTEGETBYNUMBER => MPAS_ESMF_ATTRIBUTEGETBYNUMBER
- USE MPAS_ESMF_Mod, WRFU_ATTRIBUTEGETCOUNT => MPAS_ESMF_ATTRIBUTEGETCOUNT
- USE MPAS_ESMF_Mod, WRFU_ATTRIBUTEGETLIST => MPAS_ESMF_ATTRIBUTEGETLIST
- USE MPAS_ESMF_Mod, WRFU_ATTRIBUTEGETNAMELIST => MPAS_ESMF_ATTRIBUTEGETNAMELIST
- USE MPAS_ESMF_Mod, WRFU_ATTRIBUTEGETOBJECTLIST => MPAS_ESMF_ATTRIBUTEGETOBJECTLIST
- USE MPAS_ESMF_Mod, WRFU_ATTRIBUTESET => MPAS_ESMF_ATTRIBUTESET
- USE MPAS_ESMF_Mod, WRFU_ATTRIBUTESETLIST => MPAS_ESMF_ATTRIBUTESETLIST
- USE MPAS_ESMF_Mod, WRFU_ATTRIBUTESETOBJECTLIST => MPAS_ESMF_ATTRIBUTESETOBJECTLIST
- USE MPAS_ESMF_Mod, WRFU_AXISINDEX => MPAS_ESMF_AXISINDEX
- USE MPAS_ESMF_Mod, WRFU_AXISINDEXGET => MPAS_ESMF_AXISINDEXGET
- USE MPAS_ESMF_Mod, WRFU_BAD_POINTER => MPAS_ESMF_BAD_POINTER
- USE MPAS_ESMF_Mod, WRFU_BASE => MPAS_ESMF_BASE
- USE MPAS_ESMF_Mod, WRFU_BASETIME => MPAS_ESMF_BASETIME
- USE MPAS_ESMF_Mod, WRFU_CALENDAR => MPAS_ESMF_CALENDAR
- USE MPAS_ESMF_Mod, WRFU_CALENDARTYPE => MPAS_ESMF_CALENDARTYPE
- USE MPAS_ESMF_Mod, WRFU_CAL_360DAY => MPAS_ESMF_CAL_360DAY
- USE MPAS_ESMF_Mod, WRFU_CAL_GREGORIAN => MPAS_ESMF_CAL_GREGORIAN
- USE MPAS_ESMF_Mod, WRFU_CAL_NOCALENDAR => MPAS_ESMF_CAL_NOCALENDAR
- USE MPAS_ESMF_Mod, WRFU_CAL_NOLEAP => MPAS_ESMF_CAL_NOLEAP
- USE MPAS_ESMF_Mod, WRFU_CLOCK => MPAS_ESMF_CLOCK
- USE MPAS_ESMF_Mod, WRFU_CLOCKADDALARM => MPAS_ESMF_CLOCKADDALARM
- USE MPAS_ESMF_Mod, WRFU_CLOCKADVANCE => MPAS_ESMF_CLOCKADVANCE
- USE MPAS_ESMF_Mod, WRFU_CLOCKCREATE => MPAS_ESMF_CLOCKCREATE
- USE MPAS_ESMF_Mod, WRFU_CLOCKDESTROY => MPAS_ESMF_CLOCKDESTROY
- USE MPAS_ESMF_Mod, WRFU_CLOCKGET => MPAS_ESMF_CLOCKGET
- USE MPAS_ESMF_Mod, WRFU_CLOCKGETALARMLIST => MPAS_ESMF_CLOCKGETALARMLIST
- USE MPAS_ESMF_Mod, WRFU_CLOCKISSTOPTIME => MPAS_ESMF_CLOCKISSTOPTIME
- USE MPAS_ESMF_Mod, WRFU_CLOCKPRINT => MPAS_ESMF_CLOCKPRINT
- USE MPAS_ESMF_Mod, WRFU_CLOCKSET => MPAS_ESMF_CLOCKSET
- USE MPAS_ESMF_Mod, WRFU_CLOCKSTOPTIMEDISABLE => MPAS_ESMF_CLOCKSTOPTIMEDISABLE
- USE MPAS_ESMF_Mod, WRFU_CLOCKVALIDATE => MPAS_ESMF_CLOCKVALIDATE
- USE MPAS_ESMF_Mod, WRFU_DATATYPE => MPAS_ESMF_DATATYPE
- USE MPAS_ESMF_Mod, WRFU_DATATYPESTRING => MPAS_ESMF_DATATYPESTRING
- USE MPAS_ESMF_Mod, WRFU_DATAVALUE => MPAS_ESMF_DATAVALUE
- USE MPAS_ESMF_Mod, WRFU_DATA_CHARACTER => MPAS_ESMF_DATA_CHARACTER
- USE MPAS_ESMF_Mod, WRFU_DATA_INTEGER => MPAS_ESMF_DATA_INTEGER
- USE MPAS_ESMF_Mod, WRFU_DATA_LOGICAL => MPAS_ESMF_DATA_LOGICAL
- USE MPAS_ESMF_Mod, WRFU_DATA_REAL => MPAS_ESMF_DATA_REAL
- USE MPAS_ESMF_Mod, WRFU_FAILURE => MPAS_ESMF_FAILURE
- USE MPAS_ESMF_Mod, WRFU_FINALIZE => MPAS_ESMF_FINALIZE
- USE MPAS_ESMF_Mod, WRFU_FRACTION => MPAS_ESMF_FRACTION
- USE MPAS_ESMF_Mod, WRFU_GETNAME => MPAS_ESMF_GETNAME
- USE MPAS_ESMF_Mod, WRFU_GETPOINTER => MPAS_ESMF_GETPOINTER
- USE MPAS_ESMF_Mod, WRFU_GRID => MPAS_ESMF_GRID
- USE MPAS_ESMF_Mod, WRFU_GRIDCOMP => MPAS_ESMF_GRIDCOMP
- USE MPAS_ESMF_Mod, WRFU_INITIALIZE => MPAS_ESMF_INITIALIZE
- USE MPAS_ESMF_Mod, WRFU_ISINITIALIZED => MPAS_ESMF_ISINITIALIZED
- USE MPAS_ESMF_Mod, WRFU_KIND_C16 => MPAS_ESMF_KIND_C16
- USE MPAS_ESMF_Mod, WRFU_KIND_C8 => MPAS_ESMF_KIND_C8
- USE MPAS_ESMF_Mod, WRFU_KIND_I1 => MPAS_ESMF_KIND_I1
- USE MPAS_ESMF_Mod, WRFU_KIND_I2 => MPAS_ESMF_KIND_I2
- USE MPAS_ESMF_Mod, WRFU_KIND_I4 => MPAS_ESMF_KIND_I4
- USE MPAS_ESMF_Mod, WRFU_KIND_I8 => MPAS_ESMF_KIND_I8
- USE MPAS_ESMF_Mod, WRFU_KIND_R4 => MPAS_ESMF_KIND_R4
- USE MPAS_ESMF_Mod, WRFU_KIND_R8 => MPAS_ESMF_KIND_R8
- USE MPAS_ESMF_Mod, WRFU_LOG => MPAS_ESMF_LOG
- USE MPAS_ESMF_Mod, WRFU_LOGICAL => MPAS_ESMF_LOGICAL
- USE MPAS_ESMF_Mod, WRFU_LOGWRITE => MPAS_ESMF_LOGWRITE
- USE MPAS_ESMF_Mod, WRFU_LOG_ERROR => MPAS_ESMF_LOG_ERROR
- USE MPAS_ESMF_Mod, WRFU_LOG_INFO => MPAS_ESMF_LOG_INFO
- USE MPAS_ESMF_Mod, WRFU_LOG_WARNING => MPAS_ESMF_LOG_WARNING
- USE MPAS_ESMF_Mod, WRFU_MAJOR_VERSION => MPAS_ESMF_MAJOR_VERSION
- USE MPAS_ESMF_Mod, WRFU_MAXDECOMPDIM => MPAS_ESMF_MAXDECOMPDIM
- USE MPAS_ESMF_Mod, WRFU_MAXDIM => MPAS_ESMF_MAXDIM
- USE MPAS_ESMF_Mod, WRFU_MAXGRIDDIM => MPAS_ESMF_MAXGRIDDIM
- USE MPAS_ESMF_Mod, WRFU_MAXSTR => MPAS_ESMF_MAXSTR
- USE MPAS_ESMF_Mod, WRFU_MINOR_VERSION => MPAS_ESMF_MINOR_VERSION
- USE MPAS_ESMF_Mod, WRFU_MSGTYPE => MPAS_ESMF_MSGTYPE
- USE MPAS_ESMF_Mod, WRFU_NULL_POINTER => MPAS_ESMF_NULL_POINTER
- USE MPAS_ESMF_Mod, WRFU_POINTER => MPAS_ESMF_POINTER
- USE MPAS_ESMF_Mod, WRFU_REVISION => MPAS_ESMF_REVISION
- USE MPAS_ESMF_Mod, WRFU_SETNAME => MPAS_ESMF_SETNAME
- USE MPAS_ESMF_Mod, WRFU_SETNULLPOINTER => MPAS_ESMF_SETNULLPOINTER
- USE MPAS_ESMF_Mod, WRFU_SETPOINTER => MPAS_ESMF_SETPOINTER
- USE MPAS_ESMF_Mod, WRFU_STATE => MPAS_ESMF_STATE
- USE MPAS_ESMF_Mod, WRFU_STATE_INVALID => MPAS_ESMF_STATE_INVALID
- USE MPAS_ESMF_Mod, WRFU_STATUS => MPAS_ESMF_STATUS
- USE MPAS_ESMF_Mod, WRFU_STATUSSTRING => MPAS_ESMF_STATUSSTRING
- USE MPAS_ESMF_Mod, WRFU_SUCCESS => MPAS_ESMF_SUCCESS
- USE MPAS_ESMF_Mod, WRFU_TIME => MPAS_ESMF_TIME
- USE MPAS_ESMF_Mod, WRFU_TIMEEQ => MPAS_ESMF_TIMEEQ
- USE MPAS_ESMF_Mod, WRFU_TIMEGET => MPAS_ESMF_TIMEGET
- USE MPAS_ESMF_Mod, WRFU_TIMEINTERVAL => MPAS_ESMF_TIMEINTERVAL
- USE MPAS_ESMF_Mod, WRFU_TIMEINTERVALABSVALUE => MPAS_ESMF_TIMEINTERVALABSVALUE
- USE MPAS_ESMF_Mod, WRFU_TIMEINTERVALDIVQUOT => MPAS_ESMF_TIMEINTERVALDIVQUOT
- USE MPAS_ESMF_Mod, WRFU_TIMEINTERVALGET => MPAS_ESMF_TIMEINTERVALGET
- USE MPAS_ESMF_Mod, WRFU_TIMEINTERVALNEGABSVALUE => MPAS_ESMF_TIMEINTERVALNEGABSVALUE
- USE MPAS_ESMF_Mod, WRFU_TIMEINTERVALSET => MPAS_ESMF_TIMEINTERVALSET
- USE MPAS_ESMF_Mod, WRFU_TIMESET => MPAS_ESMF_TIMESET
- USE MPAS_ESMF_Mod, WRFU_VERSION_STRING => MPAS_ESMF_VERSION_STRING
- USE MPAS_ESMF_Mod, WRFU_VM => MPAS_ESMF_VM
+ USE ESMF_Mod, WRFU_ALARM => ESMF_ALARM
+ USE ESMF_Mod, WRFU_ALARMCREATE => ESMF_ALARMCREATE
+ USE ESMF_Mod, WRFU_ALARMDESTROY => ESMF_ALARMDESTROY
+ USE ESMF_Mod, WRFU_ALARMDISABLE => ESMF_ALARMDISABLE
+ USE ESMF_Mod, WRFU_ALARMENABLE => ESMF_ALARMENABLE
+ USE ESMF_Mod, WRFU_ALARMGET => ESMF_ALARMGET
+ USE ESMF_Mod, WRFU_ALARMISRINGING => ESMF_ALARMISRINGING
+ USE ESMF_Mod, WRFU_ALARMPRINT => ESMF_ALARMPRINT
+ USE ESMF_Mod, WRFU_ALARMRINGEROFF => ESMF_ALARMRINGEROFF
+ USE ESMF_Mod, WRFU_ALARMRINGERON => ESMF_ALARMRINGERON
+ USE ESMF_Mod, WRFU_ALARMSET => ESMF_ALARMSET
+ USE ESMF_Mod, WRFU_ALARMVALIDATE => ESMF_ALARMVALIDATE
+ USE ESMF_Mod, WRFU_ATTRIBUTE => ESMF_ATTRIBUTE
+ USE ESMF_Mod, WRFU_ATTRIBUTECOPY => ESMF_ATTRIBUTECOPY
+ USE ESMF_Mod, WRFU_ATTRIBUTECOPYALL => ESMF_ATTRIBUTECOPYALL
+ USE ESMF_Mod, WRFU_ATTRIBUTEGET => ESMF_ATTRIBUTEGET
+ USE ESMF_Mod, WRFU_ATTRIBUTEGETBYNUMBER => ESMF_ATTRIBUTEGETBYNUMBER
+ USE ESMF_Mod, WRFU_ATTRIBUTEGETCOUNT => ESMF_ATTRIBUTEGETCOUNT
+ USE ESMF_Mod, WRFU_ATTRIBUTEGETLIST => ESMF_ATTRIBUTEGETLIST
+ USE ESMF_Mod, WRFU_ATTRIBUTEGETNAMELIST => ESMF_ATTRIBUTEGETNAMELIST
+ USE ESMF_Mod, WRFU_ATTRIBUTEGETOBJECTLIST => ESMF_ATTRIBUTEGETOBJECTLIST
+ USE ESMF_Mod, WRFU_ATTRIBUTESET => ESMF_ATTRIBUTESET
+ USE ESMF_Mod, WRFU_ATTRIBUTESETLIST => ESMF_ATTRIBUTESETLIST
+ USE ESMF_Mod, WRFU_ATTRIBUTESETOBJECTLIST => ESMF_ATTRIBUTESETOBJECTLIST
+ USE ESMF_Mod, WRFU_AXISINDEX => ESMF_AXISINDEX
+ USE ESMF_Mod, WRFU_AXISINDEXGET => ESMF_AXISINDEXGET
+ USE ESMF_Mod, WRFU_BAD_POINTER => ESMF_BAD_POINTER
+ USE ESMF_Mod, WRFU_BASE => ESMF_BASE
+ USE ESMF_Mod, WRFU_BASETIME => ESMF_BASETIME
+ USE ESMF_Mod, WRFU_CALENDAR => ESMF_CALENDAR
+ USE ESMF_Mod, WRFU_CALENDARTYPE => ESMF_CALENDARTYPE
+ USE ESMF_Mod, WRFU_CAL_360DAY => ESMF_CAL_360DAY
+ USE ESMF_Mod, WRFU_CAL_GREGORIAN => ESMF_CAL_GREGORIAN
+ USE ESMF_Mod, WRFU_CAL_NOCALENDAR => ESMF_CAL_NOCALENDAR
+ USE ESMF_Mod, WRFU_CAL_NOLEAP => ESMF_CAL_NOLEAP
+ USE ESMF_Mod, WRFU_CLOCK => ESMF_CLOCK
+ USE ESMF_Mod, WRFU_CLOCKADDALARM => ESMF_CLOCKADDALARM
+ USE ESMF_Mod, WRFU_CLOCKADVANCE => ESMF_CLOCKADVANCE
+ USE ESMF_Mod, WRFU_CLOCKCREATE => ESMF_CLOCKCREATE
+ USE ESMF_Mod, WRFU_CLOCKDESTROY => ESMF_CLOCKDESTROY
+ USE ESMF_Mod, WRFU_CLOCKGET => ESMF_CLOCKGET
+ USE ESMF_Mod, WRFU_CLOCKGETALARMLIST => ESMF_CLOCKGETALARMLIST
+ USE ESMF_Mod, WRFU_CLOCKISSTOPTIME => ESMF_CLOCKISSTOPTIME
+ USE ESMF_Mod, WRFU_CLOCKPRINT => ESMF_CLOCKPRINT
+ USE ESMF_Mod, WRFU_CLOCKSET => ESMF_CLOCKSET
+ USE ESMF_Mod, WRFU_CLOCKSTOPTIMEDISABLE => ESMF_CLOCKSTOPTIMEDISABLE
+ USE ESMF_Mod, WRFU_CLOCKVALIDATE => ESMF_CLOCKVALIDATE
+ USE ESMF_Mod, WRFU_DATATYPE => ESMF_DATATYPE
+ USE ESMF_Mod, WRFU_DATATYPESTRING => ESMF_DATATYPESTRING
+ USE ESMF_Mod, WRFU_DATAVALUE => ESMF_DATAVALUE
+ USE ESMF_Mod, WRFU_DATA_CHARACTER => ESMF_DATA_CHARACTER
+ USE ESMF_Mod, WRFU_DATA_INTEGER => ESMF_DATA_INTEGER
+ USE ESMF_Mod, WRFU_DATA_LOGICAL => ESMF_DATA_LOGICAL
+ USE ESMF_Mod, WRFU_DATA_REAL => ESMF_DATA_REAL
+ USE ESMF_Mod, WRFU_FAILURE => ESMF_FAILURE
+ USE ESMF_Mod, WRFU_FINALIZE => ESMF_FINALIZE
+ USE ESMF_Mod, WRFU_FRACTION => ESMF_FRACTION
+ USE ESMF_Mod, WRFU_GETNAME => ESMF_GETNAME
+ USE ESMF_Mod, WRFU_GETPOINTER => ESMF_GETPOINTER
+ USE ESMF_Mod, WRFU_GRID => ESMF_GRID
+ USE ESMF_Mod, WRFU_GRIDCOMP => ESMF_GRIDCOMP
+ USE ESMF_Mod, WRFU_INITIALIZE => ESMF_INITIALIZE
+ USE ESMF_Mod, WRFU_ISINITIALIZED => ESMF_ISINITIALIZED
+ USE ESMF_Mod, WRFU_KIND_C16 => ESMF_KIND_C16
+ USE ESMF_Mod, WRFU_KIND_C8 => ESMF_KIND_C8
+ USE ESMF_Mod, WRFU_KIND_I1 => ESMF_KIND_I1
+ USE ESMF_Mod, WRFU_KIND_I2 => ESMF_KIND_I2
+ USE ESMF_Mod, WRFU_KIND_I4 => ESMF_KIND_I4
+ USE ESMF_Mod, WRFU_KIND_I8 => ESMF_KIND_I8
+ USE ESMF_Mod, WRFU_KIND_R4 => ESMF_KIND_R4
+ USE ESMF_Mod, WRFU_KIND_R8 => ESMF_KIND_R8
+ USE ESMF_Mod, WRFU_LOG => ESMF_LOG
+ USE ESMF_Mod, WRFU_LOGICAL => ESMF_LOGICAL
+ USE ESMF_Mod, WRFU_LOGWRITE => ESMF_LOGWRITE
+ USE ESMF_Mod, WRFU_LOG_ERROR => ESMF_LOG_ERROR
+ USE ESMF_Mod, WRFU_LOG_INFO => ESMF_LOG_INFO
+ USE ESMF_Mod, WRFU_LOG_WARNING => ESMF_LOG_WARNING
+ USE ESMF_Mod, WRFU_MAJOR_VERSION => ESMF_MAJOR_VERSION
+ USE ESMF_Mod, WRFU_MAXDECOMPDIM => ESMF_MAXDECOMPDIM
+ USE ESMF_Mod, WRFU_MAXDIM => ESMF_MAXDIM
+ USE ESMF_Mod, WRFU_MAXGRIDDIM => ESMF_MAXGRIDDIM
+ USE ESMF_Mod, WRFU_MAXSTR => ESMF_MAXSTR
+ USE ESMF_Mod, WRFU_MINOR_VERSION => ESMF_MINOR_VERSION
+ USE ESMF_Mod, WRFU_MSGTYPE => ESMF_MSGTYPE
+ USE ESMF_Mod, WRFU_NULL_POINTER => ESMF_NULL_POINTER
+ USE ESMF_Mod, WRFU_POINTER => ESMF_POINTER
+ USE ESMF_Mod, WRFU_REVISION => ESMF_REVISION
+ USE ESMF_Mod, WRFU_SETNAME => ESMF_SETNAME
+ USE ESMF_Mod, WRFU_SETNULLPOINTER => ESMF_SETNULLPOINTER
+ USE ESMF_Mod, WRFU_SETPOINTER => ESMF_SETPOINTER
+ USE ESMF_Mod, WRFU_STATE => ESMF_STATE
+ USE ESMF_Mod, WRFU_STATE_INVALID => ESMF_STATE_INVALID
+ USE ESMF_Mod, WRFU_STATUS => ESMF_STATUS
+ USE ESMF_Mod, WRFU_STATUSSTRING => ESMF_STATUSSTRING
+ USE ESMF_Mod, WRFU_SUCCESS => ESMF_SUCCESS
+ USE ESMF_Mod, WRFU_TIME => ESMF_TIME
+ USE ESMF_Mod, WRFU_TIMEEQ => ESMF_TIMEEQ
+ USE ESMF_Mod, WRFU_TIMEGET => ESMF_TIMEGET
+ USE ESMF_Mod, WRFU_TIMEINTERVAL => ESMF_TIMEINTERVAL
+ USE ESMF_Mod, WRFU_TIMEINTERVALABSVALUE => ESMF_TIMEINTERVALABSVALUE
+ USE ESMF_Mod, WRFU_TIMEINTERVALDIVQUOT => ESMF_TIMEINTERVALDIVQUOT
+ USE ESMF_Mod, WRFU_TIMEINTERVALGET => ESMF_TIMEINTERVALGET
+ USE ESMF_Mod, WRFU_TIMEINTERVALNEGABSVALUE => ESMF_TIMEINTERVALNEGABSVALUE
+ USE ESMF_Mod, WRFU_TIMEINTERVALSET => ESMF_TIMEINTERVALSET
+ USE ESMF_Mod, WRFU_TIMESET => ESMF_TIMESET
+ USE ESMF_Mod, WRFU_VERSION_STRING => ESMF_VERSION_STRING
+ USE ESMF_Mod, WRFU_VM => ESMF_VM
END MODULE module_symbols_util
Modified: branches/ocean_projects/cesm_coupling/src/framework/mpas_timekeeping.F
===================================================================
--- branches/ocean_projects/cesm_coupling/src/framework/mpas_timekeeping.F        2012-11-29 20:50:09 UTC (rev 2328)
+++ branches/ocean_projects/cesm_coupling/src/framework/mpas_timekeeping.F        2012-11-29 22:23:06 UTC (rev 2329)
@@ -1,12 +1,12 @@
module mpas_timekeeping
use mpas_kind_types
- use MPAS_ESMF_BaseMod
- use MPAS_ESMF_Stubs
- use MPAS_ESMF_CalendarMod
- use MPAS_ESMF_ClockMod
- use MPAS_ESMF_TimeMod
- use MPAS_ESMF_TimeIntervalMod
+ use ESMF_BaseMod
+ use ESMF_Stubs
+ use ESMF_CalendarMod
+ use ESMF_ClockMod
+ use ESMF_TimeMod
+ use ESMF_TimeIntervalMod
private :: mpas_calibrate_alarms
private :: mpas_in_ringing_envelope
@@ -28,11 +28,11 @@
type MPAS_Time_type
- type (MPAS_ESMF_Time) :: t
+ type (ESMF_Time) :: t
end type
type MPAS_TimeInterval_type
- type (MPAS_ESMF_TimeInterval) :: ti
+ type (ESMF_TimeInterval) :: ti
end type
type MPAS_Alarm_type
@@ -48,7 +48,7 @@
type MPAS_Clock_type
integer :: direction
integer :: nAlarms
- type (MPAS_ESMF_Clock) :: c
+ type (ESMF_Clock) :: c
type (MPAS_Alarm_type), pointer :: alarmListHead
end type
@@ -116,18 +116,30 @@
character (len=*), intent(in) :: calendar
+#ifdef MPAS_CESM
if (trim(calendar) == 'gregorian') then
TheCalendar = MPAS_GREGORIAN
- call MPAS_ESMF_Initialize(defaultCalendar=MPAS_ESMF_CAL_GREGORIAN)
+ call ESMF_Initialize(defaultCalendar=ESMF_CALKIND_GREGORIAN)
else if (trim(calendar) == 'gregorian_noleap') then
TheCalendar = MPAS_GREGORIAN_NOLEAP
- call MPAS_ESMF_Initialize(defaultCalendar=MPAS_ESMF_CAL_NOLEAP)
+ call ESMF_Initialize(defaultCalendar=ESMF_CALKIND_NOLEAP)
+ else
+ write(0,*) 'ERROR: mpas_timekeeping_init: Invalid calendar type'
+ end if
+#else
+ if (trim(calendar) == 'gregorian') then
+ TheCalendar = MPAS_GREGORIAN
+ call ESMF_Initialize(defaultCalendar=ESMF_CAL_GREGORIAN)
+ else if (trim(calendar) == 'gregorian_noleap') then
+ TheCalendar = MPAS_GREGORIAN_NOLEAP
+ call ESMF_Initialize(defaultCalendar=ESMF_CAL_NOLEAP)
else if (trim(calendar) == '360day') then
TheCalendar = MPAS_360DAY
- call MPAS_ESMF_Initialize(defaultCalendar=MPAS_ESMF_CAL_360DAY)
+ call ESMF_Initialize(defaultCalendar=ESMF_CAL_360DAY)
else
write(0,*) 'ERROR: mpas_timekeeping_init: Invalid calendar type'
end if
+#endif
end subroutine mpas_timekeeping_init
@@ -136,7 +148,9 @@
implicit none
- call MPAS_ESMF_Finalize()
+#ifndef MPAS_CESM
+ call ESMF_Finalize()
+#endif
end subroutine mpas_timekeeping_finalize
@@ -171,9 +185,9 @@
return
end if
- clock % c = MPAS_ESMF_ClockCreate(TimeStep=timeStep%ti, StartTime=startTime%t, StopTime=stop_time%t, rc=ierr)
+ clock % c = ESMF_ClockCreate(TimeStep=timeStep%ti, StartTime=startTime%t, StopTime=stop_time%t, rc=ierr)
if (present(ierr)) then
- if (ierr == MPAS_ESMF_SUCCESS) ierr = 0
+ if (ierr == ESMF_SUCCESS) ierr = 0
end if
clock % direction = MPAS_FORWARD
clock % nAlarms = 0
@@ -198,9 +212,9 @@
alarmPtr => clock % alarmListHead
end do
- call MPAS_ESMF_ClockDestroy(clock % c, rc=ierr)
+ call ESMF_ClockDestroy(clock % c, rc=ierr)
if (present(ierr)) then
- if (ierr == MPAS_ESMF_SUCCESS) ierr = 0
+ if (ierr == ESMF_SUCCESS) ierr = 0
end if
end subroutine mpas_destroy_clock
@@ -213,13 +227,13 @@
type (MPAS_Clock_type), intent(in) :: clock
integer, intent(out), optional :: ierr
- type (MPAS_ESMF_Time) :: currTime, startTime, stopTime
+ type (ESMF_Time) :: currTime, startTime, stopTime
- call MPAS_ESMF_ClockGet(clock % c, CurrTime=currTime, rc=ierr)
- call MPAS_ESMF_ClockGet(clock % c, StartTime=startTime, rc=ierr)
- call MPAS_ESMF_ClockGet(clock % c, StopTime=stopTime, rc=ierr)
+ call ESMF_ClockGet(clock % c, CurrTime=currTime, rc=ierr)
+ call ESMF_ClockGet(clock % c, StartTime=startTime, rc=ierr)
+ call ESMF_ClockGet(clock % c, StopTime=stopTime, rc=ierr)
if (present(ierr)) then
- if (ierr == MPAS_ESMF_SUCCESS) ierr = 0
+ if (ierr == ESMF_SUCCESS) ierr = 0
end if
if (startTime <= stopTime) then
@@ -238,13 +252,13 @@
type (MPAS_Clock_type), intent(in) :: clock
integer, intent(out), optional :: ierr
- type (MPAS_ESMF_Time) :: currTime, startTime, stopTime
+ type (ESMF_Time) :: currTime, startTime, stopTime
- call MPAS_ESMF_ClockGet(clock % c, CurrTime=currTime, rc=ierr)
- call MPAS_ESMF_ClockGet(clock % c, StartTime=startTime, rc=ierr)
- call MPAS_ESMF_ClockGet(clock % c, StopTime=stopTime, rc=ierr)
+ call ESMF_ClockGet(clock % c, CurrTime=currTime, rc=ierr)
+ call ESMF_ClockGet(clock % c, StartTime=startTime, rc=ierr)
+ call ESMF_ClockGet(clock % c, StopTime=stopTime, rc=ierr)
if (present(ierr)) then
- if (ierr == MPAS_ESMF_SUCCESS) ierr = 0
+ if (ierr == ESMF_SUCCESS) ierr = 0
end if
if (startTime <= stopTime) then
@@ -270,15 +284,15 @@
if (direction == MPAS_BACKWARD .and. clock % direction == MPAS_BACKWARD) return
clock % direction = direction
- call MPAS_ESMF_ClockGet(clock % c, TimeStep=timeStep%ti, rc=ierr)
+ call ESMF_ClockGet(clock % c, TimeStep=timeStep%ti, rc=ierr)
timeStep = neg_ti(timeStep)
- call MPAS_ESMF_ClockSet(clock % c, TimeStep=timeStep%ti, rc=ierr)
+ call ESMF_ClockSet(clock % c, TimeStep=timeStep%ti, rc=ierr)
! specify a valid previousRingTime for each alarm
call mpas_calibrate_alarms(clock, ierr);
if (present(ierr)) then
- if (ierr == MPAS_ESMF_SUCCESS) ierr = 0
+ if (ierr == ESMF_SUCCESS) ierr = 0
end if
end subroutine mpas_set_clock_direction
@@ -307,9 +321,9 @@
type (MPAS_TimeInterval_type), intent(in) :: timeStep
integer, intent(out), optional :: ierr
- call MPAS_ESMF_ClockSet(clock % c, TimeStep=timeStep%ti, rc=ierr)
+ call ESMF_ClockSet(clock % c, TimeStep=timeStep%ti, rc=ierr)
if (present(ierr)) then
- if (ierr == MPAS_ESMF_SUCCESS) ierr = 0
+ if (ierr == ESMF_SUCCESS) ierr = 0
end if
end subroutine mpas_set_clock_timestep
@@ -324,9 +338,9 @@
type (MPAS_TimeInterval_type) :: timeStep
- call MPAS_ESMF_ClockGet(clock % c, TimeStep=timeStep%ti, rc=ierr)
+ call ESMF_ClockGet(clock % c, TimeStep=timeStep%ti, rc=ierr)
if (present(ierr)) then
- if (ierr == MPAS_ESMF_SUCCESS) ierr = 0
+ if (ierr == ESMF_SUCCESS) ierr = 0
end if
mpas_get_clock_timestep = timeStep
@@ -342,18 +356,18 @@
type (MPAS_TimeInterval_type), intent(in), optional :: timeStep
integer, intent(out), optional :: ierr
- type (MPAS_ESMF_TimeInterval) :: time_step
+ type (ESMF_TimeInterval) :: time_step
if (present(timeStep)) then
- call MPAS_ESMF_ClockGet(clock % c, TimeStep=time_step, rc=ierr)
- call MPAS_ESMF_ClockSet(clock % c, TimeStep=timeStep % ti, rc=ierr)
- call MPAS_ESMF_ClockAdvance(clock % c, rc=ierr)
- call MPAS_ESMF_ClockSet(clock % c, TimeStep=time_step, rc=ierr)
+ call ESMF_ClockGet(clock % c, TimeStep=time_step, rc=ierr)
+ call ESMF_ClockSet(clock % c, TimeStep=timeStep % ti, rc=ierr)
+ call ESMF_ClockAdvance(clock % c, rc=ierr)
+ call ESMF_ClockSet(clock % c, TimeStep=time_step, rc=ierr)
else
- call MPAS_ESMF_ClockAdvance(clock % c, rc=ierr)
+ call ESMF_ClockAdvance(clock % c, rc=ierr)
end if
if (present(ierr)) then
- if (ierr == MPAS_ESMF_SUCCESS) ierr = 0
+ if (ierr == ESMF_SUCCESS) ierr = 0
end if
end subroutine mpas_advance_clock
@@ -369,17 +383,17 @@
integer, intent(out), optional :: ierr
if (whichTime == MPAS_NOW) then
- call MPAS_ESMF_ClockSet(clock % c, CurrTime=clock_time%t, rc=ierr)
+ call ESMF_ClockSet(clock % c, CurrTime=clock_time%t, rc=ierr)
call mpas_calibrate_alarms(clock, ierr);
else if (whichTime == MPAS_START_TIME) then
- call MPAS_ESMF_ClockSet(clock % c, StartTime=clock_time%t, rc=ierr)
+ call ESMF_ClockSet(clock % c, StartTime=clock_time%t, rc=ierr)
else if (whichTime == MPAS_STOP_TIME) then
- call MPAS_ESMF_ClockSet(clock % c, StopTime=clock_time%t, rc=ierr)
+ call ESMF_ClockSet(clock % c, StopTime=clock_time%t, rc=ierr)
else if (present(ierr)) then
ierr = 1
end if
if (present(ierr)) then
- if (ierr == MPAS_ESMF_SUCCESS) ierr = 0
+ if (ierr == ESMF_SUCCESS) ierr = 0
end if
end subroutine mpas_set_clock_time
@@ -396,16 +410,16 @@
type (MPAS_Time_type) :: clock_time
if (whichTime == MPAS_NOW) then
- call MPAS_ESMF_ClockGet(clock % c, CurrTime=clock_time%t, rc=ierr)
+ call ESMF_ClockGet(clock % c, CurrTime=clock_time%t, rc=ierr)
else if (whichTime == MPAS_START_TIME) then
- call MPAS_ESMF_ClockGet(clock % c, StartTime=clock_time%t, rc=ierr)
+ call ESMF_ClockGet(clock % c, StartTime=clock_time%t, rc=ierr)
else if (whichTime == MPAS_STOP_TIME) then
- call MPAS_ESMF_ClockGet(clock % c, StopTime=clock_time%t, rc=ierr)
+ call ESMF_ClockGet(clock % c, StopTime=clock_time%t, rc=ierr)
else if (present(ierr)) then
ierr = 1
end if
if (present(ierr)) then
- if (ierr == MPAS_ESMF_SUCCESS) ierr = 0
+ if (ierr == ESMF_SUCCESS) ierr = 0
end if
mpas_get_clock_time = clock_time
@@ -472,7 +486,7 @@
alarmPtr % prevRingTime = alarmTime
end if
if (present(ierr)) then
- if (ierr == MPAS_ESMF_SUCCESS) ierr = 0
+ if (ierr == ESMF_SUCCESS) ierr = 0
end if
end subroutine mpas_add_clock_alarm
@@ -782,7 +796,7 @@
end do
if (present(ierr)) then
- if (ierr == MPAS_ESMF_SUCCESS) ierr = 0
+ if (ierr == ESMF_SUCCESS) ierr = 0
end if
end subroutine mpas_calibrate_alarms
@@ -890,7 +904,7 @@
return
end if
- call MPAS_ESMF_TimeSet(curr_time % t, YY=year, MM=month, DD=day, H=hour, M=min, S=sec, Sn=numerator, Sd=denominator, rc=ierr)
+ call ESMF_TimeSet(curr_time % t, YY=year, MM=month, DD=day, H=hour, M=min, S=sec, Sn=numerator, Sd=denominator, rc=ierr)
else
@@ -933,12 +947,12 @@
return
end if
- call MPAS_ESMF_TimeSet(curr_time % t, YY=YYYY, MM=month, DD=day, H=H, M=M, S=S, Sn=S_n, Sd=S_d, rc=ierr)
+ call ESMF_TimeSet(curr_time % t, YY=YYYY, MM=month, DD=day, H=H, M=M, S=S, Sn=S_n, Sd=S_d, rc=ierr)
end if
if (present(ierr)) then
- if (ierr == MPAS_ESMF_SUCCESS) ierr = 0
+ if (ierr == ESMF_SUCCESS) ierr = 0
end if
end subroutine mpas_set_time
@@ -961,11 +975,11 @@
character (len=StrKIND), intent(out), optional :: dateTimeString
integer, intent(out), optional :: ierr
- call MPAS_ESMF_TimeGet(curr_time % t, YY=YYYY, MM=MM, DD=DD, H=H, M=M, S=S, Sn=S_n, Sd=S_d, rc=ierr)
- call MPAS_ESMF_TimeGet(curr_time % t, dayOfYear=DoY, rc=ierr)
- call MPAS_ESMF_TimeGet(curr_time % t, timeString=dateTimeString, rc=ierr)
+ call ESMF_TimeGet(curr_time % t, YY=YYYY, MM=MM, DD=DD, H=H, M=M, S=S, Sn=S_n, Sd=S_d, rc=ierr)
+ call ESMF_TimeGet(curr_time % t, dayOfYear=DoY, rc=ierr)
+ call ESMF_TimeGet(curr_time % t, timeString=dateTimeString, rc=ierr)
if (present(ierr)) then
- if (ierr == MPAS_ESMF_SUCCESS) ierr = 0
+ if (ierr == ESMF_SUCCESS) ierr = 0
end if
end subroutine mpas_get_time
@@ -1060,7 +1074,7 @@
!
! seconds = seconds + hours*3600 + minutes*60
-! call MPAS_ESMF_TimeIntervalSet(interval % ti, D=days, S=seconds, Sn=S_n, Sd=S_d, rc=ierr)
+! call ESMF_TimeIntervalSet(interval % ti, D=days, S=seconds, Sn=S_n, Sd=S_d, rc=ierr)
if (present(timeString) .or. present(dt)) then
@@ -1128,19 +1142,19 @@
return
end if
- call MPAS_ESMF_TimeIntervalSet(interval % ti, D=day, H=hour, M=min, S=sec, Sn=numerator, Sd=denominator, rc=ierr)
+ call ESMF_TimeIntervalSet(interval % ti, D=day, H=hour, M=min, S=sec, Sn=numerator, Sd=denominator, rc=ierr)
else
- call MPAS_ESMF_TimeIntervalSet(interval % ti, D=DD, H=H, M=M, S=S, Sn=S_n, Sd=S_d, rc=ierr)
+ call ESMF_TimeIntervalSet(interval % ti, D=DD, H=H, M=M, S=S, Sn=S_n, Sd=S_d, rc=ierr)
end if
! verify that time interval is positive
- call MPAS_ESMF_TimeIntervalSet(zeroInterval % ti, D=0, H=0, M=0, S=0, rc=ierr)
+ call ESMF_TimeIntervalSet(zeroInterval % ti, D=0, H=0, M=0, S=0, rc=ierr)
if (present(ierr)) then
- if (ierr == MPAS_ESMF_SUCCESS) ierr = 0
+ if (ierr == ESMF_SUCCESS) ierr = 0
end if
if (interval <= zeroInterval) then
@@ -1171,7 +1185,7 @@
integer :: days, seconds, sn, sd
- call MPAS_ESMF_TimeIntervalGet(interval % ti, D=days, S=seconds, Sn=sn, Sd=sd, rc=ierr)
+ call ESMF_TimeIntervalGet(interval % ti, D=days, S=seconds, Sn=sn, Sd=sd, rc=ierr)
if (present(dt)) then
dt = (days * 24 * 60 * 60) + seconds + (sn / sd)
@@ -1209,11 +1223,11 @@
end if
if (present(timeString)) then
- call MPAS_ESMF_TimeIntervalGet(interval % ti, timeString=timeString, rc=ierr)
+ call ESMF_TimeIntervalGet(interval % ti, timeString=timeString, rc=ierr)
end if
if (present(ierr)) then
- if (ierr == MPAS_ESMF_SUCCESS) ierr = 0
+ if (ierr == ESMF_SUCCESS) ierr = 0
end if
end subroutine mpas_get_timeInterval
@@ -1441,11 +1455,11 @@
integer :: rc
integer :: D, S, Sn, Sd
- call MPAS_ESMF_TimeIntervalGet(ti % ti, D=D, S=S, Sn=Sn, Sd=Sd, rc=rc)
+ call ESMF_TimeIntervalGet(ti % ti, D=D, S=S, Sn=Sn, Sd=Sd, rc=rc)
D = -D
S = -S
Sn = -Sn
- call MPAS_ESMF_TimeIntervalSet(neg_ti % ti, D=D, S=S, Sn=Sn, Sd=Sd, rc=rc)
+ call ESMF_TimeIntervalSet(neg_ti % ti, D=D, S=S, Sn=Sn, Sd=Sd, rc=rc)
end function neg_ti
@@ -1460,14 +1474,14 @@
integer :: rc
integer :: D, S, Sn, Sd
- call MPAS_ESMF_TimeIntervalSet(zeroInterval % ti, D=0, H=0, M=0, S=0, rc=rc)
+ call ESMF_TimeIntervalSet(zeroInterval % ti, D=0, H=0, M=0, S=0, rc=rc)
if(ti < zeroInterval) then
- call MPAS_ESMF_TimeIntervalGet(ti % ti, D=D, S=S, Sn=Sn, Sd=Sd, rc=rc)
+ call ESMF_TimeIntervalGet(ti % ti, D=D, S=S, Sn=Sn, Sd=Sd, rc=rc)
D = -D
S = -S
Sn = -Sn
- call MPAS_ESMF_TimeIntervalSet(abs_ti % ti, D=D, S=S, Sn=Sn, Sd=Sd, rc=rc)
+ call ESMF_TimeIntervalSet(abs_ti % ti, D=D, S=S, Sn=Sn, Sd=Sd, rc=rc)
else
abs_ti = ti
end if
Modified: branches/ocean_projects/cesm_coupling/src/ocean_cesm_driver/ocn_comp_mct.F
===================================================================
--- branches/ocean_projects/cesm_coupling/src/ocean_cesm_driver/ocn_comp_mct.F        2012-11-29 20:50:09 UTC (rev 2328)
+++ branches/ocean_projects/cesm_coupling/src/ocean_cesm_driver/ocn_comp_mct.F        2012-11-29 22:23:06 UTC (rev 2329)
@@ -707,8 +707,11 @@
call mpas_output_state_finalize(output_obj, domain % dminfo)
call mpas_timer_stop("total time")
call mpas_timer_write()
+        write(0,*) 'core finalize'
call mpas_core_finalize(domain)
+        write(0,*) 'framework finalize'
call mpas_framework_finalize(dminfo, domain, io_system)
+        write(0,*) 'done in final mct'
end subroutine ocn_final_mct!}}}
</font>
</pre>