da_latlon_to_ij.inc
References to this file elsewhere.
1 subroutine da_latlon_to_ij(proj, lat, lon, i, j)
2
3 !-----------------------------------------------------------------------
4 ! Purpose: Converts input lat/lon values to the cartesian (i,j) value
5 ! for the given projection.
6 !-----------------------------------------------------------------------
7
8 implicit none
9 type(proj_info), intent(in) :: proj
10 real, intent(in) :: lat
11 real, intent(in) :: lon
12 real, intent(out) :: i
13 real, intent(out) :: j
14
15 if (.NOT.proj%init) then
16 call da_error(__FILE__,__LINE__, &
17 (/"You have not called map_set for this projection!"/))
18 end if
19
20 select case(proj%code)
21
22 case(PROJ_LATLON)
23 call da_llij_latlon(lat,lon,proj,i,j)
24
25 case(PROJ_MERC)
26 call da_llij_merc(lat,lon,proj,i,j)
27 i = i + proj%knowni - 1.0
28 j = j + proj%knownj - 1.0
29
30 case(PROJ_PS)
31 call da_llij_ps(lat,lon,proj,i,j)
32
33 case(PROJ_LC)
34 call da_llij_lc(lat,lon,proj,i,j)
35 i = i + proj%knowni - 1.0
36 j = j + proj%knownj - 1.0
37
38 case default
39 write(unit=message(1),fmt='(A,I2)') &
40 'Unrecognized map projection code: ', proj%code
41 call da_error(__FILE__,__LINE__,message(1:1))
42 end select
43
44 end subroutine da_latlon_to_ij
45
46