-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgettdonejk.f90
247 lines (177 loc) · 6.83 KB
/
gettdonejk.f90
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
!=====================================================================
! UTILITY gettdonejk
!=====================================================================
! get 'tmat.done' file from 'zarm.tma'
!---------------------------------------------------------------------
Use target; Use channels; Use tm_list
Implicit real(8) (A-H,O-Z)
Real(8), allocatable :: matr(:),mati(:)
Real(8) :: eps_e = 1.d-7
Call Inf_sub
!----------------------------------------------------------------------
! ... target information:
! ... read channel information:
nut=1; Open(nut,file='target',status='OLD')
Call R_target (nut)
Call R_channels(nut)
Close(nut)
ion = nz-nelc; zion=1.d0; if(ion.gt.1) zion=ion*ion
! ... define transition and energy under consideration:
itr1=1; Call Read_iarg('itr1',itr1)
itr2=1; Call Read_iarg('itr2',itr2)
ek1=0.d0; Call Read_rarg('ek1',ek1)
ek2=0.d0; Call Read_rarg('ek2',ek2)
Call Read_rarg('eps_e',eps_e)
!----------------------------------------------------------------------
! ... define input file and parameters:
in = 1; Open(in,file='zarm.tma',status='OLD')
E1=(ETARG(itr1)-ETARG(1))*2; E2=(ETARG(itr2)-ETARG(1))*2;
JT1 = jtarg(itr1)-1; JT2 = jtarg(itr2)-1
ip1=0; ip2=0
! ... allocations:
mtr = mch*(mch+1)/2; Allocate(matr(mtr),mati(mtr))
!----------------------------------------------------------------------
! ... define T-matrix elements:
jj_max = 0; ee_max = 0.d0
rewind(in)
1 read(in,*,end=2) ee,nopen,ntr,ii
read(in,*) (matr(i),mati(i),i=1,ntr)
write(*,*) ii
if(ek1.gt.0.d0.and.ee.lt.ek1) go to 1
if(ek2.gt.0.d0.and.ee.gt.ek2) go to 1
jj = jpar(ii)-1; ipp = (-ipar(ii)+1)/2
if(jj_max.lt.jj) jj_max = jj
if(ee_max.lt.ee) ee_max = ee
Do i = 1,nch(ii); if(iptar(ii,i).ne.itr2) Cycle
Do j = 1,i; if(iptar(ii,j).ne.itr1) Cycle
ktr = (i-1)*i/2+j; if(ktr.gt.ntr) Stop 'ktr > ntr'
lch1=lch(ii,j); lch2=lch(ii,i)
kk1= jkch(ii,j)-1; kk2=jkch(ii,i)-1
Call Fano_tma(lch1,lch2,matr(ktr),mati(ktr),ar,ai)
Call Add_tm_list(ee,ar,ai,jj,ipp,lch1,lch2,kk1,kk2)
if(itr1.eq.itr2.and.i.ne.j) &
Call Add_tm_list(ee,ar,ai,jj,ipp,lch2,lch1,kk2,kk1)
End do; End do
go to 1
2 Close(in)
!----------------------------------------------------------------------
! ... output:
Call Def_io(jj_max,ee_max)
Call Sort_tm_list
!======================================================================
if(Icheck_file('T_extra').ne.0) then
open(in,file='T_extra')
Do k=1,kcase
read(in,*) ee,j1,j2,i1,i2,i3,i4,t1,t2,jj,s1,s2
Do jj=j1,j2,2
lch1 = (jj + jo(2,k))/2
lch2 = (jj + jo(3,k))/2
kk1 = jj + jo(4,k)
kk2 = jj + jo(5,k)
t1=t1*s1; t2=t2*s2
iip = mod(lch1,2)
Call Add_tm_list(ee,t1,t2,jj,ipp,lch1,lch2,kk1,kk2)
End do
End do
end if
! Call Sort_tm_list
!======================================================================
iout = 3; Open(iout,file='tmat.done')
ne=1
Do i=2,ndata; ee = EK(i)
m=1
Do j=1,i-1;if(abs(ee-EK(j)).lt.1.d-7) then; m=0; Exit; end if; End do
ne = ne + m
End do
kk = ndata/ne
write(*,*) 'ndata,ne*kk,ne,kk =',ndata,ne*kk,ne,kk
write(iout,'(8I5,2D15.7)') itr1,itr2,JT1,JT2,ip1,ip2,ndata,ne,E1,E2
Do i=1,ndata
a=1.d0; b=1.d0
if(i.gt.1) then
if(io(i-1).eq.io(i)) then
a=TR(i)/TR(i-1)
b=TI(i)/TI(i-1)
end if
end if
write(iout,'(D15.7,6I5,2D15.7,i3,2f10.5)') &
EK(i),jjpar(i),ip(i), &
l1(i),jk1(i),l2(i),jk2(i),TR(i),TI(i), &
io(i),a,b
End do
Close(iout)
End ! UTILITY gettdonejk
!=========================================================================
Subroutine Def_io(jj,ee)
!=========================================================================
! ... define parameters different symmetries in T-matrix elements
! ... for partial wave with total JJ and energy ee
!-------------------------------------------------------------------------
Use tm_list
Implicit none
Integer :: i,j,k, jj
Real(8) :: ee
! ... define number of cases:
k=0
Do i=1,ndata
if(jjpar(i).ne.jj) Cycle
if(EK(i).ne.ee) Cycle
k=k+1
End do
kcase = k
! ... define case pattens
Allocate(jo(5,k))
k=0
Do i=1,ndata
if(jjpar(i).ne.jj) Cycle
if(EK(i).ne.ee) Cycle
k=k+1
jo(1,k) = ip(i)
jo(2,k) = 2*l1(i) - jj
jo(3,k) = 2*l2(i) - jj
jo(4,k) = jk1(i) - jj
jo(5,k) = jk2(i) - jj
End do
! ... define case index:
io = 0
Do i=1,ndata
if(jjpar(i).lt.2) Cycle
Do j=1,k
! if(ip(i).ne.jo(1,j)) Cycle
if(2*l1(i)-jjpar(i).ne.jo(2,j)) Cycle
if(2*l2(i)-jjpar(i).ne.jo(3,j)) Cycle
if(jk1(i)-jjpar(i).ne.jo(4,j)) Cycle
if(jk2(i)-jjpar(i).ne.jo(5,j)) Cycle
io(i)=j
Exit
End do
if(io(i).eq.0) Stop 'Unknown case'
End do
End Subroutine Def_io
!======================================================================
Subroutine inf_sub
!======================================================================
! provide screen information about add_farm utility
!----------------------------------------------------------------------
Character :: A
iarg = command_argument_count()
if(iarg.eq.0) Return
Call GET_COMMAND_ARGUMENT(1,A)
if(A.ne.'?'.and.A.ne.'!') Return
write(*,'(a)') &
' ',&
' gettdonejk utility generates "tmat.done" file in JK-coupling ',&
' based on the T-matrix elements given in "zarm.tma" file ',&
' obtained with BSR in the JK-coupling, to be able to use them ',&
' in the program MJK ',&
' ',&
' zarm.tma + target -> tmat.done ',&
' ',&
' Call as: gettdonejk itr1=.. itr2=.. ek1=.. ek2-.. eps_e=.. ',&
' ',&
' itr1, itr2 - transition itr1 -> itr2 ',&
' ek1, ek2 - range of electron energy ',&
' eps_e - energy tolerance ',&
' '
Stop ' '
End Subroutine inf_sub