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