2012-11-12 13:28:28 -05:00
|
|
|
subroutine pctile(x,npts,npct,xpct)
|
2012-10-11 14:33:50 -04:00
|
|
|
|
2017-06-16 09:27:17 -04:00
|
|
|
parameter (NMAX=128*1024)
|
2012-11-12 13:28:28 -05:00
|
|
|
real*4 x(npts)
|
|
|
|
real*4 tmp(NMAX)
|
2012-10-11 14:33:50 -04:00
|
|
|
|
2012-10-31 14:33:56 -04:00
|
|
|
if(npts.le.0) then
|
2012-11-12 13:28:28 -05:00
|
|
|
xpct=1.0
|
2012-10-31 14:33:56 -04:00
|
|
|
go to 900
|
|
|
|
endif
|
2012-11-12 13:28:28 -05:00
|
|
|
if(npts.gt.NMAX) stop
|
2012-10-31 14:33:56 -04:00
|
|
|
|
2015-11-17 20:28:12 -05:00
|
|
|
tmp(1:npts)=x
|
|
|
|
call shell(npts,tmp)
|
2012-11-12 13:28:28 -05:00
|
|
|
j=nint(npts*0.01*npct)
|
|
|
|
if(j.lt.1) j=1
|
|
|
|
if(j.gt.npts) j=npts
|
|
|
|
xpct=tmp(j)
|
2012-10-11 14:33:50 -04:00
|
|
|
|
2012-10-31 14:33:56 -04:00
|
|
|
900 continue
|
2012-10-11 14:33:50 -04:00
|
|
|
return
|
|
|
|
end subroutine pctile
|