Returns true if supplied date is during summer time in Europe, else false
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | date_array(6) |
Datetime [y,m,d,h,m,s] |
True if summer time, else false
function summer_time_europe(date_array) result(summer_time) !! Returns true if supplied date is during summer time in Europe, else false integer, intent(in) :: date_array(6) !! Datetime [y,m,d,h,m,s] logical :: summer_time !! True if summer time, else false ! Local variables integer :: a(6), b_start(6), b_end(6) integer :: ref_year, year real(dp) :: datenum_start, datenum_end, datenum a = date_array ref_year = 2000 b_start = 0 b_end = 0 year = a(1) b_start(1) = a(1) b_start(2) = 3 b_start(3) = (31 - mod((((5 * year)/4) + 4), 7)) b_start(4) = 1 b_end(1) = a(1) b_end(2) = 10 b_end(3) = (31 - mod((((5 * year)/4) + 1), 7)) b_end(4) = 1 datenum_start = date_to_number(b_start, ref_year) datenum_end = date_to_number(b_end, ref_year) datenum = date_to_number(a, ref_year) summer_time = .false. if (datenum .ge. datenum_start .and. datenum .lt. datenum_end) summer_time = .true. end function summer_time_europe