      INTEGER FUNCTION ME32O64(IDUMMY)
C
C     * MAY 05/08 - F.MAJAESS (ENSURE BNUM IS INITIALIZED)
C     * JUL 07/03 - A.IRWIN,F.MAJAESS (REVISED FOR F90 AND LINUX PLATFORMS)
C     * A.J. STACEY    -MARCH 23,1992-  ROUTINE CREATED TO TELL CALLING
C     *                                 PROGRAM WHETHER CURRENT MACHINE
C     *                                 IS A 32-BIT MACHINE (2) OR A 
C     *                                 64-BIT MACHINE (1).
C     *
C     * ALGORITHM:
C     * 
C     * THIS SUBPROGRAM SHOULD BE CALLED AS FOLLOWS:
C     *
C     *        :
C     *       MACHINE = ME32O64(DUMMY)
C     *       IF      (MACHINE .EQ. 1) THEN
C     *         PRINT *,' I AM A 64-BIT MACHINE. '
C     *       ELSE IF (MACHINE .EQ. 2) THEN
C     *         PRINT *,' I AM A 32-BIT MACHINE. '
C     *       ELSE
C     *         PRINT *,' ERROR (NOT A VALID MACHINE VALUE.)'
C     *       END IF
C     *        :
C     *
C     * THIS ROUTINE USES A TRICK THAT INTEGERS DO NOT HAVE A 64-BIT 
C     * REPRESENTATION ON MACHINES THAT ARE OPERATING IN TRUE 32-BIT MODE.
C     * BY REFERENCING A 64-BIT CONSTANT AS AN INTEGER AND ASSIGNING IT
C     * TO ANOTHER INTEGER, 32-BIT MACHINES WILL TRANSFER ONLY HALF OF THE
C     * REAL*8 TEST VALUE, WHICH CAN BE DETECTED AND TESTED.
C     *
C     * NOTE: IT IS IMPORTANT THAT THE CONSTANT CHOSE FOR "ANUM" HAVE NON-ZERO
C     * BITS IN THE THE LEAST SIGNIFICANT 32-BIT HALF OF A 64-BIT WORD.
C     * CHOOSING "DSQRT(2)" SOLVES THIS PROBLEM.
C
      IMPLICIT REAL (A-H,O-Z),
     +INTEGER (I-N)
      REAL*8       ANUM,BNUM
      INTEGER      INUM,JNUM
      EQUIVALENCE (ANUM,INUM),(BNUM,JNUM)
C-------------------------------------------------------------------------------
      BNUM     =-DSQRT(2.0D0) + 1.0D0
      ANUM     = DSQRT(2.0D0)
      JNUM     = INUM
      IF (ANUM .NE. BNUM) THEN
       ME32O64 = 2
      ELSE
       ME32O64 = 1
      ENDIF
      RETURN
      END
