* E01SGF 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=6*MMAX+5) * .. Local Scalars .. INTEGER I, IFAIL, M, N, NQ, NW * .. Local Arrays .. DOUBLE PRECISION F(MMAX), Q(NMAX), QX(NMAX), QY(NMAX), RQ(LRQ), + U(NMAX), V(NMAX), X(MMAX), Y(MMAX) INTEGER IQ(LIQ) * .. External Subroutines .. EXTERNAL E01SGF, E01SHF * .. Executable Statements .. WRITE (NOUT,*) 'E01SGF 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 and F. * DO 20 I = 1, M READ (NIN,*) X(I), Y(I), F(I) 20 CONTINUE * * Generate the interpolant. * NQ = 0 NW = 0 IFAIL = 1 CALL E01SGF(M,X,Y,F,NW,NQ,IQ,LIQ,RQ,LRQ,IFAIL) * IF (IFAIL.EQ.0) THEN * * Input the number of evaluation points. * READ (NIN,*) N * * Input the evaluation points. * DO 40 I = 1, N READ (NIN,*) U(I), V(I) 40 CONTINUE * * Evaluate the interpolant using E01SHF. * IFAIL = -1 CALL E01SHF(M,X,Y,F,IQ,LIQ,RQ,LRQ,N,U,V,Q,QX,QY,IFAIL) * IF (IFAIL.EQ.0) THEN WRITE (NOUT,*) ' I U(I) V(I) Q(I)' DO 60 I = 1, N WRITE (NOUT,99999) I, U(I), V(I), Q(I) 60 CONTINUE END IF ELSE WRITE (NOUT,99998) IFAIL END IF * END IF * 99999 FORMAT (1X,I6,3F10.2) 99998 FORMAT (1X,' ** E01SGF returned with IFAIL = ',I5) END