Coverage Report: Cone.f90

Generated from GCOV analysis of Fortran source code

0.0%
Lines Executed
28 total lines
0.0%
Branches Executed
0 total branches
0.0%
Calls Executed
0 total calls
0
-
Source:Cone.f90
0
-
Graph:Cone.gcno
0
-
Data:Cone.gcda
0
-
Runs:29
1
-
!! Cone-shaped beam calculations for 3D acoustics
2
-
3
-
MODULE Cone
4
-
!! Provides cone formulas for 3D beam computations
5
-
6
-
USE bellhopMod
7
-
USE MathConstants
8
-
9
-
IMPLICIT NONE
10
-
PUBLIC
11
-
12
-
CONTAINS
13
-
14
#####
SUBROUTINE ConeFormulas2D( z_xx, z_xy, z_yy, nBdry, xs, tradial, xray, BotTop )
15
-
!! analytic formula for the conical seamount
16
-
17
-
REAL (KIND=8), INTENT( IN ) :: xs( 3 ), tradial( 2 ), xray( 2 )
18
-
CHARACTER (LEN=3), INTENT( IN ) :: BotTop ! Flag indicating bottom or top reflection
19
-
REAL (KIND=8), INTENT( OUT ) :: z_xx, z_xy, z_yy, nBdry( 2 )
20
-
REAL (KIND=8) :: nBdry3dCone( 3 ), theta, phi, Rray, Radius, x, y ! for cone reflection
21
-
22
#####
IF ( BotTop == 'BOT' ) THEN
23
#####
phi = 15 * DegRad ! 15 degree angle of seamount
24
#####
Rray = xray( 1 ) ! cylindrical range of ray from source
25
-
26
-
! get bearing from cone to ray using (x,y) coordinate of the ray
27
#####
x = xs( 1 ) + Rray * tradial( 1 )
28
#####
y = xs( 2 ) + Rray * tradial( 2 )
29
#####
theta = atan2( y, x )
30
-
31
#####
nBdry3dCone = [ -cos( theta ) * sin( phi ), -sin( theta ) * sin( phi ), cos( phi ) ]
32
-
33
-
! nBdry3dCone = -[ -cos( theta ) * tan( phi ), -sin( theta ) * tan( phi ), 1.0D0 ]
34
-
! nBdry3dCone = -[ ray2D( is )%x( 1 ), ray2D( is )%x( 2 ), -1.0D0 ]
35
-
! nBdry3dCone = NBdry3dCone / NORM2( NBdry3dCone )
36
-
37
#####
nBdry( 1 ) = DOT_PRODUCT( nBdry3dCone( 1 : 2 ), tradial )
38
#####
nBdry( 2 ) = nBdry3dCone( 3 )
39
-
40
-
! curvatures
41
#####
Radius = SQRT( x ** 2 + y ** 2 ) ! radius of seamount at the bounce point
42
-
43
-
! z = z_xx / 2 * x^2 + z_xy * xy + z_yy / 2 * y^2; coefs are the kappa matrix
44
-
45
#####
z_xx = y * y / Radius**3 * tan( phi )
46
#####
z_xy = - x * y / Radius**3 * tan( phi )
47
#####
z_yy = x * x / Radius**3 * tan( phi )
48
-
END IF
49
#####
END SUBROUTINE ConeFormulas2D
50
-
51
#####
SUBROUTINE ConeFormulas3D( z_xx, z_xy, z_yy, nBdry, xs, xray, BotTop )
52
-
!! analytic formula for the conical seamount
53
-
54
-
REAL (KIND=8), INTENT( IN ) :: xs( 3 ), xray( 3 )
55
-
CHARACTER (LEN=3), INTENT( IN ) :: BotTop ! Flag indicating bottom or top reflection
56
-
REAL (KIND=8), INTENT( OUT ) :: z_xx, z_xy, z_yy, nBdry( 3 )
57
-
REAL (KIND=8) :: theta, phi, Radius, x, y, RLen
58
-
59
#####
IF ( BotTop == 'BOT' ) THEN
60
#####
phi = 15 * DegRad ! 15 degree angle of seamount
61
-
62
#####
x = xray( 1 )
63
#####
y = xray( 2 )
64
-
65
#####
theta = atan2( y, x ) ! bearing from origin (center of cone) to ray
66
-
! could write the folowing in terms of x, y, and z ...
67
#####
nBdry = [ -cos( theta ) * sin( phi ), -sin( theta ) * sin( phi ), cos( phi ) ] ! unit normal to bdry
68
-
69
-
! curvatures
70
-
71
#####
Radius = SQRT( x ** 2 + y ** 2 ) ! radius of seamount at the bounce point
72
-
! z = z_xx / 2 * x^2 + z_xy * xy + z_yy * y^2 ! coefs are the kappa matrix
73
-
74
#####
RLen = SQRT( 1 + TAN( phi ) ** 2 ) ! 1 + fx^2 + fy^2
75
#####
z_xx = y * y / Radius**3 * tan( phi ) / RLen
76
#####
z_xy = - x * y / Radius**3 * tan( phi ) / RLen
77
#####
z_yy = x * x / Radius**3 * tan( phi ) / RLen
78
-
END IF
79
#####
END SUBROUTINE ConeFormulas3D
80
-
81
-
END MODULE CONE
82
-