32 NEQ, NJA, NIAPC, NJAPC, &
33 IPC, ICNVGOPT, NORTH, ISCL, RSCALE, HSCALE, &
34 DVCLOSE, RCLOSE, L2NORM0, EPFACT, &
35 IA0, JA0, A0, IAPC, JAPC, APC, &
38 NCONV, CONVNMOD, CONVMODSTART, &
41 integer(I4B),
INTENT(INOUT) :: ICNVG
42 integer(I4B),
INTENT(IN) :: ITMAX
43 integer(I4B),
INTENT(INOUT) :: INNERIT
44 integer(I4B),
INTENT(IN) :: NEQ
45 integer(I4B),
INTENT(IN) :: NJA
46 integer(I4B),
INTENT(IN) :: NIAPC
47 integer(I4B),
INTENT(IN) :: NJAPC
48 integer(I4B),
INTENT(IN) :: IPC
49 integer(I4B),
INTENT(IN) :: ICNVGOPT
50 integer(I4B),
INTENT(IN) :: NORTH
51 integer(I4B),
INTENT(IN) :: ISCL
52 real(DP),
DIMENSION(*),
INTENT(IN) :: RSCALE
53 real(DP),
DIMENSION(*),
INTENT(IN) :: HSCALE
54 real(DP),
INTENT(IN) :: DVCLOSE
55 real(DP),
INTENT(IN) :: RCLOSE
56 real(DP),
INTENT(IN) :: L2NORM0
57 real(DP),
INTENT(IN) :: EPFACT
58 integer(I4B),
DIMENSION(NEQ + 1),
INTENT(IN) :: IA0
59 integer(I4B),
DIMENSION(NJA),
INTENT(IN) :: JA0
60 real(DP),
DIMENSION(NJA),
INTENT(IN) :: A0
61 integer(I4B),
DIMENSION(NIAPC + 1),
INTENT(IN) :: IAPC
62 integer(I4B),
DIMENSION(NJAPC),
INTENT(IN) :: JAPC
63 real(DP),
DIMENSION(NJAPC),
INTENT(IN) :: APC
64 real(DP),
DIMENSION(NEQ),
INTENT(INOUT) :: X
65 real(DP),
DIMENSION(NEQ),
INTENT(INOUT) :: B
66 real(DP),
DIMENSION(NEQ),
INTENT(INOUT) :: D
67 real(DP),
DIMENSION(NEQ),
INTENT(INOUT) :: P
68 real(DP),
DIMENSION(NEQ),
INTENT(INOUT) :: Q
69 real(DP),
DIMENSION(NEQ),
INTENT(INOUT) :: Z
71 integer(I4B),
INTENT(IN) :: NJLU
72 integer(I4B),
DIMENSION(NIAPC),
INTENT(IN) :: IW
73 integer(I4B),
DIMENSION(NJLU),
INTENT(IN) :: JLU
75 integer(I4B),
INTENT(IN) :: NCONV
76 integer(I4B),
INTENT(IN) :: CONVNMOD
77 integer(I4B),
DIMENSION(CONVNMOD + 1),
INTENT(INOUT) :: CONVMODSTART
78 character(len=31),
DIMENSION(NCONV),
INTENT(INOUT) :: CACCEL
83 character(len=31) :: cval
86 integer(I4B) :: xloc, rloc
87 integer(I4B) :: im, im0, im1
94 real(DP) :: denominator
95 real(DP) :: alpha, beta
104 inner:
DO iiter = 1, itmax
105 innerit = innerit + 1
106 summary%iter_cnt = summary%iter_cnt + 1
117 CALL lusol(neq, d, z, apc, jlu, iw)
119 rho = ddot(neq, d, 1, z, 1)
129 p(n) = z(n) + beta * p(n)
136 call amux(neq, p, q, a0, ja0, ia0)
137 denominator = ddot(neq, p, 1, q, 1)
138 denominator = denominator + sign(
dprec, denominator)
139 alpha = rho / denominator
146 summary%locdv(im) = 0
147 summary%dvmax(im) =
dzero
149 summary%rmax(im) =
dzero
152 im0 = convmodstart(1)
153 im1 = convmodstart(2)
159 im0 = convmodstart(im)
160 im1 = convmodstart(im + 1)
166 IF (iscl /= 0) tv = tv * hscale(n)
167 IF (abs(tv) > abs(deltax))
THEN
171 IF (abs(tv) > abs(summary%dvmax(im)))
THEN
172 summary%dvmax(im) = tv
173 summary%locdv(im) = n
176 tv = tv - alpha * q(n)
178 IF (iscl /= 0) tv = tv * rscale(n)
179 IF (abs(tv) > abs(rmax))
THEN
183 IF (abs(tv) > abs(summary%rmax(im)))
THEN
184 summary%rmax(im) = tv
187 l2norm = l2norm + tv * tv
189 l2norm = sqrt(l2norm)
194 WRITE (cval,
'(g15.7)') alpha
196 summary%itinner(n) = iiter
198 summary%convlocdv(im, n) = summary%locdv(im)
199 summary%convlocr(im, n) = summary%locr(im)
200 summary%convdvmax(im, n) = summary%dvmax(im)
201 summary%convrmax(im, n) = summary%rmax(im)
206 IF (icnvgopt == 2 .OR. icnvgopt == 3 .OR. icnvgopt == 4)
THEN
213 l2norm0, epfact, dvclose, rclose)
216 IF (rcnvg ==
dzero) icnvg = 1
219 IF (icnvg .NE. 0)
EXIT inner
229 lorth = mod(iiter + 1, north) == 0
236 if (rho ==
dzero)
then
245 IF (icnvg < 0) icnvg = 0
256 NEQ, NJA, NIAPC, NJAPC, &
257 IPC, ICNVGOPT, NORTH, ISCL, RSCALE, HSCALE, &
258 DVCLOSE, RCLOSE, L2NORM0, EPFACT, &
259 IA0, JA0, A0, IAPC, JAPC, APC, &
261 T, V, DHAT, PHAT, QHAT, &
263 NCONV, CONVNMOD, CONVMODSTART, &
266 integer(I4B),
INTENT(INOUT) :: ICNVG
267 integer(I4B),
INTENT(IN) :: ITMAX
268 integer(I4B),
INTENT(INOUT) :: INNERIT
269 integer(I4B),
INTENT(IN) :: NEQ
270 integer(I4B),
INTENT(IN) :: NJA
271 integer(I4B),
INTENT(IN) :: NIAPC
272 integer(I4B),
INTENT(IN) :: NJAPC
273 integer(I4B),
INTENT(IN) :: IPC
274 integer(I4B),
INTENT(IN) :: ICNVGOPT
275 integer(I4B),
INTENT(IN) :: NORTH
276 integer(I4B),
INTENT(IN) :: ISCL
277 real(DP),
DIMENSION(*),
INTENT(IN) :: RSCALE
278 real(DP),
DIMENSION(*),
INTENT(IN) :: HSCALE
279 real(DP),
INTENT(IN) :: DVCLOSE
280 real(DP),
INTENT(IN) :: RCLOSE
281 real(DP),
INTENT(IN) :: L2NORM0
282 real(DP),
INTENT(IN) :: EPFACT
283 integer(I4B),
DIMENSION(NEQ + 1),
INTENT(IN) :: IA0
284 integer(I4B),
DIMENSION(NJA),
INTENT(IN) :: JA0
285 real(DP),
DIMENSION(NJA),
INTENT(IN) :: A0
286 integer(I4B),
DIMENSION(NIAPC + 1),
INTENT(IN) :: IAPC
287 integer(I4B),
DIMENSION(NJAPC),
INTENT(IN) :: JAPC
288 real(DP),
DIMENSION(NJAPC),
INTENT(IN) :: APC
289 real(DP),
DIMENSION(NEQ),
INTENT(INOUT) :: X
290 real(DP),
DIMENSION(NEQ),
INTENT(IN) :: B
291 real(DP),
DIMENSION(NEQ),
INTENT(INOUT) :: D
292 real(DP),
DIMENSION(NEQ),
INTENT(INOUT) :: P
293 real(DP),
DIMENSION(NEQ),
INTENT(INOUT) :: Q
294 real(DP),
DIMENSION(NEQ),
INTENT(INOUT) :: T
295 real(DP),
DIMENSION(NEQ),
INTENT(INOUT) :: V
296 real(DP),
DIMENSION(NEQ),
INTENT(INOUT) :: DHAT
297 real(DP),
DIMENSION(NEQ),
INTENT(INOUT) :: PHAT
298 real(DP),
DIMENSION(NEQ),
INTENT(INOUT) :: QHAT
300 integer(I4B),
INTENT(IN) :: NJLU
301 integer(I4B),
DIMENSION(NIAPC),
INTENT(IN) :: IW
302 integer(I4B),
DIMENSION(NJLU),
INTENT(IN) :: JLU
304 integer(I4B),
INTENT(IN) :: NCONV
305 integer(I4B),
INTENT(IN) :: CONVNMOD
306 integer(I4B),
DIMENSION(CONVNMOD + 1),
INTENT(INOUT) :: CONVMODSTART
307 character(len=31),
DIMENSION(NCONV),
INTENT(INOUT) :: CACCEL
312 character(len=15) :: cval1, cval2
314 integer(I4B) :: iiter
315 integer(I4B) :: xloc, rloc
316 integer(I4B) :: im, im0, im1
323 real(DP) :: alpha, alpha0
325 real(DP) :: rho, rho0
326 real(DP) :: omega, omega0
327 real(DP) :: numerator, denominator
345 inner:
DO iiter = 1, itmax
346 innerit = innerit + 1
347 summary%iter_cnt = summary%iter_cnt + 1
350 rho = ddot(neq, dhat, 1, d, 1)
358 beta = (rho / rho0) * (alpha0 / omega0)
360 p(n) = d(n) + beta * (p(n) - omega0 * v(n))
373 CALL lusol(neq, p, phat, apc, jlu, iw)
379 call amux(neq, phat, v, a0, ja0, ia0)
382 denominator = ddot(neq, dhat, 1, v, 1)
383 denominator = denominator + sign(
dprec, denominator)
384 alpha = rho / denominator
388 q(n) = d(n) - alpha * v(n)
424 CALL lusol(neq, q, qhat, apc, jlu, iw)
428 call amux(neq, qhat, t, a0, ja0, ia0)
431 numerator = ddot(neq, t, 1, q, 1)
432 denominator = ddot(neq, t, 1, t, 1)
433 denominator = denominator + sign(
dprec, denominator)
434 omega = numerator / denominator
441 summary%dvmax(im) =
dzero
442 summary%rmax(im) =
dzero
445 im0 = convmodstart(1)
446 im1 = convmodstart(2)
452 im0 = convmodstart(im)
453 im1 = convmodstart(im + 1)
457 tv = alpha * phat(n) + omega * qhat(n)
459 IF (iscl .NE. 0)
THEN
462 IF (abs(tv) > abs(deltax))
THEN
466 IF (abs(tv) > abs(summary%dvmax(im)))
THEN
467 summary%dvmax(im) = tv
468 summary%locdv(im) = n
472 tv = q(n) - omega * t(n)
474 IF (iscl .NE. 0)
THEN
477 IF (abs(tv) > abs(rmax))
THEN
481 IF (abs(tv) > abs(summary%rmax(im)))
THEN
482 summary%rmax(im) = tv
485 l2norm = l2norm + tv * tv
487 l2norm = sqrt(l2norm)
492 WRITE (cval1,
'(g15.7)') alpha
493 WRITE (cval2,
'(g15.7)') omega
494 caccel(n) = trim(adjustl(cval1))//
','//trim(adjustl(cval2))
495 summary%itinner(n) = iiter
497 summary%convdvmax(im, n) = summary%dvmax(im)
498 summary%convlocdv(im, n) = summary%locdv(im)
499 summary%convrmax(im, n) = summary%rmax(im)
500 summary%convlocr(im, n) = summary%locr(im)
505 IF (icnvgopt == 2 .OR. icnvgopt == 3 .OR. icnvgopt == 4)
THEN
512 l2norm0, epfact, dvclose, rclose)
515 IF (rcnvg ==
dzero) icnvg = 1
518 IF (icnvg .NE. 0)
EXIT inner
537 lorth = mod(iiter + 1, north) == 0
544 if (rho * omega ==
dzero)
then
555 IF (icnvg < 0) icnvg = 0
567 integer(I4B),
INTENT(IN) :: IORD
568 integer(I4B),
INTENT(IN) :: NEQ
569 integer(I4B),
INTENT(IN) :: NJA
570 integer(I4B),
DIMENSION(NEQ + 1),
INTENT(IN) :: IA
571 integer(I4B),
DIMENSION(NJA),
INTENT(IN) :: JA
572 integer(I4B),
DIMENSION(NEQ),
INTENT(INOUT) :: LORDER
573 integer(I4B),
DIMENSION(NEQ),
INTENT(INOUT) :: IORDER
575 character(len=LINELENGTH) :: errmsg
578 integer(I4B),
DIMENSION(:),
ALLOCATABLE :: iwork0
579 integer(I4B),
DIMENSION(:),
ALLOCATABLE :: iwork1
580 integer(I4B) :: iflag
590 CALL genrcm(neq, nja, ia, ja, lorder)
592 nsp = 3 * neq + 4 * nja
593 allocate (iwork0(neq))
594 allocate (iwork1(nsp))
595 CALL ims_odrv(neq, nja, nsp, ia, ja, lorder, iwork0, &
597 IF (iflag .NE. 0)
THEN
598 write (errmsg,
'(A,1X,A)') &
599 'IMSLINEARSUB_CALC_ORDER error creating minimum degree ', &
605 deallocate (iwork0, iwork1)
610 iorder(lorder(n)) = n
615 call parser%StoreErrorUnit()
629 integer(I4B),
INTENT(IN) :: IOPT
630 integer(I4B),
INTENT(IN) :: ISCL
631 integer(I4B),
INTENT(IN) :: NEQ
632 integer(I4B),
INTENT(IN) :: NJA
633 integer(I4B),
DIMENSION(NEQ + 1),
INTENT(IN) :: IA
634 integer(I4B),
DIMENSION(NJA),
INTENT(IN) :: JA
635 real(DP),
DIMENSION(NJA),
INTENT(INOUT) :: AMAT
636 real(DP),
DIMENSION(NEQ),
INTENT(INOUT) :: X
637 real(DP),
DIMENSION(NEQ),
INTENT(INOUT) :: B
638 real(DP),
DIMENSION(NEQ),
INTENT(INOUT) :: DSCALE
639 real(DP),
DIMENSION(NEQ),
INTENT(INOUT) :: DSCALE2
642 integer(I4B) :: id, jc
643 integer(I4B) :: i0, i1
644 real(DP) :: v, c1, c2
655 c1 =
done / sqrt(abs(v))
668 amat(i) = c1 * amat(i) * c2
681 c1 = c1 + amat(i) * amat(i)
684 IF (c1 ==
dzero)
THEN
693 amat(i) = c1 * amat(i)
708 dscale2(jc) = dscale2(jc) + c2 * c2
713 IF (c2 ==
dzero)
THEN
728 amat(i) = c2 * amat(i)
752 amat(i) = (
done / c1) * amat(i) * (
done / c2)
769 integer(I4B),
INTENT(IN) :: NEQ
770 integer(I4B),
INTENT(IN) :: IORD
771 real(DP),
DIMENSION(NEQ),
INTENT(IN) :: DSCALE
772 real(DP),
DIMENSION(NEQ),
INTENT(IN) :: DSCALE2
773 integer(I4B),
DIMENSION(*),
INTENT(INOUT) :: LORDER
774 real(DP),
DIMENSION(NEQ),
INTENT(INOUT) :: RSCALE
775 real(DP),
DIMENSION(NEQ),
INTENT(INOUT) :: HSCALE
780 rscale(n) =
done / dscale(n)
781 hscale(n) = dscale2(n)
784 CALL dvperm(neq, rscale, lorder)
785 CALL dvperm(neq, hscale, lorder)
795 AMAT, IA, JA, APC, IAPC, JAPC, IW, W, &
796 LEVEL, DROPTOL, NJLU, NJW, NWLU, JLU, JW, WLU)
800 integer(I4B),
INTENT(IN) :: IOUT
801 integer(I4B),
INTENT(IN) :: NJA
802 integer(I4B),
INTENT(IN) :: NEQ
803 integer(I4B),
INTENT(IN) :: NIAPC
804 integer(I4B),
INTENT(IN) :: NJAPC
805 integer(I4B),
INTENT(IN) :: IPC
806 real(DP),
INTENT(IN) :: RELAX
807 real(DP),
DIMENSION(NJA),
INTENT(IN) :: AMAT
808 integer(I4B),
DIMENSION(NEQ + 1),
INTENT(IN) :: IA
809 integer(I4B),
DIMENSION(NJA),
INTENT(IN) :: JA
810 real(DP),
DIMENSION(NJAPC),
INTENT(INOUT) :: APC
811 integer(I4B),
DIMENSION(NIAPC + 1),
INTENT(INOUT) :: IAPC
812 integer(I4B),
DIMENSION(NJAPC),
INTENT(INOUT) :: JAPC
813 integer(I4B),
DIMENSION(NIAPC),
INTENT(INOUT) :: IW
814 real(DP),
DIMENSION(NIAPC),
INTENT(INOUT) :: W
816 integer(I4B),
INTENT(IN) :: LEVEL
817 real(DP),
INTENT(IN) :: DROPTOL
818 integer(I4B),
INTENT(IN) :: NJLU
819 integer(I4B),
INTENT(IN) :: NJW
820 integer(I4B),
INTENT(IN) :: NWLU
821 integer(I4B),
DIMENSION(NJLU),
INTENT(INOUT) :: JLU
822 integer(I4B),
DIMENSION(NJW),
INTENT(INOUT) :: JW
823 real(DP),
DIMENSION(NWLU),
INTENT(INOUT) :: WLU
825 character(len=LINELENGTH) :: errmsg
826 character(len=100),
dimension(5),
parameter :: cerr = &
827 [
"Elimination process has generated a row in L or U whose length is > n.", &
828 &
"The matrix L overflows the array al. ", &
829 &
"The matrix U overflows the array alu. ", &
830 &
"Illegal value for lfil. ", &
831 &
"Zero row encountered. "]
832 integer(i4b) :: ipcflag
833 integer(I4B) :: icount
836 real(DP) :: relax_used
8382000
FORMAT(/,
' MATRIX IS SEVERELY NON-DIAGONALLY DOMINANT.', &
839 /,
' ADDED SMALL VALUE TO PIVOT ', i0,
' TIMES IN', &
840 ' IMSLINEARSUB_PCU.')
853 apc, iapc, japc, iw, w, &
854 relax_used, ipcflag, delta)
859 CALL ilut(neq, amat, ja, ia, level, droptol, &
860 apc, jlu, iw, njapc, wlu, jw, ierr, &
861 relax_used, ipcflag, delta)
864 write (errmsg,
'(a,1x,i0,1x,a)') &
865 'ILUT: zero pivot encountered at step number', ierr,
'.'
867 write (errmsg,
'(a,1x,a)')
'ILUT:', cerr(-ierr)
870 call parser%StoreErrorUnit()
877 IF (ipcflag < 1)
THEN
883 if (relax_used >
dzero)
then
888 delta = 1.5d0 * delta +
dem3
890 IF (delta >
dhalf)
THEN
897 if (icount == 10)
then
902 if (icount > 10)
then
910 write (iout, 2000) icount
922 integer(I4B),
INTENT(IN) :: NJA
923 integer(I4B),
INTENT(IN) :: NEQ
924 real(DP),
DIMENSION(NJA),
INTENT(IN) :: AMAT
925 real(DP),
DIMENSION(NEQ),
INTENT(INOUT) :: APC
926 integer(I4B),
DIMENSION(NEQ + 1),
INTENT(IN) :: IA
927 integer(I4B),
DIMENSION(NJA),
INTENT(IN) :: JA
930 integer(I4B) :: ic0, ic1
957 integer(I4B),
INTENT(IN) :: NEQ
958 real(DP),
DIMENSION(NEQ),
INTENT(IN) :: A
959 real(DP),
DIMENSION(NEQ),
INTENT(IN) :: D1
960 real(DP),
DIMENSION(NEQ),
INTENT(INOUT) :: D2
977 APC, IAPC, JAPC, IW, W, &
978 RELAX, IPCFLAG, DELTA)
980 integer(I4B),
INTENT(IN) :: NJA
981 integer(I4B),
INTENT(IN) :: NEQ
982 real(DP),
DIMENSION(NJA),
INTENT(IN) :: AMAT
983 integer(I4B),
DIMENSION(NEQ + 1),
INTENT(IN) :: IA
984 integer(I4B),
DIMENSION(NJA),
INTENT(IN) :: JA
985 real(DP),
DIMENSION(NJA),
INTENT(INOUT) :: APC
986 integer(I4B),
DIMENSION(NEQ + 1),
INTENT(INOUT) :: IAPC
987 integer(I4B),
DIMENSION(NJA),
INTENT(INOUT) :: JAPC
988 integer(I4B),
DIMENSION(NEQ),
INTENT(INOUT) :: IW
989 real(DP),
DIMENSION(NEQ),
INTENT(INOUT) :: W
990 real(DP),
INTENT(IN) :: RELAX
991 integer(I4B),
INTENT(INOUT) :: IPCFLAG
992 real(DP),
INTENT(IN) :: DELTA
994 integer(I4B) :: ic0, ic1
995 integer(I4B) :: iic0, iic1
996 integer(I4B) :: iu, iiu
999 integer(I4B) :: jcol, jw
1000 integer(I4B) :: jjcol
1019 w(jcol) = w(jcol) + amat(j)
1022 ic1 = iapc(n + 1) - 1
1025 lower:
DO j = ic0, iu - 1
1028 iic1 = iapc(jcol + 1) - 1
1030 tl = w(jcol) * apc(jcol)
1036 w(jjcol) = w(jjcol) - tl * apc(jj)
1038 rs = rs + tl * apc(jj)
1045 tl = (
done + delta) * d - (drelax * rs)
1049 IF (sd1 .NE. d)
THEN
1053 IF (ipcflag > 1)
THEN
1062 IF (abs(tl) ==
dzero)
THEN
1066 IF (ipcflag > 1)
THEN
1093 DO j = japc(n), iapc(n + 1) - 1
1094 apc(j) = apc(j) * apc(n)
1108 integer(I4B),
INTENT(IN) :: NJA
1109 integer(I4B),
INTENT(IN) :: NEQ
1110 real(DP),
DIMENSION(NJA),
INTENT(IN) :: APC
1111 integer(I4B),
DIMENSION(NEQ + 1),
INTENT(IN) :: IAPC
1112 integer(I4B),
DIMENSION(NJA),
INTENT(IN) :: JAPC
1113 real(DP),
DIMENSION(NEQ),
INTENT(IN) :: R
1114 real(DP),
DIMENSION(NEQ),
INTENT(INOUT) :: D
1116 integer(I4B) :: ic0, ic1
1118 integer(I4B) :: jcol
1119 integer(I4B) :: j, n
1123 forward:
DO n = 1, neq
1126 ic1 = iapc(n + 1) - 1
1128 lower:
DO j = ic0, iu
1130 tv = tv - apc(j) * d(jcol)
1137 backward:
DO n = neq, 1, -1
1138 ic1 = iapc(n + 1) - 1
1141 upper:
DO j = ic1, iu, -1
1143 tv = tv - apc(j) * d(jcol)
1158 Rmax0, Epfact, Dvclose, Rclose)
1160 integer(I4B),
INTENT(IN) :: Icnvgopt
1161 integer(I4B),
INTENT(INOUT) :: Icnvg
1162 integer(I4B),
INTENT(IN) :: Iiter
1163 real(DP),
INTENT(IN) :: Dvmax
1164 real(DP),
INTENT(IN) :: Rmax
1165 real(DP),
INTENT(IN) :: Rmax0
1166 real(DP),
INTENT(IN) :: Epfact
1167 real(DP),
INTENT(IN) :: Dvclose
1168 real(DP),
INTENT(IN) :: Rclose
1170 IF (icnvgopt == 0)
THEN
1171 IF (abs(dvmax) <= dvclose .AND. abs(rmax) <= rclose)
THEN
1174 ELSE IF (icnvgopt == 1)
THEN
1175 IF (abs(dvmax) <= dvclose .AND. abs(rmax) <= rclose)
THEN
1176 IF (iiter == 1)
THEN
1182 ELSE IF (icnvgopt == 2)
THEN
1183 IF (abs(dvmax) <= dvclose .OR. rmax <= rclose)
THEN
1185 ELSE IF (rmax <= rmax0 * epfact)
THEN
1188 ELSE IF (icnvgopt == 3)
THEN
1189 IF (abs(dvmax) <= dvclose)
THEN
1191 ELSE IF (rmax <= rmax0 * rclose)
THEN
1194 ELSE IF (icnvgopt == 4)
THEN
1195 IF (abs(dvmax) <= dvclose .AND. rmax <= rclose)
THEN
1197 ELSE IF (rmax <= rmax0 * epfact)
THEN
1204 niapc, njapc, njlu, njw, nwlu)
1205 integer(I4B),
intent(in) :: neq
1206 integer(I4B),
intent(in) :: nja
1207 integer(I4B),
dimension(:),
intent(in) :: ia
1208 integer(I4B),
intent(in) :: level
1209 integer(I4B),
intent(in) :: ipc
1210 integer(I4B),
intent(inout) :: niapc
1211 integer(I4B),
intent(inout) :: njapc
1212 integer(I4B),
intent(inout) :: njlu
1213 integer(I4B),
intent(inout) :: njw
1214 integer(I4B),
intent(inout) :: nwlu
1216 integer(I4B) :: n, i
1217 integer(I4B) :: ijlu, ijw, iwlu, iwk
1228 if (ipc == 3 .or. ipc == 4)
then
1231 iwk = neq * (level * 2 + 1)
1235 i = ia(n + 1) - ia(n)
1265 integer(I4B),
INTENT(IN) :: NEQ
1266 integer(I4B),
INTENT(IN) :: NJA
1267 integer(I4B),
DIMENSION(NEQ + 1),
INTENT(IN) :: IA
1268 integer(I4B),
DIMENSION(NJA),
INTENT(IN) :: JA
1269 integer(I4B),
DIMENSION(NEQ + 1),
INTENT(INOUT) :: IAPC
1270 integer(I4B),
DIMENSION(NJA),
INTENT(INOUT) :: JAPC
1272 integer(I4B) :: n, j
1273 integer(I4B) :: i0, i1
1274 integer(I4B) :: nlen
1275 integer(I4B) :: ic, ip
1276 integer(I4B) :: jcol
1277 integer(I4B),
DIMENSION(:),
ALLOCATABLE :: iarr
1284 ALLOCATE (iarr(nlen))
1288 IF (jcol == n) cycle
1301 iapc(neq + 1) = nja + 1
1306 i1 = iapc(n + 1) - 1
1307 japc(n) = iapc(n + 1)
1325 integer(I4B),
INTENT(IN) :: NVAL
1326 integer(I4B),
DIMENSION(NVAL),
INTENT(INOUT) :: IARRAY
1328 integer(I4B) :: i, j, itemp
1332 if (iarray(i) > iarray(j))
then
1334 iarray(j) = iarray(i)
1348 integer(I4B),
INTENT(IN) :: NEQ
1349 integer(I4B),
INTENT(IN) :: NJA
1350 real(DP),
DIMENSION(NEQ),
INTENT(IN) :: X
1351 real(DP),
DIMENSION(NEQ),
INTENT(IN) :: B
1352 real(DP),
DIMENSION(NEQ),
INTENT(INOUT) :: D
1353 real(DP),
DIMENSION(NJA),
INTENT(IN) :: A
1354 integer(I4B),
DIMENSION(NEQ + 1),
INTENT(IN) :: IA
1355 integer(I4B),
DIMENSION(NJA),
INTENT(IN) :: JA
1361 call amux(neq, x, d, a, ja, ia)
1372 integer(I4B) :: icnvgopt
1373 integer(I4B) :: kstp
1376 if (icnvgopt == 2)
then
1382 else if (icnvgopt == 4)
then
subroutine ilut(n, a, ja, ia, lfil, droptol, alu, jlu, ju, iwk, w, jw, ierr, relax, izero, delta)
subroutine lusol(n, y, x, alu, jlu, ju)
This module contains block parser methods.
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
real(dp), parameter dhalf
real constant 1/2
real(dp), parameter dem3
real constant 1e-3
integer(i4b), parameter izero
integer constant zero
real(dp), parameter dem4
real constant 1e-4
real(dp), parameter dem6
real constant 1e-6
real(dp), parameter dzero
real constant zero
real(dp), parameter dprec
real constant machine precision
real(dp), parameter done
real constant 1
This module contains the IMS linear accelerator subroutines.
subroutine ims_base_pcjac(nja, neq, amat, apc, ia, ja)
Jacobi preconditioner.
subroutine ims_base_pcu(iout, nja, neq, niapc, njapc, ipc, relax, amat, ia, ja, apc, iapc, japc, iw, w, level, droptol, njlu, njw, nwlu, jlu, jw, wlu)
Update the preconditioner.
subroutine ims_calc_pcdims(neq, nja, ia, level, ipc, niapc, njapc, njlu, njw, nwlu)
subroutine ims_base_testcnvg(icnvgopt, icnvg, iiter, dvmax, rmax, rmax0, epfact, dvclose, rclose)
Test for solver convergence.
subroutine ims_base_isort(nval, iarray)
In-place sorting for an integer array.
subroutine ims_base_pcilu0(nja, neq, amat, ia, ja, apc, iapc, japc, iw, w, relax, ipcflag, delta)
Update the ILU0 preconditioner.
real(dp) function ims_base_epfact(icnvgopt, kstp)
Function returning EPFACT.
subroutine ims_base_jaca(neq, a, d1, d2)
Apply the Jacobi preconditioner.
subroutine ims_base_residual(neq, nja, x, b, d, a, ia, ja)
Calculate residual.
subroutine ims_base_ilu0a(nja, neq, apc, iapc, japc, r, d)
Apply the ILU0 and MILU0 preconditioners.
subroutine ims_base_cnvg_scale(neq, iord, dscale, dscale2, lorder, rscale, hscale)
Set the factors that return the residual and head change to model units, in the order of the reordere...
subroutine ims_base_cg(icnvg, itmax, innerit, neq, nja, niapc, njapc, ipc, icnvgopt, north, iscl, rscale, hscale, dvclose, rclose, l2norm0, epfact, ia0, ja0, a0, iapc, japc, apc, x, b, d, p, q, z, njlu, iw, jlu, nconv, convnmod, convmodstart, caccel, summary)
Preconditioned Conjugate Gradient linear accelerator.
type(blockparsertype), private parser
subroutine ims_base_calc_order(iord, neq, nja, ia, ja, lorder, iorder)
Calculate LORDER AND IORDER.
subroutine ims_base_bcgs(icnvg, itmax, innerit, neq, nja, niapc, njapc, ipc, icnvgopt, north, iscl, rscale, hscale, dvclose, rclose, l2norm0, epfact, ia0, ja0, a0, iapc, japc, apc, x, b, d, p, q, t, v, dhat, phat, qhat, njlu, iw, jlu, nconv, convnmod, convmodstart, caccel, summary)
Preconditioned BiConjugate Gradient Stabilized linear accelerator.
subroutine ims_base_scale(iopt, iscl, neq, nja, ia, ja, amat, x, b, dscale, dscale2)
Scale the coefficient matrix.
subroutine ims_base_pccrs(neq, nja, ia, ja, iapc, japc)
Generate CRS pointers for the preconditioner.
@ ipc_ilut
ILUT (incomplete LU with threshold).
@ ipc_ilu0
ILU0 (incomplete LU, zero fill).
subroutine, public ims_odrv(n, nja, nsp, ia, ja, p, ip, isp, flag)
This module defines variable data types.
pure logical function, public is_close(a, b, rtol, atol, symmetric)
Check if a real value is approximately equal to another.
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
integer(i4b) function, public count_errors()
Return number of errors.
subroutine genrcm(node_num, adj_num, adj_row, adj, perm)
subroutine amux(n, x, y, a, ja, ia)
subroutine dvperm(n, x, perm)
This structure stores the generic convergence info for a solution.