51 use precisn,
only : wp
52 use consts,
only : zero => xzero, two => xtwo
53 use congen_data,
only :
mxtarg,
nx =>
nu,
ny,
nz,
jx,
jy,
jz,
ky,
kz,
ntcon,
test,
nrcon,
nobt, &
54 nsym,
nobi,
ift,
next, navail =>
nx,
icdi,
iexcon,
indi,
inodi,
iqnstr, &
55 irfcon,
ndel,
ndel1,
ndel2,
exref,
ntso,
nodimx,
cdimx,
ndimx,
megul,
nsoi,
nncsf, &
60 use iso_c_binding,
only : c_loc, c_f_pointer
65 real(wp),
allocatable,
dimension(:),
target :: bmx
66 real(wp),
pointer :: bmx_ptr
67 integer,
dimension(:),
pointer :: int_ptr, ndel_ptr, ndel1_ptr, ndel2_ptr, irfcon_ptr
68 integer :: byproj, cdimn, conmes, d, defltc, guold,
gutot, i, idiag, iposit, is, iscat, iso, isz, itu, j, lc,
lcdi, &
69 lcdo, lcdt, ln,
lndi, lndo, lndt, lpp, lsquare, ltri, maxtgsym, megu, mflag, mold, mt, n, nadel, nbmx, &
70 nconmx, ncsf0, ncupp, ndimn, ndpmax, ndpp, ndprod, negmax, negr, nelecg, nelect, nelp, nelr, nemax, nerfg, &
71 nerfs, nextk, nfto,
nndel, nobep, nodimn, npcupf, npmult, nrefo, nrefog, nrefop, nrerun, nrfgmx, nrfgoe, &
72 nrfoe, nrfomx, ns, nshgmx, nshlp0, nshlpt, nspf, nspi, nsymmx, nsymp, ntconp, err, gflag, noex
73 integer,
dimension(3,jx) ::
cup, pqn
74 logical :: ene, ener, enob, enrefo, epsno, eqnt, erefd, error, errorg, espace, esymt, qmoln
75 logical,
dimension(11) :: erfg
76 logical,
dimension(9) :: erfs
77 character(len=80) :: gname, sname
78 character(len=256) :: errmsg
79 integer,
dimension(mxtarg) :: gucont, mcont, mdegen, mrkorb, nctgt, notgt
81 integer,
dimension(jy) :: kdssv, nelecp, nshlp, nslsv
82 integer,
dimension(nx) :: nob, nob0, nob0l, nobl
83 integer,
dimension(nx) :: nobe, nobp, nobv
84 integer,
dimension(6) :: npflg
85 integer,
dimension(jz) :: nshcon
86 integer :: ntgsmx, ntgsym, nwfngp, pqn2,
symtyp
87 real(kind=wp) :: pin, r, s, sz, thres
89 integer,
dimension(nz) :: refdet
90 integer,
dimension(kz) :: refdtg
91 integer,
dimension(ny) :: refgu
92 integer,
dimension(ky) :: refgug
93 integer,
dimension(5,ny) :: reforb
94 integer,
dimension(5,ky) :: reforg
95 integer,
dimension(3,jx,jz) :: tcon
97 equivalence(reforg(1,1), reforb(1,1))
98 equivalence(refgu(1), refgug(1))
101 equivalence(erfs(1), esymt)
102 equivalence(erfs(2), enob)
103 equivalence(erfs(3), epsno)
104 equivalence(erfs(4), ene)
105 equivalence(erfs(5), enrefo)
106 equivalence(erfs(6), ener)
107 equivalence(erfs(7), erefd)
108 equivalence(erfs(8), eqnt)
109 equivalence(erfs(9), espace)
112 namelist /
state /
megul, nrerun, lcdt, lndt, nfto, ltri, idiag, thres, megu, npflg,
nodimx,
ndimx,
cdimx, &
113 byproj, lcdo, lndo,
nftw, iscat, ntgsym, sname, lpp,
confpf,
symtyp,
qntot,
gutot, isz, &
114 npmult, nob, reforb, refgu, nrefo, nelect,
nndel, qmoln, gflag, &
115 iposit, nob0, nbmx, nobe, nobp, nobv, noex
117 namelist /wfngrp/ nelecg, ndprod, nelecp, nshlp, gname, reforg, refgug, nrefog,
mshl,
gushl, pqn,
cup, defltc, &
199 reforb(1:5,1:nrfomx) = -2
200 erfs(1:nerfs) = .false.
208 read(
nftr,
state, iostat = i, iomsg = errmsg)
212 write(
nftw,
'("1***** FAILED TO READ NAMELIST &STATE:",/,9X,A)') trim(errmsg)
218 if (iscat <= 0) idiag = 0
219 if (iscat > 0) idiag = 1
229 if (nobp(i) == 0)
then
232 nobep = nobe(i) + nobp(i)
233 if (nobep /= nob(i))
then
234 write(
nftw,*)
'ERROR on input:'
235 write(
nftw,*)
'not: NOB(i)=NOBE(i)+NOBP(i)'
236 write(
nftw,*)
'i=', i
237 write(
nftw,*)
'NOB(i)=', nob(i)
238 write(
nftw,*)
'NOBE(i)=', nobe(i)
239 write(
nftw,*)
'NOBP(i)=', nobp(i)
241 if (nobv(i) == 0)
then
244 if (nob0(i) > nob(i))
then
245 write(
nftw,*)
'ERROR on input:'
246 write(
nftw,*)
'NOB0(i) > NOB(i)'
247 write(
nftw,*)
'i=', i
248 write(
nftw,*)
'NOB(i)=', nob(i)
249 write(
nftw,*)
'NOB0(i)=', nob0(i)
256 if (nob(i) /= 0)
nsym = i
284 ene = (nelect <= 0 .or. nelect > nemax)
288 if (.not. any(erfs))
then
291 call getref (reforb, refgu, nrefo, nelect, refdet, nelr,
nsoi, nob,
shlmx1,
nsym,
symtyp, nrfomx, enrefo, ener, erefd)
295 if (.not. enrefo) nrefop = nrefo
297 if (isz == 0) isz =
qntot(1)
302 .or. (abs(isz - 1) >
qntot(1) - 1) &
321 navail = nbmx -
next + 1
337 write(
nftw,
'(" NBMX =",I9," WORDS")') nbmx
338 write(
nftw,
'(" ***** REGION USED FOR INPUT DATA ",I7," WORDS ",I5," K")')
next, nextk
339 write(
nftw,
'(" ***** LEFT ",I9," WORDS")') navail
342 espace = (navail <= 0)
347 call stwrit (nelect,
confpf,
qntot,
cdimx,
icdi,
ntso,
symtyp,
ndimx,
indi, nrefo,
nodimx,
inodi,
nsym,
gutot, nbmx, &
348 isz, navail, idiag, megu, thres, lcdt,
megul, lndt, nfto, nrerun, ltri, npflg,
nndel, nob,
nsoi, nsymp, &
349 refdet, nerfs, erfs, nrefop, reforb, refgu, nelp, lpp, sname, error, byproj, lndo, lcdo, iposit, nob0, &
350 npmult, ntgsym,
mxtarg, nobe, nobp, nobv)
354 bmx_ptr => bmx(
ndel) ;
call c_f_pointer (c_loc(bmx_ptr), ndel_ptr, (/1/))
355 bmx_ptr => bmx(
ndel1) ;
call c_f_pointer (c_loc(bmx_ptr), ndel1_ptr, (/1/))
356 bmx_ptr => bmx(
ndel2) ;
call c_f_pointer (c_loc(bmx_ptr), ndel2_ptr, (/1/))
357 call subdel (ndel_ptr, ndel1_ptr, ndel2_ptr,
nndel)
361 call wfnin (nwfngp, nadel,
nncsf,
ncsf,
lcdi,
lndi, nelecg, ndprod, nrefog, npcupf, negmax, refdtg, nrfgmx, refgug, &
362 ntcon, reforg, nshgmx, nsymmx,
mshl,
gushl, pqn,
cup, ndpmax, nshlp, nconmx,
test,
nrcon, nshcon, tcon, errorg)
375 wfngrp_loop:
do while (
nndel == 0 .or. nadel <
nndel)
378 call wfnin0 (nelecp, defltc, nerfg, erfg, gname,
qntar, errorg, ndpmax)
381 read(
nftr, wfngrp, iostat = i)
387 if (nwfngp == 0)
then
388 write(
nftw,
'(" ***** NO WFNGRP INPUT FOUND")')
391 write(
nftw,
'(" ***** END OF FILE ON INPUT")')
398 nshlpt = sum(abs(nshlp(1:ndprod)))
401 if (iscat < 2 .or. mold < -1)
then
405 else if (mold ==
mshl(nshlpt) .and. (
symtyp /= 1 .or. guold ==
gushl(nshlpt)) .and. &
406 all(
qntar(1:3) == qntar1(1:3)) .and. pqn2 == pqn(2,nshlpt) .and. lsquare /= 1 .and. gflag /= 0)
then
409 if (notgt(ntgsym) /= pqn(3,nshlpt) - pqn(2,nshlpt) + 1)
then
410 write(
nftw,
'(//," Attempt to perform CI target calculation with different length continua for same target:")')
411 write(
nftw,
'( " Number of continua, last WFNGRP",I4)') notgt(ntgsym)
412 write(
nftw,
'( " Number of continua, this WFNGRP",I4)') pqn(3,nshlpt) - pqn(2,nshlpt) + 1
413 write(
nftw,
'( " STOP")')
420 if (ntgsym >= 1)
then
421 nctgt(ntgsym) = (
ncsf - ncsf0) / notgt(ntgsym)
422 mrkorb(ntgsym) = nspi
425 if (
qntar(1) <= 0 )
then
434 if (ntgsym > ntgsmx)
then
435 write(
nftw,
'(" Number of target states [",I5,"] has exceeded mxtarg [",I5,"].")') ntgsym, ntgsmx
436 write(
nftw,
'(" Increase mxtarg and recompile.")')
439 if (lsquare == 0) maxtgsym = maxtgsym + 1
440 write(
nftw,
'(/," Target state number",I3) ') ntgsym
441 write(
nftw,
'(" TARGET MULTIPLICITY =",I5,5X,"TARGET SYMMETRY =",I5,5X,"TARGET INVERSION SYMMETRY =",I5)')
qntar
442 write(
nftw,
'(" Coupling to continuum with M =",I3)')
mshl(nshlpt)
446 notgt(ntgsym) = pqn(3,nshlpt) - pqn(2,nshlpt) + 1
447 mcont(ntgsym) =
mshl(nshlpt)
454 mdegen(ntgsym) = max(
qntot(2),
qntar(2)) - mcont(ntgsym)
457 qntar1(1:3) =
qntar(1:3)
471 if (nelecg <= 0 .or. nelecg > negmax)
go to 150
473 ndprod = max(1, ndprod)
475 if (ndprod > ndpmax)
go to 150
480 nelecp(1:ndprod) = abs(nelecp(1:ndprod))
481 nshlp(1:ndprod) = abs(nshlp(1:ndprod))
482 negr = sum(nelecp(1:ndprod))
483 nshlpt = sum(nshlp(1:ndprod))
485 erfg(3) = (any(nshlp(1:ndprod) == 0))
487 nshlp0 = nshlpt - nshlp(ndprod)
488 if (nshlpt > nshgmx) erfg(3) = .true.
489 if (negr /= nelecg) erfg(4) = .true.
490 if (erfg(3) .or. erfg(4))
go to 150
493 call getref (reforg, refgug, nrefog, nelecg, refdtg, nelr,
nsoi, nob,
shlmx1, &
494 nsym,
symtyp, nshgmx, erfg(5), erfg(6), erfg(7))
496 if (.not. erfg(5)) nrefop = nrefog
497 if (.not. erfg(6)) nelp = nelecg
498 if (erfg(5) .or. erfg(6) .or. erfg(7))
go to 150
502 exref(refdet(1:nelect)) = 1
503 if (any(
exref(refdtg(1:nelecg)) == 0)) erfg(7) = .true.
504 exref(refdtg(1:nelecg)) = 0
505 if (erfg(7))
go to 150
509 if (noex .eq. 0)
then
510 if (iposit /= 0 .and. nelecp(ndprod) /= 1)
go to 150
517 if (abs(
gushl(i)) /= 1)
go to 150
519 if (mod(mt,2) == 0) itu = -1
520 mt = mt + mt - abs((
gushl(i) + itu) / 2)
523 if (mt >
nsym)
go to 150
524 if (pqn(1,i) /= 0)
then
528 d = pqn(3,i) - pqn(2,i)
530 shlmx(i) =
shlmx1(mt) * (d + 1)
532 nspf = nspi + shlmx(i) - 1
533 if (iposit /= 0 .and. i >= nshlp0) cycle
534 if (any(
exref(nspi:nspf) /= 0))
go to 150
535 if (pqn(3,i) > nob(mt))
then
536 write(
nftw,
'(//," Error: PQN number",i3," accesses orbital number",i3)') i, pqn(3,i)
537 write(
nftw,
'( " symmetry",i2," only contains",i3," orbitals")') mt, nob(mt)
545 call getcup (nshlpt, defltc, ndprod, nshlp,
cup(1,1), erfg(9))
546 if (erfg(9)) npcupf = 1
551 if (
ntcon == 0)
go to 150
554 navail = nbmx -
next + 1
556 write(
nftw,
'(" ***** REGION USED FOR DETERMINANTS ",I7," WORDS ",I5," K")')
next, nextk
557 write(
nftw,
'(" **** LEFT ",I7," WORDS")') navail
558 if (navail <= 0) erfg(11) = .true.
561 bmx_ptr => bmx(
irfcon) ;
call c_f_pointer (c_loc(bmx_ptr), irfcon_ptr, (/1/))
570 bmx_ptr => bmx(
irfcon) ;
call c_f_pointer (c_loc(bmx_ptr), irfcon_ptr, (/1/))
572 navail, nrefog, nelecp, nshlp,
qntar, nshlpt, nshgmx,
mshl, &
573 gushl, pqn,
cup, ncupp, npcupf, refdtg, nelp, ntconp, nshcon, &
575 erfg, ndpp, nrefop, lsquare, errorg)
581 nqntot(1:3) =
qntot(1:3)
582 nqntar(1:3) =
qntar(1:3)
590 exref(refdtg(1:nelecg)) = 1
597 call distrb (nelecp, nshlp, shlmx,
occshl, nslsv, kdssv, loopf, ksss, pqn, &
603 bmx_ptr => bmx(1) ;
call c_f_pointer (c_loc(bmx_ptr), int_ptr, (/1/))
614 if (ntgsym >= 1)
then
616 nctgt(ntgsym) = (
ncsf - ncsf0) / notgt(ntgsym)
617 mrkorb(ntgsym) = nspi
624 if (mdegen(ntgsym) > 0) mdegen(ntgsym) = 0
626 if (mdegen(n) > 0)
then
627 if (mdegen(n-1) <= 0)
then
628 write(
nftw,
'(/," WARNING: for target state number",I3)') ntgsym
629 write(
nftw,
'( " Coupling to upper continuum only detected")')
630 write(
nftw,
'( " Calculation may give target phase problems")')
632 else if (nctgt(n) /= nctgt(n-1))
then
633 write(
nftw,
'(/," Target states",I3," and",I3)') n - 1, n
634 write(
nftw,
'( " analysed for degenerate coupling to the continuum")')
635 write(
nftw,
'( " But number of CSFs differ:",I6," and",I6," respectively: STOP")') nctgt(n-1), nctgt(n)
638 else if (mdegen(n) > 0)
then
639 if (mdegen(n-1) > 0) mdegen(n-1) = 0
641 if (mdegen(n) /= 0) mflag = max(mflag, nctgt(n))
649 write(
nftw,
'(" ********** TOTAL NUMBER OF CSF''S GENERATED IS ",I9)')
ncsf
655 if (qmoln .and. iscat < 2 .and.
megul == 70)
then
657 open(unit = conmes, status =
'unknown')
658 write(conmes,
'(/," *** TOTAL NUMBER OF GENERATED CSF''S FOR THE GROUND STATE IS ",I6)')
ncsf
660 if (
ncsf <= 600)
then
661 write(conmes,
'("*** This target calculation should not take long !",/)')
662 else if (
ncsf > 600 .and.
ncsf < 12000)
then
663 write(conmes,
'("*** This target calculation will take a few hours !")')
664 write(conmes,
'("*** You can have a cup of tea and come back later.",/)')
665 else if (
ncsf > 12000 .and.
ncsf <= 22000)
then
666 write(conmes,
'("*** Oops, This target calculation is very big !")')
667 write(conmes,
'("*** You can come back tomorrow.",/)')
668 else if (
ncsf > 22000 .and.
ncsf <= 80000)
then
669 write(conmes,
'("*** Oops, This target calculation is very big ")')
670 write(conmes,
'("*** and can take several days to run !",/)')
671 else if (
ncsf > 80000)
then
672 write(conmes,
'("*** Oops, This target calculation is too big ")')
673 write(conmes,
'("*** to be computationally possible !")')
674 write(conmes,
'("*** Rerun with a smaller basis or contact ")')
675 write(conmes,
'("*** technical support: support@quantemol.com")')
682 s = real(
qntot(1) - 1,kind = wp) / two
683 sz = real(isz - 1, kind = wp) / two
692 pin = real(
gutot, kind = wp)
696 nob(j) = nob(i) + nob(i+1)
697 nob0(j) = nob0(i) + nob0(i+1)
702 if (
allocated(bmx))
deallocate(bmx)
710 if (byproj > 0 .or. iscat > 0)
then
711 call projec (sname,
megul,
symtyp,
qntot(2), s, sz, r, pin,
ncsf, byproj, idiag, npflg, thres, nelect,
nsym, &
712 nob, refdet,
nftw, iposit, nob0, nobl, nob0l, iscat, ntgsym, notgt, nctgt, mcont, gucont, mrkorb, &
713 mdegen, mflag, nobe, nobp, nobv, maxtgsym)
718 call wrnmlt (megu, sname, nrerun,
megul,
symtyp,
qntot(2), s, sz, r, pin,
ncsf, byproj,
lcdi,
lndi, lcdo, lndo, &
719 lcdt, lndt, nfto, ltri, idiag, npflg, thres, nelect,
nsym, nob, refdet,
nftw, iposit, nob0, nobl, &
720 nob0l,
nx, nobe, nobp, nobv)
726 call wrnmlt (
nftw, sname, nrerun,
megul,
symtyp,
qntot(2), s, sz, r, pin,
ncsf, byproj,
lcdi,
lndi, lcdo, lndo, &
727 lcdt, lndt, nfto, ltri, idiag, npflg, thres, nelect,
nsym, nob, refdet,
nftw, iposit, nob0, nobl, &
728 nob0l,
nx, nobe, nobp, nobv)
751 integer,
intent(in) :: nftw, nob(:), ndprod, nelecp(:), nshlp(:), pqn(:, :), mshl(:)
753 integer :: iset, jset, ishl, jshl, ipqn, jpqn, iorb, jorb, irr, npqn, nso
755 character(len=*),
parameter :: err_few_shells = &
756 '(/,"ERROR: Set of shells ",i0," has to accommodate ",i0," particles but has only ",i0," spinorbitals!")'
757 character(len=*),
parameter :: err_missing_pqn = &
758 '(/,"ERROR: PQN triplet ",i0," unspecified, but used by shell ",i0," in set ",i0,"!")'
759 character(len=*),
parameter :: err_invalid_mshl = &
760 '(/,"ERROR: Invalid MSHL value ",i0," for PQN triplet ",i0,"!")'
761 character(len=*),
parameter :: err_overlapping_pqns = &
762 '(/,"ERROR: Orbital ",i0," with MSHL ",i0," is used in two PQN triplets ",i0," and ",i0,"!")'
763 character(len=*),
parameter :: err_out_of_orbitals = &
764 '(/,"ERROR: PQN triplet ",i0," references orbitals beyond NOB (",i0,")!")'
770 do ishl = 1, nshlp(iset)
772 if (pqn(1, ipqn) == -1)
then
773 write (nftw, err_missing_pqn) ipqn, ishl, iset
777 if (irr < 0 .or. irr >=
nu)
then
778 write (nftw, err_invalid_mshl) irr, ipqn
781 if (any(pqn(:, ipqn) > nob(irr + 1)))
then
782 write (nftw, err_out_of_orbitals) ipqn, nob(irr + 1)
785 if (pqn(1, ipqn) /= 0)
then
786 nso = nso +
shlmx1(irr + 1)
788 nso = nso + (pqn(3, ipqn) - pqn(2, ipqn) + 1)*
shlmx1(irr + 1)
791 if (nelecp(iset) > nso)
then
792 write (nftw, err_few_shells) iset, nelecp(iset), nso
799 npqn = sum(nshlp(1:ndprod))
800 if (all(pqn(1, 1:npqn) == 0))
then
803 do ishl = 1, nshlp(iset)
806 if (nelecp(iset) > 0)
then
807 do iorb = pqn(2, ipqn), pqn(3, ipqn)
811 do jshl = 1, nshlp(jset)
814 if (jpqn < ipqn .and. nelecp(jset) > 0 .and. mshl(jpqn) == mshl(ipqn))
then
815 do jorb = pqn(2, jpqn), pqn(3, jpqn)
816 if (iorb == jorb)
then
817 write (nftw, err_overlapping_pqns) iorb, mshl(jpqn), ipqn, jpqn
862 subroutine csfout (ia, ib, megul, nndel, cr, nr)
864 use precisn,
only : wp
865 use congen_data,
only :
lratio,
iidis2,
lcdi,
lndi,
ni,
nid,
noi,
icdi,
indi,
inodi
868 real(kind=wp),
dimension(*) :: cr
869 integer,
dimension(*) :: nr
875 if (
noi /= 0 .or.
ni /= 0 .or.
nid /= 0)
then
899 subroutine getcon (ntcon, nshcon, nrcon, nshgmx, npmax, nc, nelecg, nsym, nobt, nob, nobi, nsoi, shlmx1, exref, tcon, &
903 integer :: nc, nelecg, nobt, npmax, nshgmx, nsym, ntcon
904 integer,
dimension(*) :: exref, nob, nobi, nrcon, nshcon, nsoi, shlmx1
905 integer,
dimension(nobt,*) :: refcon
906 integer,
dimension(3,nshgmx,*) :: tcon
907 intent (in) exref, nelecg, nob, nobi, nobt, npmax, nrcon, nshgmx, nsoi, nsym, ntcon, shlmx1, tcon
909 intent (inout) nc, nshcon, refcon
911 integer :: ic, j, k, nel, nesym, net, netc, noc, ns, nshcr, nspf, nspi, pqnt, pqntm, symt
915 if (ntcon == 0)
return
923 if (nshcr <= nshgmx)
then
928 if (nrcon(ic) < 0 .or. nrcon(ic) > nelecg)
return
931 symt = tcon(1,j,ic) + 1
934 if (symt <= 0 .or. symt > nsym)
return
938 pqntm = pqnt + (net - 1) / nesym
939 if (pqnt <= 0 .or. pqntm > nob(symt))
return
940 nspi = nsoi(symt) + (pqnt - 1) * nesym
941 nspf = nspi + ((net + 1) / nesym) * nesym - 1
943 if (exref(ns) /= 0)
return
945 noc = nobi(symt) + pqnt - 1
949 if (refcon(noc,ic) /= 0)
return
950 refcon(noc,ic) = min(nesym, net)
954 if (netc /= nelecg)
return
963 subroutine getcup (nshlt, def, nd, nshlp, cup, error)
965 integer :: def, nd, nshlt
967 integer,
dimension(3,nshlt) :: cup
968 integer,
dimension(nd) :: nshlp
969 intent (in) def, nd, nshlp, nshlt
973 integer :: i, i1cup, i2cup, ifc, ifcup, ii, iicup, itest, j, nc, ncup, ncup2, ndm1, ns1, ns2, nsc1, nsc2
976 if (nshlt == 1)
return
1006 ns2 = ns1 + nshlp(i)
1007 nsc2 = nsc1 + (nshlp(i + 1) - 1)
1012 if (nshlp(i) /= 1) i1cup = cup(3,nsc1)
1013 if (nshlp(i+1) /= 1) i2cup = cup(3,nsc2)
1014 if (i > 1) i1cup = cup(3,ifc-1)
1030 if (cup(3,i) /= itest)
return
1031 if (cup(1,i) >= itest .or. cup(2,i) >= itest)
return
1038 if (cup(1,j) == i) nc = nc + 1
1039 if (cup(2,j) == i) nc = nc + 1
1077 subroutine getref (reforb, refgu, nrefo, nelec, refdet, nelr, nsoi, nob, shlmx, nsym, symtyp, nrfomx, e1, e2, e3)
1079 logical :: e1, e2, e3
1080 integer :: nelec, nelr, nrefo, nrfomx, nsym, symtyp
1081 integer,
dimension(*) :: nob, nsoi, refdet, shlmx
1082 integer,
dimension(*) :: refgu
1083 integer,
dimension(5,*) :: reforb
1084 intent (in) nelec, nob, nrefo, nrfomx, nsoi, nsym, refgu, reforb, shlmx, symtyp
1085 intent (out) e1, e2, e3
1086 intent (inout) nelr, refdet
1088 integer :: i, isot, j, jj, ne, neb, nelrm1, neo, ner, nesr, pqnr, pqnrm, symr, t1, tgu
1096 if (nrefo <= 0 .or. nrefo > nrfomx)
then
1102 nelr = sum(abs(reforb(3,1:nrefo)))
1103 if (nelr /= nelec)
then
1113 symr = reforb(1,i) + 1
1118 if (symtyp == 1)
then
1121 if (abs(tgu) /= 1)
then
1134 if (mod(symr,2) /= 0) tgu = -tgu
1135 symr = 2 * symr - (1 - tgu) / 2
1139 if (symr <= 0 .or. symr > nsym .or. ne <= 0)
then
1146 pqnrm = pqnr + (ne - 1) / nesr
1147 if (pqnr <= 0 .or. pqnrm > nob(symr))
then
1153 isot = nsoi(symr) + (pqnr - 1) * nesr - 1
1155 ner = nelr + ne - neo
1156 neb = min(neo, nesr - neo)
1168 if (all(reforb(3+1:3+neb,i) == -1)) cycle
1171 isot = isot - neo + 1
1174 if (neo == neb)
then
1176 if (reforb(3+j,i) < 0 .or. reforb(3+j,i) > nesr)
then
1182 refdet(ner) = isot + reforb(3+j,i)
1188 nesr_loop:
do j = 1, nesr
1190 if (reforb(3+jj,i) < 0 .or. reforb(3+jj,i) > nesr)
then
1194 if (reforb(3+jj,i) < j - 1) cycle nesr_loop
1198 refdet(ner) = isot + j - 1
1205 if (nelrm1 > 0)
then
1210 if (t1 == refdet(jj))
return
1211 if (t1 <= refdet(jj)) cycle
1213 refdet(jj) = refdet(i)
1235 use precisn,
only : wp
1236 use consts,
only : one => xone
1239 integer :: i, jj, js, lb, lb1
1259 end subroutine icgcf
1271 subroutine stwrit (nelect, confpf, qntot, cdimx, icdi, ntso, symtyp, ndimx, indi, nrefo, nodimx, inodi, nsym, gutot, nbmx, &
1272 isz, navail, idiag, megu, thres, lcdt, megul, lndt, nfto, nrerun, ltri, npflg, nndel, nob, nsoi, nsymp, &
1273 refdet, nerfs, erfs, nrefop, reforb, refgu, nelp, lpp, sname, error, byproj, lndo, lcdo, iposit, nob0, &
1274 npmult, ntgsym, mxtarg, nobe, nobp, nobv)
1276 use precisn,
only : wp
1277 use global_utils,
only : mprod
1282 iposit, isz, lcdo, lcdt, lndo, lndt, lpp, ltri, megu, &
1284 nerfs, nfto,
nndel,
nodimx, npmult, nrefo, nrefop, &
1287 character(len=80) :: sname
1288 real(kind=wp) :: thres
1289 logical,
dimension(9) :: erfs
1290 integer,
dimension(nu) :: nob, nob0, nobe, nobp, nobv,
nsoi
1291 integer,
dimension(6) :: npflg
1292 integer,
dimension(3) ::
qntot
1293 integer,
dimension(*) :: refdet, refgu
1294 integer,
dimension(5,*) :: reforb
1296 inodi, iposit, isz, lcdo, lcdt, lndo, lndt, ltri, &
1298 nelp, nerfs, nfto,
nndel, nob, nob0, nobe, nobp, nobv, &
1300 nsymp, ntgsym,
ntso,
qntot, refdet, refgu, reforb, &
1302 intent (inout) error
1304 character(len=32),
dimension(9) :: ersnts
1305 character(len=30) ::
head =
'CONGEN 1.0 IBM SAN JOSE '
1306 integer :: i, ii, imax, ip, it, junk, lsn = 64,
nitem = 30
1308 data ersnts/
'SYMMETRY TYPE OUT OF RANGE ', &
1309 'NO ORBITALS GIVEN ', &
1310 'EXDET, EXREF ALLOCATION FAILED ', &
1311 'NELECT OUT OF RANGE ', &
1312 'NREFO OUT OF RANGE ', &
1313 'SUM NELEC IN REF ORBS NE NELECT ', &
1314 'ERROR IN REFORB DATA ', &
1315 'ERROR IN TOTAL QN DATA ', &
1316 'NO CORE FOR CDI, NDI, AND NODI '/
1322 write(
nftw,
'(T2,"NELECT",T8,I4,T15,"CONFPF",I3,T27,"MULT ",I2,T38,"CDIMX ",I5,T52,"ICDI ",I6)') &
1324 write(
nftw,
'(" NTSO ",I4,T15,"SYMTYP",I3,T27,"MVAL ",I2,T38,"NIDMX ",I5,T52,"INDI ",I6)') &
1326 write(
nftw,
'(" NREFO ",I4,T27,"REFLC",I3,T38,"NODIMX",I5,T52,"INODI",I6)') nrefo,
qntot(3),
nodimx,
inodi
1327 write(
nftw,
'(" NSYM ",I4,T27,"GUTOT",I3,T38,"NCORE",I10)')
nsym,
gutot, nbmx
1328 write(
nftw,
'(T27,"ISZ ",I3,T38,"NAV ",I10)') isz, navail
1330 write(
nftw,
'(//,T14," DATA FOR SPEEDY INPUT")')
1331 write(
nftw,
'(/, T14,"IDIAG ",I4,T27,"MEGU ",I3,T38,"THRES ",1PE12.4)') idiag, megu, thres
1332 write(
nftw,
'(T14,"LCDT ",I4,T27,"MEGUL",I3)') lcdt,
megul
1333 write(
nftw,
'(T14,"LNDT ",I4,T27,"NFTO ",I3)') lndt, nfto
1334 write(
nftw,
'(T14,"NRERUN",I4,T27,"LTRI ",I3)') nrerun, ltri
1335 write(
nftw,
'(/,T14,"NPFLG =",6I3,2X,"NNDEL = ",I5)') npflg,
nndel
1339 write(
nftw,
'(T14,"BYPROJ",I2,3x,"LNDO",I10,3x,"LCDO",I10)') byproj, lndo, lcdo
1341 if (ntgsym <
mxtarg)
then
1343 write(
nftw,
'(" ntgsym",I4)') ntgsym
1349 write(
nftw,
'(" NSYM",30I5)') (ip, ip=1,nsymp)
1350 write(
nftw,
'(" NOB ",30I5)') (nob(ip), ip=1,nsymp)
1351 if (iposit /= 0)
then
1353 write(
nftw,
'(" NOB0",30I5)') (nob0(ip), ip=1,nsymp)
1354 write(
nftw,
'(" NOBE",30I5)') (nobe(ip), ip=1,nsymp)
1355 write(
nftw,
'(" NOBP",30I5)') (nobp(ip), ip=1,nsymp)
1356 write(
nftw,
'(" NOBV",30I5)') (nobv(ip), ip=1,nsymp)
1358 write(
nftw,
'(" NSOI",30I5)') (
nsoi(ip), ip=1,nsymp)
1360 if (iposit /= 0)
then
1362 write(
nftw,
'(5X,"POSITRON SCATTERING CASE: IPOSIT =",I3)') iposit
1368 do i = 1, nrefop,
nitem
1369 imax = min(i +
nitem - 1, nrefop)
1372 write(
nftw,
'(" REFERENCE DETERMINANT INPUT DATA")')
1375 write(
nftw,
'(1X,A4,I5,29I4)')
rhead(1), (ip,ip=i,imax)
1377 write(
nftw,
'(1X,A4,I5,29I4)')
rhead(ii+1), (reforb(ii,ip), ip=i,imax)
1379 if (
symtyp == 1)
write(
nftw,
'(1X,A4,I5,29I4)')
rhead(7), (refgu(ip), ip=i,imax)
1384 if (mod(nelp,
nitem) == 0) it = it + 1
1388 write(
nftw,
'(" REFDET =",30(I3,",")/(9X,30(I3,",")))') (refdet(ip), ip=1,nelp)
1392 if (
symtyp >= 2 .and. npmult /= 0)
then
1394 junk = mprod(1, 1, npmult,
nftw)
1401 if (.not. error)
then
1404 write(
nftw,
'(" **** ERROR DATA FOR &STATE FOLLOWS (&WFNGRP NOT PROCESSED)"/12X,A32)') ersnts(i)
1408 write(
nftw,
'(12X,A32)') ersnts(i)
1418 subroutine subdel (ndel, ndel1, ndel2, nndel)
1426 integer :: i, j, k, m, nndel1
1431 read(
nftr,
'(16I5)') nndel1
1433 do while (nndel1 /= 0)
1435 read(
nftr,
'(16I5)') (
ndel1(j), j=1,nndel1)
1462 if (j > nndel1)
then
1474 read(
nftr,
'(16I5)') nndel1
1478 write(
nftw,
'(" ***** NUMBER OF CHOSEN CONFIGURATIONS ***",I10)')
nndel
1487 subroutine wfnin (nwfngp, nadel, nncsf, ncsf, lcdi, lndi, nelecg, ndprod, nrefog, npcupf, negmax, refdtg, nrfgmx, refgug, &
1488 ntcon, reforg, nshgmx, nsymmx, mshl, gushl, pqn, cup, ndpmax, nshlp, nconmx, test, nrcon, nshcon, tcon, &
1492 integer :: lcdi, lndi, nadel, nconmx, ncsf, ndpmax, ndprod, negmax, nelecg, nncsf, npcupf, nrefog, nrfgmx, nshgmx, &
1493 nsymmx, ntcon, nwfngp
1494 integer,
dimension(3,*) :: cup, pqn
1495 integer,
dimension(*) :: gushl, mshl, nrcon, nshcon, nshlp, refdtg, refgug, test
1496 integer,
dimension(5,*) :: reforg
1497 integer,
dimension(3,nshgmx,*) :: tcon
1498 intent (in) nconmx, ndpmax, negmax, nrfgmx, nshgmx, nsymmx
1499 intent (out) cup, errorg, gushl, lcdi, lndi, mshl, nadel, ncsf, ndprod, nelecg, nncsf, npcupf, nrcon, nrefog, nshcon, &
1500 nshlp, ntcon, nwfngp, pqn, refdtg, refgug, reforg, tcon, test
1519 refdtg(1:negmax) = 0
1520 refgug(1:nrfgmx) = -2
1521 reforg(1:5,1:nrfgmx) = -2
1523 mshl(1:nshgmx) = nsymmx + 1
1524 gushl(1:nshgmx) = -2
1526 pqn(1:3,1:nshgmx) = -1
1527 cup(1:3,1:nshgmx) = -1
1533 nrcon(1:nconmx) = -1
1534 nshcon(1:nconmx) = 0
1536 tcon(1,1:nshgmx,1:nconmx) = -1
1537 tcon(2,1:nshgmx,1:nconmx) = 0
1538 tcon(3,1:nshgmx,1:nconmx) = 0
1540 end subroutine wfnin
1557 subroutine wfnin0 (nelecp, defltc, nerfg, erfg, gname, qntar, errorg, ndpmax)
1559 integer :: defltc, ndpmax, nerfg
1561 character(len=80) :: gname
1562 logical,
dimension(*) :: erfg
1563 integer,
dimension(*) :: nelecp
1564 integer,
dimension(3) :: qntar
1565 intent (in) ndpmax, nerfg
1566 intent (out) defltc, erfg, gname, nelecp, qntar
1568 nelecp(1:ndpmax) = -1
1569 erfg(1:nerfg) = .false.
1583 subroutine wrnmlt (k, sname, nrerun, megul, symtyp, mgvn, s, sz, r, pin, ncsf, byproj, lcdi, lndi, lcdo, lndo, lcdt, lndt, &
1584 nfto, ltri, idiag, npflg, thres, nelect, nsym, nob, refdet, nftw, iposit, nob0, nobl, nob0l, nx, nobe, &
1587 use precisn,
only : wp
1589 integer :: byproj, idiag, iposit, k, lcdi, lcdo, lcdt, lndi, lndo, lndt, ltri, megul, mgvn, ncsf, nelect, nfto, nftw, &
1590 nrerun, nsym, nx, symtyp
1591 real(kind=wp) :: pin, r, s, sz, thres
1592 character(len=80) :: sname
1593 integer,
dimension(*) :: nob, nob0, refdet
1594 integer,
dimension(nx) :: nob0l, nobl
1595 integer,
dimension(nx) :: nobe, nobp, nobv
1596 integer,
dimension(6) :: npflg
1597 intent (in) byproj, idiag, iposit, k, lcdi, lcdo, lcdt, lndi, lndo, lndt, ltri, megul, mgvn, ncsf, nelect, nfto, &
1598 nob, nob0, nob0l, nobe, nobl, nobp, nobv, npflg, nrerun, nsym, nx, pin, r, refdet, s, sname, symtyp, &
1601 character(len=4) :: blank1 =
' '
1604 write(k,
'(" &INPUT")')
1605 write(k,
'(" NAME=''",A80,"'',")') sname
1606 write(k,
'(" NRERUN=",I3,", MEGUL=",I3,", SYMTYP=",I3,",")') nrerun, megul, symtyp
1607 write(k,
'(" MGVN=",I3,", S=",F6.1,",SZ=",F6.1,", R=",F6.1,", PIN=",F6.1,", NOCSF=",I6,",")') mgvn, s, sz, r, pin, ncsf
1608 write(k,
'(" BYPROJ=",I2,",")') byproj
1609 write(k,
'(" LCDI=",I15,", LNDI=",I15,", LCDO=",I7,", LNDO=",I15,","," LCDT=",I7,", LNDT=",I7,",")') &
1610 lcdi, lndi, lcdo, lndo, lcdt, lndt
1611 write(k,
'(" NFTO=",I3,", LTRI=",I5,", IDIAG=",I3,", NPFLG=",5(I2,",")," NPMSPD =",I2,",")') nfto, ltri, idiag, npflg
1612 write(k,
'(" THRES=",1PD9.2,",")') thres
1613 write(k,
'(" NELT=",I4,", NSYM=",I3,", NOB=",10(1x,I0,","))') nelect, nsym, (nob(j), j=1,nsym)
1614 write(k,
'(" NDTRF=",12(1x,I0,",")/(8X,12(1x,I0,",")))') (refdet(j), j=1,nelect)
1615 write(k,
'(" NOBL=",10(1x,I0,","))') nobl
1616 write(k,
'(" NOB0L=",10(1x,I0,","))') nob0l
1618 if (iposit /= 0)
then
1619 write(k,
'(" IPOSIT=",I3)') iposit
1620 write(k,
'(" NOB0=",10(1x,I0,","))') (nob0(j), j=1,nsym)
1621 write(k,
'(" NOBE=",10(1x,I0,","))') (nobe(j), j=1,nsym)
1622 write(k,
'(" NOBP=",10(1x,I0,","))') (nobp(j), j=1,nsym)
1623 write(k,
'(" NOBV=",10(1x,I0,","))') (nobv(j), j=1,nsym)
1632 subroutine wvwrit (nwfngp, gname, nelecg, defltc, irfcon, ndprod, symtyp, ntcon, navail, nrefog, nelecp, nshlp, qntar, &
1633 nshlpt, nshgmx, mshl, gushl, pqn, cup, ncupp, npcupf, refdtg, nelp, ntconp, nshcon, nobt, reforb, &
1634 refgu, test, nrcon, tcon, refcon, nerfg, erfg, ndpp, nrefop, lsquare, errorg)
1639 integer :: defltc,
irfcon, navail, ncupp, ndpp, ndprod, nelecg, nelp, nerfg,
nobt, npcupf, nrefog, nrefop, &
1640 nshgmx, nshlpt,
ntcon, ntconp, nwfngp,
symtyp, lsquare
1642 character(len=80) :: gname
1643 integer,
dimension(3,*) ::
cup, pqn
1644 logical,
dimension(11) :: erfg
1645 integer,
dimension(*) ::
gushl,
mshl, nelecp,
nrcon, nshcon, nshlp, refcon, refdtg, refgu,
test
1648 integer,
dimension(3) ::
qntar
1649 integer,
dimension(5,*) :: reforb
1650 integer,
dimension(3,nshgmx,*) :: tcon
1652 intent (in) cup, defltc, erfg, gname,
gushl,
irfcon,
mshl, navail, ncupp, ndpp, ndprod, nelecg, nelecp, nelp, &
1653 nerfg,
nobt, npcupf,
nrcon, nrefog, nrefop, nshcon, nshgmx, nshlp, nshlpt,
ntcon, ntconp, nwfngp, pqn, &
1654 qntar, refcon, refdtg, refgu, reforb,
symtyp, tcon, lsquare
1655 intent (inout) errorg,
test
1657 character(len=32),
dimension(11) :: ersntg
1658 character(len=4) :: hcup =
'CUP ', htcon =
'TCON', lpc =
' ( '
1659 integer :: i, i1, i2, ic, ii, iimax, imax, ip, ishp, it, jj, jnshl, nshcr, nit1 = 10, nit2 = 30
1661 data ersntg/
'NELECG OUT OF RANGE ', &
1662 'NDPROD TOO LARGE ', &
1663 'NSHLP OUT OF RANGE ', &
1664 'NELECG NE SUM OF NELEP ', &
1665 'NREF OUT OF RANGE ', &
1666 'NELECG NE SUM OVER NELEC IN REFO', &
1667 'ERROR IN REF ORB DATA ', &
1668 'ERROR IN SHELL DATA ', &
1669 'ERROR IN COUPLING DATA ', &
1670 'ERROR IN CONFIG CONSTRAINT DATA ', &
1671 'NO SPACE FOR REFCON ARRAY '/
1676 write(
nftw,
'(" WFN GROUP",I4,4X,A80)') nwfngp, gname
1677 write(
nftw,
'(" NELECG",I4,T15,"DEFLTC",I3,T27,"IRFCON",I6)') nelecg, defltc,
irfcon
1678 write(
nftw,
'(" NDPROD",I4,T15,"NTCON ",I3,T27,"NAV ",I10)') ndprod,
ntcon, navail
1679 write(
nftw,
'(" LSQUARE",I3)') lsquare
1680 write(
nftw,
'(" NREFOG",I4,/)') nrefog
1681 write(
nftw,
'(9X,9I3)') (i, i=1,ndpp)
1682 write(
nftw,
'(" NELECP =",9I3)') (nelecp(i), i=1,ndpp)
1683 write(
nftw,
'(" NSHLP =",9I3)') (nshlp(i), i=1,ndpp)
1685 if (
qntar(1) /= -1)
then
1687 write(
nftw,
'(5X,"TARGET MULTIPLICITY =",I5,5X,"TARGET SYMMETRY =",I5,5X,"TARGET INVERSION SYMMETRY =",I5)') &
1693 if (ndprod /= 0 .and. nshlpt <= nshgmx)
then
1695 it = merge(1, 0,
symtyp == 1)
1700 if (jnshl == 0)
then
1702 write(
nftw,
'(I4," ORBITALS IN GROUP",I2)') jnshl, ip
1705 do i = 1, jnshl, nit1
1706 imax = min(i + nit1 - 1, jnshl)
1709 write(
nftw,
'(I4," ORBITALS IN GROUP",I2)') jnshl, ip
1713 write(
nftw,
'(1X,A4,I8,9I12)')
rhead(1), (ii, ii=i,imax)
1714 write(
nftw,
'(1X,A4,I8,9I12)')
rhead(2), (
mshl(ishp+ii), ii=i,imax)
1716 write(
nftw,
'(1X,A4,10(A3,I2,",",I2,",",I2,")"))')
rhead(3), (lpc,(pqn(jj,ishp+ii), jj=1,3), ii=i,imax)
1724 if (ncupp * npcupf /= 0)
then
1725 do i = 1, ncupp, nit1
1726 imax = min(i + nit1 - 1, ncupp)
1731 write(
nftw,
'(" COUPLING DATA")')
1735 write(
nftw,
'(1X,A4,I8,9I12)')
rhead(1), (ii, ii=i1,i2)
1736 write(
nftw,
'(1X,A4,10(A3,I2,",",I2,",",I2,")"))') hcup, (lpc,(
cup(jj,ii), jj=1,3), ii=i,imax)
1741 it = merge(2, 1,
symtyp == 1)
1743 do i = 1, nrefop, nit2
1744 imax = min(i + nit2 - 1, nrefop)
1747 write(
nftw,
'(" REFERENCE DETERMINANT INPUT DATA")')
1750 write(
nftw,
'(1X,A4,I5,29I4)')
rhead(1), (ip, ip=i,imax)
1752 write(
nftw,
'(1X,A4,I5,29I4)')
rhead(ii+1), (reforb(ii,ip), ip=i,imax)
1754 if (
symtyp == 1)
write(
nftw,
'(1X,A4,I5,29I4)')
rhead(7), (refgu(ip), ip=i,imax)
1760 it = (nelp + nit2 - 1) / nit2
1761 if (mod(nelp, nit2) == 0) it = it + 1
1764 write(
nftw,
'(" REFDET =",30(I3,","),/,(9X,30(I3,",")))') (refdtg(ip), ip=1,nelp)
1771 it = 1 + 2 * ((nshcr + nit1 - 1) / nit1) + 1 + (
nobt + nit2 - 1) / nit2
1772 if (mod(
nobt, nit2) == 0) it = it + 1
1775 write(
nftw,
'(" EXITATION CONSTRAINTS / TCON(SYM,PQN,NE",/)')
1779 if (
test(ic) /= 1)
then
1780 write(
nftw,
'(I3,10X,"GT",I3," REPLACEMENTS ALLOWED(INTERSECTION)")') ic,
nrcon(ic)
1783 write(
nftw,
'(I3,10X,"LE",I3," REPLACEMENTS ALLOWED(UNION)")') ic,
nrcon(ic)
1785 if (nshcr /= 0)
then
1786 do ii = 1, nshcr, nit1
1787 iimax = min(ii + nit1 - 1, nshcr)
1788 write(
nftw,
'(1X,A4,I8,9I12)')
rhead(1), (ip, ip=ii,iimax)
1789 write(
nftw,
'(1X,A4,10(A3,I2,",",I2,",",I2,")"))') htcon, (lpc,(tcon(jj,ip,ic), jj=1,3), ip=ii,iimax)
1792 write(
nftw,
'(" REFCON =",30(I3,",")/(9X,30(I3,",")))') (refcon(ip), ip=1,
nobt)
1802 if (.not. erfg(i)) cycle
1803 if (.not. errorg)
then
1806 write(
nftw,
'(" **** ERROR DATA FOR &WFNGRP FOLLOWS",/,12X,A32)') ersntg(i)
1811 write(
nftw,
'(12X,A32)') ersntg(i)
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).
integer, dimension(nu) shlmx1
Maximal occupancy of orbitals per symmetry.
integer lndi
Total number of integers forming packed determinants.
integer, dimension(jz) test
Determines which of the two types of constraints will be used.
integer, parameter jsmax
Maximal order of precomputed binomial coefficients.
integer, parameter nz
Used to dimension REFDET in congen_driver::csfgen; maximum number of electrons.
integer icdi
Position in workspace where the determinant coefficients start (one coeff per one determinant).
integer, dimension(lg) gushl
Gerade/ungerade per shell.
integer, parameter nftr
Unit number for reading standard input.
integer, parameter kz
Used to dimension REFDTG in csfgen; limit on input variable NELECG?
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, parameter ny
Used to dimension REFGU and REFORB in csfgen. Limit on input variable NREFO.
integer nisz
Total S_z, set by CSFGEN, defaults to first element of qntot.
character(len=1), dimension(132) head
String with output page number and user-specific header text.
integer ndel1
Workspace position used for reading CSFs from the input.
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, parameter jz
Maximum number of constraints upon CSFs accepted (limit on input variable NTCON).
integer, dimension(3) qntot
Total quantum numbers.
integer, dimension(jz) nrcon
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, dimension(:), allocatable exdet
integer confpf
Print flag for the amount of print given of configurations and prototypes.
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, parameter jy
Used to dimension various arrays in csfgen including NELECP and NSHLP. Limit on input variable NDPROD...
integer ift
Used to signal to congen_distribution::assign to initialize some variables.
integer nncsf
Number of CSFs generated by congen_distribution::wfn (total).
integer ndel2
Workspace position used for reading CSFs from the input.
integer, parameter nu
Maximal number of irreducible representation (= max dimension of NOB etc.).
integer, dimension(3, lg) pqnst
integer, dimension(nu) nobi
Running index of the first orbital in each symmetry.
integer, parameter mxtarg
Maximum number of target state symmetries.
integer lratio
Ratio of real size to integer size. Used to manage workspace data.
integer cdimx
Maximal number of determinants.
integer nid
Length of the integer array containing all packed determinants.
integer ndimx
Maximal number of workspace elements usable for packed determinant data.
integer nsym
Number of symmetries given in input file (right-trimmed of those with zero orbitals).
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(3, lg) cup
Coupling scheme data. ???
integer, parameter ky
Used to dimension REFGUG and REFORG in congen_driver::csfgen. Limit on input variable NREFOG?
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.
integer, parameter jx
Used to dimension many arrays in congen_driver::csfgen; limit on the sum of elements in the NSHLP arr...
integer noi
Number of determinants per CSF.
character(len=4), dimension(7), parameter rhead
integer nx
Full or remaining workspace size (depending on context).
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, 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, 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 state(ns, x, last, nd, confpf)
?
subroutine, private getref(reforb, refgu, nrefo, nelec, refdet, nelr, nsoi, nob, shlmx, nsym, symtyp, nrfomx, e1, e2, e3)
Form reference list of spin-orbital numbers.
subroutine, private icgcf
Precomputes needed binomial coefficients.
subroutine, private csfout(ia, ib, megul, nndel, cr, nr)
Store the wave function to file and reset arrays.
subroutine, public csfgen
Central CONGEN subroutine.
subroutine, private wrnmlt(k, sname, nrerun, megul, symtyp, mgvn, s, sz, r, pin, ncsf, byproj, lcdi, lndi, lcdo, lndo, lcdt, lndt, nfto, ltri, idiag, npflg, thres, nelect, nsym, nob, refdet, nftw, iposit, nob0, nobl, nob0l, nx, nobe, nobp, nobv)
Final text information output.
subroutine, private wfnin0(nelecp, defltc, nerfg, erfg, gname, qntar, errorg, ndpmax)
Defaults to be reset before every wfngrp.
subroutine, private getcon(ntcon, nshcon, nrcon, nshgmx, npmax, nc, nelecg, nsym, nobt, nob, nobi, nsoi, shlmx1, exref, tcon, refcon, error)
Check tcon data and form refcon array.
subroutine wfngrp_sanity_check(nftw, nob, ndprod, nelecp, nshlp, pqn, mshl)
Check electron distribution.
subroutine, private stwrit(nelect, confpf, qntot, cdimx, icdi, ntso, symtyp, ndimx, indi, nrefo, nodimx, inodi, nsym, gutot, nbmx, isz, navail, idiag, megu, thres, lcdt, megul, lndt, nfto, nrerun, ltri, npflg, nndel, nob, nsoi, nsymp, refdet, nerfs, erfs, nrefop, reforb, refgu, nelp, lpp, sname, error, byproj, lndo, lcdo, iposit, nob0, npmult, ntgsym, mxtarg, nobe, nobp, nobv)
Write information obtained from &state.
subroutine, private getcup(nshlt, def, nd, nshlp, cup, error)
Set up coupling scheme.
subroutine, private subdel(ndel, ndel1, ndel2, nndel)
Read CSFs from input stream.
subroutine, private wvwrit(nwfngp, gname, nelecg, defltc, irfcon, ndprod, symtyp, ntcon, navail, nrefog, nelecp, nshlp, qntar, nshlpt, nshgmx, mshl, gushl, pqn, cup, ncupp, npcupf, refdtg, nelp, ntconp, nshcon, nobt, reforb, refgu, test, nrcon, tcon, refcon, nerfg, erfg, ndpp, nrefop, lsquare, errorg)
Display information about the wave function group.
subroutine, private wfnin(nwfngp, nadel, nncsf, ncsf, lcdi, lndi, nelecg, ndprod, nrefog, npcupf, negmax, refdtg, nrfgmx, refgug, ntcon, reforg, nshgmx, nsymmx, mshl, gushl, pqn, cup, ndpmax, nshlp, nconmx, test, nrcon, nshcon, tcon, errorg)
Set defaults for wave function group parameters.
subroutine, public ctlpg1(lpp, h1, nh1, h2, nh2)
Controls page layout and counting.
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.
Projection on spin states.
subroutine, public projec(sname, megul, symtyp, mgvn, s, sz, r, pin, nocsf, byproj, idiag, npflg, thres, nelt, nsym, nob, ndtrf, nftw, iposit, nob0, nob1, nob01, iscat, ntgsym, notgt, nctgt, mcont, gucont, mrkorb, mdegen, mflag, nobe, nobp, nobv, maxtgsym)
Project the wave function.