annotate libcruft/daspk/ddaspk.f @ 4329:d53c33d93440

[project @ 2003-02-18 20:00:48 by jwe]
author jwe
date Tue, 18 Feb 2003 20:08:20 +0000
parents 8389e78e67d4
children d20a2f261306
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3911
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1 C Work performed under the auspices of the U.S. Department of Energy
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2 C by Lawrence Livermore National Laboratory under contract number
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
3 C W-7405-Eng-48.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
4 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
5 SUBROUTINE DDASPK (RES, NEQ, T, Y, YPRIME, TOUT, INFO, RTOL, ATOL,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
6 * IDID, RWORK, LRW, IWORK, LIW, RPAR, IPAR, JAC, PSOL)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
7 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
8 C***BEGIN PROLOGUE DDASPK
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
9 C***DATE WRITTEN 890101 (YYMMDD)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
10 C***REVISION DATE 910624
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
11 C***REVISION DATE 920929 (CJ in RES call, RES counter fix.)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
12 C***REVISION DATE 921215 (Warnings on poor iteration performance)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
13 C***REVISION DATE 921216 (NRMAX as optional input)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
14 C***REVISION DATE 930315 (Name change: DDINI to DDINIT)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
15 C***REVISION DATE 940822 (Replaced initial condition calculation)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
16 C***REVISION DATE 941101 (Added linesearch in I.C. calculations)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
17 C***REVISION DATE 941220 (Misc. corrections throughout)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
18 C***REVISION DATE 950125 (Added DINVWT routine)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
19 C***REVISION DATE 950714 (Misc. corrections throughout)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
20 C***REVISION DATE 950802 (Default NRMAX = 5, based on tests.)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
21 C***REVISION DATE 950808 (Optional error test added.)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
22 C***REVISION DATE 950814 (Added I.C. constraints and INFO(14))
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
23 C***REVISION DATE 950828 (Various minor corrections.)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
24 C***REVISION DATE 951006 (Corrected WT scaling in DFNRMK.)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
25 C***REVISION DATE 960129 (Corrected RL bug in DLINSD, DLINSK.)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
26 C***REVISION DATE 960301 (Added NONNEG to SAVE statement.)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
27 C***CATEGORY NO. I1A2
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
28 C***KEYWORDS DIFFERENTIAL/ALGEBRAIC, BACKWARD DIFFERENTIATION FORMULAS,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
29 C IMPLICIT DIFFERENTIAL SYSTEMS, KRYLOV ITERATION
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
30 C***AUTHORS Linda R. Petzold, Peter N. Brown, Alan C. Hindmarsh, and
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
31 C Clement W. Ulrich
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
32 C Center for Computational Sciences & Engineering, L-316
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
33 C Lawrence Livermore National Laboratory
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
34 C P.O. Box 808,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
35 C Livermore, CA 94551
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
36 C***PURPOSE This code solves a system of differential/algebraic
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
37 C equations of the form
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
38 C G(t,y,y') = 0 ,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
39 C using a combination of Backward Differentiation Formula
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
40 C (BDF) methods and a choice of two linear system solution
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
41 C methods: direct (dense or band) or Krylov (iterative).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
42 C This version is in double precision.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
43 C-----------------------------------------------------------------------
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
44 C***DESCRIPTION
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
45 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
46 C *Usage:
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
47 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
48 C IMPLICIT DOUBLE PRECISION(A-H,O-Z)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
49 C INTEGER NEQ, INFO(N), IDID, LRW, LIW, IWORK(LIW), IPAR(*)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
50 C DOUBLE PRECISION T, Y(*), YPRIME(*), TOUT, RTOL(*), ATOL(*),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
51 C RWORK(LRW), RPAR(*)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
52 C EXTERNAL RES, JAC, PSOL
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
53 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
54 C CALL DDASPK (RES, NEQ, T, Y, YPRIME, TOUT, INFO, RTOL, ATOL,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
55 C * IDID, RWORK, LRW, IWORK, LIW, RPAR, IPAR, JAC, PSOL)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
56 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
57 C Quantities which may be altered by the code are:
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
58 C T, Y(*), YPRIME(*), INFO(1), RTOL, ATOL, IDID, RWORK(*), IWORK(*)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
59 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
60 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
61 C *Arguments:
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
62 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
63 C RES:EXT This is the name of a subroutine which you
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
64 C provide to define the residual function G(t,y,y')
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
65 C of the differential/algebraic system.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
66 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
67 C NEQ:IN This is the number of equations in the system.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
68 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
69 C T:INOUT This is the current value of the independent
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
70 C variable.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
71 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
72 C Y(*):INOUT This array contains the solution components at T.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
73 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
74 C YPRIME(*):INOUT This array contains the derivatives of the solution
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
75 C components at T.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
76 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
77 C TOUT:IN This is a point at which a solution is desired.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
78 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
79 C INFO(N):IN This is an integer array used to communicate details
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
80 C of how the solution is to be carried out, such as
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
81 C tolerance type, matrix structure, step size and
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
82 C order limits, and choice of nonlinear system method.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
83 C N must be at least 20.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
84 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
85 C RTOL,ATOL:INOUT These quantities represent absolute and relative
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
86 C error tolerances (on local error) which you provide
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
87 C to indicate how accurately you wish the solution to
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
88 C be computed. You may choose them to be both scalars
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
89 C or else both arrays of length NEQ.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
90 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
91 C IDID:OUT This integer scalar is an indicator reporting what
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
92 C the code did. You must monitor this variable to
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
93 C decide what action to take next.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
94 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
95 C RWORK:WORK A real work array of length LRW which provides the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
96 C code with needed storage space.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
97 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
98 C LRW:IN The length of RWORK.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
99 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
100 C IWORK:WORK An integer work array of length LIW which provides
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
101 C the code with needed storage space.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
102 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
103 C LIW:IN The length of IWORK.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
104 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
105 C RPAR,IPAR:IN These are real and integer parameter arrays which
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
106 C you can use for communication between your calling
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
107 C program and the RES, JAC, and PSOL subroutines.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
108 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
109 C JAC:EXT This is the name of a subroutine which you may
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
110 C provide (optionally) for calculating Jacobian
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
111 C (partial derivative) data involved in solving linear
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
112 C systems within DDASPK.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
113 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
114 C PSOL:EXT This is the name of a subroutine which you must
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
115 C provide for solving linear systems if you selected
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
116 C a Krylov method. The purpose of PSOL is to solve
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
117 C linear systems involving a left preconditioner P.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
118 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
119 C *Overview
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
120 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
121 C The DDASPK solver uses the backward differentiation formulas of
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
122 C orders one through five to solve a system of the form G(t,y,y') = 0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
123 C for y = Y and y' = YPRIME. Values for Y and YPRIME at the initial
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
124 C time must be given as input. These values should be consistent,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
125 C that is, if T, Y, YPRIME are the given initial values, they should
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
126 C satisfy G(T,Y,YPRIME) = 0. However, if consistent values are not
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
127 C known, in many cases you can have DDASPK solve for them -- see INFO(11).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
128 C (This and other options are described in more detail below.)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
129 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
130 C Normally, DDASPK solves the system from T to TOUT. It is easy to
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
131 C continue the solution to get results at additional TOUT. This is
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
132 C the interval mode of operation. Intermediate results can also be
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
133 C obtained easily by specifying INFO(3).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
134 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
135 C On each step taken by DDASPK, a sequence of nonlinear algebraic
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
136 C systems arises. These are solved by one of two types of
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
137 C methods:
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
138 C * a Newton iteration with a direct method for the linear
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
139 C systems involved (INFO(12) = 0), or
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
140 C * a Newton iteration with a preconditioned Krylov iterative
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
141 C method for the linear systems involved (INFO(12) = 1).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
142 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
143 C The direct method choices are dense and band matrix solvers,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
144 C with either a user-supplied or an internal difference quotient
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
145 C Jacobian matrix, as specified by INFO(5) and INFO(6).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
146 C In the band case, INFO(6) = 1, you must supply half-bandwidths
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
147 C in IWORK(1) and IWORK(2).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
148 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
149 C The Krylov method is the Generalized Minimum Residual (GMRES)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
150 C method, in either complete or incomplete form, and with
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
151 C scaling and preconditioning. The method is implemented
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
152 C in an algorithm called SPIGMR. Certain options in the Krylov
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
153 C method case are specified by INFO(13) and INFO(15).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
154 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
155 C If the Krylov method is chosen, you may supply a pair of routines,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
156 C JAC and PSOL, to apply preconditioning to the linear system.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
157 C If the system is A*x = b, the matrix is A = dG/dY + CJ*dG/dYPRIME
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
158 C (of order NEQ). This system can then be preconditioned in the form
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
159 C (P-inverse)*A*x = (P-inverse)*b, with left preconditioner P.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
160 C (DDASPK does not allow right preconditioning.)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
161 C Then the Krylov method is applied to this altered, but equivalent,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
162 C linear system, hopefully with much better performance than without
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
163 C preconditioning. (In addition, a diagonal scaling matrix based on
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
164 C the tolerances is also introduced into the altered system.)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
165 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
166 C The JAC routine evaluates any data needed for solving systems
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
167 C with coefficient matrix P, and PSOL carries out that solution.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
168 C In any case, in order to improve convergence, you should try to
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
169 C make P approximate the matrix A as much as possible, while keeping
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
170 C the system P*x = b reasonably easy and inexpensive to solve for x,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
171 C given a vector b.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
172 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
173 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
174 C *Description
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
175 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
176 C------INPUT - WHAT TO DO ON THE FIRST CALL TO DDASPK-------------------
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
177 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
178 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
179 C The first call of the code is defined to be the start of each new
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
180 C problem. Read through the descriptions of all the following items,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
181 C provide sufficient storage space for designated arrays, set
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
182 C appropriate variables for the initialization of the problem, and
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
183 C give information about how you want the problem to be solved.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
184 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
185 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
186 C RES -- Provide a subroutine of the form
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
187 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
188 C SUBROUTINE RES (T, Y, YPRIME, CJ, DELTA, IRES, RPAR, IPAR)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
189 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
190 C to define the system of differential/algebraic
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
191 C equations which is to be solved. For the given values
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
192 C of T, Y and YPRIME, the subroutine should return
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
193 C the residual of the differential/algebraic system
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
194 C DELTA = G(T,Y,YPRIME)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
195 C DELTA is a vector of length NEQ which is output from RES.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
196 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
197 C Subroutine RES must not alter T, Y, YPRIME, or CJ.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
198 C You must declare the name RES in an EXTERNAL
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
199 C statement in your program that calls DDASPK.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
200 C You must dimension Y, YPRIME, and DELTA in RES.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
201 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
202 C The input argument CJ can be ignored, or used to rescale
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
203 C constraint equations in the system (see Ref. 2, p. 145).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
204 C Note: In this respect, DDASPK is not downward-compatible
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
205 C with DDASSL, which does not have the RES argument CJ.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
206 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
207 C IRES is an integer flag which is always equal to zero
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
208 C on input. Subroutine RES should alter IRES only if it
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
209 C encounters an illegal value of Y or a stop condition.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
210 C Set IRES = -1 if an input value is illegal, and DDASPK
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
211 C will try to solve the problem without getting IRES = -1.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
212 C If IRES = -2, DDASPK will return control to the calling
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
213 C program with IDID = -11.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
214 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
215 C RPAR and IPAR are real and integer parameter arrays which
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
216 C you can use for communication between your calling program
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
217 C and subroutine RES. They are not altered by DDASPK. If you
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
218 C do not need RPAR or IPAR, ignore these parameters by treat-
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
219 C ing them as dummy arguments. If you do choose to use them,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
220 C dimension them in your calling program and in RES as arrays
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
221 C of appropriate length.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
222 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
223 C NEQ -- Set it to the number of equations in the system (NEQ .GE. 1).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
224 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
225 C T -- Set it to the initial point of the integration. (T must be
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
226 C a variable.)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
227 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
228 C Y(*) -- Set this array to the initial values of the NEQ solution
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
229 C components at the initial point. You must dimension Y of
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
230 C length at least NEQ in your calling program.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
231 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
232 C YPRIME(*) -- Set this array to the initial values of the NEQ first
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
233 C derivatives of the solution components at the initial
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
234 C point. You must dimension YPRIME at least NEQ in your
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
235 C calling program.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
236 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
237 C TOUT - Set it to the first point at which a solution is desired.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
238 C You cannot take TOUT = T. Integration either forward in T
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
239 C (TOUT .GT. T) or backward in T (TOUT .LT. T) is permitted.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
240 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
241 C The code advances the solution from T to TOUT using step
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
242 C sizes which are automatically selected so as to achieve the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
243 C desired accuracy. If you wish, the code will return with the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
244 C solution and its derivative at intermediate steps (the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
245 C intermediate-output mode) so that you can monitor them,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
246 C but you still must provide TOUT in accord with the basic
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
247 C aim of the code.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
248 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
249 C The first step taken by the code is a critical one because
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
250 C it must reflect how fast the solution changes near the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
251 C initial point. The code automatically selects an initial
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
252 C step size which is practically always suitable for the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
253 C problem. By using the fact that the code will not step past
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
254 C TOUT in the first step, you could, if necessary, restrict the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
255 C length of the initial step.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
256 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
257 C For some problems it may not be permissible to integrate
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
258 C past a point TSTOP, because a discontinuity occurs there
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
259 C or the solution or its derivative is not defined beyond
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
260 C TSTOP. When you have declared a TSTOP point (see INFO(4)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
261 C and RWORK(1)), you have told the code not to integrate past
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
262 C TSTOP. In this case any tout beyond TSTOP is invalid input.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
263 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
264 C INFO(*) - Use the INFO array to give the code more details about
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
265 C how you want your problem solved. This array should be
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
266 C dimensioned of length 20, though DDASPK uses only the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
267 C first 15 entries. You must respond to all of the following
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
268 C items, which are arranged as questions. The simplest use
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
269 C of DDASPK corresponds to setting all entries of INFO to 0.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
270 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
271 C INFO(1) - This parameter enables the code to initialize itself.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
272 C You must set it to indicate the start of every new
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
273 C problem.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
274 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
275 C **** Is this the first call for this problem ...
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
276 C yes - set INFO(1) = 0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
277 C no - not applicable here.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
278 C See below for continuation calls. ****
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
279 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
280 C INFO(2) - How much accuracy you want of your solution
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
281 C is specified by the error tolerances RTOL and ATOL.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
282 C The simplest use is to take them both to be scalars.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
283 C To obtain more flexibility, they can both be arrays.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
284 C The code must be told your choice.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
285 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
286 C **** Are both error tolerances RTOL, ATOL scalars ...
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
287 C yes - set INFO(2) = 0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
288 C and input scalars for both RTOL and ATOL
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
289 C no - set INFO(2) = 1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
290 C and input arrays for both RTOL and ATOL ****
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
291 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
292 C INFO(3) - The code integrates from T in the direction of TOUT
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
293 C by steps. If you wish, it will return the computed
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
294 C solution and derivative at the next intermediate step
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
295 C (the intermediate-output mode) or TOUT, whichever comes
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
296 C first. This is a good way to proceed if you want to
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
297 C see the behavior of the solution. If you must have
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
298 C solutions at a great many specific TOUT points, this
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
299 C code will compute them efficiently.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
300 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
301 C **** Do you want the solution only at
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
302 C TOUT (and not at the next intermediate step) ...
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
303 C yes - set INFO(3) = 0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
304 C no - set INFO(3) = 1 ****
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
305 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
306 C INFO(4) - To handle solutions at a great many specific
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
307 C values TOUT efficiently, this code may integrate past
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
308 C TOUT and interpolate to obtain the result at TOUT.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
309 C Sometimes it is not possible to integrate beyond some
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
310 C point TSTOP because the equation changes there or it is
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
311 C not defined past TSTOP. Then you must tell the code
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
312 C this stop condition.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
313 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
314 C **** Can the integration be carried out without any
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
315 C restrictions on the independent variable T ...
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
316 C yes - set INFO(4) = 0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
317 C no - set INFO(4) = 1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
318 C and define the stopping point TSTOP by
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
319 C setting RWORK(1) = TSTOP ****
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
320 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
321 C INFO(5) - used only when INFO(12) = 0 (direct methods).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
322 C To solve differential/algebraic systems you may wish
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
323 C to use a matrix of partial derivatives of the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
324 C system of differential equations. If you do not
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
325 C provide a subroutine to evaluate it analytically (see
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
326 C description of the item JAC in the call list), it will
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
327 C be approximated by numerical differencing in this code.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
328 C Although it is less trouble for you to have the code
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
329 C compute partial derivatives by numerical differencing,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
330 C the solution will be more reliable if you provide the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
331 C derivatives via JAC. Usually numerical differencing is
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
332 C more costly than evaluating derivatives in JAC, but
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
333 C sometimes it is not - this depends on your problem.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
334 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
335 C **** Do you want the code to evaluate the partial deriv-
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
336 C atives automatically by numerical differences ...
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
337 C yes - set INFO(5) = 0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
338 C no - set INFO(5) = 1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
339 C and provide subroutine JAC for evaluating the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
340 C matrix of partial derivatives ****
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
341 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
342 C INFO(6) - used only when INFO(12) = 0 (direct methods).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
343 C DDASPK will perform much better if the matrix of
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
344 C partial derivatives, dG/dY + CJ*dG/dYPRIME (here CJ is
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
345 C a scalar determined by DDASPK), is banded and the code
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
346 C is told this. In this case, the storage needed will be
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
347 C greatly reduced, numerical differencing will be performed
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
348 C much cheaper, and a number of important algorithms will
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
349 C execute much faster. The differential equation is said
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
350 C to have half-bandwidths ML (lower) and MU (upper) if
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
351 C equation i involves only unknowns Y(j) with
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
352 C i-ML .le. j .le. i+MU .
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
353 C For all i=1,2,...,NEQ. Thus, ML and MU are the widths
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
354 C of the lower and upper parts of the band, respectively,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
355 C with the main diagonal being excluded. If you do not
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
356 C indicate that the equation has a banded matrix of partial
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
357 C derivatives the code works with a full matrix of NEQ**2
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
358 C elements (stored in the conventional way). Computations
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
359 C with banded matrices cost less time and storage than with
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
360 C full matrices if 2*ML+MU .lt. NEQ. If you tell the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
361 C code that the matrix of partial derivatives has a banded
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
362 C structure and you want to provide subroutine JAC to
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
363 C compute the partial derivatives, then you must be careful
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
364 C to store the elements of the matrix in the special form
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
365 C indicated in the description of JAC.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
366 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
367 C **** Do you want to solve the problem using a full (dense)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
368 C matrix (and not a special banded structure) ...
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
369 C yes - set INFO(6) = 0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
370 C no - set INFO(6) = 1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
371 C and provide the lower (ML) and upper (MU)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
372 C bandwidths by setting
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
373 C IWORK(1)=ML
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
374 C IWORK(2)=MU ****
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
375 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
376 C INFO(7) - You can specify a maximum (absolute value of)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
377 C stepsize, so that the code will avoid passing over very
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
378 C large regions.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
379 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
380 C **** Do you want the code to decide on its own the maximum
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
381 C stepsize ...
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
382 C yes - set INFO(7) = 0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
383 C no - set INFO(7) = 1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
384 C and define HMAX by setting
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
385 C RWORK(2) = HMAX ****
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
386 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
387 C INFO(8) - Differential/algebraic problems may occasionally
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
388 C suffer from severe scaling difficulties on the first
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
389 C step. If you know a great deal about the scaling of
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
390 C your problem, you can help to alleviate this problem
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
391 C by specifying an initial stepsize H0.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
392 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
393 C **** Do you want the code to define its own initial
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
394 C stepsize ...
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
395 C yes - set INFO(8) = 0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
396 C no - set INFO(8) = 1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
397 C and define H0 by setting
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
398 C RWORK(3) = H0 ****
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
399 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
400 C INFO(9) - If storage is a severe problem, you can save some
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
401 C storage by restricting the maximum method order MAXORD.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
402 C The default value is 5. For each order decrease below 5,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
403 C the code requires NEQ fewer locations, but it is likely
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
404 C to be slower. In any case, you must have
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
405 C 1 .le. MAXORD .le. 5.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
406 C **** Do you want the maximum order to default to 5 ...
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
407 C yes - set INFO(9) = 0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
408 C no - set INFO(9) = 1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
409 C and define MAXORD by setting
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
410 C IWORK(3) = MAXORD ****
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
411 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
412 C INFO(10) - If you know that certain components of the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
413 C solutions to your equations are always nonnegative
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
414 C (or nonpositive), it may help to set this
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
415 C parameter. There are three options that are
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
416 C available:
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
417 C 1. To have constraint checking only in the initial
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
418 C condition calculation.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
419 C 2. To enforce nonnegativity in Y during the integration.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
420 C 3. To enforce both options 1 and 2.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
421 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
422 C When selecting option 2 or 3, it is probably best to try the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
423 C code without using this option first, and only use
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
424 C this option if that does not work very well.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
425 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
426 C **** Do you want the code to solve the problem without
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
427 C invoking any special inequality constraints ...
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
428 C yes - set INFO(10) = 0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
429 C no - set INFO(10) = 1 to have option 1 enforced
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
430 C no - set INFO(10) = 2 to have option 2 enforced
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
431 C no - set INFO(10) = 3 to have option 3 enforced ****
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
432 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
433 C If you have specified INFO(10) = 1 or 3, then you
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
434 C will also need to identify how each component of Y
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
435 C in the initial condition calculation is constrained.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
436 C You must set:
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
437 C IWORK(40+I) = +1 if Y(I) must be .GE. 0,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
438 C IWORK(40+I) = +2 if Y(I) must be .GT. 0,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
439 C IWORK(40+I) = -1 if Y(I) must be .LE. 0, while
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
440 C IWORK(40+I) = -2 if Y(I) must be .LT. 0, while
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
441 C IWORK(40+I) = 0 if Y(I) is not constrained.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
442 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
443 C INFO(11) - DDASPK normally requires the initial T, Y, and
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
444 C YPRIME to be consistent. That is, you must have
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
445 C G(T,Y,YPRIME) = 0 at the initial T. If you do not know
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
446 C the initial conditions precisely, in some cases
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
447 C DDASPK may be able to compute it.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
448 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
449 C Denoting the differential variables in Y by Y_d
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
450 C and the algebraic variables by Y_a, DDASPK can solve
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
451 C one of two initialization problems:
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
452 C 1. Given Y_d, calculate Y_a and Y'_d, or
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
453 C 2. Given Y', calculate Y.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
454 C In either case, initial values for the given
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
455 C components are input, and initial guesses for
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
456 C the unknown components must also be provided as input.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
457 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
458 C **** Are the initial T, Y, YPRIME consistent ...
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
459 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
460 C yes - set INFO(11) = 0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
461 C no - set INFO(11) = 1 to calculate option 1 above,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
462 C or set INFO(11) = 2 to calculate option 2 ****
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
463 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
464 C If you have specified INFO(11) = 1, then you
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
465 C will also need to identify which are the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
466 C differential and which are the algebraic
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
467 C components (algebraic components are components
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
468 C whose derivatives do not appear explicitly
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
469 C in the function G(T,Y,YPRIME)). You must set:
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
470 C IWORK(LID+I) = +1 if Y(I) is a differential variable
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
471 C IWORK(LID+I) = -1 if Y(I) is an algebraic variable,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
472 C where LID = 40 if INFO(10) = 0 or 2 and LID = 40+NEQ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
473 C if INFO(10) = 1 or 3.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
474 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
475 C INFO(12) - Except for the addition of the RES argument CJ,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
476 C DDASPK by default is downward-compatible with DDASSL,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
477 C which uses only direct (dense or band) methods to solve
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
478 C the linear systems involved. You must set INFO(12) to
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
479 C indicate whether you want the direct methods or the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
480 C Krylov iterative method.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
481 C **** Do you want DDASPK to use standard direct methods
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
482 C (dense or band) or the Krylov (iterative) method ...
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
483 C direct methods - set INFO(12) = 0.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
484 C Krylov method - set INFO(12) = 1,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
485 C and check the settings of INFO(13) and INFO(15).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
486 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
487 C INFO(13) - used when INFO(12) = 1 (Krylov methods).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
488 C DDASPK uses scalars MAXL, KMP, NRMAX, and EPLI for the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
489 C iterative solution of linear systems. INFO(13) allows
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
490 C you to override the default values of these parameters.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
491 C These parameters and their defaults are as follows:
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
492 C MAXL = maximum number of iterations in the SPIGMR
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
493 C algorithm (MAXL .le. NEQ). The default is
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
494 C MAXL = MIN(5,NEQ).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
495 C KMP = number of vectors on which orthogonalization is
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
496 C done in the SPIGMR algorithm. The default is
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
497 C KMP = MAXL, which corresponds to complete GMRES
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
498 C iteration, as opposed to the incomplete form.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
499 C NRMAX = maximum number of restarts of the SPIGMR
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
500 C algorithm per nonlinear iteration. The default is
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
501 C NRMAX = 5.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
502 C EPLI = convergence test constant in SPIGMR algorithm.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
503 C The default is EPLI = 0.05.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
504 C Note that the length of RWORK depends on both MAXL
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
505 C and KMP. See the definition of LRW below.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
506 C **** Are MAXL, KMP, and EPLI to be given their
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
507 C default values ...
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
508 C yes - set INFO(13) = 0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
509 C no - set INFO(13) = 1,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
510 C and set all of the following:
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
511 C IWORK(24) = MAXL (1 .le. MAXL .le. NEQ)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
512 C IWORK(25) = KMP (1 .le. KMP .le. MAXL)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
513 C IWORK(26) = NRMAX (NRMAX .ge. 0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
514 C RWORK(10) = EPLI (0 .lt. EPLI .lt. 1.0) ****
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
515 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
516 C INFO(14) - used with INFO(11) > 0 (initial condition
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
517 C calculation is requested). In this case, you may
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
518 C request control to be returned to the calling program
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
519 C immediately after the initial condition calculation,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
520 C before proceeding to the integration of the system
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
521 C (e.g. to examine the computed Y and YPRIME).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
522 C If this is done, and if the initialization succeeded
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
523 C (IDID = 4), you should reset INFO(11) to 0 for the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
524 C next call, to prevent the solver from repeating the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
525 C initialization (and to avoid an infinite loop).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
526 C **** Do you want to proceed to the integration after
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
527 C the initial condition calculation is done ...
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
528 C yes - set INFO(14) = 0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
529 C no - set INFO(14) = 1 ****
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
530 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
531 C INFO(15) - used when INFO(12) = 1 (Krylov methods).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
532 C When using preconditioning in the Krylov method,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
533 C you must supply a subroutine, PSOL, which solves the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
534 C associated linear systems using P.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
535 C The usage of DDASPK is simpler if PSOL can carry out
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
536 C the solution without any prior calculation of data.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
537 C However, if some partial derivative data is to be
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
538 C calculated in advance and used repeatedly in PSOL,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
539 C then you must supply a JAC routine to do this,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
540 C and set INFO(15) to indicate that JAC is to be called
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
541 C for this purpose. For example, P might be an
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
542 C approximation to a part of the matrix A which can be
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
543 C calculated and LU-factored for repeated solutions of
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
544 C the preconditioner system. The arrays WP and IWP
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
545 C (described under JAC and PSOL) can be used to
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
546 C communicate data between JAC and PSOL.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
547 C **** Does PSOL operate with no prior preparation ...
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
548 C yes - set INFO(15) = 0 (no JAC routine)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
549 C no - set INFO(15) = 1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
550 C and supply a JAC routine to evaluate and
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
551 C preprocess any required Jacobian data. ****
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
552 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
553 C INFO(16) - option to exclude algebraic variables from
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
554 C the error test.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
555 C **** Do you wish to control errors locally on
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
556 C all the variables...
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
557 C yes - set INFO(16) = 0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
558 C no - set INFO(16) = 1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
559 C If you have specified INFO(16) = 1, then you
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
560 C will also need to identify which are the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
561 C differential and which are the algebraic
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
562 C components (algebraic components are components
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
563 C whose derivatives do not appear explicitly
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
564 C in the function G(T,Y,YPRIME)). You must set:
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
565 C IWORK(LID+I) = +1 if Y(I) is a differential
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
566 C variable, and
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
567 C IWORK(LID+I) = -1 if Y(I) is an algebraic
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
568 C variable,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
569 C where LID = 40 if INFO(10) = 0 or 2 and
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
570 C LID = 40 + NEQ if INFO(10) = 1 or 3.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
571 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
572 C INFO(17) - used when INFO(11) > 0 (DDASPK is to do an
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
573 C initial condition calculation).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
574 C DDASPK uses several heuristic control quantities in the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
575 C initial condition calculation. They have default values,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
576 C but can also be set by the user using INFO(17).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
577 C These parameters and their defaults are as follows:
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
578 C MXNIT = maximum number of Newton iterations
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
579 C per Jacobian or preconditioner evaluation.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
580 C The default is:
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
581 C MXNIT = 5 in the direct case (INFO(12) = 0), and
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
582 C MXNIT = 15 in the Krylov case (INFO(12) = 1).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
583 C MXNJ = maximum number of Jacobian or preconditioner
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
584 C evaluations. The default is:
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
585 C MXNJ = 6 in the direct case (INFO(12) = 0), and
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
586 C MXNJ = 2 in the Krylov case (INFO(12) = 1).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
587 C MXNH = maximum number of values of the artificial
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
588 C stepsize parameter H to be tried if INFO(11) = 1.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
589 C The default is MXNH = 5.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
590 C NOTE: the maximum number of Newton iterations
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
591 C allowed in all is MXNIT*MXNJ*MXNH if INFO(11) = 1,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
592 C and MXNIT*MXNJ if INFO(11) = 2.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
593 C LSOFF = flag to turn off the linesearch algorithm
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
594 C (LSOFF = 0 means linesearch is on, LSOFF = 1 means
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
595 C it is turned off). The default is LSOFF = 0.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
596 C STPTOL = minimum scaled step in linesearch algorithm.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
597 C The default is STPTOL = (unit roundoff)**(2/3).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
598 C EPINIT = swing factor in the Newton iteration convergence
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
599 C test. The test is applied to the residual vector,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
600 C premultiplied by the approximate Jacobian (in the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
601 C direct case) or the preconditioner (in the Krylov
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
602 C case). For convergence, the weighted RMS norm of
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
603 C this vector (scaled by the error weights) must be
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
604 C less than EPINIT*EPCON, where EPCON = .33 is the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
605 C analogous test constant used in the time steps.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
606 C The default is EPINIT = .01.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
607 C **** Are the initial condition heuristic controls to be
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
608 C given their default values...
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
609 C yes - set INFO(17) = 0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
610 C no - set INFO(17) = 1,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
611 C and set all of the following:
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
612 C IWORK(32) = MXNIT (.GT. 0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
613 C IWORK(33) = MXNJ (.GT. 0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
614 C IWORK(34) = MXNH (.GT. 0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
615 C IWORK(35) = LSOFF ( = 0 or 1)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
616 C RWORK(14) = STPTOL (.GT. 0.0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
617 C RWORK(15) = EPINIT (.GT. 0.0) ****
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
618 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
619 C INFO(18) - option to get extra printing in initial condition
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
620 C calculation.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
621 C **** Do you wish to have extra printing...
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
622 C no - set INFO(18) = 0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
623 C yes - set INFO(18) = 1 for minimal printing, or
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
624 C set INFO(18) = 2 for full printing.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
625 C If you have specified INFO(18) .ge. 1, data
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
626 C will be printed with the error handler routines.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
627 C To print to a non-default unit number L, include
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
628 C the line CALL XSETUN(L) in your program. ****
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
629 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
630 C RTOL, ATOL -- You must assign relative (RTOL) and absolute (ATOL)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
631 C error tolerances to tell the code how accurately you
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
632 C want the solution to be computed. They must be defined
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
633 C as variables because the code may change them.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
634 C you have two choices --
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
635 C Both RTOL and ATOL are scalars (INFO(2) = 0), or
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
636 C both RTOL and ATOL are vectors (INFO(2) = 1).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
637 C In either case all components must be non-negative.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
638 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
639 C The tolerances are used by the code in a local error
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
640 C test at each step which requires roughly that
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
641 C abs(local error in Y(i)) .le. EWT(i) ,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
642 C where EWT(i) = RTOL*abs(Y(i)) + ATOL is an error weight
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
643 C quantity, for each vector component.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
644 C (More specifically, a root-mean-square norm is used to
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
645 C measure the size of vectors, and the error test uses the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
646 C magnitude of the solution at the beginning of the step.)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
647 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
648 C The true (global) error is the difference between the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
649 C true solution of the initial value problem and the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
650 C computed approximation. Practically all present day
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
651 C codes, including this one, control the local error at
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
652 C each step and do not even attempt to control the global
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
653 C error directly.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
654 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
655 C Usually, but not always, the true accuracy of
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
656 C the computed Y is comparable to the error tolerances.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
657 C This code will usually, but not always, deliver a more
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
658 C accurate solution if you reduce the tolerances and
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
659 C integrate again. By comparing two such solutions you
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
660 C can get a fairly reliable idea of the true error in the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
661 C solution at the larger tolerances.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
662 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
663 C Setting ATOL = 0. results in a pure relative error test
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
664 C on that component. Setting RTOL = 0. results in a pure
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
665 C absolute error test on that component. A mixed test
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
666 C with non-zero RTOL and ATOL corresponds roughly to a
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
667 C relative error test when the solution component is
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
668 C much bigger than ATOL and to an absolute error test
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
669 C when the solution component is smaller than the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
670 C threshold ATOL.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
671 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
672 C The code will not attempt to compute a solution at an
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
673 C accuracy unreasonable for the machine being used. It
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
674 C will advise you if you ask for too much accuracy and
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
675 C inform you as to the maximum accuracy it believes
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
676 C possible.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
677 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
678 C RWORK(*) -- a real work array, which should be dimensioned in your
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
679 C calling program with a length equal to the value of
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
680 C LRW (or greater).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
681 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
682 C LRW -- Set it to the declared length of the RWORK array. The
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
683 C minimum length depends on the options you have selected,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
684 C given by a base value plus additional storage as described
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
685 C below.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
686 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
687 C If INFO(12) = 0 (standard direct method), the base value is
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
688 C base = 50 + max(MAXORD+4,7)*NEQ.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
689 C The default value is MAXORD = 5 (see INFO(9)). With the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
690 C default MAXORD, base = 50 + 9*NEQ.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
691 C Additional storage must be added to the base value for
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
692 C any or all of the following options:
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
693 C if INFO(6) = 0 (dense matrix), add NEQ**2
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
694 C if INFO(6) = 1 (banded matrix), then
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
695 C if INFO(5) = 0, add (2*ML+MU+1)*NEQ + 2*(NEQ/(ML+MU+1)+1),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
696 C if INFO(5) = 1, add (2*ML+MU+1)*NEQ,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
697 C if INFO(16) = 1, add NEQ.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
698 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
699 C If INFO(12) = 1 (Krylov method), the base value is
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
700 C base = 50 + (MAXORD+5)*NEQ + (MAXL+3+MIN0(1,MAXL-KMP))*NEQ +
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
701 C + (MAXL+3)*MAXL + 1 + LENWP.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
702 C See PSOL for description of LENWP. The default values are:
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
703 C MAXORD = 5 (see INFO(9)), MAXL = min(5,NEQ) and KMP = MAXL
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
704 C (see INFO(13)).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
705 C With the default values for MAXORD, MAXL and KMP,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
706 C base = 91 + 18*NEQ + LENWP.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
707 C Additional storage must be added to the base value for
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
708 C any or all of the following options:
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
709 C if INFO(16) = 1, add NEQ.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
710 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
711 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
712 C IWORK(*) -- an integer work array, which should be dimensioned in
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
713 C your calling program with a length equal to the value
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
714 C of LIW (or greater).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
715 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
716 C LIW -- Set it to the declared length of the IWORK array. The
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
717 C minimum length depends on the options you have selected,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
718 C given by a base value plus additional storage as described
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
719 C below.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
720 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
721 C If INFO(12) = 0 (standard direct method), the base value is
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
722 C base = 40 + NEQ.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
723 C IF INFO(10) = 1 or 3, add NEQ to the base value.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
724 C If INFO(11) = 1 or INFO(16) =1, add NEQ to the base value.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
725 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
726 C If INFO(12) = 1 (Krylov method), the base value is
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
727 C base = 40 + LENIWP.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
728 C See PSOL for description of LENIWP.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
729 C IF INFO(10) = 1 or 3, add NEQ to the base value.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
730 C If INFO(11) = 1 or INFO(16) = 1, add NEQ to the base value.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
731 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
732 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
733 C RPAR, IPAR -- These are arrays of double precision and integer type,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
734 C respectively, which are available for you to use
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
735 C for communication between your program that calls
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
736 C DDASPK and the RES subroutine (and the JAC and PSOL
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
737 C subroutines). They are not altered by DDASPK.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
738 C If you do not need RPAR or IPAR, ignore these
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
739 C parameters by treating them as dummy arguments.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
740 C If you do choose to use them, dimension them in
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
741 C your calling program and in RES (and in JAC and PSOL)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
742 C as arrays of appropriate length.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
743 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
744 C JAC -- This is the name of a routine that you may supply
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
745 C (optionally) that relates to the Jacobian matrix of the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
746 C nonlinear system that the code must solve at each T step.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
747 C The role of JAC (and its call sequence) depends on whether
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
748 C a direct (INFO(12) = 0) or Krylov (INFO(12) = 1) method
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
749 C is selected.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
750 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
751 C **** INFO(12) = 0 (direct methods):
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
752 C If you are letting the code generate partial derivatives
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
753 C numerically (INFO(5) = 0), then JAC can be absent
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
754 C (or perhaps a dummy routine to satisfy the loader).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
755 C Otherwise you must supply a JAC routine to compute
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
756 C the matrix A = dG/dY + CJ*dG/dYPRIME. It must have
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
757 C the form
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
758 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
759 C SUBROUTINE JAC (T, Y, YPRIME, PD, CJ, RPAR, IPAR)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
760 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
761 C The JAC routine must dimension Y, YPRIME, and PD (and RPAR
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
762 C and IPAR if used). CJ is a scalar which is input to JAC.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
763 C For the given values of T, Y, and YPRIME, the JAC routine
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
764 C must evaluate the nonzero elements of the matrix A, and
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
765 C store these values in the array PD. The elements of PD are
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
766 C set to zero before each call to JAC, so that only nonzero
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
767 C elements need to be defined.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
768 C The way you store the elements into the PD array depends
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
769 C on the structure of the matrix indicated by INFO(6).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
770 C *** INFO(6) = 0 (full or dense matrix) ***
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
771 C Give PD a first dimension of NEQ. When you evaluate the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
772 C nonzero partial derivatives of equation i (i.e. of G(i))
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
773 C with respect to component j (of Y and YPRIME), you must
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
774 C store the element in PD according to
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
775 C PD(i,j) = dG(i)/dY(j) + CJ*dG(i)/dYPRIME(j).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
776 C *** INFO(6) = 1 (banded matrix with half-bandwidths ML, MU
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
777 C as described under INFO(6)) ***
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
778 C Give PD a first dimension of 2*ML+MU+1. When you
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
779 C evaluate the nonzero partial derivatives of equation i
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
780 C (i.e. of G(i)) with respect to component j (of Y and
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
781 C YPRIME), you must store the element in PD according to
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
782 C IROW = i - j + ML + MU + 1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
783 C PD(IROW,j) = dG(i)/dY(j) + CJ*dG(i)/dYPRIME(j).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
784 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
785 C **** INFO(12) = 1 (Krylov method):
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
786 C If you are not calculating Jacobian data in advance for use
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
787 C in PSOL (INFO(15) = 0), JAC can be absent (or perhaps a
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
788 C dummy routine to satisfy the loader). Otherwise, you may
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
789 C supply a JAC routine to compute and preprocess any parts of
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
790 C of the Jacobian matrix A = dG/dY + CJ*dG/dYPRIME that are
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
791 C involved in the preconditioner matrix P.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
792 C It is to have the form
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
793 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
794 C SUBROUTINE JAC (RES, IRES, NEQ, T, Y, YPRIME, REWT, SAVR,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
795 C WK, H, CJ, WP, IWP, IER, RPAR, IPAR)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
796 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
797 C The JAC routine must dimension Y, YPRIME, REWT, SAVR, WK,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
798 C and (if used) WP, IWP, RPAR, and IPAR.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
799 C The Y, YPRIME, and SAVR arrays contain the current values
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
800 C of Y, YPRIME, and the residual G, respectively.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
801 C The array WK is work space of length NEQ.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
802 C H is the step size. CJ is a scalar, input to JAC, that is
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
803 C normally proportional to 1/H. REWT is an array of
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
804 C reciprocal error weights, 1/EWT(i), where EWT(i) is
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
805 C RTOL*abs(Y(i)) + ATOL (unless you supplied routine DDAWTS
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
806 C instead), for use in JAC if needed. For example, if JAC
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
807 C computes difference quotient approximations to partial
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
808 C derivatives, the REWT array may be useful in setting the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
809 C increments used. The JAC routine should do any
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
810 C factorization operations called for, in preparation for
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
811 C solving linear systems in PSOL. The matrix P should
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
812 C be an approximation to the Jacobian,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
813 C A = dG/dY + CJ*dG/dYPRIME.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
814 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
815 C WP and IWP are real and integer work arrays which you may
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
816 C use for communication between your JAC routine and your
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
817 C PSOL routine. These may be used to store elements of the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
818 C preconditioner P, or related matrix data (such as factored
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
819 C forms). They are not altered by DDASPK.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
820 C If you do not need WP or IWP, ignore these parameters by
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
821 C treating them as dummy arguments. If you do use them,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
822 C dimension them appropriately in your JAC and PSOL routines.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
823 C See the PSOL description for instructions on setting
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
824 C the lengths of WP and IWP.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
825 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
826 C On return, JAC should set the error flag IER as follows..
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
827 C IER = 0 if JAC was successful,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
828 C IER .ne. 0 if JAC was unsuccessful (e.g. if Y or YPRIME
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
829 C was illegal, or a singular matrix is found).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
830 C (If IER .ne. 0, a smaller stepsize will be tried.)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
831 C IER = 0 on entry to JAC, so need be reset only on a failure.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
832 C If RES is used within JAC, then a nonzero value of IRES will
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
833 C override any nonzero value of IER (see the RES description).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
834 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
835 C Regardless of the method type, subroutine JAC must not
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
836 C alter T, Y(*), YPRIME(*), H, CJ, or REWT(*).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
837 C You must declare the name JAC in an EXTERNAL statement in
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
838 C your program that calls DDASPK.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
839 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
840 C PSOL -- This is the name of a routine you must supply if you have
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
841 C selected a Krylov method (INFO(12) = 1) with preconditioning.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
842 C In the direct case (INFO(12) = 0), PSOL can be absent
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
843 C (a dummy routine may have to be supplied to satisfy the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
844 C loader). Otherwise, you must provide a PSOL routine to
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
845 C solve linear systems arising from preconditioning.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
846 C When supplied with INFO(12) = 1, the PSOL routine is to
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
847 C have the form
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
848 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
849 C SUBROUTINE PSOL (NEQ, T, Y, YPRIME, SAVR, WK, CJ, WGHT,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
850 C WP, IWP, B, EPLIN, IER, RPAR, IPAR)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
851 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
852 C The PSOL routine must solve linear systems of the form
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
853 C P*x = b where P is the left preconditioner matrix.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
854 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
855 C The right-hand side vector b is in the B array on input, and
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
856 C PSOL must return the solution vector x in B.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
857 C The Y, YPRIME, and SAVR arrays contain the current values
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
858 C of Y, YPRIME, and the residual G, respectively.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
859 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
860 C Work space required by JAC and/or PSOL, and space for data to
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
861 C be communicated from JAC to PSOL is made available in the form
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
862 C of arrays WP and IWP, which are parts of the RWORK and IWORK
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
863 C arrays, respectively. The lengths of these real and integer
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
864 C work spaces WP and IWP must be supplied in LENWP and LENIWP,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
865 C respectively, as follows..
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
866 C IWORK(27) = LENWP = length of real work space WP
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
867 C IWORK(28) = LENIWP = length of integer work space IWP.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
868 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
869 C WK is a work array of length NEQ for use by PSOL.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
870 C CJ is a scalar, input to PSOL, that is normally proportional
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
871 C to 1/H (H = stepsize). If the old value of CJ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
872 C (at the time of the last JAC call) is needed, it must have
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
873 C been saved by JAC in WP.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
874 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
875 C WGHT is an array of weights, to be used if PSOL uses an
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
876 C iterative method and performs a convergence test. (In terms
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
877 C of the argument REWT to JAC, WGHT is REWT/sqrt(NEQ).)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
878 C If PSOL uses an iterative method, it should use EPLIN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
879 C (a heuristic parameter) as the bound on the weighted norm of
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
880 C the residual for the computed solution. Specifically, the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
881 C residual vector R should satisfy
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
882 C SQRT (SUM ( (R(i)*WGHT(i))**2 ) ) .le. EPLIN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
883 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
884 C PSOL must not alter NEQ, T, Y, YPRIME, SAVR, CJ, WGHT, EPLIN.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
885 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
886 C On return, PSOL should set the error flag IER as follows..
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
887 C IER = 0 if PSOL was successful,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
888 C IER .lt. 0 if an unrecoverable error occurred, meaning
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
889 C control will be passed to the calling routine,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
890 C IER .gt. 0 if a recoverable error occurred, meaning that
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
891 C the step will be retried with the same step size
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
892 C but with a call to JAC to update necessary data,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
893 C unless the Jacobian data is current, in which case
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
894 C the step will be retried with a smaller step size.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
895 C IER = 0 on entry to PSOL so need be reset only on a failure.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
896 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
897 C You must declare the name PSOL in an EXTERNAL statement in
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
898 C your program that calls DDASPK.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
899 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
900 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
901 C OPTIONALLY REPLACEABLE SUBROUTINE:
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
902 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
903 C DDASPK uses a weighted root-mean-square norm to measure the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
904 C size of various error vectors. The weights used in this norm
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
905 C are set in the following subroutine:
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
906 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
907 C SUBROUTINE DDAWTS (NEQ, IWT, RTOL, ATOL, Y, EWT, RPAR, IPAR)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
908 C DIMENSION RTOL(*), ATOL(*), Y(*), EWT(*), RPAR(*), IPAR(*)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
909 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
910 C A DDAWTS routine has been included with DDASPK which sets the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
911 C weights according to
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
912 C EWT(I) = RTOL*ABS(Y(I)) + ATOL
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
913 C in the case of scalar tolerances (IWT = 0) or
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
914 C EWT(I) = RTOL(I)*ABS(Y(I)) + ATOL(I)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
915 C in the case of array tolerances (IWT = 1). (IWT is INFO(2).)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
916 C In some special cases, it may be appropriate for you to define
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
917 C your own error weights by writing a subroutine DDAWTS to be
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
918 C called instead of the version supplied. However, this should
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
919 C be attempted only after careful thought and consideration.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
920 C If you supply this routine, you may use the tolerances and Y
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
921 C as appropriate, but do not overwrite these variables. You
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
922 C may also use RPAR and IPAR to communicate data as appropriate.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
923 C ***Note: Aside from the values of the weights, the choice of
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
924 C norm used in DDASPK (weighted root-mean-square) is not subject
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
925 C to replacement by the user. In this respect, DDASPK is not
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
926 C downward-compatible with the original DDASSL solver (in which
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
927 C the norm routine was optionally user-replaceable).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
928 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
929 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
930 C------OUTPUT - AFTER ANY RETURN FROM DDASPK----------------------------
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
931 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
932 C The principal aim of the code is to return a computed solution at
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
933 C T = TOUT, although it is also possible to obtain intermediate
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
934 C results along the way. To find out whether the code achieved its
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
935 C goal or if the integration process was interrupted before the task
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
936 C was completed, you must check the IDID parameter.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
937 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
938 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
939 C T -- The output value of T is the point to which the solution
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
940 C was successfully advanced.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
941 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
942 C Y(*) -- contains the computed solution approximation at T.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
943 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
944 C YPRIME(*) -- contains the computed derivative approximation at T.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
945 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
946 C IDID -- reports what the code did, described as follows:
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
947 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
948 C *** TASK COMPLETED ***
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
949 C Reported by positive values of IDID
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
950 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
951 C IDID = 1 -- a step was successfully taken in the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
952 C intermediate-output mode. The code has not
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
953 C yet reached TOUT.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
954 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
955 C IDID = 2 -- the integration to TSTOP was successfully
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
956 C completed (T = TSTOP) by stepping exactly to TSTOP.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
957 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
958 C IDID = 3 -- the integration to TOUT was successfully
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
959 C completed (T = TOUT) by stepping past TOUT.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
960 C Y(*) and YPRIME(*) are obtained by interpolation.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
961 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
962 C IDID = 4 -- the initial condition calculation, with
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
963 C INFO(11) > 0, was successful, and INFO(14) = 1.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
964 C No integration steps were taken, and the solution
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
965 C is not considered to have been started.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
966 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
967 C *** TASK INTERRUPTED ***
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
968 C Reported by negative values of IDID
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
969 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
970 C IDID = -1 -- a large amount of work has been expended
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
971 C (about 500 steps).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
972 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
973 C IDID = -2 -- the error tolerances are too stringent.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
974 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
975 C IDID = -3 -- the local error test cannot be satisfied
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
976 C because you specified a zero component in ATOL
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
977 C and the corresponding computed solution component
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
978 C is zero. Thus, a pure relative error test is
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
979 C impossible for this component.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
980 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
981 C IDID = -5 -- there were repeated failures in the evaluation
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
982 C or processing of the preconditioner (in JAC).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
983 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
984 C IDID = -6 -- DDASPK had repeated error test failures on the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
985 C last attempted step.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
986 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
987 C IDID = -7 -- the nonlinear system solver in the time integration
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
988 C could not converge.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
989 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
990 C IDID = -8 -- the matrix of partial derivatives appears
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
991 C to be singular (direct method).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
992 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
993 C IDID = -9 -- the nonlinear system solver in the time integration
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
994 C failed to achieve convergence, and there were repeated
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
995 C error test failures in this step.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
996 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
997 C IDID =-10 -- the nonlinear system solver in the time integration
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
998 C failed to achieve convergence because IRES was equal
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
999 C to -1.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1000 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1001 C IDID =-11 -- IRES = -2 was encountered and control is
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1002 C being returned to the calling program.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1003 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1004 C IDID =-12 -- DDASPK failed to compute the initial Y, YPRIME.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1005 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1006 C IDID =-13 -- unrecoverable error encountered inside user's
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1007 C PSOL routine, and control is being returned to
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1008 C the calling program.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1009 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1010 C IDID =-14 -- the Krylov linear system solver could not
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1011 C achieve convergence.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1012 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1013 C IDID =-15,..,-32 -- Not applicable for this code.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1014 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1015 C *** TASK TERMINATED ***
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1016 C reported by the value of IDID=-33
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1017 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1018 C IDID = -33 -- the code has encountered trouble from which
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1019 C it cannot recover. A message is printed
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1020 C explaining the trouble and control is returned
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1021 C to the calling program. For example, this occurs
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1022 C when invalid input is detected.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1023 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1024 C RTOL, ATOL -- these quantities remain unchanged except when
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1025 C IDID = -2. In this case, the error tolerances have been
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1026 C increased by the code to values which are estimated to
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1027 C be appropriate for continuing the integration. However,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1028 C the reported solution at T was obtained using the input
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1029 C values of RTOL and ATOL.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1030 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1031 C RWORK, IWORK -- contain information which is usually of no interest
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1032 C to the user but necessary for subsequent calls.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1033 C However, you may be interested in the performance data
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1034 C listed below. These quantities are accessed in RWORK
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1035 C and IWORK but have internal mnemonic names, as follows..
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1036 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1037 C RWORK(3)--contains H, the step size h to be attempted
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1038 C on the next step.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1039 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1040 C RWORK(4)--contains TN, the current value of the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1041 C independent variable, i.e. the farthest point
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1042 C integration has reached. This will differ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1043 C from T if interpolation has been performed
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1044 C (IDID = 3).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1045 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1046 C RWORK(7)--contains HOLD, the stepsize used on the last
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1047 C successful step. If INFO(11) = INFO(14) = 1,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1048 C this contains the value of H used in the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1049 C initial condition calculation.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1050 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1051 C IWORK(7)--contains K, the order of the method to be
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1052 C attempted on the next step.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1053 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1054 C IWORK(8)--contains KOLD, the order of the method used
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1055 C on the last step.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1056 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1057 C IWORK(11)--contains NST, the number of steps (in T)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1058 C taken so far.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1059 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1060 C IWORK(12)--contains NRE, the number of calls to RES
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1061 C so far.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1062 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1063 C IWORK(13)--contains NJE, the number of calls to JAC so
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1064 C far (Jacobian or preconditioner evaluations).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1065 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1066 C IWORK(14)--contains NETF, the total number of error test
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1067 C failures so far.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1068 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1069 C IWORK(15)--contains NCFN, the total number of nonlinear
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1070 C convergence failures so far (includes counts
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1071 C of singular iteration matrix or singular
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1072 C preconditioners).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1073 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1074 C IWORK(16)--contains NCFL, the number of convergence
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1075 C failures of the linear iteration so far.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1076 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1077 C IWORK(17)--contains LENIW, the length of IWORK actually
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1078 C required. This is defined on normal returns
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1079 C and on an illegal input return for
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1080 C insufficient storage.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1081 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1082 C IWORK(18)--contains LENRW, the length of RWORK actually
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1083 C required. This is defined on normal returns
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1084 C and on an illegal input return for
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1085 C insufficient storage.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1086 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1087 C IWORK(19)--contains NNI, the total number of nonlinear
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1088 C iterations so far (each of which calls a
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1089 C linear solver).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1090 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1091 C IWORK(20)--contains NLI, the total number of linear
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1092 C (Krylov) iterations so far.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1093 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1094 C IWORK(21)--contains NPS, the number of PSOL calls so
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1095 C far, for preconditioning solve operations or
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1096 C for solutions with the user-supplied method.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1097 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1098 C Note: The various counters in IWORK do not include
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1099 C counts during a call made with INFO(11) > 0 and
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1100 C INFO(14) = 1.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1101 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1102 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1103 C------INPUT - WHAT TO DO TO CONTINUE THE INTEGRATION -----------------
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1104 C (CALLS AFTER THE FIRST)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1105 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1106 C This code is organized so that subsequent calls to continue the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1107 C integration involve little (if any) additional effort on your
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1108 C part. You must monitor the IDID parameter in order to determine
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1109 C what to do next.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1110 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1111 C Recalling that the principal task of the code is to integrate
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1112 C from T to TOUT (the interval mode), usually all you will need
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1113 C to do is specify a new TOUT upon reaching the current TOUT.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1114 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1115 C Do not alter any quantity not specifically permitted below. In
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1116 C particular do not alter NEQ, T, Y(*), YPRIME(*), RWORK(*),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1117 C IWORK(*), or the differential equation in subroutine RES. Any
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1118 C such alteration constitutes a new problem and must be treated
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1119 C as such, i.e. you must start afresh.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1120 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1121 C You cannot change from array to scalar error control or vice
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1122 C versa (INFO(2)), but you can change the size of the entries of
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1123 C RTOL or ATOL. Increasing a tolerance makes the equation easier
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1124 C to integrate. Decreasing a tolerance will make the equation
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1125 C harder to integrate and should generally be avoided.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1126 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1127 C You can switch from the intermediate-output mode to the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1128 C interval mode (INFO(3)) or vice versa at any time.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1129 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1130 C If it has been necessary to prevent the integration from going
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1131 C past a point TSTOP (INFO(4), RWORK(1)), keep in mind that the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1132 C code will not integrate to any TOUT beyond the currently
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1133 C specified TSTOP. Once TSTOP has been reached, you must change
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1134 C the value of TSTOP or set INFO(4) = 0. You may change INFO(4)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1135 C or TSTOP at any time but you must supply the value of TSTOP in
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1136 C RWORK(1) whenever you set INFO(4) = 1.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1137 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1138 C Do not change INFO(5), INFO(6), INFO(12-17) or their associated
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1139 C IWORK/RWORK locations unless you are going to restart the code.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1140 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1141 C *** FOLLOWING A COMPLETED TASK ***
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1142 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1143 C If..
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1144 C IDID = 1, call the code again to continue the integration
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1145 C another step in the direction of TOUT.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1146 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1147 C IDID = 2 or 3, define a new TOUT and call the code again.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1148 C TOUT must be different from T. You cannot change
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1149 C the direction of integration without restarting.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1150 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1151 C IDID = 4, reset INFO(11) = 0 and call the code again to begin
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1152 C the integration. (If you leave INFO(11) > 0 and
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1153 C INFO(14) = 1, you may generate an infinite loop.)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1154 C In this situation, the next call to DASPK is
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1155 C considered to be the first call for the problem,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1156 C in that all initializations are done.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1157 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1158 C *** FOLLOWING AN INTERRUPTED TASK ***
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1159 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1160 C To show the code that you realize the task was interrupted and
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1161 C that you want to continue, you must take appropriate action and
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1162 C set INFO(1) = 1.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1163 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1164 C If..
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1165 C IDID = -1, the code has taken about 500 steps. If you want to
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1166 C continue, set INFO(1) = 1 and call the code again.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1167 C An additional 500 steps will be allowed.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1168 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1169 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1170 C IDID = -2, the error tolerances RTOL, ATOL have been increased
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1171 C to values the code estimates appropriate for
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1172 C continuing. You may want to change them yourself.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1173 C If you are sure you want to continue with relaxed
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1174 C error tolerances, set INFO(1) = 1 and call the code
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1175 C again.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1176 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1177 C IDID = -3, a solution component is zero and you set the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1178 C corresponding component of ATOL to zero. If you
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1179 C are sure you want to continue, you must first alter
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1180 C the error criterion to use positive values of ATOL
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1181 C for those components corresponding to zero solution
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1182 C components, then set INFO(1) = 1 and call the code
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1183 C again.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1184 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1185 C IDID = -4 --- cannot occur with this code.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1186 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1187 C IDID = -5, your JAC routine failed with the Krylov method. Check
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1188 C for errors in JAC and restart the integration.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1189 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1190 C IDID = -6, repeated error test failures occurred on the last
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1191 C attempted step in DDASPK. A singularity in the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1192 C solution may be present. If you are absolutely
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1193 C certain you want to continue, you should restart
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1194 C the integration. (Provide initial values of Y and
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1195 C YPRIME which are consistent.)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1196 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1197 C IDID = -7, repeated convergence test failures occurred on the last
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1198 C attempted step in DDASPK. An inaccurate or ill-
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1199 C conditioned Jacobian or preconditioner may be the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1200 C problem. If you are absolutely certain you want
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1201 C to continue, you should restart the integration.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1202 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1203 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1204 C IDID = -8, the matrix of partial derivatives is singular, with
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1205 C the use of direct methods. Some of your equations
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1206 C may be redundant. DDASPK cannot solve the problem
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1207 C as stated. It is possible that the redundant
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1208 C equations could be removed, and then DDASPK could
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1209 C solve the problem. It is also possible that a
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1210 C solution to your problem either does not exist
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1211 C or is not unique.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1212 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1213 C IDID = -9, DDASPK had multiple convergence test failures, preceded
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1214 C by multiple error test failures, on the last
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1215 C attempted step. It is possible that your problem is
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1216 C ill-posed and cannot be solved using this code. Or,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1217 C there may be a discontinuity or a singularity in the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1218 C solution. If you are absolutely certain you want to
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1219 C continue, you should restart the integration.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1220 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1221 C IDID = -10, DDASPK had multiple convergence test failures
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1222 C because IRES was equal to -1. If you are
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1223 C absolutely certain you want to continue, you
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1224 C should restart the integration.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1225 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1226 C IDID = -11, there was an unrecoverable error (IRES = -2) from RES
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1227 C inside the nonlinear system solver. Determine the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1228 C cause before trying again.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1229 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1230 C IDID = -12, DDASPK failed to compute the initial Y and YPRIME
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1231 C vectors. This could happen because the initial
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1232 C approximation to Y or YPRIME was not very good, or
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1233 C because no consistent values of these vectors exist.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1234 C The problem could also be caused by an inaccurate or
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1235 C singular iteration matrix, or a poor preconditioner.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1236 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1237 C IDID = -13, there was an unrecoverable error encountered inside
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1238 C your PSOL routine. Determine the cause before
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1239 C trying again.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1240 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1241 C IDID = -14, the Krylov linear system solver failed to achieve
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1242 C convergence. This may be due to ill-conditioning
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1243 C in the iteration matrix, or a singularity in the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1244 C preconditioner (if one is being used).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1245 C Another possibility is that there is a better
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1246 C choice of Krylov parameters (see INFO(13)).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1247 C Possibly the failure is caused by redundant equations
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1248 C in the system, or by inconsistent equations.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1249 C In that case, reformulate the system to make it
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1250 C consistent and non-redundant.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1251 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1252 C IDID = -15,..,-32 --- Cannot occur with this code.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1253 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1254 C *** FOLLOWING A TERMINATED TASK ***
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1255 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1256 C If IDID = -33, you cannot continue the solution of this problem.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1257 C An attempt to do so will result in your run being
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1258 C terminated.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1259 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1260 C ---------------------------------------------------------------------
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1261 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1262 C***REFERENCES
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1263 C 1. L. R. Petzold, A Description of DASSL: A Differential/Algebraic
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1264 C System Solver, in Scientific Computing, R. S. Stepleman et al.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1265 C (Eds.), North-Holland, Amsterdam, 1983, pp. 65-68.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1266 C 2. K. E. Brenan, S. L. Campbell, and L. R. Petzold, Numerical
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1267 C Solution of Initial-Value Problems in Differential-Algebraic
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1268 C Equations, Elsevier, New York, 1989.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1269 C 3. P. N. Brown and A. C. Hindmarsh, Reduced Storage Matrix Methods
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1270 C in Stiff ODE Systems, J. Applied Mathematics and Computation,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1271 C 31 (1989), pp. 40-91.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1272 C 4. P. N. Brown, A. C. Hindmarsh, and L. R. Petzold, Using Krylov
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1273 C Methods in the Solution of Large-Scale Differential-Algebraic
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1274 C Systems, SIAM J. Sci. Comp., 15 (1994), pp. 1467-1488.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1275 C 5. P. N. Brown, A. C. Hindmarsh, and L. R. Petzold, Consistent
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1276 C Initial Condition Calculation for Differential-Algebraic
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1277 C Systems, LLNL Report UCRL-JC-122175, August 1995; submitted to
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1278 C SIAM J. Sci. Comp.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1279 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1280 C***ROUTINES CALLED
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1281 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1282 C The following are all the subordinate routines used by DDASPK.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1283 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1284 C DDASIC computes consistent initial conditions.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1285 C DYYPNW updates Y and YPRIME in linesearch for initial condition
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1286 C calculation.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1287 C DDSTP carries out one step of the integration.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1288 C DCNSTR/DCNST0 check the current solution for constraint violations.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1289 C DDAWTS sets error weight quantities.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1290 C DINVWT tests and inverts the error weights.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1291 C DDATRP performs interpolation to get an output solution.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1292 C DDWNRM computes the weighted root-mean-square norm of a vector.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1293 C D1MACH provides the unit roundoff of the computer.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1294 C XERRWD/XSETF/XSETUN/IXSAV is a package to handle error messages.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1295 C DDASID nonlinear equation driver to initialize Y and YPRIME using
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1296 C direct linear system solver methods. Interfaces to Newton
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1297 C solver (direct case).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1298 C DNSID solves the nonlinear system for unknown initial values by
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1299 C modified Newton iteration and direct linear system methods.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1300 C DLINSD carries out linesearch algorithm for initial condition
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1301 C calculation (direct case).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1302 C DFNRMD calculates weighted norm of preconditioned residual in
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1303 C initial condition calculation (direct case).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1304 C DNEDD nonlinear equation driver for direct linear system solver
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1305 C methods. Interfaces to Newton solver (direct case).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1306 C DMATD assembles the iteration matrix (direct case).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1307 C DNSD solves the associated nonlinear system by modified
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1308 C Newton iteration and direct linear system methods.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1309 C DSLVD interfaces to linear system solver (direct case).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1310 C DDASIK nonlinear equation driver to initialize Y and YPRIME using
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1311 C Krylov iterative linear system methods. Interfaces to
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1312 C Newton solver (Krylov case).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1313 C DNSIK solves the nonlinear system for unknown initial values by
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1314 C Newton iteration and Krylov iterative linear system methods.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1315 C DLINSK carries out linesearch algorithm for initial condition
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1316 C calculation (Krylov case).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1317 C DFNRMK calculates weighted norm of preconditioned residual in
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1318 C initial condition calculation (Krylov case).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1319 C DNEDK nonlinear equation driver for iterative linear system solver
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1320 C methods. Interfaces to Newton solver (Krylov case).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1321 C DNSK solves the associated nonlinear system by Inexact Newton
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1322 C iteration and (linear) Krylov iteration.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1323 C DSLVK interfaces to linear system solver (Krylov case).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1324 C DSPIGM solves a linear system by SPIGMR algorithm.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1325 C DATV computes matrix-vector product in Krylov algorithm.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1326 C DORTH performs orthogonalization of Krylov basis vectors.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1327 C DHEQR performs QR factorization of Hessenberg matrix.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1328 C DHELS finds least-squares solution of Hessenberg linear system.
4329
d53c33d93440 [project @ 2003-02-18 20:00:48 by jwe]
jwe
parents: 3911
diff changeset
1329 C DGETRF, DGETRS, DGBTRF, DGBTRS are LAPACK routines for solving
3911
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1330 C linear systems (dense or band direct methods).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1331 C DAXPY, DCOPY, DDOT, DNRM2, DSCAL are Basic Linear Algebra (BLAS)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1332 C routines.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1333 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1334 C The routines called directly by DDASPK are:
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1335 C DCNST0, DDAWTS, DINVWT, D1MACH, DDWNRM, DDASIC, DDATRP, DDSTP,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1336 C XERRWD
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1337 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1338 C***END PROLOGUE DDASPK
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1339 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1340 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1341 IMPLICIT DOUBLE PRECISION(A-H,O-Z)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1342 LOGICAL DONE, LAVL, LCFN, LCFL, LWARN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1343 DIMENSION Y(*),YPRIME(*)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1344 DIMENSION INFO(20)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1345 DIMENSION RWORK(LRW),IWORK(LIW)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1346 DIMENSION RTOL(*),ATOL(*)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1347 DIMENSION RPAR(*),IPAR(*)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1348 CHARACTER MSG*80
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1349 EXTERNAL RES, JAC, PSOL, DDASID, DDASIK, DNEDD, DNEDK
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1350 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1351 C Set pointers into IWORK.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1352 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1353 PARAMETER (LML=1, LMU=2, LMTYPE=4,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1354 * LIWM=1, LMXORD=3, LJCALC=5, LPHASE=6, LK=7, LKOLD=8,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1355 * LNS=9, LNSTL=10, LNST=11, LNRE=12, LNJE=13, LETF=14, LNCFN=15,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1356 * LNCFL=16, LNIW=17, LNRW=18, LNNI=19, LNLI=20, LNPS=21,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1357 * LNPD=22, LMITER=23, LMAXL=24, LKMP=25, LNRMAX=26, LLNWP=27,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1358 * LLNIWP=28, LLOCWP=29, LLCIWP=30, LKPRIN=31,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1359 * LMXNIT=32, LMXNJ=33, LMXNH=34, LLSOFF=35, LICNS=41)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1360 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1361 C Set pointers into RWORK.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1362 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1363 PARAMETER (LTSTOP=1, LHMAX=2, LH=3, LTN=4, LCJ=5, LCJOLD=6,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1364 * LHOLD=7, LS=8, LROUND=9, LEPLI=10, LSQRN=11, LRSQRN=12,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1365 * LEPCON=13, LSTOL=14, LEPIN=15,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1366 * LALPHA=21, LBETA=27, LGAMMA=33, LPSI=39, LSIGMA=45, LDELTA=51)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1367 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1368 SAVE LID, LENID, NONNEG
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1369 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1370 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1371 C***FIRST EXECUTABLE STATEMENT DDASPK
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1372 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1373 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1374 IF(INFO(1).NE.0) GO TO 100
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1375 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1376 C-----------------------------------------------------------------------
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1377 C This block is executed for the initial call only.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1378 C It contains checking of inputs and initializations.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1379 C-----------------------------------------------------------------------
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1380 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1381 C First check INFO array to make sure all elements of INFO
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1382 C Are within the proper range. (INFO(1) is checked later, because
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1383 C it must be tested on every call.) ITEMP holds the location
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1384 C within INFO which may be out of range.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1385 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1386 DO 10 I=2,9
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1387 ITEMP = I
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1388 IF (INFO(I) .NE. 0 .AND. INFO(I) .NE. 1) GO TO 701
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1389 10 CONTINUE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1390 ITEMP = 10
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1391 IF(INFO(10).LT.0 .OR. INFO(10).GT.3) GO TO 701
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1392 ITEMP = 11
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1393 IF(INFO(11).LT.0 .OR. INFO(11).GT.2) GO TO 701
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1394 DO 15 I=12,17
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1395 ITEMP = I
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1396 IF (INFO(I) .NE. 0 .AND. INFO(I) .NE. 1) GO TO 701
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1397 15 CONTINUE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1398 ITEMP = 18
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1399 IF(INFO(18).LT.0 .OR. INFO(18).GT.2) GO TO 701
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1400
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1401 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1402 C Check NEQ to see if it is positive.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1403 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1404 IF (NEQ .LE. 0) GO TO 702
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1405 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1406 C Check and compute maximum order.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1407 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1408 MXORD=5
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1409 IF (INFO(9) .NE. 0) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1410 MXORD=IWORK(LMXORD)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1411 IF (MXORD .LT. 1 .OR. MXORD .GT. 5) GO TO 703
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1412 ENDIF
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1413 IWORK(LMXORD)=MXORD
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1414 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1415 C Set and/or check inputs for constraint checking (INFO(10) .NE. 0).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1416 C Set values for ICNFLG, NONNEG, and pointer LID.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1417 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1418 ICNFLG = 0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1419 NONNEG = 0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1420 LID = LICNS
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1421 IF (INFO(10) .EQ. 0) GO TO 20
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1422 IF (INFO(10) .EQ. 1) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1423 ICNFLG = 1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1424 NONNEG = 0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1425 LID = LICNS + NEQ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1426 ELSEIF (INFO(10) .EQ. 2) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1427 ICNFLG = 0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1428 NONNEG = 1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1429 ELSE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1430 ICNFLG = 1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1431 NONNEG = 1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1432 LID = LICNS + NEQ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1433 ENDIF
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1434 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1435 20 CONTINUE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1436 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1437 C Set and/or check inputs for Krylov solver (INFO(12) .NE. 0).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1438 C If indicated, set default values for MAXL, KMP, NRMAX, and EPLI.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1439 C Otherwise, verify inputs required for iterative solver.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1440 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1441 IF (INFO(12) .EQ. 0) GO TO 25
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1442 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1443 IWORK(LMITER) = INFO(12)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1444 IF (INFO(13) .EQ. 0) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1445 IWORK(LMAXL) = MIN(5,NEQ)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1446 IWORK(LKMP) = IWORK(LMAXL)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1447 IWORK(LNRMAX) = 5
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1448 RWORK(LEPLI) = 0.05D0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1449 ELSE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1450 IF(IWORK(LMAXL) .LT. 1 .OR. IWORK(LMAXL) .GT. NEQ) GO TO 720
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1451 IF(IWORK(LKMP) .LT. 1 .OR. IWORK(LKMP) .GT. IWORK(LMAXL))
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1452 1 GO TO 721
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1453 IF(IWORK(LNRMAX) .LT. 0) GO TO 722
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1454 IF(RWORK(LEPLI).LE.0.0D0 .OR. RWORK(LEPLI).GE.1.0D0)GO TO 723
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1455 ENDIF
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1456 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1457 25 CONTINUE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1458 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1459 C Set and/or check controls for the initial condition calculation
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1460 C (INFO(11) .GT. 0). If indicated, set default values.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1461 C Otherwise, verify inputs required for iterative solver.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1462 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1463 IF (INFO(11) .EQ. 0) GO TO 30
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1464 IF (INFO(17) .EQ. 0) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1465 IWORK(LMXNIT) = 5
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1466 IF (INFO(12) .GT. 0) IWORK(LMXNIT) = 15
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1467 IWORK(LMXNJ) = 6
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1468 IF (INFO(12) .GT. 0) IWORK(LMXNJ) = 2
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1469 IWORK(LMXNH) = 5
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1470 IWORK(LLSOFF) = 0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1471 RWORK(LEPIN) = 0.01D0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1472 ELSE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1473 IF (IWORK(LMXNIT) .LE. 0) GO TO 725
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1474 IF (IWORK(LMXNJ) .LE. 0) GO TO 725
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1475 IF (IWORK(LMXNH) .LE. 0) GO TO 725
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1476 LSOFF = IWORK(LLSOFF)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1477 IF (LSOFF .LT. 0 .OR. LSOFF .GT. 1) GO TO 725
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1478 IF (RWORK(LEPIN) .LE. 0.0D0) GO TO 725
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1479 ENDIF
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1480 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1481 30 CONTINUE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1482 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1483 C Below is the computation and checking of the work array lengths
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1484 C LENIW and LENRW, using direct methods (INFO(12) = 0) or
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1485 C the Krylov methods (INFO(12) = 1).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1486 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1487 LENIC = 0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1488 IF (INFO(10) .EQ. 1 .OR. INFO(10) .EQ. 3) LENIC = NEQ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1489 LENID = 0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1490 IF (INFO(11) .EQ. 1 .OR. INFO(16) .EQ. 1) LENID = NEQ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1491 IF (INFO(12) .EQ. 0) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1492 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1493 C Compute MTYPE, etc. Check ML and MU.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1494 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1495 NCPHI = MAX(MXORD + 1, 4)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1496 IF(INFO(6).EQ.0) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1497 LENPD = NEQ**2
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1498 LENRW = 50 + (NCPHI+3)*NEQ + LENPD
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1499 IF(INFO(5).EQ.0) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1500 IWORK(LMTYPE)=2
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1501 ELSE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1502 IWORK(LMTYPE)=1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1503 ENDIF
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1504 ELSE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1505 IF(IWORK(LML).LT.0.OR.IWORK(LML).GE.NEQ)GO TO 717
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1506 IF(IWORK(LMU).LT.0.OR.IWORK(LMU).GE.NEQ)GO TO 718
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1507 LENPD=(2*IWORK(LML)+IWORK(LMU)+1)*NEQ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1508 IF(INFO(5).EQ.0) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1509 IWORK(LMTYPE)=5
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1510 MBAND=IWORK(LML)+IWORK(LMU)+1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1511 MSAVE=(NEQ/MBAND)+1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1512 LENRW = 50 + (NCPHI+3)*NEQ + LENPD + 2*MSAVE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1513 ELSE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1514 IWORK(LMTYPE)=4
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1515 LENRW = 50 + (NCPHI+3)*NEQ + LENPD
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1516 ENDIF
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1517 ENDIF
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1518 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1519 C Compute LENIW, LENWP, LENIWP.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1520 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1521 LENIW = 40 + LENIC + LENID + NEQ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1522 LENWP = 0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1523 LENIWP = 0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1524 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1525 ELSE IF (INFO(12) .EQ. 1) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1526 MAXL = IWORK(LMAXL)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1527 LENWP = IWORK(LLNWP)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1528 LENIWP = IWORK(LLNIWP)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1529 LENPD = (MAXL+3+MIN0(1,MAXL-IWORK(LKMP)))*NEQ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1530 1 + (MAXL+3)*MAXL + 1 + LENWP
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1531 LENRW = 50 + (IWORK(LMXORD)+5)*NEQ + LENPD
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1532 LENIW = 40 + LENIC + LENID + LENIWP
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1533 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1534 ENDIF
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1535 IF(INFO(16) .NE. 0) LENRW = LENRW + NEQ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1536 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1537 C Check lengths of RWORK and IWORK.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1538 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1539 IWORK(LNIW)=LENIW
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1540 IWORK(LNRW)=LENRW
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1541 IWORK(LNPD)=LENPD
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1542 IWORK(LLOCWP) = LENPD-LENWP+1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1543 IF(LRW.LT.LENRW)GO TO 704
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1544 IF(LIW.LT.LENIW)GO TO 705
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1545 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1546 C Check ICNSTR for legality.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1547 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1548 IF (LENIC .GT. 0) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1549 DO 40 I = 1,NEQ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1550 ICI = IWORK(LICNS-1+I)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1551 IF (ICI .LT. -2 .OR. ICI .GT. 2) GO TO 726
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1552 40 CONTINUE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1553 ENDIF
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1554 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1555 C Check Y for consistency with constraints.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1556 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1557 IF (LENIC .GT. 0) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1558 CALL DCNST0(NEQ,Y,IWORK(LICNS),IRET)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1559 IF (IRET .NE. 0) GO TO 727
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1560 ENDIF
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1561 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1562 C Check ID for legality.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1563 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1564 IF (LENID .GT. 0) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1565 DO 50 I = 1,NEQ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1566 IDI = IWORK(LID-1+I)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1567 IF (IDI .NE. 1 .AND. IDI .NE. -1) GO TO 724
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1568 50 CONTINUE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1569 ENDIF
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1570 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1571 C Check to see that TOUT is different from T.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1572 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1573 IF(TOUT .EQ. T)GO TO 719
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1574 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1575 C Check HMAX.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1576 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1577 IF(INFO(7) .NE. 0) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1578 HMAX = RWORK(LHMAX)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1579 IF (HMAX .LE. 0.0D0) GO TO 710
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1580 ENDIF
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1581 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1582 C Initialize counters and other flags.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1583 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1584 IWORK(LNST)=0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1585 IWORK(LNRE)=0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1586 IWORK(LNJE)=0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1587 IWORK(LETF)=0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1588 IWORK(LNCFN)=0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1589 IWORK(LNNI)=0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1590 IWORK(LNLI)=0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1591 IWORK(LNPS)=0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1592 IWORK(LNCFL)=0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1593 IWORK(LKPRIN)=INFO(18)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1594 IDID=1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1595 GO TO 200
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1596 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1597 C-----------------------------------------------------------------------
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1598 C This block is for continuation calls only.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1599 C Here we check INFO(1), and if the last step was interrupted,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1600 C we check whether appropriate action was taken.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1601 C-----------------------------------------------------------------------
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1602 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1603 100 CONTINUE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1604 IF(INFO(1).EQ.1)GO TO 110
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1605 ITEMP = 1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1606 IF(INFO(1).NE.-1)GO TO 701
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1607 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1608 C If we are here, the last step was interrupted by an error
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1609 C condition from DDSTP, and appropriate action was not taken.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1610 C This is a fatal error.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1611 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1612 MSG = 'DASPK-- THE LAST STEP TERMINATED WITH A NEGATIVE'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1613 CALL XERRWD(MSG,49,201,0,0,0,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1614 MSG = 'DASPK-- VALUE (=I1) OF IDID AND NO APPROPRIATE'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1615 CALL XERRWD(MSG,47,202,0,1,IDID,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1616 MSG = 'DASPK-- ACTION WAS TAKEN. RUN TERMINATED'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1617 CALL XERRWD(MSG,41,203,1,0,0,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1618 RETURN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1619 110 CONTINUE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1620 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1621 C-----------------------------------------------------------------------
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1622 C This block is executed on all calls.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1623 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1624 C Counters are saved for later checks of performance.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1625 C Then the error tolerance parameters are checked, and the
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1626 C work array pointers are set.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1627 C-----------------------------------------------------------------------
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1628 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1629 200 CONTINUE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1630 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1631 C Save counters for use later.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1632 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1633 IWORK(LNSTL)=IWORK(LNST)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1634 NLI0 = IWORK(LNLI)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1635 NNI0 = IWORK(LNNI)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1636 NCFN0 = IWORK(LNCFN)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1637 NCFL0 = IWORK(LNCFL)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1638 NWARN = 0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1639 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1640 C Check RTOL and ATOL.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1641 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1642 NZFLG = 0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1643 RTOLI = RTOL(1)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1644 ATOLI = ATOL(1)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1645 DO 210 I=1,NEQ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1646 IF (INFO(2) .EQ. 1) RTOLI = RTOL(I)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1647 IF (INFO(2) .EQ. 1) ATOLI = ATOL(I)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1648 IF (RTOLI .GT. 0.0D0 .OR. ATOLI .GT. 0.0D0) NZFLG = 1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1649 IF (RTOLI .LT. 0.0D0) GO TO 706
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1650 IF (ATOLI .LT. 0.0D0) GO TO 707
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1651 210 CONTINUE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1652 IF (NZFLG .EQ. 0) GO TO 708
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1653 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1654 C Set pointers to RWORK and IWORK segments.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1655 C For direct methods, SAVR is not used.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1656 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1657 IWORK(LLCIWP) = LID + LENID
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1658 LSAVR = LDELTA
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1659 IF (INFO(12) .NE. 0) LSAVR = LDELTA + NEQ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1660 LE = LSAVR + NEQ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1661 LWT = LE + NEQ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1662 LVT = LWT
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1663 IF (INFO(16) .NE. 0) LVT = LWT + NEQ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1664 LPHI = LVT + NEQ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1665 LWM = LPHI + (IWORK(LMXORD)+1)*NEQ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1666 IF (INFO(1) .EQ. 1) GO TO 400
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1667 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1668 C-----------------------------------------------------------------------
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1669 C This block is executed on the initial call only.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1670 C Set the initial step size, the error weight vector, and PHI.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1671 C Compute unknown initial components of Y and YPRIME, if requested.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1672 C-----------------------------------------------------------------------
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1673 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1674 300 CONTINUE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1675 TN=T
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1676 IDID=1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1677 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1678 C Set error weight array WT and altered weight array VT.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1679 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1680 CALL DDAWTS(NEQ,INFO(2),RTOL,ATOL,Y,RWORK(LWT),RPAR,IPAR)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1681 CALL DINVWT(NEQ,RWORK(LWT),IER)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1682 IF (IER .NE. 0) GO TO 713
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1683 IF (INFO(16) .NE. 0) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1684 DO 305 I = 1, NEQ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1685 305 RWORK(LVT+I-1) = MAX(IWORK(LID+I-1),0)*RWORK(LWT+I-1)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1686 ENDIF
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1687 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1688 C Compute unit roundoff and HMIN.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1689 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1690 UROUND = D1MACH(4)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1691 RWORK(LROUND) = UROUND
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1692 HMIN = 4.0D0*UROUND*MAX(ABS(T),ABS(TOUT))
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1693 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1694 C Set/check STPTOL control for initial condition calculation.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1695 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1696 IF (INFO(11) .NE. 0) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1697 IF( INFO(17) .EQ. 0) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1698 RWORK(LSTOL) = UROUND**.6667D0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1699 ELSE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1700 IF (RWORK(LSTOL) .LE. 0.0D0) GO TO 725
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1701 ENDIF
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1702 ENDIF
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1703 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1704 C Compute EPCON and square root of NEQ and its reciprocal, used
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1705 C inside iterative solver.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1706 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1707 RWORK(LEPCON) = 0.33D0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1708 FLOATN = NEQ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1709 RWORK(LSQRN) = SQRT(FLOATN)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1710 RWORK(LRSQRN) = 1.D0/RWORK(LSQRN)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1711 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1712 C Check initial interval to see that it is long enough.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1713 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1714 TDIST = ABS(TOUT - T)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1715 IF(TDIST .LT. HMIN) GO TO 714
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1716 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1717 C Check H0, if this was input.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1718 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1719 IF (INFO(8) .EQ. 0) GO TO 310
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1720 H0 = RWORK(LH)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1721 IF ((TOUT - T)*H0 .LT. 0.0D0) GO TO 711
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1722 IF (H0 .EQ. 0.0D0) GO TO 712
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1723 GO TO 320
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1724 310 CONTINUE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1725 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1726 C Compute initial stepsize, to be used by either
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1727 C DDSTP or DDASIC, depending on INFO(11).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1728 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1729 H0 = 0.001D0*TDIST
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1730 YPNORM = DDWNRM(NEQ,YPRIME,RWORK(LVT),RPAR,IPAR)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1731 IF (YPNORM .GT. 0.5D0/H0) H0 = 0.5D0/YPNORM
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1732 H0 = SIGN(H0,TOUT-T)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1733 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1734 C Adjust H0 if necessary to meet HMAX bound.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1735 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1736 320 IF (INFO(7) .EQ. 0) GO TO 330
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1737 RH = ABS(H0)/RWORK(LHMAX)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1738 IF (RH .GT. 1.0D0) H0 = H0/RH
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1739 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1740 C Check against TSTOP, if applicable.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1741 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1742 330 IF (INFO(4) .EQ. 0) GO TO 340
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1743 TSTOP = RWORK(LTSTOP)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1744 IF ((TSTOP - T)*H0 .LT. 0.0D0) GO TO 715
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1745 IF ((T + H0 - TSTOP)*H0 .GT. 0.0D0) H0 = TSTOP - T
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1746 IF ((TSTOP - TOUT)*H0 .LT. 0.0D0) GO TO 709
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1747 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1748 340 IF (INFO(11) .EQ. 0) GO TO 370
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1749 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1750 C Compute unknown components of initial Y and YPRIME, depending
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1751 C on INFO(11) and INFO(12). INFO(12) represents the nonlinear
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1752 C solver type (direct/Krylov). Pass the name of the specific
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1753 C nonlinear solver, depending on INFO(12). The location of the work
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1754 C arrays SAVR, YIC, YPIC, PWK also differ in the two cases.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1755 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1756 NWT = 1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1757 EPCONI = RWORK(LEPIN)*RWORK(LEPCON)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1758 350 IF (INFO(12) .EQ. 0) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1759 LYIC = LPHI + 2*NEQ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1760 LYPIC = LYIC + NEQ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1761 LPWK = LYPIC
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1762 CALL DDASIC(TN,Y,YPRIME,NEQ,INFO(11),IWORK(LID),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1763 * RES,JAC,PSOL,H0,RWORK(LWT),NWT,IDID,RPAR,IPAR,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1764 * RWORK(LPHI),RWORK(LSAVR),RWORK(LDELTA),RWORK(LE),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1765 * RWORK(LYIC),RWORK(LYPIC),RWORK(LPWK),RWORK(LWM),IWORK(LIWM),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1766 * HMIN,RWORK(LROUND),RWORK(LEPLI),RWORK(LSQRN),RWORK(LRSQRN),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1767 * EPCONI,RWORK(LSTOL),INFO(15),ICNFLG,IWORK(LICNS),DDASID)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1768 ELSE IF (INFO(12) .EQ. 1) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1769 LYIC = LWM
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1770 LYPIC = LYIC + NEQ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1771 LPWK = LYPIC + NEQ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1772 CALL DDASIC(TN,Y,YPRIME,NEQ,INFO(11),IWORK(LID),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1773 * RES,JAC,PSOL,H0,RWORK(LWT),NWT,IDID,RPAR,IPAR,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1774 * RWORK(LPHI),RWORK(LSAVR),RWORK(LDELTA),RWORK(LE),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1775 * RWORK(LYIC),RWORK(LYPIC),RWORK(LPWK),RWORK(LWM),IWORK(LIWM),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1776 * HMIN,RWORK(LROUND),RWORK(LEPLI),RWORK(LSQRN),RWORK(LRSQRN),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1777 * EPCONI,RWORK(LSTOL),INFO(15),ICNFLG,IWORK(LICNS),DDASIK)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1778 ENDIF
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1779 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1780 IF (IDID .LT. 0) GO TO 600
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1781 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1782 C DDASIC was successful. If this was the first call to DDASIC,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1783 C update the WT array (with the current Y) and call it again.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1784 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1785 IF (NWT .EQ. 2) GO TO 355
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1786 NWT = 2
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1787 CALL DDAWTS(NEQ,INFO(2),RTOL,ATOL,Y,RWORK(LWT),RPAR,IPAR)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1788 CALL DINVWT(NEQ,RWORK(LWT),IER)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1789 IF (IER .NE. 0) GO TO 713
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1790 GO TO 350
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1791 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1792 C If INFO(14) = 1, return now with IDID = 4.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1793 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1794 355 IF (INFO(14) .EQ. 1) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1795 IDID = 4
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1796 H = H0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1797 IF (INFO(11) .EQ. 1) RWORK(LHOLD) = H0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1798 GO TO 590
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1799 ENDIF
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1800 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1801 C Update the WT and VT arrays one more time, with the new Y.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1802 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1803 CALL DDAWTS(NEQ,INFO(2),RTOL,ATOL,Y,RWORK(LWT),RPAR,IPAR)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1804 CALL DINVWT(NEQ,RWORK(LWT),IER)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1805 IF (IER .NE. 0) GO TO 713
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1806 IF (INFO(16) .NE. 0) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1807 DO 357 I = 1, NEQ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1808 357 RWORK(LVT+I-1) = MAX(IWORK(LID+I-1),0)*RWORK(LWT+I-1)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1809 ENDIF
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1810 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1811 C Reset the initial stepsize to be used by DDSTP.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1812 C Use H0, if this was input. Otherwise, recompute H0,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1813 C and adjust it if necessary to meet HMAX bound.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1814 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1815 IF (INFO(8) .NE. 0) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1816 H0 = RWORK(LH)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1817 GO TO 360
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1818 ENDIF
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1819 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1820 H0 = 0.001D0*TDIST
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1821 YPNORM = DDWNRM(NEQ,YPRIME,RWORK(LVT),RPAR,IPAR)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1822 IF (YPNORM .GT. 0.5D0/H0) H0 = 0.5D0/YPNORM
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1823 H0 = SIGN(H0,TOUT-T)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1824 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1825 360 IF (INFO(7) .NE. 0) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1826 RH = ABS(H0)/RWORK(LHMAX)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1827 IF (RH .GT. 1.0D0) H0 = H0/RH
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1828 ENDIF
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1829 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1830 C Check against TSTOP, if applicable.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1831 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1832 IF (INFO(4) .NE. 0) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1833 TSTOP = RWORK(LTSTOP)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1834 IF ((T + H0 - TSTOP)*H0 .GT. 0.0D0) H0 = TSTOP - T
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1835 ENDIF
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1836 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1837 C Load H and RWORK(LH) with H0.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1838 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1839 370 H = H0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1840 RWORK(LH) = H
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1841 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1842 C Load Y and H*YPRIME into PHI(*,1) and PHI(*,2).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1843 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1844 ITEMP = LPHI + NEQ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1845 DO 380 I = 1,NEQ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1846 RWORK(LPHI + I - 1) = Y(I)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1847 380 RWORK(ITEMP + I - 1) = H*YPRIME(I)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1848 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1849 GO TO 500
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1850 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1851 C-----------------------------------------------------------------------
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1852 C This block is for continuation calls only.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1853 C Its purpose is to check stop conditions before taking a step.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1854 C Adjust H if necessary to meet HMAX bound.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1855 C-----------------------------------------------------------------------
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1856 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1857 400 CONTINUE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1858 UROUND=RWORK(LROUND)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1859 DONE = .FALSE.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1860 TN=RWORK(LTN)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1861 H=RWORK(LH)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1862 IF(INFO(7) .EQ. 0) GO TO 410
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1863 RH = ABS(H)/RWORK(LHMAX)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1864 IF(RH .GT. 1.0D0) H = H/RH
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1865 410 CONTINUE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1866 IF(T .EQ. TOUT) GO TO 719
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1867 IF((T - TOUT)*H .GT. 0.0D0) GO TO 711
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1868 IF(INFO(4) .EQ. 1) GO TO 430
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1869 IF(INFO(3) .EQ. 1) GO TO 420
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1870 IF((TN-TOUT)*H.LT.0.0D0)GO TO 490
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1871 CALL DDATRP(TN,TOUT,Y,YPRIME,NEQ,IWORK(LKOLD),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1872 * RWORK(LPHI),RWORK(LPSI))
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1873 T=TOUT
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1874 IDID = 3
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1875 DONE = .TRUE.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1876 GO TO 490
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1877 420 IF((TN-T)*H .LE. 0.0D0) GO TO 490
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1878 IF((TN - TOUT)*H .GT. 0.0D0) GO TO 425
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1879 CALL DDATRP(TN,TN,Y,YPRIME,NEQ,IWORK(LKOLD),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1880 * RWORK(LPHI),RWORK(LPSI))
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1881 T = TN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1882 IDID = 1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1883 DONE = .TRUE.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1884 GO TO 490
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1885 425 CONTINUE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1886 CALL DDATRP(TN,TOUT,Y,YPRIME,NEQ,IWORK(LKOLD),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1887 * RWORK(LPHI),RWORK(LPSI))
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1888 T = TOUT
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1889 IDID = 3
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1890 DONE = .TRUE.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1891 GO TO 490
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1892 430 IF(INFO(3) .EQ. 1) GO TO 440
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1893 TSTOP=RWORK(LTSTOP)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1894 IF((TN-TSTOP)*H.GT.0.0D0) GO TO 715
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1895 IF((TSTOP-TOUT)*H.LT.0.0D0)GO TO 709
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1896 IF((TN-TOUT)*H.LT.0.0D0)GO TO 450
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1897 CALL DDATRP(TN,TOUT,Y,YPRIME,NEQ,IWORK(LKOLD),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1898 * RWORK(LPHI),RWORK(LPSI))
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1899 T=TOUT
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1900 IDID = 3
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1901 DONE = .TRUE.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1902 GO TO 490
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1903 440 TSTOP = RWORK(LTSTOP)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1904 IF((TN-TSTOP)*H .GT. 0.0D0) GO TO 715
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1905 IF((TSTOP-TOUT)*H .LT. 0.0D0) GO TO 709
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1906 IF((TN-T)*H .LE. 0.0D0) GO TO 450
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1907 IF((TN - TOUT)*H .GT. 0.0D0) GO TO 445
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1908 CALL DDATRP(TN,TN,Y,YPRIME,NEQ,IWORK(LKOLD),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1909 * RWORK(LPHI),RWORK(LPSI))
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1910 T = TN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1911 IDID = 1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1912 DONE = .TRUE.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1913 GO TO 490
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1914 445 CONTINUE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1915 CALL DDATRP(TN,TOUT,Y,YPRIME,NEQ,IWORK(LKOLD),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1916 * RWORK(LPHI),RWORK(LPSI))
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1917 T = TOUT
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1918 IDID = 3
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1919 DONE = .TRUE.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1920 GO TO 490
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1921 450 CONTINUE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1922 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1923 C Check whether we are within roundoff of TSTOP.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1924 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1925 IF(ABS(TN-TSTOP).GT.100.0D0*UROUND*
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1926 * (ABS(TN)+ABS(H)))GO TO 460
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1927 CALL DDATRP(TN,TSTOP,Y,YPRIME,NEQ,IWORK(LKOLD),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1928 * RWORK(LPHI),RWORK(LPSI))
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1929 IDID=2
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1930 T=TSTOP
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1931 DONE = .TRUE.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1932 GO TO 490
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1933 460 TNEXT=TN+H
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1934 IF((TNEXT-TSTOP)*H.LE.0.0D0)GO TO 490
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1935 H=TSTOP-TN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1936 RWORK(LH)=H
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1937 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1938 490 IF (DONE) GO TO 590
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1939 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1940 C-----------------------------------------------------------------------
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1941 C The next block contains the call to the one-step integrator DDSTP.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1942 C This is a looping point for the integration steps.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1943 C Check for too many steps.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1944 C Check for poor Newton/Krylov performance.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1945 C Update WT. Check for too much accuracy requested.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1946 C Compute minimum stepsize.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1947 C-----------------------------------------------------------------------
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1948 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1949 500 CONTINUE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1950 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1951 C Check for too many steps.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1952 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1953 IF((IWORK(LNST)-IWORK(LNSTL)).LT.500) GO TO 505
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1954 IDID=-1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1955 GO TO 527
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1956 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1957 C Check for poor Newton/Krylov performance.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1958 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1959 505 IF (INFO(12) .EQ. 0) GO TO 510
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1960 NSTD = IWORK(LNST) - IWORK(LNSTL)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1961 NNID = IWORK(LNNI) - NNI0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1962 IF (NSTD .LT. 10 .OR. NNID .EQ. 0) GO TO 510
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1963 AVLIN = REAL(IWORK(LNLI) - NLI0)/REAL(NNID)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1964 RCFN = REAL(IWORK(LNCFN) - NCFN0)/REAL(NSTD)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1965 RCFL = REAL(IWORK(LNCFL) - NCFL0)/REAL(NNID)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1966 FMAXL = IWORK(LMAXL)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1967 LAVL = AVLIN .GT. FMAXL
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1968 LCFN = RCFN .GT. 0.9D0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1969 LCFL = RCFL .GT. 0.9D0
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1970 LWARN = LAVL .OR. LCFN .OR. LCFL
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1971 IF (.NOT.LWARN) GO TO 510
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1972 NWARN = NWARN + 1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1973 IF (NWARN .GT. 10) GO TO 510
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1974 IF (LAVL) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1975 MSG = 'DASPK-- Warning. Poor iterative algorithm performance '
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1976 CALL XERRWD (MSG, 56, 501, 0, 0, 0, 0, 0, 0.0D0, 0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1977 MSG = ' at T = R1. Average no. of linear iterations = R2 '
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1978 CALL XERRWD (MSG, 56, 501, 0, 0, 0, 0, 2, TN, AVLIN)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1979 ENDIF
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1980 IF (LCFN) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1981 MSG = 'DASPK-- Warning. Poor iterative algorithm performance '
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1982 CALL XERRWD (MSG, 56, 502, 0, 0, 0, 0, 0, 0.0D0, 0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1983 MSG = ' at T = R1. Nonlinear convergence failure rate = R2'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1984 CALL XERRWD (MSG, 56, 502, 0, 0, 0, 0, 2, TN, RCFN)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1985 ENDIF
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1986 IF (LCFL) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1987 MSG = 'DASPK-- Warning. Poor iterative algorithm performance '
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1988 CALL XERRWD (MSG, 56, 503, 0, 0, 0, 0, 0, 0.0D0, 0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1989 MSG = ' at T = R1. Linear convergence failure rate = R2 '
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1990 CALL XERRWD (MSG, 56, 503, 0, 0, 0, 0, 2, TN, RCFL)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1991 ENDIF
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1992 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1993 C Update WT and VT, if this is not the first call.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1994 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1995 510 CALL DDAWTS(NEQ,INFO(2),RTOL,ATOL,RWORK(LPHI),RWORK(LWT),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1996 * RPAR,IPAR)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1997 CALL DINVWT(NEQ,RWORK(LWT),IER)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1998 IF (IER .NE. 0) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
1999 IDID = -3
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2000 GO TO 527
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2001 ENDIF
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2002 IF (INFO(16) .NE. 0) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2003 DO 515 I = 1, NEQ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2004 515 RWORK(LVT+I-1) = MAX(IWORK(LID+I-1),0)*RWORK(LWT+I-1)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2005 ENDIF
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2006 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2007 C Test for too much accuracy requested.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2008 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2009 R = DDWNRM(NEQ,RWORK(LPHI),RWORK(LWT),RPAR,IPAR)*100.0D0*UROUND
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2010 IF (R .LE. 1.0D0) GO TO 525
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2011 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2012 C Multiply RTOL and ATOL by R and return.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2013 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2014 IF(INFO(2).EQ.1)GO TO 523
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2015 RTOL(1)=R*RTOL(1)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2016 ATOL(1)=R*ATOL(1)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2017 IDID=-2
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2018 GO TO 527
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2019 523 DO 524 I=1,NEQ
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2020 RTOL(I)=R*RTOL(I)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2021 524 ATOL(I)=R*ATOL(I)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2022 IDID=-2
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2023 GO TO 527
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2024 525 CONTINUE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2025 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2026 C Compute minimum stepsize.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2027 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2028 HMIN=4.0D0*UROUND*MAX(ABS(TN),ABS(TOUT))
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2029 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2030 C Test H vs. HMAX
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2031 IF (INFO(7) .NE. 0) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2032 RH = ABS(H)/RWORK(LHMAX)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2033 IF (RH .GT. 1.0D0) H = H/RH
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2034 ENDIF
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2035 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2036 C Call the one-step integrator.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2037 C Note that INFO(12) represents the nonlinear solver type.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2038 C Pass the required nonlinear solver, depending upon INFO(12).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2039 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2040 IF (INFO(12) .EQ. 0) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2041 CALL DDSTP(TN,Y,YPRIME,NEQ,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2042 * RES,JAC,PSOL,H,RWORK(LWT),RWORK(LVT),INFO(1),IDID,RPAR,IPAR,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2043 * RWORK(LPHI),RWORK(LSAVR),RWORK(LDELTA),RWORK(LE),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2044 * RWORK(LWM),IWORK(LIWM),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2045 * RWORK(LALPHA),RWORK(LBETA),RWORK(LGAMMA),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2046 * RWORK(LPSI),RWORK(LSIGMA),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2047 * RWORK(LCJ),RWORK(LCJOLD),RWORK(LHOLD),RWORK(LS),HMIN,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2048 * RWORK(LROUND), RWORK(LEPLI),RWORK(LSQRN),RWORK(LRSQRN),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2049 * RWORK(LEPCON), IWORK(LPHASE),IWORK(LJCALC),INFO(15),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2050 * IWORK(LK), IWORK(LKOLD),IWORK(LNS),NONNEG,INFO(12),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2051 * DNEDD)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2052 ELSE IF (INFO(12) .EQ. 1) THEN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2053 CALL DDSTP(TN,Y,YPRIME,NEQ,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2054 * RES,JAC,PSOL,H,RWORK(LWT),RWORK(LVT),INFO(1),IDID,RPAR,IPAR,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2055 * RWORK(LPHI),RWORK(LSAVR),RWORK(LDELTA),RWORK(LE),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2056 * RWORK(LWM),IWORK(LIWM),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2057 * RWORK(LALPHA),RWORK(LBETA),RWORK(LGAMMA),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2058 * RWORK(LPSI),RWORK(LSIGMA),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2059 * RWORK(LCJ),RWORK(LCJOLD),RWORK(LHOLD),RWORK(LS),HMIN,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2060 * RWORK(LROUND), RWORK(LEPLI),RWORK(LSQRN),RWORK(LRSQRN),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2061 * RWORK(LEPCON), IWORK(LPHASE),IWORK(LJCALC),INFO(15),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2062 * IWORK(LK), IWORK(LKOLD),IWORK(LNS),NONNEG,INFO(12),
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2063 * DNEDK)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2064 ENDIF
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2065 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2066 527 IF(IDID.LT.0)GO TO 600
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2067 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2068 C-----------------------------------------------------------------------
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2069 C This block handles the case of a successful return from DDSTP
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2070 C (IDID=1). Test for stop conditions.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2071 C-----------------------------------------------------------------------
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2072 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2073 IF(INFO(4).NE.0)GO TO 540
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2074 IF(INFO(3).NE.0)GO TO 530
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2075 IF((TN-TOUT)*H.LT.0.0D0)GO TO 500
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2076 CALL DDATRP(TN,TOUT,Y,YPRIME,NEQ,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2077 * IWORK(LKOLD),RWORK(LPHI),RWORK(LPSI))
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2078 IDID=3
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2079 T=TOUT
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2080 GO TO 580
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2081 530 IF((TN-TOUT)*H.GE.0.0D0)GO TO 535
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2082 T=TN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2083 IDID=1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2084 GO TO 580
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2085 535 CALL DDATRP(TN,TOUT,Y,YPRIME,NEQ,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2086 * IWORK(LKOLD),RWORK(LPHI),RWORK(LPSI))
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2087 IDID=3
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2088 T=TOUT
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2089 GO TO 580
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2090 540 IF(INFO(3).NE.0)GO TO 550
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2091 IF((TN-TOUT)*H.LT.0.0D0)GO TO 542
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2092 CALL DDATRP(TN,TOUT,Y,YPRIME,NEQ,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2093 * IWORK(LKOLD),RWORK(LPHI),RWORK(LPSI))
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2094 T=TOUT
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2095 IDID=3
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2096 GO TO 580
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2097 542 IF(ABS(TN-TSTOP).LE.100.0D0*UROUND*
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2098 * (ABS(TN)+ABS(H)))GO TO 545
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2099 TNEXT=TN+H
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2100 IF((TNEXT-TSTOP)*H.LE.0.0D0)GO TO 500
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2101 H=TSTOP-TN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2102 GO TO 500
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2103 545 CALL DDATRP(TN,TSTOP,Y,YPRIME,NEQ,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2104 * IWORK(LKOLD),RWORK(LPHI),RWORK(LPSI))
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2105 IDID=2
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2106 T=TSTOP
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2107 GO TO 580
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2108 550 IF((TN-TOUT)*H.GE.0.0D0)GO TO 555
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2109 IF(ABS(TN-TSTOP).LE.100.0D0*UROUND*(ABS(TN)+ABS(H)))GO TO 552
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2110 T=TN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2111 IDID=1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2112 GO TO 580
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2113 552 CALL DDATRP(TN,TSTOP,Y,YPRIME,NEQ,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2114 * IWORK(LKOLD),RWORK(LPHI),RWORK(LPSI))
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2115 IDID=2
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2116 T=TSTOP
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2117 GO TO 580
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2118 555 CALL DDATRP(TN,TOUT,Y,YPRIME,NEQ,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2119 * IWORK(LKOLD),RWORK(LPHI),RWORK(LPSI))
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2120 T=TOUT
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2121 IDID=3
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2122 580 CONTINUE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2123 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2124 C-----------------------------------------------------------------------
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2125 C All successful returns from DDASPK are made from this block.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2126 C-----------------------------------------------------------------------
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2127 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2128 590 CONTINUE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2129 RWORK(LTN)=TN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2130 RWORK(LH)=H
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2131 RETURN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2132 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2133 C-----------------------------------------------------------------------
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2134 C This block handles all unsuccessful returns other than for
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2135 C illegal input.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2136 C-----------------------------------------------------------------------
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2137 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2138 600 CONTINUE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2139 ITEMP = -IDID
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2140 GO TO (610,620,630,700,655,640,650,660,670,675,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2141 * 680,685,690,695), ITEMP
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2142 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2143 C The maximum number of steps was taken before
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2144 C reaching tout.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2145 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2146 610 MSG = 'DASPK-- AT CURRENT T (=R1) 500 STEPS'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2147 CALL XERRWD(MSG,38,610,0,0,0,0,1,TN,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2148 MSG = 'DASPK-- TAKEN ON THIS CALL BEFORE REACHING TOUT'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2149 CALL XERRWD(MSG,48,611,0,0,0,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2150 GO TO 700
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2151 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2152 C Too much accuracy for machine precision.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2153 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2154 620 MSG = 'DASPK-- AT T (=R1) TOO MUCH ACCURACY REQUESTED'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2155 CALL XERRWD(MSG,47,620,0,0,0,0,1,TN,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2156 MSG = 'DASPK-- FOR PRECISION OF MACHINE. RTOL AND ATOL'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2157 CALL XERRWD(MSG,48,621,0,0,0,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2158 MSG = 'DASPK-- WERE INCREASED TO APPROPRIATE VALUES'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2159 CALL XERRWD(MSG,45,622,0,0,0,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2160 GO TO 700
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2161 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2162 C WT(I) .LE. 0.0D0 for some I (not at start of problem).
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2163 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2164 630 MSG = 'DASPK-- AT T (=R1) SOME ELEMENT OF WT'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2165 CALL XERRWD(MSG,38,630,0,0,0,0,1,TN,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2166 MSG = 'DASPK-- HAS BECOME .LE. 0.0'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2167 CALL XERRWD(MSG,28,631,0,0,0,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2168 GO TO 700
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2169 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2170 C Error test failed repeatedly or with H=HMIN.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2171 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2172 640 MSG = 'DASPK-- AT T (=R1) AND STEPSIZE H (=R2) THE'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2173 CALL XERRWD(MSG,44,640,0,0,0,0,2,TN,H)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2174 MSG='DASPK-- ERROR TEST FAILED REPEATEDLY OR WITH ABS(H)=HMIN'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2175 CALL XERRWD(MSG,57,641,0,0,0,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2176 GO TO 700
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2177 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2178 C Nonlinear solver failed to converge repeatedly or with H=HMIN.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2179 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2180 650 MSG = 'DASPK-- AT T (=R1) AND STEPSIZE H (=R2) THE'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2181 CALL XERRWD(MSG,44,650,0,0,0,0,2,TN,H)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2182 MSG = 'DASPK-- NONLINEAR SOLVER FAILED TO CONVERGE'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2183 CALL XERRWD(MSG,44,651,0,0,0,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2184 MSG = 'DASPK-- REPEATEDLY OR WITH ABS(H)=HMIN'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2185 CALL XERRWD(MSG,40,652,0,0,0,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2186 GO TO 700
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2187 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2188 C The preconditioner had repeated failures.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2189 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2190 655 MSG = 'DASPK-- AT T (=R1) AND STEPSIZE H (=R2) THE'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2191 CALL XERRWD(MSG,44,655,0,0,0,0,2,TN,H)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2192 MSG = 'DASPK-- PRECONDITIONER HAD REPEATED FAILURES.'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2193 CALL XERRWD(MSG,46,656,0,0,0,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2194 GO TO 700
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2195 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2196 C The iteration matrix is singular.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2197 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2198 660 MSG = 'DASPK-- AT T (=R1) AND STEPSIZE H (=R2) THE'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2199 CALL XERRWD(MSG,44,660,0,0,0,0,2,TN,H)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2200 MSG = 'DASPK-- ITERATION MATRIX IS SINGULAR.'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2201 CALL XERRWD(MSG,38,661,0,0,0,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2202 GO TO 700
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2203 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2204 C Nonlinear system failure preceded by error test failures.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2205 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2206 670 MSG = 'DASPK-- AT T (=R1) AND STEPSIZE H (=R2) THE'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2207 CALL XERRWD(MSG,44,670,0,0,0,0,2,TN,H)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2208 MSG = 'DASPK-- NONLINEAR SOLVER COULD NOT CONVERGE.'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2209 CALL XERRWD(MSG,45,671,0,0,0,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2210 MSG = 'DASPK-- ALSO, THE ERROR TEST FAILED REPEATEDLY.'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2211 CALL XERRWD(MSG,49,672,0,0,0,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2212 GO TO 700
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2213 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2214 C Nonlinear system failure because IRES = -1.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2215 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2216 675 MSG = 'DASPK-- AT T (=R1) AND STEPSIZE H (=R2) THE'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2217 CALL XERRWD(MSG,44,675,0,0,0,0,2,TN,H)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2218 MSG = 'DASPK-- NONLINEAR SYSTEM SOLVER COULD NOT CONVERGE'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2219 CALL XERRWD(MSG,51,676,0,0,0,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2220 MSG = 'DASPK-- BECAUSE IRES WAS EQUAL TO MINUS ONE'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2221 CALL XERRWD(MSG,44,677,0,0,0,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2222 GO TO 700
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2223 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2224 C Failure because IRES = -2.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2225 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2226 680 MSG = 'DASPK-- AT T (=R1) AND STEPSIZE H (=R2)'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2227 CALL XERRWD(MSG,40,680,0,0,0,0,2,TN,H)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2228 MSG = 'DASPK-- IRES WAS EQUAL TO MINUS TWO'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2229 CALL XERRWD(MSG,36,681,0,0,0,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2230 GO TO 700
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2231 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2232 C Failed to compute initial YPRIME.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2233 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2234 685 MSG = 'DASPK-- AT T (=R1) AND STEPSIZE H (=R2) THE'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2235 CALL XERRWD(MSG,44,685,0,0,0,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2236 MSG = 'DASPK-- INITIAL (Y,YPRIME) COULD NOT BE COMPUTED'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2237 CALL XERRWD(MSG,49,686,0,0,0,0,2,TN,H0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2238 GO TO 700
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2239 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2240 C Failure because IER was negative from PSOL.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2241 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2242 690 MSG = 'DASPK-- AT T (=R1) AND STEPSIZE H (=R2)'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2243 CALL XERRWD(MSG,40,690,0,0,0,0,2,TN,H)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2244 MSG = 'DASPK-- IER WAS NEGATIVE FROM PSOL'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2245 CALL XERRWD(MSG,35,691,0,0,0,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2246 GO TO 700
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2247 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2248 C Failure because the linear system solver could not converge.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2249 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2250 695 MSG = 'DASPK-- AT T (=R1) AND STEPSIZE H (=R2) THE'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2251 CALL XERRWD(MSG,44,695,0,0,0,0,2,TN,H)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2252 MSG = 'DASPK-- LINEAR SYSTEM SOLVER COULD NOT CONVERGE.'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2253 CALL XERRWD(MSG,50,696,0,0,0,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2254 GO TO 700
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2255 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2256 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2257 700 CONTINUE
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2258 INFO(1)=-1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2259 T=TN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2260 RWORK(LTN)=TN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2261 RWORK(LH)=H
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2262 RETURN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2263 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2264 C-----------------------------------------------------------------------
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2265 C This block handles all error returns due to illegal input,
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2266 C as detected before calling DDSTP.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2267 C First the error message routine is called. If this happens
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2268 C twice in succession, execution is terminated.
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2269 C-----------------------------------------------------------------------
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2270 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2271 701 MSG = 'DASPK-- ELEMENT (=I1) OF INFO VECTOR IS NOT VALID'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2272 CALL XERRWD(MSG,50,1,0,1,ITEMP,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2273 GO TO 750
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2274 702 MSG = 'DASPK-- NEQ (=I1) .LE. 0'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2275 CALL XERRWD(MSG,25,2,0,1,NEQ,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2276 GO TO 750
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2277 703 MSG = 'DASPK-- MAXORD (=I1) NOT IN RANGE'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2278 CALL XERRWD(MSG,34,3,0,1,MXORD,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2279 GO TO 750
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2280 704 MSG='DASPK-- RWORK LENGTH NEEDED, LENRW (=I1), EXCEEDS LRW (=I2)'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2281 CALL XERRWD(MSG,60,4,0,2,LENRW,LRW,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2282 GO TO 750
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2283 705 MSG='DASPK-- IWORK LENGTH NEEDED, LENIW (=I1), EXCEEDS LIW (=I2)'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2284 CALL XERRWD(MSG,60,5,0,2,LENIW,LIW,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2285 GO TO 750
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2286 706 MSG = 'DASPK-- SOME ELEMENT OF RTOL IS .LT. 0'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2287 CALL XERRWD(MSG,39,6,0,0,0,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2288 GO TO 750
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2289 707 MSG = 'DASPK-- SOME ELEMENT OF ATOL IS .LT. 0'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2290 CALL XERRWD(MSG,39,7,0,0,0,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2291 GO TO 750
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2292 708 MSG = 'DASPK-- ALL ELEMENTS OF RTOL AND ATOL ARE ZERO'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2293 CALL XERRWD(MSG,47,8,0,0,0,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2294 GO TO 750
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2295 709 MSG='DASPK-- INFO(4) = 1 AND TSTOP (=R1) BEHIND TOUT (=R2)'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2296 CALL XERRWD(MSG,54,9,0,0,0,0,2,TSTOP,TOUT)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2297 GO TO 750
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2298 710 MSG = 'DASPK-- HMAX (=R1) .LT. 0.0'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2299 CALL XERRWD(MSG,28,10,0,0,0,0,1,HMAX,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2300 GO TO 750
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2301 711 MSG = 'DASPK-- TOUT (=R1) BEHIND T (=R2)'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2302 CALL XERRWD(MSG,34,11,0,0,0,0,2,TOUT,T)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2303 GO TO 750
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2304 712 MSG = 'DASPK-- INFO(8)=1 AND H0=0.0'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2305 CALL XERRWD(MSG,29,12,0,0,0,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2306 GO TO 750
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2307 713 MSG = 'DASPK-- SOME ELEMENT OF WT IS .LE. 0.0'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2308 CALL XERRWD(MSG,39,13,0,0,0,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2309 GO TO 750
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2310 714 MSG='DASPK-- TOUT (=R1) TOO CLOSE TO T (=R2) TO START INTEGRATION'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2311 CALL XERRWD(MSG,60,14,0,0,0,0,2,TOUT,T)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2312 GO TO 750
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2313 715 MSG = 'DASPK-- INFO(4)=1 AND TSTOP (=R1) BEHIND T (=R2)'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2314 CALL XERRWD(MSG,49,15,0,0,0,0,2,TSTOP,T)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2315 GO TO 750
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2316 717 MSG = 'DASPK-- ML (=I1) ILLEGAL. EITHER .LT. 0 OR .GT. NEQ'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2317 CALL XERRWD(MSG,52,17,0,1,IWORK(LML),0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2318 GO TO 750
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2319 718 MSG = 'DASPK-- MU (=I1) ILLEGAL. EITHER .LT. 0 OR .GT. NEQ'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2320 CALL XERRWD(MSG,52,18,0,1,IWORK(LMU),0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2321 GO TO 750
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2322 719 MSG = 'DASPK-- TOUT (=R1) IS EQUAL TO T (=R2)'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2323 CALL XERRWD(MSG,39,19,0,0,0,0,2,TOUT,T)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2324 GO TO 750
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2325 720 MSG = 'DASPK-- MAXL (=I1) ILLEGAL. EITHER .LT. 1 OR .GT. NEQ'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2326 CALL XERRWD(MSG,54,20,0,1,IWORK(LMAXL),0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2327 GO TO 750
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2328 721 MSG = 'DASPK-- KMP (=I1) ILLEGAL. EITHER .LT. 1 OR .GT. MAXL'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2329 CALL XERRWD(MSG,54,21,0,1,IWORK(LKMP),0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2330 GO TO 750
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2331 722 MSG = 'DASPK-- NRMAX (=I1) ILLEGAL. .LT. 0'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2332 CALL XERRWD(MSG,36,22,0,1,IWORK(LNRMAX),0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2333 GO TO 750
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2334 723 MSG = 'DASPK-- EPLI (=R1) ILLEGAL. EITHER .LE. 0.D0 OR .GE. 1.D0'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2335 CALL XERRWD(MSG,58,23,0,0,0,0,1,RWORK(LEPLI),0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2336 GO TO 750
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2337 724 MSG = 'DASPK-- ILLEGAL IWORK VALUE FOR INFO(11) .NE. 0'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2338 CALL XERRWD(MSG,48,24,0,0,0,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2339 GO TO 750
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2340 725 MSG = 'DASPK-- ONE OF THE INPUTS FOR INFO(17) = 1 IS ILLEGAL'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2341 CALL XERRWD(MSG,54,25,0,0,0,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2342 GO TO 750
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2343 726 MSG = 'DASPK-- ILLEGAL IWORK VALUE FOR INFO(10) .NE. 0'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2344 CALL XERRWD(MSG,48,26,0,0,0,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2345 GO TO 750
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2346 727 MSG = 'DASPK-- Y(I) AND IWORK(40+I) (I=I1) INCONSISTENT'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2347 CALL XERRWD(MSG,49,27,0,1,IRET,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2348 GO TO 750
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2349 750 IF(INFO(1).EQ.-1) GO TO 760
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2350 INFO(1)=-1
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2351 IDID=-33
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2352 RETURN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2353 760 MSG = 'DASPK-- REPEATED OCCURRENCES OF ILLEGAL INPUT'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2354 CALL XERRWD(MSG,46,701,0,0,0,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2355 770 MSG = 'DASPK-- RUN TERMINATED. APPARENT INFINITE LOOP'
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2356 CALL XERRWD(MSG,47,702,1,0,0,0,0,0.0D0,0.0D0)
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2357 RETURN
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2358 C
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2359 C------END OF SUBROUTINE DDASPK-----------------------------------------
8389e78e67d4 [project @ 2002-04-28 02:15:38 by jwe]
jwe
parents:
diff changeset
2360 END