Evaluates sound speed profile at given location
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=8), | intent(in) | :: | x(2) | |||
real(kind=8), | intent(in) | :: | t(2) | |||
real(kind=8), | intent(out) | :: | c | |||
real(kind=8), | intent(out) | :: | cimag | |||
real(kind=8), | intent(out) | :: | gradc(2) | |||
real(kind=8), | intent(out) | :: | crr | |||
real(kind=8), | intent(out) | :: | crz | |||
real(kind=8), | intent(out) | :: | czz | |||
real(kind=8), | intent(out) | :: | rho | |||
real(kind=8), | intent(in) | :: | freq | |||
character(len=3), | intent(in) | :: | Task |
SUBROUTINE EvaluateSSP( x, t, c, cimag, gradc, crr, crz, czz, rho, freq, Task ) !! Evaluates sound speed profile at given location ! Call the particular profil routine indicated by the SSP%Type and perform Task ! Task = 'TAB' then tabulate cp, cs, rhoT ! Task = 'INI' then initialize REAL (KIND=8), INTENT( IN ) :: freq REAL (KIND=8), INTENT( IN ) :: x( 2 ) ! r-z coordinate where SSP is to be evaluated REAL (KIND=8), INTENT( IN ) :: t( 2 ) ! ray tangent; for edge cases of updating segments CHARACTER ( LEN=3), INTENT( IN ) :: Task REAL (KIND=8), INTENT( OUT ) :: c, cimag, gradc( 2 ), crr, crz, czz, rho REAL (KIND=8) :: gradc_3d( 3 ), cxx, cyy, cxy, cxz, cyz REAL (KIND=8) :: x3( 3 ), t3( 3 ) SELECT CASE ( SSP%Type ) CASE ( 'N' ) ! N2-linear profile option CALL n2Linear( x, t, c, cimag, gradc, crr, crz, czz, rho, freq, Task ) CASE ( 'C' ) ! C-linear profile option CALL cLinear( x, t, c, cimag, gradc, crr, crz, czz, rho, freq, Task ) CASE ( 'P' ) ! monotone PCHIP ACS profile option CALL cPCHIP( x, t, c, cimag, gradc, crr, crz, czz, rho, freq, Task ) CASE ( 'S' ) ! Cubic spline profile option CALL cCubic( x, t, c, cimag, gradc, crr, crz, czz, rho, freq, Task ) CASE ( 'Q' ) CALL Quad( x, t, c, cimag, gradc, crr, crz, czz, rho, freq, Task ) CASE ( 'H' ) IF ( Task == 'TAB' ) THEN WRITE( PRTFile, * ) 'BELLHOP: EvaluateSSP: Hexahedral is not a valid SSP in 2D mode' CALL ERROUT( 'BELLHOP: EvaluateSSP', 'Hexahedral is not a valid SSP in 2D mode') END IF ! this is called by BELLHOP3D only once, during READIN ! possibly the logic should be changed to call EvaluateSSP2D or 3D x3 = [ 0.0D0, 0.0D0, x( 2 ) ] t3 = [ 0.0D0, 0.0D0, t( 2 ) ] CALL Hexahedral( x3, t3, c, cimag, gradc_3d, cxx, cyy, czz, cxy, cxz, cyz, rho, freq, Task ) CASE ( 'A' ) ! Analytic profile option CALL Analytic( x, t, c, cimag, gradc, crr, crz, czz, rho ) CASE DEFAULT WRITE( PRTFile, * ) 'Profile option: ', SSP%Type CALL ERROUT( 'BELLHOP: EvaluateSSP', 'Invalid profile option' ) END SELECT END SUBROUTINE EvaluateSSP