da_xyll_merc.inc

References to this file elsewhere.
1 subroutine da_xyll_merc(x, y, proj, lat, lon)
2 
3    !-----------------------------------------------------------------------
4    ! Compute the lat/lon from i/j for mercator projection
5    !-----------------------------------------------------------------------
6 
7    implicit none
8 
9    real,intent(in)               :: x
10    real,intent(in)               :: y    
11    type(proj_info),intent(in)    :: proj
12    real, intent(out)             :: lat
13    real, intent(out)             :: lon 
14 
15    if (trace_use_frequent) call da_trace_entry("da_xyll_merc")
16 
17    lat = 2.0*ATAN(EXP(proj%dlon*(proj%rsw + y-1.0)))*deg_per_rad - 90.0
18    lon = (x-1.0)*proj%dlon*deg_per_rad + proj%lon1
19    if (lon > 180.0) lon = lon - 360.0
20    if (lon < -180.0) lon = lon + 360.0
21 
22    if (trace_use_frequent) call da_trace_exit("da_xyll_merc")
23 
24 end subroutine da_xyll_merc
25 
26