1 SUBROUTINE SKALE
(N
, MSTAR
, KD
, Z
, XI
, SCALE
, DSCALE
)
3 C**********************************************************************
6 C provide a proper scaling of the state variables, used
7 C to control the damping factor for a newton iteration [2].
11 C n = number of mesh subintervals
12 C mstar = number of unknomns in z(u(x))
13 C kd = number of unknowns in dmz
14 C z = the global unknown vector
15 C xi = the current mesh
16 C scale = scaling vector for z
17 C dscale = scaling vector for dmz
19 C**********************************************************************
21 IMPLICIT REAL*8 (A
-H
,O
-Z
)
22 DIMENSION Z
(MSTAR
,1), SCALE
(MSTAR
,1), DSCALE
(KD
,1)
23 DIMENSION XI
(1), BASM
(5)
25 COMMON /COLORD
/ K
, NCOMP
, ID1
, ID2
, MMAX
, M
(20)
32 BASM
(L
+1) = BASM
(L
) * H
/ DFLOAT
(L
)
34 DO 40 ICOMP
= 1, NCOMP
35 SCAL
= (DABS
(Z
(IZ
,J
)) + DABS
(Z
(IZ
,J
+1))) * .5D0
+ 1.D0
38 SCALE
(IZ
,J
) = BASM
(L
) / SCAL
41 SCAL
= BASM
(MJ
+1) / SCAL
42 DO 30 IDMZ
= ICOMP
, KD
, NCOMP
49 SCALE
(IZ
,NP1
) = SCALE
(IZ
,N
)