Inctime

Inctime is the main program.

Program

program inctime

Main program

Package Overview
Inctime is a set of routines in fortran 90 to perform calculations with dates; The main function is to calculate dates to past or to future from any date. Other operations can be performed by using the modules available in this routine. Among other duties, they are calculating the Julian day, number of years, months, days and hours between any two dates.
Autor
João Gerd Zell de Mattos
Affiliation
Group on Data Assimilation Development - CPTEC/INPE
Date
March 22, 2011
Usage

The way to use this program is through the command line as follows:

inctime [yyyymmddhh, yyyymmdd] [<+,->nynmndnhnnns] [Form. output]

where

  • [yyyymmddhh, yyyymmdd]
    • Initial Time
  • [<+,->nynmndnhnnns]
    • ( -) calculate the passed date
    • ( +) calculate the future date (default)
    • (ny) Number of year (default is 0)
    • (nm) Number of months (default is 0)
    • (nd) Number of days (default is 0)
    • (nh) Number of hours (default is 0)
    • (nn) Number of minutes (default is 0)
    • (ns) Number of seconds (default is 0)
  • [ Form. Output ]
    • Format to output date. is a template Format The format descriptors are similar to those used in the GrADS.
    • “%y4” substitute with a 4 digit year
    • “%y2” a 2 digit year
    • “%m1” a 1 or 2 digit month
    • “%m2” a 2 digit month
    • “%mc” a 3 letter month in lower cases
    • “%Mc” a 3 letter month with a leading letter in upper case
    • “%MC” a 3 letter month in upper cases
    • “%d1” a 1 or 2 digit day
    • “%d2” a 2 digit day
    • “%h1” a 1 or 2 digit hour
    • “%h2” a 2 digit hour
    • “%h3” a 3 digit hour (?)
    • “%n2” a 2 digit minute
    • “%e” a string ensemble identify
    • “%jd” a julian day without hours decimals
    • “%jdh” a julian day with hour decimals
    • “%jy” a day of current year without hours decimals
    • “%jyh” a day of current year with hours decimals

Can use words to compose the output format.

Examples
  • inctime 2001091000 +1d %d2/%m2/%y4
  • inctime 2001091000 +48h30n %h2Z%d2%MC%y4
  • inctime 2001091000 -1h30n 3B42RT.%y4%m2%d2%h2.bin
  • inctime 2001091000 -2h45n 3B42RT.%y4%m2%d2%h2.bin
  • inctime 2001091000 -1y3m2d1h45n ANYTHING.%y4%m2%d2%h2.ANYTHING
History
  • 22 Mar 2011 - Joao Gerd - Initial Code
  • 27 Jul 2011 - Joao Gerd - Bug into the end print
  • 19 Jul 2012 - Joao Gerd - Add option to month increment/decrement
  • 15 Apr 2013 - Joao Gerd - correct bug to incr/decr month
  • 03 May 2013 - Joao Gerd - correct bug to incr/decr all times (ym was not
    being properly initialized)
  • 05 Feb 2014 - Joao Gerd - Add julian day
  • 20 Jul 2014 - Joao Gerd - upgrade to new version of m_string.f90
    • update help banner and documentation
Use :m_stdio, time_module, m_string
Call to:usage(), jul2cal(), doy()

Subroutines and functions

subroutine usage()
Use :m_stdio
Called from:inctime