da_llij_merc.inc

References to this file elsewhere.
1 subroutine da_llij_merc(lat, lon, proj, i, j)
2 
3    !-----------------------------------------------------------------------
4    ! Purpose: Compute i/j coordinate from lat lon for mercator projection
5    !-----------------------------------------------------------------------
6   
7    implicit none
8 
9    real, intent(in)              :: lat
10    real, intent(in)              :: lon
11    type(proj_info),intent(in)    :: proj
12    real,intent(out)              :: i
13    real,intent(out)              :: j
14    real                          :: deltalon
15 
16    deltalon = lon - proj%lon1
17    if (deltalon < -180.0) deltalon = deltalon + 360.0
18    if (deltalon > 180.0) deltalon = deltalon - 360.0
19    i = 1. + (deltalon/(proj%dlon*deg_per_rad))
20    j = 1. + (ALOG(TAN(0.5*((lat + 90.0) * rad_per_deg)))) / &
21            proj%dlon - proj%rsw
22 
23 end subroutine da_llij_merc
24 
25