2012-11-12 13:28:28 -05:00
|
|
|
subroutine pctile(x,npts,npct,xpct)
|
2012-10-11 14:33:50 -04:00
|
|
|
|
2020-12-05 11:09:27 -05:00
|
|
|
real x(npts)
|
|
|
|
real,allocatable :: tmp(:)
|
2012-10-11 14:33:50 -04:00
|
|
|
|
2020-12-05 11:09:27 -05:00
|
|
|
allocate(tmp(npts))
|
2012-10-31 14:33:56 -04:00
|
|
|
|
2020-12-05 11:09:27 -05:00
|
|
|
tmp=x
|
2015-11-17 20:28:12 -05:00
|
|
|
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
|
|
|
|
|
|
|
return
|
|
|
|
end subroutine pctile
|