From 97ed4022a2b12f053cb0c9caa1a6e93bfb9e34ff Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 18 Oct 2023 07:50:39 -0400 Subject: [PATCH] Check for invalid argument in pctile(). --- lib/pctile.f90 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/pctile.f90 b/lib/pctile.f90 index 0c16aaba3..6fde9dd99 100644 --- a/lib/pctile.f90 +++ b/lib/pctile.f90 @@ -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