da_get_reglats.inc
References to this file elsewhere.
1 subroutine da_get_reglats( nj, pi, lat, sinlat, coslat, int_wgts)
2
3 !-----------------------------------------------------------------------
4 ! Purpose: TBD
5 !-----------------------------------------------------------------------
6
7 implicit none
8
9 integer, intent(in) :: nj ! Number of latitudes
10 real, intent(in) :: pi ! pi
11 real, intent(out) :: lat(1:nj) ! Latitude(radians, from south).
12 real, intent(out) :: sinlat(1:nj) ! sin(Latitude).
13 real, intent(out) :: coslat(1:nj) ! cos(Latitude).
14 real, intent(out) :: int_wgts(1:nj) ! Legendre Integration weights.
15
16 integer :: j ! Loop counter.
17 real :: delta_phi ! Regular latitude interval.
18
19 delta_phi = pi / real(nj-1)
20
21 do j = 1, nj / 2
22 lat(j) = -0.5 * pi + delta_phi * real(j - 1)
23 sinlat(j) = sin(lat(j))
24 coslat(j) = cos(lat(j))
25 int_wgts(j) = coslat(j) * delta_phi
26
27 ! use symmetry for northern hemisphere:
28 lat(nj+1-j) = -lat(j)
29 sinlat(nj+1-j) = -sinlat(j)
30 coslat(nj+1-j) = coslat(j)
31 int_wgts(nj+1-j) = int_wgts(j)
32 end do
33
34 if ((nj+1) / 2 == nj/2 + 1) then ! Odd, then equator point:
35 lat(nj/2+1) = 0.0
36 sinlat(nj/2+1) = 0.0
37 coslat(nj/2+1) = 1.0
38 int_wgts(nj/2+1) = delta_phi
39 end if
40
41 end subroutine da_get_reglats
42
43