	INTEGER FUNCTION NEL(A,N)
C
C  Note:  This is the UNIX version.  
C
C		Version 2U, D. Gudehus, April, 1999
C		Modified END for Unix
C		Version 3U, D. Gudehus, Dec. 16, 2002
C		Changed ENDLIN to catch NaN situations
C		Version 3UM, D. Gudehus, February 8, 2005
C		Modified END for Absoft compiler on Mac OS
C
C       This function counts the number of 4-byte words in the array
C  A of dimension N.  It is used after a call to USRINP.  If a default 
C  is not taken with USRINP, the correct number will be returned;  however,
C  if a default is taken with USRINP, one must precede the call to USRINP
C  with a call to SETEND.  For example,   
C	DO I=1,MAXNUMPARAM
C	  J=SETEND(PARAMETER(I))
C	END DO
C	CALL USRINP(PARAMETER,...)
C	NUM=NEL(PARAMETER,N)
C
	INTEGER ENDLIN
	DIMENSION A(N)
	INTEGER IEND
	EQUIVALENCE (IEND,END)
	DATA IEND/'FF7FFFFF'X/
C
	DO I=1,N
	  IF (A(I).EQ.END) GO TO 11
	END DO
   11	NEL=I-1
	RETURN
C
	ENTRY ENDLIN(X)  ! NB This is an integer function
C 
C       This function tests for the end of array indicator and will
C  be true if the idicator is present.
C
	ENDLIN=0
	  
	IF (X.EQ.END) ENDLIN=1
C  If a NaN situation arises, and the end of the input sequence has
C  not been reached, we can catch it with the following:
	IF (X.LT.END) ENDLIN=0
	IF (X.GT.END) ENDLIN=0 !  This is the important one
	RETURN
C
	ENTRY SETEND(X)
C
C       This function sets the argument equal to the end-of-array
C  indicator.
C
	X=END
	RETURN
C
	END
