Soil Water Balance (SWB2)
Loading...
Searching...
No Matches
datetime Module Reference

This module contains the DATETIME_T class and associated time and date-related routines, along with the MONTH_T class which defines month names and three-letter abbreviations. More...

Data Types

interface  assignment(=)
type  datetime_t
type  month_t
 Container for month name and length information. More...
interface  operator(<)
interface  operator(>)

Functions/Subroutines

subroutine set_default_date_format (sdateformat)
subroutine set_default_time_format (stimeformat)
subroutine set_date_format_indices (this, sdateformat)
subroutine set_time_format_indices (this, stimeformat)
subroutine parse_text_to_date_sub (this, sstring, sfilename, ilinenumber)
subroutine parse_text_to_time_sub (this, sstring)
subroutine calc_water_year_sub (this)
subroutine calc_julian_day_sub (this, imonth, iday, iyear, ihour, iminute, isecond)
subroutine calc_gregorian_date_sub (this)
subroutine, public gregorian_date (ijd, iyear, imonth, iday, iorigin)
integer(c_int) function, public julian_day (iyear, imonth, iday, iorigin, sinputitemname)
logical(c_bool) function is_date_greater_than (date1, date2)
logical(c_bool) function is_date_less_than (date1, date2)
logical(c_bool) function is_date_lt_or_equal_to (date1, date2)
logical(c_bool) function is_date_gt_or_equal_to (date1, date2)
logical(c_bool) function is_date_equal_to (date1, date2)
integer(c_int) function, public count_leap_days_between_dates (date_min, date_max)
subroutine assign_value_to_sub (date2, date1)
real(c_double) function date_minus_date_fn (date1, date2)
type(datetime_t) function, allocatable date_plus_float_fn (date1, fvalue)
type(datetime_t) function, allocatable date_minus_float_fn (date1, fvalue)
type(datetime_t) function, allocatable date_minus_int_fn (date1, ivalue)
character(len=20) function write_pretty_datetime_fn (this)
character(len=10) function write_pretty_date_fn (this)
character(len=10) function write_list_date_fn (this)
character(len=8) function write_list_time_fn (this)
character(len=19) function write_list_datetime_fn (this)
subroutine system_time_to_date_sub (this)
subroutine set_julian_date_sub (this, dvalue)
 Return the number of days in the given year.
integer(c_int) function get_julian_day_fn (this)
real(c_double) function get_fraction_of_day_fn (this)
integer(c_int) function get_days_in_month_fn (this)
integer(c_int) function get_days_in_year_fn (this)
subroutine date_plus_year_sub (this)
subroutine date_set_day_sub (this, newday)
subroutine date_set_month_sub (this, newmonth)
subroutine date_set_year_sub (this, newyear)
subroutine date_advance_to_last_day_of_month_sub (this)
subroutine date_minus_year_sub (this)
subroutine date_plus_day_sub (this)
subroutine date_minus_day_sub (this)
logical(c_bool) function is_leap_year_fn (this)
integer(c_int) function mmddyyyy2julian (smmddyyyy)
integer(c_int) function, public mmdd2doy (smmdd, sinputitemname)
integer(c_int) function mmddyyyy2doy (smmddyyyy)
integer(c_int) function get_day_of_year_fn (this)
integer(c_int) function, public day_of_year (ijd)
logical(c_bool) function, public isleap (iyear)

Variables

character(len=14), private sdate_format = "MM/DD/YYYY"
character(len=14), public sdefault_date_format = "MM/DD/YYYY"
integer(c_int), private iscanmm1 = 1
integer(c_int), private iscanmm2 = 2
integer(c_int), private iscandelim1 = 3
integer(c_int), private iscandd1 = 4
integer(c_int), private iscandd2 = 5
integer(c_int), private iscandelim2 = 6
integer(c_int), private iscanyyyy1 = 7
integer(c_int), private iscanyyyy2 = 10
character(len=14), private stime_format = "HH:MM:SS"
character(len=14), public sdefault_time_format = "HH:MM:SS"
integer(c_int), private iscanhour1 = 1
integer(c_int), private iscanhour2 = 2
integer(c_int), private iscanmin1 = 4
integer(c_int), private iscanmin2 = 5
integer(c_int), private iscansec1 = 7
integer(c_int), private iscansec2 = 8
type(month_t), dimension(12), target, public months = [ MONTH_T( 'Jan','January ', 1, 31, 1, 31), MONTH_T( 'Feb','February ', 32, 59, 2, 29), MONTH_T( 'Mar','March ', 60, 90, 3, 31), MONTH_T( 'Apr','April ', 91, 120, 4, 30), MONTH_T( 'May','May ', 121, 151, 5, 31), MONTH_T( 'Jun','June ', 152, 181, 6, 30), MONTH_T( 'Jul','July ', 182, 212, 7, 31), MONTH_T( 'Aug','August ', 213, 243, 8, 31), MONTH_T( 'Sep','September', 244, 273, 9, 30), MONTH_T( 'Oct','October ', 274, 304, 10, 31), MONTH_T( 'Nov','November ', 305, 334, 11, 30), MONTH_T( 'Dec','December ', 335, 365, 12, 31) ]
 Month information.

Detailed Description

This module contains the DATETIME_T class and associated time and date-related routines, along with the MONTH_T class which defines month names and three-letter abbreviations.

Function/Subroutine Documentation

◆ assign_value_to_sub()

subroutine datetime::assign_value_to_sub ( type(datetime_t), intent(out) date2,
type(datetime_t), intent(in) date1 )
private

Definition at line 880 of file datetime.F90.

◆ calc_gregorian_date_sub()

subroutine datetime::calc_gregorian_date_sub ( class (datetime_t), intent(inout) this)
private

Definition at line 503 of file datetime.F90.

Here is the call graph for this function:

◆ calc_julian_day_sub()

subroutine datetime::calc_julian_day_sub ( class (datetime_t) this,
integer (c_int), intent(in), optional imonth,
integer (c_int), intent(in), optional iday,
integer (c_int), intent(in), optional iyear,
integer (c_int), intent(in), optional ihour,
integer (c_int), intent(in), optional iminute,
integer (c_int), intent(in), optional isecond )
private

Definition at line 470 of file datetime.F90.

Here is the call graph for this function:

◆ calc_water_year_sub()

subroutine datetime::calc_water_year_sub ( class (datetime_t) this)
private

Definition at line 409 of file datetime.F90.

◆ count_leap_days_between_dates()

integer (c_int) function, public datetime::count_leap_days_between_dates ( class(datetime_t), intent(in) date_min,
class(datetime_t), intent(in) date_max )

Definition at line 832 of file datetime.F90.

Here is the call graph for this function:

◆ date_advance_to_last_day_of_month_sub()

subroutine datetime::date_advance_to_last_day_of_month_sub ( class(datetime_t) this)
private

Definition at line 1316 of file datetime.F90.

◆ date_minus_date_fn()

real (c_double) function datetime::date_minus_date_fn ( class(datetime_t), intent(in) date1,
class(datetime_t), intent(in) date2 )
private

Definition at line 900 of file datetime.F90.

◆ date_minus_day_sub()

subroutine datetime::date_minus_day_sub ( class(datetime_t) this)
private

Definition at line 1367 of file datetime.F90.

◆ date_minus_float_fn()

type(datetime_t) function, allocatable datetime::date_minus_float_fn ( class(datetime_t), intent(in) date1,
real (c_float), intent(in) fvalue )
private

Definition at line 927 of file datetime.F90.

◆ date_minus_int_fn()

type(datetime_t) function, allocatable datetime::date_minus_int_fn ( class(datetime_t), intent(in) date1,
integer (c_int), intent(in) ivalue )
private

Definition at line 942 of file datetime.F90.

◆ date_minus_year_sub()

subroutine datetime::date_minus_year_sub ( class(datetime_t) this)
private

Definition at line 1340 of file datetime.F90.

◆ date_plus_day_sub()

subroutine datetime::date_plus_day_sub ( class(datetime_t) this)
private

Definition at line 1355 of file datetime.F90.

◆ date_plus_float_fn()

type(datetime_t) function, allocatable datetime::date_plus_float_fn ( class(datetime_t), intent(in) date1,
real (c_float), intent(in) fvalue )
private

Definition at line 912 of file datetime.F90.

◆ date_plus_year_sub()

subroutine datetime::date_plus_year_sub ( class(datetime_t) this)
private

Definition at line 1265 of file datetime.F90.

◆ date_set_day_sub()

subroutine datetime::date_set_day_sub ( class(datetime_t) this,
integer (c_int), intent(in) newday )
private

Definition at line 1280 of file datetime.F90.

◆ date_set_month_sub()

subroutine datetime::date_set_month_sub ( class(datetime_t) this,
integer (c_int), intent(in) newmonth )
private

Definition at line 1292 of file datetime.F90.

◆ date_set_year_sub()

subroutine datetime::date_set_year_sub ( class(datetime_t) this,
integer (c_int), intent(in) newyear )
private

Definition at line 1304 of file datetime.F90.

◆ day_of_year()

integer (c_int) function, public datetime::day_of_year ( integer (c_int), value ijd)

Definition at line 1534 of file datetime.F90.

Here is the call graph for this function:

◆ get_day_of_year_fn()

integer (c_int) function datetime::get_day_of_year_fn ( class(datetime_t) this)
private

Definition at line 1523 of file datetime.F90.

Here is the call graph for this function:

◆ get_days_in_month_fn()

integer (c_int) function datetime::get_days_in_month_fn ( class(datetime_t) this)
private

Definition at line 1231 of file datetime.F90.

◆ get_days_in_year_fn()

integer (c_int) function datetime::get_days_in_year_fn ( class(datetime_t) this)
private

Definition at line 1250 of file datetime.F90.

◆ get_fraction_of_day_fn()

real (c_double) function datetime::get_fraction_of_day_fn ( class(datetime_t), intent(in) this)
private

Definition at line 1220 of file datetime.F90.

◆ get_julian_day_fn()

integer (c_int) function datetime::get_julian_day_fn ( class(datetime_t), intent(in) this)
private

Definition at line 1209 of file datetime.F90.

◆ gregorian_date()

subroutine, public datetime::gregorian_date ( integer (c_int), value ijd,
integer (c_int), intent(inout) iyear,
integer (c_int), intent(inout) imonth,
integer (c_int), intent(inout) iday,
integer (c_int), intent(in), optional iorigin )

Definition at line 571 of file datetime.F90.

◆ is_date_equal_to()

logical(c_bool ) function datetime::is_date_equal_to ( class(datetime_t), intent(in) date1,
class(datetime_t), intent(in) date2 )
private

Definition at line 809 of file datetime.F90.

◆ is_date_greater_than()

logical(c_bool ) function datetime::is_date_greater_than ( type(datetime_t), intent(in) date1,
type(datetime_t), intent(in) date2 )
private

Definition at line 731 of file datetime.F90.

◆ is_date_gt_or_equal_to()

logical(c_bool ) function datetime::is_date_gt_or_equal_to ( class ( datetime_t), intent(in) date1,
type ( datetime_t), intent(in) date2 )
private

Definition at line 793 of file datetime.F90.

◆ is_date_less_than()

logical(c_bool ) function datetime::is_date_less_than ( class(datetime_t), intent(in) date1,
class(datetime_t), intent(in) date2 )
private

Definition at line 754 of file datetime.F90.

◆ is_date_lt_or_equal_to()

logical(c_bool ) function datetime::is_date_lt_or_equal_to ( class ( datetime_t ), intent(in) date1,
type ( datetime_t ), intent(in) date2 )
private

Definition at line 777 of file datetime.F90.

◆ is_leap_year_fn()

logical (c_bool) function datetime::is_leap_year_fn ( class(datetime_t) this)
private

Definition at line 1379 of file datetime.F90.

◆ isleap()

logical (c_bool) function, public datetime::isleap ( integer (c_int), intent(in) iyear)

Definition at line 1552 of file datetime.F90.

◆ julian_day()

integer (c_int) function, public datetime::julian_day ( integer (c_int), intent(in) iyear,
integer (c_int), intent(in) imonth,
integer (c_int), intent(in) iday,
integer (c_int), optional iorigin,
character (len=*), optional sinputitemname )

Definition at line 641 of file datetime.F90.

Here is the call graph for this function:

◆ mmdd2doy()

integer (c_int) function, public datetime::mmdd2doy ( character (len=*) smmdd,
character (len=*), optional sinputitemname )

Definition at line 1429 of file datetime.F90.

Here is the call graph for this function:

◆ mmddyyyy2doy()

integer (c_int) function datetime::mmddyyyy2doy ( character (len=*) smmddyyyy)
private

Definition at line 1480 of file datetime.F90.

Here is the call graph for this function:

◆ mmddyyyy2julian()

integer (c_int) function datetime::mmddyyyy2julian ( character (len=*) smmddyyyy)
private

Definition at line 1391 of file datetime.F90.

Here is the call graph for this function:

◆ parse_text_to_date_sub()

subroutine datetime::parse_text_to_date_sub ( class (datetime_t), intent(inout) this,
character (len=*), intent(in) sstring,
character (len=*), intent(in), optional sfilename,
integer (c_int), intent(in), optional ilinenumber )
private

Definition at line 258 of file datetime.F90.

Here is the call graph for this function:

◆ parse_text_to_time_sub()

subroutine datetime::parse_text_to_time_sub ( class (datetime_t), intent(inout) this,
character (len=*), intent(in) sstring )
private

Definition at line 346 of file datetime.F90.

◆ set_date_format_indices()

subroutine datetime::set_date_format_indices ( class (datetime_t), intent(inout) this,
character (len=*), intent(in), optional sdateformat )
private

Definition at line 186 of file datetime.F90.

◆ set_default_date_format()

subroutine datetime::set_default_date_format ( character (len=*), intent(in) sdateformat)
private

Definition at line 166 of file datetime.F90.

◆ set_default_time_format()

subroutine datetime::set_default_time_format ( character (len=*), intent(in) stimeformat)
private

Definition at line 176 of file datetime.F90.

◆ set_julian_date_sub()

subroutine datetime::set_julian_date_sub ( class (datetime_t), intent(inout) this,
real (c_double), intent(in) dvalue )
private

Return the number of days in the given year.

This function simply returns the number of days given the current year.

Definition at line 1195 of file datetime.F90.

◆ set_time_format_indices()

subroutine datetime::set_time_format_indices ( class (datetime_t), intent(inout) this,
character (len=*), intent(in), optional stimeformat )
private

Definition at line 226 of file datetime.F90.

◆ system_time_to_date_sub()

subroutine datetime::system_time_to_date_sub ( class (datetime_t) this)
private

Definition at line 1089 of file datetime.F90.

◆ write_list_date_fn()

character (len=10) function datetime::write_list_date_fn ( class(datetime_t) this)
private

Definition at line 981 of file datetime.F90.

◆ write_list_datetime_fn()

character (len=19) function datetime::write_list_datetime_fn ( class(datetime_t) this)
private

Definition at line 1019 of file datetime.F90.

◆ write_list_time_fn()

character (len=8) function datetime::write_list_time_fn ( class(datetime_t) this)
private

Definition at line 1008 of file datetime.F90.

◆ write_pretty_date_fn()

character (len=10) function datetime::write_pretty_date_fn ( class(datetime_t) this)
private

Definition at line 969 of file datetime.F90.

◆ write_pretty_datetime_fn()

character (len=20) function datetime::write_pretty_datetime_fn ( class(datetime_t) this)
private

Definition at line 957 of file datetime.F90.

Variable Documentation

◆ iscandd1

integer (c_int), private datetime::iscandd1 = 4
private

Definition at line 120 of file datetime.F90.

◆ iscandd2

integer (c_int), private datetime::iscandd2 = 5
private

Definition at line 121 of file datetime.F90.

◆ iscandelim1

integer (c_int), private datetime::iscandelim1 = 3
private

Definition at line 119 of file datetime.F90.

◆ iscandelim2

integer (c_int), private datetime::iscandelim2 = 6
private

Definition at line 122 of file datetime.F90.

◆ iscanhour1

integer (c_int), private datetime::iscanhour1 = 1
private

Definition at line 128 of file datetime.F90.

◆ iscanhour2

integer (c_int), private datetime::iscanhour2 = 2
private

Definition at line 129 of file datetime.F90.

◆ iscanmin1

integer (c_int), private datetime::iscanmin1 = 4
private

Definition at line 130 of file datetime.F90.

◆ iscanmin2

integer (c_int), private datetime::iscanmin2 = 5
private

Definition at line 131 of file datetime.F90.

◆ iscanmm1

integer (c_int), private datetime::iscanmm1 = 1
private

Definition at line 117 of file datetime.F90.

◆ iscanmm2

integer (c_int), private datetime::iscanmm2 = 2
private

Definition at line 118 of file datetime.F90.

◆ iscansec1

integer (c_int), private datetime::iscansec1 = 7
private

Definition at line 132 of file datetime.F90.

◆ iscansec2

integer (c_int), private datetime::iscansec2 = 8
private

Definition at line 133 of file datetime.F90.

◆ iscanyyyy1

integer (c_int), private datetime::iscanyyyy1 = 7
private

Definition at line 123 of file datetime.F90.

◆ iscanyyyy2

integer (c_int), private datetime::iscanyyyy2 = 10
private

Definition at line 124 of file datetime.F90.

◆ months

type ( month_t ), dimension(12), target, public datetime::months = [ MONTH_T( 'Jan','January ', 1, 31, 1, 31), MONTH_T( 'Feb','February ', 32, 59, 2, 29), MONTH_T( 'Mar','March ', 60, 90, 3, 31), MONTH_T( 'Apr','April ', 91, 120, 4, 30), MONTH_T( 'May','May ', 121, 151, 5, 31), MONTH_T( 'Jun','June ', 152, 181, 6, 30), MONTH_T( 'Jul','July ', 182, 212, 7, 31), MONTH_T( 'Aug','August ', 213, 243, 8, 31), MONTH_T( 'Sep','September', 244, 273, 9, 30), MONTH_T( 'Oct','October ', 274, 304, 10, 31), MONTH_T( 'Nov','November ', 305, 334, 11, 30), MONTH_T( 'Dec','December ', 335, 365, 12, 31) ]

Month information.

Definition at line 148 of file datetime.F90.

◆ sdate_format

character (len=14), private datetime::sdate_format = "MM/DD/YYYY"
private

Definition at line 115 of file datetime.F90.

◆ sdefault_date_format

character (len=14), public datetime::sdefault_date_format = "MM/DD/YYYY"

Definition at line 116 of file datetime.F90.

◆ sdefault_time_format

character (len=14), public datetime::sdefault_time_format = "HH:MM:SS"

Definition at line 127 of file datetime.F90.

◆ stime_format

character (len=14), private datetime::stime_format = "HH:MM:SS"
private

Definition at line 126 of file datetime.F90.