FORCES
FORtran lib for Comp. Env. Sys.
|
Julian date conversion routines. More...
Data Types | |
interface | setcalendar |
Set module private variable calendar. More... | |
Functions/Subroutines | |
subroutine | setcalendarstring (selector) |
subroutine | setcalendarinteger (selector) |
pure integer(i4) function | selectcalendar (selector) |
Select a calendar. | |
elemental subroutine, public | caldat (julian, dd, mm, yy, calendar) |
Day, month and year from Julian day in the current or given calendar. | |
elemental subroutine, public | 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 | 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 | julday (dd, mm, yy, calendar) |
Julian day from day, month and year in the current or given calendar. | |
elemental subroutine, public | caldatjulian (julian, dd, mm, yy) |
Day, month and year from Julian day. | |
elemental real(dp) function | date2decjulian (dd, mm, yy, hh, nn, ss) |
Fractional Julian day from day, month, year, hour, minute, second. | |
elemental subroutine | dec2datejulian (julian, dd, mm, yy, hh, nn, ss) |
Day, month, year, hour, minute, and second from fractional Julian day. | |
elemental integer(i4) function | juldayjulian (dd, mm, yy) |
Julian day from day, month and year. | |
elemental integer(i4) function, public | ndays (dd, mm, yy) |
IMSL Julian day from day, month and year. | |
elemental subroutine, public | ndyin (julian, dd, mm, yy) |
Day, month and year from IMSL Julian day. | |
elemental subroutine | caldat360 (julian, dd, mm, yy) |
Day, month and year from Julian day in a 360 day calendar. | |
elemental integer(i4) function | julday360 (dd, mm, yy) |
Julian day from day, month and year in a 360_day calendar. | |
elemental subroutine | 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 | date2dec360 (dd, mm, yy, hh, nn, ss) |
Fractional Julian day from day, month, year, hour, minute, second in 360 day calendar. | |
elemental subroutine | caldat365 (julian, dd, mm, yy) |
Day, month and year from Julian day in a 365 day calendar. | |
elemental integer(i4) function | julday365 (dd, mm, yy) |
Julian day from day, month and year in a 365_day calendar. | |
elemental subroutine | 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 | 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 | calendar = 1 |
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.
COPYING
and COPYING.LESSER
provided with this software. The complete GNU license text can also be found at http://www.gnu.org/licenses/. elemental subroutine, public mo_julian::caldat | ( | integer(i4), intent(in) | julian, |
integer(i4), intent(out) | dd, | ||
integer(i4), intent(out) | mm, | ||
integer(i4), intent(out) | yy, | ||
integer(i4), intent(in), optional | calendar | ||
) |
Day, month and year from Julian day in the current or given calendar.
Wrapper around the calendar specific caldat procedures. Inverse of the function julday. Here julian is input as a Julian Day Number, and the routine outputs d0d, mm, and yy as the day, month, and year on which the specified Julian Day started at noon.
The zeroth Julian Day depends on the called procedure. See their documentation for details.
Example
Converts julday to dd, mm, yy format
[in] | integer(i4) :: julday | Julian day |
[out] | integer(i4) :: dd | Day in month of Julian day |
[out] | integer(i4) :: mm | Month in year of Julian day |
[out] | integer(i4) :: yy | Year of Julian day |
[in] | integer(i4) :: calendar | The calendar to use, the global calendar will be used by default |
Definition at line 166 of file mo_julian.f90.
References caldat360(), caldat365(), caldatjulian(), and selectcalendar().
Referenced by dec2datejulian(), and ndyin().
|
private |
Day, month and year from Julian day in a 360 day calendar.
Inverse of the function julday360. Here julian is input as a Julian Day Number, and the routine outputs dd, mm, and yy as the day, month, and year on which the specified Julian Day started at noon.
The zeroth Julian Day here is 01.01.0000
Example
[in] | integer(i4) :: julday | Julian day |
[out] | integer(i4) :: dd | Day in month of Julian day |
[out] | integer(i4) :: mm | Month in year of Julian day |
[out] | integer(i4) :: yy | Year of Julian day |
Definition at line 883 of file mo_julian.f90.
Referenced by caldat(), and dec2date360().
|
private |
Day, month and year from Julian day in a 365 day calendar.
Inverse of the function julday365. Here julian is input as a Julian Day Number, and the routine outputs dd, mm, and yy as the day, month, and year on which the specified Julian Day started at noon.
The zeroth Julian Day here is 01.01.0000
Example
[in] | integer(i4) :: julday | Julian day |
[out] | integer(i4) :: dd | Day in month of Julian day |
[out] | integer(i4) :: mm | Month in year of Julian day |
[out] | integer(i4) :: yy | Year of Julian day |
Definition at line 1088 of file mo_julian.f90.
Referenced by caldat(), and dec2date365().
elemental subroutine, public mo_julian::caldatjulian | ( | integer(i4), intent(in) | julian, |
integer(i4), intent(out) | dd, | ||
integer(i4), intent(out) | mm, | ||
integer(i4), intent(out) | yy | ||
) |
Day, month and year from Julian day.
Inverse of the function juldayJulian. Here julian is input as a Julian Day Number, and the routine outputs id, mm, and yy as the day, month, and year on which the specified Julian Day started at noon.
The zeroth Julian Day is 01.01.-4712, i.e. the 1st January 4713 BC.
Julian day definition starts at 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.
Example
Literature
[in] | integer(i4) :: Julday | Julian day |
[out] | integer(i4) :: dd | Day in month of Julian day |
[out] | integer(i4) :: mm | Month in year of Julian day |
[out] | integer(i4) :: yy | Year of Julian day |
Definition at line 385 of file mo_julian.f90.
References mo_kind::dp, mo_kind::i4, and mo_kind::i8.
Referenced by caldat().
elemental real(dp) function, public mo_julian::date2dec | ( | integer(i4), intent(in), optional | dd, |
integer(i4), intent(in), optional | mm, | ||
integer(i4), intent(in), optional | yy, | ||
integer(i4), intent(in), optional | hh, | ||
integer(i4), intent(in), optional | nn, | ||
integer(i4), intent(in), optional | ss, | ||
integer(i4), intent(in), optional | calendar | ||
) |
Fractional Julian day from day, month, year, hour, minute, second in the current calendar.
Wrapper around the calendar specific date2dec procedures. In this routine date2dec returns the fractional Julian Day that begins at noon of the calendar date specified by month mm, day dd, and year yy, all integer variables.
The zeroth Julian Day depends on the called procedure. See their documentation for details.
Example
Take dd, mm, yy, hh, nn, ss to fractional Julian date
[in] | integer(i4), optional :: dd | Day in month of Julian day (default: 1) |
[in] | integer(i4), optional :: mm | Month in year of Julian day (default: 1) |
[in] | integer(i4), optional :: yy | Year of Julian day (default: 1) |
[in] | integer(i4), optional :: hh | Hours of Julian day (default: 0) |
[in] | integer(i4), optional :: nn | Minutes of hour of Julian day (default: 0) |
[in] | integer(i4), optional :: ss | Secondes of minute of hour of Julian day (default: 0) |
[in] | integer(i4), optional :: calendar | The calendar to use, the global calendar will be used by default |
real(dp) :: date2dec | Fractional Julian day |
Definition at line 265 of file mo_julian.f90.
References date2dec(), date2dec360(), date2dec365(), date2decjulian(), and selectcalendar().
Referenced by date2dec().
|
private |
Fractional Julian day from day, month, year, hour, minute, second in 360 day calendar.
In this routine date2dec360 returns the fractional Julian Day that begins at noon of the calendar date specified by month mm, day dd, and year yy, all integer variables.
The zeroth Julian Day is 01.01.0000 at noon.
Example
[in] | integer(i4), optional :: dd | Day in month of Julian day (default: 1) |
[in] | integer(i4), optional :: mm | Month in year of Julian day (default: 1) |
[in] | integer(i4), optional :: yy | Year of Julian day (default: 1) |
[in] | integer(i4), optional :: hh | Hours of Julian day (default: 0) |
[in] | integer(i4), optional :: nn | Minutes of hour of Julian day (default: 0) |
[in] | integer(i4), optional :: ss | Secondes of minute of hour of Julian day (default: 0) |
real(dp) :: date2dec360 | Fractional Julian day |
Definition at line 1028 of file mo_julian.f90.
References date2dec360(), mo_kind::dp, and julday360().
Referenced by date2dec(), and date2dec360().
|
private |
Fractional Julian day from day, month, year, hour, minute, second in 365 day calendar.
In this routine date2dec365 returns the fractional Julian Day that begins at noon of the calendar date specified by month mm, day dd, and year yy, all integer variables.
The zeroth Julian Day is 01.01.0000 at noon.
Example
[in] | integer(i4), optional :: dd | Day in month of Julian day (default: 1) |
[in] | integer(i4), optional :: mm | Month in year of Julian day (default: 1) |
[in] | integer(i4), optional :: yy | Year of Julian day (default: 1) |
[in] | integer(i4), optional :: hh | Hours of Julian day (default: 0) |
[in] | integer(i4), optional :: nn | Minutes of hour of Julian day (default: 0) |
[in] | integer(i4), optional :: ss | Secondes of minute of hour of Julian day (default: 0) |
real(dp) :: date2dec365 | Fractional Julian day |
Definition at line 1243 of file mo_julian.f90.
References date2dec365(), mo_kind::dp, and julday365().
Referenced by date2dec(), and date2dec365().
|
private |
Fractional Julian day from day, month, year, hour, minute, second.
In this routine date2decJulian returns the fractional Julian Day that begins at noon of the calendar date specified by month mm, day dd, and year yy, all integer variables.
The zeroth Julian Day is 01.01.-4712 at noon, i.e. the 1st January 4713 BC 12:00:00 h.
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.
Example
2415020.5 is 01.01.1900 00:00
julian = date2decJulian(01,01,1990,12,00)
Literature
[in] | integer(i4), optional :: dd | Day in month of Julian day (default: 1) |
[in] | integer(i4), optional :: mm | Month in year of Julian day (default: 1) |
[in] | integer(i4), optional :: yy | Year of Julian day (default: 1) |
[in] | integer(i4), optional :: hh | Hours of Julian day (default: 0) |
[in] | integer(i4), optional :: nn | Minutes of hour of Julian day (default: 0) |
[in] | integer(i4), optional :: ss | Secondes of minute of hour of Julian day (default: 0) |
real(dp) :: date2dec | Fractional Julian day |
Definition at line 486 of file mo_julian.f90.
References date2decjulian(), mo_kind::dp, and mo_kind::i8.
Referenced by date2dec(), and date2decjulian().
elemental subroutine, public mo_julian::dec2date | ( | real(dp), intent(in) | julian, |
integer(i4), intent(out), optional | dd, | ||
integer(i4), intent(out), optional | mm, | ||
integer(i4), intent(out), optional | yy, | ||
integer(i4), intent(out), optional | hh, | ||
integer(i4), intent(out), optional | nn, | ||
integer(i4), intent(out), optional | ss, | ||
integer(i4), intent(in), optional | calendar | ||
) |
Day, month, year, hour, minute, and second from fractional Julian day in the current or given calendar.
Wrapper around the calendar specific dec2date procedures. Inverse of the function date2dec. Here dec2date is input as a fractional Julian Day. The routine outputs dd, mm, yy, hh, nn, ss as the day, month, year, hour, minute, and second on which the specified Julian Day started at noon.
The zeroth Julian Day depends on the called procedure. See their documentation for details.
Example
Takes in fraction julian date fJulian to covert to dd, mm, yy, hh, nn, ss
[in] | real(dp) :: fJulian | fractional Julian day |
[in] | integer(i4), optional :: calendar | The calendar to use, the global calendar will be used by default |
[out] | integer(i4), optional :: dd | Day in month of Julian day |
[out] | integer(i4), optional :: mm | Month in year of Julian day |
[out] | integer(i4), optional :: yy | Year of Julian day |
[out] | integer(i4), optional :: hh | Hour of Julian day |
[out] | integer(i4), optional :: nn | Minute in hour of Julian day |
[out] | integer(i4), optional :: ss | Second in minute of hour of Julian day |
Definition at line 217 of file mo_julian.f90.
References dec2date360(), dec2date365(), dec2datejulian(), and selectcalendar().
|
private |
Day, month, year, hour, minute, and second from fractional Julian day in a 360_day calendar.
Inverse of the function date2dec360. Here dec2date360 is input as a fractional Julian Day. The routine outputs dd, mm, yy, hh, nn, ss as the day, month, year, hour, minute, and second on which the specified Julian Day started at noon.
The zeroth Julian Day is 01.01.0000 at noon.
Example
[in] | real(dp) :: fJulian | fractional Julian day |
[out] | integer(i4), optional :: dd | Day in month of Julian day |
[out] | integer(i4), optional :: mm | Month in year of Julian day |
[out] | integer(i4), optional :: yy | Year of Julian day |
[out] | integer(i4), optional :: hh | Hour of Julian day |
[out] | integer(i4), optional :: nn | Minute in hour of Julian day |
[out] | integer(i4), optional :: ss | Second in minute of hour of Julian day |
Definition at line 960 of file mo_julian.f90.
References caldat360(), mo_kind::dp, mo_kind::i4, and julday360().
Referenced by dec2date().
|
private |
Day, month, year, hour, minute, and second from fractional Julian day in a 365_day calendar.
Inverse of the function date2dec. Here dec2date365 is input as a fractional Julian Day. The routine outputs dd, mm, yy, hh, nn, ss as the day, month, year, hour, minute, and second on which the specified Julian Day started at noon.
The zeroth Julian Day is 01.01.0000 at noon.
Example
[in] | real(dp) :: fJulian | fractional Julian day |
[out] | integer(i4), optional :: dd | Day in month of Julian day |
[out] | integer(i4), optional :: mm | Month in year of Julian day |
[out] | integer(i4), optional :: yy | Year of Julian day |
[out] | integer(i4), optional :: hh | Hour of Julian day |
[out] | integer(i4), optional :: nn | Minute in hour of Julian day |
[out] | integer(i4), optional :: ss | Second in minute of hour of Julian day |
Definition at line 1175 of file mo_julian.f90.
References caldat365(), mo_kind::dp, mo_kind::i4, and julday365().
Referenced by dec2date().
|
private |
Day, month, year, hour, minute, and second from fractional Julian day.
Inverse of the function date2decJulian. Here dec2dateJulian is input as a fractional Julian Day, which starts at noon of the 1st January 4713 BC, i.e. 01.01.-4712. The routine outputs dd, mm, yy, hh, nn, ss as the day, month, year, hour, minute, and second on which the specified Julian Day started at noon.
The zeroth Julian Day is 01.01.-4712 at noon, i.e. the 1st January 4713 BC at noon.
Julian day definition starts at 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.
Example
2415020.5 is 01.01.1900 00:00
2415021.0 is 01.01.1900 12:00
Literature
[in] | real(dp) :: fJulian | fractional Julian day |
[out] | integer(i4), optional :: dd | Day in month of Julian day |
[out] | integer(i4), optional :: mm | Month in year of Julian day |
[out] | integer(i4), optional :: yy | Year of Julian day |
[out] | integer(i4), optional :: hh | Hour of Julian day |
[out] | integer(i4), optional :: nn | Minute in hour of Julian day |
[out] | integer(i4), optional :: ss | Second in minute of hour of Julian day |
Definition at line 610 of file mo_julian.f90.
References caldat(), mo_kind::dp, mo_kind::i4, mo_kind::i8, and julday().
Referenced by dec2date().
elemental integer(i4) function, public mo_julian::julday | ( | integer(i4), intent(in) | dd, |
integer(i4), intent(in) | mm, | ||
integer(i4), intent(in) | yy, | ||
integer(i4), intent(in), optional | calendar | ||
) |
Julian day from day, month and year in the current or given calendar.
Wrapper around the calendar specific julday procedures. In this routine julday returns the Julian Day Number that begins at noon of the calendar date specified by month mm, day dd, and year yy, all integer variables.
The zeroth Julian Day depends on the called procedure. See their documentation for details.
Example
Take dd, mm, yy, hh, nn, ss to Julian date
[in] | integer(i4) :: dd | Day in month of Julian day |
[in] | integer(i4) :: mm | Month in year of Julian day |
[in] | integer(i4) :: yy | Year of Julian day |
[in] | integer(i4), optional :: calendar | The calendar to use, the global calendar will be used by default |
integer(i4) :: julian | Julian day |
Definition at line 312 of file mo_julian.f90.
References julday(), julday360(), julday365(), juldayjulian(), and selectcalendar().
Referenced by dec2datejulian(), julday(), and ndays().
|
private |
Julian day from day, month and year in a 360_day calendar.
In this routine julday360 returns the Julian Day Number that begins at noon of the calendar date specified by month mm, day dd, and year yy, all integer variables.
The zeroth Julian Day is 01.01.0000
Example
[in] | integer(i4) :: dd | Day in month of Julian day |
[in] | integer(i4) :: mm | Month in year of Julian day |
[in] | integer(i4) :: yy | Year of Julian day |
integer(i4) :: julian | Julian day |
Definition at line 921 of file mo_julian.f90.
References julday360().
Referenced by date2dec360(), dec2date360(), julday(), and julday360().
|
private |
Julian day from day, month and year in a 365_day calendar.
In this routine julday365 returns the Julian Day Number that begins at noon of the calendar date specified by month mm, day dd, and year yy, all integer variables.
The zeroth Julian Day is 01.01.0000
Example
[in] | integer(i4) :: dd | Day in month of Julian day |
[in] | integer(i4) :: mm | Month in year of Julian day |
[in] | integer(i4) :: yy | Year of Julian day |
integer(i4) :: julian | Julian day |
Definition at line 1134 of file mo_julian.f90.
References julday365().
Referenced by date2dec365(), dec2date365(), julday(), and julday365().
|
private |
Julian day from day, month and year.
In this routine juldayJulian returns the Julian Day Number that begins at noon of the calendar date specified by month mm, day dd, and year yy, all integer variables.
The zeroth Julian Day is 01.01.-4712 at noon, i.e. the 1st January 4713 BC 12:00:00 h.
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.
Example
2415021 is 01.01.1900 and 2440588 is 01.01.1970
See also example in test directory
Literature
[in] | integer(i4) :: dd | Day in month of Julian day |
[in] | integer(i4) :: mm | Month in year of Julian day |
[in] | integer(i4) :: yy | Year of Julian day |
integer(i4) :: julian | Julian day |
Definition at line 744 of file mo_julian.f90.
References mo_kind::dp, mo_kind::i4, mo_kind::i8, and juldayjulian().
Referenced by julday(), and juldayjulian().
elemental integer(i4) function, public mo_julian::ndays | ( | integer(i4), intent(in) | dd, |
integer(i4), intent(in) | mm, | ||
integer(i4), intent(in) | yy | ||
) |
IMSL Julian day from day, month and year.
In this routine ndays returns the IMSL Julian Day Number. Julian days begin at noon of the calendar date specified by month mm, day dd, and year yy, all integer variables. IMSL treats 01.01.1900 as a reference and assigns a Julian day 0 to it.
ndays = julday(dd,mm,yy) - julday(01,01,1900)
Example
0 is 01.01.1900
See also example in test directory
[in] | integer(i4) :: dd | Day in month of IMSL Julian day |
[in] | integer(i4) :: mm | Month in year of IMSL Julian day |
[in] | integer(i4) :: yy | Year of IMSL Julian day |
integer(i4) :: julian | IMSL Julian day, i.e. days before or after 01.01.1900 |
Definition at line 808 of file mo_julian.f90.
References julday(), and ndays().
Referenced by ndays().
elemental subroutine, public mo_julian::ndyin | ( | integer(i4), intent(in) | julian, |
integer(i4), intent(out) | dd, | ||
integer(i4), intent(out) | mm, | ||
integer(i4), intent(out) | yy | ||
) |
Day, month and year from IMSL Julian day.
Inverse of the function ndys. Here ISML Julian is input as a Julian Day Number minus the Julian Day Number of 01.01.1900, and the routine outputs id, mm, and yy as the day, month, and year on which the specified Julian Day started at noon.
ndyin is caldat(IMSLJulian + 2415021, dd, mm, yy)
Example
0 is 01.01.1900
See also example in test directory
[in] | integer(i4) :: julian | IMSL Julian day, i.e. days before or after 01.01.1900 |
[out] | integer(i4) :: dd | Day in month of IMSL Julian day |
[out] | integer(i4) :: mm | Month in year of IMSL Julian day |
[out] | integer(i4) :: yy | Year of IMSL Julian day |
Definition at line 847 of file mo_julian.f90.
References caldat().
|
private |
Select a calendar.
Returns a valid calendar index, based on the given optional argument and/or the module global private variable calendar. If an invalid selector is passed, its value is ignored and the global calendar value retuned instead.
Example
Returns a valid index which is 3
[in] | integer(i4), optional :: selector | Calendar selector {1|2|3} |
Definition at line 125 of file mo_julian.f90.
References selectcalendar().
Referenced by caldat(), date2dec(), dec2date(), julday(), and selectcalendar().
|
private |
Definition at line 95 of file mo_julian.f90.
|
private |
Definition at line 78 of file mo_julian.f90.
|
private |
Definition at line 50 of file mo_julian.f90.