53 subroutine assign (nshl, ndist, nused, refcon, excon, qnstor, nx, nftw)
65 use congen_data,
only :
ntcon,
test,
nrcon,
nobt,
nst,
nshsym,
nobi,
ift,
occshl, pqn =>
pqnst, sshl =>
sshlst,
qnshlr
68 integer,
dimension(nobt) :: excon
69 integer,
dimension(*) :: qnstor
70 integer,
dimension(nobt,max(ntcon,1)) :: refcon
72 intent (out) nused, qnstor
73 intent (inout) excon,
ndist
75 integer,
save :: allow, i, ic, it, ita, itest, j, ks, kss, mrun, mt, nav, navm1, ndrop, nrep, nshrun, nt
89 do while (nshrun /=
nshl)
93 if (mrun == sshl(i))
then
122 qnshlr(ks) >= pqn(2,kss) .and. &
123 qnshlr(kss) <= pqn(3,ks))
go to 200
126 if (ks <
nshl)
go to 100
142 nt = excon(i) - refcon(i,ic)
143 nrep = abs(nt) + nrep
145 if (
test(ic) /= 1)
then
150 itest = itest +
test(ic)
153 if (allow == 0 .and. itest /= 0)
go to 200
157 if (ndrop +
nshl >= navm1)
then
158 write(
nftw,
'("1",31("*"),/," ",31("*"),"STORAGE OVERFLOW IN ASSIGN:",I8, " WORDS AVAILABLE")')
nx
170 200
do while (ks > 0)
174 if (
qnshlr(ks) <= pqn(3,ks))
go to 120
197 subroutine cgcoef (j1, j2, j3, m3, n, ms, c, intpfg)
199 use precisn,
only : wp
200 use consts,
only : xzero, xone
203 integer :: intpfg, j1, j2, j3, m3, n
204 real(kind=wp),
dimension(*) :: c
205 integer,
dimension(2,*) :: ms
206 intent (in) intpfg, j1, j2, j3, m3
207 intent (inout) c, ms, n
209 real(kind=wp) :: a, b, t
210 integer :: i, i1, i2, ii, jj, js, lb, lb1, lb2, lbh, lbl, m, m1, m2
211 integer,
dimension(3) :: j, k, l
213 js = (j1 + j2 + j3 - 1) / 2
222 if (j3 - 1 < abs(m - 1))
return
223 if (any(k < 0))
return
225 l(3) = (j3 + m3 - 2) / 2
230 if (abs(m2 - 1) <= j2 - 1)
then
235 l(2) = (j2 + m2 - 2) / 2
241 i1 = max(l(1) - k(1), l(2) - k(3), 0)
242 i2 = min(l(1), l(2), k(2))
245 lbl =
ind(k(2) + 1) + i1
246 lbh =
ind(k(2) + 1) + i2
247 lb1 =
ind(k(1) + 1) + l(1) - i1
248 lb2 =
ind(k(3) + 1) + l(2) - i1
255 c(n) = b * t * (-xone)**i2
256 if (abs(c(n)) <=
thresh1) n = n - 1
261 if (intpfg /= 0)
then
262 write(
nftw,
'(" CGCOEF : CLEBSCH-GORDAN COEFFICIENTS FOR")')
263 write(
nftw,
'(" J1 =",I4," J2 =",I4," J3 =",I4," M3 =",I4,/)') j1, j2, j3, m3
264 write(
nftw,
'(/(E25.15,2I5))') (c(i), ms(1,i), ms(2,i), i=1,n)
289 subroutine getsa (ne, l, is, isz, m, nc, c, iso)
291 use precisn,
only : wp
292 use consts,
only : one => xone
295 integer :: is, isz, l, m, nc,
ne
296 real(kind=wp),
dimension(*) :: c
297 integer,
dimension(*) :: iso
298 intent (in) is, isz, l, m,
ne
309 if (m < 0) iso(1) = iso(1) + 2
311 else if (
ne == 2)
then
317 if (isz + m /= 1)
then
319 iso(1) = 1 - (l + l) / m
323 iso(1) = (3 - isz) / 4
334 if (is == 1) c(2) = -
root2
374 subroutine getsm (ne, isz, nc, c, iso)
376 use precisn,
only : wp
377 use consts,
only : one => xone
379 integer :: isz, nc, ne
380 real(kind=wp),
dimension(*) :: c
381 integer,
dimension(*) :: iso
383 intent (out) c, iso, nc
389 if (ne == 1) iso(1) = 1 - isz / 2
416 subroutine getso (ns, intpfg, nti, iqns, ci, nd, id, cd, last)
418 use precisn,
only : wp
421 integer :: intpfg, last, nd, ns, nti
422 real(kind=wp),
dimension(*) :: cd, ci
423 integer,
dimension(*) :: id
424 integer,
dimension(2,ns,*) :: iqns
425 intent (in) ci, intpfg, iqns, last, ns, nti
426 intent (inout) cd, id, nd
428 real(kind=wp),
dimension(100) :: c
429 real(kind=wp),
dimension(ns) :: cs
430 integer :: i, ie1, ie2, is, isz, iti, kc, ke, kso, ld, ld1, ld2, ml, nc
431 integer,
dimension(200) :: iso
432 integer,
dimension(150) :: jso
433 integer,
dimension(ns+1) :: lc, lso
434 integer,
dimension(ns) :: lcs, lsos
437 if (intpfg /= 0)
then
438 write(
nftw,
'(" GETSO : NTI =",I10,/," IQNS :",/)') nti
440 write(
nftw,
'(20I5)') (iqns(1,is,iti), is=1,ns)
441 write(
nftw,
'(20I5)') (iqns(2,is,iti), is=1,ns)
457 call getsa (nes(is), ms(is), iqn(1,is), isz, ml, nc, c(kc), iso(kso))
459 call getsm (nes(is), isz, nc, c(kc), iso(kso))
464 kso = kso + nc * nes(is)
476 if (nes(is) == 0)
go to 415
487 t = cs(is) * c(lcs(is))
488 lcs(is) = lcs(is) + 1
490 if (is <= ns)
go to 300
494 write(
nftw,
'("0storage overflow")')
509 if (lcs(is) < lc(is + 1))
go to 400
514 if (intpfg /= 0)
then
515 write(
nftw,
'(" GETSO : ND =",I6,/," CD, ID :",/)') nd
520 write(
nftw,
'(E25.15,20I5)') cd(i), (id(ld), ld=ld1,ld2)
574 subroutine cplea (nncsf, nadel, x, nftw)
576 use iso_c_binding,
only : c_loc, c_f_pointer
577 use precisn,
only : wp
578 use congen_data,
only :
lg,
next,
nx,
icdi,
iexcon,
indi,
inodi,
iqnstr,
irfcon,
ndel,
confpf,
ndist,
nshl, &
579 nstate,
occshl,
mshl,
gushl,
cup,
qnshl,
spnmin,
kslim,
mclim,
shlmx1,
qntot, &
583 real(wp),
dimension(*),
target :: x
584 integer,
dimension(:),
pointer :: int_ptr, irfcon_ptr, iexcon_ptr, iqnstr_ptr, nodi_ptr, ndi_ptr, ndel_ptr, nnext_ptr
585 integer,
dimension(2,3,lg) :: qntmp
587 integer :: gutry, i, idumm, iidis1, iidist, iocc, kc, kclim, kcs, kcsp, ks, &
588 m, mtry, nav, nnext, nused, shl1, shl2, spntry, z1=1
590 real(wp),
pointer :: x_ptr
600 if (
gushl(i) > 0) cycle
601 if (iand(
occshl(i), z1) /= 0) gutry = -gutry
603 if (gutry /=
gutot)
return
609 if (
gutot /= 0 ) m = m + m
612 spntry = spntry + iocc
613 mtry = mtry + iocc *
mshl(i)
615 if (spntry >
qntot(1))
return
616 if (mtry -
qntot(2) > 0 .or. iand(mtry -
qntot(2), z1) /= 0)
return
632 if (
gutot /= 0) m = m + m
639 mtry = mtry +
mshl(i)
647 mtry = mtry -
mshl(i)
654 if (
kslim(2,ks) == 1)
go to 120
660 if (ks <
nshl)
go to 100
662 if (spntry <
qntot(1) .or. mtry <
qntot(2))
go to 600
665 if (kclim /= 0)
go to 300
675 qntmp(1,2,kc) = abs(
qnshl(2,shl1) -
qnshl(2,shl2))
681 if (qntmp(1,1,kc) == qntmp(1,2,kc))
go to 320
683 if (qntmp(1,2,kc) /= 0)
go to 320
688 if (kc < kclim)
go to 300
696 if (
qnshl(2,kcs) /=
qntot(2) .and. qntmp(1,2,kc) /=
qntot(2))
go to 500
699 if (qntmp(1,1,kc) /= 0)
go to 420
700 qnshl(3,kcs) = qntmp(2,1,kc)
705 420
if (
qntar(1) >= 0)
then
707 if (kcs == 3) kcsp = 1
713 if (
nstate /= 1)
go to 400
716 x_ptr => x(
irfcon) ;
call c_f_pointer (c_loc(x_ptr), irfcon_ptr, (/1/))
717 x_ptr => x(
iexcon) ;
call c_f_pointer (c_loc(x_ptr), iexcon_ptr, (/1/))
718 x_ptr => x(
iqnstr) ;
call c_f_pointer (c_loc(x_ptr), iqnstr_ptr, (/1/))
730 if (
nndel /= 0)
go to 405
736 x_ptr => x(
inodi) ;
call c_f_pointer (c_loc(x_ptr), nodi_ptr, (/1/))
737 x_ptr => x(
indi) ;
call c_f_pointer (c_loc(x_ptr), ndi_ptr, (/1/))
738 x_ptr => x(
ndel) ;
call c_f_pointer (c_loc(x_ptr), ndel_ptr, (/1/))
739 x_ptr => x(
iqnstr) ;
call c_f_pointer (c_loc(x_ptr), iqnstr_ptr, (/1/))
740 x_ptr => x(nnext) ;
call c_f_pointer (c_loc(x_ptr), nnext_ptr, (/1/))
742 call wfn (
nncsf, nadel, iidist, iidis1, nodi_ptr, ndi_ptr, x(
icdi), ndel_ptr, iqnstr_ptr, x(nnext), nnext_ptr, nav)
744 if (
nndel > 0 .and. nadel >
nndel .and. iidis1 == 0)
return
745 if (
nndel == 0)
go to 500
746 if (iidist == 0)
go to 500
748 if (
confpf >= 10 .and. iidis1 /= 0)
call print2 (iidis1)
754 if (kc == 0)
go to 600
767 if (ks == 0)
go to 900
770 if (
kslim(1,ks) == 3)
go to 625
783 625 mtry = mtry -
qnshl(2,ks)
788 900
if (
nndel /= 0 .and. iidis1 /= 0)
call print3 (iidis1, 1)
801 subroutine cplem (nncsf, nadel, x, nftw, noex)
803 use iso_c_binding,
only : c_loc, c_f_pointer
804 use precisn,
only : wp
805 use global_utils,
only : mprod
806 use congen_data,
only :
lg,
next,
nx,
icdi,
iexcon,
indi,
inodi,
iqnstr,
irfcon,
ndel,
confpf,
ndist,
nshl, &
828 real(wp),
dimension(*),
target :: x
829 integer,
dimension(:),
pointer :: int_ptr, nodi_ptr, ndi_ptr, ndel_ptr, irfcon_ptr, iexcon_ptr, iqnstr_ptr, nnext_ptr
830 real(wp),
pointer :: x_ptr
832 integer :: i, idumm, iidis1, iidist, kc, kclim, kcs, kcsp, mtry, mu1, mu2, nav, nnext, nused, spntry
833 integer,
dimension(2*lg) :: qntmp
851 mtry = mprod(mtry + 1, qntmp(i) + 1, 0,
nftw) - 1
854 if (spntry <
qntot(1))
return
855 if (mtry /=
qntot(2))
return
866 qntmp(kcs) = mprod(qntmp(
cup(1,i)) + 1, qntmp(
cup(2,i)) + 1, 0,
nftw) - 1
876 300
do while (kc <
nshl - 1)
881 qnshl(1,kcs) = mu1 + mu2 - 1
882 spnmin(kc) = abs(mu1 - mu2) + 1
892 360
if (
qntar(1) >= 0)
then
894 if (kcs == 3) kcsp = 1
906 x_ptr => x(
irfcon) ;
call c_f_pointer (c_loc(x_ptr), irfcon_ptr, (/1/))
907 x_ptr => x(
iexcon) ;
call c_f_pointer (c_loc(x_ptr), iexcon_ptr, (/1/))
908 x_ptr => x(
iqnstr) ;
call c_f_pointer (c_loc(x_ptr), iqnstr_ptr, (/1/))
925 x_ptr => x(
inodi) ;
call c_f_pointer (c_loc(x_ptr), nodi_ptr, (/1/))
926 x_ptr => x(
indi) ;
call c_f_pointer (c_loc(x_ptr), ndi_ptr, (/1/))
927 x_ptr => x(
ndel) ;
call c_f_pointer (c_loc(x_ptr), ndel_ptr, (/1/))
928 x_ptr => x(
iqnstr) ;
call c_f_pointer (c_loc(x_ptr), iqnstr_ptr, (/1/))
929 x_ptr => x(nnext) ;
call c_f_pointer (c_loc(x_ptr), nnext_ptr, (/1/))
931 call wfn (
nncsf, nadel, iidist, iidis1, nodi_ptr, ndi_ptr, x(
icdi), ndel_ptr, iqnstr_ptr, x(nnext), nnext_ptr, nav)
933 if (
nndel > 0 .and. nadel >
nndel .and. iidis1 == 0)
return
935 if (
nndel /= 0 .and. iidist /= 0)
then
937 if (
confpf >= 10 .and. iidis1 /= 0)
call print2 (iidis1)
942 500
do while (kc > 1)
949 if (
nndel /= 0 .and. iidis1 /= 0)
call print3 (iidis1, 1)
994 subroutine distrb (nelecp, nshlp, shlmx, occshl, nslsv, kdssv, loopf, ksss, pqn, occst, shlmx1, pqnst, mshl, mshlst, &
995 gushl, gushst, cup, cupst, ndprod, symtyp, confpf, sshl, sshlst, ncsf, nncsf, nadel, nndel, x, nftw, &
998 use precisn,
only : wp
1002 integer,
dimension(3,*) ::
cup, cupst, pqn,
pqnst
1003 integer,
dimension(*) ::
gushl, gushst, kdssv, ksss, loopf,
mshl, mshlst, nelecp, nshlp, nslsv,
occshl, &
1005 real(kind=wp),
dimension(*) :: x
1006 intent (in) confpf,
cup,
gushl,
mshl,
ncsf, ndprod, nelecp,
nndel, nshlp, pqn, shlmx,
shlmx1, sshl,
symtyp
1008 intent (inout) cupst, kdssv, ksss, loopf, nslsv,
occshl, occst
1010 integer :: i, ibias, ic1, id, idd, it, it1, it2, ita, j, kds, kdsb, kdst, kprod, krun, ksi, kss, nadd, nadd2, ncrun, &
1011 nela, neleft, ninitx, nshlw, nslots, noex
1019 ninitx = sum(nshlp(1:ndprod))
1021 orbital_set_loop:
do
1025 neleft = nelecp(kprod)
1026 nshlw = nshlp(kprod)
1027 nslots = sum(shlmx(ibias + 1 : ibias + nshlw))
1028 occshl(ibias + 1 : ibias + nshlw) = 0
1034 occshl(kdsb) = min(neleft, shlmx(kdsb))
1036 neleft = neleft -
occshl(kdsb)
1037 nslots = nslots - shlmx(kdsb)
1039 if (neleft /= 0)
then
1040 if (nslots >= neleft) cycle shell_loop
1041 do while (nslots <= neleft .and. kds /= 0)
1042 neleft = neleft +
occshl(kdsb)
1044 nslots = nslots + shlmx(kdsb)
1049 else if (kprod /= ndprod)
then
1050 nslsv(kprod) = nslots
1052 ibias = ibias + nshlp(kprod)
1053 cycle orbital_set_loop
1058 where (
occshl(1:ninitx) == 0 .or. pqn(1,1:ninitx) /= 0)
1073 if (ksi == ninitx)
then
1078 cupst(1:3,1:ncrun) =
cup(1:3,1:ncrun)
1081 all_shell_loop:
do i = 1, ninitx
1083 if (ksss(i) < 1)
then
1086 if (cupst(1,id) == krun)
then ; it1 = cupst(2,id) ; it2 = cupst(3,id) ;
exit ;
end if
1087 if (cupst(2,id) == krun)
then ; it1 = cupst(1,id) ; it2 = cupst(3,id) ;
exit ;
end if
1093 cupst(1:3,idd) = cupst(1:3,idd+1)
1097 if (cupst(1,idd) == it2)
then ; cupst(1,idd) = it1 ;
exit ;
end if
1098 if (cupst(2,idd) == it2)
then ; cupst(2,idd) = it1 ;
exit ;
end if
1103 if (cupst(j,idd) <= krun) cycle
1104 cupst(j,idd) = cupst(j,idd) - 1
1105 if (cupst(j,idd) >= it2) cupst(j,idd) = cupst(j,idd) - 1
1111 else if (ksss(i) > 1)
then
1116 cupst(3,idd) = cupst(3,idd) + nadd2
1118 if (cupst(j,idd) == krun)
then
1119 cupst(j,idd) = nshrun + nadd2
1120 else if (cupst(j,idd) > krun .and. cupst(j,idd) <= nshrun)
then
1121 cupst(j,idd) = cupst(j,idd) + nadd
1122 else if (cupst(j,idd) > krun .and. cupst(j,idd) > nshrun)
then
1123 cupst(j,idd) = cupst(j,idd) + nadd2
1128 nshrun = nshrun + nadd
1130 cupst(1,ncrun+idd) = ic1
1131 cupst(2,ncrun+idd) = krun + idd
1132 cupst(3,ncrun+idd) = nshrun + idd
1135 ncrun = ncrun + nadd
1138 end do all_shell_loop
1142 do while (i /= cupst(3,i) - kdst)
1143 it = cupst(3,i) - kdst
1146 cupst(j,it) = cupst(j,i)
1162 if (loopf(ksi) == 0)
then
1165 kdst = kdst - ksss(ksi)
1172 if (
occshl(ksi) == 0) cycle ksi_loop
1173 if (
occshl(ksi) /= 0)
continue
1178 410 kss_loop:
do while (kss <= pqn(3,ksi) - pqn(2,ksi))
1181 occst(kdst) = min(nela,
shlmx1(sshl(ksi)))
1182 if (kss /= 1 .and. kdst > 1) occst(kdst) = min(nela, occst(kdst-1))
1183 pqnst(1:3,kdst) = pqn(1:3,ksi)
1184 mshlst(kdst) =
mshl(ksi)
1185 gushst(kdst) =
gushl(ksi)
1187 nela = nela - occst(kdst)
1198 occst(kdst) = occst(kdst) - 1
1200 if (occst(kdst) /= 0)
go to 410
1213 if (ksi <= 0)
exit ksi_loop
1214 if (loopf(ksi) == 0)
then
1218 kdst = kdst - ksss(ksi)
1229 120
if (
occshl(kdsb) == 0)
go to 140
1232 if (
nndel /= 0 .and. nadel >
nndel)
exit orbital_set_loop
1233 if (kds < nshlp(kprod)) cycle shell_loop
1234 neleft = neleft +
occshl(kdsb)
1236 nslots = nslots + shlmx(kdsb)
1240 130 unkds_loop:
do while (kds /= 0)
1241 if (
occshl(kdsb) /= 0)
then
1244 if (
nndel /= 0 .and. nadel >
nndel)
exit orbital_set_loop
1247 nslots = nslots + shlmx(kdsb)
1252 140 kprod = kprod - 1
1253 if (kprod == 0)
exit orbital_set_loop
1254 ibias = ibias - nshlp(kprod)
1255 nslots = nslsv(kprod)
1262 end do orbital_set_loop
1283 use precisn,
only : wp
1285 integer :: ni, nj, nt
1286 real(kind=wp),
dimension(*) :: ci, cj
1287 integer,
dimension(2,ni,*) :: iqn
1288 integer,
dimension(2,nj,*) :: jqn
1289 intent (in) ci, iqn, ni, nj, nt
1290 intent (out) cj, jqn
1292 jqn(1:2,1:nj,1:nt) = iqn(1:2,1:nj,1:nt)
1302 use global_utils,
only : getin
1303 use congen_data ,
only :
confpf,
ndist,
ne,
nshl,
ntyp,
occshl, pqnr =>
pqnst,
mshl,
gushl,
qnshl, &
1307 integer,
dimension(*),
intent(in) :: qnstor
1310 integer :: i, ii, imax, j, jj, k, kf, ki, klabel, lt, lta, nlex, nstar
1311 character(len=4),
dimension(3,4) :: label = reshape((/
' NTY',
'P=XX',
'X ', &
1312 ' NDI',
'ST=Y',
'YYY ', &
1313 ' NST',
'ATE=',
'ZZZ ', &
1314 ' ',
' ',
' ' /) , (/ 3, 4/))
1315 character(len=16),
parameter :: frmt =
'(3A4,A8,I8,8I12)'
1316 character(len=1),
dimension(12,4) :: labell
1318 equivalence(label(1,1), labell(1,1))
1324 if (
symtyp == 1) nlex = 1
1328 call getin (
ntyp, 3, labell(7,1), 0)
1343 call addl (5 + nlex)
1344 write(
nftw,frmt) (label(j,klabel), j=1,3),
header(1), (j, j=i,imax)
1352 write(
nftw,
'(3A4,A8,9(A3,2(I3,","),I3,")"))')
blnk43,
header(5), (
lp, (pqnr(jj,j), jj=1,3), j=i,imax)
1354 write(
nftw,
'(3A4,A8,9(A3,2(I2,","),I2,")"))')
blnk43,
header(6), (
lp, (
qnshl(jj,j), jj=1,3), j=i,imax)
1368 if (lt > 0)
write(
nftw,
'(" ",132A1)') (
star, j=1,nstar)
1373 call getin (ii, 4, labell(8,2), 0)
1376 call addl (4 + nlex)
1377 write(
nftw,frmt) (label(j,klabel), j=1,3),
header(1), (j, j=i,imax)
1383 kf = ki + (imax - i)
1394 write(
nftw,
'(" ",19("*"),5X,"TOTAL NUMBER OF DISTRIBUTIONS FOR NTYP =",I3," IS",I5)')
ntyp,
ndist
1401 if (lt > 0)
write(
nftw,
'(" ",132A1)') (
star, j=1,nstar)
1411 use global_utils,
only : getin
1412 use congen_data,
only :
confpf,
ncsf,
ndist,
nshl,
nstate,
cup,
qnshl,
symtyp,
nftw,
blnk43,
header,
lp,
nitem
1418 integer :: i, imax, j, jj, kf, ki, klabel, ncsff, ncsfi, nshlm1
1419 character(len=4),
dimension(3,4) :: label = reshape((/
' NTY',
'P=XX',
'X ', &
1420 ' NDI',
'ST=Y',
'YYY ', &
1421 ' NST',
'ATE=',
'ZZZ ', &
1422 ' ',
' ',
' '/) , (/ 3, 4/))
1423 character(len=1),
dimension(12,4) :: labell
1425 equivalence(label(1,1), labell(1,1))
1431 call getin (
nstate, 3, labell(9,3), 0)
1432 if (nshlm1 <= 0)
then
1434 write(
nftw,
'(3A4,A8,I8,8I12)') (label(j,3), j=1,3)
1439 do i = 1, nshlm1,
nitem
1440 imax = min(i +
nitem - 1, nshlm1)
1442 write(
nftw,
'(3A4,A8,9(A3,2(I2,","),I2,")"))') (label(j,klabel), j=1,3),
header(7), (
lp, (
cup(jj,j), jj=1,3), j=i,imax)
1445 kf = ki + (imax - i)
1446 write(
nftw,
'(3A4,A8,9(A3,2(I2,","),I2,")"))')
blnk43,
header(6), (
lp, (
qnshl(jj,j), jj=1,3), j=ki,kf)
1448 write(
nftw,
'(3A4,A8,9(A3,2(I2,","),I2,")"))')
blnk43,
header(6), (
lp, (
qnshl(jj,j), jj=1,3), j=ki,kf)
1457 if (iidis1 /= 0)
then
1458 ncsfi =
ncsf - iidis1 + 1
1466 write(
nftw,
'(" ",19("*"),5X,"CSF NUMBERS",I6," TO",I6," GENERATED FOR NSTATE=",I3)') ncsfi, ncsff,
nstate
1479 integer,
intent(in) :: i13, iidis1
1481 integer :: i, j, lt, ncsfi, nstar, nstot
1490 ncsfi =
ncsf + 1 - nstot
1494 write(
nftw,
'(" ",19("*"),5X,"TOTAL NUMBER OF STATES FOR NTYP=",I3," IS",I4)')
ntyp,
nstate
1495 write(
nftw,
'(20X,"CSF NUMBERS",I10," TO",I10," (",I9," CSFS) GENERATED")') ncsfi,
ncsf, nstot
1500 if (lt > 0)
write(
nftw,
'(" ",132A1)') (
star, j=1,nstar)
1510 use precisn,
only : wp
1515 integer,
dimension(*) :: ix
1516 real(kind=wp),
dimension(*) :: x
1517 intent (in) ix, nd, x
1519 integer :: ie,
ind, ip, ipi, it, j, nl,
nitem
1531 write(
nftw,
'(30X,"NUMBER OF DET IS",I3)') nd
1536 ipi = ip + min(
nitem - 1,
ne - ie)
1538 write(
nftw,
'(45X,20I4)') (ix(j), j=ip,ipi)
1540 write(
nftw,
'(I25,5X,E15.8,20I4)')
ind, x(
ind), (ix(j), j=ip,ipi)
1558 integer,
dimension(*) :: ndi
1561 integer ::
ind, ip, ipi, j, nrep
1568 write(
nftw,
'(35X,2I5)')
ind, nrep
1578 write(
nftw,
'(35X,2I5,21I4/(45X,21I4))')
ind, nrep, (ndi(j), j=ipi,ip)
1580 write(
nftw,
'(30X,3I5,21I4/(45X,21I4))')
ncsf,
ind, nrep, (ndi(j), j=ipi,ip)
1586 write(
nftw,
'(45X,21I4)') (ndi(j), j = ipi,ip)
1603 subroutine state (ns, x, last, nd, confpf)
1605 use iso_c_binding,
only : c_loc, c_f_pointer
1606 use precisn,
only : wp
1609 integer ::
confpf, last, nd, ns
1610 real(kind=wp),
dimension(*),
target :: x
1612 intent (inout) nd, x
1614 integer :: ic, id, intpfg, iqns, jqns, lc, ld, ldp, ldq, nam, ndmx, nt, ntmx
1616 real(wp),
pointer :: x_ptr
1617 integer,
pointer,
dimension(:) :: iqns_ptr, jqns_ptr, ld_ptr
1621 intpfg = merge(1, 0,
confpf > 40)
1625 ntmx = last / (nam + nam + 1)
1630 x_ptr => x(iqns) ;
call c_f_pointer (c_loc(x_ptr), iqns_ptr, (/1/))
1632 call wfcple (nam, iqn, isz,
cup, iqns_ptr, x(ic), ntmx, nt, intpfg)
1636 jqns = last - 2 * ns * nt + 1
1640 x_ptr => x(jqns) ;
call c_f_pointer (c_loc(x_ptr), jqns_ptr, (/1/))
1642 call packdet (iqns_ptr, nam, jqns_ptr, ns, x(1), x(lc), nt)
1644 ndmx = (lc - 1) / (
ne + 1)
1648 x_ptr => x(ld) ;
call c_f_pointer (c_loc(x_ptr), ld_ptr, (/1/))
1650 call getso (ns, intpfg, nt, jqns_ptr, x(lc), nd, ld_ptr, x(ic), ndmx)
1663 end subroutine state
1668 subroutine wfcple (nam, iqn, isz, icup, iqns, c, last, lc2, intpfg)
1670 use precisn,
only : wp
1671 use consts,
only : one => xone
1674 integer :: intpfg, isz, last, lc2, nam
1675 real(kind=wp),
dimension(*) :: c
1676 integer,
dimension(3,lg) :: icup
1677 integer,
dimension(3,*) :: iqn
1678 integer,
dimension(2,nam,*) :: iqns
1679 intent (in) icup, isz, last, nam
1680 intent (inout) c, iqns, lc2
1682 integer :: i, iam, ic, init, j, l, lc, lc1, lc3, m, mp, ms, n, n1, n2, n3, nc, niam, niam1
1683 logical,
dimension(nam) :: ind
1684 integer,
dimension(2,200) :: iszt
1685 real(kind=wp) :: sign
1688 iqns(2,nam,1) = iqn(2,nam)
1691 if (nam == 1)
return
1695 niam = (nam + 1) / 2
1697 110
if (ind(n3))
then
1698 if (n3 <= niam)
go to 299
1700 init = last - lc2 + 1
1704 iqns(1:2,1:nam,l) = iqns(1:2,1:nam,lc)
1710 300
if (icup(3,n) == n3)
then
1713 if (n1 > n3 .or. n2 > n3)
go to 299
1714 if (.not.ind(n1) .or. .not.ind(n2))
go to 299
1715 if (n1 <= niam) ind(n1) = .false.
1716 if (n2 <= niam) ind(n2) = .false.
1719 iqns(2,n1,l) = iqn(2,n1)
1720 iqns(2,n2,l) = iqn(2,n2)
1722 if (abs(m) /= iqn(2,n1) + iqn(2,n2))
then
1723 mp = iqn(2,n1) - iqn(2,n2)
1724 if (abs(m) /= abs(mp))
go to 511
1727 iqns(2,n,l) = -iqns(2,n,l)
1728 else if (iqns(2,n3,l) < 0)
then
1729 iqns(2,n1,l) = -iqns(2,n1,l)
1730 iqns(2,n2,l) = -iqns(2,n2,l)
1734 call cgcoef (iqn(1,n1), iqn(1,n2), iqn(1,n3), ms, nc, iszt, c(lc1), intpfg)
1737 if (lc2 >= l)
go to 899
1740 iqns(1:2,1:nam,lc) = iqns(1:2,1:nam,l)
1741 iqns(1,n1,lc) = iszt(1,ic)
1742 iqns(1,n2,lc) = iszt(2,ic)
1744 c(lc) = c(lc) * c(l)
1746 if (iqns(2,n3,l) < 0)
then
1747 if (iqn(3,n1) >= 0 .and. iqn(3,n2) >= 0) cycle
1748 c(lc1:lc2) = -c(lc1:lc2)
1749 else if (iqns(2,n3,l) == 0)
then
1750 if (iqn(2,n1) /= 0)
then
1751 if (lc2 + nc >= l)
go to 899
1754 if (iqn(3,n3) < 0) sign = -one
1757 iqns(1:2,1:nam,lc2) = iqns(1:2,1:nam,lc)
1758 iqns(2,n1,lc2) = -iqns(2,n1,lc2)
1759 iqns(2,n2,lc2) = -iqns(2,n2,lc2)
1760 c(lc) = c(lc) *
root2
1761 c(lc2) = c(lc) * sign
1765 if (iqn(3,n1) * iqn(3,n2) /= iqn(3,n3))
go to 511
1774 if (n < niam)
go to 300
1778 if (n3 > 0)
go to 110
1781 299 niam1 = niam - 1
1782 write(
nftw,
'("0ERROR IN COUPLING TREE"//(3I5))') ((icup(i,j), i=1,3), j=1,niam1)
1786 511
write(
nftw,
'("0COUPLING IMPOSSIBLE MULTIPLICITIES FOLLOW"//(3I5))') (iqn(i,n1), iqn(i,n2), iqn(i,n3), i=1,3)
1790 899
write(
nftw,
'("0STORAGE OVERFLOW IN VECTOR COUPLING")')
1815 subroutine wfn (nncsf, nadel, iidist, iidis3, nodi, ndi, cdi, ndel, pqnshl, x, ix, nx)
1821 use precisn,
only : wp
1822 use congen_data,
only :
lratio,
iidis2,
lcdi,
lndi,
ni,
nid,
noi,
exdet,
exref,
norep,
nonew,
ntso, &
1826 integer :: iidis3, iidist, nadel,
nncsf,
nx
1827 real(kind=wp),
dimension(*) :: cdi, x
1828 integer,
dimension(*) :: ix,
ndel, ndi, nodi, pqnshl
1829 intent (in) ndel, pqnshl
1831 intent (inout) cdi, iidist, nadel, ndi,
nncsf, nodi
1833 integer :: det, i, ia, ib, id, idist, iidis1, irep, j, k, k1, kshl, kshlst, lf, li, nd, nii
1839 if (
ncall == 1)
then
1854 write(
nftw,
'("1","******* ERROR IN WFN ND=0"//)')
1859 if (
ndist == 0)
return
1872 kshlst = kshlst +
nshl
1877 if (
nndel /= 0)
then
1883 ia = nd * (2 * nelec + 1) +
ni
1887 if (ia > jmx .or. ib > nidmx .or. k1 > noimx)
then
1911 det = ix(k) +
nsoi(sshl(i)) + (pqnshl(kshl) - 1) *
shlmx1(sshl(i))
1931 if (
ni + 2 * irep >
ndimx)
then
1932 write(
nftw,
'("******* ERROR IN WFN, NDIMX TOO SMALL",2I10)')
ni + 2 * irep,
ndimx
1951 if (
noi > noimx)
then
1952 write(
nftw,
'("******* ERROR IN WFN, NODIMX TOO SMALL",2I10)')
noi, noimx
1960 if (
nid + nd > nidmx)
then
1961 write(
nftw,
'("******* ERROR IN WFN, CDIMX TOO SMALL",2I10)')
nid + nd, nidmx
1974 iidis1 = iidis1 + iidist
Module containing parameters / data required throughout the CONGEN program.
integer ndel
Workspace position used for the CSFs read from input.
integer nobt
Total number of all orbitals considered in the calculation, essentially equal to sum(nob).
real(kind=wp), parameter root2
Note that this is actually inverse square root!
integer, dimension(nu) shlmx1
Maximal occupancy of orbitals per symmetry.
integer lndi
Total number of integers forming packed determinants.
integer, dimension(lg) norep
integer, dimension(jz) test
Determines which of the two types of constraints will be used.
integer icdi
Position in workspace where the determinant coefficients start (one coeff per one determinant).
integer, dimension(lg) gushl
Gerade/ungerade per shell.
integer, dimension(nu, lg) nst
Pointer to shell index and order count; only used in congen_distribution::assign.
integer gutot
Total gerade (= +1) / ungerade (= -1) quantum number.
integer iqnstr
Starting position in workspace for per-shell quantum numbers (e.g. congen_distribution::cplem).
integer indi
Position in workspace where packed determinants start (each as size + replacements).
real(kind=wp), dimension((jsmax *jsmax+3 *jsmax+4)/2) binom
Table of precomputed Pascal triangle.
integer nisz
Total S_z, set by CSFGEN, defaults to first element of qntot.
character(len=4), dimension(3), parameter blnk43
integer, dimension(lg) qnshlr
Total quantum numbers for all shells in the set of orbitals being processed.
integer ntyp
Prototype number, updated in congen_distribution::distrb.
integer megul
File unit for binary output of generated configurations.
integer ntso
Total number of spin-orbitals, given the orbitals and their maximal occupacy (from group properties).
integer, parameter nitem
Number of interesting things printed per line in the PRINT* routines.
integer, dimension(:), allocatable exref
Population of spin-orbitals (0 = not populated, 1 = populated).
integer, dimension(2, lg) mclim
integer, dimension(3) qntot
Total quantum numbers.
integer, dimension(jz) nrcon
integer nstate
Number of couplings computed in congen_distribution::cplea or congen_distribution::cplem.
integer nndel
Number of workspace elements used for reservation of space needed when reading CSFs from input.
integer, dimension(jsmax+2) ind
Pascal triangle row pointers into congen_data::binom.
integer nshl
Number of shells in the set of orbitals currently being processed.
integer, dimension(:), allocatable exdet
integer confpf
Print flag for the amount of print given of configurations and prototypes.
integer, dimension(2, lg) kslim
integer nnlecg
The total number of electrons which are movable within the current wfn group.
integer, dimension(nu) nsoi
Running index of the first spin-orbital within given total symmetry.
integer ift
Used to signal to congen_distribution::assign to initialize some variables.
integer ndist
Number of distributions generated from set of shells (set in congen_distribution::assign).
integer, dimension(lg) nonew
integer nncsf
Number of CSFs generated by congen_distribution::wfn (total).
character(len=3), parameter lp
integer, dimension(3, lg) pqnst
integer, dimension(nu) nobi
Running index of the first orbital in each symmetry.
integer lratio
Ratio of real size to integer size. Used to manage workspace data.
integer, dimension(lg) spnmin
integer cdimx
Maximal number of determinants.
integer nid
Length of the integer array containing all packed determinants.
integer, dimension(3, 2 *lg) qnshl
integer ndimx
Maximal number of workspace elements usable for packed determinant data.
integer ncall
Used to signal to "wfn" to initialize some variables.
integer iexcon
Position in workspace where EX constraints start.
integer lcdi
Total number of determinants (including those already flushed to disk).
integer, dimension(nu) nshsym
integer, dimension(3, lg) cup
Coupling scheme data. ???
integer ncsf
Total number of CSFs generated.
integer nftw
Unit number for printing; may be changed via the STATE namelist so not a parameter.
integer next
Position in the workspace indicating the first unused element.
real(kind=wp), parameter thresh1
Threshold used in congen_distribution::cgcoef.
character(len=1), parameter star
integer noi
Number of determinants per CSF.
integer nx
Full or remaining workspace size (depending on context).
character(len=8), dimension(7), parameter header
integer, dimension(lg) mshl
Symmetry number from zero to n-1 (mvalue).
integer, dimension(3) qntar
Coupling control for current wfn group. ???
integer nodimx
Maximal number of workspace elements usable for CSF information.
integer ni
Number of determinants currently in memory.
integer, parameter lg
??? used to dimension arrays below; also in CPLE[A,M].
integer, dimension(lg) sshlst
integer inodi
Position in workspace where CSFs start (as number of determinants per CSF).
integer symtyp
Symmetry type, 0 = C_infv, 1 = D_infh, 2 = {D_2h, C_2v, C_s, E}.
integer, dimension(lg) occshl
Compressed shell occupations, all zeros deleted and pseudo shells expanded.
Distribute electrons to available orbitals.
subroutine wfcple(nam, iqn, isz, icup, iqns, c, last, lc2, intpfg)
?
subroutine, public distrb(nelecp, nshlp, shlmx, occshl, nslsv, kdssv, loopf, ksss, pqn, occst, shlmx1, pqnst, mshl, mshlst, gushl, gushst, cup, cupst, ndprod, symtyp, confpf, sshl, sshlst, ncsf, nncsf, nadel, nndel, x, nftw, noex)
Distribute electrons to spin-orbitals.
subroutine, private print3(iidis1, i13)
?
subroutine, private cplem(nncsf, nadel, x, nftw, noex)
?
subroutine, private print1(qnstor)
?
subroutine, private cplea(nncsf, nadel, x, nftw)
Loop through (and fill) all allowed couplings for a given electron distribution into shells.
subroutine, private getsm(ne, isz, nc, c, iso)
Form ne electrons in a shell coupled to (l,is).
subroutine, private getso(ns, intpfg, nti, iqns, ci, nd, id, cd, last)
?
subroutine, private wfn(nncsf, nadel, iidist, iidis3, nodi, ndi, cdi, ndel, pqnshl, x, ix, nx)
TODO...
subroutine, private state(ns, x, last, nd, confpf)
?
subroutine, private print5(nd, ndi)
?
subroutine, private getsa(ne, l, is, isz, m, nc, c, iso)
Form ne electrons in a shell coupled to (l,is).
subroutine, private packdet(iqn, ni, jqn, nj, ci, cj, nt)
Copy determinant data.
subroutine, private print2(iidis1)
?
subroutine, private print4(nd, x, ix)
?
subroutine, private assign(nshl, ndist, nused, refcon, excon, qnstor, nx, nftw)
Assign quantum numbers to real shells.
subroutine, private cgcoef(j1, j2, j3, m3, n, ms, c, intpfg)
Clebsch-Gordan coefficients.
subroutine, public taddl1(lines, lt)
Check available lines.
subroutine, public newpg
Start new page of output.
subroutine, public space(lines)
Add blank lines to output.
subroutine, public addl(lines)
Add blank lines to output.
subroutine, public taddl(lines, lt)
Add blank lines to output.