subroutine sintdy (t, k, yh, nyh, dky, iflag) C***BEGIN PROLOGUE SINTDY C***SUBSIDIARY C***PURPOSE Interpolate solution derivatives. C***TYPE SINGLE PRECISION (SINTDY-S, DINTDY-D) C***AUTHOR Hindmarsh, Alan C., (LLNL) C***DESCRIPTION C C SINTDY computes interpolated values of the K-th derivative of the C dependent variable vector y, and stores it in DKY. This routine C is called within the package with K = 0 and T = TOUT, but may C also be called by the user for any K up to the current order. C (See detailed instructions in the usage documentation.) C C The computed values in DKY are gotten by interpolation using the C Nordsieck history array YH. This array corresponds uniquely to a C vector-valued polynomial of degree NQCUR or less, and DKY is set C to the K-th derivative of this polynomial at T. C The formula for DKY is: C q C DKY(i) = sum c(j,K) * (T - tn)**(j-K) * h**(-j) * YH(i,j+1) C j=K C where c(j,K) = j*(j-1)*...*(j-K+1), q = NQCUR, tn = TCUR, h = HCUR. C The quantities nq = NQCUR, l = nq+1, N = NEQ, tn, and h are C communicated by COMMON. The above sum is done in reverse order. C IFLAG is returned negative if either K or T is out of bounds. C C***SEE ALSO SLSODE C***ROUTINES CALLED XERRWV C***COMMON BLOCKS SLS001 C***REVISION HISTORY (YYMMDD) C 791129 DATE WRITTEN C 890501 Modified prologue to SLATEC/LDOC format. (FNF) C 890503 Minor cosmetic changes. (FNF) C 930809 Renamed to allow single/double precision versions. (ACH) C 010412 Reduced size of Common block /SLS001/. (ACH) C***END PROLOGUE SINTDY C**End integer k, nyh, iflag integer icf, ierpj, iersl, jcur, jstart, kflag, l, 1 lyh, lewt, lacor, lsavr, lwm, liwm, meth, miter, 2 maxord, maxcor, msbp, mxncf, n, nq, nst, nfe, nje, nqu integer i, ic, j, jb, jb2, jj, jj1, jp1 real t, yh, dky real ccmax, el0, h, hmin, hmxi, hu, rc, tn, uround real c, r, s, tp character*80 msg dimension yh(nyh,*), dky(*) common /sls001/ ccmax, el0, h, hmin, hmxi, hu, rc, tn, uround, 1 icf, ierpj, iersl, jcur, jstart, kflag, l, 2 lyh, lewt, lacor, lsavr, lwm, liwm, meth, miter, 3 maxord, maxcor, msbp, mxncf, n, nq, nst, nfe, nje, nqu c c***first executable statement sintdy iflag = 0 if (k .lt. 0 .or. k .gt. nq) go to 80 tp = tn - hu - 100.0e0*uround*(tn + hu) if ((t-tp)*(t-tn) .gt. 0.0e0) go to 90 c s = (t - tn)/h ic = 1 if (k .eq. 0) go to 15 jj1 = l - k do 10 jj = jj1,nq 10 ic = ic*jj 15 c = ic do 20 i = 1,n 20 dky(i) = c*yh(i,l) if (k .eq. nq) go to 55 jb2 = nq - k do 50 jb = 1,jb2 j = nq - jb jp1 = j + 1 ic = 1 if (k .eq. 0) go to 35 jj1 = jp1 - k do 30 jj = jj1,j 30 ic = ic*jj 35 c = ic do 40 i = 1,n 40 dky(i) = c*yh(i,jp1) + s*dky(i) 50 continue if (k .eq. 0) return 55 r = h**(-k) do 60 i = 1,n 60 dky(i) = r*dky(i) return c 80 msg = 'sintdy- k (=i1) illegal ' call xerrwv (msg, 30, 51, 0, 1, k, 0, 0, 0.0e0, 0.0e0) iflag = -1 return 90 msg = 'sintdy- t (=r1) illegal ' call xerrwv (msg, 30, 52, 0, 0, 0, 0, 1, t, 0.0e0) msg=' t not in interval tcur - hu (= r1) to tcur (=r2) ' call xerrwv (msg, 60, 52, 0, 0, 0, 0, 2, tp, tn) iflag = -2 return c----------------------- end of subroutine sintdy ---------------------- end