C   25/06/78 708272304  MEMBER NAME  ENELMX   (S)           FORTRAN
      FUNCTION ENELS(E)
C
C THIS FUNCTION GIVES THE AVERAGE IONIZATION LOSS, I.E. ENERGY LOSS
C UP TO THE MAXIMUM TRANSFER POSSIBLE. WMAX IS GIVEN BY FORMULA (53)
C WHICH FOR ELECTRONS IS E-ME. THE FORMULA IS NR (55) IN STERNHEIMER,
C P.R.B (1971) 3681.
C  NOTE THAT THE INPUT ENERGY COMES IN UNITS OF ME, I.E. == GAMMA,
C  THEREFORE     BETA**2 = 1 - 1/E**2
C  LN2 = .69315
C  CON = LN(P/MC) = LN(M BETA GAMMA/M) = LNE + .5 * LN(BETA**2)
C
C  COMMON/ILPAR/ IS SET IN PARST2, CALLED BY INTSHW
C
      COMMON/ILPAR/AI,BI,ALCUTM
C
      DATA RME/0.511/
C
      BE2=1.-1./E**2
      IF(BE2.LE.0.)GOTO10
      CON=ALOG(E)+ALOG(BE2)/2.
C
      ALMAX = (E-1.)*RME
      IF(ALMAX.LE.0) RALMAX = 0.
      IF(ALMAX.GT.0) RALMAX = ALOG(ALMAX)
C
      ENELS=AI*(BI+0.69315+2.*CON+RALMAX-2.*BE2
     @         -DENDEL(0.434294*CON))/BE2
C FUNCTION DENDEL CALCULATES DENSITY EFFECT CORRECTION.
      RETURN
 10   ENELS=0.
      RETURN
      END
