CSUBR file = NIJX1.ALL              **** Part 1  of the NIJX subroutines
**** Computer specific or user-dependent subroutines: updt: 27 Sep. 1999
****    NIJX = NIJX1 + NIJX2   !
****
C NIJX1 = the first part of the NIJX subroutines,
C REPROGRAMMED BY S.G.G. 1986, FORTRAN77 BY W.B. AND C.J. 1987
C BASED ON THE DIRDIF 1981 KERN SUBROUTINES
C List of subroutines given in this NIJX1 FORTRAN deck:
C DATIME, KEYSWI, FILINX
C+----------------------------------------------------------------------
*
CSUBROUTINE DATIME (I1, I2, I3)
C-----------------------------------------------------------------------
C THIS VERSION IS A DUMMY ROUTINE : Return: I1 = I2 = I3 = 0  !!!!!!!!!!
C Subroutine to get the system date and the CPU time in msec.  Output:
C   I1   time of the day as hhmm (hh=hours, mm=minutes)
C   I2   CPU time in msec used since initiation
C   I3   day-number as yynnn (yy=year, nnn=number)
C I1 = I2 = I3 = 0 implies that an invalid clock value was returned
C or that the time routines have been disabled, as is the case here.
C This subroutine is computer dependent if properly used.
C Suggestions for use and modifications: see other NIJX1.... files.
C Subroutine DATIME is only used by the subroutines KEDATE and KETIME .
C+----------------------------------------------------------------------
      SUBROUTINE DATIME (I1, I2, I3)
      I1 = 0
      I2 = 0
      I3 = 0
      RETURN
C        END OF SUBROUTINE DATIME
      END
CSUBROUTINE KEYSWI
C-----------------------------------------------------------------------
C Subr. for 'local' KEYS and SWITCH settings, and 'local' specialities !
C    Switches are defaulted .FALSE. and may be changed at any time:
C SWITCH(1) = NIJMEG = .TRUE. on execution in Nijmegen: see NIJX1.IBM ??
C SWITCH(2) = MOLEN  = .TRUE. for MOLEN users
C SWITCH(6) = SWFILX = .TRUE. if subr. FILINX is needed: -> NIJX1.CYB ??
C SWITCH(3), SWITCH(4) and SWITCH(5) are still free.
C    KEYS() are defaulted = 0  and several are still free.
C KEYSWI is called once at the beginning of each program, and it is
C called again at any STOP (including at an error stop).
***  Note 1: if you wish us to implement some special private features
C    for you, please, write to us. These private features then will be
C    activated by these SWITCHes or KEYS.
***  Note 2: you can implement your own routine at the beginning and at
C    the end of the execution of any program. E.g. see NIJX1.FORCYB.
***  Note 3: we will be very happy to help !
C+----------------------------------------------------------------------
      SUBROUTINE KEYSWI
C     ------ /SYSTA/ and /SYSTB/ interface with supervisor.
      COMMON /SYSTA/ IFILE(20), IFSTAT(20), ITIME(4),   KEYS(28),
     *               NFNUM,     NLIT,       NCOLN(32),  NCOLL(32),
     *               NFDOT(32), NFDOL(32),  NLUSER(32), FNUM(32),
     *               SWITCH(28)
      LOGICAL        SWITCH
C98   LOGICAL SWFILX
C98   EQUIVALENCE (SWFILX, SWITCH(6))
C XXX version: KEYS(11)=IATX==> =3 for SPF, =4 for SCHAKAL, =5 for both.
      EQUIVALENCE (IATX, KEYS(11))
      LOGICAL FIRST
      DATA FIRST / .TRUE. /
C98   SWFILX = .TRUE.
C        subr. FILINX will be called for local file definitions.
C XXX version: KEYS(11)=IATX==> =3 for SPF, =4 for SCHAKAL, =5 for both.
C === output atoms file for programs PLUTON and SCHAKAL, respectively.
Cxxx
      IF (IATX .EQ. 0) IATX = 5
Cxxx
 
      IF (FIRST) THEN
C        switch FIRST = .TRUE. for first entry, reset to .FALSE.
         FIRST = .FALSE.
C           things to be done at start for each program
      ELSE
         FIRST = .TRUE.
C           things to be done at STOP for each program
         ENDIF
      RETURN
C        END OF SUBROUTINE KEYSWI
      END
CSUBROUTINE FILINX (FNAME)
C-----------------------------------------------------------------------
C Subr. for 'local' file definitions, only used if SWITCH(6)=.TRUE.
C Filename: CHARACTER FNAME *64 is modified to suit your needs:
C In this example subroutine:
C Most filenames will be used as eXtension to CCODE (true compound code)
C    e.g. CRYSDA will be denoted: CCODE.CRYSDA   (CCODE ===> true code!)
C If FNAME = ORBASE or ORUSER or HELP: it will be eXtended to DIRDIF
C Warning: see that unit 5 or 6  (IDR and LIS1) are defined properly.
C For another example, forcing lower case names, see subrout.  NIJX1.SG*
C+----------------------------------------------------------------------
      SUBROUTINE FILINX (FNAME)
      CHARACTER *64 FNAME, GNAME
C     ------ /SYSTA/ and /SYSTB/ interface with supervisor.
      COMMON /SYSTB/ PROGNM,    PROSNM,     CCODE,      TITLE,
     *               CHIN,      LIT(32),    CHOUT
      CHARACTER      PROGNM *8, PROSNM *6,  CCODE *6,   TITLE *64,
     *               CHIN *80,  LIT *6,     CHOUT *72
C        Count number of char. in CCODE : N
      DO 111 N = 6, 1, -1
      IF (CCODE(N:N) .NE. ' ') GOTO 122
  111 CONTINUE
C check non-blank CCODE ?
  122 GNAME = CCODE(1:N)//'.'//FNAME
C        or for special files:
      IF (FNAME .EQ. 'DDHELP' .OR. FNAME .EQ. 'ORBASE' .OR.
     *    FNAME .EQ. 'DDCON ' .OR. FNAME .EQ. 'DDLIC ' .OR.
     *      FNAME .EQ. 'DDCONFIG' .OR.
     *   FNAME .EQ. 'ORUSER') GNAME = 'DIRDIF.'//FNAME
* rm ddconfig
***      disabled:
***   IF (FNAME .EQ. 'LIS1') GNAME = CCODE(1:N)//'.LST'
      FNAME = GNAME
      RETURN
C        END OF SUBROUTINE FILINX
      END
