	subroutine stdev(n,rMiss,rX,rStDev,iErr)

c	Calculate the standard deviation of an array of numbers.
c	This routine simply takes the square root of the variance.

c	EQUATION: 	
c	          	sigma [ (x - x(bar) **2 ]    
c	          (   -----------------------------  ) ** 0.5
c	          	         n - 1  	   

*********************

c	Declarations

	real rX(1:n)

*********************

c	Main

	call variance(n,rMiss,rX,rVariance,iErr1)

	if (iErr1.eq.1) then
	  iErr=1
	  return
	else
	  rStDev = rVariance**0.5
	  iErr=0
	endif

	return
	end
