1 SUBROUTINE GDERIV
( GI
, NROW
, IROW
, ZVAL
, DGZ
, MODE
, DGSUB
)
3 C**********************************************************************
7 C construct a collocation matrix row according to mode:
8 C mode = 1 - a row corresponding to a initial condition
9 C (i.e. at the left end of the subinterval).
10 C mode = 2 - a row corresponding to a final condition.
14 C gi - the sub-block of the global bvp matrix in
15 C which the equations are to be formed.
16 C nrow - no. of rows in gi.
17 C irow - the row in gi to be used for equations.
19 C dg - the derivatives of the side condition.
21 C**********************************************************************
22 IMPLICIT REAL*8 (A
-H
,O
-Z
)
23 DIMENSION GI
(NROW
,1), ZVAL
(1), DGZ
(1), DG
(40)
25 COMMON /COLORD
/ KDUM
, NDUM
, MSTAR
, KD
, MMAX
, M
(20)
26 COMMON /COLSID
/ ZETA
(40), ALEFT
, ARIGHT
, IZETA
, IDUM
27 COMMON /COLNLN
/ NONLIN
, ITER
, LIMIT
, ICARE
, IGUESS
34 C... evaluate jacobian dg
36 CALL DGSUB
(IZETA
, ZVAL
, DG
)
38 C... evaluate dgz = dg * zval once for a new mesh
40 IF (NONLIN
.EQ
. 0 .OR
. ITER
.GT
. 0) GO TO 30
43 20 DOT
= DOT
+ DG
(J
) * ZVAL
(J
)
46 C... branch according to m o d e
48 30 IF ( MODE
.EQ
. 2 ) GO TO 50
50 C... provide coefficients of the j-th linearized side condition.
51 C... specifically, at x=zeta(j) the j-th side condition reads
52 C... dg(1)*z(1) + ... +dg(mstar)*z(mstar) + g = 0
55 C... handle an initial condition
59 40 GI
(IROW
,MSTAR
+J
) = 0.D0
62 C... handle a final condition
66 60 GI
(IROW
,MSTAR
+J
) = DG
(J
)