GetDateInt4 Subroutine

public subroutine GetDateInt4(yyyymmdd_1, hhmmss_1, offset, yyyymmdd_2, hhmmss_2, rc)

GetDateInt4 — Returns a new date/time from an initial date/time and offset

This subroutine returns a new date and time in yyyymmdd and hhmmss format given and initial date, time, and offset in seconds. The routine converts the input date and time to julian seconds, adds the offset, and converts back to yyyymmdd and hhmmss format. This routine has been tested for Y2K compiance.

History

  • 1998.07.20 Lucchesi Initial version.
  • 2010.05.11 Lucchesi Integer for julian seconds changed to 64-bit. StartDate constant no longer needed.

Arguments

Type IntentOptional Attributes Name
integer :: yyyymmdd_1

Initial date in YYYYYMMDD format

integer :: hhmmss_1

Initial time in HHMMSS format

integer :: offset

Offset to add (in seconds)

integer :: yyyymmdd_2

New date in YYYYMMDD format

integer :: hhmmss_2

New time in HHMMSS format

integer :: rc

Return code. (<0 = error)


Calls

proc~~getdateint4~~CallsGraph proc~getdateint4 GetDateInt4 proc~getdateint8 GetDateInt8 proc~getdateint4->proc~getdateint8 proc~caldat CALDAT proc~getdateint8->proc~caldat proc~cfio_parseinttime CFIO_parseIntTime proc~getdateint8->proc~cfio_parseinttime proc~julday julday proc~getdateint8->proc~julday

Called by

proc~~getdateint4~~CalledByGraph proc~getdateint4 GetDateInt4 interface~getdate GetDate interface~getdate->proc~getdateint4 proc~getbegdatetime GetBegDateTime proc~getbegdatetime->interface~getdate proc~getdatetimevec GetDateTimeVec proc~getdatetimevec->interface~getdate proc~cfio_getvar CFIO_GetVar proc~cfio_getvar->proc~getdatetimevec proc~cfio_sgetvar CFIO_SGetVar proc~cfio_sgetvar->proc~getdatetimevec proc~esmf_cfiosdffileopen ESMF_CFIOSdfFileOpen proc~esmf_cfiosdffileopen->proc~getbegdatetime proc~esmf_cfiofileopen ESMF_CFIOFileOpen proc~esmf_cfiofileopen->proc~esmf_cfiosdffileopen

Source Code

       subroutine GetDateInt4 (yyyymmdd_1,hhmmss_1,offset, &
                          yyyymmdd_2,hhmmss_2,rc)

       implicit none
!
! !INPUT PARAMETERS:
!
       integer yyyymmdd_1               !! Initial date in YYYYYMMDD format
       integer hhmmss_1                 !! Initial time in HHMMSS format
       integer offset                   !! Offset to add (in seconds)
!
! !OUTPUT PARAMETERS:
!
       integer yyyymmdd_2               !! New date in YYYYMMDD format
       integer hhmmss_2                 !! New time in HHMMSS format
       integer rc                       !! Return code. (<0 = error)
!
!-------------------------------------------------------------------------

       integer(Kind=INT64) offsetLong

       offsetLong = INT(offset,Kind=INT64)
       call GetDateInt8(yyyymmdd_1,hhmmss_1,offsetLong,yyyymmdd_2,hhmmss_2,rc)
       return

      end subroutine GetDateInt4