time_day_length Subroutine

public subroutine time_day_length(daylen, ida, mb, pit, ylc, yls)

Arguments

Type IntentOptional AttributesName
real(kind=dp), intent(out), dimension(:):: daylen
integer, intent(in) :: ida
integer, intent(in) :: mb
real(kind=dp), intent(in) :: pit
real(kind=dp), intent(in), dimension(:):: ylc
real(kind=dp), intent(in), dimension(:):: yls

Called by

proc~~time_day_length~~CalledByGraph proc~time_day_length time_day_length proc~time_process_day time_process_day proc~time_process_day->proc~time_day_length proc~time_process_month time_process_month proc~time_process_month->proc~time_process_day proc~time_process_years time_process_years proc~time_process_years->proc~time_process_month program~swim swim program~swim->proc~time_process_years

Contents

Source Code


Source Code

  subroutine time_day_length(daylen, ida, mb, pit, ylc, yls)
    integer, intent(in) :: ida
    integer, intent(in) :: mb
    real(dp), intent(in) :: pit
    real(dp), dimension(:), intent(in) :: ylc
    real(dp), dimension(:), intent(in) :: yls
    real(dp), dimension(:), intent(out) :: daylen
    integer k
    real(dp) ch, h, sd, xi
    !**** CALC day length (from clgen)
    do k = 1, mb
      xi = ida
      sd = .4102 * sin((xi - 80.25) / pit)
      ch = - yls(k) * tan(sd) / ylc(k)
      if (ch .lt. 1.) then
        if (ch .le. - 1.) then
          h = 3.1416
        else
          h = acos(ch)
        end if
      else
        h = 0.
      end if
      daylen(k) = 7.72 * h
    end do
  end subroutine time_day_length