RayNormal Subroutine

public subroutine RayNormal(t, phi, c, e1, e2)

Arguments

Type IntentOptional Attributes Name
real(kind=8), intent(in) :: t(3)
real(kind=8), intent(in) :: phi
real(kind=8), intent(in) :: c
real(kind=8), intent(out) :: e1(3)
real(kind=8), intent(out) :: e2(3)

Called by

proc~~raynormal~~CalledByGraph proc~raynormal RayNormal proc~influence3dgeogaussianraycen Influence3DGeoGaussianRayCen proc~influence3dgeogaussianraycen->proc~raynormal proc~influence3dgeohatraycen Influence3DGeoHatRayCen proc~influence3dgeohatraycen->proc~raynormal proc~reflect3d Reflect3D proc~reflect3d->proc~raynormal proc~step3d Step3D proc~step3d->proc~raynormal proc~bellhopcore BellhopCore proc~bellhopcore->proc~influence3dgeogaussianraycen proc~bellhopcore->proc~influence3dgeohatraycen proc~traceray3d TraceRay3D proc~bellhopcore->proc~traceray3d proc~traceray3d->proc~reflect3d proc~traceray3d->proc~step3d program~bellhop3d BELLHOP3D program~bellhop3d->proc~bellhopcore

Source Code

  SUBROUTINE RayNormal( t, phi, c, e1, e2 )

    ! Computes the ray normals

    REAL (KIND=8), INTENT( IN  ) :: t( 3 )             ! tangent vector (NOT normalized)
    REAL (KIND=8), INTENT( IN  ) :: phi                ! torsion
    REAL (KIND=8), INTENT( IN  ) :: c                  ! sound speed
    REAL (KIND=8), INTENT( OUT ) :: e1( 3 ), e2( 3 )   ! ray unit normals

    RL = NORM2( t( 1 : 2 ) )

    IF ( phi /= 0 ) THEN
       !  e1
       e1( 1 ) = ( c * t( 1 ) * t( 3 ) * COS( phi ) + t( 2 ) * SIN( phi ) ) / RL
       e1( 2 ) = ( c * t( 2 ) * t( 3 ) * COS( phi ) - t( 1 ) * SIN( phi ) ) / RL
       e1( 3 ) = -c * RL * COS( phi )

       !  e2
       e2( 1 ) = ( c * t( 1 ) * t( 3 ) * SIN( phi ) - t( 2 ) * COS( phi ) ) / RL
       e2( 2 ) = ( c * t( 2 ) * t( 3 ) * SIN( phi ) + t( 1 ) * COS( phi ) ) / RL
       e2( 3 ) = -c * RL * SIN( phi )
    ELSE
       e1 = [ c * t( 1 ) * t( 3  ) / RL, c * t( 2 ) * t( 3 ) / RL, -c * RL ]
       e2 = [ -t( 2 ) / RL,              t( 1 ) / RL,              0.0D0   ]
    END IF

    RETURN
  END SUBROUTINE RayNormal