barker Function

private pure function barker(r1, r2, mu)

Barker time of flight equation

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(3) :: r1
real(kind=wp), intent(in), dimension(3) :: r2
real(kind=wp), intent(in) :: mu

Return Value real(kind=wp)


Source Code

    pure function barker(r1, r2, mu)

    implicit none

    real(wp),dimension(3),intent(in) :: r1
    real(wp),dimension(3),intent(in) :: r2
    real(wp),intent(in) :: mu
    real(wp) :: barker

    real(wp) :: x, r1mag, r2mag, r21mag, sigma, r1pr2mag
    real(wp),dimension(3) :: r21

    r1mag    = norm2(r1)
    r2mag    = norm2(r2)
    r21      = r2 - r1
    r21mag   = norm2(r21)
    x        = r1(1) * r2(2) - r1(2) * r2(1)
    sigma    = sign(one,x)
    r1pr2mag = r1mag + r2mag

    barker = (r1pr2mag + r21mag)**1.5_wp - &
             sigma * (r1pr2mag - r21mag)**1.5_wp / (six * sqrt(mu))

    end function barker