Check for invalid argument in pctile().

This commit is contained in:
Joe Taylor 2023-10-18 07:50:39 -04:00
parent 893565f40d
commit 97ed4022a2

View File

@ -3,6 +3,7 @@ subroutine pctile(x,npts,npct,xpct)
real x(npts)
real,allocatable :: tmp(:)
if(npts.lt.0) go to 900
allocate(tmp(npts))
tmp=x
@ -11,6 +12,7 @@ subroutine pctile(x,npts,npct,xpct)
if(j.lt.1) j=1
if(j.gt.npts) j=npts
xpct=tmp(j)
deallocate(tmp)
return
900 return
end subroutine pctile