1 subroutine da_llxy_merc_new(proj, info)
3 !-----------------------------------------------------------------------
4 ! Purpose: Compute x/y coordinate from lat lon for mercator projection
5 !-----------------------------------------------------------------------
9 type(proj_info), intent(in) :: proj
10 type(infa_type), intent(inout) :: info
15 if (trace_use) call da_trace_entry("da_llxy_merc_new")
19 ! where (lon(:,:) - proj%lon1 < -180.0)
20 ! x(:,:) = 1.0 + (lon(:,:) - proj%lon1 + 360.0)/(proj%dlon*deg_per_rad))
21 ! elsewhere (lon(:,:) - proj%lon1 > 180.0)
22 ! x(:,:) = 1.0 + (lon(:,:) - proj%lon1 - 360.0)/(proj%dlon*deg_per_rad))
24 ! x(:,:) = 1.0 + (lon(:,:) - proj%lon1)/(proj%dlon*deg_per_rad))
27 ! y(:,:) = 1.0 + (ALOG(TAN(0.5*((lat(:,: + 90.0) * rad_per_deg)))) / proj%dlon - proj%rsw
31 do n=lbound(info%lat,2),ubound(info%lat,2)
32 deltalon = info%lon(1,n) - proj%lon1
33 if (deltalon < -180.0) deltalon = deltalon + 360.0
34 if (deltalon > 180.0) deltalon = deltalon - 360.0
35 info%x(:,n) = 1.0 + (deltalon/(proj%dlon*deg_per_rad))
36 info%y(:,n) = 1.0 + (ALOG(TAN(0.5*((info%lat(1,n) + 90.0) * rad_per_deg)))) / proj%dlon - proj%rsw
39 if (trace_use) call da_trace_exit("da_llxy_merc_new")
42 end subroutine da_llxy_merc_new