C mplinux0.f
C
C Machine-dependent routines MPIS, MPLARG and MPUPW
C
C MPIS, MPLARG and MPUPW modified 20010823 to work on Athlon 
C processor running Redhat Linux 7.1, compiled using f77  
C (GNU Fortran 0.5.26 20000731 (Red Hat Linux 7.1 2.96-81)).
C Also tested on Pentium II under Red Hat Linux 5.2 with
C GNU F77 version egcs-2.90.27 980315 (egcs-1.0.2 release).
C
C $$                   ******  MPIS  ******      Linux Version 20010829
      LOGICAL FUNCTION MPIS (J, K)
C
C              *************************    (SEE THE MP
C              *** MACHINE DEPENDENT ***     USERS GUIDE FOR
C              *************************     CONVERSION HINTS)
C
C ASSUMES THAT J AND K ARE WORDS CONTAINING ONE CHARACTER IN LEFT-MOST
C POSITION WITH BLANK FILL (READ UNDER A1 FORMAT OR SET BY 1HX DATA
C STATEMENT OR UNPACKED BY MPUPK).  RETURNS .TRUE. IF AND ONLY IF THE
C CHARACTERS ARE EQUAL.  
C
      INTEGER J, K
C
      MPIS = (MOD(J, 256) .EQ. MOD(K, 256))
C
      RETURN
      END
C $$                   ******  MPLARG  ******    Linux version 20010829
      SUBROUTINE MPLARG (MXINT)
C
C              *************************    (SEE THE MP
C              *** MACHINE DEPENDENT ***     USERS GUIDE FOR
C              *************************     CONVERSION HINTS)
C
C RETURNS MXINT .LE. THE MAXIMUM REPRESENTABLE INTEGER OF
C THE FORM 2**J - 1 .
C
C INTEGER ARITHMETIC MUST BE PERFORMED EXACTLY ON INTEGERS
C IN THE RANGE -MXINT ... +MXINT.
C
      INTEGER I, K, MX, MXINT, WDLEN
C
C WDLEN MAY BE SET TO THE WORDLENGTH (IN BITS) IN THE FOLLOWING
C DATA STATEMENT IF THE CODE BELOW FOR COMPUTING MXINT DOES
C NOT WORK.
C
      DATA WDLEN /32/
C
      K = WDLEN
C HERE K IS LOWER BOUND ON WORDLENGTH, COMPUTE 2**(K-1) - 1
      MXINT = 0
      DO 20 I = 2, K
   20 MXINT = 2*MXINT + 1
      RETURN
      END
C $$                   ******  MPUPW  ******     Linux version 20010829
      SUBROUTINE MPUPW (W, C, N)
C
C              *************************    (SEE THE MP
C              *** MACHINE DEPENDENT ***     USERS GUIDE FOR
C              *************************     CONVERSION HINTS)
C
C WHEN CALLED WITH PACKED CHARACTER STRING IN W,
C RETURNS N = NUMBER OF CHARACTERS/WORD AND THE
C CHARACTERS IN C(1), ... , C(N), UNPACKED, LEFT JUSTIFIED,
C BLANK FILLED.
C
      INTEGER W, C(4), N
      INTEGER W0
      W0 = W
      C(1) = MOD (W0, 256)
      W0 = W0/256
      C(2) = MOD (W0, 256)
      W0 = W0/256
      C(3) = MOD (W0, 256)
      W0 = W0/256
      C(4) = MOD (W0, 256)
      N = 4
      RETURN
      END
