da_llxy_latlon_new.inc

References to this file elsewhere.
1 subroutine da_llxy_latlon_new(proj, info)
2 
3    !----------------------------------------------------------------------- 
4    ! Purpose: Compute the x/y location of a lat/lon on a LATLON grid.
5    !-----------------------------------------------------------------------
6 
7    implicit none
8 
9    type(proj_info), intent(in)    :: proj
10    type(infa_type), intent(inout) :: info
11 
12    integer :: n
13 
14    if (trace_use) call da_trace_entry("da_llxy_latlon_new")
15 
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
19 
20    ! Compute the difference between the input lat/lon and the origin lat/lon
21 
22    info%y(1,:) = (info%lat(1,:) - proj%lat1)/proj%truelat1 + 1.0
23 
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
28    elsewhere
29       info%x(1,:) = (info%lon(1,:) - proj%lon1)/proj%stdlon + 1.0
30    end where
31 
32    do n=1,ubound(info%x,2)
33       info%x(:,n) = info%x(1,n)
34       info%y(:,n) = info%y(1,n)
35    end do
36 
37    if (trace_use) call da_trace_exit("da_llxy_latlon_new")
38 
39 end subroutine da_llxy_latlon_new
40 
41