da_set_ps.inc
References to this file elsewhere.
1 subroutine da_set_ps(proj)
2
3 ! Initializes a polar-stereographic map projection from the partially
4 ! filled proj structure. This routine computes the radius to the
5 ! southwest corner and computes the i/j location of the pole for use
6 ! in llij_ps and ijll_ps.
7
8 implicit none
9
10 type(proj_info), intent(inout) :: proj
11
12 real :: ala1
13 real :: alo1
14 real :: reflon
15 real :: scale_top
16
17 if (trace_use) call da_trace_entry("da_set_ps")
18
19 ! To define the cone factor for polar stereographic projection
20 proj%cone = 1.0
21
22 reflon = proj%stdlon + 90.0
23
24 ! Compute numerator term of map scale factor
25 scale_top = 1.0 + proj%hemi * Sin(proj%truelat1 * rad_per_deg)
26
27 ! Compute radius to lower-left (SW) corner
28 ala1 = proj%lat1 * rad_per_deg
29 proj%rsw = proj%rebydx*COS(ala1)*scale_top/(1.0+proj%hemi*Sin(ala1))
30
31 ! Find the pole point
32 alo1 = (proj%lon1 - reflon) * rad_per_deg
33 proj%polei = proj%knowni - proj%rsw * COS(alo1)
34 proj%polej = proj%knownj - proj%hemi * proj%rsw * Sin(alo1)
35 if (print_detail_map) then
36 write(unit=stdout,fmt='(A,2F10.1)') 'Computed (I,J) of pole point: ',proj%polei,proj%polej
37 end if
38
39 if (trace_use) call da_trace_exit("da_set_ps")
40
41 end subroutine da_set_ps
42
43