1 subroutine da_xyll(proj, xx, yy, lat, lon)
3 !-----------------------------------------------------------------------
4 ! Purpose: Computes geographical latitude and longitude for a given (i,j)
5 ! point in a grid with a projection of proj
6 !-----------------------------------------------------------------------
10 type(proj_info), intent(in) :: proj
11 real, intent(in) :: xx
12 real, intent(in) :: yy
13 real, intent(out) :: lat
14 real, intent(out) :: lon
18 if (trace_use) call da_trace_entry("da_xyll")
20 if (.NOT.proj%init) then
21 call da_error(__FILE__,__LINE__, &
22 (/"You have not called map_set for this projection!"/))
28 select case (proj%code)
30 call da_xyll_latlon(x, y, proj, lat, lon)
33 x = xx - proj%knowni + 1.0
34 y = yy - proj%knownj + 1.0
35 call da_xyll_merc(x, y, proj, lat, lon)
38 call da_xyll_ps(x, y, proj, lat, lon)
42 x = xx - proj%knowni + 1.0
43 y = yy - proj%knownj + 1.0
44 call da_xyll_lc(x, y, proj, lat, lon)
47 write(unit=message(1),fmt='(A,I2)') &
48 "Unrecognized map projection code: ", proj%code
49 call da_error(__FILE__,__LINE__,message(1:1))
53 if (trace_use) call da_trace_exit("da_xyll")
55 end subroutine da_xyll