WriteRay3D Subroutine

public subroutine WriteRay3D(alpha0, beta0, Nsteps1)

The 3D version is for ray traces in (x,y,z) coordinates

Arguments

Type IntentOptional Attributes Name
real(kind=8), intent(in) :: alpha0
real(kind=8), intent(in) :: beta0
integer, intent(in) :: Nsteps1

Called by

proc~~writeray3d~~CalledByGraph proc~writeray3d WriteRay3D proc~applycontribution ApplyContribution proc~applycontribution->proc~writeray3d proc~applycontribution~2 ApplyContribution proc~applycontribution~2->proc~writeray3d proc~bellhopcore BellhopCore proc~bellhopcore->proc~writeray3d proc~influence3dgeogaussiancart Influence3DGeoGaussianCart proc~bellhopcore->proc~influence3dgeogaussiancart proc~influence3dgeogaussianraycen Influence3DGeoGaussianRayCen proc~bellhopcore->proc~influence3dgeogaussianraycen proc~influence3dgeohatcart Influence3DGeoHatCart proc~bellhopcore->proc~influence3dgeohatcart proc~influence3dgeohatraycen Influence3DGeoHatRayCen proc~bellhopcore->proc~influence3dgeohatraycen proc~influencegeogaussiancart InfluenceGeoGaussianCart proc~bellhopcore->proc~influencegeogaussiancart proc~influencegeohatcart InfluenceGeoHatCart proc~bellhopcore->proc~influencegeohatcart proc~influencegeohatraycen InfluenceGeoHatRayCen proc~bellhopcore->proc~influencegeohatraycen proc~influencesgb InfluenceSGB proc~bellhopcore->proc~influencesgb proc~influence3dgeogaussiancart->proc~applycontribution proc~influence3dgeogaussianraycen->proc~applycontribution proc~influence3dgeohatcart->proc~applycontribution proc~influence3dgeohatraycen->proc~applycontribution proc~influencegeogaussiancart->proc~applycontribution~2 proc~influencegeohatcart->proc~applycontribution~2 proc~influencegeohatraycen->proc~applycontribution~2 proc~influencesgb->proc~applycontribution~2 program~bellhop3d BELLHOP3D program~bellhop3d->proc~bellhopcore proc~bellhopcore~2 BellhopCore proc~bellhopcore~2->proc~influencegeogaussiancart proc~bellhopcore~2->proc~influencegeohatcart proc~bellhopcore~2->proc~influencegeohatraycen proc~bellhopcore~2->proc~influencesgb program~bellhop BELLHOP program~bellhop->proc~bellhopcore~2

Source Code

  SUBROUTINE WriteRay3D( alpha0, beta0, Nsteps1 )
    !! The 3D version is for ray traces in (x,y,z) coordinates

    INTEGER,       INTENT( IN ) :: Nsteps1
    REAL (KIND=8), INTENT( IN ) :: alpha0, beta0   ! take-off angle of this ray

    ! if Nx2D run, copy r-z rays to x-y-z rays

    IF ( Beam%RunType( 6 : 6 ) == '2' ) THEN
       ray3D%x( 1 )    = xs_3D( 1 ) + ray2D%x( 1 ) * COS( beta0 )
       ray3D%x( 2 )    = xs_3D( 2 ) + ray2D%x( 1 ) * SIN( beta0 )
       ray3D%x( 3 )    = ray2D%x( 2 )
       ray3D%NumTopBnc = ray2D%NumTopBnc
       ray3D%NumBotBnc = ray2D%NumBotBnc
    END IF

    ! compression
    ! LP: Besides the problems mentioned above in the 2D version, this also does
    ! nothing because iSkip is overridden to 1 below.

    N2    = 1
    iSkip = MAX( Nsteps1 / MaxNRayPoints, 1 )
    iSkip = 1

    Stepping: DO is = 2, Nsteps1
       ! ensure that we always write ray points near boundary reflections
       IF ( MIN( Bdry%Bot%HS%Depth - ray3D( is )%x( 3 ),  ray3D( is )%x( 3 ) - Bdry%Top%HS%Depth ) < 0.2 .OR. &
            MOD( is, iSkip ) == 0 .OR. is == Nsteps1 ) THEN
          N2 = N2 + 1
          ray3D( N2 )%x = ray3D( is )%x
       END IF
    END DO Stepping

    ! write to ray file

    WRITE( RAYFile, * ) alpha0
    WRITE( RAYFile, * ) N2, ray3D( Nsteps1 )%NumTopBnc, ray3D( Nsteps1 )%NumBotBnc

    DO is = 1, N2
       WRITE( RAYFile, * ) ray3D( is )%x
    END DO

  END SUBROUTINE WriteRay3D