











      INTEGER      MAXPGR, MAX_REFCOUNT, MAXCPL
      PARAMETER    (MAXPGR=5)
      PARAMETER    (MAXCPL=500)
      PARAMETER    (MAX_REFCOUNT=100)

      INTEGER      REFLEVEL, REFCYCLES, REFSTEPS, REFDETAIL,
     +             REFFINISHED, REFWARN_ABOVE, REFWARN_LEVEL,
     +             REFUSE_BAD, REFDAMP_FACT, REFUSE_ANCHOR,
     +             REFCOUNT(25), REFI2(2,500),
     +             SUPUSE(MAXAA), 
     +             COPLAN(2,MAXCPL), NUMCPL,
     +             IDPLAN(2,MAXCPL), NUMIPL, 
     +             PAPLAN(2,MAXCPL), NUMPAL, 
     +             IQ7380, IQ7388, IQ7389, IQ7390, IQ7400, 
     +             PAIRLIST(2,1000), ANGLIST(3,1000), NUM_REFDP

      REAL         DELTAX(MAXAT), DELTAY(MAXAT), DELTAZ(MAXAT),
     +             OLDX(MAXAT), OLDY(MAXAT), OLDZ(MAXAT), REFD2(3,500),
     +             PAIRDIST(2,1000), ANGDIST(2,1000)

      LOGICAL      PLANAR(MAXTAT,MAXPGR,NUMUA), REFFIX(MAXAT), 
     +             REFLIX(MAXAT)








      EQUIVALENCE  (WIFPAR(61), REFWARN_LEVEL)
      EQUIVALENCE  (WIFPAR(76), REFWARN_ABOVE)
      EQUIVALENCE  (WIFPAR(112),REFUSE_ANCHOR)
      EQUIVALENCE  (WIFPAR(113),REFDAMP_FACT)
      EQUIVALENCE  (WIFPAR(124),REFCYCLES)
      EQUIVALENCE  (WIFPAR(125),REFSTEPS)
      EQUIVALENCE  (WIFPAR(829),REFLEVEL)
      EQUIVALENCE  (WIFPAR(842),REFDETAIL)
      EQUIVALENCE  (WIFPAR(843),REFFINISHED)
      EQUIVALENCE  (WIFPAR(971),REFUSE_BAD)
      
      COMMON       /REFI00/
     +             NUMCPL, NUMIPL, REFI2, IQ7380, PAPLAN, IQ7388, 
     +             NUMPAL, IQ7389, PAIRLIST, IQ7390, NUM_REFDP, 
     +             ANGLIST,IQ7400
      
      COMMON       /REFI01/
     +             PLANAR

      COMMON       /REFI02/
     +             PAIRDIST, ANGDIST
      
      COMMON       /REFI03/
     +             REFCOUNT
      
      COMMON       /REFI04/
     +             OLDX, OLDY, OLDZ, REFD2
      
      COMMON       /REFI05/
     +             REFFIX, REFLIX
      
      COMMON       /REFI06/
     +             DELTAX, DELTAY, DELTAZ, SUPUSE, COPLAN, IDPLAN
