! sp2 Geoff's brain production ! Copyright (C) 1999,2010 Gauthier Delerce ! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software Foundation, ! Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! ! Gauthier Delerce !*------------------------------------------------------------------------- !* SP2 - solve for U at XI,YI given spline coefficients in S & T !* from SP1. X and Y are coordinate arrays same as those sent to SP1. !*------------------------------------------------------------------------- subroutine sp2(xi,yi,x,y,n,s,t,u) implicit real(8) (a-g,o-z) real x(n),y(n),xi,yi,u real(8) s(n),t(3) u=0. !*------------ interpolate at Xi,Yi from S(N) coefficients --------------- do k=1,n dx=dble(xi-x(k)) dy=dble(yi-y(k)) tt=dx*dx+dy*dy if (tt.ne.0.d0) then dltt=dlog(tt) dxtt=dx*(dltt+1.d0) dytt=dy*(dltt+1.d0) u=u+sngl(s(k)*tt*dltt) endif end do !*----------------- add the contribution from the Ts ---------------------- u=u+sngl(t(1)*xi+t(2)*yi+t(3)) return end