1 2 DOUBLE PRECISION FUNCTION DB2VAL(XVAL,YVAL,IDX,IDY,TX,TY,NX,NY, 3 * KX,KY,BCOEF,WORK) 4C***BEGIN PROLOGUE DB2VAL 5C***DATE WRITTEN 25 MAY 1982 6C***REVISION DATE 25 MAY 1982 7C***CATEGORY NO. E1A 8C***KEYWORDS INTERPOLATION, TWO-DIMENSIONS, GRIDDED DATA, SPLINES, 9C PIECEWISE POLYNOMIALS 10C***AUTHOR BOISVERT, RONALD, NBS 11C SCIENTIFIC COMPUTING DIVISION 12C NATIONAL BUREAU OF STANDARDS 13C WASHINGTON, DC 20234 14C***PURPOSE DB2VAL EVALUATES THE PIECEWISE POLYNOMIAL INTERPOLATING 15C FUNCTION CONSTRUCTED BY THE ROUTINE DB2INK OR ONE OF ITS 16C PARTIAL DERIVATIVES. 17C DOUBLE PRECISION VERSION OF B2VAL. 18C***DESCRIPTION 19C 20C DB2VAL evaluates the tensor product piecewise polynomial 21C interpolant constructed by the routine DB2INK or one of its 22C derivatives at the point (XVAL,YVAL). To evaluate the interpolant 23C itself, set IDX=IDY=0, to evaluate the first partial with respect 24C to x, set IDX=1,IDY=0, and so on. 25C 26C DB2VAL returns 0.0E0 if (XVAL,YVAL) is out of range. That is, if 27C XVAL.LT.TX(1) .OR. XVAL.GT.TX(NX+KX) .OR. 28C YVAL.LT.TY(1) .OR. YVAL.GT.TY(NY+KY) 29C If the knots TX and TY were chosen by DB2INK, then this is 30C equivalent to 31C XVAL.LT.X(1) .OR. XVAL.GT.X(NX)+EPSX .OR. 32C YVAL.LT.Y(1) .OR. YVAL.GT.Y(NY)+EPSY 33C where EPSX = 0.1*(X(NX)-X(NX-1)) and EPSY = 0.1*(Y(NY)-Y(NY-1)). 34C 35C The input quantities TX, TY, NX, NY, KX, KY, and BCOEF should be 36C unchanged since the last call of DB2INK. 37C 38C 39C I N P U T 40C --------- 41C 42C XVAL Double precision scalar 43C X coordinate of evaluation point. 44C 45C YVAL Double precision scalar 46C Y coordinate of evaluation point. 47C 48C IDX Integer scalar 49C X derivative of piecewise polynomial to evaluate. 50C 51C IDY Integer scalar 52C Y derivative of piecewise polynomial to evaluate. 53C 54C TX Double precision 1D array (size NX+KX) 55C Sequence of knots defining the piecewise polynomial in 56C the x direction. (Same as in last call to DB2INK.) 57C 58C TY Double precision 1D array (size NY+KY) 59C Sequence of knots defining the piecewise polynomial in 60C the y direction. (Same as in last call to DB2INK.) 61C 62C NX Integer scalar 63C The number of interpolation points in x. 64C (Same as in last call to DB2INK.) 65C 66C NY Integer scalar 67C The number of interpolation points in y. 68C (Same as in last call to DB2INK.) 69C 70C KX Integer scalar 71C Order of polynomial pieces in x. 72C (Same as in last call to DB2INK.) 73C 74C KY Integer scalar 75C Order of polynomial pieces in y. 76C (Same as in last call to DB2INK.) 77C 78C BCOEF Double precision 2D array (size NX by NY) 79C The B-spline coefficients computed by DB2INK. 80C 81C WORK Double precision 1D array (size 3*max(KX,KY) + KY) 82C A working storage array. 83C 84C***REFERENCES CARL DE BOOR, A PRACTICAL GUIDE TO SPLINES, 85C SPRINGER-VERLAG, NEW YORK, 1978. 86C***ROUTINES CALLED DINTRV,DBVALU 87C***END PROLOGUE DB2VAL 88 89 90