-
Notifications
You must be signed in to change notification settings - Fork 1
/
Coupling.f90
executable file
·283 lines (283 loc) · 15.1 KB
/
Coupling.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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
!***********************************************************************
!
PROGRAM Coupling
! *
! Written by G. Gaigalas, *
! NIST Oct 2015 *
! *
!***********************************************************************
!-----------------------------------------------
! M o d u l e s
!-----------------------------------------------
use Coupling_constants
use Coupling_structures
use Coupling_main
implicit none
!-----------------------------------------------
! L o c a l V a r i a b l e s
!-----------------------------------------------
character(len=50) :: log_file
character(len=24) :: NAME
character(len=2) :: note
character(len=13) :: couplings
real(kind=dp) :: thresh
integer :: print_level,K
!-----------------------------------------------
print *, " "
print *, &
"Coupling: Transformation of ASFs from a LS-coupled CSF basis"
print *, &
" into differete coupled CSF bases (Fortran 95)"
print *, &
" (C) (2022) G. Gaigalas, A. Kramida."
print *, " "
print *, &
"Input files: *.lsj.c, *.lsj.j (ATSP (CPC) or GRASP2K types)"
print *, &
"Output files: *.coup*.*.lbl, *.coup*.sum"
print *, " "
print *, " "
1 WRITE (*,*) 'Name of state'
READ(*,'(A)') NAME
K=INDEX(NAME,' ')
IF (K.EQ.1) THEN
WRITE (*,*) 'Names may not start with a blank'
GOTO 1
ENDIF
call get_parameters &
(couplings,NAME,print_level,note,thresh)
call open_files(couplings,NAME,print_level)
call GLCONS
call FACTRL(32)
call main(1, couplings, print_level,thresh)
!GG call store_R_values(iwrite_log, note,couplings)
call store_P_values(iwrite_log, note,couplings)
call iseiti
print *, " "
write(*,*)'Coupling: Execution complete.'
!
contains
!
!***********************************************************************
! *
subroutine get_parameters(couplings,NAME,print_level,note,thresh)
! *
! This subroutine asks the user for some parameters: *
! couplings, *
! printing level, *
! note (for the R_values, and P_values output), *
! input data file names. *
! *
! Written by G. Gaigalas, *
! NIST last update: Oct 2015 *
! *
!***********************************************************************
!-----------------------------------------------
! D u m m y A r g u m e n t s
!-----------------------------------------------
character(len=24), intent(in) :: NAME
character(len=13), intent(out) :: couplings
character(len=2), intent(out) :: note
character(len=4) :: jval
integer, intent(out) :: print_level
real(kind=dp), intent(out) :: thresh
!-----------------------------------------------
print_level=1
note='No'
! write(*,*)'Specify the data source 1-mchf '
! write(*,*)'mchf'
! write(*,*)'Specify the print level : 0, 1 or 2'
! read(*,'(i1)')print_level
write(*,*)'Default settings ? (Y/N)'
read(*,'(a1)') note
if(note(1:1) == 'Y' .or. note(1:1) == 'y') then
print_level = 0
else
print_level = 2
end if
note=' '
write (*,*) &
'Specify the number of coupled shells for evaluation (1,2 or 3):'
read(*,'(i1)') I_Numb
! write (*,*) ' ',I_Numb
write (*,'(I2)') I_Numb
symbol_I_Numb = jval(2*I_Numb)
log_file=NAME(1:K-1)//'.coup'//symbol_I_Numb(1:1)//'.sum'
open(iwrite_log, file=log_file, status='unknown')
write(iwrite_log,*) " -------------------------------"
write(iwrite_log,*) " Summry file of program COUPLING"
write(iwrite_log,*) " -------------------------------"
write(iwrite_log,*) ""
write(iwrite_log,*) &
"The CSF input file: ",NAME(1:K-1)//'.lsj.c'
write(iwrite_log,*) &
"The mixing coefficient input file: ",NAME(1:K-1)//'.lsj.j'
write(iwrite_log,*) "There are",I_Numb, &
"(in LS-coupling) coupled shells case."
if (I_Numb == 1) then
couplings='ynnnnnnnnnynn'
else if (I_Numb == 2) then
couplings='yyyynnnnnynyn'
else if (I_Numb ==3) then
couplings='ynnnyyyyynnny'
else
write(*,*) &
'Not proper number of coupled shells for evaluation.'
stop
end if
write(iwrite_log,*) "Specification of couplings: ",couplings
write(iwrite_log,*) &
"(LS JJ LK JK LS3 LSJ3 LK3 JK3 cLSJ3 LScjj jj1 jj2 jj3)"
write(iwrite_log, &
'(3X,A1,4(2X,A1),3X,A1,4X,A1,3X,A1,4X,A1,4(4X,A1))') &
couplings(1:1),couplings(2:2),couplings(3:3),couplings(4:4), &
couplings(5:5),couplings(6:6),couplings(7:7),couplings(8:8), &
couplings(9:9),couplings(10:10),couplings(11:11), &
couplings(12:12),couplings(13:13)
write (*,*) &
'What is the value below which an eigenvector composition'
write (*,*) 'is to be neglected for printing?'
READ *, thresh
write (*,*) ' ',thresh
write(iwrite_log,*) ""
write(iwrite_log,*) &
'The value below which an eigenvector composition'
write(iwrite_log,*) 'is to be neglected for printing:',thresh
write(iwrite_log,*) ""
end subroutine get_parameters
!
!***********************************************************************
! *
subroutine open_files(couplings,NAME,print_level)
! *
! This subroutine opens the files of input and output *
! *
! Written by G. Gaigalas, *
! NIST last update: Oct 2015 *
! *
!***********************************************************************
!-----------------------------------------------
! D u m m y A r g u m e n t s
!-----------------------------------------------
character(len=13), intent(in) :: couplings
character(len=24), intent(in) :: NAME
integer, intent(in) :: print_level
!-----------------------------------------------
! L o c a l V a r i a b l e s
!-----------------------------------------------
character(len=50) :: suggestions_file
!print_level 1
character(len=50) :: classifications_file
character(len=50) :: classifications_evaluation_file
character(len=50) :: expansions_file
!print_level 2
character(len=50) :: log_file2
character(len=50) :: cfg_lsjj_file,cfg_lslk_file,cfg_lsjk_file
character(len=51) :: cfg_lsls3_file,cfg_lslsj3_file,cfg_lslk3_file
character(len=51) :: cfg_lsjk3_file,cfg_lsclsj3_file
character(len=51) :: cfg_lslscjj_file,cfg_lsjj123_file
integer :: K
!-----------------------------------------------
! write(*,*) 'open_files'
!
K=INDEX(NAME,' ')
log_file2 = 'log2.coup'
!
cfg_lsjj_file ='ASF_expansions_lsJJ.coup'
cfg_lslk_file ='ASF_expansions_lslk.coup'
cfg_lsjk_file ='ASF_expansions_jjjk.coup'
cfg_lsls3_file ='ASF_expansions_lsls3.coup'
cfg_lslsj3_file ='ASF_expansions_lslsj3.coup'
cfg_lslk3_file ='ASF_expansions_lslk3.coup'
cfg_lsjk3_file ='ASF_expansions_lsjk3.coup'
cfg_lsclsj3_file ='ASF_expansions_lsclsj3.coup'
cfg_lslscjj_file ='ASF_expansions_lslscjj.coup'
cfg_lsjj123_file ='ASF_expansions_lsjj.coup'
!
expansions_file='ASF_expansions.coup'
!
classifications_file='All_classifications.coup'
classifications_evaluation_file='States_classif_evaluations.coup'
!
open(iread_csf, file=NAME(1:K-1)//'.lsj.c',status='old')
open(iread_coefs, file=NAME(1:K-1)//'.lsj.j',status='old')
if(print_level > 3) then
suggestions_file= &
NAME(1:K-1)//'.coup'//symbol_I_Numb(1:1)//'.Suggest'
open(iwrite_suggestions,file=suggestions_file,status='unknown')
end if
if(couplings(1:1).eq.'y') &
open(iwrite_DataBase_LS, file=NAME(1:K-1)//'.coup'//symbol_I_Numb(1:1)//'.LS.lbl',status='unknown')
if(couplings(2:2).eq.'y') &
open(iwrite_DataBase_JJ,file=NAME(1:K-1)//'.coup'//symbol_I_Numb(1:1)//'.JJ.lbl',status='unknown')
if(couplings(3:3).eq.'y') &
open(iwrite_DataBase_LK,file=NAME(1:K-1)//'.coup'//symbol_I_Numb(1:1)//'.LK.lbl',status='unknown')
if(couplings(4:4).eq.'y') &
open(iwrite_DataBase_JK,file=NAME(1:K-1)//'.coup'//symbol_I_Numb(1:1)//'.JK.lbl',status='unknown')
if(couplings(5:5).eq.'y') &
open(iwrite_DataBase_LS3,file=NAME(1:K-1)//'.coup'//symbol_I_Numb(1:1)//'.LS3.lbl',status='unknown')
if(couplings(6:6).eq.'y') &
open(iwrite_DataBase_LSJ3,file=NAME(1:K-1)//'.coup'//symbol_I_Numb(1:1)//'.LSJ3.lbl',status='unknown')
if(couplings(7:7).eq.'y') &
open(iwrite_DataBase_LK3,file=NAME(1:K-1)//'.coup'//symbol_I_Numb(1:1)//'.LK3.lbl',status='unknown')
if(couplings(8:8).eq.'y') &
open(iwrite_DataBase_JK3,file=NAME(1:K-1)//'.coup'//symbol_I_Numb(1:1)//'.JK3.lbl',status='unknown')
if(couplings(9:9).eq.'y') &
open(iwrite_DataBase_cLSJ3,file=NAME(1:K-1)//'.coup'//symbol_I_Numb(1:1)//'.cLSJ3.lbl',status='unknown')
if(couplings(10:10).eq.'y') &
open(iwrite_DataBase_LScjj,file=NAME(1:K-1)//'.coup'//symbol_I_Numb(1:1)//'.LScjj.lbl',status='unknown')
if(couplings(11:11).eq.'y') &
open(iwrite_DataBase_jj123,file=NAME(1:K-1)//'.coup'//symbol_I_Numb(1:1)//'.jj.lbl',status='unknown')
if(couplings(12:12).eq.'y') &
open(iwrite_DataBase_jj123,file=NAME(1:K-1)//'.coup'//symbol_I_Numb(1:1)//'.jj.lbl',status='unknown')
if(couplings(13:13).eq.'y') &
open(iwrite_DataBase_jj123,file=NAME(1:K-1)//'.coup'//symbol_I_Numb(1:1)//'.jj.lbl',status='unknown')
if(print_level.gt.0) then
open(iwrite_expansions, file=expansions_file, status='unknown')
open(iwrite_classifications, file=classifications_file, &
status='unknown')
open(iwrite_classifications_evaluations, &
file=classifications_evaluation_file, status='unknown')
if(print_level.gt.1) then
if(couplings(2:2).eq.'y') &
open(iwrite_cfg_expansions_JJ, file=cfg_lsjj_file, &
status='unknown')
if(couplings(3:3).eq.'y') &
open(iwrite_cfg_expansions_LK, file=cfg_lslk_file, &
status='unknown')
if(couplings(4:4).eq.'y') &
open(iwrite_cfg_expansions_JK, file=cfg_lsjk_file, &
status='unknown')
if(couplings(5:5).eq.'y') &
open(iwrite_cfg_expansions_LS3, file=cfg_lsls3_file, &
status='unknown')
if(couplings(6:6).eq.'y') &
open(iwrite_cfg_expansions_LSJ3, file=cfg_lslsj3_file, &
status='unknown')
if(couplings(7:7).eq.'y') &
open(iwrite_cfg_expansions_LK3, file=cfg_lslk3_file, &
status='unknown')
if(couplings(8:8).eq.'y') &
open(iwrite_cfg_expansions_JK3, file=cfg_lsjk3_file, &
status='unknown')
if(couplings(9:9).eq.'y') &
open(iwrite_cfg_expansions_cLSJ3, file=cfg_lsclsj3_file, &
status='unknown')
if(couplings(10:10).eq.'y') &
open(iwrite_cfg_expansions_LScjj, file=cfg_lslscjj_file, &
status='unknown')
if(couplings(11:11).eq.'y') &
open(iwrite_cfg_expansions_jj123, file=cfg_lsjj123_file, &
status='unknown')
if(couplings(12:12).eq.'y') &
open(iwrite_cfg_expansions_jj123, file=cfg_lsjj123_file, &
status='unknown')
if(couplings(13:13).eq.'y') &
open(iwrite_cfg_expansions_jj123, file=cfg_lsjj123_file, &
status='unknown')
end if
end if
! write(*,*) 'end open_files'
end subroutine open_files
!
end program Coupling