      SUBROUTINE REFER
      implicit double precision (A-H,O-Z)
      include 'SIZES'
      include 'MOP6FILE'
      common
     1       /REFS/ ALLREF(107,4)
     2       /MOLKST/ NUMAT,NAT(NUMATM),NFIRST(NUMATM),NMIDLE(NUMATM),
     3                NLAST(NUMATM), NORBS, NELECS,NALPHA,NBETA,
     4                NCLOSE,NOPEN,NDUMY,FRACT
     5       /KEYWRD/ KEYWRD
      logical ALLOK, ELEMNS(107), MIXOK, MIX
      save MIX
      character KEYWRD*241, ALLREF*80
      data MIX/.FALSE./
      MIXOK=(INDEX(KEYWRD,'PARASOK').NE.0)
      do 10 I=1,102
   10 ELEMNS(I)=.FALSE.
      if (INDEX(KEYWRD,'PM3').NE.0) then
         MODE=4
      else if (INDEX(KEYWRD,'AM1').NE.0) then
         MODE=3
      else if (INDEX(KEYWRD,'MINDO').NE.0) then
         MODE=2
      else
         MODE=1
      end if
      ALLREF(99,MODE)=' DUMMY ATOMS ARE USED; THESE do NOT AFFECT '
     1//'THE CALCULATION'
      ALLREF(100,MODE)=' '
      do 20 I=1,NUMAT
         J=NAT(I)
   20 ELEMNS(J)=.TRUE.
      ALLOK=.TRUE.
      do 30 I=1,102
         if (ELEMNS(I)) then
            if (I.LT.99.AND..NOT.MIX.AND.MODE.EQ.3)
     1         MIX=(INDEX(ALLREF(I,3),'MNDO').NE.0)
            if (ALLREF(I,MODE) (1:1).NE.' ') then
               write(MIOB,'(A,I3)')
     %           ' DATA ARE NOT AVAILABLE FOR ELEMENT NO.',I
               ALLOK=.FALSE.
            else
               write(MIOB,'(A)') ALLREF(I,MODE)
            end if
         end if
   30 continue
      if (MIX.AND..NOT.MIXOK) then
         write(MIOB,40)
     1  'SOME ELEMENTS HAVE BEEN SPECIFIED FOR WHICH ONLY MNDO',
     2  'PARAMETERS ARE AVAILABLE.  SUCH MIXTURES OF METHODS ARE',
     3  'VERY RISKY AND HAVE NOT BEEN FULLY TESTED.  IF YOU FEEL',
     4  'THE RISK IS WORTH WHILE - CHECK THE MANUAL FIRST - THEN',
     5  'SPECIFY "PARASOK" IN THE KEYWORDS'
c
         call filclo  !  J/M
         stop ' in REFER - mixing parameters - think it over!'
c
      end if
      if (ALLOK) return
      write(MIOB,40)
     1 'SOME ELEMENTS HAVE BEEN SPECIFIED FOR WHICH',
     2 'NO PARAMETERS ARE AVAILABLE.  CALCULATION STOPPED.'
c
      call filclo  !  J/M
      stop ' in REFER - no parameters for some elements used'
c
   40 format(/////10X,A,4(/10X,A))
      end
