time_functions Module

Various procedures for manipulating time


Uses

  • module~~time_functions~~UsesGraph module~time_functions time_functions module~uemep_constants uemep_constants module~time_functions->module~uemep_constants

Used by

  • module~~time_functions~~UsedByGraph module~time_functions time_functions module~chemistry_no2 chemistry_no2 module~chemistry_no2->module~time_functions module~read_config read_config module~read_config->module~time_functions module~read_emep read_emep module~read_emep->module~time_functions module~read_meteo_nc read_meteo_nc module~read_meteo_nc->module~time_functions module~read_meteo_nc->module~read_config module~read_roadlink_data_ascii read_roadlink_data_ascii module~read_roadlink_data_ascii->module~time_functions module~read_shipping_asi_data read_shipping_asi_data module~read_shipping_asi_data->module~time_functions module~read_time_profiles read_time_profiles module~read_time_profiles->module~time_functions module~save_emission_netcdf save_emission_netcdf module~save_emission_netcdf->module~time_functions module~save_emission_netcdf->module~read_meteo_nc module~save_emission_netcdf->module~read_roadlink_data_ascii module~save_emission_netcdf->module~read_shipping_asi_data module~save_emission_netcdf->module~read_time_profiles module~save_netcdf_file save_netcdf_file module~save_emission_netcdf->module~save_netcdf_file module~save_netcdf_file->module~chemistry_no2 program~uemep uEMEP program~uemep->module~chemistry_no2 program~uemep->module~read_config program~uemep->module~read_emep program~uemep->module~read_meteo_nc program~uemep->module~read_roadlink_data_ascii program~uemep->module~read_shipping_asi_data program~uemep->module~read_time_profiles program~uemep->module~save_emission_netcdf program~uemep->module~save_netcdf_file module~redistribute_data redistribute_data program~uemep->module~redistribute_data module~redistribute_data->module~save_netcdf_file

Functions

public function date_to_julian(date_array, ref_year) result(res)

Returns Julian day from an array with date and time

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: date_array(6)

Datetime [y,m,d,h,m,s]

integer, intent(in) :: ref_year

Reference year

Return Value integer

Julian day

public function date_to_number(date_array, ref_year) result(res)

Returns a date number from an array with date and time

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: date_array(6)

Datetime [y,m,d,h,m,s]

integer, intent(in) :: ref_year

Reference year

Return Value real(kind=dp)

Date number in seconds since ref_year

public function day_of_week(date_array) result(res)

The subroutine calculates the day of week given current datetime, where DAYW = 1 corresponds to Monday and DAYW = 7 to Sunday. The algorithm is based on the tables in "Hvem Hva Hvor 1971" (p. 121) and is valid for all years from 1800 to infinity

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: date_array(6)

Datetime [y,m,d,h,m,s]

Return Value integer

Day of week [1-7]

public function summer_time_europe(date_array) result(summer_time)

Returns true if supplied date is during summer time in Europe, else false

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: date_array(6)

Datetime [y,m,d,h,m,s]

Return Value logical

True if summer time, else false


Subroutines

public subroutine date_to_datestr(date_array, format_str, date_str)

Returns a date string based on (yyyy.mm.dd HH:MM:SS) from a date array

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: date_array(6)

Datetime [y,m,d,h,m,s]

character(len=*), intent(in) :: format_str

Format string

character(len=*), intent(out) :: date_str

Date string

public subroutine date_to_datestr_bracket(date_array, in_format_str, out_a_str)

Converts a date array to a date string with brackets in format string

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: date_array(6)

Datetime [y,m,d,h,m,s]

character(len=*), intent(in) :: in_format_str

Format string

character(len=*), intent(out) :: out_a_str

Date string

private subroutine date_to_datestr_new(date_array, in_format_str, out_a_str)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: date_array(6)

Datetime [y,m,d,h,m,s]

character(len=*), intent(in) :: in_format_str

Format string

character(len=*), intent(out) :: out_a_str

Date string

public subroutine date_to_datestr_squarebracket(date_array, in_format_str, out_a_str)

Converts a date array to a date string with brackets in format string

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: date_array(6)
character(len=*), intent(in) :: in_format_str
character(len=*), intent(out) :: out_a_str

public subroutine datestr_to_date(date_str, format_str, date_array)

Converts date string to a date array based on the format string

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: date_str

Date string [yyyymmddHHMMSS]

character(len=*), intent(in) :: format_str

Format string

integer, intent(out) :: date_array(6)

Datetime [y,m,d,h,m,s]

public subroutine get_sun_angles(lat, lon, date_a, date_num, difutc_h, azimuth_ang, zenith_ang)

Returns the azimuth and zenith angles

Read more…

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: lat
real, intent(in) :: lon
integer, intent(in) :: date_a(6)
real(kind=dp), intent(in) :: date_num
real, intent(in) :: difutc_h
real, intent(out) :: azimuth_ang
real, intent(out) :: zenith_ang

public subroutine number_to_date(date_num, date_array, ref_year)

Returns array with date and time from a date number

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: date_num

Date number in seconds since ref_year

integer, intent(out) :: date_array(6)

Datetime [y,m,d,h,m,s]

integer, intent(in) :: ref_year

Reference year