subroutine rdguess(ierror,il) C C Reads in the parameters for density matrix approximation. C C GUESS C DNA.dmx F C water1.dmx C water2.dmx C END_GUESS C C the total number of atoms should be equal to the ones in divcon.dim C sequential numbering is assumed, i.e. DNA.dmx contains atoms 1 - x, C water1.dmx atoms x+1 - y, and water2.dmx contains atoms y+1 - natoms C C if the filename is followed by a 'F', then the subsystems with the atoms C of that file in the core, will be frozen, i.e. treated by the FDM approximation. C C guess C 1-1512 dna.dmx 3-1514 F C 1513-2931 water.dmx 1-1419 C 2932-3001 salts.dmx 4-73 C 3002-3010 dna.dmx 1515-1523 F C end_guess C C density matrix elements for atoms 1-1512 will be filled with information C from atoms 3-1514 of dna.dmx and subsystems with these atoms in the core C will be frozen, i.e. treated by the FDM approximation C density matrix elements for atoms 1513-2931 will be filled with information C from atoms 1-1419 of water.dmx C density matrix elements for atoms 2932-3001 will be filled with information C from atoms 4-73 of salts.dmx C C It is imperative that all atomtypes (H, O, C, ...) correspond with each other, C i.e. in the example above atom #3 of the new file should have the C same atom type as atom #5 of dna.dmx. Note that this is up to the user, C divcon does not check this. C C C C Note that no dashes '-' are allowed in the name of the dmx files implicit double precision (a-h,o-z) #include "divcon.dim" #include "divcon.h" character line*80, nocapline*80 logical int, mini, first data first /.true./ save first dimension itmpn(2*maxsresf) nsresfile = 0 minsynt = .false. 5 il = il + 1 line = (options2(il)) C 5 read (inpt,fmt='(A80)') line nocapline(1:80) = line(1:80) call upcase1(line,80) if (index(line,'END_GUESS').ne.0) then if (minsynt) then itmp = 2*nsresfile call bovsort1(itmp,itmpn,ierror) if (ierror.ne.0) then C-RDC write(iout,'(/" ERROR: NON-IDENTICAL ATOM REFERENCES " C-RDC & "FOR ", C-RDC & "NEW DENSITY", C-RDC & /" MATRIX IN GUESS PARAMETERS")') return endif endif return endif istart = 1 im = index(line,'-') if (im.ne.0) then if (first) then minsynt = .true. first = .false. else if (.not.minsynt) then C-RDC write(iout,'(/" ERROR: MIXED SYNTAXIS IN GUESS ", C-RDC & "PARAMETERS.", C-RDC & /" USE EITHER THE", C-RDC & /" ABC.DMX", C-RDC & /" OR THE", C-RDC & /" 5-10 ABC.DMX 25-30", C-RDC & /" SYNTAX")') ierror = 1 return endif endif C . find first number nsresfile = nsresfile + 1 in2 = 2*nsresfile in1 = in2-1 i=1 10 if (i.lt.80) then call whatis2(line(i:i),int, mini) if (int) then call iatoi(line, i, lstr, inewsres(in1), ierror) goto 20 endif i=i+1 goto 10 else C-RDC write(iout,'(/" ERROR: WRONG SYNTAX IN GUESS PARAMETERS", C-RDC $ " LINE",/,1x,a20,"...")') line(1:20) ierror = 1 return endif 20 i=im+1 C . find second number 30 if (i.lt.80) then call whatis2(line(i:i),int, mini) if (int) then call iatoi(line, i, lstr, inewsres(in2), ierror) goto 40 endif i=i+1 goto 30 else C-RDC write(iout,'(/" ERROR: WRONG SYNTAX IN GUESS PARAMETERS", C-RDC $ " LINE",/,1x,a20,"...")') line(1:20) ierror = 1 return endif 40 i=lstr+1 C . filename call rdword(line,i,istop) if (istop.le.0) then C-RDC write(iout,'(/" ERROR: MISSING GUESS ENTRIES IN LINE ", C-RDC & /,1X,A20)') line(1:20) ierror = 1 return endif istopp = min(istop,i+59) sresfile(nsresfile) = nocapline(i:istopp) i=istop+1 C . find third number 50 if (i.lt.80) then call whatis2(line(i:i),int, mini) if (int) then call iatoi(line, i, lstr, ioldsres(in1), ierror) goto 60 endif i=i+1 goto 50 else C-RDC write(iout,'(/" ERROR: WRONG SYNTAX IN GUESS PARAMETERS", C-RDC $ " LINE",/,1x,a20,"...")') line(1:20) ierror = 1 return endif 60 i=lstr+1 C . find fourth number 70 if (i.lt.80) then call whatis2(line(i:i),int, mini) if (int) then call iatoi(line, i, lstr, ioldsres(in2), ierror) goto 80 endif i=i+1 goto 70 else C-RDC write(iout,'(/" ERROR: WRONG SYNTAX IN GUESS PARAMETERS", C-RDC $ " LINE",/,1x,a20,"...")') line(1:20) ierror = 1 return endif 80 if (index(line(lstr+1:80),'F').ne.0) then fdmx = .true. fresfile(nsresfile) = .true. if (stand) then C-RDC write(iout,'(/" ERROR: CANNOT USE THE FDM APPROXIMATION ", C-RDC & "WHEN", C-RDC & /" A STANDARD CALCULATION IS DONE")') ierror = 1 return endif else fresfile(nsresfile) = .false. endif C . do some checking if ((inewsres(in2).lt.inewsres(in1)).or. & (ioldsres(in2).lt.ioldsres(in1))) then C-RDC write(iout,'(/" ERROR: INVALID ATOM REFERENCING IN GUESS ", C-RDC $ "PARAMETERS LINE", C-RDC $ /,1X,a20,"...")') line(1:20) ierror = 1 return else do i=in1,in2 if (((inewsres(i).le.0).or.(inewsres(i).gt.natoms)) & .or. & (ioldsres(i).le.0)) & then C-RDC write(iout,'(/" ERROR: OUT OF RANGE ERROR IN ", C-RDC & "GUESS LINE ", C-RDC & /,1X,A20,"...")') line(1:20) ierror = 1 return endif itmpn(i) = inewsres(i) enddo endif k1 = inewsres(in2)-inewsres(in1) k2 = ioldsres(in2)-ioldsres(in1) if (k1.ne.k2) then C-RDC write(iout,'(/" ERROR: DIFFERENT RANGES IN LINE ", C-RDC & A20,"... OF ", C-RDC $ /" GUESS PARAMETERS")') line(1:20) ierror = 1 return endif else if (first) then minsynt = .false. first = .false. else if (minsynt) then C-RDC write(iout,'(/" ERROR: MIXED SYNTAXIS IN GUESS ", C-RDC & "PARAMETERS.", C-RDC & /" USE EITHER THE", C-RDC & /" ABC.DMX", C-RDC & /" OR THE", C-RDC & /" 5-10 ABC.DMX 25-30", C-RDC & /" SYNTAX")') ierror = 1 return endif endif istart=1 call rdword(line,istart,istop) nsresfile = nsresfile + 1 if (stand.and.(nsresfile.gt.1)) then C-RDC write(iout,'(/" ERROR: ONLY ONE DMX FILE IS ALLOWED WHEN ", C-RDC & /" DOING A STANDARD CALCULATION")') ierror = 1 return endif if (nsresfile.gt.maxsresf) then C-RDC write(iout,'(/" ERROR: TOO MANY DENSITY MATRIX FILES ", C-RDC & "SPECIFIED", C-RDC & /" INCREASE MAXSRESF IN divcon.dim AND ", C-RDC & "RECOMPILE")') ierror = 1 return endif istopp = min(istop,istart+59) sresfile(nsresfile) = nocapline(istart:istopp) if (index(line(istop+1:80),'F').ne.0) then fdmx = .true. fresfile(nsresfile) = .true. if (stand) then C-RDC write(iout,'(/" ERROR: CANNOT USE THE FDM APPROXIMATION ", C-RDC & "WHEN", C-RDC & /" A STANDARD CALCULATION IS DONE")') ierror = 1 return endif else fresfile(nsresfile) = .false. endif endif goto 5 end