-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathqshksh.f
51 lines (51 loc) · 1.21 KB
/
qshksh.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
subroutine qshksh(hk,z,n,rsite)
implicit none
c
integer n
double precision z
double complex hk(2,2)
logical rsite
c
include 'qsglobal.h'
c
double complex cx,cem,cch,csh
c
if(rsite)then
cx=ksrs(n)*dcmplx(2.d0*z,0.d0)
if(z.gt.0.d0)then
cem=cdexp(-cx)
cch=(0.5d0,0.d0)*((1.d0,0.d0)+cem)
csh=(0.5d0,0.d0)*((1.d0,0.d0)-cem)
else
cem=cdexp(cx)
cch=(0.5d0,0.d0)*((1.d0,0.d0)+cem)
csh=-(0.5d0,0.d0)*((1.d0,0.d0)-cem)
endif
c
c propagator matrix for SH waves
c
hk(1,1)=cch
hk(1,2)=csh/(cmurs(n)*ksrs(n))
hk(2,1)=csh*cmurs(n)*ksrs(n)
hk(2,2)=cch
else
cx=ks(n)*dcmplx(2.d0*z,0.d0)
if(z.gt.0.d0)then
cem=cdexp(-cx)
cch=(0.5d0,0.d0)*((1.d0,0.d0)+cem)
csh=(0.5d0,0.d0)*((1.d0,0.d0)-cem)
else
cem=cdexp(cx)
cch=(0.5d0,0.d0)*((1.d0,0.d0)+cem)
csh=-(0.5d0,0.d0)*((1.d0,0.d0)-cem)
endif
c
c propagator matrix for SH waves
c
hk(1,1)=cch
hk(1,2)=csh/(cmu(n)*ks(n))
hk(2,1)=csh*cmu(n)*ks(n)
hk(2,2)=cch
endif
return
end