DiffDate Function

public function DiffDate(yyyymmhh_1, hhmmss_1, yyyymmhh_2, hhmmss_2)

DiffDate — Calculates the number of seconds between two times.

This function returns the number of seconds between two times. Each time is specified with two integers, one representing a date in the format YYYYMMDD and one representing a time in the format HHMMSS. This function determines the Julian day of each date using the “julday” function from the book “Numerical Recipes in FORTRAN, the art of scientific computing (2nd Ed.), by William H. Press, Saul A. Teukolsky, William T. Vetterling, and Brian P. Flannery (Cambridge University Press, 1992). The difference between the two times is then calculated and returned. The times need not be in chronological order as the function returns the abs value. -1 is returned in the event of an error.

RETURNED VALUE:

Integer function returns number of seconds between the the times given as input. -1 is returned in the event of an error.

History

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

! DiffDate = iabs (julsec2 - julsec1)

Arguments

Type IntentOptional Attributes Name
integer :: yyyymmhh_1
integer :: hhmmss_1
integer :: yyyymmhh_2
integer :: hhmmss_2

Return Value integer(kind=int64)


Calls

proc~~diffdate~~CallsGraph proc~diffdate DiffDate proc~cfio_parseinttime CFIO_parseIntTime proc~diffdate->proc~cfio_parseinttime proc~julday julday proc~diffdate->proc~julday

Called by

proc~~diffdate~~CalledByGraph proc~diffdate DiffDate proc~cfio_getvar CFIO_GetVar proc~cfio_getvar->proc~diffdate proc~cfio_putvar CFIO_PutVar proc~cfio_putvar->proc~diffdate proc~cfio_sgetvar CFIO_SGetVar proc~cfio_sgetvar->proc~diffdate proc~cfio_sputvar CFIO_SPutVar proc~cfio_sputvar->proc~diffdate