is_leap_year Function

public pure function is_leap_year(y)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: y

Return Value logical


Called by

proc~~is_leap_year~2~~CalledByGraph proc~is_leap_year~2 is_leap_year proc~get_month_ends get_month_ends proc~get_month_ends->proc~is_leap_year~2 proc~test_is_leap_year test_is_leap_year proc~test_is_leap_year->proc~is_leap_year~2 proc~get_month_end get_month_end proc~get_month_end->proc~get_month_ends proc~test_get_month_ends test_get_month_ends proc~test_get_month_ends->proc~get_month_ends proc~is_valid_date~2 is_valid_date proc~is_valid_date~2->proc~get_month_end proc~test_get_month_end test_get_month_end proc~test_get_month_end->proc~get_month_end proc~parse_date parse_date proc~parse_date->proc~is_valid_date~2 proc~test_is_valid_date test_is_valid_date proc~test_is_valid_date->proc~is_valid_date~2

Source Code

   pure logical function is_leap_year(y)
      integer, intent(in) :: y
      ! Leap years are years divisible by 400 or (years divisible by 4 and not divisible by 100)
      is_leap_year = (400 .divides. y) .or. ((4 .divides. y) .and. .not. (100 .divides. y))
   end function is_leap_year