SPEED
READ_SISM.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine read_sism (xipo, yipo, zipo, x1, y1, z1, x2, y2, z2, x3, y3, z3, nnod, xs, ys, zs, num_ns, sour_ns, i_sism, dist_sour_ns, nl_sism, max_num_ns, loc_n_num, nn_loc, pos_sour_nx, pos_sour_ny, pos_sour_nz)
 Generates seismic triangular faults.
 

Function/Subroutine Documentation

◆ read_sism()

subroutine read_sism ( 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(nn_loc)  xs,
real*8, dimension(nn_loc)  ys,
real*8, dimension(nn_loc)  zs,
integer*4  num_ns,
integer*4, dimension(max_num_ns,nl_sism)  sour_ns,
integer*4  i_sism,
real*8, dimension(max_num_ns,nl_sism)  dist_sour_ns,
integer*4  nl_sism,
integer*4  max_num_ns,
integer*4, dimension(nn_loc)  loc_n_num,
integer*4  nn_loc,
real*8, dimension(max_num_ns,nl_sism)  pos_sour_nx,
real*8, dimension(max_num_ns,nl_sism)  pos_sour_ny,
  pos_sour_nz 
)

Generates seismic triangular faults.

Author
Ilario Mazzieri
Date
September, 2013
Version
1.0
Parameters
[in]XipoHipocenter x-coordinate
[in]YipoHipocenter y-coordinate
[in]ZipoHipocenter z-coordinate
[in]X1x-coordinate of the triangular fault 1-node
[in]Y1y-coordinate of the triangular fault 1-node
[in]Z1z-coordinate of the triangular fault 1-node
[in]X2x-coordinate of the triangular fault 2-node
[in]Y2y-coordinate of the triangular fault 2-node
[in]Z2z-coordinate of the triangular fault 2-node
[in]X3x-coordinate of the triangular fault 3-node
[in]Y3y-coordinate of the triangular fault 3-node
[in]Z3z-coordinate of the triangular fault 3-node
[in]xsx-coord local spectral nodes
[in]ysy-coord local spectral nodes
[in]zsz-coord local spectral nodes
[in]num_nsnumber of seismic nodes
[in]i_sismcolumn index for filling sour_ns
[in]nl_sismnumber of seismic loads
[in]nn_locnumber of local nodes
[in]nnodnumber of local nodes
[in]loc_n_numlocal node numeration
[in]max_nummax number of nodes for the specific triangular fault
[out]sour_nsinfo about seismic nodes
[out]dist_sour_nsdistance of seismic nodes in sour_ns

Definition at line 48 of file READ_SISM.f90.

57
58
59 implicit none
60
61 integer*4 :: i_sism,isn,i,nn_loc
62 integer*4 :: nnod,node_sism,num_ns,nl_sism,max_num_ns
63
64 integer*4, dimension(nn_loc) :: loc_n_num(nn_loc)
65
66 integer*4, dimension(max_num_ns,nl_sism) :: sour_ns
67
68 real*8 :: xipo,yipo,zipo,x1,y1,z1,x2,y2,z2,x3,y3,z3,x4,y4,z4,ux,uy,uz,vx,vy,vz,tol
69 real*8 :: p1x,p1y,p1z,p2x,p2y,p2z
70 real*8 :: epsilon, twopi, anglesum, costheta,m1,m2
71
72 real*8, dimension(nn_loc) :: xs,ys,zs
73 real*8, dimension(4) :: x,y,z
74
75 real*8, dimension(max_num_ns,nl_sism) :: dist_sour_ns
76 real*8, dimension(max_num_ns,nl_sism) :: pos_sour_nx,pos_sour_ny,pos_sour_nz
77
78 node_sism = 0
79
80 tol = 6.28
81 epsilon = 1.d-8
82 twopi = 6.283185307179586476925287
83
84 x(1) = x1
85 y(1) = y1
86 z(1) = z1
87
88 x(2) = x2
89 y(2) = y2
90 z(2) = z2
91
92 x(3) = x3
93 y(3) = y3
94 z(3) = z3
95
96 x(4) = x1
97 y(4) = y1
98 z(4) = z1
99
100
101 do isn = 1,nnod
102
103 anglesum = 0.0d0
104 do i = 1,3
105 p1x = x(i) - xs(isn)
106 p1y = y(i) - ys(isn)
107 p1z = z(i) - zs(isn)
108 p2x = x(i+1) - xs(isn)
109 p2y = y(i+1) - ys(isn)
110 p2z = z(i+1) - zs(isn)
111
112 m1 = dsqrt(p1x*p1x + p1y*p1y + p1z*p1z)
113 m2 = dsqrt(p2x*p2x + p2y*p2y + p2z*p2z)
114
115 if ((m1*m2).le.epsilon) then
116 anglesum = twopi
117 else
118 costheta = (p1x*p2x + p1y*p2y + p1z*p2z)/(m1*m2)
119 anglesum = anglesum + dacos(costheta)
120 endif
121 enddo
122
123 if (anglesum.ge.tol) then
124
125 node_sism = node_sism + 1
126 sour_ns(node_sism,i_sism) = loc_n_num(isn)
127 dist_sour_ns(node_sism,i_sism) = dsqrt((xipo - xs(isn))**2 +(yipo - ys(isn))**2 +(zipo - zs(isn))**2)
128 pos_sour_nx(node_sism,i_sism) = xs(isn)
129 pos_sour_ny(node_sism,i_sism) = ys(isn)
130 pos_sour_nz(node_sism,i_sism) = zs(isn)
131
132 endif
133
134 enddo
135
136
137 return