SPEED
GET_DIME_EXPL.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine get_dime_expl (xipo, yipo, zipo, x1, y1, z1, x2, y2, z2, x3, y3, z3, nnod, xs, ys, zs, node_expl, nnloc)
 Computes local number of nodes where explosive source is imposed.
 

Function/Subroutine Documentation

◆ get_dime_expl()

subroutine get_dime_expl ( real*8  xipo,
real*8  yipo,
real*8  zipo,
real*8  x1,
real*8  y1,
real*8  z1,
real*8  x2,
real*8  y2,
real*8  z2,
real*8  x3,
real*8  y3,
real*8  z3,
integer*4  nnod,
real*8, dimension(nnloc)  xs,
real*8, dimension(nnloc)  ys,
real*8, dimension(nnloc)  zs,
integer*4  node_expl,
integer*4  nnloc 
)

Computes local number of nodes where explosive source is imposed.

Author
Ilario Mazzieri
Date
September, 2013
Version
1.0
Parameters
[in]Xipox-coordinate of Hypocenter
[in]Yipoy-coordinate of Hypocenter
[in]Zipoz-coordinate of Hypocenter
[in]X1vertex coordinate (x) of the triangular fault
[in]Y1vertex coordinate (y) of the triangular fault
[in]Z1vertex coordinate (z) of the triangular fault
[in]X2vertex coordinate (x) of the triangular fault
[in]Y2vertex coordinate (y) of the triangular fault
[in]Z2vertex coordinate (z) of the triangular fault
[in]X3vertex coordinate (x) of the triangular fault
[in]Y3vertex coordinate (y) of the triangular fault
[in]Z3vertex coordinate (z) of the triangular fault
[in]nnodnumber of local nodes
[in]xsx-coordinate of spectral nodes
[in]ysy-coordinate of spectral nodes
[in]zsz-coordinate of spectral nodes
[in]nnloc(obsolete)
[out]node_expllocal number of explosive nodes

Definition at line 42 of file GET_DIME_EXPL.f90.

48
49 implicit none
50
51 integer*4 :: nnod,node_expl,nnloc
52 integer*4 :: isn
53
54 real*8 :: xipo,yipo,zipo,x1,y1,z1,x2,y2,z2,x3,y3,z3,ux,uy,uz,vx,vy,vz,tol
55 real*8 :: xmax,xmin,ymax,ymin,zmin,zmax,a,b,c, den
56 real*8, dimension(nnloc) :: xs,ys,zs
57
58 node_expl = 0
59 tol = 5.0d0
60
61 ux=(x1-x2)/sqrt((x1-x2)**2+(y1-y2)**2+(z1-z2)**2)
62 uy=(y1-y2)/sqrt((x1-x2)**2+(y1-y2)**2+(z1-z2)**2)
63 uz=(z1-z2)/sqrt((x1-x2)**2+(y1-y2)**2+(z1-z2)**2)
64 vx=(x3-x2)/sqrt((x3-x2)**2+(y3-y2)**2+(z3-z2)**2)
65 vy=(y3-y2)/sqrt((x3-x2)**2+(y3-y2)**2+(z3-z2)**2)
66 vz=(z3-z2)/sqrt((x3-x2)**2+(y3-y2)**2+(z3-z2)**2)
67
68 a = uy * vz - uz * vy
69 b = uz * vx - ux * vz
70 c = ux * vy - uy * vx
71 den = sqrt(a**2 + b**2 + c**2)
72
73 !Check on the relative position of fault end points
74 !In this preliminary part we check if P1 point is the lower-left fault point or not
75 !If this check would fail the two points are swapped
76
77 xmax=max(x1,x2,x3)+tol
78 xmin=min(x1,x2,x3)-tol
79 ymax=max(y1,y2,y3)+tol
80 ymin=min(y1,y2,y3)-tol
81 zmax=max(z1,z2,z3)+tol
82 zmin=min(z1,z2,z3)-tol
83
84
85 do isn = 1,nnod
86 if ( dabs( a*(xs(isn)-xipo) + b*(ys(isn)-yipo) + c*(zs(isn)-zipo)/den ).le.tol) then
87 if ((xs(isn).ge.xmin).and.(xs(isn).le.xmax)) then
88 if ((ys(isn).ge.ymin).and.(ys(isn).le.ymax)) then
89 if ((zs(isn).ge.zmin).and.(zs(isn).le.zmax)) then
90 node_expl = node_expl+1
91 endif
92 endif
93 endif
94 endif
95 enddo
96
97 return