* E01TGF Example Program Text * Mark 18 Release. NAG Copyright 1997. * .. Parameters .. INTEGER NIN, NOUT PARAMETER (NIN=5,NOUT=6) INTEGER MMAX, NMAX, LIQ, LRQ PARAMETER (MMAX=100,NMAX=100,LIQ=2*MMAX+1,LRQ=10*MMAX+7) * .. Local Scalars .. INTEGER I, IFAIL, M, N, NQ, NW * .. Local Arrays .. DOUBLE PRECISION F(MMAX), Q(NMAX), QX(NMAX), QY(NMAX), QZ(NMAX), + RQ(LRQ), U(NMAX), V(NMAX), W(NMAX), X(MMAX), + Y(MMAX), Z(MMAX) INTEGER IQ(LIQ) * .. External Subroutines .. EXTERNAL E01TGF, E01THF * .. Executable Statements .. WRITE (NOUT,*) 'E01TGF Example Program Results' WRITE (NOUT,*) * Skip heading in data file READ (NIN,*) * * Input the number of nodes. * READ (NIN,*) M IF (M.GT.0 .AND. M.LE.MMAX) THEN * * Input the data points X,Y,Z and F. * DO 20 I = 1, M READ (NIN,*) X(I), Y(I), Z(I), F(I) 20 CONTINUE * * Generate the interpolant. * NQ = 0 NW = 0 IFAIL = 0 CALL E01TGF(M,X,Y,Z,F,NW,NQ,IQ,LIQ,RQ,LRQ,IFAIL) * * Input the number of evaluation points. * READ (NIN,*) N * * Input the evaluation points. * DO 40 I = 1, N READ (NIN,*) U(I), V(I), W(I) 40 CONTINUE * * Evaluate the interpolant using E01THF. * IFAIL = -1 CALL E01THF(M,X,Y,Z,F,IQ,LIQ,RQ,LRQ,N,U,V,W,Q,QX,QY,QZ,IFAIL) * WRITE (NOUT,*) ' I U(I) V(I) W(I) Q(I)' DO 60 I = 1, N WRITE (NOUT,99999) I, U(I), V(I), W(I), Q(I) 60 CONTINUE * END IF STOP * 99999 FORMAT (1X,I6,4F10.4) END