1310 subroutine prjct (nelt, mxss, nodi, ndo, cdi, nodo, cdo, maxcdo, mgvn, iss, isd, thres, r, ndtr, mm, ms, maxndo, symtyp, nsrb)
1312 use precisn,
only : wp
1315 real(kind=wp) :: fcta,fctb,fctc,fctr,tmp
1316 real(kind=wp),
parameter :: zero = 0.0_wp
1317 real(kind=wp),
parameter :: one = 1.0_wp
1318 real(kind=wp),
parameter :: four = 4.0_wp
1331 real(kind=wp) :: thres
1332 real(kind=wp) :: cdi(*)
1333 real(kind=wp) :: cdo(maxcdo)
1338 integer,
target :: ndo(maxndo)
1339 integer :: ndtr(nsrb)
1343 integer :: i, ia, ib, id, idet, is, issp, istart, ma, mb, mga, mgb, nd, ninitial_dets
1345 integer,
pointer :: ndo_ptr(:)
1346 logical,
parameter :: zdebug = .false.
1353 write(6,
'(/,20x,"====> prjct() - project wavefunction <====",/)')
1354 write(6,
'( 20x,"Input data: ")')
1355 write(6,
'( 20x," # electrons open shell (nelt) = ",I7)') nelt
1356 write(6,
'( 20x," Maximum S for projection (mxss) = ",I7)') mxss
1357 write(6,
'( 20x," Lambda value for Wavefn (mgvn) = ",I7)') mgvn
1358 write(6,
'( 20x," Required Spin value (iss) = ",I7)') iss
1359 write(6,
'( 20x," Required Sz value (isd) = ",I7)') isd
1360 write(6,
'( 20x," Threshold (thres) = ",D13.6)') thres
1361 write(6,
'( 20x," Dimension of cdo() (maxcdo) = ",I7)') maxcdo
1362 write(6,
'( 20x," Dimension of ndo() (maxndo) = ",I7)') maxndo
1363 write(6,
'( 20x," Abelian/C-inf-v flag (symtyp) = ",I7)') symtyp
1364 write(6,
'( 20x," Number of spin orbs (nsrb) = ",I7,/)') nsrb
1365 write(6,
'( 20x,"No. of dets in this CSF (nodi) = ",I7)') nodi
1368 istart = (idet - 1) * nelt
1369 write(6,
'(/,20x,"Det No = ",I7," Coeff (cdi) = ",D13.6,/)') idet, cdi(idet)
1370 write(6,
'( 20x," Sp. orbs in open shells (ndi) = ",20(I4,1x))') (ndo(istart+i), i=1,nelt)
1376 ninitial_dets = nodi
1379 fcta = -nelt * (nelt - 4)
1380 fctb = iss * (iss + 2)
1387 cdo(1:nodi) = cdi(1:nodi)
1390 ndo_ptr => ndo(1:maxndo)
1391 call bst % init(ndo_ptr, nelt)
1393 call bst % insert(id)
1395 write(6,
'(/,20x,"Bstree after add det #",I0,": ")') id
1396 call bst % output(22)
1402 write(6,
'(/,20x,"Entering loop over components of spin",/)')
1403 write(6,
'( 20x," fcta = ",D13.6)') fcta
1404 write(6,
'( 20x," fctb = ",D13.6)') fctb
1405 write(6,
'( 20x," issp = ",I6,/)') issp
1411 spin_loop:
do is = isd + 1, mxss + 1, 2
1414 if (is == issp) cycle
1417 fctc = (is - 1) * (is + 1)
1418 fctr = (fcta - fctc) / (fctb - fctc)
1421 write(6,
'(/,20x,"Working on Spin Iteration (is) = ",I5,/)') is
1422 write(6,
'( 20x," Factor fctc = ",D13.6)') fctc
1423 write(6,
'( 20x," Factor fctr = ",D13.6,/)') fctr
1428 cdo(1:nodi) = fctr * cdi(1:nodi)
1438 determinant_loop:
do id = 1, nodi
1440 fctr = four * cdi(id) / (fctb - fctc)
1443 write(6,
'(23x,"Working on determinant (id) = ",I5," of ",I5)') id, nodi
1444 write(6,
'(23x,"Coefficient, cdi() = ",D13.6 )') cdi(id)
1445 write(6,
'(23x,"Factor (fctr) = ",D13.6,/)') fctr
1446 write(6,
'(23x,"Current op-shl det: ",20(I3,1x),/,(20x,20(I3,1x)) )') (ndo(nd+i), i=1,nelt)
1452 first_electron_loop:
do ia = 2, nelt
1453 second_electron_loop:
do ib = 1, ia - 1
1457 ndtr(1:nelt) = ndo(nd+1:nd+nelt)
1469 write(6,
'(23x,"Evaluating electron pair: ")')
1470 write(6,
'(23x," #1: idx(ia) = ",I3,"sporb(ma) = ",I3," Sz (mga) = ",I3 )') ia, ma, mga
1471 write(6,
'(23x," #2: idx(ib) = ",I3,"sporb(mb) = ",I3," Sz (mgb) = ",I3,/)') ib, mb, mgb
1499 if (mga == mgb)
then
1500 cdo(id) = cdo(id) + fctr
1516 flip = (mod(
qsort(nelt, ndtr(1:nelt)), 2) /= 0)
1519 write(6,
'(23x,"New valid determinant produced by this pair",/)')
1520 write(6,
'(23x,"New open shell det: ",20(I3,1x),/,(20x,20(I3,1x)) )') (ndtr(i), i=1,nelt)
1527 if (ndtr(i) == ma .and. i /= ia) cycle
1528 if (ndtr(i) == mb .and. i /= ib) cycle
1540 call stmrg (nelt, maxcdo, maxndo, ndo, cdo, nodo, ndtr, merge(-fctr, fctr, flip), bst)
1542 end do second_electron_loop
1543 end do first_electron_loop
1550 end do determinant_loop
1555 call cntrct (nelt, nodo, ndo, cdo, thres)
1560 write(6,
'(/,10x,"**** Error in prjct() ",/)')
1561 write(6,
'( 10x,"After removing all determinants with expansion ")')
1562 write(6,
'( 10x,"coefficients less than (thres) = ",D13.6)') thres
1563 write(6,
'( 10x,"there are no determinants left in this CSF",/)')
1575 cdi(1:nodi) = cdo(1:nodi)
1582 if (symtyp <= 1 .and. mgvn == 0)
then
1583 if (zdebug)
write(6,
'(/,20x,"Analysis of Reflection operator required",/)')
1586 cdi(1:nodi) = cdo(1:nodi)
1588 call rfltn (nelt, nodi, ndo, cdi, r, maxcdo, maxndo, thres, nodo, cdo, ndtr, mm, bst)
1591 write(6,
'(/,10x,"**** Error in prjct() ",/)')
1592 write(6,
'( 10x,"After reflection analysis there are no ")')
1593 write(6,
'( 10x,"no determinants left in the CSF",/)')
1602 write(6,
'(/,20x,"Coefficients after projection ")')
1603 write(6,
'( 20x," (but not yet normalized) ",/)')
1604 write(6,
'( 20x," No. of determinants (nodi) = ",I6,/)') nodi
1605 write(6,
'(20x,I4,2x,D13.6)') (i, cdi(i), i=1,nodi)
1610 tmp =
snrm2(nodo, cdo, 1)
1611 tmp = one / sqrt(tmp)
1614 cdo(i) = cdo(i) * tmp
1622 write(6,
'(20x,"Final number of determinants in CSF (nodo) = ",I5,/)') nodo
1624 if (nodo /= ninitial_dets)
then
1625 ia = nodo - ninitial_dets
1626 write(6,
'(20x,"The length of the CSF has changed: ")')
1627 write(6,
'(20x," Initial number of dets = ",I6)') ninitial_dets
1628 write(6,
'(20x," # of dets added = ",I6," by projection",/)') ia
1630 write(6,
'(20x,"# of dets in the CSF has NOT changed ",/)')
1633 write(6,
'(/,20x,"**** prjct() - completed",/)')
1646 subroutine projec (sname, megul, symtyp, mgvn, s, sz, r, pin, nocsf, byproj, idiag, npflg, thres, &
1647 nelt, nsym, nob, ndtrf, nftw, iposit, nob0, nob1, nob01, iscat, ntgsym, notgt, &
1648 nctgt, mcont, gucont, mrkorb, mdegen, mflag, nobe, nobp, nobv, maxtgsym)
1650 use precisn,
only : wp
1651 use global_utils,
only : mprod
1653 integer,
intent(in) :: iscat, mflag
1654 integer,
intent(inout) :: ntgsym
1655 integer :: byproj, idiag, iposit, megul, mgvn, nelt, nftw, nocsf, &
1656 nsym, symtyp, npflg(6), num_csfs_unproj, num_dets_unproj, &
1658 real(kind=wp) :: pin, r, s, sz, thres
1659 character(len=80) :: sname
1660 integer,
dimension(ntgsym) :: gucont, mcont, mdegen, mrkorb, nctgt, notgt
1661 integer,
dimension(nsym) :: nob, nob0, nob01, nobe, nobp, nobv
1662 integer,
dimension(nelt) :: ndtrf
1663 integer,
dimension(*) :: nob1
1665 integer :: i,nalm,nb,nctarg,nd,nl,norb,junk, isd,iss,n,k,msum,isum,m,ierr, &
1666 num_dets,nreps,maxndi,maxcdi, maxndo,maxcdo,lenndo,lencdo, &
1667 leniphase,leniphase0,maxtgsym
1673 integer :: wfn_unproj_num_csfs, &
1674 wfn_unproj_num_dets, &
1675 wfn_unproj_len_pkd_dets
1676 integer,
allocatable :: wfn_unproj_dets_per_csf(:), &
1677 wfn_unproj_packed_dets(:), &
1678 wfn_unproj_indx_1st_det_per_csf(:), &
1679 wfn_unproj_indx_1st_coeff_per_csf(:)
1680 real(kind=wp),
allocatable :: wfn_unproj_coefficients_per_det(:)
1686 integer :: wfn_proj_num_csfs, &
1687 wfn_proj_num_dets, &
1688 wfn_proj_len_pkd_dets
1689 integer,
allocatable :: wfn_proj_dets_per_csf(:), &
1690 wfn_proj_packed_dets(:), &
1691 wfn_proj_indx_1st_det_per_csf(:), &
1692 wfn_proj_indx_1st_coeff_per_csf(:)
1693 real(kind=wp),
allocatable :: wfn_proj_coefficients_per_det(:)
1699 integer :: nsrb,noarg
1700 integer,
allocatable :: itab_sporb_indx_in_sym(:), &
1701 itab_sporb_gu_value(:), &
1702 itab_sporb_sym(:), &
1703 itab_sporb_isz(:), &
1704 itab_sporb_mpos(:), &
1711 integer,
allocatable :: nconf(:),
iphase(:),iphase0(:)
1721 logical :: zbypass_wfn_projection, &
1722 zadjust_wfn_phase_for_scattering, &
1723 zpositrons,ztarget_state_calculation, &
1724 zscattering_calculation,zabelian
1726 integer :: num_csfs_proj, num_dets_proj, len_pkd_dets_proj
1729 if (symtyp >= 2)
then
1730 write(nftw,
'(" MOLECULE SYMMETRY CASE, symtyp =",I2)') symtyp
1731 junk = mprod(1, 1, npflg(6), nftw)
1747 zbypass_wfn_projection = byproj == 0
1748 zadjust_wfn_phase_for_scattering = iscat > 0
1749 zpositrons = iposit /= 0
1750 zabelian = symtyp == 2
1756 nsrb = sum(nob(1:nsym))
1765 allocate(itab_sporb_indx_in_sym(nsrb), stat = ierr)
1768 write(nftw,9950)
'itab_sporb_indx_in_sym', ierr
1772 allocate(itab_sporb_gu_value(nsrb),stat = ierr)
1775 write(nftw,9950)
'itab_sporb_gu_value', ierr
1779 allocate(itab_sporb_sym(nsrb), stat = ierr)
1782 write(nftw,9950)
'itab_sporb_sym', ierr
1786 allocate(itab_sporb_isz(nsrb), stat = ierr)
1789 write(nftw,9950)
'itab_sporb_isz', ierr
1793 allocate(itab_sporb_mpos(nsrb), stat = ierr)
1796 write(nftw,9950)
'itab_sporb_mpos', ierr
1800 allocate(map_orbitals(norb), stat = ierr)
1803 write(nftw,9950)
'mpos_orbitals', ierr
1816 if (zpositrons .and. zabelian)
then
1817 call pmkorbs (nob, nobe, nsym, &
1818 itab_sporb_indx_in_sym, &
1819 itab_sporb_gu_value, &
1827 call mkorbs (nob, nsym, &
1828 itab_sporb_indx_in_sym, &
1829 itab_sporb_gu_value, &
1832 norb, nsrb, map_orbitals, &
1834 iposit, nob1, nob01, symtyp)
1842 if (.not. zabelian)
then
1846 msum = msum + itab_sporb_sym(m)
1847 isum = isum + 1 - itab_sporb_isz(m) - itab_sporb_isz(m)
1853 msum = mprod(msum, itab_sporb_sym(m) + 1, 0, nftw)
1854 isum = isum + 1 - itab_sporb_isz(m) - itab_sporb_isz(m)
1863 if (abs(msum) /= mgvn)
then
1869 if (abs(isum) /= isd)
then
1871 write(nftw,1195) abs(isum), isd
1885 call rdwf_getsize (megul, wfn_unproj_num_csfs, wfn_unproj_num_dets, wfn_unproj_len_pkd_dets)
1896 allocate(wfn_unproj_dets_per_csf(wfn_unproj_num_csfs), stat = ierr)
1899 write(nftw,9950)
'wfn_unproj_dets_per_csf', ierr
1907 allocate(wfn_unproj_coefficients_per_det(wfn_unproj_num_dets), stat = ierr)
1910 write(nftw,9950)
'wfn_unproj_coefficients_per_det',ierr
1918 allocate(wfn_unproj_packed_dets(wfn_unproj_len_pkd_dets), stat = ierr)
1921 write(nftw,9950)
'wfn_unproj_packed_dets', ierr
1931 allocate(wfn_unproj_indx_1st_det_per_csf(wfn_unproj_num_csfs+1), stat = ierr)
1934 write(nftw,9950)
'wfn_unproj_indx_1st_det_per_csf',ierr
1944 allocate(wfn_unproj_indx_1st_coeff_per_csf(wfn_unproj_num_csfs+1), stat = ierr)
1947 write(nftw,9950)
'wfn_unproj_indx_1st_coeff_per_csf', ierr
1957 call rdwf (megul, num_csfs_unproj, wfn_unproj_dets_per_csf, &
1958 num_dets_unproj, wfn_unproj_coefficients_per_det, &
1959 len_pkd_dets_unproj, wfn_unproj_packed_dets)
1965 if (num_csfs_unproj /= wfn_unproj_num_csfs)
then
1966 write(nftw,*)
' Error 1 '
1970 if (num_dets_unproj /= wfn_unproj_num_dets)
then
1971 write(nftw,*)
' Error 2 '
1975 if (len_pkd_dets_unproj /= wfn_unproj_len_pkd_dets)
then
1976 write(nftw,*)
' Error 3 '
1995 wfn_unproj_indx_1st_coeff_per_csf(1) = 1
1997 do n = 2, num_csfs_unproj
1998 wfn_unproj_indx_1st_coeff_per_csf(n) = &
1999 wfn_unproj_indx_1st_coeff_per_csf(n-1) + &
2000 wfn_unproj_dets_per_csf(n-1)
2003 wfn_unproj_indx_1st_coeff_per_csf(num_csfs_unproj+1) = &
2004 wfn_unproj_indx_1st_coeff_per_csf(num_csfs_unproj) + &
2005 wfn_unproj_dets_per_csf(num_csfs_unproj)
2011 wfn_unproj_indx_1st_det_per_csf(1) = 1
2013 do n = 1, num_csfs_unproj
2014 num_dets = wfn_unproj_dets_per_csf(n)
2016 nreps = wfn_unproj_packed_dets(k)
2017 k = k + (2*nreps + 1)
2019 if (n <= num_csfs_unproj)
then
2020 wfn_unproj_indx_1st_det_per_csf(n+1) = k
2028 if (npflg(1) > 5)
then
2029 write(nftw,1285) megul
2030 call ptpwf (nftw,num_csfs_unproj,nelt,ndtrf, &
2031 wfn_unproj_dets_per_csf, &
2032 wfn_unproj_indx_1st_det_per_csf, &
2033 wfn_unproj_indx_1st_coeff_per_csf, &
2034 wfn_unproj_packed_dets, &
2035 wfn_unproj_coefficients_per_det)
2057 if (zbypass_wfn_projection)
then
2058 wfn_proj_num_csfs = wfn_unproj_num_csfs
2059 wfn_proj_num_dets = wfn_unproj_num_dets
2060 wfn_proj_len_pkd_dets = wfn_unproj_len_pkd_dets
2062 wfn_proj_num_csfs = wfn_unproj_num_csfs
2063 wfn_proj_num_dets = 10 * wfn_unproj_num_dets
2064 wfn_proj_len_pkd_dets = 10 * wfn_unproj_len_pkd_dets
2075 allocate(wfn_proj_dets_per_csf(wfn_proj_num_csfs), stat = ierr)
2078 write(nftw,9950)
'wfn_proj_dets_per_csf', ierr
2086 allocate(wfn_proj_coefficients_per_det(wfn_proj_num_dets), stat = ierr)
2089 write(nftw,9950)
'wfn_proj_coefficients_per_det', ierr
2097 allocate(wfn_proj_packed_dets(wfn_proj_len_pkd_dets), stat=ierr)
2100 write(nftw,9950)
'wfn_proj_packed_dets', ierr
2112 allocate(wfn_proj_indx_1st_det_per_csf(wfn_proj_num_csfs+1), stat = ierr)
2115 write(nftw,9950)
'wfn_proj_indx_1st_det_per_csf', ierr
2124 allocate(wfn_proj_indx_1st_coeff_per_csf(wfn_proj_num_csfs+1), stat = ierr)
2127 write(nftw,9950)
'wfn_proj_indx_1st_coeff_per_csf', ierr
2140 if (zbypass_wfn_projection)
then
2141 wfn_proj_dets_per_csf = wfn_unproj_dets_per_csf
2142 wfn_proj_packed_dets = wfn_unproj_packed_dets
2143 wfn_proj_coefficients_per_det = wfn_unproj_coefficients_per_det
2144 wfn_proj_indx_1st_det_per_csf = wfn_unproj_indx_1st_det_per_csf
2145 wfn_proj_indx_1st_coeff_per_csf = wfn_unproj_indx_1st_det_per_csf
2148 maxndi =
size(wfn_unproj_packed_dets)
2149 maxcdi =
size(wfn_unproj_coefficients_per_det)
2150 maxndo =
size(wfn_proj_packed_dets)
2151 maxcdo =
size(wfn_proj_coefficients_per_det)
2153 if (maxndi <= 0 .or. maxcdi <= 0) stop 901
2154 if (maxndo <= 0 .or. maxcdo <= 0) stop 902
2156 call wfgntr (mgvn, iss, isd, thres, r, symtyp, nelt, &
2157 nsym, nob, nob1, nob01, nobe, norb, nsrb, &
2158 itab_sporb_indx_in_sym, &
2159 itab_sporb_gu_value, &
2162 iposit, map_orbitals, itab_sporb_mpos, &
2163 wfn_unproj_num_csfs, &
2165 wfn_unproj_dets_per_csf, &
2166 wfn_unproj_packed_dets, &
2167 wfn_unproj_coefficients_per_det, &
2168 wfn_unproj_indx_1st_det_per_csf, &
2169 wfn_unproj_indx_1st_coeff_per_csf, &
2171 wfn_proj_dets_per_csf, &
2172 wfn_proj_packed_dets, &
2173 wfn_proj_coefficients_per_det, &
2174 wfn_proj_indx_1st_det_per_csf, &
2175 wfn_proj_indx_1st_coeff_per_csf, &
2176 maxndo, maxcdo, lenndo, lencdo, &
2177 npflg, byproj, nftw, nalm)
2191 if (npflg(3) /= 0)
then
2192 write(nftw,
'("1 OUTPUT FUNCTIONS IN PACKED FORM")')
2193 call ptpwf (nftw, wfn_proj_num_csfs, nelt, ndtrf, &
2194 wfn_proj_dets_per_csf, &
2195 wfn_proj_indx_1st_det_per_csf, &
2196 wfn_proj_indx_1st_coeff_per_csf, &
2197 wfn_proj_packed_dets, &
2198 wfn_proj_coefficients_per_det)
2209 deallocate(wfn_unproj_dets_per_csf, stat = ierr)
2212 write(nftw, 9960)
'wfn_unproj_dets_per_csf', ierr
2216 deallocate(wfn_unproj_coefficients_per_det, stat = ierr)
2219 write(nftw, 9960)
'wfn_unproj_coefficients_per_det', ierr
2223 deallocate(wfn_unproj_packed_dets, stat = ierr)
2226 write(nftw, 9960)
'wfn_unproj_packed_dets', ierr
2230 deallocate(wfn_unproj_indx_1st_det_per_csf, stat = ierr)
2233 write(nftw, 9960)
'wfn_unproj_indx_1st_det_per_csf', ierr
2237 deallocate(wfn_unproj_indx_1st_coeff_per_csf, stat = ierr)
2240 write(nftw, 9960)
'wfn_unproj_1st_coeff_per_csf', ierr
2251 ztarget_state_calculation = iscat == 1
2252 zscattering_calculation = iscat > 1
2262 allocate(nconf(nelt), stat = ierr)
2266 write(nftw, 9950)
'nconf', ierr
2274 if (ztarget_state_calculation)
then
2277 leniphase = sum(nctgt(1:ntgsym))
2280 allocate(
iphase(leniphase), stat = ierr)
2283 write(nftw, 9950)
'iphase', ierr
2293 allocate(iphase0(3*nocsf), stat = ierr)
2297 write(nftw, 9950)
'iphase0', ierr
2306 if (ztarget_state_calculation)
then
2313 call dophz0 (nftw, nocsf, nelt, ndtrf, nconf, &
2314 wfn_proj_indx_1st_det_per_csf, &
2315 wfn_proj_packed_dets, &
2317 wfn_proj_indx_1st_coeff_per_csf, &
2318 wfn_proj_coefficients_per_det, &
2323 else if (zscattering_calculation)
then
2326 write(nftw, 3110) ntgsym,notgt
2327 write(nftw, 3120) nctgt
2328 write(nftw, 3130) mcont
2330 if (symtyp == 1)
write(nftw, 3140) gucont
2331 if (npflg(5) > 0)
write(nftw, 3150) mrkorb
2332 if (symtyp <= 1 .and. mgvn > 0)
write(nftw, 3160) mdegen
2339 if (iposit .NE. 0)
then
2340 nctarg = sum(nctgt(1:maxtgsym))
2342 nctarg = sum(nctgt(1:ntgsym))
2349 call dophz (nftw, nocsf, nelt, ndtrf, nconf, &
2350 wfn_proj_indx_1st_det_per_csf, &
2351 wfn_proj_packed_dets, &
2353 wfn_proj_indx_1st_coeff_per_csf, &
2354 wfn_proj_coefficients_per_det, &
2360 nctarg, nctgt, notgt, mrkorb, &
2361 mdegen, ntgsym, mcont, &
2367 write(nftw,*)
'neither a target state nor a scattering run'
2382 write(nftw, 3167) megul
2383 call wrnfto (sname, mgvn, s, sz, r, pin, norb, nsrb, &
2384 nocsf, nelt, idiag, nsym, symtyp, &
2385 nob, ndtrf, wfn_proj_dets_per_csf, &
2387 wfn_proj_indx_1st_coeff_per_csf, &
2388 wfn_proj_indx_1st_det_per_csf, &
2389 wfn_proj_packed_dets, &
2391 wfn_proj_coefficients_per_det, &
2393 megul, nob1, 2 * nsym, &
2394 npflg, thres, iposit, nob0, nob01, nctarg, &
2395 ntgsym, notgt, nctgt, mcont, gucont,
iphase, &
2396 nobe, nobp, nobv, maxtgsym)
2397 write(nftw, 3170) megul
2399 write(nftw, 3168) megul
2402 wfn_proj_dets_per_csf, &
2404 wfn_proj_coefficients_per_det, &
2405 len_pkd_dets_proj, &
2406 wfn_proj_packed_dets)
2413 if (
allocated(nconf))
then
2414 deallocate(nconf, stat = ierr)
2417 write(nftw, 9960)
'nconf', ierr
2422 if (
allocated(
iphase))
then
2423 deallocate(
iphase, stat = ierr)
2426 write(nftw, 9960)
'iphase', ierr
2431 if (
allocated(iphase0))
then
2432 deallocate(iphase0, stat = ierr)
2435 write(nftw, 9960)
'iphase0', ierr
2448 deallocate(itab_sporb_indx_in_sym, stat = ierr)
2451 write(nftw, 9960)
'itab_sporb_indx_in_sym', ierr
2455 deallocate(itab_sporb_gu_value, stat = ierr)
2458 write(nftw, 9960)
'itab_sporb_gu_value', ierr
2462 deallocate(itab_sporb_sym, stat = ierr)
2465 write(nftw, 9960)
'itab_sporb_sym', ierr
2469 deallocate(itab_sporb_isz, stat = ierr)
2472 write(nftw, 9960)
'itab_sporb_isz', ierr
2476 deallocate(itab_sporb_mpos, stat = ierr)
2479 write(nftw, 9960)
'itab_sporb_mpos', ierr
2483 deallocate(map_orbitals, stat = ierr)
2486 write(nftw, 9960)
'mpos_orbitals', ierr
2496 40
format(.LT.
' SSZ')
2497 1000
format(/,5x,
'Projection and phase alignment of wavefunction ',/, &
2498 5x,
'============================================== ',//,&
2499 5x,
'Input data: ',/)
2500 1005
format(5x,
' Sname = ',a,/, &
2501 5x,
' Mgvn = ',i10,/, &
2502 5x,
' S = ',f10.4,/, &
2503 5x,
' Sz = ',f10.4,/, &
2504 5x,
' R = ',f10.4,/, &
2505 5x,
' Pin = ',f10.4,/, &
2506 5x,
' Nocsf = ',i10,/, &
2507 5x,
' Idiag = ',i10,//)
2508 1007
format(5x,
' Number of electrons in system (nelt) = ',i5,//, &
2509 5x,
' Reference determinant: ',//, &
2510 5x,
' (refdet) = ',10(i5,1x),/, &
2513 1020
format(5x,
' Point group (symmetry) of nuclear framework (symtyp) = ',i3,/)
2514 1021
format(5x,
' This is the C-inf-v point group',/)
2515 1022
format(5x,
' This is the D-inf-h point',/)
2516 1023
format(5x,
' This is an Abelian point group ',/)
2518 1030
format(5x,.eq.
' Bypassing wavefunction projection (byproj 0)',/)
2519 1031
format(5x,.ne.
' Wavefunction will be projected (byproj 0)',/)
2521 1035
format(5x,.gt.
' Adjusting phase of wavefunction for scattering (iscat 0)',/)
2522 1036
format(5x,.le.
' Not adjusting phase of wavefunction for scattering (iscat 0)',/)
2524 1038
format(/,5x,
' Print flags (npflg) ',/,&
2525 5x,
' ------------------- ',/,&
2526 5x,
' 1. Unprojec and projec wavefunctions : ',i5,/,&
2530 5x,
' 5. Target or scattering phase compute : ',i5,/,&
2531 5x,
' 6. Abelian point grp multiplctn table : ',i5,/)
2533 1099
format(/,5x,
'**** End of the input data',/)
2535 1110
format(/,5x,
'Total number of orbitals (norb) = ',i8,/, &
2536 5x,
'Triangulation of norb (norbb) = ',i8)
2537 1120
format(/,5x,
'Total number of spin-orbs (nsrb) = ',i8,/)
2538 1130
format(5x,
'Spin orbitals table of quantum numbers',//, &
2539 5x,
' I N G M S MPOS ',/,&
2540 5x,
'----- ----- ----- ----- ----- ----- ')
2541 1140
format((5x,6(i5,2x)))
2542 1145
format(/,5x,
'**** End of table of spin-orbitals ',/)
2544 1160
format(/,5x,
'User defined quantum numbers of ref determinant :',//,&
2545 5x,
' mgvn = ',i5,/, &
2546 5x,
' S = ',f8.3,/, &
2547 5x,
' Sz = ',f8.3,//, &
2548 5x,
'and locally computed vars for spin from S,Sz: ',//,&
2549 5x,
' iss = ',i5,/, &
2551 1170
format(/,5x,
'For check, computed q-numbers of ref det:',//,&
2552 5x,
' 2*Sz + 1 = ',i5)
2553 1180
format( 5x,
' irreducible representation = ',i5,//,&
2554 5x,
' (Note: totally symmetric representation = 0) ',/)
2556 1185
format(5x,
' Lambda value = ',i5,/)
2557 1190
format(5x,
' Symmetry quantum number in refdet is not MGVN')
2558 1195
format(5x,
' Sz in refdet (',i0,
') is not = SZ (',i0,
')')
2560 1270
format(/,5x,
'Starting to build indexes for the wavefunction',/)
2561 1280
format(/,5x,
'Finished building indexes for the wavefunction',/)
2562 1285
format(/,5x,
'Wavefunctions read from input file on unit ',i5,/)
2564 2000
format(/,5x,
'The wavefunction will be projected',//, &
2565 5x,
'This means that the wavefunction on unit ',i5,
' is an',/,&
2566 5x,
'unprojected wavefunction.',/)
2567 2010
format(5x,
'Data read from the wavefunction on unit: ',i5,//, &
2568 5x,
' number of CSFs = ',i10,/, &
2569 5x,
' number of determinants = ',i10,/, &
2570 5x,
' length of packed determinants = ',i10,//, &
2571 5x,
'This data will be used to allocate dynamic storage',/,&
2572 5x,
'in which to hold the wavefunction.',/)
2573 2100
format(5x,
'Projected CSFs in packed format:',/)
2574 3000
format(/,5x,
'Computing phase for target state',/)
2575 3100
format(/,5x,
'Performing phase correction for target',/,&
2576 5x,
'states in a scattering run',/)
2577 46
format(
' DUE TO ALARM CONDITION THIS RUN WAS TERMINATED')
2578 3110
format(/
' CI target data for SCATCI:', &
2579 //
' Number of target symmetries in expansion, NTGSYM =',&
2580 i5/
' Number of continuum orbs for each state, NOTGT =',&
2582 3120
format(
' Number of CI components for each state, NCTGT =',20i5,/,(
' ',20i5))
2583 3130
format(
' Continuum M projection for each state, MCONT =',20i5,/,(
' ',20i5))
2584 3140
format(
' Continuum G/U symmetry for each state, GUCONT =',20i5,/,(
' ',20i5))
2585 3150
format(
' Marked continuum orbital for each state, MRKORB =',20i5,/,(
' ',20i5))
2586 3160
format(
' Degenerate coupling case flag MDEGEN =',20i5,/,(
' ',20i5))
2588 3167
format(5x,
'Writing projected CSFs to unit ',i5,
' in format',/,&
2589 5x,
'required by the SCATCI/DENPROP programs ',/)
2590 3168
format(5x,
'Writing projected CSFs to unit ',i5,
' in format',/,&
2591 5x,
'required by the SPEEDY program ',/)
2592 3170
format(5x,
'Data on CSFs has been written to file (MEGUL) = ',i5/)
2593 8000
format(5x,
'***** Wavefn projection (projec()) - completed',/)
2594 9900
format(/,5x,
'***** Error in: projec() ',//)
2595 9950
format(5x,
'Cannot allocate space for array ',a,//,&
2596 5x,
'Return status from allocate() = ',i8,/)
2597 9960
format(5x,
'Cannot de-allocate space for array ',a,//,&
2598 5x,
'Return status from deallocate() = ',i8,/)
3006 subroutine wfgntr (mgvn, iss, isd, thres, r, symtyp, nelt, nsyml, nob, nobl, nob0l, nobe, norb, nsrb, &
3007 mn, mg, mm, ms, iposit, map, mpos, nocsf, ndtrf, nodi, ndi, cdi, indil, icdil, maxndi, maxcdi, &
3008 nodo, ndo, cdo, indo, icdo, maxndo, maxcdo, lenndo, lencdo, npflg, byproj, nftw, nalm)
3010 use precisn,
only : wp
3011 use global_utils,
only : mprod
3016 integer,
parameter :: len_cdit = 5000
3017 real(kind=wp) :: cdit(len_cdit)
3021 real(kind=wp),
parameter :: verysmall = 1.0d-30
3026 integer :: symtyp, byproj
3041 integer :: nocsf,nsrb
3042 integer :: maxndi,maxcdi
3043 integer,
dimension(nsyml) :: nob(nsyml),nobl(nsyml),nob0l(nsyml), nobe(nsyml)
3044 integer,
dimension(nsrb) :: mn,mg,mm,ms,map,mpos
3045 integer,
dimension(nelt) :: ndtrf
3047 real(kind=wp) :: r,thres
3071 integer,
dimension(nocsf) :: nodi
3072 integer,
dimension(maxndi) :: ndi
3073 integer,
dimension(nocsf+1) :: indil, icdil
3074 real(kind=wp),
dimension(maxcdi) :: cdi
3078 integer,
dimension(nocsf) :: nodo
3079 integer,
dimension(maxndi) :: ndo
3080 integer,
dimension(nocsf+1) :: indo, icdo
3081 real(kind=wp),
dimension(maxcdi) :: cdo
3084 integer :: n, i, num_dets_input, ipos_dets_input, ipos_coeffs_out, ipos_coeffs_in, &
3085 ipos_dets_out, idet, isum, msum, nsrbs, needed, ierr, lenmop, nalm, &
3086 ipos_this_det, nreps, me, mf, idop, idcp, ieltp, num_dets_final, mxss
3087 integer,
dimension(nelt) :: mdop, mdcp
3088 integer,
dimension(nsrb) :: mdc, mdo, ndta
3089 logical,
allocatable :: flip(:)
3092 real(kind=wp) :: mysum
3094 integer,
allocatable :: mop(:)
3097 integer :: icsf_with_max(1)
3098 integer :: max_num_dets_input
3099 integer :: max_num_dets_output
3102 logical,
parameter :: zdebug = .false.
3105 intrinsic :: sqrt, maxloc, minloc
3110 write(nftw,1010) mgvn,iss,isd,thres,r,nsyml,nelt,nocsf,nsrb
3111 write(nftw,1020) norb, ndmx, ncmx, ndmxp
3112 write(nftw,1030) maxcdo, maxndo
3114 write(nftw,1036) (i,mn(i),mg(i),mm(i),ms(i),mpos(i),i=1,nsrb)
3123 select case (symtyp)
3124 case (0) ; nsrbs = 2 * nob(1)
3125 case (1) ; nsrbs = 2 * (nob(1) + nob(2))
3126 case (2) ; nsrbs = 2 * sum(nob(1:nsyml))
3127 case default ;
write(nftw, 9900) ; stop
3131 write(nftw,1040) nsrbs
3143 max_num_dets_input = maxval(nodi)
3144 icsf_with_max = maxloc(nodi)
3152 lenmop = 7 * nelt * max_num_dets_input
3153 allocate(mop(lenmop), stat = ierr)
3156 write(nftw,9925) lenmop
3162 allocate(flip(max_num_dets_input), stat = ierr)
3165 write(nftw,9926) max_num_dets_input
3184 num_dets_input = nodi(n)
3185 ipos_dets_input = indil(n)
3186 icdo(n) = ipos_coeffs_out
3187 indo(n) = ipos_dets_out
3190 write(nftw,3010) n, nocsf, num_dets_input, ipos_dets_input, ipos_coeffs_out, ipos_dets_out
3204 ipos_this_det = ipos_dets_input
3206 do idet = 1, num_dets_input
3207 nreps = ndi(ipos_this_det)
3210 write(nftw,3020) n, idet, num_dets_input, nreps
3213 if (nreps /= 0)
then
3215 write(nftw,3030) (ndi(ipos_this_det+i), i=1,nreps)
3216 write(nftw,3035) (ndi(ipos_this_det+nreps+i), i=1,nreps)
3221 select case (symtyp)
3227 me = ndi(ipos_this_det + i)
3228 mf = ndi(ipos_this_det + nreps + i)
3229 isum = isum + ms(me) - ms(mf)
3230 msum = msum + mm(me) - mm(mf)
3237 me = ndi(ipos_this_det + i)
3238 mf = ndi(ipos_this_det + nreps + i)
3239 isum = isum + ms(me) - ms(mf)
3240 msum = mprod(msum, mprod(mm(me)+1, mm(mf)+1, 0, nftw), 0, nftw)
3253 write(nftw, 9214) idet, n
3259 write(nftw,9215) idet, n
3271 ipos_this_det = ipos_this_det + nreps + nreps + 1
3291 num_dets_input = nodi(n)
3292 ipos_dets_input = indil(n)
3294 call popnwf (nsrb, nsrbs, nelt, ndtrf, lenmop, mdop, mdcp, mop, mdc, mdo, ndta, &
3295 num_dets_input, ndi(ipos_dets_input), idop, idcp, ieltp, flip, ierr)
3300 write(nftw,4010) ieltp
3305 case (1) ;
write(nftw,233) n
3306 case (2) ;
write(nftw,235) n
3307 case (3:) ;
write(nftw,237) n
3320 ipos_coeffs_in = icdil(n) - 1
3323 do i = 1, num_dets_input
3324 if (flip(i)) cdi(ipos_coeffs_in + i) = -cdi(ipos_coeffs_in + i)
3331 if (ieltp <= 1)
then
3336 write (nftw,4522) ipos_coeffs_in, ipos_coeffs_out
3337 write (nftw,4525) (i, cdi(ipos_coeffs_in+1+i-1), i=1,num_dets_input)
3340 mysum =
snrm2(num_dets_input, cdi(ipos_coeffs_in+1), 1)
3342 if (zdebug)
write(nftw,4530) mysum
3344 if (mysum < verysmall)
then
3346 write(nftw, 2222) mysum
3350 mysum = 1.0_wp/sqrt(mysum)
3352 do i = 1, num_dets_input
3353 cdo(ipos_coeffs_out+i-1) = mysum * cdi(ipos_coeffs_in+1+i-1)
3356 num_dets_final = num_dets_input
3360 write(nftw,4525) (i, cdo(ipos_coeffs_out+i-1), i=1,num_dets_final)
3372 write(nftw,4522) ipos_coeffs_in, ipos_coeffs_out
3373 write(nftw,4525) (i, cdi(ipos_coeffs_in+1+i-1), i=1,num_dets_input)
3377 if (num_dets_input > len_cdit)
then
3379 write(nftw,9935) n, num_dets_input, len_cdit
3382 do i = 1, num_dets_input
3383 cdit(i) = cdi(ipos_coeffs_in + i)
3389 write(nftw,4525) (i, cdit(i), i=1,num_dets_input)
3405 lencdo = maxcdo - ipos_coeffs_out + 1
3408 call prjct (ieltp, mxss, num_dets_input, mop, cdit, num_dets_final, cdo(ipos_coeffs_out), &
3409 lencdo, mgvn, iss, isd, thres, r, ndta, mm, ms, lenmop, symtyp, nsrb)
3413 write(nftw,4525) (i, cdo(ipos_coeffs_out+i-1), i=1,num_dets_final)
3425 write(nftw, 4062) num_dets_final, ieltp, idop, idcp, ipos_dets_out, maxndo
3428 call pkwf (num_dets_final, ieltp, cdo(ipos_coeffs_out), mop, idop, mdop, idcp, mdcp, &
3429 nftw, ipos_dets_out, ndo, maxndo, n)
3435 nodo(n) = num_dets_final
3436 ipos_coeffs_out = ipos_coeffs_out + num_dets_final
3440 if (ipos_dets_out >= maxndo)
then
3442 write(nftw,9981) n, maxndo
3446 if (ipos_coeffs_out >= maxcdo)
then
3448 write(nftw,9982) n, maxcdo
3466 if (
allocated(mop))
then
3467 deallocate(mop, stat = ierr)
3470 write(nftw,9927) lenmop
3476 if (
allocated(flip))
then
3477 deallocate(flip, stat = ierr)
3480 write(nftw,9928) max_num_dets_input
3487 indo(nocsf+1) = ipos_dets_out
3488 icdo(nocsf+1) = ipos_coeffs_out
3491 lenndo = ipos_dets_out - 1
3492 lencdo = ipos_coeffs_out - 1
3495 max_num_dets_output = maxval( nodo )
3496 icsf_with_max = maxloc( nodo )
3498 write(nftw,2992) icsf_with_max(1), max_num_dets_output
3501 write(nftw,7990) lenndo, maxndo, lencdo, maxcdo
3505 233
format(i6,
' TH WF IN ERROR, (NO. OF OPEN SO NOT =)')
3506 237
format(i6,
' TH WF IN ERROR,(NELTP=0,BUT NOD GT. 1)')
3507 235
format(
' NEED MORE SPACE FOR MOP IN',i5,
' TH WF',/, &
3508 ' Increase parameter LNDT in input')
3509 1000
format(/,10x,
'====> WFGNTR() <====',/)
3510 1010
format( 10x,
'Input data: ',/, &
3511 10x,
' mgvn = ',i10,/, &
3512 10x,
' iss = ',i10,/, &
3513 10x,
' isd = ',i10,/, &
3514 10x,
' thres = ',f12.5,/, &
3515 10x,
' r = ',f12.5,/, &
3516 10x,
' nsyml = ',i10,/, &
3517 10x,
' nelt = ',i10,/, &
3518 10x,
' nocsf = ',i10,/, &
3520 1020
format( 10x,
' norb = ',i10,/, &
3521 10x,
' ndmx = ',i10,/, &
3522 10x,
' ncmx = ',i10,/, &
3523 10x,
' ndmxp = ',i10,/)
3524 1030
format( 10x,
' maxcdo = ',i10,/, &
3525 10x,
' maxndo = ',i10,/)
3526 1035
format(5x,
'Spin orbitals table of quantum numbers',//, &
3527 5x,
' I N G M S MPOS ',/, &
3528 5x,
'----- ----- ----- ----- ----- ----- ')
3529 1036
format((5x,6(i5,2x)))
3530 1037
format(/,5x,
'**** End of table of spin-orbitals ',/)
3531 1040
format(10x,
'No. non-degenerate spin orbitals (nsrbs) = ',i6,/)
3532 1055
format(10x,
'Allocating ',i8,
' integers for array mop() ',/)
3533 1500
format(/,10x,
'Allocated ',i10,
' integer units to array nr() ',/)
3534 2222
format(/,
' Sum IN WFGNTR =',e20.12,//)
3535 2990
format(/,10x,
'On input CSF ',i7,
' has the largest ',/, &
3536 10x,
'number of determinants = ',i7,/)
3537 2992
format(/,10x,
'On output CSF ',i7,
' has the largest ',/, &
3538 10x,
'number of determinants = ',i7,/)
3539 3000
format(/,10x,
'Entering loop over CSFs ',/)
3540 3010
format(/,10x,
'>>>> Processing input CSF ',i10,
' of ',i10,//, &
3541 10x,
'Number of determinants (num_dets_input) = ',i7,/, &
3542 10x,
'1st in pkd dets array (ipos_dets_input) = ',i7,//, &
3543 10x,
'1st in Out coefs arry (ipos_coeffs_out) = ',i7,/, &
3544 10x,
'1st in Output dets arry (ipos_dets_out) = ',i7)
3545 3020
format(/,15x,
'CSF ',i7,
' - Det. ',i6,
' of ',i6,//, &
3546 20x,
'Number of replacements (nreps) = ',i5,/)
3547 3030
format(20x,
'Replaced spin orbs : ',20(i3,1x))
3548 3035
format(20x,
'Replacments spin. orbs: ',20(i3,1x))
3549 3090
format(/,15x,
'Quantum numbers for all determinants in this CSF',/, &
3550 15x,
'have been validated.',/)
3551 4010
format(15x,
'Number of electrons in open shells (ieltp) = ',i5,/)
3552 4050
format(15x,
'The expansion coefficients for each determinant ',/ &
3553 15x,
'have been normalized.',/)
3554 4060
format(/,15x,
'This projected CSF will now be packed into',/ &
3555 15x,
'into the array holding all output packed CSF',/)
3556 4062
format(15x,
'Data sent into PKWF() follows: (old name/new name)',/, &
3557 15x,
' nod (num_dets_final) = ',i10,/, &
3558 15x,
' neltp (ieltp) = ',i10,/, &
3559 15x,
' idop (idop) = ',i10,/, &
3560 15x,
' idcp (idcp) = ',i10,/, &
3561 15x,
' no (ipos_dets_out) = ',i10,/, &
3562 15x,
' ndmx (maxndo) = ',i10,/)
3563 4510
format(15x,
'Normalizing CSF expansion coefficients using ',/, &
3564 15x,
'the SNRM2 function. Projection is not needed.'/)
3565 4520
format(/,15x,
'CSF coefficients before normalization: ',/)
3566 4522
format(15x,
'Storage locs for input and output coefficients: ',//, &
3567 15x,
' For cdi(), ipos_coeffs_in = ',i7,//, &
3568 15x,
' For cdo(), ipos_coeffs_out = ',i7,/)
3569 4525
format(15x,i6,
'. ',2x,f13.7)
3570 4530
format(/,15x,
'Sum - sqrs of coefficients (this CSF) = ',d13.6,/)
3571 4540
format(/,15x,
'CSF coefficients after normalization: ',/)
3572 4610
format(15x,
'Normalizing CSF expansion coefficients using ',/, &
3573 15x,
'projection because it has >= 2 electrons in ',/, &
3574 15x,
'open shells. '/)
3575 4625
format(/,15x,
'Coefficients have been copied into CDIT(): ',/)
3576 4690
format(/,10x,
'<<<< Completed processing of CSF number ',i6,/)
3577 7990
format(/,10x,
'At end of wfgntr(), usage of memory in output',/, &
3578 10x,
'arrays is as follows: ',//, &
3579 10x,
' Array Used Max avail ',/, &
3580 10x,
' ----- --------- --------- ',/, &
3581 10x,
' ndo() ',i9,2x,i9,/, &
3582 10x,
' cdo() ',i9,2x,i9,/)
3583 8000
format(/,10x,
'**** WFGNTR() - completed ',/)
3586 9214
format(5x,
'Spatial symmetry for determinant ',i5,/, &
3587 5x,
'in CSF ',i5,
' does not match ref determinant',/)
3588 9215
format(5x,
'Sz quantum number for determinant ',i5,/, &
3589 5x,
'in CSF ',i5,
' does not match ref determinant',/)
3590 9900
format(/,5x,
'***** Error in: wfngtr() ',//)
3591 9925
format(5x,
'Cannot allocate array mop() of length (lenmop) ',i8,/)
3592 9926
format(5x,
'Cannot allocate array flip() of length (max_num_dets_input) ',i8,/)
3593 9927
format(5x,
'Cannot de-alloc array mop() of length (lenmop) ',i8,/)
3594 9928
format(5x,
'Cannot de-alloc array flip() of length (max_num_dets_input) ',i8,/)
3595 9935
format(5x,
'Insufficient space in cdit() for projection ',/, &
3596 5x,
'CSF ',i10,
' has ',i10,
' determinants ',/, &
3597 5x,
'cdit() holds the expansion coefficient ',/, &
3598 5x,
'for each determinant and len_cdit must be ',/, &
3599 5x,
'at least as big as the number of determinants',/, &
3600 5x,
'Currenttly it is fixed at ',i10,/)
3601 9955
format(5x,
'WFNGTR() has received an error on return',/, &
3602 5x,
'fromPOPNWF(). Code is terminating now.',/)
3603 9981
format(5x,
'CSF ',i7,
' has exhausted space available in ndo',/, &
3604 5x,
'Available (maxndo) = ',i10)
3605 9982
format(5x,
'CSF ',i7,
' has exhausted space available in cdo',/, &
3606 5x,
'Available (maxcdo) = ',i10)
3618 subroutine wrnfto (sname, mgvn, s, sz, r, pin, norb, nsrb, nocsf, nelt, idiag, nsym, symtyp, &
3619 nob, ndtrf, nodo, m, icdo, indo, ndo, lndi, cdo, lcdi, nfto, nobl, nx, &
3620 npflg, thres, iposit, nob0, nob0l, nctarg, ntgsym, notgt, nctgt, mcont, &
3621 gucont, iphz, nobe, nobp, nobv, maxtgsym)
3623 use precisn,
only : wp
3625 integer :: symtyp, i, nfto, iposit, norb, nsrb, idiag, itg, maxtgsym, mgvn, &
3626 norbw, nsrbw, lcdi, lndi, nsym, nelt, m, nx, nctarg, ntgsym, nocsf
3627 integer,
parameter :: iwrite = 6
3628 integer,
dimension(nsym) :: nob, nob0, nobe, nobp, nobv
3629 integer,
dimension(nelt) :: ndtrf
3630 integer,
dimension(nocsf) :: nodo
3631 integer,
dimension(m) :: icdo, indo
3632 integer,
dimension(lndi) :: ndo
3633 integer,
dimension(ntgsym) :: notgt, nctgt, mcont, gucont
3634 integer,
dimension(nctarg) :: iphz
3635 integer,
dimension(20) :: nobw
3636 integer,
dimension(nx) :: nobl, nob0l
3637 integer,
dimension(6) :: npflg
3638 real(kind=wp),
dimension(lcdi) :: cdo
3639 real(kind=wp) :: s, sz, r, pin, thres
3640 character(120) :: name
3641 character(80) :: sname
3647 write(iwrite,
'(/,5x,"Writing final results to disk (wrnfto) ")')
3648 write(iwrite,
'( 5x,"-------------------------------------- ")')
3649 write(iwrite,
'( 5x," Logical unit (nfto) = ",I8)') nfto
3650 write(iwrite,
'( 5x," Positrons present (iposit) = ",I8)') iposit
3651 write(iwrite,
'( 5x," Number of electrons (nelt) = ",I8)') nelt
3652 write(iwrite,
'( 5x," Number of CSFs (nocsf) = ",I8)') nocsf
3653 write(iwrite,
'( 5x," Number of symmetries (nsym) = ",I8)') nsym
3654 write(iwrite,
'( 5x," Point group flag (symtyp) = ",I8)') symtyp
3655 write(iwrite,
'( 5x," Orbitals per symm (nob) : ",(20(1x,I0)))') (nob(i), i=1,nsym)
3656 write(iwrite,
'( 5x," Total # of orbitals (norb) = ",I8)') norb
3657 write(iwrite,
'( 5x," Total # of spin orbs (nsrb) = ",I8)') nsrb
3659 write(iwrite,
'(/,5x," Length of index arrays - icdo,indo (m) = ",I8)') m
3660 write(iwrite,
'( 5x," Length of coeff. array - cdo (lcdi) = ",I8)') lcdi
3661 write(iwrite,
'( 5x," (equals # dets in wfn)")')
3662 write(iwrite,
'( 5x," Length of packed dets array - ndo (lndi) = ",I8)') lndi
3664 write(iwrite,
'(/,5x," Spin quantum number (s) = ",F8.2)') s
3665 write(iwrite,
'( 5x," Z-projection of spin (sz) = ",F8.2)') sz
3666 write(iwrite,
'( 5x," Reflection quant. # (r) = ",F8.2)') r
3667 write(iwrite,
'( 5x," Pin (pin) = ",F8.2)') pin
3668 write(iwrite,
'( 5x," (idiag) = ",I8,/)') idiag
3676 nobw(1:nsym) = nob(1:nsym)
3688 if (iposit == 0)
then
3689 write(nfto) name, mgvn, s, sz, r, pin, norbw, nsrbw, nocsf, nelt, lcdi, idiag, &
3690 nsym, symtyp, lndi, npflg, thres, nctarg, ntgsym
3691 if (ntgsym > 0)
write(nfto) iphz, nctgt, notgt, mcont, gucont
3692 if (ntgsym <= 0)
write(nfto) iphz
3693 write(nfto) (nobw(i), i=1,nsym), ndtrf, nodo, iposit, nob0, nobl, nob0l
3695 write(nfto) name, mgvn, s, sz, r, pin, norbw, nsrbw, nocsf, nelt, lcdi, idiag, &
3696 nsym, symtyp, lndi, npflg, thres, nctarg, maxtgsym
3697 if (maxtgsym > 0)
then
3699 write(nfto) (nctgt(itg), itg=1,maxtgsym)
3700 write(nfto) (notgt(itg), itg=1,maxtgsym)
3701 write(nfto) (mcont(itg), itg=1,maxtgsym)
3702 write(nfto) (gucont(itg), itg=1,maxtgsym)
3704 if (maxtgsym <= 0)
write(nfto) iphz
3705 write(nfto) (nobw(i), i=1,nsym), ndtrf, nodo, iposit, nob0, nobl, nob0l
3706 write(nfto) (nobe(i), i=1,nsym)
3707 write(nfto) (nobp(i), i=1,nsym)
3708 write(nfto) (nobv(i), i=1,nsym)
3715 write(nfto) icdo, indo