













































































































































































































































































































































































































































































































































      subroutine a2rate_main
      implicit double precision (a-h,o-z)
C


c icore.com : begin

c icore(1) is an anchor in memory that allows subroutines to address memory
c allocated with malloc. This system will fail if the main memory is segmented
c or parallel processes are not careful in how they allocate memory.

      integer icore(1)
      common / / icore

c icore.com : end







c machsp.com : begin

c This data is used to measure byte-lengths and integer ratios of variables.

c iintln : the byte-length of a default integer
c ifltln : the byte-length of a double precision float
c iintfp : the number of integers in a double precision float
c ialone : the bitmask used to filter out the lowest fourth bits in an integer
c ibitwd : the number of bits in one-fourth of an integer

      integer         iintln, ifltln, iintfp, ialone, ibitwd
      common /machsp/ iintln, ifltln, iintfp, ialone, ibitwd
      save   /machsp/

c machsp.com : end



c flags.com : begin
      integer        iflags(100)
      common /flags/ iflags
c flags.com : end
c flags2.com : begin
      integer         iflags2(500)
      common /flags2/ iflags2
c flags2.com : end
c istart.com : begin
      integer         i0, icrsiz
      common /istart/ i0, icrsiz
      save   /istart/
c istart.com : end
C-----------------------------------------------------------------------
      if (iflags(11).eq.0) iuhf = 0
      maxcor=icrsiz
C
      Call Getrec(20,'JOBARC','NREALATM',1,Nreals)
      Call Getrec(20,'JOBARC','ZMATATMS',1,Natoms)

      iocc   = i0
      iatmMass = iocc + 16
      icoord   = iatmMass + 3*Natoms*iintfp 
      ivgrad   = icoord   + 3*NAtoms*iintfp
      izgrad   = ivgrad   + 3*Nreals*iintfp
      ihess    = izgrad   + 3*Nreals*iintfp
      ifreq    = ihess    + 9*Natoms*Natoms*iintfp
      imap     = ifreq    + 3*Nreals*iintfp
      iord     = imap     + Nreals
      inext    = iord     + Nreals 

      if(inext-i0.gt.maxcor)call insmem('a2rate_main',inext-i0,maxcor)

      call a2rate_wrte(.true.,.true.,.true.,.true.,natoms,nreals,
     &                 icore(iocc),icore(iatmMass),icore(icoord),
     &                 icore(ivgrad),icore(izgrad),icore(ihess),
     &                 icore(ifreq),icore(imap),icore(iord),iuhf)
c ----------------------------------------------------------------------

      return
      end

