0.6.2-dev0
FORCES
FORtran lib for Comp. Env. Sys.
Loading...
Searching...
No Matches
mo_julian.f90 File Reference

Julian date conversion routines. More...

Go to the source code of this file.

Data Types

interface  mo_julian::setcalendar
 Set module private variable calendar. More...
 

Modules

module  mo_julian
 Julian date conversion routines.
 

Functions/Subroutines

subroutine mo_julian::setcalendarstring (selector)
 
subroutine mo_julian::setcalendarinteger (selector)
 
pure integer(i4) function mo_julian::selectcalendar (selector)
 Select a calendar.
 
elemental subroutine, public mo_julian::caldat (julian, dd, mm, yy, calendar)
 Day, month and year from Julian day in the current or given calendar.
 
elemental subroutine, public mo_julian::dec2date (julian, dd, mm, yy, hh, nn, ss, calendar)
 Day, month, year, hour, minute, and second from fractional Julian day in the current or given calendar.
 
elemental real(dp) function, public mo_julian::date2dec (dd, mm, yy, hh, nn, ss, calendar)
 Fractional Julian day from day, month, year, hour, minute, second in the current calendar.
 
elemental integer(i4) function, public mo_julian::julday (dd, mm, yy, calendar)
 Julian day from day, month and year in the current or given calendar.
 
elemental subroutine, public mo_julian::caldatjulian (julian, dd, mm, yy)
 Day, month and year from Julian day.
 
elemental real(dp) function mo_julian::date2decjulian (dd, mm, yy, hh, nn, ss)
 Fractional Julian day from day, month, year, hour, minute, second.
 
elemental subroutine mo_julian::dec2datejulian (julian, dd, mm, yy, hh, nn, ss)
 Day, month, year, hour, minute, and second from fractional Julian day.
 
elemental integer(i4) function mo_julian::juldayjulian (dd, mm, yy)
 Julian day from day, month and year.
 
elemental integer(i4) function, public mo_julian::ndays (dd, mm, yy)
 IMSL Julian day from day, month and year.
 
elemental subroutine, public mo_julian::ndyin (julian, dd, mm, yy)
 Day, month and year from IMSL Julian day.
 
elemental subroutine mo_julian::caldat360 (julian, dd, mm, yy)
 Day, month and year from Julian day in a 360 day calendar.
 
elemental integer(i4) function mo_julian::julday360 (dd, mm, yy)
 Julian day from day, month and year in a 360_day calendar.
 
elemental subroutine mo_julian::dec2date360 (julian, dd, mm, yy, hh, nn, ss)
 Day, month, year, hour, minute, and second from fractional Julian day in a 360_day calendar.
 
elemental real(dp) function mo_julian::date2dec360 (dd, mm, yy, hh, nn, ss)
 Fractional Julian day from day, month, year, hour, minute, second in 360 day calendar.
 
elemental subroutine mo_julian::caldat365 (julian, dd, mm, yy)
 Day, month and year from Julian day in a 365 day calendar.
 
elemental integer(i4) function mo_julian::julday365 (dd, mm, yy)
 Julian day from day, month and year in a 365_day calendar.
 
elemental subroutine mo_julian::dec2date365 (julian, dd, mm, yy, hh, nn, ss)
 Day, month, year, hour, minute, and second from fractional Julian day in a 365_day calendar.
 
elemental real(dp) function mo_julian::date2dec365 (dd, mm, yy, hh, nn, ss)
 Fractional Julian day from day, month, year, hour, minute, second in 365 day calendar.
 

Variables

integer(i4), save, private mo_julian::calendar = 1
 

Detailed Description

Julian date conversion routines.

Julian date to and from day, month, year, and also from day, month, year, hour, minute, and second. Also convience routines for Julian dates of IMSL are provided.

Note
Julian day definition starts at noon of the 1st January 4713 BC.
Here, the astronomical definition is used, i.e. the year 1 BC (historic) is counted as 0 (astronomic), 2 BC is -1, etc.
This means that Julian day definition starts as 01.01.-4712 in astronomical units.

julday and caldat start at midnight of the 1st January 4713 BC. So date2dec and julday as well as dec2date and caldat are shifted by half a day.
Use date2dec with dec2date together for fractional Julian dates and use julday with caldat together for integer Julian days.
Changelog
  • Matthias Cuntz, Dec 2011
  • Matthias Cuntz, Jan 2013
    • added date2dec and dec2date
  • Matthias Cuntz, May 2014
    • changed to new algorithm with astronomical units removed numerical recipes
  • David Schaefer, Oct 2015
    • addded 360 day calendar procedures
  • David Schaefer, Jan 2016
    • addded 365 day calendar procedures
  • David Schaefer, Feb 2016
    • implemented wrapper function and the module calendar state
Author
Matthias Cuntz
Date
Dec 2011

Definition in file mo_julian.f90.