lambert2lb_uEMEP Subroutine

private subroutine lambert2lb_uEMEP(x, y, gl, gb, lon0, lat0)

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: x
real, intent(in) :: y
real, intent(out) :: gl
real, intent(out) :: gb
real, intent(in) :: lon0
real, intent(in) :: lat0

Source Code

    subroutine lambert2lb_uEMEP(x, y, gl, gb, lon0, lat0)
        real, intent(in) ::x, y, lon0, lat0
        real, intent(out)::gl, gb
        real ::r, t
        real :: earth_radius, k, F, y0

        earth_radius = 6371000.0

        k = sin(PI/180.0*lat0)
        F = earth_radius*cos(PI/180.0*lat0) * (tan(PI/4.0 + PI/360.0*lat0)**k)/k
        y0 = F*tan(PI/4.0 - PI/360.0*lat0)**k
        r = sqrt(x*x + (y0 - y)*(y0 - y))
        t = atan(x/(y0 - y))
        gb = 2.0*180.0/PI*atan((F/r)**(1.0/k)) - 90.0
        gl = lon0 + 180.0/PI*t/k
    end subroutine lambert2lb_uEMEP