      SUBROUTINE STATIS(X, N, XMIN, XMAX, XBAR, VAR, STDEV, SKEW, XKURT)
	REAL*8 A,ABAR,SD,S2,S3,S4
      DIMENSION X(N)
      ABAR = 0. 
      DO 310 I = 1, N 
 310  ABAR = ABAR + X(I)
      ABAR = ABAR / N 
      XBAR = ABAR 
      XMAX = -1.E20 
      XMIN = 1.E20
      SD = 0. 
      S2 = 0. 
      S3 = 0. 
      S4 = 0. 
      DO 320 I = 1, N 
      B = X(I)
      A = B
      XMAX = AMAX1(XMAX,B)
      XMIN = AMIN1(XMIN,B)
      SD = SD + (A - ABAR)**2 
      S2 = S2 + A**2
      S3 = S3 + A**3
 320  S4 = S4 + A**4
      VAR = SD / N
      STDEV = SQRT(VAR) 
	skew=-999.
	xkurt=-999.
	if(var.le.0.0) return
      SKEW = (S3/N - 3.*ABAR*S2/N + 2.*ABAR**3) / STDEV**3
      XKURT= ((S4 - 4.*ABAR*S3 + 6.*ABAR*ABAR*S2)/N -3.*ABAR**4)/ VAR**2
      RETURN
      END 
