C ********************************************************************** C * * C * SOFTWARE LICENSING * C * * C * This program is free software; you can redistribute * C * it and/or modify it under the terms of the GNU * C * General Public License as published by the Free * C * Software Foundation, either Version 2 of the * C * license, or (at your option) any later version. * C * * C * This program is distributed in the hope that it * C * will be useful, but without any warranty; without * C * even the implied warranty of merchantability or * C * fitness for a particular purpose. See the GNU * C * General Public License for more details. * C * * C * A copy of the GNU General Public License is * C * available at http://www.gnu.org/copyleft/gpl.html * C * or by writing to the Free Software Foundation, Inc.,* C * 59 Temple Place - Suite 330, Boston, MA 02111, USA. * C * * C ********************************************************************** SUBROUTINE SINTER(X,A,Y,B,M,N) SAVE C VERSION(09/27/90) C C----------------------------------------------------------------------| C A SPECIAL CASE OF INTERP ....NO EXTRAPOLATION BELOW & ABOVE DATA C THIS ROUTINE LINEARLY INTERPOLATES AN ARRAY B | C X(M) MUST BE DESCENDING | C A(X) GIVEN FUNCTION | C B(Y) FOUND BY LINEAR INTERPOLATION AND EXTRAPOLATION | C Y(N) THE DESIRED DEPTHS | C M THE NUMBER OF POINTS IN X AND A | C N THE NUMBER OF POINTS IN Y AND B | C----------------------------------------------------------------------| C DIMENSION X(M),A(M),Y(N),B(N) C C-------- BOUNDARIES --------------------------------------------------- DO 30 I=1,N IF(Y(I).GT.X(1)) B(I)=A(1) IF(Y(I).LT.X(M)) B(I)=A(M) 30 CONTINUE C C-------- INTERPOLATION CASES ------------------------------------------ NM=M-1 DO 10 I=1,N DO 20 J=1,NM IF(Y(I).LE.X(J).AND.Y(I).GE.X(J+1)) + B(I)=A(J) -(A(J)-A(J+1))*(X(J)-Y(I))/(X(J)-X(J+1)) 20 CONTINUE 10 CONTINUE C RETURN END