Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
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