C*MODULE NEO     *DECK NEOCAL
      SUBROUTINE NEOCAL(RUNTYP)
C
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
C        NEO CODE IS SELECTED IN THE COMPILING SCRIPTS COMPALL/LKED
C        NEO CODE IS SUPPLIED WITH GAMESS, SO WE JUST NEED TO REMIND
C        PEOPLE TO BE SURE TO BUILD GAMESS WITH THIS OPTION TURNED ON.
C
      WRITE(6,*) 'NEO RUNS ARE NOT ENABLED, PLEASE RE-COMPILE WITH NEO'
      CALL ABRT
C
      RUNTYP = 0.0D+00
      RETURN
      END
C
*MODULE NEO     *DECK NEOINP
      SUBROUTINE NEOINP(IRET)
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
      DOUBLE PRECISION NMOMTD,NEO,NEOSCF,NEOCI
C
      LOGICAL GOPARR,DSKWRK,MASWRK
      LOGICAL EXCH,VNUCEX,DNUCGS
      LOGICAL NEOHSS,POSNEO,POSPRP
      LOGICAL NUCOPT,CLSTEP,NEOTS
C
      LOGICAL DIRNUC,NUFOCK,SYMNUC,USRDEX
C
      PARAMETER (MAXQNT=10, MAXNUP=100)
C
      COMMON /IOFILE/ IR,IW,IP,IS,IPK,IDAF,NAV,IODA(950)
      COMMON /PAR   / ME,MASTER,NPROC,IBTYP,IPTIM,GOPARR,DSKWRK,MASWRK
      COMMON /NEOMPN/ NEMPLV
      COMMON /NBSEXP/ EXNB(MAXNUP,MAXQNT),CONNB(MAXNUP,MAXQNT),
     *                ICONNB(MAXNUP,MAXQNT),USRDEX
      COMMON /NEOJOB/ NEORUN,NELERM
      COMMON /NEOMTD/ NEOSCF,NEOCI
      COMMON /NUCMOI/ NUNIQN,IUNIQN(20),IUNIQT(20),NQMNUC,IQMNUC(20),
     *                IQNTYP(20),NUMNB,NUCST,NAUXNB,IAUXNB(20),NUMULT,
     *                NNA,NNB,NTAUXB
      COMMON /NUCMOR/ QMNUCM(20)
      COMMON /NUCMOL/ EXCH,VNUCEX,DNUCGS
      COMMON /NUCMOM/ BASNUC,NMOMTD
      COMMON /NUCMOP/ DIRNUC,NUFOCK
      COMMON /NEOOPT/ NUCOPT,CLSTEP,NEOTS
      COMMON /NUCPOS/ IUNIQA(20),POSNEO,POSPRP
C     COMMON /SYMNEO/ SYMNUC,NUSLC,NUSLC2,NUSLC3,
C    *                IPANU(14)
      COMMON /SYMNEO/ QMATLN,SYMNUC
      COMMON /NUCHSS/ HSSINI,HSSUPD,NEOHSS
C
      PARAMETER (ZERO=0.0D+00, ONE=1.0D+00)
C
C      ----- SET UP NAMELIST $NEO TABLES -----
C
      PARAMETER (NNAM=25)
      DIMENSION QNAM(NNAM),KQNAM(NNAM)
      DATA NEO/8HNEO     /
      DATA QNAM/8HNUNIQN  ,8HIUNIQN  ,8HQMNUCM  ,8HBASNUC  ,
     *          8HNMOMTD  ,8HIUNIQT  ,8HEXCH    ,8HNUMULT  ,
     *          8HNUCST   ,8HNAUXNB  ,8HIAUXNB  ,8HVNUCEX  ,
     *          8HNUCOPT  ,8HNTAUXB  ,8HNEOHSS  ,8HHSSINI  ,
     *          8HHSSUPD  ,8HDIRNUC  ,8HSYMNUC  ,8HQMTOLN  ,
     *          8HEXNB    ,8HNEMPLV  ,8HPOSNEO  ,8HPOSPRP  ,
     *          8HIUNIQA  /
      DATA KQNAM /1,201,203,5,    5,201,0,1,    1,1,201,0,
     *            0,1,0,5,        5,0,0,3,      803,1,0,0,
     *            201/
C
      DATA BLANK /8H        /
C
C        NOTE THAT ANY RUN FINDING $NEO INPUT MUST BOMB BELOW.
C
C        NEXT TWO ARE INITIALIZATIONS FOR NEO CODE -NOT- COMPILED IN.
C
      IRET = 0
      NEMPLV = 0
C
      NEOSCF = BLANK
      NEOCI  = BLANK
C
C        NEXT ARE INITIALIZATION OF $NEO KEYWORDS, ALTHOUGH WE
C        MUST NOT ACTUALLY FIND ANY SUCH INPUT IN NO-NEO BINARIES
C
      DO 110 J=1,MAXQNT
         DO 100 I=1,MAXNUP
            ICONNB(I,J) = 0
            CONNB(I,J) = ZERO
            EXNB(I,J) = -ONE
  100    CONTINUE
  110 CONTINUE
C
C     ----- INITIALIZE VARIABLES FOR NAMELIST $NEO -----
C
      NEMPLV = 0
      NEORUN = 0
      NUNIQN = 0
      NQMNUC = 0
      NAUXNB = 0
      NTAUXB = 0
      BASNUC = BLANK
      NMOMTD = BLANK
      DO I = 1,20
         IUNIQT(I) = 1
         IUNIQA(I) = 0
         IQNTYP(I) = 1
         IAUXNB(I) = 0
      END DO
C
      EXCH = .TRUE.
      NUCOPT = .FALSE.
      NEOHSS = .FALSE.
      HSSINI = BLANK
      HSSUPD = BLANK
      NUMULT = 2
      NUCST = 1
      VNUCEX=.FALSE.
      DIRNUC = .FALSE.
      SYMNUC = .FALSE.
      QMTOLN = 0.0D+00
      USRDEX = .FALSE.
      POSNEO = .FALSE.
      POSPRP = .FALSE.
C
C     ----- READ NAMELIST $SYSTEM -----
C
      JRET = 0
      CALL NAMEIO(IR,JRET,NEO,NNAM,QNAM,KQNAM,
     *     NUNIQN,IUNIQN,QMNUCM,BASNUC,NMOMTD,IUNIQT,EXCH,NUMULT,
     *     NUCST,NAUXNB,IAUXNB,VNUCEX,NUCOPT,NTAUXB,NEOHSS,HSSINI,
     *     HSSUPD,DIRNUC,SYMNUC,QMTOLN,EXNB,NEMPLV,POSNEO,POSPRP,
     *     IUNIQA,
     *       0,0,0,0,    0,0,0,0,0,
     *     0,0,0,0,0,    0,0,0,0,0,
     *     0,0,0,0,0,    0,0,0,0,0,
     *     0,0,0,0,0,    0,0,0,0,0)
C
      IF(JRET.EQ.1) RETURN
C
      IF(MASWRK) WRITE(IW,9000)
      CALL ABRT
      STOP
C
 9000 FORMAT(//20X,'*** ERROR ***'/
     *     1X,'A $NEO GROUP WAS FOUND IN THE INPUT FILE OF THIS RUN,'/
     *     1X,'BUT THE NEO PLUG-IN CODE HAS NOT BEEN COMPILED INTO',
     *        ' GAMESS.'//
     *     1X,'ADDING NEO IS EASY, SEE THE ~/GAMESS/QMNUC DIRECTORY.'/)
      END
C
C*MODULE NEO     *DECK NEOSET
      SUBROUTINE NEOSET(DO1NUC,DONGES)
      IMPLICIT DOUBLE PRECISION(A-H,O-Z)
      LOGICAL DO1NUC,DONGES
C
      WRITE(6,*) 'NEO RUNS ARE NOT ENABLED, PLEASE RE-COMPILE WITH NEO'
      CALL ABRT
C
      IF(DO1NUC.OR.DONGES) WRITE(6,*) 'POINTLESS OUTPUT'
      RETURN
      END
C
*MODULE NEOHF   *DECK NEOHF
      SUBROUTINE NEOHF(H1E,FAE,DAE,FBE,DBE,DFDAE,DFDBE,SCR,SCR2,
     &                 ADDE,L1,L2,ICNT,EHFEL,ITER,EN)
C
      IMPLICIT DOUBLE PRECISION(A-H,O-Z)
      DIMENSION H1E(*),FAE(*),DAE(*),FBE(*),DBE(*),DFDAE(*),DFDBE(*),
     *          SCR(*),SCR2(*),ADDE(*)
C
      WRITE(6,*) 'NEO RUNS ARE NOT ENABLED, PLEASE RE-COMPILE WITH NEO'
      CALL ABRT
      EHFEL = EN
      WRITE(6,9000) H1E(1),FAE(1),DAE(1),FBE(1),DBE(1),
     *              DFDAE(1),DFDBE(1),SCR(1),SCR2(1),ADDE(1),
     *              L1,L2,ICNT,ITER
 9000 FORMAT(1X,'POINTLESS WRITE TO SUPPRESS FTNCHEK MESSAGES'/
     *       1X,5F12.5/1X,5F12.5/
     *       1X,'L1,L2=',2I6,' ICNT,ITER=',2I4)
C
      RETURN
      END
C
C*MODULE NEO     *DECK NMOOUT
      SUBROUTINE NMOOUT(MPUNCH)
C
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
      WRITE(6,*) 'NEO RUNS ARE NOT ENABLED, PLEASE RE-COMPILE WITH NEO'
      CALL ABRT
      WRITE(6,9000) MPUNCH
 9000 FORMAT(1X,'POINTLESS WRITE TO SUPPRESS FTNCHEK MESSAGES'/
     *       1X,I5)
C
      RETURN
      END
C
*MODULE NEOSYM  *DECK NEOSYM
      SUBROUTINE NEOSYM(GAM,CHARR,TRACEP,TRACED,TRACEF,TRACEG)
C
      IMPLICIT DOUBLE PRECISION(A-H,O-Z)
      DIMENSION GAM(*),CHARR(*),TRACEP(*),TRACED(*),TRACEF(*),TRACEG(*)
C
      WRITE(6,*) 'NEO RUNS ARE NOT ENABLED, PLEASE RE-COMPILE WITH NEO'
      CALL ABRT
      WRITE(6,9000) GAM(1),CHARR(1),TRACEP(1),
     *              TRACED(1),TRACEF(1),TRACEG(1)
 9000 FORMAT(1X,'POINTLESS WRITE TO SUPPRESS FTNCHEK MESSAGES'/
     *       1X,7F12.5)
C
      RETURN
      END
C
C*MODULE NEO     *DECK ENMP2D
      SUBROUTINE ENMP2D
      WRITE(6,*) 'NEO RUNS ARE NOT ENABLED, PLEASE RE-COMPILE WITH NEO'
      CALL ABRT
      RETURN
      END
C
C*MODULE NEO     *DECK EDETIN
      SUBROUTINE EDETIN(NPFLG,DETWRD)
      IMPLICIT DOUBLE PRECISION(A-H,O-Z)
      WRITE(6,*) 'NEO RUNS ARE NOT ENABLED, PLEASE RE-COMPILE WITH NEO'
      CALL ABRT
      NPFLG=0
      DETWRD=0.0D+00
      RETURN
      END
C
C*MODULE NEO     *DECK NDETIN
      SUBROUTINE NDETIN(NPFLG,DETWRD)
      IMPLICIT DOUBLE PRECISION(A-H,O-Z)
      WRITE(6,*) 'NEO RUNS ARE NOT ENABLED, PLEASE RE-COMPILE WITH NEO'
      CALL ABRT
      NPFLG=0
      DETWRD=0.0D+00
      RETURN
      END
C
C*MODULE NEO     *DECK NEOFCI
      SUBROUTINE NEOFCI(NPFLG,ITCOUNT)
      WRITE(6,*) 'NEO RUNS ARE NOT ENABLED, PLEASE RE-COMPILE WITH NEO'
      CALL ABRT
      IF(ITCOUNT.LT.-100) NPFLG=0
      RETURN
      END
C
C*MODULE NEO      *DECK CASNEI
      SUBROUTINE CASNEI(XPQIJ,X,IX,L2,NACT2)
      IMPLICIT DOUBLE PRECISION(A-H,O-Z)
      DIMENSION XPQIJ(L2,NACT2),X(*),IX(*)
      WRITE(6,*) 'NEO RUNS ARE NOT ENABLED, PLEASE RE-COMPILE WITH NEO'
      CALL ABRT
      XPQIJ(1,1) = X(1) + IX(1)
      RETURN
      END
C*MODULE NEOCAS   *DECK FACTND
      SUBROUTINE FACTND(FAAO,WRK,XX,IX,IA,L1,L2)
      IMPLICIT DOUBLE PRECISION(A-H,O-Z)
      DIMENSION FAAO(L2),WRK(L2),XX(*),IX(*),IA(*)
      WRITE(6,*) 'NEO RUNS ARE NOT ENABLED, PLEASE RE-COMPILE WITH NEO'
      CALL ABRT
      FAAO(1) = WRK(1) + XX(1) + IX(1) + IA(1) + L1
      RETURN
      END
C*MODULE NEOPOS   *DECK LAMDAHF
      SUBROUTINE LAMBDAHF
      IMPLICIT DOUBLE PRECISION(A-H,O-Z)
      WRITE(6,*) 'NEO RUNS ARE NOT ENABLED, PLEASE RE-COMPILE WITH NEO'
      CALL ABRT
      RETURN
      END
C
C*MODULE NEOGRD   *DECK NEOGRAD
      SUBROUTINE NEOGRAD
      IMPLICIT DOUBLE PRECISION(A-H,O-Z)
      WRITE(6,*) 'NEO RUNS ARE NOT ENABLED, PLEASE RE-COMPILE WITH NEO'
      CALL ABRT
      RETURN
      END
C
C*MODULE NEOOPT  *DECK NEOIZ
      SUBROUTINE NEOIZ(ZANI,ZANJ,IZI,IZJ,I,J)
      IMPLICIT DOUBLE PRECISION(A-H,O-Z)
      IZI = INT(ZANI) + I
      IZJ = INT(ZANJ) + J
      WRITE(6,*) 'NEO RUNS ARE NOT ENABLED, PLEASE RE-COMPILE WITH NEO'
      CALL ABRT
      RETURN
      END
C
C*MODULE NEOOPT  *DECK NEOSTP
      SUBROUTINE NEOSTP
      IMPLICIT DOUBLE PRECISION(A-H,O-Z)
      WRITE(6,*) 'NEO RUNS ARE NOT ENABLED, PLEASE RE-COMPILE WITH NEO'
      CALL ABRT
      RETURN
      END
C
C*MODULE NEOVIB  *DECK FGMTRX_NEO
      SUBROUTINE FGMTRX_NEO(VEC,FCM,E,SCR,IA,RM,SVTZT,
     *                  SVTZR,SVTZTT,SVTZRT,CC,COM,ZMS,BUF1,BUF2,
     *                  NC1,NC2,NPART,DDM,GOTDDM,ADM,GOTADM,
     *                  PROJCT,STATPT,SCFOK)
C
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
      LOGICAL GOTDDM,GOTADM,PROJCT,STATPT,SCFOK
      DIMENSION VEC(NC1,NC1),FCM(NC2),E(NC1),SCR(NC1,8),IA(NC1),
     *          RM(*),SVTZT(3,NC1),SVTZR(3,NC1),
     *          SVTZTT(NC1),SVTZRT(NC1),
     *          CC(3,NPART),COM(3,NPART),ZMS(NPART),
     *          BUF1(NC1,NC1),BUF2(NC1,NC1),
     *          DDM(3,NC1),ADM(6,NC1)
      WRITE(6,*) 'NEO RUNS ARE NOT ENABLED, PLEASE RE-COMPILE WITH NEO'
      CALL ABRT
C         TOUCH ALL ARGUMENTS JUST TO MAKE FTNCHEK REMAIN HAPPY.
C         NOTE THAT WE DON'T EVER EXECUTE THIS, WE ABORT JUST ABOVE.
      IF(STATPT .AND. SCFOK .AND. PROJCT .AND. GOTDDM .AND. GOTADM) THEN
      VEC(1,1)=FCM(1)+E(1)+SCR(1,1)+IA(1)+RM(1)+SVTZT(1,1)+SVTZR(1,1)
     *        +SVTZTT(1)+SVTZRT(1)+CC(1,1)+COM(1,1)+ZMS(1)+BUF1(1,1)
     *        +BUF2(1,1)+NC1+NC2+NPART+DDM(1,1)+ADM(1,1)
      ENDIF
      RETURN
      END
C
C*MODULE NEOPRP  *DECK PRPNEO
      SUBROUTINE PRPNEO(PRPTYP)
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
      CHARACTER*4 PRPTYP
      WRITE(6,900) PRPTYP
  900 FORMAT(1X,'NEO RUNS ARE NOT ENABLED, PLEASE RE-COMPILE WITH NEO'/
     *       1X,'PRPTYP=',A4)
      CALL ABRT
      RETURN
      END
C
C*MODULE NEOPRP  *DECK PUNNMO
      SUBROUTINE PUNNMO(NPUN)
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
      WRITE(6,900) NPUN
  900 FORMAT(1X,'NEO RUNS ARE NOT ENABLED, PLEASE RE-COMPILE WITH NEO'/
     *       1X,'NPUN=',I4)
      CALL ABRT
      RETURN
      END
