From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- math/bevington/smooth.f | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 math/bevington/smooth.f (limited to 'math/bevington/smooth.f') diff --git a/math/bevington/smooth.f b/math/bevington/smooth.f new file mode 100644 index 00000000..19c2c457 --- /dev/null +++ b/math/bevington/smooth.f @@ -0,0 +1,29 @@ +c subroutine smooth.f +c +c source +c Bevington, page 260. +c +c purpose +c smooth a set of data points by averaging adjacent channels +c +c usage +c call smooth (y, npts) +c +c description of parameters +c y - array of data points +c npts - number of data points +c +c subroutines and function subprograms required +c none +c + subroutine smooth (y,npts) + dimension y(1) +11 imax=npts-1 + yi=y(1) +21 do 24 i=1,imax + ynew=(yi+2.*y(i)+y(i+1))/4. + yi=y(i) +24 y(i)=ynew +25 y(npts)=(yi+3.*y(npts))/4. + return + end -- cgit