forked from alisw/POWHEG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcernroutines.f
2386 lines (1792 loc) · 65 KB
/
cernroutines.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
c# 1 "dilog64.F"
c# 1 "<built-in>"
c# 1 "<command line>"
c# 1 "dilog64.F"
*
* $Id: dilog64.F,v 1.1.1.1 1996/04/01 15:02:05 mclareni Exp $
*
* $Log: dilog64.F,v $
* Revision 1.1.1.1 1996/04/01 15:02:05 mclareni
* Mathlib gen
*
*
c# 1 "/usr/local/home/video/cernlib/2005/include/gen/pilot.h" 1
c# 40 "/usr/local/home/video/cernlib/2005/include/gen/pilot.h"
c# 57 "/usr/local/home/video/cernlib/2005/include/gen/pilot.h"
c# 10 "dilog64.F" 2
FUNCTION DDILOG(X)
c# 1 "/usr/local/home/video/cernlib/2005/include/gen/imp64.inc" 1
*
* $Id: imp64.inc,v 1.1.1.1 1996/04/01 15:02:59 mclareni Exp $
*
* $Log: imp64.inc,v $
* Revision 1.1.1.1 1996/04/01 15:02:59 mclareni
* Mathlib gen
*
*
* imp64.inc
*
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
c# 13 "dilog64.F" 2
DIMENSION C(0:19)
PARAMETER (Z1 = 1, HF = Z1/2)
PARAMETER (PI = 3.14159 26535 89793 24D0)
PARAMETER (PI3 = PI**2/3, PI6 = PI**2/6, PI12 = PI**2/12)
DATA C( 0) / 0.42996 69356 08136 97D0/
DATA C( 1) / 0.40975 98753 30771 05D0/
DATA C( 2) /-0.01858 84366 50145 92D0/
DATA C( 3) / 0.00145 75108 40622 68D0/
DATA C( 4) /-0.00014 30418 44423 40D0/
DATA C( 5) / 0.00001 58841 55418 80D0/
DATA C( 6) /-0.00000 19078 49593 87D0/
DATA C( 7) / 0.00000 02419 51808 54D0/
DATA C( 8) /-0.00000 00319 33412 74D0/
DATA C( 9) / 0.00000 00043 45450 63D0/
DATA C(10) /-0.00000 00006 05784 80D0/
DATA C(11) / 0.00000 00000 86120 98D0/
DATA C(12) /-0.00000 00000 12443 32D0/
DATA C(13) / 0.00000 00000 01822 56D0/
DATA C(14) /-0.00000 00000 00270 07D0/
DATA C(15) / 0.00000 00000 00040 42D0/
DATA C(16) /-0.00000 00000 00006 10D0/
DATA C(17) / 0.00000 00000 00000 93D0/
DATA C(18) /-0.00000 00000 00000 14D0/
DATA C(19) /+0.00000 00000 00000 02D0/
IF(X .EQ. 1) THEN
H=PI6
ELSEIF(X .EQ. -1) THEN
H=-PI12
ELSE
T=-X
IF(T .LE. -2) THEN
Y=-1/(1+T)
S=1
A=-PI3+HF*(LOG(-T)**2-LOG(1+1/T)**2)
ELSEIF(T .LT. -1) THEN
Y=-1-T
S=-1
A=LOG(-T)
A=-PI6+A*(A+LOG(1+1/T))
ELSE IF(T .LE. -HF) THEN
Y=-(1+T)/T
S=1
A=LOG(-T)
A=-PI6+A*(-HF*A+LOG(1+T))
ELSE IF(T .LT. 0) THEN
Y=-T/(1+T)
S=-1
A=HF*LOG(1+T)**2
ELSE IF(T .LE. 1) THEN
Y=T
S=1
A=0
ELSE
Y=1/T
S=-1
A=PI6+HF*LOG(T)**2
ENDIF
H=Y+Y-1
ALFA=H+H
B1=0
B2=0
DO 1 I = 19,0,-1
B0=C(I)+ALFA*B1-B2
B2=B1
1 B1=B0
H=-(S*(B0-H*B2)+A)
ENDIF
DDILOG=H
RETURN
END
*
* $Id: dzero.F,v 1.1.1.1 1996/02/15 17:49:07 mclareni Exp $
*
* $Log: dzero.F,v $
* Revision 1.1.1.1 1996/02/15 17:49:07 mclareni
* Kernlib
*
SUBROUTINE DZERO(A,B,X0,R,EPS,MXF,F)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
*
* $Id: c205body.inc,v 1.1.1.1 1996/02/15 17:49:07 mclareni Exp $
*
* $Log: c205body.inc,v $
* Revision 1.1.1.1 1996/02/15 17:49:07 mclareni
* Kernlib
*
*
*
*
* c205body.inc
*
LOGICAL MFLAG,RFLAG
EXTERNAL F
PARAMETER (ONE = 1, HALF = ONE/2)
XA=MIN(A,B)
XB=MAX(A,B)
FA=F(XA,1)
FB=F(XB,2)
IF(FA*FB .GT. 0) GO TO 5
MC=0
1 X0=HALF*(XA+XB)
R=X0-XA
EE=EPS*(ABS(X0)+1)
IF(R .LE. EE) GO TO 4
F1=FA
X1=XA
F2=FB
X2=XB
2 FX=F(X0,2)
MC=MC+1
IF(MC .GT. MXF) GO TO 6
IF(FX*FA .GT. 0) THEN
XA=X0
FA=FX
ELSE
XB=X0
FB=FX
END IF
3 U1=F1-F2
U2=X1-X2
U3=F2-FX
U4=X2-X0
IF(U2 .EQ. 0 .OR. U4 .EQ. 0) GO TO 1
F3=FX
X3=X0
U1=U1/U2
U2=U3/U4
CA=U1-U2
CB=(X1+X2)*U2-(X2+X0)*U1
CC=(X1-X0)*F1-X1*(CA*X1+CB)
IF(CA .EQ. 0) THEN
IF(CB .EQ. 0) GO TO 1
X0=-CC/CB
ELSE
U3=CB/(2*CA)
U4=U3*U3-CC/CA
IF(U4 .LT. 0) GO TO 1
X0=-U3+SIGN(SQRT(U4),X0+U3)
END IF
IF(X0 .LT. XA .OR. X0 .GT. XB) GO TO 1
R=MIN(ABS(X0-X3),ABS(X0-X2))
EE=EPS*(ABS(X0)+1)
IF(R .GT. EE) THEN
F1=F2
X1=X2
F2=F3
X2=X3
GO TO 2
END IF
FX=F(X0,2)
IF(FX .EQ. 0) GO TO 4
IF(FX*FA .LT. 0) THEN
XX=X0-EE
IF(XX .LE. XA) GO TO 4
FF=F(XX,2)
FB=FF
XB=XX
ELSE
XX=X0+EE
IF(XX .GE. XB) GO TO 4
FF=F(XX,2)
FA=FF
XA=XX
END IF
IF(FX*FF .GT. 0) THEN
MC=MC+2
IF(MC .GT. MXF) GO TO 6
F1=F3
X1=X3
F2=FX
X2=X0
X0=XX
FX=FF
GO TO 3
END IF
4 R=EE
FF=F(X0,3)
RETURN
5 CALL KERMTR('C205.1',LGFILE,MFLAG,RFLAG)
IF(MFLAG) THEN
IF(LGFILE .EQ. 0) WRITE(*,100)
IF(LGFILE .NE. 0) WRITE(LGFILE,100)
END IF
IF(.NOT.RFLAG) CALL ABEND
R=-2*(XB-XA)
X0=0
RETURN
6 CALL KERMTR('C205.2',LGFILE,MFLAG,RFLAG)
IF(MFLAG) THEN
IF(LGFILE .EQ. 0) WRITE(*,101)
IF(LGFILE .NE. 0) WRITE(LGFILE,101)
END IF
IF(.NOT.RFLAG) CALL ABEND
R=-HALF*ABS(XB-XA)
X0=0
RETURN
100 FORMAT(1X,'***** CERN C205 DZERO ... F(A) AND F(B)',
1 ' HAVE THE SAME SIGN')
101 FORMAT(1X,'***** CERN C205 DZERO ... TOO MANY FUNCTION CALLS')
END
c# 1 "kerset.F"
c# 1 "<built-in>"
c# 1 "<command line>"
c# 1 "kerset.F"
*
* $Id: kerset.F,v 1.1.1.1 1996/02/15 17:48:35 mclareni Exp $
*
* $Log: kerset.F,v $
* Revision 1.1.1.1 1996/02/15 17:48:35 mclareni
* Kernlib
*
*
c# 1 "/usr/local/home/video/cernlib/2005/include/kernnum/pilot.h" 1
c# 21 "/usr/local/home/video/cernlib/2005/include/kernnum/pilot.h"
c# 33 "/usr/local/home/video/cernlib/2005/include/kernnum/pilot.h"
c# 10 "kerset.F" 2
SUBROUTINE KERSET(ERCODE,LGFILE,LIMITM,LIMITR)
PARAMETER(KOUNTE = 27)
CHARACTER*6 ERCODE, CODE(KOUNTE)
LOGICAL MFLAG, RFLAG
INTEGER KNTM(KOUNTE), KNTR(KOUNTE)
DATA LOGF / 0 /
DATA CODE(1), KNTM(1), KNTR(1) / 'C204.1', 255, 255 /
DATA CODE(2), KNTM(2), KNTR(2) / 'C204.2', 255, 255 /
DATA CODE(3), KNTM(3), KNTR(3) / 'C204.3', 255, 255 /
DATA CODE(4), KNTM(4), KNTR(4) / 'C205.1', 255, 255 /
DATA CODE(5), KNTM(5), KNTR(5) / 'C205.2', 255, 255 /
DATA CODE(6), KNTM(6), KNTR(6) / 'C305.1', 255, 255 /
DATA CODE(7), KNTM(7), KNTR(7) / 'C308.1', 255, 255 /
DATA CODE(8), KNTM(8), KNTR(8) / 'C312.1', 255, 255 /
DATA CODE(9), KNTM(9), KNTR(9) / 'C313.1', 255, 255 /
DATA CODE(10),KNTM(10),KNTR(10) / 'C336.1', 255, 255 /
DATA CODE(11),KNTM(11),KNTR(11) / 'C337.1', 255, 255 /
DATA CODE(12),KNTM(12),KNTR(12) / 'C341.1', 255, 255 /
DATA CODE(13),KNTM(13),KNTR(13) / 'D103.1', 255, 255 /
DATA CODE(14),KNTM(14),KNTR(14) / 'D106.1', 255, 255 /
DATA CODE(15),KNTM(15),KNTR(15) / 'D209.1', 255, 255 /
DATA CODE(16),KNTM(16),KNTR(16) / 'D509.1', 255, 255 /
DATA CODE(17),KNTM(17),KNTR(17) / 'E100.1', 255, 255 /
DATA CODE(18),KNTM(18),KNTR(18) / 'E104.1', 255, 255 /
DATA CODE(19),KNTM(19),KNTR(19) / 'E105.1', 255, 255 /
DATA CODE(20),KNTM(20),KNTR(20) / 'E208.1', 255, 255 /
DATA CODE(21),KNTM(21),KNTR(21) / 'E208.2', 255, 255 /
DATA CODE(22),KNTM(22),KNTR(22) / 'F010.1', 255, 0 /
DATA CODE(23),KNTM(23),KNTR(23) / 'F011.1', 255, 0 /
DATA CODE(24),KNTM(24),KNTR(24) / 'F012.1', 255, 0 /
DATA CODE(25),KNTM(25),KNTR(25) / 'F406.1', 255, 0 /
DATA CODE(26),KNTM(26),KNTR(26) / 'G100.1', 255, 255 /
DATA CODE(27),KNTM(27),KNTR(27) / 'G100.2', 255, 255 /
LOGF = LGFILE
L = 0
IF(ERCODE .NE. ' ') THEN
DO 10 L = 1, 6
IF(ERCODE(1:L) .EQ. ERCODE) GOTO 12
10 CONTINUE
12 CONTINUE
ENDIF
DO 14 I = 1, KOUNTE
IF(L .EQ. 0) GOTO 13
IF(CODE(I)(1:L) .NE. ERCODE(1:L)) GOTO 14
13 IF(LIMITM.GE.0) KNTM(I) = LIMITM
IF(LIMITR.GE.0) KNTR(I) = LIMITR
14 CONTINUE
RETURN
ENTRY KERMTR(ERCODE,LOG,MFLAG,RFLAG)
LOG = LOGF
DO 20 I = 1, KOUNTE
IF(ERCODE .EQ. CODE(I)) GOTO 21
20 CONTINUE
WRITE(*,1000) ERCODE
CALL ABEND
RETURN
21 RFLAG = KNTR(I) .GE. 1
IF(RFLAG .AND. (KNTR(I) .LT. 255)) KNTR(I) = KNTR(I) - 1
MFLAG = KNTM(I) .GE. 1
IF(MFLAG .AND. (KNTM(I) .LT. 255)) KNTM(I) = KNTM(I) - 1
IF(.NOT. RFLAG) THEN
IF(LOGF .LT. 1) THEN
WRITE(*,1001) CODE(I)
ELSE
WRITE(LOGF,1001) CODE(I)
ENDIF
ENDIF
IF(MFLAG .AND. RFLAG) THEN
IF(LOGF .LT. 1) THEN
WRITE(*,1002) CODE(I)
ELSE
WRITE(LOGF,1002) CODE(I)
ENDIF
ENDIF
RETURN
1000 FORMAT(' KERNLIB LIBRARY ERROR. ' /
+ ' ERROR CODE ',A6,' NOT RECOGNIZED BY KERMTR',
+ ' ERROR MONITOR. RUN ABORTED.')
1001 FORMAT(/' ***** RUN TERMINATED BY CERN LIBRARY ERROR ',
+ 'CONDITION ',A6)
1002 FORMAT(/' ***** CERN LIBRARY ERROR CONDITION ',A6)
END
c# 1 "rm48.F"
c# 1 "<built-in>"
c# 1 "<command line>"
c# 1 "rm48.F"
*
* $Id: rm48.F,v 1.2 1996/12/12 16:32:06 cernlib Exp $
*
* $Log: rm48.F,v $
* Revision 1.2 1996/12/12 16:32:06 cernlib
* Variables ONE and ZERO added to SAVE statement, courtesy R.Veenhof
*
* Revision 1.1.1.1 1996/04/01 15:02:55 mclareni
* Mathlib gen
*
*
c# 1 "/usr/local/home/video/cernlib/2005/include/gen/pilot.h" 1
c# 40 "/usr/local/home/video/cernlib/2005/include/gen/pilot.h"
c# 57 "/usr/local/home/video/cernlib/2005/include/gen/pilot.h"
c# 13 "rm48.F" 2
SUBROUTINE RM48(RVEC,LENV)
C Double-precision version of
C Universal random number generator proposed by Marsaglia and Zaman
C in report FSU-SCRI-87-50
C based on RANMAR, modified by F. James, to generate vectors
C of pseudorandom numbers RVEC of length LENV, where the numbers
C in RVEC are numbers with at least 48-bit mantissas.
C Input and output entry points: RM48IN, RM48UT.
C!!! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C!!! Calling sequences for RM48: ++
C!!! CALL RM48 (RVEC, LEN) returns a vector RVEC of LEN ++
C!!! 64-bit random floating point numbers between ++
C!!! zero and one. ++
C!!! CALL RM48IN(I1,N1,N2) initializes the generator from one ++
C!!! 64-bit integer I1, and number counts N1,N2 ++
C!!! (for initializing, set N1=N2=0, but to restart ++
C!!! a previously generated sequence, use values ++
C!!! output by RM48UT) ++
C!!! CALL RM48UT(I1,N1,N2) outputs the value of the original ++
C!!! seed and the two number counts, to be used ++
C!!! for restarting by initializing to I1 and ++
C!!! skipping N2*100000000+N1 numbers. ++
C!!! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C for 32-bit machines, use IMPLICIT DOUBLE PRECISION
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
DIMENSION RVEC(*)
COMMON/R48ST1/U(97),C,I97,J97
PARAMETER (MODCNS=1000000000)
SAVE CD, CM, TWOM24, NTOT, NTOT2, IJKL,TWOM49, ONE, ZERO
save /R48ST1/
DATA NTOT,NTOT2,IJKL/-1,0,0/
C
IF (NTOT .GE. 0) GO TO 50
C
C Default initialization. User has called RM48 without RM48IN.
IJKL = 54217137
NTOT = 0
NTOT2 = 0
KALLED = 0
GO TO 1
C
ENTRY RM48IN(IJKLIN, NTOTIN,NTOT2N)
C Initializing routine for RM48, may be called before
C generating pseudorandom numbers with RM48. The input
C values should be in the ranges: 0<=IJKLIN<=900 OOO OOO
C 0<=NTOTIN<=999 999 999
C 0<=NTOT2N<<999 999 999!
C To get the standard values in Marsaglia's paper, IJKLIN=54217137
C NTOTIN,NTOT2N=0
IJKL = IJKLIN
NTOT = MAX(NTOTIN,0)
NTOT2= MAX(NTOT2N,0)
KALLED = 1
C always come here to initialize
1 CONTINUE
IJ = IJKL/30082
KL = IJKL - 30082*IJ
I = MOD(IJ/177, 177) + 2
J = MOD(IJ, 177) + 2
K = MOD(KL/169, 178) + 1
L = MOD(KL, 169)
WRITE(6,'(A,I10,2X,2I10)') ' RM48 INITIALIZED:',IJKL,NTOT,NTOT2
CCC PRINT '(A,4I10)', ' I,J,K,L= ',I,J,K,L
ONE = 1.
HALF = 0.5
ZERO = 0.
DO 2 II= 1, 97
S = 0.
T = HALF
DO 3 JJ= 1, 48
M = MOD(MOD(I*J,179)*K, 179)
I = J
J = K
K = M
L = MOD(53*L+1, 169)
IF (MOD(L*M,64) .GE. 32) S = S+T
3 T = HALF*T
2 U(II) = S
TWOM49 = T
TWOM24 = ONE
DO 4 I24= 1, 24
4 TWOM24 = HALF*TWOM24
C = 362436.*TWOM24
CD = 7654321.*TWOM24
CM = 16777213.*TWOM24
I97 = 97
J97 = 33
C Complete initialization by skipping
C (NTOT2*MODCNS + NTOT) random numbers
DO 45 LOOP2= 1, NTOT2+1
NOW = MODCNS
IF (LOOP2 .EQ. NTOT2+1) NOW=NTOT
IF (NOW .GT. 0) THEN
WRITE(6,'(A,I15)') ' RM48IN SKIPPING OVER ',NOW
c Bug! fixed by P. Nason, 13/12/2012
c DO 40 IDUM = 1, NTOT
DO 40 IDUM = 1, NOW
UNI = U(I97)-U(J97)
IF (UNI .LT. ZERO) UNI=UNI+ONE
U(I97) = UNI
I97 = I97-1
IF (I97 .EQ. 0) I97=97
J97 = J97-1
IF (J97 .EQ. 0) J97=97
C = C - CD
IF (C .LT. ZERO) C=C+CM
40 CONTINUE
ENDIF
45 CONTINUE
IF (KALLED .EQ. 1) RETURN
C
C Normal entry to generate LENV random numbers
50 CONTINUE
DO 100 IVEC= 1, LENV
UNI = U(I97)-U(J97)
IF (UNI .LT. ZERO) UNI=UNI+ONE
U(I97) = UNI
I97 = I97-1
IF (I97 .EQ. 0) I97=97
J97 = J97-1
IF (J97 .EQ. 0) J97=97
C = C - CD
IF (C .LT. ZERO) C=C+CM
UNI = UNI-C
IF (UNI .LT. ZERO) UNI=UNI+ONE
RVEC(IVEC) = UNI
C Replace exact zeros by 2**-49
IF (UNI .EQ. ZERO) THEN
RVEC(IVEC) = TWOM49
ENDIF
100 CONTINUE
NTOT = NTOT + LENV
IF (NTOT .GE. MODCNS) THEN
NTOT2 = NTOT2 + 1
NTOT = NTOT - MODCNS
ENDIF
RETURN
C Entry to output current status
ENTRY RM48UT(IJKLUT,NTOTUT,NTOT2T)
IJKLUT = IJKL
NTOTUT = NTOT
NTOT2T = NTOT2
RETURN
END
c# 1 "abend.F"
c# 1 "<built-in>"
c# 1 "<command line>"
c# 1 "abend.F"
*
* $Id: abend.F,v 1.1.1.1 1996/02/15 17:50:37 mclareni Exp $
*
* $Log: abend.F,v $
* Revision 1.1.1.1 1996/02/15 17:50:37 mclareni
* Kernlib
*
*
c# 1 "/usr/local/home/video/cernlib/2005/include/kerngen/pilot.h" 1
c# 94 "/usr/local/home/video/cernlib/2005/include/kerngen/pilot.h"
c# 10 "abend.F" 2
SUBROUTINE ABEND
C
C CERN PROGLIB# Z035 ABEND .VERSION KERNFOR 4.31 911111
C ORIG. 8/02/88 JZ
C
STOP 7
END
c# 1 "lenocc.F"
c# 1 "<built-in>"
c# 1 "<command line>"
c# 1 "lenocc.F"
*
* $Id: lenocc.F,v 1.1.1.1 1996/02/15 17:49:49 mclareni Exp $
*
* $Log: lenocc.F,v $
* Revision 1.1.1.1 1996/02/15 17:49:49 mclareni
* Kernlib
*
*
c# 1 "/usr/local/home/video/cernlib/2005/include/kerngen/pilot.h" 1
c# 94 "/usr/local/home/video/cernlib/2005/include/kerngen/pilot.h"
c# 10 "lenocc.F" 2
FUNCTION LENOCC (CHV)
C
C CERN PROGLIB# M507 LENOCC .VERSION KERNFOR 4.21 890323
C ORIG. March 85, A.Petrilli, re-write 21/02/89, JZ
C
C- Find last non-blank character in CHV
CHARACTER CHV*(*)
N = LEN(CHV)
DO 17 JJ= N,1,-1
IF (CHV(JJ:JJ).NE.' ') GO TO 99
17 CONTINUE
JJ = 0
99 LENOCC = JJ
RETURN
END
c# 1 "mtlset.F"
c# 1 "<built-in>"
c# 1 "<command line>"
c# 1 "mtlset.F"
*
* $Id: mtlset.F,v 1.1.1.1 1996/04/01 15:02:53 mclareni Exp $
*
* $Log: mtlset.F,v $
* Revision 1.1.1.1 1996/04/01 15:02:53 mclareni
* Mathlib gen
*
*
c# 1 "/usr/local/home/video/cernlib/2005/include/gen/pilot.h" 1
c# 40 "/usr/local/home/video/cernlib/2005/include/gen/pilot.h"
c# 57 "/usr/local/home/video/cernlib/2005/include/gen/pilot.h"
c# 10 "mtlset.F" 2
SUBROUTINE MTLSET(ERC,NLG,MXM,MXR)
PARAMETER (KTE = 132)
CHARACTER*6 ERC,CODE(KTE)
LOGICAL LMF,LRF
DIMENSION KNTM(KTE),KNTR(KTE)
DATA ILG /0/
C renumber the data statements after putting new codes in Unix with:
C awk -F'[()]' '{ printf"%s(%s)%s(%s)%s(%s)%s\n",$1,NR,$3,NR,$5,NR,$7 }'
C and modify KTE to the number of lines below
DATA CODE(1),KNTM(1),KNTR(1) / 'B100.1', 255, 255 /
DATA CODE(2),KNTM(2),KNTR(2) / 'B300.1', 255, 255 /
DATA CODE(3),KNTM(3),KNTR(3) / 'B300.2', 255, 255 /
DATA CODE(4),KNTM(4),KNTR(4) / 'C200.0', 255, 255 /
DATA CODE(5),KNTM(5),KNTR(5) / 'C200.1', 255, 255 /
DATA CODE(6),KNTM(6),KNTR(6) / 'C200.2', 255, 255 /
DATA CODE(7),KNTM(7),KNTR(7) / 'C200.3', 255, 255 /
DATA CODE(8),KNTM(8),KNTR(8) / 'C201.0', 255, 255 /
DATA CODE(9),KNTM(9),KNTR(9) / 'C202.0', 255, 255 /
DATA CODE(10),KNTM(10),KNTR(10) / 'C202.1', 255, 255 /
DATA CODE(11),KNTM(11),KNTR(11) / 'C202.2', 255, 255 /
DATA CODE(12),KNTM(12),KNTR(12) / 'C205.1', 255, 255 /
DATA CODE(13),KNTM(13),KNTR(13) / 'C205.2', 255, 255 /
DATA CODE(14),KNTM(14),KNTR(14) / 'C207.0', 255, 255 /
DATA CODE(15),KNTM(15),KNTR(15) / 'C208.0', 255, 255 /
DATA CODE(16),KNTM(16),KNTR(16) / 'C209.0', 255, 255 /
DATA CODE(17),KNTM(17),KNTR(17) / 'C209.1', 255, 255 /
DATA CODE(18),KNTM(18),KNTR(18) / 'C209.2', 255, 255 /
DATA CODE(19),KNTM(19),KNTR(19) / 'C209.3', 255, 255 /
DATA CODE(20),KNTM(20),KNTR(20) / 'C210.1', 255, 255 /
DATA CODE(21),KNTM(21),KNTR(21) / 'C302.1', 255, 255 /
DATA CODE(22),KNTM(22),KNTR(22) / 'C303.1', 255, 255 /
DATA CODE(23),KNTM(23),KNTR(23) / 'C304.1', 255, 255 /
DATA CODE(24),KNTM(24),KNTR(24) / 'C305.1', 255, 255 /
DATA CODE(25),KNTM(25),KNTR(25) / 'C306.1', 255, 255 /
DATA CODE(26),KNTM(26),KNTR(26) / 'C307.1', 255, 255 /
DATA CODE(27),KNTM(27),KNTR(27) / 'C312.1', 255, 255 /
DATA CODE(28),KNTM(28),KNTR(28) / 'C313.1', 255, 255 /
DATA CODE(29),KNTM(29),KNTR(29) / 'C315.1', 255, 255 /
DATA CODE(30),KNTM(30),KNTR(30) / 'C316.1', 255, 255 /
DATA CODE(31),KNTM(31),KNTR(31) / 'C316.2', 255, 255 /
DATA CODE(32),KNTM(32),KNTR(32) / 'C320.1', 255, 255 /
DATA CODE(33),KNTM(33),KNTR(33) / 'C321.1', 255, 255 /
DATA CODE(34),KNTM(34),KNTR(34) / 'C323.1', 255, 255 /
DATA CODE(35),KNTM(35),KNTR(35) / 'C327.1', 255, 255 /
DATA CODE(36),KNTM(36),KNTR(36) / 'C328.1', 255, 255 /
DATA CODE(37),KNTM(37),KNTR(37) / 'C328.2', 255, 255 /
DATA CODE(38),KNTM(38),KNTR(38) / 'C328.3', 255, 255 /
DATA CODE(39),KNTM(39),KNTR(39) / 'C330.1', 255, 255 /
DATA CODE(40),KNTM(40),KNTR(40) / 'C330.2', 255, 255 /
DATA CODE(41),KNTM(41),KNTR(41) / 'C330.3', 255, 255 /
DATA CODE(42),KNTM(42),KNTR(42) / 'C331.1', 255, 255 /
DATA CODE(43),KNTM(43),KNTR(43) / 'C331.2', 255, 255 /
DATA CODE(44),KNTM(44),KNTR(44) / 'C334.1', 255, 255 /
DATA CODE(45),KNTM(45),KNTR(45) / 'C334.2', 255, 255 /
DATA CODE(46),KNTM(46),KNTR(46) / 'C334.3', 255, 255 /
DATA CODE(47),KNTM(47),KNTR(47) / 'C334.4', 255, 255 /
DATA CODE(48),KNTM(48),KNTR(48) / 'C334.5', 255, 255 /
DATA CODE(49),KNTM(49),KNTR(49) / 'C334.6', 255, 255 /
DATA CODE(50),KNTM(50),KNTR(50) / 'C336.1', 255, 255 /
DATA CODE(51),KNTM(51),KNTR(51) / 'C337.1', 255, 255 /
DATA CODE(52),KNTM(52),KNTR(52) / 'C338.1', 255, 255 /
DATA CODE(53),KNTM(53),KNTR(53) / 'C340.1', 255, 255 /
DATA CODE(54),KNTM(54),KNTR(54) / 'C343.1', 255, 255 /
DATA CODE(55),KNTM(55),KNTR(55) / 'C343.2', 255, 255 /
DATA CODE(56),KNTM(56),KNTR(56) / 'C343.3', 255, 255 /
DATA CODE(57),KNTM(57),KNTR(57) / 'C343.4', 255, 255 /
DATA CODE(58),KNTM(58),KNTR(58) / 'C344.1', 255, 255 /
DATA CODE(59),KNTM(59),KNTR(59) / 'C344.2', 255, 255 /
DATA CODE(60),KNTM(60),KNTR(60) / 'C344.3', 255, 255 /
DATA CODE(61),KNTM(61),KNTR(61) / 'C344.4', 255, 255 /
DATA CODE(62),KNTM(62),KNTR(62) / 'C345.1', 255, 255 /
DATA CODE(63),KNTM(63),KNTR(63) / 'C346.1', 255, 255 /
DATA CODE(64),KNTM(64),KNTR(64) / 'C346.2', 255, 255 /
DATA CODE(65),KNTM(65),KNTR(65) / 'C346.3', 255, 255 /
DATA CODE(66),KNTM(66),KNTR(66) / 'C347.1', 255, 255 /
DATA CODE(67),KNTM(67),KNTR(67) / 'C347.2', 255, 255 /
DATA CODE(68),KNTM(68),KNTR(68) / 'C347.3', 255, 255 /
DATA CODE(69),KNTM(69),KNTR(69) / 'C347.4', 255, 255 /
DATA CODE(70),KNTM(70),KNTR(70) / 'C347.5', 255, 255 /
DATA CODE(71),KNTM(71),KNTR(71) / 'C347.6', 255, 255 /
DATA CODE(72),KNTM(72),KNTR(72) / 'C348.1', 255, 255 /