subroutine shap1dc (zz,lnz,nord) c c======================================================================= c === c This routine applies a Shapiro filter around a closed curve. === c === c ------ === c Input: === c ------ === c === c LNZ The length of ZZ. (integer) === c NORD The order of the Shapiro filter. (integer) === c ZZ The field to be filtered. (real vector) === c === c ------- === c Output: === c ------- === c === c ZZ The filtered field. (real vector) === c === c ------ === c Calls: === c ------ === c === c none === c === c======================================================================= c c----------------------------------------------------------------------- c Define global data. c----------------------------------------------------------------------- c #include #include #include c c----------------------------------------------------------------------- c Define local data. c----------------------------------------------------------------------- c integer i,idown,iodev,iup,n,lnz,lnzm1,nord real fac real g(maxext,0:1),zz(lnz) c c======================================================================= c Begin executable code. c======================================================================= c c----------------------------------------------------------------------- c Initialize pointer & scale factors. c----------------------------------------------------------------------- c iup = 1 lnzm1 = lnz - 1 c iodev=(nord+1)/2-nord/2 fac=cm1+c2*float(iodev) fac=fac/c2**(2*nord) c c----------------------------------------------------------------------- c Load data into work array. c----------------------------------------------------------------------- c do 10 i=1,lnz g(i,iup)=zz(i) 10 continue c c----------------------------------------------------------------------- c Construct differences. c----------------------------------------------------------------------- c do 30 n=1,nord idown=1-iup do 20 i=2,lnzm1 g(i,idown)=(g(i+1,iup)-g(i,iup))+(g(i-1,iup)-g(i,iup)) 20 continue g(1,idown)=(g(2,iup)-g(1,iup))+(g(lnz,iup)-g(1,iup)) g(lnz,idown)=(g(1,iup)-g(lnz,iup))+(g(lnzm1,iup)-g(lnz,iup)) iup=1-iup 30 continue c c----------------------------------------------------------------------- c Apply filter. c----------------------------------------------------------------------- c do 40 i=1,lnz zz(i) = zz(i) + fac*g(i,iup) 40 continue c return end