******************************************************************************** * * * 2DHF version 1-2003 * * Copyright (C) 1996 Jacek Kobus, Leif Laaksonen, Dage Sundholm * * * * This software may be used and distributed according to the terms * * of the GNU General Public License, see README and COPYING. * * * ******************************************************************************** c ### rinputd ### c c Handles the input to 2DHF. c subroutine rinputd(iform_t,ni_t,mu_t,no_t,nons_t) implicit integer*4 (i-n) implicit real*8 (a-h,o-z) character*8 clabel,char8 character*8 labellc(30),cmethod(6),pab(3) character*8 sigma,sigmag,sigmau,pi,delta,phi,space,angstrom, & endl,endc character*20 psiinp,coulinp,exchinp,psiout,coulout,exchout include 'commons8.inc' dimension id(600) data nlabels/28/ data labellc /'title','method','nuclei','config','initial', & 'break','multipol','grid','cutoff','homo', & 'scf','sor','debug','help','stop','interp', & 'subgrid','fix','xalpha','omega','order', & 'plot','fermi','lagra','gauss','damp','canon', & 'fefield',2*' '/ c data angstrom/'angstrom'/ data cmethod/'hf','HF','oed','OED','hfs','HFS'/, & endl/'end'/,endc/'END'/ data pab/'u','g',' '/ data sigma/'sigma'/,pi/'pi'/,delta/'delta'/,phi/'phi'/ data sigmag/'sigma g'/,sigmau/'sigma u'/ data space/' '/ data inpiexit/-99999/ c no=isum=norb c iexd=maxorb c bond=orbsym c initialization of some variables ihomon=0 ibreak=0 iinterp=0 cutorb =1.d-6 cutcoul=1.d-6 cutexch=1.d-6 itail =13 c diver - if demax(1) in proce is greater than diver c divergence in the scf process is detected and c the program stops diver = 1.d8 c initial default value inclorb = 0 c default canonicalization coefficients icanon=1 c multipol default value impole=8 c default number of grids and the default ordering of mesh points ngrids=1 iorder(ngrids)=2 c scf default values maxscf = 1000 nobckup = 100 ienterm = 10 inoterm = 10 iprtlev = 2 facmul = 1.15d0 c fix default values iexlorb = 0 iexlcoul = 0 iexlexp = 2 exlorb = 0.d0 exlcoul = 0.d0 exlexp = 2.d0 c xalpha defaul value alphaf = 0.0d0 sltthr = 0.0d0 c sor default value maxsor2 =10 maxsor1 = 1 lsor = 1 ipoiss = 1 c fermi default value (point nuclei) ifermi=0 c plot default value (no data exported for making plots) iplot=0 c additional relaxation of the least relaxed orbital is switched off c facrel is no longer used facrel=-10.d0 c search for optimal value of the overrelaxation parameter is c switched off search=1.d-15 omincr=0.0d0 sflagra=1.d0 ifefield=0 ffield =0.d0 fgrad =0.d0 zcutoff=1.d5 cmass =0.d0 cmass1=0.d0 c default order of interpolation polynomials when changing grids c for orbitals and potentials iord_nu_orb=5 iord_nu_coul=5 iord_nu_exch=5 iord_mu_orb=5 iord_mu_coul=5 iord_mu_exch=5 incrni=10 incrmu=10 c set maximum allowed unit number call setmaxunit() write(*,*) ' ... start of input data ...' write(*,*)' ' 5 continue call card call inpa(clabel) do i=1,nlabels if (clabel.eq.labellc(i)) go to 12 enddo write(iout6,1100) clabel 1100 format(/10x,'****** ',a8,' not yet in the menu ******'//) write(iout6,1102) (labellc(i),i=1,nlabels) 1102 format(/10x,'try one of the following :'// & 10(10x,a8/)) stop 12 go to ( 20, 40, 60, 80,100, & 120,140,160,180,200, & 220,240,260,280,300, & 320,162,222,224,244, & 242,340,360,370,362, & 380,390,392), i stop c label: title 20 continue read(iinp5,1104,err=1500) header write(iout6,1104) header 1104 format(80a1) go to 5 c label: method 40 continue c call card call inpa(char8) if (char8.eq.cmethod(1).or.char8.eq.cmethod(2)) imethod=1 if (char8.eq.cmethod(3).or.char8.eq.cmethod(4)) imethod=2 if (char8.eq.cmethod(5).or.char8.eq.cmethod(6)) imethod=3 c prepare for HFS calculations if (imethod.eq.3) then alphaf=0.70d0 sltthr=precis exlexp=1.d0 islat =1 endif if (char8.eq.cmethod(1).or.char8.eq.cmethod(2).or. & char8.eq.cmethod(3).or.char8.eq.cmethod(4).or. & char8.eq.cmethod(5).or.char8.eq.cmethod(6)) go to 5 write(iout6,*) 'method must be HF, HFS or OED for a time being' stop 'rinputd' c label: nuclei 60 continue call inpf(z1) call inpf(z2) call inpf(r) call inpa(char8) c conversion factor due to Cohen and Taylor (1986) c The 1986 Adjustment of the Fundamental Physical Constants if (char8.eq.angstrom) r=r/bohr2ang r2=r/2.0d0 if ((abs(z1)+abs(z2)).eq.0.d0.or.r.eq.0.d0) then write(iout6,*) 'Error: incomplete input' stop 'rinputd' endif go to 5 c label: config 80 continue c read total charge for the system call inpi(itotq) totq=z1+z2-dble(itotq) c to allow for noninteger nucleus charge needed to force convergence c in some open-shell cases read in the nuclei charges again z1t=0.d0 z2t=0.d0 call inpf(z1t) call inpf(z2t) if (z1t.gt.precis) z1=z1t if (z2t.gt.precis) z2=z2t c read in symmetry and occupation and test if c the orbital is locked = 1 (open shell case) c = 0 (closed shell case) isum=0 82 call card call inpi(nbsym) call inpa(char8) if(char8.ne.sigma.and.char8.ne.pi.and. & char8.ne.delta.and.char8.ne.phi) then write(iout6,*) 'Error: wrong symmetry or symmetry higher', & ' than phi' stop 'rinputd' endif isum0=isum do i=1,nbsym isum=isum+1 orbsym(isum)=char8 bond(isum)=orbsym(isum) gut(isum)=space enddo if (isum.gt.maxorb) then write(iout6,*) 'too many orbitals (max. see maxorb)' stop 'rinputd' endif c in homonuclear case read in the parity of each orbital c if BREAK is on (ibreak=1) u/g labels are ignored c if |z1-z2|0 multipole moment expansion c coefficients are recalculated every time demax(1), c i.e. maximum error in orbital energy, is reduced by c facmul c if facmul<0 these coefficients are not calculated c call inpf(facmul) if (facmul.lt.0.d0) facmul=10.0**(15) go to 5 c label: grid 160 continue c call inpi(nni) c call inpi(nmu(ngrids)) c call inpf(rgrid(ngrids)) tmp1=0.d0 tmp2=0.d0 call inpi(nni) call inpf(tmp1) call inpf(tmp2) if (tmp2.ne.0.d0) then c nnu nmu R_infty nmu(ngrids)=tmp1 rgrid(ngrids)=tmp2 else c nni R_infty if (ngrids.ne.1) then write(*,*)'rinputd: missing item in GRID card' stop 'rinputd' endif rgrid(ngrids)=tmp1 nmu(1)=nmucalc() endif rinf=rgrid(ngrids) nmutot=nmu(ngrids) if (nni.gt.maxni) then write(*,*) 'Error: too many grid points in nu variable' stop 'rinputd' endif if (nmutot.gt.maxmu) then write(*,*) 'Error: too many grid points in mu variable' stop 'rinputd' endif goto 5 c label: subgrid c up to 10 grids can be formally defined (rgrid(10) though c rgrid(9) would sufice nmu(10)) c the last value of rgrid must be equal to rinf, i.e. the practical infinity 162 continue call inpi(ngrids) call card call inpi(nni) nmutot=0 do ig=1,ngrids call inpi(nmu(ig)) nmutot=nmutot+nmu(ig) enddo if (nni.gt.maxni) then write(*,*) 'Error: too many grid points in nu variable' stop 'rinputd' endif if (nmutot.gt.maxmu) then write(*,*) 'Error: too many grid points in mu variable' stop 'rinputd' endif call card do ig=1,ngrids call inpf(rgrid(ig)) enddo rinf=rgrid(ngrids) if (ngrids.gt.maxgrids) then write(*,*) 'Error: too many subgrids' stop 'rinputd' endif c set default ordering for subgrids do ig=1,ngrids iorder(ig)=2 enddo goto 5 c label: cutoff -- cutoff values for orbitals and potentials 180 continue call inpi(itmp) if (itmp.ge.0) itail=itmp goto 5 c label: homo -- when this label is encountered the g/u symmetry of c orbitals is strictly imposed; in all other respects c a homonuclear case is treated as a heteronuclear one c ihomon=0 -- heteronuclear case c ihomon=1 -- homonuclear case |z1-z2|