1 subroutine da_llxy_latlon_new(proj, info)
3 !-----------------------------------------------------------------------
4 ! Purpose: Compute the x/y location of a lat/lon on a LATLON grid.
5 !-----------------------------------------------------------------------
9 type(proj_info), intent(in) :: proj
10 type(infa_type), intent(inout) :: info
14 if (trace_use) call da_trace_entry("da_llxy_latlon_new")
16 ! Extract the latitude and longitude increments for this grid
17 ! (e.g., 2.5 deg for NCEP reanalysis) from the proj structure, where
18 ! loninc is saved in the stdlon tag and latinc is saved in truelat1
20 ! Compute the difference between the input lat/lon and the origin lat/lon
22 info%y(1,:) = (info%lat(1,:) - proj%lat1)/proj%truelat1 + 1.0
24 ! To account for issues around the dateline, convert the incoming
25 ! longitudes to be 0->360.0
26 where (info%lon(1,:) < 0)
27 info%x(1,:) = (info%lon(1,:) + 360.0 - proj%lon1)/proj%stdlon + 1.0
29 info%x(1,:) = (info%lon(1,:) - proj%lon1)/proj%stdlon + 1.0
32 do n=1,ubound(info%x,2)
33 info%x(:,n) = info%x(1,n)
34 info%y(:,n) = info%y(1,n)
37 if (trace_use) call da_trace_exit("da_llxy_latlon_new")
39 end subroutine da_llxy_latlon_new