-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
hbook.f
4126 lines (4013 loc) · 161 KB
/
hbook.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
*-------------------------------------------------------------------------------
*
* This file contains the hbook's package subset needed to build h2root.
* It cannot be used by any hbook application because many hbook functionalities
* are missing.
*
*-------------------------------------------------------------------------------
SUBROUTINE HNTVAR2(ID1,IVAR,CHTAG,CHFULL,BLOCK,NSUB,ITYPE,ISIZE
+ ,NBITS,IELEM)
INTEGER ZBITS, ZNDIM, ZNOENT, ZNPRIM, ZNRZB, ZIFCON,
+ ZIFNAM, ZIFCHA, ZIFINT, ZIFREA, ZNWTIT, ZITIT1,
+ ZNCHRZ, ZDESC, ZLNAME, ZNAME, ZARIND, ZRANGE, ZNADDR,
+ ZIBLOK, ZNBLOK, ZLCONT, ZIFBIT, ZIBANK, ZIFTMP, ZITMP,
+ ZID, ZNTMP, ZNTMP1, ZLINK
PARAMETER(ZBITS=1, ZNDIM=2, ZNOENT=3, ZNPRIM=4, ZLCONT=6,
+ ZNRZB=5, ZIFCON=7, ZIFNAM=4, ZIFCHA=5, ZIFINT=6,
+ ZIFREA=7, ZNWTIT=8, ZITIT1=9, ZNCHRZ=13, ZIFBIT=8,
+ ZDESC=1, ZLNAME=2, ZNAME=3, ZRANGE=4, ZNADDR=12,
+ ZARIND=11, ZIBLOK=8, ZNBLOK=10, ZIBANK=9, ZIFTMP=11,
+ ZID=12, ZITMP=10, ZNTMP=6, ZNTMP1=3, ZLINK=6)
INTEGER ID ,IDBADD,LID ,IDLAST,IDHOLD,NBIT ,NBITCH,
+ NCHAR ,NRHIST,IERR ,NV
COMMON/HCFLAG/ID ,IDBADD,LID ,IDLAST,IDHOLD,NBIT ,NBITCH,
+ NCHAR ,NRHIST,IERR ,NV
INTEGER NWPAW,IXPAWC,IHDIV,IXHIGZ,IXKU, LMAIN
REAL FENC , HCV
COMMON/BIGBUF/BIGB(4000000)
character BIGB
COMMON/PAWC/NWPAW,IXPAWC,IHDIV,IXHIGZ,IXKU,FENC(5),LMAIN,
+HCV(4000000-11)
INTEGER IQ ,LQ
REAL Q
DIMENSION IQ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I24, I25, I26, I27,
+I28, I29, I30, I31, I32, I33, I34, I35, I123, I230
COMMON / HCBITS / I1, I2, I3, I4, I5, I6, I7, I8,
+ I9, I10, I11, I12, I13, I14, I15, I16,
+I17, I18, I19, I20, I21, I22, I23, I24, I25, I26, I27,
+I28, I29, I30, I31, I32, I33, I34, I35, I123, I230
CHARACTER*(*) CHTAG, CHFULL, BLOCK
CHARACTER*80 VAR
CHARACTER*32 NAME, SUBS
LOGICAL LDUM
ID = ID1
IDPOS = LOCATI(IQ(LTAB+1),IQ(LCDIR+KNRH),ID)
IF (IDPOS .LE. 0) THEN
print*,'Unknown N-tuple','HNTVAR',ID1
RETURN
ENDIF
LCID = LQ(LTAB-IDPOS)
CHTAG = ' '
NAME = ' '
BLOCK = ' '
NSUB = 0
ITYPE = 0
ISIZE = 0
IELEM = 0
ICNT = 0
IF (IVAR .GT. IQ(LCID+ZNDIM)) RETURN
LBLOK = LQ(LCID-1)
LCHAR = LQ(LCID-2)
LINT = LQ(LCID-3)
LREAL = LQ(LCID-4)
5 LNAME = LQ(LBLOK-1)
IOFF = 0
NDIM = IQ(LBLOK+ZNDIM)
DO 10 I = 1, NDIM
ICNT = ICNT + 1
IF (ICNT .EQ. IVAR) THEN
CALL HNDESC(IOFF, NSUB, ITYPE, ISIZE, NBITS, LDUM)
LL = IQ(LNAME+IOFF+ZLNAME)
LV = IQ(LNAME+IOFF+ZNAME)
CALL UHTOC(IQ(LCHAR+LV), 4, NAME, LL)
CALL UHTOC(IQ(LBLOK+ZIBLOK), 4, BLOCK, 8)
IELEM = 1
IF (NSUB .GT. 0) THEN
VAR = NAME(1:LL)//'['
DO 25 J = NSUB,1,-1
LP = IQ(LINT+IQ(LNAME+IOFF+ZARIND)+(J-1))
IF (LP .LT. 0) THEN
IE = -LP
CALL HITOC(IE, SUBS, LL, IERR)
ELSE
LL = IQ(LNAME+LP-1+ZLNAME)
LV = IQ(LNAME+LP-1+ZNAME)
CALL UHTOC(IQ(LCHAR+LV), 4, SUBS, LL)
LL1 = IQ(LNAME+LP-1+ZRANGE)
IE = IQ(LINT+LL1+1)
ENDIF
IELEM = IELEM*IE
IF (J .EQ. NSUB) THEN
VAR = VAR(1:LENOCC(VAR))//SUBS(1:LL)
ELSE
VAR = VAR(1:LENOCC(VAR))//']['//SUBS(1:LL)
ENDIF
25 CONTINUE
VAR = VAR(1:LENOCC(VAR))//']'
ELSE
VAR = NAME(1:LL)
ENDIF
CHTAG = NAME
CHFULL = VAR
RETURN
ENDIF
IOFF = IOFF + ZNADDR
10 CONTINUE
LBLOK = LQ(LBLOK)
IF (LBLOK .NE. 0) GOTO 5
END
*-------------------------------------------------------------------------------
subroutine hntvar3(id,last,chvar)
character *80 allvars
common/callvars/allvars(100)
common/calloff/ioffset(100)
character *(*) chvar
integer id,ivar,last
save ivar
data ivar/0/
if (ivar.ne.0) then
if (allvars(ivar).ne.chvar) then
ivar = ivar+1
allvars(ivar) = chvar
ioffset(ivar) = 0
endif
else
ivar = ivar+1
allvars(ivar) = chvar
ioffset(ivar) = 0
endif
ier = 0
if (last.ne.0) then
call hgnt1(id,'*',allvars,ioffset,-ivar,1,ier)
allvars(1) = ' '
ivar = 0
endif
end
*-------------------------------------------------------------------------------
SUBROUTINE HLIMIT (LIMIT)
INTEGER NWPAW,IXPAWC,IHDIV,IXHIGZ,IXKU, LMAIN
REAL FENC , HCV
COMMON/PAWC/NWPAW,IXPAWC,IHDIV,IXHIGZ,IXKU,FENC(5),LMAIN,
+HCV(4000000-11)
INTEGER IQ ,LQ
REAL Q
DIMENSION IQ(2),Q(2),LQ(8000)
EQUIVALENCE (LQ(1),LMAIN),(IQ(1),LQ(9)),(Q(1),IQ(1))
INTEGER HVERSN,IHWORK,LHBOOK,LHPLOT,LGTIT,LHWORK,
+LCDIR,LSDIR,LIDS,LTAB,LCID,LCONT,LSCAT,LPROX,LPROY,LSLIX,
+LSLIY,LBANX,LBANY,LPRX,LPRY,LFIX,LLID,LR1,LR2,LNAME,LCHAR,LINT,
+LRE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ATM)
CHARACTER*(LENHFN) HFNAME
COMMON /HCFILE/HFNAME(MXFILES)
CALL HMACHI
NHBOOK = IABS(LIMIT)
IF (NHBOOK.LT.10000) NHBOOK=10000
IF (LIMIT.GT.0) CALL MZEBRA(-3)
IF(LIMIT.NE.0)CALL MZPAW(NHBOOK,' ')
CALL MZLINK(IXPAWC,'/HCBOOK/',LHBOOK,LCDIR,LCIDN)
IHWORK = IXPAWC+1
IHDIV = IXPAWC+2
CALL MZFORM('HDIR','4H -I',IODIR)
CALL MZFORM('HID1','1B 2I 6F -H',IOH1)
CALL MZFORM('HID2','1B 2I 3F 1I 4F -H',IOH2)
CALL MZFORM('HIDN','11I -H',IOHN)
CALL MZFORM('HIDT','13I -H',IONT)
CALL MZFORM('HBLK','7I -H',IOBL)
CALL MZFORM('HCF1','2I 2F 4D -F',IOCF1)
CALL MZFORM('HCB1','2I 2F 4D -B',IOCB1)
CALL MZFORM('HCF2','2I -F',IOCF2)
CALL MZFORM('HCF4','4I -F',IOCF4)
CALL MZFORM('HCB2','2I -B',IOCB2)
CALL MZFORM('HFIT','5I 5F -D',IOFIT)
CALL MZFORM('LCHX','2I -H',IOCC)
CALL MZBOOK(IHDIV,LCDIR,LHBOOK, 1,'HDIR',50,8,10,IODIR,0)
CALL UCTOH('PAWC ',IQ(LCDIR+1),4,16)
CALL MZBOOK(IHDIV,LTAB ,LHBOOK,-3,'HTAB',500,0,500,2,0)
LMAIN = LHBOOK
NLCDIR = 1
NLPAT = 1
CHCDIR(1) = 'PAWC'
NCHTOP = 1
CHTOP(1) = 'PAWC'
HFNAME(1) = 'COMMON /PAWC/ in memory'
ICHTOP(1) = 0
ICHLUN(1) = 0
ICDIR = 1
END
*-------------------------------------------------------------------------------
SUBROUTINE HROPEN(LUN,CHDIR,CFNAME,CHOPTT,LRECL,ISTAT)
PARAMETER (NLPATM=100, MXFILES=50, LENHFN=128)
COMMON /HCDIRN/NLCDIR,NLNDIR,NLPAT,ICDIR,NCHTOP,ICHTOP(MXFILES)
+ ,ICHTYP(MXFILES),ICHLUN(MXFILES)
CHARACTER*16 CHNDIR, CHCDIR, CHPAT ,CHTOP
COMMON /HCDIRC/CHCDIR(NLPATM),CHNDIR(NLPATM),CHPAT(NLPATM)
+ ,CHTOP(NLPATM)
CHARACTER*(LENHFN) HFNAME
COMMON /HCFILE/HFNAME(MXFILES)
COMMON/QUEST/IQUEST(100)
CHARACTER*(*) CFNAME,CHDIR,CHOPTT
CHARACTER*8 CHOPT
CHOPT=CHOPTT
CALL CLTOU(CHOPT)
DO 10 I=1,NCHTOP
IF(CFNAME.EQ.HFNAME(I))THEN
print*, 'File already connected','HROPEN',0
GO TO 99
ENDIF
10 CONTINUE
IQ10=IQUEST(10)
IF (INDEX(CHOPT,'F').EQ.0) THEN
IC = MIN(LENOCC(CHOPT)+1,8)
CHOPT(IC:IC) = 'C'
ENDIF
CALL RZOPEN(LUN,CHDIR,CFNAME,CHOPT,LRECL,ISTAT)
90 IF(ISTAT.NE.0)THEN
print*, 'Cannot open file','HROPEN',0
GO TO 99
ENDIF
IF (IQUEST(12).NE.0 ) THEN
IC = MIN(LENOCC(CHOPT)+1,8)
CHOPT(IC:IC) = 'X'
ENDIF
LRE=IQUEST(10)
IQUEST(10)=IQ10
IQUEST(99)=LRE
CALL HRFILE(LUN,CHDIR,CHOPT)
IF(IQUEST(1).NE.0)THEN
ISTAT=IQUEST(1)
print*,'>>>>>> CALL RZEND(CHDIR)'
****** CALL RZEND(CHDIR)
CLOSE(LUN)
GO TO 90
ENDIF
IF(ICDIR.GT.0)HFNAME(ICDIR)=CFNAME
IF(INDEX(CHOPT,'Q').EQ.0)IQUEST(10)=LRE
99 RETURN
END
*-------------------------------------------------------------------------------
SUBROUTINE HRFILE(LUN,CHDIR,CHOPT)
PARAMETER (NLPATM=100, MXFILES=50, LENHFN=128)
COMMON /HCDIRN/NLCDIR,NLNDIR,NLPAT,ICDIR,NCHTOP,ICHTOP(MXFILES)
+ ,ICHTYP(MXFILES),ICHLUN(MXFILES)
CHARACTER*16 CHNDIR, CHCDIR, CHPAT ,CHTOP
COMMON /HCDIRC/CHCDIR(NLPATM),CHNDIR(NLPATM),CHPAT(NLPATM)
+ ,CHTOP(NLPATM)
CHARACTER*(LENHFN) HFNAME
COMMON /HCFILE/HFNAME(MXFILES)
CHARACTER*128 CHMAIL
COMMON /HCMAIL/CHMAIL
COMMON/QUEST/IQUEST(100)
CHARACTER*(*) CHDIR,CHOPT
CHARACTER*8 TAGS(2),CHOPTT
DIMENSION IOPT(6)
EQUIVALENCE (IOPTN,IOPT(1)),(IOPTG,IOPT(2)),(IOPTQ,IOPT(3))
EQUIVALENCE (IOPTM,IOPT(4)),(IOPTO,IOPT(5)),(IOPTE,IOPT(6))
IF(NCHTOP.GE.MXFILES)THEN
print*, 'Too many open files','HRFILE',LUN
GO TO 99
ENDIF
CALL HUOPTC(CHOPT,'NGQMOE',IOPT)
IF(IOPTM.NE.0)IOPTG=1
IQUEST(1)=0
IF(IOPTG.EQ.0)THEN
IF(IOPTN.NE.0)THEN
IF(IOPTQ.NE.0)THEN
NQUOT=IQUEST(10)
IF(NQUOT.LT.100)NQUOT=100
IF(NQUOT.GT.65000.AND.IOPTE.EQ.0)NQUOT=65000
ELSE
NQUOT=32000
ENDIF
TAGS(1) = 'HBOOK-ID'
TAGS(2) = 'VARIABLE'
NCH=LENOCC(CHOPT)
IF(NCH.EQ.0)THEN
CHOPTT='X'
ELSE
CHOPTT='X'//CHOPT(1:NCH)
ENDIF
CALL CLTOU(CHOPTT)
I=INDEX(CHOPTT,'N')
IF(I.NE.0)CHOPTT(I:I)='?'
I=INDEX(CHOPTT,'E')
IF(I.NE.0)CHOPTT(I:I)='N'
IF(IOPTO.NE.0)THEN
NWK=1
CHOPTT(1:1)='?'
ELSE
NWK=2
ENDIF
IQ10=IQUEST(10)
IF(INDEX(CHOPT,'C').NE.0) IQUEST(10)=IQUEST(99)
print*,'>>>>>> CALL RZMAKE(...)'
****** CALL RZMAKE(LUN,CHDIR,NWK,'II',TAGS,NQUOT,CHOPTT)
IQUEST(10)=IQ10
ELSE
IQ10=IQUEST(10)
IF(INDEX(CHOPT,'C').NE.0) IQUEST(10)=IQUEST(99)
CALL RZFILE(LUN,CHDIR,CHOPT)
IQUEST(10)=IQ10
IF(IQUEST(1).EQ.2)IQUEST(1)=0
NWK=IQUEST(8)
ENDIF
ENDIF
IF(IQUEST(1).NE.0)RETURN
NCHTOP=NCHTOP+1
CHTOP(NCHTOP)=CHDIR
ICHLUN(NCHTOP)=0
IF(IOPTG.EQ.0)THEN
ICHTOP(NCHTOP)=LUN
ICHTYP(NCHTOP)=NWK
HFNAME(NCHTOP)=CHDIR
ELSE
ICHTOP(NCHTOP)=-LOCF(LUN)
ICHTYP(NCHTOP)=0
IF(IOPTM.EQ.0)THEN
HFNAME(NCHTOP)='Global section - '//CHDIR
ELSE
HFNAME(NCHTOP)='Global memory - '//CHDIR
ENDIF
ENDIF
10 CHMAIL='//'//CHTOP(NCHTOP)
CALL HCDIR(CHMAIL,' ')
99 RETURN
END
*-------------------------------------------------------------------------------
SUBROUTINE HRIN(IDD,ICYCLE,KOFSET)
INTEGER NWPAW,IXPAWC,IHDIV,IXHIGZ,IXKU, LMAIN
REAL FENC , HCV
COMMON/PAWC/NWPAW,IXPAWC,IHDIV,IXHIGZ,IXKU,FENC(5),LMAIN,
+HCV(4000000-11)
INTEGER IQ ,LQ
REAL Q
DIMENSION IQ(2),Q(2),LQ(8000)
EQUIVALENCE (LQ(1),LMAIN),(IQ(1),LQ(9)),(Q(1),IQ(1))
INTEGER HVERSN,IHWORK,LHBOOK,LHPLOT,LGTIT,LHWORK,
+LCDIR,LSDIR,LIDS,LTAB,LCID,LCONT,LSCAT,LPROX,LPROY,LSLIX,
+LSLIY,LBANX,LBANY,LPRX,LPRY,LFIX,LLID,LR1,LR2,LNAME,LCHAR,LINT,
+LREAL,LBLOK,LLBLK,LBUFM,LBUF,LTMPM,LTMP,LTMP1,LHPLIP,LHDUM,
+LHFIT,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EQ.0)THEN
KEYS(1) = 1
CALL HRZIN(IHDIV,0,0,KEYS,9999,'SC')
IDN=IQUEST(21)
IQ42=IQUEST(22)
ENDIF
10 ID=IDN+IOFSET
NRHIST=IQ(LCDIR+KNRH)
IDPOS=LOCATI(IQ(LTAB+1),NRHIST,ID)
INMEM=0
IF(IDPOS.GT.0)THEN
LC=LQ(LTAB-IDPOS)
IF(JBIT(IQ(LC),5).EQ.0)THEN
INMEM=1
ELSE
print*, '+Already existing histogram replaced','HRIN',ID
CALL HDELET(ID)
NRHIST=IQ(LCDIR+KNRH)
IDPOS=-IDPOS+1
ENDIF
ENDIF
KEYS(1) = IDN
KEYS(2) = IQ42
CALL HRZIN(IHDIV,0,0,KEYS,ICYCLE,'NC')
IF(IQUEST(1).NE.0)GO TO 70
IQ40=IQUEST(40)
IQ41=IQUEST(41)
IQ42=IQUEST(42)
NWORDS=IQUEST(12)
IOPTA=JBIT(IQUEST(14),4)
IF(IOPTA.NE.0)GO TO 60
IF(INMEM.NE.0)GO TO 60
CALL HSPACE(NWORDS+1000,'HRIN ',IDD)
IF(IERR.NE.0) GO TO 70
IDPOS=-IDPOS+1
IF(NRHIST.GE.IQ(LTAB-1))THEN
CALL MZPUSH(IHDIV,LTAB,500,500,' ')
ENDIF
DO 20 I=NRHIST,IDPOS,-1
IQ(LTAB+I+1)=IQ(LTAB+I)
LQ(LTAB-I-1)=LQ(LTAB-I)
20 CONTINUE
IF(LIDS.EQ.0)THEN
KEYS(1) = IDN
CALL HRZIN(IHDIV,LCDIR,-2,KEYS,ICYCLE,'ND')
IF(IQUEST(1).NE.0)THEN
print*, 'Bad sequence for RZ','HRIN',IDN
GO TO 70
ENDIF
LIDS=LQ(LCDIR-2)
LCID=LIDS
ELSE
LLID=LQ(LCDIR-9)
KEYS(1) = IDN
CALL HRZIN(IHDIV,LLID, 0,KEYS,ICYCLE,'ND')
IF(IQUEST(1).NE.0)THEN
print*, 'Bad sequence for RZ','HRIN',IDN
GO TO 70
ENDIF
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=LQ(LCID-1)
GO TO 60
ENDIF
40 CONTINUE
LC=LQ(LCID-1)
ENDIF
ELSE
IF(ICHTOP(ICDIR).LT.1000) THEN
print*, '>>>>>> CALL HRZKEY(IDN)'
****** CALL HRZKEY(IDN)
ENDIF
IQ(LCID+5)=IDN
ENDIF
GO TO 60
ELSE
NCHRZ=IQ(LCID+ZNCHRZ)
IF(NCHRZ.LE.0)GO TO 50
ITIT1=IQ(LCID+ZITIT1)
NW=IQ(LCID-1)-ITIT1+1
NPLUS=34-ITIT1
IF(NPLUS.GT.0)THEN
CALL MZPUSH(IHDIV,LCID,0,NPLUS,' ')
CALL UCOPY2(IQ(LCID+ITIT1),IQ(LCID+34),NW)
IQ(LCID+ZITIT1)=34
ENDIF
CALL HPAFF(CHCDIR,NLCDIR,CHWOLD)
NCHRZ=LENOCC(CHWOLD)
CALL UCTOH(CHWOLD,IQ(LCID+ZNCHRZ+1),4,NCHRZ)
IQ(LCID+ZNCHRZ)=NCHRZ
50 IQ(LCID)=9999
LC = LQ(LCID-1)
CALL SBIT0(IQ(LC),1)
CALL SBIT0(IQ(LC),2)
CALL SBIT0(IQ(LC),3)
CALL HNMSET(ID,ZIBANK,0)
CALL HNMSET(ID,ZITMP,0)
IQ(LCID+ZIFTMP) = 2
IQ(LCID+ZID) = IDN
NTCUR = 0
GO TO 60
ENDIF
ENDIF
60 IF(IQ40.EQ.0)GO TO 80
IDN=IQ41
IF(IDD.EQ.0)GO TO 10
70 CONTINUE
80 RETURN
END
*-------------------------------------------------------------------------------
SUBROUTINE HRZIN(IXDIV,LBANK,JBIAS,KEYS,ICYCLE,CHOPT)
INTEGER NWPAW,IXPAWC,IHDIV,IXHIGZ,IXKU, LMAIN
REAL FENC , HCV
COMMON/PAWC/NWPAW,IXPAWC,IHDIV,IXHIGZ,IXKU,FENC(5),LMAIN,
+HCV(4000000-11)
INTEGER IQ ,LQ
REAL Q
DIMENSION IQ(2),Q(2),LQ(8000)
EQUIVALENCE (LQ(1),LMAIN),(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ILES)
CHARACTER*16 CHNDIR, CHCDIR, CHPAT ,CHTOP
COMMON /HCDIRC/CHCDIR(NLPATM),CHNDIR(NLPATM),CHPAT(NLPATM)
+ ,CHTOP(NLPATM)
CHARACTER*(LENHFN) HFNAME
COMMON /HCFILE/HFNAME(MXFILES)
CHARACTER*128 CHMAIL
COMMON /HCMAIL/CHMAIL
COMMON/QUEST/IQUEST(100)
DIMENSION LBANK(1),JBIAS(1)
INTEGER KEYS(2)
CHARACTER*(*)CHOPT
CHARACTER*1 FCHOPT
CHARACTER*8 CHOPT1
IF(ICHTOP(ICDIR).GT.1000)THEN
print*, 'CZ option not active','HRZIN',0
RETURN
ENDIF
CALL RZIN(IXDIV,LBANK,JBIAS,KEYS,ICYCLE,CHOPT)
END
*-------------------------------------------------------------------------------
SUBROUTINE HNOENT(IDD,NUMB)
INTEGER NWPAW,IXPAWC,IHDIV,IXHIGZ,IXKU, LMAIN
REAL FENC , HCV
COMMON/PAWC/NWPAW,IXPAWC,IHDIV,IXHIGZ,IXKU,FENC(5),LMAIN,
+HCV(4000000-11)
INTEGER IQ ,LQ
REAL Q
DIMENSION IQ(2),Q(2),LQ(8000)
EQUIVALENCE (LQ(1),LMAIN),(IQ(1),LQ(9)),(Q(1),IQ(1))
INTEGER HVERSN,IHWORK,LHBOOK,LHPLOT,LGTIT,LHWORK,
+LCDIR,LSDIR,LIDS,LTAB,LCID,LCONT,LSCAT,LPROX,LPROY,LSLIX,
+LSLIY,LBANX,LBANY,LPRX,LPRY,LFIX,LLID,LR1,LR2,LNAME,LCHAR,LINT,
+LREAL,LBLOK,LLBLK,LBUFM,LBUF,LTMPM,LTMP,LTMP1,LHPLIP,LHDUM,
+LHFIT,LFUNC,LHFCO,LHFNA,LCIDN
COMMON/HCBOOK/HVERSN,IHWORK,LHBOOK,LHPLOT,LGTIT,LHWORK,
+LCDIR,LSDIR,LIDS,LTAB,LCID,LCONT,LSCAT,LPROX,LPROY,LSLIX,
+LSLIY,LBANX,LBANY,LPRX,LPRY,LFIX,LLID,LR1,LR2,LNAME,LCHAR,LINT,
+LREAL,LBLOK,LLBLK,LBUFM,LBUF,LTMPM,LTMP,LTMP1,LHPLIP,LHDUM(9),
+LHFIT,LFUNC,LHFCO,LHFNA,LCIDN
INTEGER KNCX ,KXMIN ,KXMAX ,KMIN1 ,KMAX1 ,KNORM , KTIT1,
+ KNCY ,KYMIN ,KYMAX ,KMIN2 ,KMAX2 ,KSCAL2 , KTIT2,
+ KNBIT ,KNOENT ,KSTAT1 ,KNSDIR ,KNRH ,
+ KCON1 ,KCON2 ,KBITS ,KNTOT
PARAMETER(KNCX=3,KXMIN=4,KXMAX=5,KMIN1=7,KMAX1=8,KNORM=9,KTIT1=10,
+ KNCY=7,KYMIN=8,KYMAX=9,KMIN2=6,KMAX2=10,KSCAL2=11,
+ KTIT2=12,KNBIT=1,KNOENT=2,KSTAT1=3,KNSDIR=5,KNRH=6,
+ KCON1=9,KCON2=3,KBITS=1,KNTOT=2)
COMMON /QUEST/ IQUEST(100)
CALL HFIND(IDD,'HNOENT')
IF(IQUEST(1).NE.0)THEN
NUMB=0
ELSE
I4=JBIT(IQ(LCID+KBITS),4)
IF(I4.NE.0)THEN
NUMB=IQ(LCID+3)
ELSE
NUMB=IQ(LCONT+KNOENT)
ENDIF
ENDIF
END
*-------------------------------------------------------------------------------
SUBROUTINE HGIVE(IDD,CHTITL,NCX,XMIN,XMAX,NCY,YMIN,YMAX,NWT,IDB)
INTEGER NWPAW,IXPAWC,IHDIV,IXHIGZ,IXKU, LMAIN
REAL FENC , HCV
COMMON/PAWC/NWPAW,IXPAWC,IHDIV,IXHIGZ,IXKU,FENC(5),LMAIN,
+HCV(4000000-11)
INTEGER IQ ,LQ
REAL Q
DIMENSION IQ(2),Q(2),LQ(8000)
EQUIVALENCE (LQ(1),LMAIN),(IQ(1),LQ(9)),(Q(1),IQ(1))
INTEGER HVERSN,IHWORK,LHBOOK,LHPLOT,LGTIT,LHWORK,
+LCDIR,LSDIR,LIDS,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ID, ZNTMP, ZNTMP1, ZLINK
PARAMETER(ZBITS=1, ZNDIM=2, ZNOENT=3, ZNPRIM=4, ZLCONT=6,
+ ZNRZB=5, ZIFCON=7, ZIFNAM=4, ZIFCHA=5, ZIFINT=6,
+ ZIFREA=7, ZNWTIT=8, ZITIT1=9, ZNCHRZ=13, ZIFBIT=8,
+ ZDESC=1, ZLNAME=2, ZNAME=3, ZRANGE=4, ZNADDR=12,
+ ZARIND=11, ZIBLOK=8, ZNBLOK=10, ZIBANK=9, ZIFTMP=11,
+ ZID=12, ZITMP=10, ZNTMP=6, ZNTMP1=3, ZLINK=6)
INTEGER I1, I2, I3, I4, I5, I6, I7, I8,
+ I9, I10, I11, I12, I13, I14, I15, I16,
+I17, I18, I19, I20, I21, I22, I23, I24, I25, I26, I27,
+I28, I29, I30, I31, I32, I33, I34, I35, I123, I230
COMMON / HCBITS / I1, I2, I3, I4, I5, I6, I7, I8,
+ I9, I10, I11, I12, I13, I14, I15, I16,
+I17, I18, I19, I20, I21, I22, I23, I24, I25, I26, I27,
+I28, I29, I30, I31, I32, I33, I34, I35, I123, I230
CHARACTER*(*) CHTITL
NARG=10
NCX=0
IF(NARG.GT.5)NCY=0
IF(NARG.GT.8)NWT=0
IF(NARG.GT.9)IDB=0
CALL HFIND(IDD,'HGIVE ')
IF(LCID.LE.0)GO TO 99
CALL HDCOFL
IF(I4.NE.0)THEN
IF (IQ(LCID-2) .NE. ZLINK) THEN
NCX = IQ(LCID+2)
IWT = IQ(LCID+9)+LCID
NWTIT = IQ(LCID+8)
ELSE
NCX = IQ(LCID+ZNDIM)
IWT = IQ(LCID+ZITIT1)+LCID
NWTIT = IQ(LCID+ZNWTIT)
ENDIF
XMIN=0.
XMAX=0.
YMIN=0.
YMAX=0.
ELSE
NCX=IQ(LCID+KNCX)
XMIN=Q(LCID+KXMIN)
XMAX=Q(LCID+KXMAX)
IWT=LCID+KTIT1
IF(I230.NE.0)THEN
IF(NARG.GT.5)NCY=IQ(LCID+KNCY)
IF(NARG.GT.6)YMIN=Q(LCID+KYMIN)
IF(NARG.GT.7)YMAX=Q(LCID+KYMAX)
IWT=LCID+KTIT2
ENDIF
NWTIT=IQ(LCID-1)-IWT+LCID+1
ENDIF
IF(NARG.GT.9)IDB=LCID
IF(NARG.LT.9)GO TO 99
NWT=NWTIT
IF(NWT.EQ.0)GO TO 99
NCH=LEN(CHTITL)
NWCH=MIN(NCH,4*NWT)
IF(NCH.GT.0)CHTITL=' '
CALL UHTOC(IQ(IWT),4,CHTITL,NWCH)
99 RETURN
END
*-------------------------------------------------------------------------------
SUBROUTINE HGIVEN( ID1, CHTITL, NVAR, TAGS, RLOW, RHIGH )
INTEGER NWPAW,IXPAWC,IHDIV,IXHIGZ,IXKU, LMAIN
REAL FENC , HCV
COMMON/PAWC/NWPAW,IXPAWC,IHDIV,IXHIGZ,IXKU,FENC(5),LMAIN,
+HCV(4000000-11)
INTEGER IQ ,LQ
REAL Q
DIMENSION IQ(2),Q(2),LQ(8000)
EQUIVALENCE (LQ(1),LMAIN),(IQ(1),LQ(9)),(Q(1),IQ(1))
INTEGER HVERSN,IHWORK,LHBOOK,LHPLOT,LGTIT,LHWORK,
+LCDIR,LSDIR,LIDS,LTAB,LCID,LCONT,LSCAT,LPROX,LPROY,LSLIX,
+LSLIY,LBANX,LBANY,LPRX,LPRY,LFIX,LLID,LR1,LR2,LNAME,LCHAR,LINT,
+LREAL,LBLOK,LLBLK,LBUFM,LBUF,LTMPM,LTMP,LTMP1,LHPLIP,LHDUM,
+LHFIT,LFUNC,LHFCO,LHFNA,LCIDN
COMMON/HCBOOK/HVERSN,IHWORK,LHBOOK,LHPLOT,LGTIT,LHWORK,
+LCDIR,LSDIR,LIDS,LTAB,LCID,LCONT,LSCAT,LPROX,LPROY,LSLIX,
+LSLIY,LBANX,LBANY,LPRX,LPRY,LFIX,LLID,LR1,LR2,LNAME,LCHAR,LINT,
+LREAL,LBLOK,LLBLK,LBUFM,LBUF,LTMPM,LTMP,LTMP1,LHP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DBADD,LID ,IDLAST,IDHOLD,NBIT ,NBITCH,
+ NCHAR ,NRHIST,IERR ,NV
INTEGER I1, I2, I3, I4, I5, I6, I7, I8,
+ I9, I10, I11, I12, I13, I14, I15, I16,
+I17, I18, I19, I20, I21, I22, I23, I24, I25, I26, I27,
+I28, I29, I30, I31, I32, I33, I34, I35, I123, I230
COMMON / HCBITS / I1, I2, I3, I4, I5, I6, I7, I8,
+ I9, I10, I11, I12, I13, I14, I15, I16,
+I17, I18, I19, I20, I21, I22, I23, I24, I25, I26, I27,
+I28, I29, I30, I31, I32, I33, I34, I35, I123, I230
CHARACTER*(*) CHTITL, TAGS(*)
INTEGER ID1, NVAR
REAL RLOW(*), RHIGH(*)
CHARACTER*8 BLOCK
LOGICAL NTOLD
NMAX = NVAR
NVAR = 0
ID = ID1
IDPOS = LOCATI(IQ(LTAB+1),IQ(LCDIR+KNRH),ID)
IF( IDPOS.LE.0 ) RETURN
IDLAST = ID1
LCID = LQ(LTAB-IDPOS)
I4 = JBIT(IQ(LCID+KBITS),4)
IF( I4.EQ.0 ) RETURN
IF (IQ(LCID-2) .NE. ZLINK) THEN
NTOLD = .TRUE.
ELSE
NTOLD = .FALSE.
ENDIF
IF (NTOLD) THEN
NDIM = IQ(LCID+2)
LLIMS = LQ(LCID-2)
ITAG1 = IQ(LCID+10)
ITIT1 = IQ(LCID+9)
NWTIT = IQ(LCID+8)
ELSE
NDIM = IQ(LCID+ZNDIM)
ITIT1 = IQ(LCID+ZITIT1)
NWTIT = IQ(LCID+ZNWTIT)
ENDIF
NVAR = MIN(NDIM, NMAX)
NCH = LEN(CHTITL)
IF (NCH .GT. 0) CHTITL = ' '
NCH = MIN( NCH, 4*NWTIT )
IF (NCH .GT. 0) CALL UHTOC( IQ(LCID+ITIT1), 4, CHTITL, NCH )
IF (NTOLD) THEN
NCH = LEN( TAGS(1) )
NCH = MIN( NCH, 8 )
DO 10 I = 1, NVAR
IF( NCH.GT.0 ) TAGS(I) = ' '
IF( NCH.GT.0 )THEN
TAGS(I)=' '
CALL UHTOC( IQ(LCID+ITAG1+2*(I-1)), 4, TAGS(I), NCH )
ENDIF
RLOW (I) = Q(LLIMS+2*I-1)
RHIGH(I) = Q(LLIMS+2*I)
10 CONTINUE
ELSE
DO 20 I = 1, NVAR
CALL HNTVAR(ID1, I, TAGS(I), BLOCK, NS, IT, IS, IE)
RLOW(I) = 0.0
RHIGH(I) = 0.0
20 CONTINUE
ENDIF
NVAR = NDIM
END
*-------------------------------------------------------------------------------
SUBROUTINE HGNPAR(IDN,CHROUT)
INTEGER NWPAW,IXPAWC,IHDIV,IXHIGZ,IXKU, LMAIN
REAL FENC , HCV
COMMON/PAWC/NWPAW,IXPAWC,IHDIV,IXHIGZ,IXKU,FENC(5),LMAIN,
+HCV(4000000-11)
INTEGER IQ ,LQ
REAL Q
DIMENSION IQ(2),Q(2),LQ(8000)
EQUIVALENCE (LQ(1),LMAIN),(IQ(1),LQ(9)),(Q(1),IQ(1))
INTEGER HVERSN,IHWORK,LHBOOK,LHPLOT,LGTIT,LHWORK,
+LCDIR,LSDIR,LIDS,LTAB,LCID,LCONT,LSCAT,LPROX,LPROY,LSLIX,
+LSLIY,LBANX,LBANY,LPRX,LPRY,LFIX,LLID,LR1,LR2,LNAME,LCHAR,LINT,
+LREAL,LBLOK,LLBLK,LBUFM,LBUF,LTMPM,LTMP,LTMP1,LHPLIP,LHDUM,
+LHFIT,LFUNC,LHFCO,LHFNA,LCIDN
COMMON/HCBOOK/HVERSN,IHWORK,LHBOOK,LHPLOT,LGTIT,LHWORK,
+LCDIR,LSDIR,LIDS,LTAB,LCID,LCONT,LSCAT,LPROX,LPROY,LSLIX,
+LSLIY,LBANX,LBANY,LPRX,LPRY,LFIX,LLID,LR1,LR2,LNAME,LCHAR,LINT,
+LREAL,LBLOK,LLBLK,LBUFM,LBUF,LTMPM,LTMP,LTMP1,LHPLIP,LHDUM(9),
+LHFIT,LFUNC,LHFCO,LHFNA,LCIDN
INTEGER KNCX ,KXMIN ,KXMAX ,KMIN1 ,KMAX1 ,KNORM , KTIT1,
+ KNCY ,KYMIN ,KYMAX ,KMIN2 ,KMAX2 ,KSCAL2 , KTIT2,
+ KNBIT ,KNOENT ,KSTAT1 ,KNSDIR ,KNRH ,
+ KCON1 ,KCON2 ,KBITS ,KNTOT
PARAMETER(KNCX=3,KXMIN=4,KXMAX=5,KMIN1=7,KMAX1=8,KNORM=9,KTIT1=10,
+ KNCY=7,KYMIN=8,KYMAX=9,KMIN2=6,KMAX2=10,KSCAL2=11,
+ KTIT2=12,KNBIT=1,KNOENT=2,KSTAT1=3,KNSDIR=5,KNRH=6,
+ KCON1=9,KCON2=3,KBITS=1,KNTOT=2)
CHARACTER*(*) CHROUT
INTEGER KEYS(2)
LCIDN=0
NIDN=LOCATI(IQ(LTAB+1),IQ(LCDIR+KNRH),IDN)
IF(NIDN.LE.0)THEN
CALL HRIN(IDN,9999,0)
NIDN=LOCATI(IQ(LTAB+1),IQ(LCDIR+KNRH),IDN)
IF(NIDN.LE.0)THEN
print*, 'Unknown N-tuple',CHROUT,IDN
RETURN
ENDIF
ENDIF
LCIDN=LQ(LTAB-NIDN)
I4=JBIT(IQ(LCIDN+KBITS),4)
IF(I4.EQ.0)THEN
print*, 'Not a N-tuple',CHROUT,IDN
RETURN
ENDIF
IF (IQ(LCIDN-2) .NE. 2) THEN
print*,'New N-tuple, this routine works only for old '//
+ 'N-tuples',CHROUT,IDN
RETURN
ENDIF
NCHRZ=IQ(LCIDN+11)
IF(NCHRZ.EQ.0)THEN
NMORE=IQ(LCIDN+5)+3-IQ(LCIDN-3)
IF(NMORE.GT.0)THEN
CALL MZPUSH(IHDIV,LCIDN,NMORE,0,' ')
LC=LQ(LCIDN-1)
IF(IQ(LCIDN+5).GE.1)THEN
DO 10 IB=1,IQ(LCIDN+5)
LQ(LCIDN-3-IB)=LC
LC=LQ(LC)
IF(LC.EQ.0)GO TO 999
10 CONTINUE
ENDIF
GO TO 999
ENDIF
ENDIF
LC=LQ(LCIDN-1)
IF(JBIT(IQ(LC),1).NE.0)THEN
CALL SBIT0(IQ(LC),1)
KEYS(1) = IDN
KEYS(2) = 0
print*, '>>>>>> HRZOUT'
****** CALL HRZOUT(IHDIV,LCIDN,KEYS,ICYCLE,' ')
ENDIF
999 END
*-------------------------------------------------------------------------------
SUBROUTINE HGNF(IDN,IDNEVT,X,IERROR)
INTEGER NWPAW,IXPAWC,IHDIV,IXHIGZ,IXKU, LMAIN
REAL FENC , HCV
COMMON/PAWC/NWPAW,IXPAWC,IHDIV,IXHIGZ,IXKU,FENC(5),LMAIN,
+HCV(4000000-11)
INTEGER IQ ,LQ
REAL Q
DIMENSION IQ(2),Q(2),LQ(8000)
EQUIVALENCE (LQ(1),LMAIN),(IQ(1),LQ(9)),(Q(1),IQ(1))
INTEGER HVERSN,IHWORK,LHBOOK,LHPLOT,LGTIT,LHWORK,