1 C$Id: adBuffer.f 3723 2011-02-24 13:34:42Z llh $
3 c PISTES D'AMELIORATIONS:
4 c Attention aux IF qui peuvent couter cher.
5 c On pourrait aussi bufferiser les bits avec N entiers,
6 c (1 bit par entier), passer tout le paquet a C et laisser
7 c C faire les jongleries de bitsets.
8 c On pourrait aussi optimiser en -O3 les primitives de ADFirstAidKit
9 c Regarder l'assembleur (option -S (et -o toto.s))
10 c Pourchasser les divisions!
12 c======================== BITS ==========================:
14 INTEGER adbitbuf, adbitlbuf
15 INTEGER adbitibuf, adbitilbuf
17 COMMON /adbitfbuf/adbitbuf,adbitlbuf,
18 + adbitibuf,adbitilbuf,adbitinlbuf
23 DATA adbitinlbuf/.FALSE./
26 c [0,31] are the bit indices we can use in an INTEGER
28 SUBROUTINE PUSHBIT(bit)
30 INTEGER adbitbuf, adbitlbuf
31 INTEGER adbitibuf, adbitilbuf
33 COMMON /adbitfbuf/adbitbuf,adbitlbuf,
34 + adbitibuf,adbitilbuf,adbitinlbuf
36 IF (adbitilbuf.ne.-1) THEN
41 adbitbuf = IBSET(adbitbuf, adbitibuf)
43 adbitbuf = IBCLR(adbitbuf, adbitibuf)
45 IF (adbitibuf.ge.31) THEN
46 CALL PUSHINTEGER4(adbitbuf)
50 adbitibuf = adbitibuf+1
54 LOGICAL FUNCTION LOOKBIT()
55 INTEGER adbitbuf, adbitlbuf
56 INTEGER adbitibuf, adbitilbuf
58 COMMON /adbitfbuf/adbitbuf,adbitlbuf,
59 + adbitibuf,adbitilbuf,adbitinlbuf
61 IF (adbitilbuf.eq.-1) THEN
65 IF (adbitilbuf.le.0) THEN
66 CALL LOOKINTEGER4(adbitlbuf)
69 adbitilbuf = adbitilbuf-1
71 LOOKBIT = BTEST(adbitlbuf, adbitilbuf)
74 LOGICAL FUNCTION POPBIT()
75 INTEGER adbitbuf, adbitlbuf
76 INTEGER adbitibuf, adbitilbuf
78 COMMON /adbitfbuf/adbitbuf,adbitlbuf,
79 + adbitibuf,adbitilbuf,adbitinlbuf
81 IF (adbitilbuf.ne.-1) THEN
85 IF (adbitibuf.le.0) THEN
86 CALL POPINTEGER4(adbitbuf)
89 adbitibuf = adbitibuf-1
91 POPBIT = BTEST(adbitbuf, adbitibuf)
94 c====================== CONTROL =========================:
96 SUBROUTINE PUSHCONTROL1B(cc)
101 SUBROUTINE POPCONTROL1B(cc)
111 SUBROUTINE LOOKCONTROL1B(cc)
121 SUBROUTINE PUSHCONTROL2B(cc)
123 CALL PUSHBIT(BTEST(cc,0))
124 CALL PUSHBIT(BTEST(cc,1))
127 SUBROUTINE POPCONTROL2B(cc)
135 IF (POPBIT()) cc = IBSET(cc,0)
138 SUBROUTINE LOOKCONTROL2B(cc)
146 IF (LOOKBIT()) cc = IBSET(cc,0)
149 SUBROUTINE PUSHCONTROL3B(cc)
151 CALL PUSHBIT(BTEST(cc,0))
152 CALL PUSHBIT(BTEST(cc,1))
153 CALL PUSHBIT(BTEST(cc,2))
156 SUBROUTINE POPCONTROL3B(cc)
164 IF (POPBIT()) cc = IBSET(cc,1)
165 IF (POPBIT()) cc = IBSET(cc,0)
168 SUBROUTINE LOOKCONTROL3B(cc)
176 IF (LOOKBIT()) cc = IBSET(cc,1)
177 IF (LOOKBIT()) cc = IBSET(cc,0)
180 SUBROUTINE PUSHCONTROL4B(cc)
182 CALL PUSHBIT(BTEST(cc,0))
183 CALL PUSHBIT(BTEST(cc,1))
184 CALL PUSHBIT(BTEST(cc,2))
185 CALL PUSHBIT(BTEST(cc,3))
188 SUBROUTINE POPCONTROL4B(cc)
196 IF (POPBIT()) cc = IBSET(cc,2)
197 IF (POPBIT()) cc = IBSET(cc,1)
198 IF (POPBIT()) cc = IBSET(cc,0)
201 SUBROUTINE LOOKCONTROL4B(cc)
209 IF (LOOKBIT()) cc = IBSET(cc,2)
210 IF (LOOKBIT()) cc = IBSET(cc,1)
211 IF (LOOKBIT()) cc = IBSET(cc,0)
214 SUBROUTINE PUSHCONTROL5B(cc)
216 CALL PUSHBIT(BTEST(cc,0))
217 CALL PUSHBIT(BTEST(cc,1))
218 CALL PUSHBIT(BTEST(cc,2))
219 CALL PUSHBIT(BTEST(cc,3))
220 CALL PUSHBIT(BTEST(cc,4))
223 SUBROUTINE POPCONTROL5B(cc)
231 IF (POPBIT()) cc = IBSET(cc,3)
232 IF (POPBIT()) cc = IBSET(cc,2)
233 IF (POPBIT()) cc = IBSET(cc,1)
234 IF (POPBIT()) cc = IBSET(cc,0)
237 SUBROUTINE LOOKCONTROL5B(cc)
245 IF (LOOKBIT()) cc = IBSET(cc,3)
246 IF (LOOKBIT()) cc = IBSET(cc,2)
247 IF (LOOKBIT()) cc = IBSET(cc,1)
248 IF (LOOKBIT()) cc = IBSET(cc,0)
251 c======================= BOOLEANS =========================
253 SUBROUTINE PUSHBOOLEAN(x)
258 SUBROUTINE LOOKBOOLEAN(x)
263 SUBROUTINE POPBOOLEAN(x)
268 c===================== CHARACTERS =======================:
269 BLOCK DATA CHARACTERS
270 CHARACTER ads1buf(512), ads1lbuf(512)
271 INTEGER ads1ibuf,ads1ilbuf
273 COMMON /ads1fbuf/ads1buf,ads1lbuf,
274 + ads1ibuf,ads1ilbuf,ads1inlbuf
277 DATA ads1inlbuf/.FALSE./
280 SUBROUTINE PUSHCHARACTER(x)
281 CHARACTER x, ads1buf(512), ads1lbuf(512)
282 INTEGER ads1ibuf,ads1ilbuf
284 COMMON /ads1fbuf/ads1buf,ads1lbuf,
285 + ads1ibuf,ads1ilbuf,ads1inlbuf
288 IF (ads1ilbuf.ne.-1) THEN
292 IF (ads1ibuf.ge.512) THEN
294 CALL PUSHCHARACTERARRAY(ads1buf, 512)
295 CALL addftraffic(-512)
298 ads1buf(ads1ibuf) = x
299 ads1ibuf = ads1ibuf+1
303 SUBROUTINE LOOKCHARACTER(x)
304 CHARACTER x, ads1buf(512), ads1lbuf(512)
305 INTEGER ads1ibuf,ads1ilbuf
307 COMMON /ads1fbuf/ads1buf,ads1lbuf,
308 + ads1ibuf,ads1ilbuf,ads1inlbuf
310 IF (ads1ilbuf.eq.-1) THEN
312 CALL RESETADLOOKSTACK()
314 IF (ads1ilbuf.le.1) THEN
315 CALL LOOKCHARACTERARRAY(ads1lbuf, 512)
320 ads1ilbuf = ads1ilbuf-1
322 x = ads1lbuf(ads1ilbuf)
324 x = ads1buf(ads1ilbuf)
329 SUBROUTINE POPCHARACTER(x)
330 CHARACTER x, ads1buf(512), ads1lbuf(512)
331 INTEGER ads1ibuf,ads1ilbuf
333 COMMON /ads1fbuf/ads1buf,ads1lbuf,
334 + ads1ibuf,ads1ilbuf,ads1inlbuf
336 IF (ads1ilbuf.ne.-1) THEN
340 IF (ads1ibuf.le.1) THEN
341 CALL POPCHARACTERARRAY(ads1buf, 512)
345 ads1ibuf = ads1ibuf-1
346 x = ads1buf(ads1ibuf)
350 c======================= INTEGER*4 =========================:
352 INTEGER*4 adi4buf(512), adi4lbuf(512)
353 INTEGER adi4ibuf,adi4ilbuf
355 COMMON /adi4fbuf/adi4buf,adi4lbuf,
356 + adi4ibuf,adi4ilbuf,adi4inlbuf
359 DATA adi4inlbuf/.FALSE./
362 SUBROUTINE PUSHINTEGER4(x)
363 INTEGER*4 x, adi4buf(512), adi4lbuf(512)
364 INTEGER adi4ibuf,adi4ilbuf
366 COMMON /adi4fbuf/adi4buf,adi4lbuf,
367 + adi4ibuf,adi4ilbuf,adi4inlbuf
370 IF (adi4ilbuf.ne.-1) THEN
374 IF (adi4ibuf.ge.512) THEN
376 CALL PUSHINTEGER4ARRAY(adi4buf, 512)
377 CALL addftraffic(-2048)
380 adi4buf(adi4ibuf) = x
381 adi4ibuf = adi4ibuf+1
385 SUBROUTINE LOOKINTEGER4(x)
386 INTEGER*4 x, adi4buf(512), adi4lbuf(512)
387 INTEGER adi4ibuf,adi4ilbuf
389 COMMON /adi4fbuf/adi4buf,adi4lbuf,
390 + adi4ibuf,adi4ilbuf,adi4inlbuf
392 IF (adi4ilbuf.eq.-1) THEN
394 CALL RESETADLOOKSTACK()
396 IF (adi4ilbuf.le.1) THEN
397 CALL LOOKINTEGER4ARRAY(adi4lbuf, 512)
402 adi4ilbuf = adi4ilbuf-1
404 x = adi4lbuf(adi4ilbuf)
406 x = adi4buf(adi4ilbuf)
411 SUBROUTINE POPINTEGER4(x)
412 INTEGER*4 x, adi4buf(512), adi4lbuf(512)
413 INTEGER adi4ibuf,adi4ilbuf
415 COMMON /adi4fbuf/adi4buf,adi4lbuf,
416 + adi4ibuf,adi4ilbuf,adi4inlbuf
418 IF (adi4ilbuf.ne.-1) THEN
422 IF (adi4ibuf.le.1) THEN
423 CALL POPINTEGER4ARRAY(adi4buf, 512)
427 adi4ibuf = adi4ibuf-1
428 x = adi4buf(adi4ibuf)
432 c======================= INTEGER*8 =========================
434 INTEGER*8 adi8buf(512), adi8lbuf(512)
435 INTEGER adi8ibuf,adi8ilbuf
437 COMMON /adi8fbuf/adi8buf,adi8lbuf,
438 + adi8ibuf,adi8ilbuf,adi8inlbuf
441 DATA adi8inlbuf/.FALSE./
444 SUBROUTINE PUSHINTEGER8(x)
445 INTEGER*8 x, adi8buf(512), adi8lbuf(512)
446 INTEGER adi8ibuf,adi8ilbuf
448 COMMON /adi8fbuf/adi8buf,adi8lbuf,
449 + adi8ibuf,adi8ilbuf,adi8inlbuf
452 IF (adi8ilbuf.ne.-1) THEN
456 IF (adi8ibuf.ge.512) THEN
458 CALL PUSHINTEGER8ARRAY(adi8buf, 512)
459 CALL addftraffic(-4096)
462 adi8buf(adi8ibuf) = x
463 adi8ibuf = adi8ibuf+1
467 SUBROUTINE LOOKINTEGER8(x)
468 INTEGER*8 x, adi8buf(512), adi8lbuf(512)
469 INTEGER adi8ibuf,adi8ilbuf
471 COMMON /adi8fbuf/adi8buf,adi8lbuf,
472 + adi8ibuf,adi8ilbuf,adi8inlbuf
474 IF (adi8ilbuf.eq.-1) THEN
476 CALL RESETADLOOKSTACK()
478 IF (adi8ilbuf.le.1) THEN
479 CALL LOOKINTEGER8ARRAY(adi8lbuf, 512)
484 adi8ilbuf = adi8ilbuf-1
486 x = adi8lbuf(adi8ilbuf)
488 x = adi8buf(adi8ilbuf)
493 SUBROUTINE POPINTEGER8(x)
494 INTEGER*8 x, adi8buf(512), adi8lbuf(512)
495 INTEGER adi8ibuf,adi8ilbuf
497 COMMON /adi8fbuf/adi8buf,adi8lbuf,
498 + adi8ibuf,adi8ilbuf,adi8inlbuf
500 IF (adi8ilbuf.ne.-1) THEN
504 IF (adi8ibuf.le.1) THEN
505 CALL POPINTEGER8ARRAY(adi8buf, 512)
509 adi8ibuf = adi8ibuf-1
510 x = adi8buf(adi8ibuf)
514 c======================= REAL*4 =========================
516 REAL*4 adr4buf(512), adr4lbuf(512)
517 INTEGER adr4ibuf,adr4ilbuf
519 COMMON /adr4fbuf/adr4buf,adr4lbuf,
520 + adr4ibuf,adr4ilbuf,adr4inlbuf
523 DATA adr4inlbuf/.FALSE./
526 SUBROUTINE PUSHREAL4(x)
527 REAL*4 x, adr4buf(512), adr4lbuf(512)
528 INTEGER adr4ibuf,adr4ilbuf
530 COMMON /adr4fbuf/adr4buf,adr4lbuf,
531 + adr4ibuf,adr4ilbuf,adr4inlbuf
534 IF (adr4ilbuf.ne.-1) THEN
538 IF (adr4ibuf.ge.512) THEN
540 CALL PUSHREAL4ARRAY(adr4buf, 512)
541 CALL addftraffic(-2048)
544 adr4buf(adr4ibuf) = x
545 adr4ibuf = adr4ibuf+1
549 SUBROUTINE LOOKREAL4(x)
550 REAL*4 x, adr4buf(512), adr4lbuf(512)
551 INTEGER adr4ibuf,adr4ilbuf
553 COMMON /adr4fbuf/adr4buf,adr4lbuf,
554 + adr4ibuf,adr4ilbuf,adr4inlbuf
556 IF (adr4ilbuf.eq.-1) THEN
558 CALL RESETADLOOKSTACK()
560 IF (adr4ilbuf.le.1) THEN
561 CALL LOOKREAL4ARRAY(adr4lbuf, 512)
566 adr4ilbuf = adr4ilbuf-1
568 x = adr4lbuf(adr4ilbuf)
570 x = adr4buf(adr4ilbuf)
575 SUBROUTINE POPREAL4(x)
576 REAL*4 x, adr4buf(512), adr4lbuf(512)
577 INTEGER adr4ibuf,adr4ilbuf
579 COMMON /adr4fbuf/adr4buf,adr4lbuf,
580 + adr4ibuf,adr4ilbuf,adr4inlbuf
582 IF (adr4ilbuf.ne.-1) THEN
586 IF (adr4ibuf.le.1) THEN
587 CALL POPREAL4ARRAY(adr4buf, 512)
591 adr4ibuf = adr4ibuf-1
592 x = adr4buf(adr4ibuf)
596 c======================= REAL*8 =========================
598 REAL*8 adr8buf(512), adr8lbuf(512)
599 INTEGER adr8ibuf,adr8ilbuf
601 COMMON /adr8fbuf/adr8buf,adr8lbuf,
602 + adr8ibuf,adr8ilbuf,adr8inlbuf
605 DATA adr8inlbuf/.FALSE./
608 SUBROUTINE PUSHREAL8(x)
609 REAL*8 x, adr8buf(512), adr8lbuf(512)
610 INTEGER adr8ibuf,adr8ilbuf
612 COMMON /adr8fbuf/adr8buf,adr8lbuf,
613 + adr8ibuf,adr8ilbuf,adr8inlbuf
616 IF (adr8ilbuf.ne.-1) THEN
620 IF (adr8ibuf.ge.512) THEN
622 CALL PUSHREAL8ARRAY(adr8buf, 512)
623 CALL addftraffic(-4096)
626 adr8buf(adr8ibuf) = x
627 adr8ibuf = adr8ibuf+1
631 SUBROUTINE LOOKREAL8(x)
632 REAL*8 x, adr8buf(512), adr8lbuf(512)
633 INTEGER adr8ibuf,adr8ilbuf
635 COMMON /adr8fbuf/adr8buf,adr8lbuf,
636 + adr8ibuf,adr8ilbuf,adr8inlbuf
638 IF (adr8ilbuf.eq.-1) THEN
640 CALL RESETADLOOKSTACK()
642 IF (adr8ilbuf.le.1) THEN
643 CALL LOOKREAL8ARRAY(adr8lbuf, 512)
648 adr8ilbuf = adr8ilbuf-1
650 x = adr8lbuf(adr8ilbuf)
652 x = adr8buf(adr8ilbuf)
657 SUBROUTINE POPREAL8(x)
658 REAL*8 x, adr8buf(512), adr8lbuf(512)
659 INTEGER adr8ibuf,adr8ilbuf
661 COMMON /adr8fbuf/adr8buf,adr8lbuf,
662 + adr8ibuf,adr8ilbuf,adr8inlbuf
664 IF (adr8ilbuf.ne.-1) THEN
668 IF (adr8ibuf.le.1) THEN
669 CALL POPREAL8ARRAY(adr8buf, 512)
673 adr8ibuf = adr8ibuf-1
674 x = adr8buf(adr8ibuf)
678 c======================= REAL*16 =========================
680 DOUBLE PRECISION adr16buf(512), adr16lbuf(512)
681 INTEGER adr16ibuf,adr16ilbuf
683 COMMON /adr16fbuf/adr16buf,adr16lbuf,
684 + adr16ibuf,adr16ilbuf,adr16inlbuf
687 DATA adr16inlbuf/.FALSE./
690 SUBROUTINE PUSHREAL16(x)
691 DOUBLE PRECISION x, adr16buf(512), adr16lbuf(512)
692 INTEGER adr16ibuf,adr16ilbuf
694 COMMON /adr16fbuf/adr16buf,adr16lbuf,
695 + adr16ibuf,adr16ilbuf,adr16inlbuf
698 IF (adr16ilbuf.ne.-1) THEN
700 adr16inlbuf = .FALSE.
702 IF (adr16ibuf.ge.512) THEN
704 CALL PUSHREAL16ARRAY(adr16buf, 512)
705 CALL addftraffic(-8192)
708 adr16buf(adr16ibuf) = x
709 adr16ibuf = adr16ibuf+1
713 SUBROUTINE LOOKREAL16(x)
714 DOUBLE PRECISION x, adr16buf(512), adr16lbuf(512)
715 INTEGER adr16ibuf,adr16ilbuf
717 COMMON /adr16fbuf/adr16buf,adr16lbuf,
718 + adr16ibuf,adr16ilbuf,adr16inlbuf
720 IF (adr16ilbuf.eq.-1) THEN
722 CALL RESETADLOOKSTACK()
724 IF (adr16ilbuf.le.1) THEN
725 CALL LOOKREAL16ARRAY(adr16lbuf, 512)
730 adr16ilbuf = adr16ilbuf-1
731 if (adr16inlbuf) THEN
732 x = adr16lbuf(adr16ilbuf)
734 x = adr16buf(adr16ilbuf)
739 SUBROUTINE POPREAL16(x)
740 DOUBLE PRECISION x, adr16buf(512), adr16lbuf(512)
741 INTEGER adr16ibuf,adr16ilbuf
743 COMMON /adr16fbuf/adr16buf,adr16lbuf,
744 + adr16ibuf,adr16ilbuf,adr16inlbuf
746 IF (adr16ilbuf.ne.-1) THEN
748 adr16inlbuf = .FALSE.
750 IF (adr16ibuf.le.1) THEN
751 CALL POPREAL16ARRAY(adr16buf, 512)
755 adr16ibuf = adr16ibuf-1
756 x = adr16buf(adr16ibuf)
760 c======================= COMPLEX*8 =========================
762 COMPLEX*8 adc8buf(512), adc8lbuf(512)
763 INTEGER adc8ibuf,adc8ilbuf
765 COMMON /adc8fbuf/adc8buf,adc8lbuf,
766 + adc8ibuf,adc8ilbuf,adc8inlbuf
769 DATA adc8inlbuf/.FALSE./
772 SUBROUTINE PUSHCOMPLEX8(x)
773 COMPLEX*8 x, adc8buf(512), adc8lbuf(512)
774 INTEGER adc8ibuf,adc8ilbuf
776 COMMON /adc8fbuf/adc8buf,adc8lbuf,
777 + adc8ibuf,adc8ilbuf,adc8inlbuf
780 IF (adc8ilbuf.ne.-1) THEN
784 IF (adc8ibuf.ge.512) THEN
786 CALL PUSHCOMPLEX8ARRAY(adc8buf, 512)
787 CALL addftraffic(-4096)
790 adc8buf(adc8ibuf) = x
791 adc8ibuf = adc8ibuf+1
795 SUBROUTINE LOOKCOMPLEX8(x)
796 COMPLEX*8 x, adc8buf(512), adc8lbuf(512)
797 INTEGER adc8ibuf,adc8ilbuf
799 COMMON /adc8fbuf/adc8buf,adc8lbuf,
800 + adc8ibuf,adc8ilbuf,adc8inlbuf
802 IF (adc8ilbuf.eq.-1) THEN
804 CALL RESETADLOOKSTACK()
806 IF (adc8ilbuf.le.1) THEN
807 CALL LOOKCOMPLEX8ARRAY(adc8lbuf, 512)
812 adc8ilbuf = adc8ilbuf-1
814 x = adc8lbuf(adc8ilbuf)
816 x = adc8buf(adc8ilbuf)
821 SUBROUTINE POPCOMPLEX8(x)
822 COMPLEX*8 x, adc8buf(512), adc8lbuf(512)
823 INTEGER adc8ibuf,adc8ilbuf
825 COMMON /adc8fbuf/adc8buf,adc8lbuf,
826 + adc8ibuf,adc8ilbuf,adc8inlbuf
828 IF (adc8ilbuf.ne.-1) THEN
832 IF (adc8ibuf.le.1) THEN
833 CALL POPCOMPLEX8ARRAY(adc8buf, 512)
837 adc8ibuf = adc8ibuf-1
838 x = adc8buf(adc8ibuf)
842 c======================= COMPLEX*16 =========================
843 BLOCK DATA COMPLEXS16
844 COMPLEX*16 adc16buf(512), adc16lbuf(512)
845 INTEGER adc16ibuf,adc16ilbuf
847 COMMON /adc16fbuf/adc16buf,adc16lbuf,
848 + adc16ibuf,adc16ilbuf,adc16inlbuf
851 DATA adc16inlbuf/.FALSE./
854 SUBROUTINE PUSHCOMPLEX16(x)
855 COMPLEX*16 x, adc16buf(512), adc16lbuf(512)
856 INTEGER adc16ibuf,adc16ilbuf
858 COMMON /adc16fbuf/adc16buf,adc16lbuf,
859 + adc16ibuf,adc16ilbuf,adc16inlbuf
862 IF (adc16ilbuf.ne.-1) THEN
864 adc16inlbuf = .FALSE.
866 IF (adc16ibuf.ge.512) THEN
868 CALL PUSHCOMPLEX16ARRAY(adc16buf, 512)
869 CALL addftraffic(-8192)
872 adc16buf(adc16ibuf) = x
873 adc16ibuf = adc16ibuf+1
877 SUBROUTINE LOOKCOMPLEX16(x)
878 COMPLEX*16 x, adc16buf(512), adc16lbuf(512)
879 INTEGER adc16ibuf,adc16ilbuf
881 COMMON /adc16fbuf/adc16buf,adc16lbuf,
882 + adc16ibuf,adc16ilbuf,adc16inlbuf
884 IF (adc16ilbuf.eq.-1) THEN
886 CALL RESETADLOOKSTACK()
888 IF (adc16ilbuf.le.1) THEN
889 CALL LOOKCOMPLEX16ARRAY(adc16lbuf, 512)
894 adc16ilbuf = adc16ilbuf-1
895 if (adc16inlbuf) THEN
896 x = adc16lbuf(adc16ilbuf)
898 x = adc16buf(adc16ilbuf)
903 SUBROUTINE POPCOMPLEX16(x)
904 COMPLEX*16 x, adc16buf(512), adc16lbuf(512)
905 INTEGER adc16ibuf,adc16ilbuf
907 COMMON /adc16fbuf/adc16buf,adc16lbuf,
908 + adc16ibuf,adc16ilbuf,adc16inlbuf
910 IF (adc16ilbuf.ne.-1) THEN
912 adc16inlbuf = .FALSE.
914 IF (adc16ibuf.le.1) THEN
915 CALL POPCOMPLEX16ARRAY(adc16buf, 512)
919 adc16ibuf = adc16ibuf-1
920 x = adc16buf(adc16ibuf)
924 C=========== MEASUREMENT OF PUSH/POP TRAFFIC ==========
926 BLOCK DATA MEMTRAFFIC
927 INTEGER*8 mmftraffic,mmftrafficM
928 COMMON /mmcomtraffic/mmftraffic,mmftrafficM
933 subroutine addftraffic(n)
935 INTEGER*8 mmftraffic,mmftrafficM
936 COMMON /mmcomtraffic/mmftraffic,mmftrafficM
938 mmftraffic = mmftraffic+n
939 if (mmftraffic.ge.1000000) then
940 100 mmftraffic = mmftraffic-1000000
941 mmftrafficM = mmftrafficM+1
942 if (mmftraffic.ge.1000000) then
947 else if (mmftraffic.lt.0) then
948 200 mmftraffic = mmftraffic+1000000
949 mmftrafficM = mmftrafficM-1
950 if (mmftraffic.lt.0) then
959 SUBROUTINE PRINTTRAFFIC()
960 INTEGER*8 mmftraffic,mmftrafficM
961 COMMON /mmcomtraffic/mmftraffic,mmftrafficM
963 CALL printftrafficinc(mmftrafficM, 1000000, mmftraffic)
964 c write (6,1001) ' F Traffic: ',mmftrafficM,' Mb and ',
965 c + (((mmftraffic*1000)/1024)*1000)/1024, ' millionths'
966 c 1001 format(a,i6,a,i6,a)
969 C ============ PRINTING THE SIZE OF STACKS AND BUFFERS ==========
971 SUBROUTINE PRINTBUFFERTOP()
972 integer*4 SMALLSTACKSIZE
975 size = SMALLSTACKSIZE()
976 print *,'Buffer size:',size,' bytes i.e. ',size/1024.0,' Kbytes'
979 FUNCTION SMALLSTACKSIZE()
980 CHARACTER ads1buf(512), ads1lbuf(512)
981 INTEGER ads1ibuf,ads1ilbuf
983 COMMON /ads1fbuf/ads1buf,ads1lbuf,
984 + ads1ibuf,ads1ilbuf,ads1inlbuf
985 c LOGICAL adl4buf(512), adl4lbuf(512)
986 c INTEGER adl4ibuf,adl4ilbuf
988 c COMMON /adl4fbuf/adl4buf,adl4lbuf,
989 c + adl4ibuf,adl4ilbuf,adl4inlbuf
990 INTEGER*4 adi4buf(512), adi4lbuf(512)
991 INTEGER adi4ibuf,adi4ilbuf
993 COMMON /adi4fbuf/adi4buf,adi4lbuf,
994 + adi4ibuf,adi4ilbuf,adi4inlbuf
995 INTEGER*8 adi8buf(512), adi8lbuf(512)
996 INTEGER adi8ibuf,adi8ilbuf
998 COMMON /adi8fbuf/adi8buf,adi8lbuf,
999 + adi8ibuf,adi8ilbuf,adi8inlbuf
1000 c INTEGER*16 adi16buf(512), adi16lbuf(512)
1001 c INTEGER adi16ibuf,adi16ilbuf
1002 c LOGICAL adi16inlbuf
1003 c COMMON /adi16fbuf/adi16buf,adi16lbuf,
1004 c + adi16ibuf,adi16ilbuf,adi16inlbuf
1005 REAL*4 adr4buf(512), adr4lbuf(512)
1006 INTEGER adr4ibuf,adr4ilbuf
1008 COMMON /adr4fbuf/adr4buf,adr4lbuf,
1009 + adr4ibuf,adr4ilbuf,adr4inlbuf
1010 REAL*8 adr8buf(512), adr8lbuf(512)
1011 INTEGER adr8ibuf,adr8ilbuf
1013 COMMON /adr8fbuf/adr8buf,adr8lbuf,
1014 + adr8ibuf,adr8ilbuf,adr8inlbuf
1015 DOUBLE PRECISION adr16buf(512), adr16lbuf(512)
1016 INTEGER adr16ibuf,adr16ilbuf
1018 COMMON /adr16fbuf/adr16buf,adr16lbuf,
1019 + adr16ibuf,adr16ilbuf,adr16inlbuf
1020 c REAL*32 x, adr32buf(512), adr32lbuf(512)
1021 c INTEGER adr32ibuf,adr32ilbuf
1022 c LOGICAL adr32inlbuf
1023 c COMMON /adr32fbuf/adr32buf,adr32lbuf,
1024 c + adr32ibuf,adr32ilbuf,adr32inlbuf
1025 c COMPLEX*4 adc4buf(512), adc4lbuf(512)
1026 c INTEGER adc4ibuf,adc4ilbuf
1027 c LOGICAL adc4inlbuf
1028 c COMMON /adc4fbuf/adc4buf,adc4lbuf,
1029 c + adc4ibuf,adc4ilbuf,adc4inlbuf
1030 COMPLEX*8 adc8buf(512), adc8lbuf(512)
1031 INTEGER adc8ibuf,adc8ilbuf
1033 COMMON /adc8fbuf/adc8buf,adc8lbuf,
1034 + adc8ibuf,adc8ilbuf,adc8inlbuf
1035 COMPLEX*16 adc16buf(512), adc16lbuf(512)
1036 INTEGER adc16ibuf,adc16ilbuf
1038 COMMON /adc16fbuf/adc16buf,adc16lbuf,
1039 + adc16ibuf,adc16ilbuf,adc16inlbuf
1040 c COMPLEX*32 adc32buf(512), adc32lbuf(512)
1041 c INTEGER adc32ibuf,adc32ilbuf
1042 c LOGICAL adc32inlbuf
1043 c COMMON /adc32fbuf/adc32buf,adc32lbuf,
1044 c + adc32ibuf,adc32ilbuf,adc32inlbuf
1045 integer*4 smallstacksize
1048 smallstacksize = smallstacksize + (ads1ibuf-1)*1
1049 c smallstacksize = smallstacksize + (adl4ibuf-1)*4
1050 smallstacksize = smallstacksize + (adi4ibuf-1)*4
1051 smallstacksize = smallstacksize + (adi8ibuf-1)*8
1052 c smallstacksize = smallstacksize + (adi16ibuf-1)*16
1053 smallstacksize = smallstacksize + (adr4ibuf-1)*4
1054 smallstacksize = smallstacksize + (adr8ibuf-1)*8
1055 smallstacksize = smallstacksize + (adr16ibuf-1)*16
1056 c smallstacksize = smallstacksize + (adr32ibuf-1)*32
1057 c smallstacksize = smallstacksize + (adc4ibuf-1)*4
1058 smallstacksize = smallstacksize + (adc8ibuf-1)*8
1059 smallstacksize = smallstacksize + (adc16ibuf-1)*16
1060 c smallstacksize = smallstacksize + (adc32ibuf-1)*32
1064 C FOR INTERNAL DEBUGS ONLY:
1065 SUBROUTINE SHOWALLSTACKS()
1066 INTEGER adbitbuf, adbitlbuf
1067 INTEGER adbitibuf, adbitilbuf
1069 COMMON /adbitfbuf/adbitbuf,adbitlbuf,
1070 + adbitibuf,adbitilbuf,adbitinlbuf
1071 CHARACTER ads1buf(512), ads1lbuf(512)
1072 INTEGER ads1ibuf,ads1ilbuf
1074 COMMON /ads1fbuf/ads1buf,ads1lbuf,
1075 + ads1ibuf,ads1ilbuf,ads1inlbuf
1076 INTEGER*4 adi4buf(512), adi4lbuf(512)
1077 INTEGER adi4ibuf,adi4ilbuf
1079 COMMON /adi4fbuf/adi4buf,adi4lbuf,
1080 + adi4ibuf,adi4ilbuf,adi4inlbuf
1081 INTEGER*8 adi8buf(512), adi8lbuf(512)
1082 INTEGER adi8ibuf,adi8ilbuf
1084 COMMON /adi8fbuf/adi8buf,adi8lbuf,
1085 + adi8ibuf,adi8ilbuf,adi8inlbuf
1086 REAL*4 adr4buf(512), adr4lbuf(512)
1087 INTEGER adr4ibuf,adr4ilbuf
1089 COMMON /adr4fbuf/adr4buf,adr4lbuf,
1090 + adr4ibuf,adr4ilbuf,adr4inlbuf
1091 REAL*8 adr8buf(512), adr8lbuf(512)
1092 INTEGER adr8ibuf,adr8ilbuf
1094 COMMON /adr8fbuf/adr8buf,adr8lbuf,
1095 + adr8ibuf,adr8ilbuf,adr8inlbuf
1096 DOUBLE PRECISION adr16buf(512), adr16lbuf(512)
1097 INTEGER adr16ibuf,adr16ilbuf
1099 COMMON /adr16fbuf/adr16buf,adr16lbuf,
1100 + adr16ibuf,adr16ilbuf,adr16inlbuf
1101 COMPLEX*8 adc8buf(512), adc8lbuf(512)
1102 INTEGER adc8ibuf,adc8ilbuf
1104 COMMON /adc8fbuf/adc8buf,adc8lbuf,
1105 + adc8ibuf,adc8ilbuf,adc8inlbuf
1106 COMPLEX*16 adc16buf(512), adc16lbuf(512)
1107 INTEGER adc16ibuf,adc16ilbuf
1109 COMMON /adc16fbuf/adc16buf,adc16lbuf,
1110 + adc16ibuf,adc16ilbuf,adc16inlbuf
1113 write (6,1010) 'BIT STACK : ',adbitbuf,'==',adbitbuf,
1114 + ' (',adbitibuf,')'
1115 1010 format(a,i20,a,z16,a,i2,a)
1116 write (6,1011) 'INTEGER*8 BUFFER[',adi8ibuf-1,']: ',
1117 + (adi8buf(i),i=1,adi8ibuf-1)
1118 write (6,1011) 'INTEGER*4 BUFFER[',adi4ibuf-1,']: ',
1119 + (adi4buf(i),i=1,adi4ibuf-1)
1120 1011 format(a,i3,a,512(i40))
1121 write (6,1012) 'REAL*16 BUFFER:[',adr16ibuf-1,']: ',
1122 + (adr16buf(i),i=1,adr16ibuf-1)
1123 write (6,1012) 'REAL*8 BUFFER:[',adr8ibuf-1, ']: ',
1124 + (adr8buf(i),i=1,adr8ibuf-1)
1125 write (6,1012) 'REAL*4 BUFFER:[',adr4ibuf-1, ']: ',
1126 + (adr4buf(i),i=1,adr4ibuf-1)
1127 1012 format(a,512(e10.2))
1128 call showrecentcstack()
1132 C========================================================
1133 C PUSH* POP* SUBROUTINES FOR OTHER DATA TYPES
1134 C Uncomment if these types are available on your compiler
1135 C and they are needed by the reverse differentiated code
1136 C Don't forget to uncomment the corresponding lines in
1137 C subroutine PRINTBUFFERTOP, otherwise these types'
1138 C contribution to buffer occupation will not be seen.
1139 C (not very important anyway...)
1141 c======================= INTEGER*16 =========================
1142 c BLOCK DATA INTEGERS16
1143 c INTEGER*16 adi16buf(512), adi16lbuf(512)
1144 c INTEGER adi16ibuf,adi16ilbuf
1145 c LOGICAL adi16inlbuf
1146 c COMMON /adi16fbuf/adi16buf,adi16lbuf,
1147 c + adi16ibuf,adi16ilbuf,adi16inlbuf
1149 c DATA adi16ilbuf/-1/
1150 c DATA adi16inlbuf/.FALSE./
1153 c SUBROUTINE PUSHINTEGER16(x)
1154 c INTEGER*16 x, adi16buf(512), adi16lbuf(512)
1155 c INTEGER adi16ibuf,adi16ilbuf
1156 c LOGICAL adi16inlbuf
1157 c COMMON /adi16fbuf/adi16buf,adi16lbuf,
1158 c + adi16ibuf,adi16ilbuf,adi16inlbuf
1160 c CALL addftraffic(16)
1161 c IF (adi16ilbuf.ne.-1) THEN
1163 c adi16inlbuf = .FALSE.
1165 c IF (adi16ibuf.ge.512) THEN
1167 c CALL PUSHINTEGER16ARRAY(adi16buf, 512)
1168 c CALL addftraffic(-8192)
1171 c adi16buf(adi16ibuf) = x
1172 c adi16ibuf = adi16ibuf+1
1176 c SUBROUTINE LOOKINTEGER16(x)
1177 c INTEGER*16 x, adi16buf(512), adi16lbuf(512)
1178 c INTEGER adi16ibuf,adi16ilbuf
1179 c LOGICAL adi16inlbuf
1180 c COMMON /adi16fbuf/adi16buf,adi16lbuf,
1181 c + adi16ibuf,adi16ilbuf,adi16inlbuf
1183 c IF (adi16ilbuf.eq.-1) THEN
1184 c adi16ilbuf=adi16ibuf
1185 c CALL RESETADLOOKSTACK()
1187 c IF (adi16ilbuf.le.1) THEN
1188 c CALL LOOKINTEGER16ARRAY(adi16lbuf, 512)
1189 c adi16inlbuf = .TRUE.
1191 c x = adi16lbuf(512)
1193 c adi16ilbuf = adi16ilbuf-1
1194 c if (adi16inlbuf) THEN
1195 c x = adi16lbuf(adi16ilbuf)
1197 c x = adi16buf(adi16ilbuf)
1202 c SUBROUTINE POPINTEGER16(x)
1203 c INTEGER*16 x, adi16buf(512), adi16lbuf(512)
1204 c INTEGER adi16ibuf,adi16ilbuf
1205 c LOGICAL adi16inlbuf
1206 c COMMON /adi16fbuf/adi16buf,adi16lbuf,
1207 c + adi16ibuf,adi16ilbuf,adi16inlbuf
1209 c IF (adi16ilbuf.ne.-1) THEN
1211 c adi16inlbuf = .FALSE.
1213 c IF (adi16ibuf.le.1) THEN
1214 c CALL POPINTEGER16ARRAY(adi16buf, 512)
1218 c adi16ibuf = adi16ibuf-1
1219 c x = adi16buf(adi16ibuf)
1223 c======================= REAL*32 =========================
1224 c BLOCK DATA REALS32
1225 c REAL*32 adr32buf(512), adr32lbuf(512)
1226 c INTEGER adr32ibuf,adr32ilbuf
1227 c LOGICAL adr32inlbuf
1228 c COMMON /adr32fbuf/adr32buf,adr32lbuf,
1229 c + adr32ibuf,adr32ilbuf,adr32inlbuf
1231 c DATA adr32ilbuf/-1/
1232 c DATA adr32inlbuf/.FALSE./
1235 c SUBROUTINE PUSHREAL32(x)
1236 c REAL*32 x, adr32buf(512), adr32lbuf(512)
1237 c INTEGER adr32ibuf,adr32ilbuf
1238 c LOGICAL adr32inlbuf
1239 c COMMON /adr32fbuf/adr32buf,adr32lbuf,
1240 c + adr32ibuf,adr32ilbuf,adr32inlbuf
1242 c CALL addftraffic(32)
1243 c IF (adr32ilbuf.ne.-1) THEN
1245 c adr32inlbuf = .FALSE.
1247 c IF (adr32ibuf.ge.512) THEN
1249 c CALL PUSHREAL32ARRAY(adr32buf, 512)
1250 c CALL addftraffic(-16384)
1253 c adr32buf(adr32ibuf) = x
1254 c adr32ibuf = adr32ibuf+1
1258 c SUBROUTINE LOOKREAL32(x)
1259 c REAL*32 x, adr32buf(512), adr32lbuf(512)
1260 c INTEGER adr32ibuf,adr32ilbuf
1261 c LOGICAL adr32inlbuf
1262 c COMMON /adr32fbuf/adr32buf,adr32lbuf,
1263 c + adr32ibuf,adr32ilbuf,adr32inlbuf
1265 c IF (adr32ilbuf.eq.-1) THEN
1266 c adr32ilbuf=adr32ibuf
1267 c CALL RESETADLOOKSTACK()
1269 c IF (adr32ilbuf.le.1) THEN
1270 c CALL LOOKREAL32ARRAY(adr32lbuf, 512)
1271 c adr32inlbuf = .TRUE.
1273 c x = adr32lbuf(512)
1275 c adr32ilbuf = adr32ilbuf-1
1276 c if (adr32inlbuf) THEN
1277 c x = adr32lbuf(adr32ilbuf)
1279 c x = adr32buf(adr32ilbuf)
1284 c SUBROUTINE POPREAL32(x)
1285 c REAL*32 x, adr32buf(512), adr32lbuf(512)
1286 c INTEGER adr32ibuf,adr32ilbuf
1287 c LOGICAL adr32inlbuf
1288 c COMMON /adr32fbuf/adr32buf,adr32lbuf,
1289 c + adr32ibuf,adr32ilbuf,adr32inlbuf
1291 c IF (adr32ilbuf.ne.-1) THEN
1293 c adr32inlbuf = .FALSE.
1295 c IF (adr32ibuf.le.1) THEN
1296 c CALL POPREAL32ARRAY(adr32buf, 512)
1300 c adr32ibuf = adr32ibuf-1
1301 c x = adr32buf(adr32ibuf)
1305 c======================= COMPLEX*4 =========================
1306 c BLOCK DATA COMPLEXS4
1307 c COMPLEX*4 adc4buf(512), adc4lbuf(512)
1308 c INTEGER adc4ibuf,adc4ilbuf
1309 c LOGICAL adc4inlbuf
1310 c COMMON /adc4fbuf/adc4buf,adc4lbuf,
1311 c + adc4ibuf,adc4ilbuf,adc4inlbuf
1313 c DATA adc4ilbuf/-1/
1314 c DATA adc4inlbuf/.FALSE./
1317 c SUBROUTINE PUSHCOMPLEX4(x)
1318 c COMPLEX*4 x, adc4buf(512), adc4lbuf(512)
1319 c INTEGER adc4ibuf,adc4ilbuf
1320 c LOGICAL adc4inlbuf
1321 c COMMON /adc4fbuf/adc4buf,adc4lbuf,
1322 c + adc4ibuf,adc4ilbuf,adc4inlbuf
1324 c CALL addftraffic(4)
1325 c IF (adc4ilbuf.ne.-1) THEN
1327 c adc4inlbuf = .FALSE.
1329 c IF (adc4ibuf.ge.512) THEN
1331 c CALL PUSHCOMPLEX4ARRAY(adc4buf, 512)
1332 c CALL addftraffic(-2048)
1335 c adc4buf(adc4ibuf) = x
1336 c adc4ibuf = adc4ibuf+1
1340 c SUBROUTINE LOOKCOMPLEX4(x)
1341 c COMPLEX*4 x, adc4buf(512), adc4lbuf(512)
1342 c INTEGER adc4ibuf,adc4ilbuf
1343 c LOGICAL adc4inlbuf
1344 c COMMON /adc4fbuf/adc4buf,adc4lbuf,
1345 c + adc4ibuf,adc4ilbuf,adc4inlbuf
1347 c IF (adc4ilbuf.eq.-1) THEN
1348 c adc4ilbuf=adc4ibuf
1349 c CALL RESETADLOOKSTACK()
1351 c IF (adc4ilbuf.le.1) THEN
1352 c CALL LOOKCOMPLEX4ARRAY(adc4lbuf, 512)
1353 c adc4inlbuf = .TRUE.
1357 c adc4ilbuf = adc4ilbuf-1
1358 c if (adc4inlbuf) THEN
1359 c x = adc4lbuf(adc4ilbuf)
1361 c x = adc4buf(adc4ilbuf)
1366 c SUBROUTINE POPCOMPLEX4(x)
1367 c COMPLEX*4 x, adc4buf(512), adc4lbuf(512)
1368 c INTEGER adc4ibuf,adc4ilbuf
1369 c LOGICAL adc4inlbuf
1370 c COMMON /adc4fbuf/adc4buf,adc4lbuf,
1371 c + adc4ibuf,adc4ilbuf,adc4inlbuf
1373 c IF (adc4ilbuf.ne.-1) THEN
1375 c adc4inlbuf = .FALSE.
1377 c IF (adc4ibuf.le.1) THEN
1378 c CALL POPCOMPLEX4ARRAY(adc4buf, 512)
1382 c adc4ibuf = adc4ibuf-1
1383 c x = adc4buf(adc4ibuf)
1387 c======================= COMPLEX*32 =========================
1388 c BLOCK DATA COMPLEXS32
1389 c COMPLEX*32 adc32buf(512), adc32lbuf(512)
1390 c INTEGER adc32ibuf,adc32ilbuf
1391 c LOGICAL adc32inlbuf
1392 c COMMON /adc32fbuf/adc32buf,adc32lbuf,
1393 c + adc32ibuf,adc32ilbuf,adc32inlbuf
1395 c DATA adc32ilbuf/-1/
1396 c DATA adc32inlbuf/.FALSE./
1399 c SUBROUTINE PUSHCOMPLEX32(x)
1400 c COMPLEX*32 x, adc32buf(512), adc32lbuf(512)
1401 c INTEGER adc32ibuf,adc32ilbuf
1402 c LOGICAL adc32inlbuf
1403 c COMMON /adc32fbuf/adc32buf,adc32lbuf,
1404 c + adc32ibuf,adc32ilbuf,adc32inlbuf
1406 c CALL addftraffic(32)
1407 c IF (adc32ilbuf.ne.-1) THEN
1409 c adc32inlbuf = .FALSE.
1411 c IF (adc32ibuf.ge.512) THEN
1413 c CALL PUSHCOMPLEX32ARRAY(adc32buf, 512)
1414 c CALL addftraffic(-16384)
1417 c adc32buf(adc32ibuf) = x
1418 c adc32ibuf = adc32ibuf+1
1422 c SUBROUTINE LOOKCOMPLEX32(x)
1423 c COMPLEX*32 x, adc32buf(512), adc32lbuf(512)
1424 c INTEGER adc32ibuf,adc32ilbuf
1425 c LOGICAL adc32inlbuf
1426 c COMMON /adc32fbuf/adc32buf,adc32lbuf,
1427 c + adc32ibuf,adc32ilbuf,adc32inlbuf
1429 c IF (adc32ilbuf.eq.-1) THEN
1430 c adc32ilbuf=adc32ibuf
1431 c CALL RESETADLOOKSTACK()
1433 c IF (adc32ilbuf.le.1) THEN
1434 c CALL LOOKCOMPLEX32ARRAY(adc32lbuf, 512)
1435 c adc32inlbuf = .TRUE.
1437 c x = adc32lbuf(512)
1439 c adc32ilbuf = adc32ilbuf-1
1440 c if (adc32inlbuf) THEN
1441 c x = adc32lbuf(adc32ilbuf)
1443 c x = adc32buf(adc32ilbuf)
1448 c SUBROUTINE POPCOMPLEX32(x)
1449 c COMPLEX*32 x, adc32buf(512), adc32lbuf(512)
1450 c INTEGER adc32ibuf,adc32ilbuf
1451 c LOGICAL adc32inlbuf
1452 c COMMON /adc32fbuf/adc32buf,adc32lbuf,
1453 c + adc32ibuf,adc32ilbuf,adc32inlbuf
1455 c IF (adc32ilbuf.ne.-1) THEN
1457 c adc32inlbuf = .FALSE.
1459 c IF (adc32ibuf.le.1) THEN
1460 c CALL POPCOMPLEX32ARRAY(adc32buf, 512)
1464 c adc32ibuf = adc32ibuf-1
1465 c x = adc32buf(adc32ibuf)
1469 C========================================================
1470 C HOW TO CREATE PUSH* POP* SUBROUTINES
1471 C YET FOR OTHER DATA TYPES
1472 C ** Duplicate the commented program lines below
1473 c ** In the duplicated subroutines, replace:
1474 c TTTT by the basic name of the type
1475 c z9 by the initial and size of the type
1476 c (integer:i real:r complex:c boolean:b character:s)
1477 c 9 by the size of the type
1478 c ** Uncomment the duplicated subroutines
1479 C ** Don't forget to insert the corresponding lines in
1480 C subroutine PRINTBUFFERTOP, otherwise these types'
1481 C contribution to buffer occupation will not be seen.
1482 C (not very important anyway...)
1484 c======================= TTTT*9 =========================
1486 c TTTT*9 adz9buf(512), adz9lbuf(512)
1487 c INTEGER adz9ibuf,adz9ilbuf
1488 c LOGICAL adz9inlbuf
1489 c COMMON /adz9fbuf/adz9buf,adz9lbuf,
1490 c + adz9ibuf,adz9ilbuf,adz9inlbuf
1492 c DATA adz9ilbuf/-1/
1493 c DATA adz9inlbuf/.FALSE./
1496 c SUBROUTINE PUSHTTTT9(x)
1497 c TTTT*9 x, adz9buf(512), adz9lbuf(512)
1498 c INTEGER adz9ibuf,adz9ilbuf
1499 c LOGICAL adz9inlbuf
1500 c COMMON /adz9fbuf/adz9buf,adz9lbuf,
1501 c + adz9ibuf,adz9ilbuf,adz9inlbuf
1503 c CALL addftraffic(9)
1504 c IF (adz9ilbuf.ne.-1) THEN
1506 c adz9inlbuf = .FALSE.
1508 c IF (adz9ibuf.ge.512) THEN
1510 c CALL PUSHTTTT9ARRAY(adz9buf, 512)
1511 c CALL addftraffic(-9*512)
1514 c adz9buf(adz9ibuf) = x
1515 c adz9ibuf = adz9ibuf+1
1519 c SUBROUTINE LOOKTTTT9(x)
1520 c TTTT*9 x, adz9buf(512), adz9lbuf(512)
1521 c INTEGER adz9ibuf,adz9ilbuf
1522 c LOGICAL adz9inlbuf
1523 c COMMON /adz9fbuf/adz9buf,adz9lbuf,
1524 c + adz9ibuf,adz9ilbuf,adz9inlbuf
1526 c IF (adz9ilbuf.eq.-1) THEN
1527 c adz9ilbuf=adz9ibuf
1528 c CALL RESETADLOOKSTACK()
1530 c IF (adz9ilbuf.le.1) THEN
1531 c CALL LOOKTTTT9ARRAY(adz9lbuf, 512)
1532 c adz9inlbuf = .TRUE.
1536 c adz9ilbuf = adz9ilbuf-1
1537 c if (adz9inlbuf) THEN
1538 c x = adz9lbuf(adz9ilbuf)
1540 c x = adz9buf(adz9ilbuf)
1545 c SUBROUTINE POPTTTT9(x)
1546 c TTTT*9 x, adz9buf(512), adz9lbuf(512)
1547 c INTEGER adz9ibuf,adz9ilbuf
1548 c LOGICAL adz9inlbuf
1549 c COMMON /adz9fbuf/adz9buf,adz9lbuf,
1550 c + adz9ibuf,adz9ilbuf,adz9inlbuf
1552 c IF (adz9ilbuf.ne.-1) THEN
1554 c adz9inlbuf = .FALSE.
1556 c IF (adz9ibuf.le.1) THEN
1557 c CALL POPTTTT9ARRAY(adz9buf, 512)
1561 c adz9ibuf = adz9ibuf-1
1562 c x = adz9buf(adz9ibuf)