1 subroutine da_xyll_latlon(x, y, proj, lat, lon)
3 !-----------------------------------------------------------------------
4 ! Purpose: Compute the lat/lon location of an x/y on a LATLON grid.
5 !-----------------------------------------------------------------------
11 type(proj_info), intent(in) :: proj
12 real, intent(out) :: lat
13 real, intent(out) :: lon
21 if (trace_use_frequent) call da_trace_entry("da_xyll_latlon")
23 loninc = proj%dx*360.0/(2.0*EARTH_RADIUS_M*PI)
24 latinc = proj%dx*360.0/(2.0*EARTH_RADIUS_M*PI)
26 deltalon = (x - proj%knowni) * loninc
27 deltalat = (y - proj%knownj) * latinc
29 lon360 = deltalon + proj%lon1
30 lat = deltalat + proj%lat1
32 if ((ABS(lat) > 90.0).OR.(ABS(deltalon) > 360.0)) then
33 ! Off the earth for this grid; THIS SHOULD NEVER HAPPEN
37 lon = MOD(lon360,360.0)
38 if (lon > 180.0) lon = lon - 360.0
41 if (trace_use_frequent) call da_trace_exit("da_xyll_latlon")
43 end subroutine da_xyll_latlon