lonlat_2_ABI_XY Subroutine

public subroutine lonlat_2_ABI_XY(lon, lat, lambda0, x, y, mask)

Arguments

Type IntentOptional Attributes Name
real(kind=REAL64), intent(in) :: lon
real(kind=REAL64), intent(in) :: lat
real(kind=REAL64), intent(in) :: lambda0
real(kind=REAL64), intent(out) :: x
real(kind=REAL64), intent(out) :: y
integer, intent(out) :: mask

Called by

proc~~lonlat_2_abi_xy~~CalledByGraph proc~lonlat_2_abi_xy lonlat_2_ABI_XY proc~test_conversion test_conversion proc~test_conversion->proc~lonlat_2_abi_xy

Source Code

  subroutine lonlat_2_ABI_XY (lon, lat, lambda0, x, y, mask)
    implicit none
    real(REAL64), intent(in) :: lon, lat
    real(REAL64), intent(in) :: lambda0
    real(REAL64), intent(out):: x, y
    integer, intent(out):: mask
    real(REAL64) :: theta_c
    real(REAL64) :: e2, rc, Sx, Sy, Sz, t
    real(REAL64) :: a, b, H
    real*8 :: delta

    a=r_eq; b=r_pol; H=H_sat

    theta_c = atan( (b/a)**2.d0 * tan(lat) )
    e2 = 1.d0 - (b/a)**2.d0       ! (a^2-b^2)/a^2
    rc = b / sqrt( 1.d0 - e2 * cos(theta_c)**2.d0 )
    Sx = H - rc * cos(theta_c) * cos( lon - lambda0 )
    Sy =   - rc * cos(theta_c) * sin( lon - lambda0 )
    Sz =     rc * sin(theta_c)
    x  = - asin ( Sy / sqrt (Sx*Sx + Sy*Sy + Sz*Sz) )
    y  =   atan ( Sz / Sx )

    t = H*(H-Sx) - ( Sy*Sy + (a/b)**2.d0 *Sz*Sz )
    if (t < 0) then
       mask = 1
    else
       mask = 0
    end if

  end subroutine lonlat_2_ABI_XY