intdy.f

Go to the documentation of this file.
00001       SUBROUTINE INTDY (T, K, YH, NYH, DKY, IFLAG)
00002 CLLL. OPTIMIZE
00003       INTEGER K, NYH, IFLAG
00004       INTEGER IOWND, IOWNS,
00005      1   ICF, IERPJ, IERSL, JCUR, JSTART, KFLAG, L, METH, MITER,
00006      2   MAXORD, MAXCOR, MSBP, MXNCF, N, NQ, NST, NFE, NJE, NQU
00007       INTEGER I, IC, J, JB, JB2, JJ, JJ1, JP1
00008       DOUBLE PRECISION T, YH, DKY
00009       DOUBLE PRECISION ROWNS, 
00010      1   CCMAX, EL0, H, HMIN, HMXI, HU, RC, TN, UROUND
00011       DOUBLE PRECISION C, R, S, TP
00012       DIMENSION YH(NYH,*), DKY(*)
00013       COMMON /LS0001/ ROWNS(209),
00014      2   CCMAX, EL0, H, HMIN, HMXI, HU, RC, TN, UROUND,
00015      3   IOWND(14), IOWNS(6), 
00016      4   ICF, IERPJ, IERSL, JCUR, JSTART, KFLAG, L, METH, MITER,
00017      5   MAXORD, MAXCOR, MSBP, MXNCF, N, NQ, NST, NFE, NJE, NQU
00018 C-----------------------------------------------------------------------
00019 C INTDY COMPUTES INTERPOLATED VALUES OF THE K-TH DERIVATIVE OF THE
00020 C DEPENDENT VARIABLE VECTOR Y, AND STORES IT IN DKY.  THIS ROUTINE
00021 C IS CALLED WITHIN THE PACKAGE WITH K = 0 AND T = TOUT, BUT MAY
00022 C ALSO BE CALLED BY THE USER FOR ANY K UP TO THE CURRENT ORDER.
00023 C (SEE DETAILED INSTRUCTIONS IN THE USAGE DOCUMENTATION.)
00024 C-----------------------------------------------------------------------
00025 C THE COMPUTED VALUES IN DKY ARE GOTTEN BY INTERPOLATION USING THE
00026 C NORDSIECK HISTORY ARRAY YH.  THIS ARRAY CORRESPONDS UNIQUELY TO A
00027 C VECTOR-VALUED POLYNOMIAL OF DEGREE NQCUR OR LESS, AND DKY IS SET
00028 C TO THE K-TH DERIVATIVE OF THIS POLYNOMIAL AT T. 
00029 C THE FORMULA FOR DKY IS..
00030 C              Q
00031 C  DKY(I)  =  SUM  C(J,K) * (T - TN)**(J-K) * H**(-J) * YH(I,J+1)
00032 C             J=K
00033 C WHERE  C(J,K) = J*(J-1)*...*(J-K+1), Q = NQCUR, TN = TCUR, H = HCUR.
00034 C THE QUANTITIES  NQ = NQCUR, L = NQ+1, N = NEQ, TN, AND H ARE
00035 C COMMUNICATED BY COMMON.  THE ABOVE SUM IS DONE IN REVERSE ORDER.
00036 C IFLAG IS RETURNED NEGATIVE IF EITHER K OR T IS OUT OF BOUNDS.
00037 C-----------------------------------------------------------------------
00038       IFLAG = 0
00039       IF (K .LT. 0 .OR. K .GT. NQ) GO TO 80
00040       TP = TN - HU -  100.0D0*UROUND*(TN + HU)
00041       IF ((T-TP)*(T-TN) .GT. 0.0D0) GO TO 90
00042 C
00043       S = (T - TN)/H
00044       IC = 1
00045       IF (K .EQ. 0) GO TO 15
00046       JJ1 = L - K
00047       DO 10 JJ = JJ1,NQ
00048  10     IC = IC*JJ
00049  15   C = DBLE(IC)
00050       DO 20 I = 1,N 
00051  20     DKY(I) = C*YH(I,L)
00052       IF (K .EQ. NQ) GO TO 55 
00053       JB2 = NQ - K
00054       DO 50 JB = 1,JB2
00055         J = NQ - JB 
00056         JP1 = J + 1 
00057         IC = 1
00058         IF (K .EQ. 0) GO TO 35
00059         JJ1 = JP1 - K
00060         DO 30 JJ = JJ1,J
00061  30       IC = IC*JJ
00062  35     C = DBLE(IC)
00063         DO 40 I = 1,N
00064  40       DKY(I) = C*YH(I,JP1) + S*DKY(I)
00065  50     CONTINUE
00066       IF (K .EQ. 0) RETURN
00067  55   R = H**(-K)
00068       DO 60 I = 1,N 
00069  60     DKY(I) = R*DKY(I)
00070       RETURN
00071 C
00072  80   CALL XERRWD('INTDY--  K (=I1) ILLEGAL      ',
00073      1   30, 51, 0, 1, K, 0, 0, 0.0D0, 0.0D0)
00074       IFLAG = -1
00075       RETURN
00076  90   CALL XERRWD('INTDY--  T (=R1) ILLEGAL      ',
00077      1   30, 52, 0, 0, 0, 0, 1, T, 0.0D0)
00078       CALL XERRWD(
00079      1  '      T NOT IN INTERVAL TCUR - HU (= R1) TO TCUR (=R2)      ',
00080      1   60, 52, 0, 0, 0, 0, 2, TP, TN) 
00081       IFLAG = -2
00082       RETURN
00083 C----------------------- END OF SUBROUTINE INTDY -----------------------
00084       END 
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines