1 ;;; Compiled by f2cl version:
2 ;;; ("f2cl1.l,v 95098eb54f13 2013/04/01 00:45:16 toy $"
3 ;;; "f2cl2.l,v 95098eb54f13 2013/04/01 00:45:16 toy $"
4 ;;; "f2cl3.l,v 96616d88fb7e 2008/02/22 22:19:34 rtoy $"
5 ;;; "f2cl4.l,v 96616d88fb7e 2008/02/22 22:19:34 rtoy $"
6 ;;; "f2cl5.l,v 95098eb54f13 2013/04/01 00:45:16 toy $"
7 ;;; "f2cl6.l,v 1d5cbacbb977 2008/08/24 00:56:27 rtoy $"
8 ;;; "macros.l,v 1409c1352feb 2013/03/24 20:44:50 toy $")
10 ;;; Using Lisp CMU Common Lisp snapshot-2013-11 (20E Unicode)
12 ;;; Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
13 ;;; (:coerce-assigns :as-needed) (:array-type ':array)
14 ;;; (:array-slicing t) (:declare-common nil)
15 ;;; (:float-format single-float))
17 (in-package "ODEPACK")
21 (neq y yh nyh yh1 ewt savf savr acor wm iwm res adda jac pjac slvs
)
22 (declare (type (f2cl-lib:integer4
) nyh
)
23 (type (array double-float
(*)) wm acor savr savf ewt yh1 yh y
)
24 (type (array f2cl-lib
:integer4
(*)) iwm neq
))
27 :element-type
'double-float
28 :displaced-to
(dls001-part-0 *dls001-common-block
*)
29 :displaced-index-offset
2))
32 :element-type
'double-float
33 :displaced-to
(dls001-part-0 *dls001-common-block
*)
34 :displaced-index-offset
15))
37 :element-type
'double-float
38 :displaced-to
(dls001-part-0 *dls001-common-block
*)
39 :displaced-index-offset
173)))
40 (symbol-macrolet ((conit (aref (dls001-part-0 *dls001-common-block
*) 0))
41 (crate (aref (dls001-part-0 *dls001-common-block
*) 1))
44 (hold (aref (dls001-part-0 *dls001-common-block
*) 171))
45 (rmax (aref (dls001-part-0 *dls001-common-block
*) 172))
47 (ccmax (aref (dls001-part-0 *dls001-common-block
*) 209))
48 (el0 (aref (dls001-part-0 *dls001-common-block
*) 210))
49 (h (aref (dls001-part-0 *dls001-common-block
*) 211))
50 (hmin (aref (dls001-part-0 *dls001-common-block
*) 212))
51 (hmxi (aref (dls001-part-0 *dls001-common-block
*) 213))
52 (hu (aref (dls001-part-0 *dls001-common-block
*) 214))
53 (rc (aref (dls001-part-0 *dls001-common-block
*) 215))
54 (tn (aref (dls001-part-0 *dls001-common-block
*) 216))
55 (ialth (aref (dls001-part-1 *dls001-common-block
*) 6))
56 (ipup (aref (dls001-part-1 *dls001-common-block
*) 7))
57 (lmax (aref (dls001-part-1 *dls001-common-block
*) 8))
58 (meo (aref (dls001-part-1 *dls001-common-block
*) 9))
59 (nqnyh (aref (dls001-part-1 *dls001-common-block
*) 10))
60 (nslp (aref (dls001-part-1 *dls001-common-block
*) 11))
61 (icf (aref (dls001-part-1 *dls001-common-block
*) 12))
62 (ierpj (aref (dls001-part-1 *dls001-common-block
*) 13))
63 (iersl (aref (dls001-part-1 *dls001-common-block
*) 14))
64 (jcur (aref (dls001-part-1 *dls001-common-block
*) 15))
65 (jstart (aref (dls001-part-1 *dls001-common-block
*) 16))
66 (kflag (aref (dls001-part-1 *dls001-common-block
*) 17))
67 (l (aref (dls001-part-1 *dls001-common-block
*) 18))
68 (meth (aref (dls001-part-1 *dls001-common-block
*) 25))
69 (miter (aref (dls001-part-1 *dls001-common-block
*) 26))
70 (maxord (aref (dls001-part-1 *dls001-common-block
*) 27))
71 (maxcor (aref (dls001-part-1 *dls001-common-block
*) 28))
72 (msbp (aref (dls001-part-1 *dls001-common-block
*) 29))
73 (mxncf (aref (dls001-part-1 *dls001-common-block
*) 30))
74 (n (aref (dls001-part-1 *dls001-common-block
*) 31))
75 (nq (aref (dls001-part-1 *dls001-common-block
*) 32))
76 (nst (aref (dls001-part-1 *dls001-common-block
*) 33))
77 (nfe (aref (dls001-part-1 *dls001-common-block
*) 34))
78 (nqu (aref (dls001-part-1 *dls001-common-block
*) 36)))
79 (f2cl-lib:with-multi-array-data
80 ((neq f2cl-lib
:integer4 neq-%data% neq-%offset%
)
81 (iwm f2cl-lib
:integer4 iwm-%data% iwm-%offset%
)
82 (y double-float y-%data% y-%offset%
)
83 (yh double-float yh-%data% yh-%offset%
)
84 (yh1 double-float yh1-%data% yh1-%offset%
)
85 (ewt double-float ewt-%data% ewt-%offset%
)
86 (savf double-float savf-%data% savf-%offset%
)
87 (savr double-float savr-%data% savr-%offset%
)
88 (acor double-float acor-%data% acor-%offset%
)
89 (wm double-float wm-%data% wm-%offset%
))
90 (prog ((newq 0) (ncf 0) (m 0) (kgo 0) (jb 0) (j 0) (iret 0) (ires 0)
91 (iredo 0) (i1 0) (i 0) (told 0.0d0
) (rhup 0.0d0
) (rhsm 0.0d0
)
92 (rhdn 0.0d0
) (rh 0.0d0
) (r 0.0d0
) (exup 0.0d0
) (exsm 0.0d0
)
93 (exdn 0.0d0
) (el1h 0.0d0
) (eljh 0.0d0
) (dup 0.0d0
) (dsm 0.0d0
)
94 (delp 0.0d0
) (del 0.0d0
) (ddn 0.0d0
) (dcon 0.0d0
))
95 (declare (type (double-float) dcon ddn del delp dsm dup eljh el1h
96 exdn exsm exup r rh rhdn rhsm rhup
98 (type (f2cl-lib:integer4
) i i1 iredo ires iret j jb kgo m
108 (if (> jstart
0) (go label200
))
109 (if (= jstart -
1) (go label100
))
110 (if (= jstart -
2) (go label160
))
111 (setf lmax
(f2cl-lib:int-add maxord
1))
115 (setf rmax
10000.0d0
)
127 (setf lmax
(f2cl-lib:int-add maxord
1))
128 (if (= ialth
1) (setf ialth
2))
129 (if (= meth meo
) (go label110
))
130 (dcfode meth elco tesco
)
132 (if (> nq maxord
) (go label120
))
137 (if (<= nq maxord
) (go label160
))
141 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
145 (setf (f2cl-lib:fref el
(i) ((1 13)))
146 (f2cl-lib:fref elco
(i nq
) ((1 13) (1 12))))))
147 (setf nqnyh
(f2cl-lib:int-mul nq nyh
))
148 (setf rc
(/ (* rc
(f2cl-lib:fref el
(1) ((1 13)))) el0
))
149 (setf el0
(f2cl-lib:fref el
(1) ((1 13))))
150 (setf conit
(/ 0.5d0
(f2cl-lib:int-add nq
2)))
152 (/ (dvnorm n savf ewt
)
153 (f2cl-lib:fref tesco
(1 l
) ((1 3) (1 12)))))
154 (setf exdn
(/ 1.0d0 l
))
155 (setf rhdn
(/ 1.0d0
(+ (* 1.3d0
(expt ddn exdn
)) 1.3d-6
)))
156 (setf rh
(min rhdn
1.0d0
))
158 (if (= h hold
) (go label170
))
159 (setf rh
(min rh
(abs (/ h hold
))))
163 (dcfode meth elco tesco
)
165 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
169 (setf (f2cl-lib:fref el
(i) ((1 13)))
170 (f2cl-lib:fref elco
(i nq
) ((1 13) (1 12))))))
171 (setf nqnyh
(f2cl-lib:int-mul nq nyh
))
172 (setf rc
(/ (* rc
(f2cl-lib:fref el
(1) ((1 13)))) el0
))
173 (setf el0
(f2cl-lib:fref el
(1) ((1 13))))
174 (setf conit
(/ 0.5d0
(f2cl-lib:int-add nq
2)))
175 (f2cl-lib:computed-goto
(label160 label170 label200
) iret
)
177 (if (= h hold
) (go label200
))
183 (setf rh
(max rh
(/ hmin
(abs h
))))
185 (setf rh
(min rh rmax
))
186 (setf rh
(/ rh
(max 1.0d0
(* (abs h
) hmxi rh
))))
188 (f2cl-lib:fdo
(j 2 (f2cl-lib:int-add j
1))
192 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
195 (setf (f2cl-lib:fref yh-%data%
200 (f2cl-lib:fref yh-%data%
209 (if (= iredo
0) (go label690
))
211 (if (> (abs (- rc
1.0d0
)) ccmax
) (setf ipup miter
))
212 (if (>= nst
(f2cl-lib:int-add nslp msbp
)) (setf ipup miter
))
214 (setf i1
(f2cl-lib:int-add nqnyh
1))
215 (f2cl-lib:fdo
(jb 1 (f2cl-lib:int-add jb
1))
218 (setf i1
(f2cl-lib:int-sub i1 nyh
))
219 (f2cl-lib:fdo
(i i1
(f2cl-lib:int-add i
1))
223 (setf (f2cl-lib:fref yh1-%data%
(i) ((1 *)) yh1-%offset%
)
225 (f2cl-lib:fref yh1-%data%
(i) ((1 *)) yh1-%offset%
)
226 (f2cl-lib:fref yh1-%data%
227 ((f2cl-lib:int-add i nyh
))
233 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
236 (setf (f2cl-lib:fref savf-%data%
(i) ((1 *)) savf-%offset%
)
238 (f2cl-lib:fref yh-%data%
244 (setf (f2cl-lib:fref y-%data%
(i) ((1 *)) y-%offset%
)
245 (f2cl-lib:fref yh-%data%
249 (if (<= ipup
0) (go label240
))
251 (var-0 var-1 var-2 var-3 var-4 var-5 var-6 var-7 var-8 var-9
252 var-10 var-11 var-12
)
267 (declare (ignore var-0 var-1 var-2 var-4 var-5 var-6 var-7 var-8
268 var-9 var-10 var-11 var-12
))
275 (if (= ierpj
0) (go label250
))
276 (if (< ierpj
0) (go label435
))
278 (f2cl-lib:computed-goto
(label430 label435 label430
) ires
)
281 (multiple-value-bind (var-0 var-1 var-2 var-3 var-4 var-5
)
282 (funcall res neq tn y savf savr ires
)
283 (declare (ignore var-0 var-2 var-3 var-4
))
288 (setf nfe
(f2cl-lib:int-add nfe
1))
289 (setf kgo
(abs ires
))
290 (f2cl-lib:computed-goto
(label250 label435 label430
) kgo
)
292 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
296 (setf (f2cl-lib:fref acor-%data%
(i) ((1 *)) acor-%offset%
)
299 (funcall slvs wm iwm savr savf
)
300 (if (< iersl
0) (go label430
))
301 (if (> iersl
0) (go label410
))
302 (setf el1h
(* (f2cl-lib:fref el
(1) ((1 13))) h
))
303 (setf del
(* (dvnorm n savr ewt
) (abs h
)))
304 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
307 (setf (f2cl-lib:fref acor-%data%
(i) ((1 *)) acor-%offset%
)
308 (+ (f2cl-lib:fref acor-%data%
(i) ((1 *)) acor-%offset%
)
309 (f2cl-lib:fref savr-%data%
313 (setf (f2cl-lib:fref savf-%data%
(i) ((1 *)) savf-%offset%
)
314 (+ (f2cl-lib:fref acor-%data%
(i) ((1 *)) acor-%offset%
)
316 (f2cl-lib:fref yh-%data%
322 (setf (f2cl-lib:fref y-%data%
(i) ((1 *)) y-%offset%
)
324 (f2cl-lib:fref yh-%data%
329 (f2cl-lib:fref acor-%data%
333 (if (/= m
0) (setf crate
(max (* 0.2d0 crate
) (/ del delp
))))
335 (/ (* del
(min 1.0d0
(* 1.5d0 crate
)))
336 (* (f2cl-lib:fref tesco
(2 nq
) ((1 3) (1 12))) conit
)))
337 (if (<= dcon
1.0d0
) (go label460
))
338 (setf m
(f2cl-lib:int-add m
1))
339 (if (= m maxcor
) (go label410
))
340 (if (and (>= m
2) (> del
(* 2.0d0 delp
))) (go label410
))
343 (multiple-value-bind (var-0 var-1 var-2 var-3 var-4 var-5
)
344 (funcall res neq tn y savf savr ires
)
345 (declare (ignore var-0 var-2 var-3 var-4
))
350 (setf nfe
(f2cl-lib:int-add nfe
1))
351 (setf kgo
(abs ires
))
352 (f2cl-lib:computed-goto
(label270 label435 label410
) kgo
)
355 (if (= jcur
1) (go label430
))
360 (setf ncf
(f2cl-lib:int-add ncf
1))
364 (setf i1
(f2cl-lib:int-add nqnyh
1))
365 (f2cl-lib:fdo
(jb 1 (f2cl-lib:int-add jb
1))
368 (setf i1
(f2cl-lib:int-sub i1 nyh
))
369 (f2cl-lib:fdo
(i i1
(f2cl-lib:int-add i
1))
373 (setf (f2cl-lib:fref yh1-%data%
(i) ((1 *)) yh1-%offset%
)
375 (f2cl-lib:fref yh1-%data%
(i) ((1 *)) yh1-%offset%
)
376 (f2cl-lib:fref yh1-%data%
377 ((f2cl-lib:int-add i nyh
))
381 (if (= ires
2) (go label680
))
382 (if (or (< ierpj
0) (< iersl
0)) (go label685
))
383 (if (<= (abs h
) (* hmin
1.00001d0
)) (go label450
))
384 (if (= ncf mxncf
) (go label450
))
390 (if (= ires
3) (go label680
))
395 (setf dsm
(/ del
(f2cl-lib:fref tesco
(2 nq
) ((1 3) (1 12))))))
398 (/ (* (abs h
) (dvnorm n acor ewt
))
399 (f2cl-lib:fref tesco
(2 nq
) ((1 3) (1 12))))))
400 (if (> dsm
1.0d0
) (go label500
))
403 (setf nst
(f2cl-lib:int-add nst
1))
406 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
409 (setf eljh
(* (f2cl-lib:fref el
(j) ((1 13))) h
))
410 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
413 (setf (f2cl-lib:fref yh-%data%
418 (f2cl-lib:fref yh-%data%
423 (f2cl-lib:fref acor-%data%
426 acor-%offset%
))))))))
428 (setf ialth
(f2cl-lib:int-sub ialth
1))
429 (if (= ialth
0) (go label520
))
430 (if (> ialth
1) (go label700
))
431 (if (= l lmax
) (go label700
))
432 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
436 (setf (f2cl-lib:fref yh-%data%
440 (f2cl-lib:fref acor-%data%
(i) ((1 *)) acor-%offset%
))))
443 (setf kflag
(f2cl-lib:int-sub kflag
1))
445 (setf i1
(f2cl-lib:int-add nqnyh
1))
446 (f2cl-lib:fdo
(jb 1 (f2cl-lib:int-add jb
1))
449 (setf i1
(f2cl-lib:int-sub i1 nyh
))
450 (f2cl-lib:fdo
(i i1
(f2cl-lib:int-add i
1))
454 (setf (f2cl-lib:fref yh1-%data%
(i) ((1 *)) yh1-%offset%
)
456 (f2cl-lib:fref yh1-%data%
(i) ((1 *)) yh1-%offset%
)
457 (f2cl-lib:fref yh1-%data%
458 ((f2cl-lib:int-add i nyh
))
463 (if (<= (abs h
) (* hmin
1.00001d0
)) (go label660
))
464 (if (<= kflag -
7) (go label660
))
470 (if (= l lmax
) (go label540
))
471 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
475 (setf (f2cl-lib:fref savf-%data%
(i) ((1 *)) savf-%offset%
)
476 (- (f2cl-lib:fref acor-%data%
(i) ((1 *)) acor-%offset%
)
477 (f2cl-lib:fref yh-%data%
482 (/ (* (abs h
) (dvnorm n savf ewt
))
483 (f2cl-lib:fref tesco
(3 nq
) ((1 3) (1 12)))))
484 (setf exup
(/ 1.0d0
(f2cl-lib:int-add l
1)))
485 (setf rhup
(/ 1.0d0
(+ (* 1.4d0
(expt dup exup
)) 1.4d-6
)))
487 (setf exsm
(/ 1.0d0 l
))
488 (setf rhsm
(/ 1.0d0
(+ (* 1.2d0
(expt dsm exsm
)) 1.2d-6
)))
490 (if (= nq
1) (go label560
))
494 (f2cl-lib:array-slice yh-%data%
500 (f2cl-lib:fref tesco
(1 nq
) ((1 3) (1 12)))))
501 (setf exdn
(/ 1.0d0 nq
))
502 (setf rhdn
(/ 1.0d0
(+ (* 1.3d0
(expt ddn exdn
)) 1.3d-6
)))
504 (if (>= rhsm rhup
) (go label570
))
505 (if (> rhup rhdn
) (go label590
))
508 (if (< rhsm rhdn
) (go label580
))
513 (setf newq
(f2cl-lib:int-sub nq
1))
515 (if (and (< kflag
0) (> rh
1.0d0
)) (setf rh
1.0d0
))
520 (if (< rh
1.1d0
) (go label610
))
521 (setf r
(/ (* h
(f2cl-lib:fref el
(l) ((1 13)))) l
))
522 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
526 (setf (f2cl-lib:fref yh-%data%
527 (i (f2cl-lib:int-add newq
1))
530 (* (f2cl-lib:fref acor-%data%
(i) ((1 *)) acor-%offset%
)
537 (if (and (= kflag
0) (< rh
1.1d0
)) (go label610
))
538 (if (<= kflag -
2) (setf rh
(min rh
0.1d0
)))
539 (if (= newq nq
) (go label170
))
542 (setf l
(f2cl-lib:int-add nq
1))
552 (setf kflag
(f2cl-lib:int-sub
(f2cl-lib:int-sub ires
) 1))
560 (setf r
(/ h
(f2cl-lib:fref tesco
(2 nqu
) ((1 3) (1 12)))))
561 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
565 (setf (f2cl-lib:fref acor-%data%
(i) ((1 *)) acor-%offset%
)
566 (* (f2cl-lib:fref acor-%data%
(i) ((1 *)) acor-%offset%
)
591 (in-package #:cl-user
)
592 #+#.
(cl:if
(cl:find-package
'#:f2cl
) '(and) '(or))
593 (eval-when (:load-toplevel
:compile-toplevel
:execute
)
594 (setf (gethash 'fortran-to-lisp
::dstodi
595 fortran-to-lisp
::*f2cl-function-info
*)
596 (fortran-to-lisp::make-f2cl-finfo
597 :arg-types
'((array fortran-to-lisp
::integer4
(*))
598 (array double-float
(*)) (array double-float
(*))
599 (fortran-to-lisp::integer4
) (array double-float
(*))
600 (array double-float
(*)) (array double-float
(*))
601 (array double-float
(*)) (array double-float
(*))
602 (array double-float
(*))
603 (array fortran-to-lisp
::integer4
(*)) t t t t t
)
604 :return-values
'(nil nil nil fortran-to-lisp
::nyh nil nil nil nil
605 nil nil nil nil nil nil nil nil
)
606 :calls
'(fortran-to-lisp::dvnorm fortran-to-lisp
::dcfode
))))