1 SUBROUTINE ddassl (RES, NEQ, T, Y, YPRIME, TOUT, INFO, RTOL, ATOL,
2 + IDID, RWORK, LRW, IWORK, LIW, RPAR, IPAR, JAC)
931 INTEGER NEQ, INFO(15), IDID, LRW, IWORK(*), LIW, IPAR(*)
933 * t, y(*), yprime(*), tout, rtol(*), atol(*), rwork(*),
940 DOUBLE PRECISION D1MACH, DDANRM
944 INTEGER I, ITEMP, LALPHA, LBETA, LCJ, LCJOLD, LCTF, LDELTA,
945 * leniw, lenpd, lenrw, le, letf,
lgamma, lh, lhmax, lhold,
947 * ljcalc, lk, lkold, liwm, lml, lmtype, lmu, lmxord, lnje, lnpd,
948 * lnre, lns, lnst, lnstl, lpd, lphase, lphi, lpsi, lround, ls,
949 * lsigma, ltn, ltstop, lwm, lwt, mband, msave, mxord, npd, ntemp,
952 * atoli, h, hmax, hmin, ho, r, rh, rtoli, tdist, tn, tnext,
953 * tstop, uround, ypnorm
957 CHARACTER*8 XERN1, XERN2
958 CHARACTER*16 XERN3, XERN4
961 parameter(lml=1, lmu=2, lmxord=3, lmtype=4, lnst=11,
962 * lnre=12, lnje=13, letf=14, lctf=15, lnpd=16, lmxstp=21,
963 * lipvt=22, ljcalc=5, lphase=6, lk=7, lkold=8,
964 * lns=9, lnstl=10, liwm=1)
970 parameter(ltstop=1, lhmax=2, lh=3, ltn=4,
971 * lcj=5, lcjold=6, lhold=7, ls=8, lround=9,
972 * lalpha=11, lbeta=17,
lgamma=23,
973 * lpsi=29, lsigma=35, ldelta=41)
976 IF(info(1).NE.0)
GO TO 100
986 IF(info(i).NE.0.AND.info(i).NE.1)
GO TO 701
989 IF(neq.LE.0)
GO TO 702
993 IF(info(9).EQ.0)
GO TO 20
995 IF(mxord.LT.1.OR.mxord.GT.5)
GO TO 703
996 20 iwork(lmxord)=mxord
999 IF(info(6).NE.0)
GO TO 40
1001 lenrw=40+(iwork(lmxord)+4)*neq+lenpd
1002 IF(info(5).NE.0)
GO TO 30
1007 40
IF(iwork(lml).LT.0.OR.iwork(lml).GE.neq)
GO TO 717
1008 IF(iwork(lmu).LT.0.OR.iwork(lmu).GE.neq)
GO TO 718
1009 lenpd=(2*iwork(lml)+iwork(lmu)+1)*neq
1010 IF(info(5).NE.0)
GO TO 50
1012 mband=iwork(lml)+iwork(lmu)+1
1014 lenrw=40+(iwork(lmxord)+4)*neq+lenpd+2*msave
1017 lenrw=40+(iwork(lmxord)+4)*neq+lenpd
1022 IF(lrw.LT.lenrw)
GO TO 704
1023 IF(liw.LT.leniw)
GO TO 705
1026 IF(tout .EQ. t)
GO TO 719
1029 IF(info(7).EQ.0)
GO TO 70
1031 IF(hmax.LE.0.0d0)
GO TO 710
1036 IF(info(12).EQ.0)
GO TO 80
1038 IF(mxstp.LT.0)
GO TO 716
1039 80 iwork(lmxstp)=mxstp
1058 IF(info(1).EQ.1)
GO TO 110
1059 IF(info(1).NE.-1)
GO TO 701
1065 WRITE (xern1,
'(I8)') idid
1066 CALL xermsg (
'SLATEC',
'DDASSL',
1067 *
'THE LAST STEP TERMINATED WITH A NEGATIVE VALUE OF IDID = ' //
1068 * xern1 //
' AND NO APPROPRIATE ACTION WAS TAKEN. ' //
1069 *
'RUN TERMINATED', -998, 2)
1072 iwork(lnstl)=iwork(lnst)
1087 IF(info(2).EQ.1)rtoli=rtol(i)
1088 IF(info(2).EQ.1)atoli=atol(i)
1089 IF(rtoli.GT.0.0d0.OR.atoli.GT.0.0d0)nzflg=1
1090 IF(rtoli.LT.0.0d0)
GO TO 706
1091 IF(atoli.LT.0.0d0)
GO TO 707
1093 IF(nzflg.EQ.0)
GO TO 708
1100 lpd=lphi+(iwork(lmxord)+1)*neq
1102 ntemp=npd+iwork(lnpd)
1103 IF(info(1).EQ.1)
GO TO 400
1116 CALL ddawts(neq,info(2),rtol,atol,y,rwork(lwt),rpar,ipar)
1118 IF(rwork(lwt+i-1).LE.0.0d0)
GO TO 713
1123 rwork(lround) = uround
1124 hmin = 4.0d0*uround*
max(abs(t),abs(tout))
1127 tdist = abs(tout - t)
1128 IF(tdist .LT. hmin)
GO TO 714
1131 IF (info(8) .EQ. 0)
GO TO 310
1133 IF ((tout - t)*ho .LT. 0.0d0)
GO TO 711
1134 IF (ho .EQ. 0.0d0)
GO TO 712
1141 ypnorm = ddanrm(neq,yprime,rwork(lwt),rpar,ipar)
1142 IF (ypnorm .GT. 0.5d0/ho) ho = 0.5d0/ypnorm
1143 ho = sign(ho,tout-t)
1145 320
IF (info(7) .EQ. 0)
GO TO 330
1146 rh = abs(ho)/rwork(lhmax)
1147 IF (rh .GT. 1.0d0) ho = ho/rh
1149 330
IF (info(4) .EQ. 0)
GO TO 340
1150 tstop = rwork(ltstop)
1151 IF ((tstop - t)*ho .LT. 0.0d0)
GO TO 715
1152 IF ((t + ho - tstop)*ho .GT. 0.0d0) ho = tstop - t
1153 IF ((tstop - tout)*ho .LT. 0.0d0)
GO TO 709
1156 340
IF (info(11) .EQ. 0)
GO TO 350
1157 CALL ddaini(tn,y,yprime,neq,
1158 * res,jac,ho,rwork(lwt),idid,rpar,ipar,
1159 * rwork(lphi),rwork(ldelta),rwork(le),
1160 * rwork(lwm),iwork(liwm),hmin,rwork(lround),
1162 IF (idid .LT. 0)
GO TO 390
1171 rwork(lphi + i - 1) = y(i)
1172 370 rwork(itemp + i - 1) = h*yprime(i)
1184 uround=rwork(lround)
1188 IF(info(7) .EQ. 0)
GO TO 410
1189 rh = abs(h)/rwork(lhmax)
1190 IF(rh .GT. 1.0d0) h = h/rh
1192 IF(t .EQ. tout)
GO TO 719
1193 IF((t - tout)*h .GT. 0.0d0)
GO TO 711
1194 IF(info(4) .EQ. 1)
GO TO 430
1195 IF(info(3) .EQ. 1)
GO TO 420
1196 IF((tn-tout)*h.LT.0.0d0)
GO TO 490
1197 CALL ddatrp(tn,tout,y,yprime,neq,iwork(lkold),
1198 * rwork(lphi),rwork(lpsi))
1203 420
IF((tn-t)*h .LE. 0.0d0)
GO TO 490
1204 IF((tn - tout)*h .GT. 0.0d0)
GO TO 425
1205 CALL ddatrp(tn,tn,y,yprime,neq,iwork(lkold),
1206 * rwork(lphi),rwork(lpsi))
1212 CALL ddatrp(tn,tout,y,yprime,neq,iwork(lkold),
1213 * rwork(lphi),rwork(lpsi))
1218 430
IF(info(3) .EQ. 1)
GO TO 440
1220 IF((tn-tstop)*h.GT.0.0d0)
GO TO 715
1221 IF((tstop-tout)*h.LT.0.0d0)
GO TO 709
1222 IF((tn-tout)*h.LT.0.0d0)
GO TO 450
1223 CALL ddatrp(tn,tout,y,yprime,neq,iwork(lkold),
1224 * rwork(lphi),rwork(lpsi))
1229 440 tstop = rwork(ltstop)
1230 IF((tn-tstop)*h .GT. 0.0d0)
GO TO 715
1231 IF((tstop-tout)*h .LT. 0.0d0)
GO TO 709
1232 IF((tn-t)*h .LE. 0.0d0)
GO TO 450
1233 IF((tn - tout)*h .GT. 0.0d0)
GO TO 445
1234 CALL ddatrp(tn,tn,y,yprime,neq,iwork(lkold),
1235 * rwork(lphi),rwork(lpsi))
1241 CALL ddatrp(tn,tout,y,yprime,neq,iwork(lkold),
1242 * rwork(lphi),rwork(lpsi))
1249 IF(abs(tn-tstop).GT.100.0d0*uround*
1250 * (abs(tn)+abs(h)))
GO TO 460
1251 CALL ddatrp(tn,tstop,y,yprime,neq,iwork(lkold),
1252 * rwork(lphi),rwork(lpsi))
1258 IF((tnext-tstop)*h.LE.0.0d0)
GO TO 490
1262 490
IF (done)
GO TO 580
1276 IF (idid .EQ. -12)
GO TO 527
1279 IF((iwork(lnst)-iwork(lnstl)).LT.iwork(lmxstp))
1285 510
CALL ddawts(neq,info(2),rtol,atol,rwork(lphi),
1286 * rwork(lwt),rpar,ipar)
1288 IF(rwork(i+lwt-1).GT.0.0d0)
GO TO 520
1294 r=ddanrm(neq,rwork(lphi),rwork(lwt),rpar,ipar)*
1296 IF(r.LE.1.0d0)
GO TO 525
1298 IF(info(2).EQ.1)
GO TO 523
1305 524 atol(i)=r*atol(i)
1311 hmin=4.0d0*uround*
max(abs(tn),abs(tout))
1314 IF (info(7) .EQ. 0)
GO TO 526
1315 rh = abs(h)/rwork(lhmax)
1316 IF (rh .GT. 1.0d0) h = h/rh
1319 CALL ddastp(tn,y,yprime,neq,
1320 * res,jac,h,rwork(lwt),info(1),idid,rpar,ipar,
1321 * rwork(lphi),rwork(ldelta),rwork(le),
1322 * rwork(lwm),iwork(liwm),
1323 * rwork(lalpha),rwork(lbeta),rwork(
lgamma),
1324 * rwork(lpsi),rwork(lsigma),
1325 * rwork(lcj),rwork(lcjold),rwork(lhold),
1326 * rwork(ls),hmin,rwork(lround),
1327 * iwork(lphase),iwork(ljcalc),iwork(lk),
1328 * iwork(lkold),iwork(lns),info(10),ntemp)
1329 527
IF(idid.LT.0)
GO TO 600
1336 IF(info(4).NE.0)
GO TO 540
1337 IF(info(3).NE.0)
GO TO 530
1338 IF((tn-tout)*h.LT.0.0d0)
GO TO 500
1339 CALL ddatrp(tn,tout,y,yprime,neq,
1340 * iwork(lkold),rwork(lphi),rwork(lpsi))
1344 530
IF((tn-tout)*h.GE.0.0d0)
GO TO 535
1348 535
CALL ddatrp(tn,tout,y,yprime,neq,
1349 * iwork(lkold),rwork(lphi),rwork(lpsi))
1353 540
IF(info(3).NE.0)
GO TO 550
1354 IF((tn-tout)*h.LT.0.0d0)
GO TO 542
1355 CALL ddatrp(tn,tout,y,yprime,neq,
1356 * iwork(lkold),rwork(lphi),rwork(lpsi))
1360 542
IF(abs(tn-tstop).LE.100.0d0*uround*
1361 * (abs(tn)+abs(h)))
GO TO 545
1363 IF((tnext-tstop)*h.LE.0.0d0)
GO TO 500
1366 545
CALL ddatrp(tn,tstop,y,yprime,neq,
1367 * iwork(lkold),rwork(lphi),rwork(lpsi))
1371 550
IF((tn-tout)*h.GE.0.0d0)
GO TO 555
1372 IF(abs(tn-tstop).LE.100.0d0*uround*(abs(tn)+abs(h)))
GO TO 552
1376 552
CALL ddatrp(tn,tstop,y,yprime,neq,
1377 * iwork(lkold),rwork(lphi),rwork(lpsi))
1381 555
CALL ddatrp(tn,tout,y,yprime,neq,
1382 * iwork(lkold),rwork(lphi),rwork(lpsi))
1404 GO TO (610,620,630,690,690,640,650,660,670,675,
1409 610
WRITE (xern3,
'(1P,D15.6)') tn
1410 CALL xermsg (
'SLATEC',
'DDASSL',
1411 *
'AT CURRENT T = ' // xern3 //
' 500 STEPS TAKEN ON THIS ' //
1412 *
'CALL BEFORE REACHING TOUT', idid, 1)
1416 620
WRITE (xern3,
'(1P,D15.6)') tn
1417 CALL xermsg (
'SLATEC',
'DDASSL',
1418 *
'AT T = ' // xern3 //
' TOO MUCH ACCURACY REQUESTED FOR ' //
1419 *
'PRECISION OF MACHINE. RTOL AND ATOL WERE INCREASED TO ' //
1420 *
'APPROPRIATE VALUES', idid, 1)
1424 630
WRITE (xern3,
'(1P,D15.6)') tn
1425 CALL xermsg (
'SLATEC',
'DDASSL',
1426 *
'AT T = ' // xern3 // .LE.
' SOME ELEMENT OF WT HAS BECOME ' //
1431 640
WRITE (xern3,
'(1P,D15.6)') tn
1432 WRITE (xern4,
'(1P,D15.6)') h
1433 CALL xermsg (
'SLATEC',
'DDASSL',
1434 *
'AT T = ' // xern3 //
' AND STEPSIZE H = ' // xern4 //
1435 *
' THE ERROR TEST FAILED REPEATEDLY OR WITH ABS(H)=HMIN',
1440 650
WRITE (xern3,
'(1P,D15.6)') tn
1441 WRITE (xern4,
'(1P,D15.6)') h
1442 CALL xermsg (
'SLATEC',
'DDASSL',
1443 *
'AT T = ' // xern3 //
' AND STEPSIZE H = ' // xern4 //
1444 *
' THE CORRECTOR FAILED TO CONVERGE REPEATEDLY OR WITH ' //
1445 *
'ABS(H)=HMIN', idid, 1)
1449 660
WRITE (xern3,
'(1P,D15.6)') tn
1450 WRITE (xern4,
'(1P,D15.6)') h
1451 CALL xermsg (
'SLATEC',
'DDASSL',
1452 *
'AT T = ' // xern3 //
' AND STEPSIZE H = ' // xern4 //
1453 *
' THE ITERATION MATRIX IS SINGULAR', idid, 1)
1457 670
WRITE (xern3,
'(1P,D15.6)') tn
1458 WRITE (xern4,
'(1P,D15.6)') h
1459 CALL xermsg (
'SLATEC',
'DDASSL',
1460 *
'AT T = ' // xern3 //
' AND STEPSIZE H = ' // xern4 //
1461 *
' THE CORRECTOR COULD NOT CONVERGE. ALSO, THE ERROR TEST ' //
1462 *
'FAILED REPEATEDLY.', idid, 1)
1466 675
WRITE (xern3,
'(1P,D15.6)') tn
1467 WRITE (xern4,
'(1P,D15.6)') h
1468 CALL xermsg (
'SLATEC',
'DDASSL',
1469 *
'AT T = ' // xern3 //
' AND STEPSIZE H = ' // xern4 //
1470 *
' THE CORRECTOR COULD NOT CONVERGE BECAUSE IRES WAS EQUAL ' //
1471 *
'TO MINUS ONE', idid, 1)
1475 680
WRITE (xern3,
'(1P,D15.6)') tn
1476 WRITE (xern4,
'(1P,D15.6)') h
1477 CALL xermsg (
'SLATEC',
'DDASSL',
1478 *
'AT T = ' // xern3 //
' AND STEPSIZE H = ' // xern4 //
1479 *
' IRES WAS EQUAL TO MINUS TWO', idid, 1)
1483 685
WRITE (xern3,
'(1P,D15.6)') tn
1484 WRITE (xern4,
'(1P,D15.6)') ho
1485 CALL xermsg (
'SLATEC',
'DDASSL',
1486 *
'AT T = ' // xern3 //
' AND STEPSIZE H = ' // xern4 //
1487 *
' THE INITIAL YPRIME COULD NOT BE COMPUTED', idid, 1)
1505 701
CALL xermsg (
'SLATEC',
'DDASSL',
1506 *
'SOME ELEMENT OF INFO VECTOR IS NOT ZERO OR ONE', 1, 1)
1509 702
WRITE (xern1,
'(I8)') neq
1510 CALL xermsg (
'SLATEC',
'DDASSL',
1511 *
'NEQ = ' // xern1 // .LE.
' 0', 2, 1)
1514 703
WRITE (xern1,
'(I8)') mxord
1515 CALL xermsg (
'SLATEC',
'DDASSL',
1516 *
'MAXORD = ' // xern1 //
' NOT IN RANGE', 3, 1)
1519 704
WRITE (xern1,
'(I8)') lenrw
1520 WRITE (xern2,
'(I8)') lrw
1521 CALL xermsg (
'SLATEC',
'DDASSL',
1522 *
'RWORK LENGTH NEEDED, LENRW = ' // xern1 //
1523 *
', EXCEEDS LRW = ' // xern2, 4, 1)
1526 705
WRITE (xern1,
'(I8)') leniw
1527 WRITE (xern2,
'(I8)') liw
1528 CALL xermsg (
'SLATEC',
'DDASSL',
1529 *
'IWORK LENGTH NEEDED, LENIW = ' // xern1 //
1530 *
', EXCEEDS LIW = ' // xern2, 5, 1)
1533 706
CALL xermsg (
'SLATEC',
'DDASSL',
1534 * .LT.
'SOME ELEMENT OF RTOL IS 0', 6, 1)
1537 707
CALL xermsg (
'SLATEC',
'DDASSL',
1538 * .LT.
'SOME ELEMENT OF ATOL IS 0', 7, 1)
1541 708
CALL xermsg (
'SLATEC',
'DDASSL',
1542 *
'ALL ELEMENTS OF RTOL AND ATOL ARE ZERO', 8, 1)
1545 709
WRITE (xern3,
'(1P,D15.6)') tstop
1546 WRITE (xern4,
'(1P,D15.6)') tout
1547 CALL xermsg (
'SLATEC',
'DDASSL',
1548 *
'INFO(4) = 1 AND TSTOP = ' // xern3 //
' BEHIND TOUT = ' //
1552 710
WRITE (xern3,
'(1P,D15.6)') hmax
1553 CALL xermsg (
'SLATEC',
'DDASSL',
1554 *
'HMAX = ' // xern3 // .LT.
' 0.0', 10, 1)
1557 711
WRITE (xern3,
'(1P,D15.6)') tout
1558 WRITE (xern4,
'(1P,D15.6)') t
1559 CALL xermsg (
'SLATEC',
'DDASSL',
1560 *
'TOUT = ' // xern3 //
' BEHIND T = ' // xern4, 11, 1)
1563 712
CALL xermsg (
'SLATEC',
'DDASSL',
1564 *
'INFO(8)=1 AND H0=0.0', 12, 1)
1567 713
CALL xermsg (
'SLATEC',
'DDASSL',
1568 * .LE.
'SOME ELEMENT OF WT IS 0.0', 13, 1)
1571 714
WRITE (xern3,
'(1P,D15.6)') tout
1572 WRITE (xern4,
'(1P,D15.6)') t
1573 CALL xermsg (
'SLATEC',
'DDASSL',
1574 *
'TOUT = ' // xern3 //
' TOO CLOSE TO T = ' // xern4 //
1575 *
' TO START INTEGRATION', 14, 1)
1578 715
WRITE (xern3,
'(1P,D15.6)') tstop
1579 WRITE (xern4,
'(1P,D15.6)') t
1580 CALL xermsg (
'SLATEC',
'DDASSL',
1581 *
'INFO(4)=1 AND TSTOP = ' // xern3 //
' BEHIND T = ' // xern4,
1585 716
WRITE (xern1,
'(I8)') mxstp
1586 CALL xermsg (
'SLATEC',
'DDASSL',
1587 *
'INFO(12)=1 AND MXSTP = ' // xern1 //
' ILLEGAL.', 3, 1)
1590 717
WRITE (xern1,
'(I8)') iwork(lml)
1591 CALL xermsg (
'SLATEC',
'DDASSL',
1592 *
'ML = ' // xern1 // .LT..GT.
' ILLEGAL. EITHER 0 OR NEQ',
1596 718
WRITE (xern1,
'(I8)') iwork(lmu)
1597 CALL xermsg (
'SLATEC',
'DDASSL',
1598 *
'MU = ' // xern1 // .LT..GT.
' ILLEGAL. EITHER 0 OR NEQ',
1602 719
WRITE (xern3,
'(1P,D15.6)') tout
1603 CALL xermsg (
'SLATEC',
'DDASSL',
1604 *
'TOUT = T = ' // xern3, 19, 1)
1608 IF(info(1).EQ.-1)
THEN
1609 CALL xermsg (
'SLATEC',
'DDASSL',
1610 *
'REPEATED OCCURRENCES OF ILLEGAL INPUT$$' //
1611 *
'RUN TERMINATED. APPARENT INFINITE LOOP', -999, 2)
charNDArray max(char d, const charNDArray &m)
double precision function d1mach(i)
subroutine ddaini(X, Y, YPRIME, NEQ, RES, JAC, H, WT, IDID, RPAR, IPAR, PHI, DELTA, E, WM, IWM, HMIN, UROUND, NONNEG, NTEMP)
double precision function ddanrm(NEQ, V, WT, RPAR, IPAR)
subroutine ddassl(RES, NEQ, T, Y, YPRIME, TOUT, INFO, RTOL, ATOL, IDID, RWORK, LRW, IWORK, LIW, RPAR, IPAR, JAC)
subroutine ddastp(X, Y, YPRIME, NEQ, RES, JAC, H, WT, JSTART, IDID, RPAR, IPAR, PHI, DELTA, E, WM, IWM, ALPHA, BETA, GAMMA, PSI, SIGMA, CJ, CJOLD, HOLD, S, HMIN, UROUND, IPHASE, JCALC, K, KOLD, NS, NONNEG, NTEMP)
subroutine ddatrp(X, XOUT, YOUT, YPOUT, NEQ, KOLD, PHI, PSI)
subroutine ddawts(NEQ, IWT, RTOL, ATOL, Y, WT, RPAR, IPAR)
subroutine xermsg(LIBRAR, SUBROU, MESSG, NERR, LEVEL)