da_get_reglats.inc
References to this file elsewhere.
1 subroutine da_get_reglats( nj, 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(out) :: lat(1:nj) ! Latitude(radians, from south).
11 real, intent(out) :: sinlat(1:nj) ! sin(Latitude).
12 real, intent(out) :: coslat(1:nj) ! cos(Latitude).
13 real, intent(out) :: int_wgts(1:nj) ! Legendre Integration weights.
14
15 integer :: j ! Loop counter.
16 real :: delta_phi ! Regular latitude interval.
17
18 if (trace_use) call da_trace_entry("da_get_reglats")
19
20 delta_phi = pi / real(nj-1)
21
22 do j = 1, nj / 2
23 lat(j) = -0.5 * pi + delta_phi * real(j - 1)
24 sinlat(j) = sin(lat(j))
25 coslat(j) = cos(lat(j))
26 int_wgts(j) = coslat(j) * delta_phi
27
28 ! use symmetry for northern hemisphere:
29 lat(nj+1-j) = -lat(j)
30 sinlat(nj+1-j) = -sinlat(j)
31 coslat(nj+1-j) = coslat(j)
32 int_wgts(nj+1-j) = int_wgts(j)
33 end do
34
35 if ((nj+1) / 2 == nj/2 + 1) then ! Odd, then equator point:
36 lat(nj/2+1) = 0.0
37 sinlat(nj/2+1) = 0.0
38 coslat(nj/2+1) = 1.0
39 int_wgts(nj/2+1) = delta_phi
40 end if
41
42 if (trace_use) call da_trace_exit("da_get_reglats")
43
44 end subroutine da_get_reglats
45
46