UpdateDepthSegmentT Subroutine

public subroutine UpdateDepthSegmentT(x, t)

Arguments

Type IntentOptional Attributes Name
real(kind=8), intent(in) :: x(2)
real(kind=8), intent(in) :: t(2)

Called by

proc~~updatedepthsegmentt~~CalledByGraph proc~updatedepthsegmentt UpdateDepthSegmentT proc~ccubic cCubic proc~ccubic->proc~updatedepthsegmentt proc~clinear cLinear proc~clinear->proc~updatedepthsegmentt proc~cpchip cPCHIP proc~cpchip->proc~updatedepthsegmentt proc~n2linear n2Linear proc~n2linear->proc~updatedepthsegmentt proc~quad Quad proc~quad->proc~updatedepthsegmentt proc~evaluatessp EvaluateSSP proc~evaluatessp->proc~ccubic proc~evaluatessp->proc~clinear proc~evaluatessp->proc~cpchip proc~evaluatessp->proc~n2linear proc~evaluatessp->proc~quad proc~evaluatessp3d EvaluateSSP3D proc~evaluatessp3d->proc~ccubic proc~evaluatessp3d->proc~clinear proc~evaluatessp3d->proc~n2linear proc~bellhopcore BellhopCore proc~bellhopcore->proc~evaluatessp3d proc~influencecervenycart InfluenceCervenyCart proc~bellhopcore->proc~influencecervenycart proc~traceray3d TraceRay3D proc~bellhopcore->proc~traceray3d proc~traceray2d TraceRay2D proc~bellhopcore->proc~traceray2d proc~bellhopcore~2 BellhopCore proc~bellhopcore~2->proc~evaluatessp proc~bellhopcore~2->proc~influencecervenycart proc~traceray2d~2 TraceRay2D proc~bellhopcore~2->proc~traceray2d~2 proc~evaluatessp2d EvaluateSSP2D proc~evaluatessp2d->proc~evaluatessp3d proc~influencecervenycart->proc~evaluatessp proc~readenvironment ReadEnvironment proc~readenvironment->proc~evaluatessp proc~reflect2d~2 Reflect2D proc~reflect2d~2->proc~evaluatessp proc~reflect3d Reflect3D proc~reflect3d->proc~evaluatessp3d proc~step2d Step2D proc~step2d->proc~evaluatessp proc~step3d Step3D proc~step3d->proc~evaluatessp3d proc~traceray2d~2->proc~evaluatessp proc~traceray2d~2->proc~reflect2d~2 proc~traceray2d~2->proc~step2d proc~reflect2d Reflect2D proc~reflect2d->proc~evaluatessp2d proc~step2d~2 Step2D proc~step2d~2->proc~evaluatessp2d proc~traceray3d->proc~reflect3d proc~traceray3d->proc~step3d program~bellhop BELLHOP program~bellhop->proc~bellhopcore~2 program~bellhop->proc~readenvironment program~bellhop3d BELLHOP3D program~bellhop3d->proc~bellhopcore program~bellhop3d->proc~readenvironment proc~traceray2d->proc~reflect2d proc~traceray2d->proc~step2d~2

Source Code

  SUBROUTINE UpdateDepthSegmentT( x, t )
     REAL (KIND=8), INTENT(IN) :: x( 2 ), t( 2 )

     ! LP: Handles edge cases based on which direction the ray is going. If the
     ! ray takes a small step in the direction of t, it will remain in the same
     ! segment as it is now.

     IF ( t( 2 ) >= 0.0 ) THEN
        ! SSP%z( iSegz ) <= x( 2 ) < SSP%z( iSegz + 1 )
        DO WHILE ( x( 2 ) < SSP%z( iSegz ) .AND. iSegz > 1 )
           iSegz = iSegz - 1
        END DO
        DO WHILE ( x( 2 ) >= SSP%z( iSegz + 1 ) .AND. iSegz < SSP%Npts-1 )
           iSegz = iSegz + 1
        END DO
     ELSE
        ! SSP%z( iSegz ) < x( 2 ) <= SSP%z( iSegz + 1 )
        DO WHILE ( x( 2 ) > SSP%z( iSegz + 1 ) .AND. iSegz < SSP%Npts-1 )
           iSegz = iSegz + 1
        END DO
        DO WHILE ( x( 2 ) <= SSP%z( iSegz ) .AND. iSegz > 1 )
           iSegz = iSegz - 1
        END DO
     ENDIF

  END SUBROUTINE UpdateDepthSegmentT