-
Notifications
You must be signed in to change notification settings - Fork 0
/
CCSORT.UNIXFORT
541 lines (541 loc) · 15.1 KB
/
CCSORT.UNIXFORT
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
C
C ******************
C---------------------------***** BKTDMP *****-------------------------
C ******************
C
SUBROUTINE BKTDMP(BKT,LENGTH,IDISK)
C
IMPLICIT REAL*8 (A-H,O-Z)
DIMENSION BKT(LENGTH)
CALL SWRIT(IDISK,BKT,INTOWP(LENGTH))
RETURN
END
cets The following is called by a C program which handles dynamic
cets allocation of memory.
subroutine fentry(core,icore,maxcor)
cets PROGRAM CCSORT
IMPLICIT REAL*8 (A-H,O-Z)
cets REAL*8 CORE(1)
cets INTEGER ICORE(1000000),I30(200)
real*8 core(maxcor)
integer icore(intowp(maxcor)),i30(200)
INTEGER WPADTI,SEC2I
cets EQUIVALENCE (CORE,ICORE)
cets MAXCOR=500000
CALL drum
C
CALL TSTART(6)
C
WRITE(6,6000)
6000 FORMAT(//,47('-'),/,47('-'),/,
.' CCSORT: SORTING INTEGRALS FOR COUPLED CLUSTER ',/,
.' WRITTEN BY ANDY SCHEINER ',/,47('-'),/,47('-'),//)
C
1 FORMAT (' ')
2 FORMAT ('************************************************')
C
INPUT=5
JOUT=6
ITAP30=30
ITAP60=60
ITAP61=61
ITAP62=62
ITAP63=63
ITAP64=64
ITAP65=65
ITAP66=66
ITAP78=78
INTBUF=SEC2I(100)/INTOWP(1)
WRITE (JOUT,*) ' SEC2I = 100, INTBUF=',INTBUF
C
CALL RFILE(ITAP30)
CALL RFILE(ITAP60)
CALL RFILE(ITAP61)
CALL RFILE(ITAP62)
CALL RFILE(ITAP63)
CALL RFILE(ITAP64)
CALL RFILE(ITAP65)
CALL RFILE(ITAP66)
CALL RFILE(ITAP78)
C WRITE (JOUT,*) ' RFILES'
CALL WREADW(ITAP30,I30,200,101,LWORD)
C WRITE (JOUT,1)
C WRITE (JOUT,2)
C WRITE (JOUT,*) ' ************ TAPE 30 CONSTANTS ***********'
C WRITE (JOUT,2)
C WRITE (JOUT,1)
C DO 3 I=1,200
C WRITE (JOUT,*) I,I30(I)
C 3 CONTINUE
C
MPOINT=I30(2)
MCONST=I30(3)
MCALCS=I30(4)
NCALCS=I30(5)
NBF=I30(18)
WRITE (JOUT,*) ' NBF=',NBF
NBFAO=I30(22)
WRITE (JOUT,*) ' NBFAO=',NBFAO
NIRRED=I30(28)
NSYMHF=I30(41)
WRITE (JOUT,*) ' NSYMHF=',NSYMHF
WRITE (JOUT,*) ' MCALCS=',MCALCS
MXCOEF=I30(42)
WRITE (JOUT,*) ' MXCOEF=',MXCOEF
NTRI=(NBF*(NBF+1))/2
NTRIAO=(NBFAO*(NBFAO+1))/2
WRITE (JOUT,*) ' NTRIAO=',NTRIAO
C
IC=0
C
CALL ZERO(CORE,MAXCOR)
C
K1= 1
K2=K1+NBF*NBFAO
C WRITE (JOUT,*) ' K2=',K2
K3=WPADTI(K2+NBF)
C WRITE (JOUT,*) ' K3=',K3
KTPO=K3+NSYMHF
C WRITE (JOUT,*) ' KTPO=',KTPO
KTYP=KTPO+NBF
C WRITE (JOUT,*) ' KTYP=',KTYP
KFLOV=KTYP+NSYMHF
C WRITE (JOUT,*) ' KFLOV=',KFLOV
KORBSM=KFLOV+2*NIRRED
C WRITE (JOUT,*) ' KORBSM=',KORBSM
KNMSM=KORBSM+NBF
C WRITE (JOUT,*) ' KNMSM=',KNMSM
KIWRK=KNMSM+NIRRED
C WRITE (JOUT,*) ' KIWRK=',KIWRK
KKLPT=KIWRK+NIRRED
C WRITE (JOUT,*) ' KKLPT=',KKLPT
KIJPT=KKLPT+NTRI
C WRITE (JOUT,*) ' KIJPT=',KIJPT
KOFF1=KIJPT+NTRI
C WRITE (JOUT,*) ' KOFF1=',KOFF1
KOFF2=KOFF1+NTRI
C WRITE (JOUT,*) ' KOFF2=',KOFF2
K4=KOFF2+NTRI
C WRITE (JOUT,*) ' K4=',K4
K5=K4+MCALCS
C WRITE (JOUT,*) ' K5=',K5
K6=IADTWP(K5+NSYMHF)
C WRITE (JOUT,*) ' K6=',K6
K7 = K6 + MXCOEF
C WRITE (JOUT,*) ' K7=',K7
KTOP=K7+NBF*NBF-1
C WRITE (JOUT,*) ' KTOP=',KTOP
C
CALL READ30 (ITAP30,MPOINT,MCONST,MCALCS,NCALCS,NBF,NBFAO,NSYMHF,
. MXCOEF,CORE(K1),CORE(K2),ICORE(K3),ICORE(K4),CORE(K6)
. ,JOUT,ICORE(K5),NO,ICORE(KTPO),CORE(K7),ICORE(KTYP),
. NIRRED,ICORE(KFLOV),ICORE(KORBSM),NTRI,ICORE(KNMSM),
. ICORE(KIWRK),ICORE(KKLPT),ICORE(KIJPT),ICORE(KOFF1),
. ICORE(KOFF2))
NV=NBF-NO
C WRITE(*,*) ' NV = ',NV
C WRITE(JOUT,*)
C WRITE(JOUT,*) ' THE SCF EIGENVECTORS '
C WRITE(JOUT,*)
C CALL MATOUT (CORE(K1),NBFAO,NBF,NBFAO,NBF,JOUT)
C WRITE (JOUT,1)
C WRITE (JOUT,2)
C WRITE (JOUT,*) ' ************ EIGENVECTOR *************'
C WRITE (JOUT,2)
C WRITE (JOUT,1)
C DO 4 I=1,196
C WRITE (JOUT,*) I,CORE(I)
C 4 CONTINUE
C WRITE (JOUT,1)
C WRITE (JOUT,2)
C WRITE (JOUT,*) ' ************ EIGENVALUES *************'
C WRITE (JOUT,2)
C WRITE (JOUT,1)
C DO 5 I=197,210
C WRITE (JOUT,*) I,CORE(I)
C 5 CONTINUE
C WRITE (JOUT,1)
C WRITE (JOUT,2)
C WRITE (JOUT,*) ' ************ NLAMDA *************'
C WRITE (JOUT,2)
C WRITE (JOUT,1)
C WRITE (JOUT,*) ICORE (421)
C WRITE (JOUT,1)
C WRITE (JOUT,2)
C WRITE (JOUT,*) ' ************ ITEMP *************'
C WRITE (JOUT,2)
C WRITE (JOUT,1)
C DO 6 I=422,521
C WRITE (JOUT,*) I,ICORE(I)
C 6 CONTINUE
C WRITE (JOUT,1)
C WRITE (JOUT,2)
C WRITE (JOUT,*) ' ************ XVEC *************'
C WRITE (JOUT,2)
C WRITE (JOUT,1)
C DO 7 I=262,457
C WRITE (JOUT,*) I,CORE(I)
C 7 CONTINUE
C
CALL ZERO(CORE,MAXCOR)
C
LTYP=7
C IBKTSP=MAXCOR-INTBUF
C LENGTH=IBKTSP/LTYP
C NIOBF=INTOWP(LENGTH)/SEC2I(1)
NIOBF=100
LENGTH=NIOBF*(SEC2I(1)/INTOWP(1))
IBKTSP=LENGTH*LTYP
C
JBKT=1
C WRITE (JOUT,*) ' JBKT=',JBKT
JIBKT=WPADTI(JBKT)
C WRITE (JOUT,*) ' JIBKT=',JIBKT
JBUF=JBKT+IBKTSP
C WRITE (JOUT,*) ' JBUF=',JBUF
JIBUF=WPADTI(JBUF)
C WRITE (JOUT,*) ' JIBUF=',JIBUF
JTOP=JBUF+INTBUF-1
C WRITE (JOUT,*) ' JTOP=',JTOP
C
CALL SORTI(CORE(JBKT),ICORE(JIBKT),CORE(JBUF),ICORE(JIBUF),LENGTH,
. LTYP,IBKTSP,INTBUF,NBF,NO,ITAP60,ITAP61,ITAP62,ITAP63,
. ITAP64,ITAP65,ITAP66,ITAP78,JOUT)
CALL RCLOSE(ITAP30,3)
CALL RCLOSE(ITAP78,3)
CALL RCLOSE(ITAP60,3)
CALL RCLOSE(ITAP61,3)
CALL RCLOSE(ITAP62,3)
CALL RCLOSE(ITAP63,3)
CALL RCLOSE(ITAP64,3)
CALL RCLOSE(ITAP65,3)
CALL RCLOSE(ITAP66,3)
WRITE (JOUT,*) ' CALLED RCLOSE TAPE 78'
CALL TSTOP(6)
C
END
C
C ********************
C-------------------------****** READ30 ******-------------------------
C ********************
C
SUBROUTINE READ30(ITAP30,MPOINT,MCONST,MCALCS,NCALCS,NBF,NBFAO,
. NSYMHF,MXCOEF,EIGVEC,EIGVAL,NLAMDA,ITEMP,XVEC,
. JOUT,NC,NO,PTOCC,WTEMP,ITYP,NIRRED,FLOV,ORBSYM,
. NTRI,NUMSYM,IWRK,KLPNT,IJPNT,IOFF1,IOFF2)
C
IMPLICIT REAL*8 (A-H,O-Z)
C
CHARACTER*4 CHAR,LABEL(20)
INTEGER NORD
REAL*8 EIGVEC(NBFAO,NBF),EIGVAL(NBF),XVEC(MXCOEF),WTEMP(NBF,NBF)
CHARACTER*4 ITYP(NSYMHF),ICSYM
INTEGER NLAMDA(NSYMHF),ITEMP(MCALCS),NC(NSYMHF),PTOCC(NBF),
. FLOV(NIRRED,2),ORBSYM(NBF),NUMSYM(NIRRED),IWRK(NIRRED),
. KLPNT(NTRI),IJPNT(NTRI),IOFF1(NTRI),IOFF2(NTRI)
integer symorb
C
JPOINT = 101 + MCONST + MPOINT
C
IC=0
DO 88 I=1,NBF
DO 88 J=1,I
IC=IC+1
IOFF1(IC)=I
IOFF2(IC)=J
88 CONTINUE
C
CALL WREADW (ITAP30,ITEMP,MCALCS,JPOINT,JPOINT)
LOCCAL = ITEMP(NCALCS)
JPOINT = LOCCAL + 60
CALL WREADW (ITAP30,LOCVEC,1,JPOINT,JPOINT)
CALL WREADW (ITAP30,XVEC,INTOWP(MXCOEF),LOCVEC,LOCVEC)
CALL WREADW (ITAP30,EIGVAL,INTOWP(NBF),LOCVEC,LOCVEC)
CALL WREADW (ITAP30,ITYP,NSYMHF,LOCVEC,LOCVEC)
C WRITE(*,*) 'ITYP',ITYP
C DO 333 I =1,NBF
C333 WRITE(6,*)'I=',I,'E(I)=',EIGVAL(I)
C LOCVEC = LOCVEC + NSYMHF
C WRITE(*,*) ' LOCVEC,MXCOEF = ',LOCVEC,MXCOEF
CALL WREADW (ITAP30,NLAMDA,NSYMHF,LOCVEC,LOCVEC)
C WRITE(*,*) ' NLAMDA ',NLAMDA
CALL WREADW (ITAP30,NC,NSYMHF,LOCVEC,LOCVEC)
NO=0
DO 555 I=1,NSYMHF
NO=NO+NC(I)
C WRITE (JOUT,*) ' NC=',NC(I)
555 CONTINUE
ICNT=0
IOF = 0
DO 558 I=1,NSYMHF
IF(I.NE.1) IOF = IOF + NLAMDA(I-1)
NOI=NC(I)
DO 557 J=1,NOI
ICNT=ICNT+1
IPT=IOF+J
C WRITE(6,*)'IPT=',IPT,ICNT
557 PTOCC(IPT)=ICNT
558 CONTINUE
IOF = 0
DO 658 I=1,NSYMHF
IF(I.NE.1) IOF = IOF + NLAMDA(I-1)
NVI=NLAMDA(I)-NC(I)
DO 657 J=1,NVI
ICNT=ICNT+1
IPT=IOF+NC(I) + J
C WRITE(6,*)'IPT=',IPT,ICNT
657 PTOCC(IPT)=ICNT
658 CONTINUE
DO 559 I=1,NBF
IPT=PTOCC(I)
559 WTEMP(IPT,1)=EIGVAL(I)
DO 569 I=1,NBF
EIGVAL(I)=WTEMP(I,1)
C WRITE(6,*)'I=',I,'E(I)=',EIGVAL(I)
569 CONTINUE
CALL ZERO(WTEMP,NBF*NBF)
C
C LET'S SYMMETRY BLOCK THE EIGENVECTORS
C
IOF = 0
IJ = 0
DO 1001 ISYM = 1,NSYMHF
N = NLAMDA(ISYM)
DO 1002 J = 1,N
DO 1003 I = 1,N
IJ = IJ + 1
EIGVEC(IOF+I,IOF+J) = XVEC(IJ)
1003 CONTINUE
1002 CONTINUE
IOF = IOF + N
1001 CONTINUE
C DO 1765 I=1,NBFAO
C DO 1765 J=1,NBF
C JPT=PTOCC(J)
C1765 EIGVEC(I,JPT)=WTEMP(I,J)
C
C WRITE(JOUT,*)
C WRITE(JOUT,*) ' THE SCF EIGENVECTORS '
C WRITE(JOUT,*)
C CALL MATOUT (EIGVEC,NBFAO,NBF,NBFAO,NBF,JOUT)
C
DO 805 ISYM = 1,NIRRED
FLOV(ISYM,1) = 0
FLOV(ISYM,2) = -1
805 CONTINUE
C
C GET SYMMETRY LABEL FROM INPUT
C
CALL LOCATE (5,'# INPUT ###',IERR)
IF(IERR.NE.0) THEN
WRITE (6,*)'NO INPUT WAS FOUND!'
STOP
ELSE
READ(5,6004)LABEL
READ(5,6004)LABEL
6004 FORMAT(20A4)
6005 FORMAT(A4,5X,I1)
READ(5,6005)CHAR,NORD
WRITE(6,6024)CHAR,NORD
6024 FORMAT(//,'SYMMETRY LABEL FROM INPUT',/,A4,5X,I1)
END IF
C
ICNT=0
DO 705 ISYM=1,NSYMHF
ICSYM=ITYP(ISYM)
ICNTH=ICNT+1
NBFI=NLAMDA(ISYM)
DO 700 I=1,NBFI
ICNT=ICNT+1
IF(ICSYM.EQ.'A1 ')ORBSYM(ICNT)=0
IF(ICSYM.EQ.'A2 ')ORBSYM(ICNT)=1
IF(ICSYM.EQ.'B1 ')ORBSYM(ICNT)=2
IF(ICSYM.EQ.'B2 ')ORBSYM(ICNT)=3
IF(ICSYM.EQ.'A ')ORBSYM(ICNT)=0
IF(ICSYM.EQ.'B ')ORBSYM(ICNT)=1
IF(ICSYM.EQ.'A'' ')ORBSYM(ICNT)=0
IF(ICSYM.EQ.'A" ')ORBSYM(ICNT)=1
IF(ICSYM.EQ.'AG ')ORBSYM(ICNT)=0
IF(ICSYM.EQ.'B1G ')ORBSYM(ICNT)=1
IF(ICSYM.EQ.'B2G ')ORBSYM(ICNT)=2
IF(ICSYM.EQ.'B3G ')ORBSYM(ICNT)=3
IF(ICSYM.EQ.'AU ')ORBSYM(ICNT)=4
IF(ICSYM.EQ.'B1U ')ORBSYM(ICNT)=5
IF(ICSYM.EQ.'B2U ')ORBSYM(ICNT)=6
IF(ICSYM.EQ.'B3U ')ORBSYM(ICNT)=7
IF(NIRRED.GT.4) GO TO 690
IF(ICSYM.EQ.'AG ')ORBSYM(ICNT)=0
IF(ICSYM.EQ.'BG ')ORBSYM(ICNT)=1
IF(ICSYM.EQ.'AU ')ORBSYM(ICNT)=2
IF(ICSYM.EQ.'BU ')ORBSYM(ICNT)=3
690 CONTINUE
IF(CHAR.EQ.'DN '.AND.NORD.EQ.2)THEN
IF(ICSYM.EQ.'A1 ')ORBSYM(ICNT)=0
IF(ICSYM.EQ.'B1 ')ORBSYM(ICNT)=1
IF(ICSYM.EQ.'B2 ')ORBSYM(ICNT)=2
IF(ICSYM.EQ.'B3 ')ORBSYM(ICNT)=3
ENDIF
700 CONTINUE
IF(ICNTH-1.NE.ICNT) THEN
SYMORB = ORBSYM(ICNT) + 1
FLOV(SYMORB,1)=ICNTH
FLOV(SYMORB,2)=ICNT
END IF
C WRITE(*,*)'ISYM',ISYM,'1',FLOV(ISYM,1)
C WRITE(*,*)'ISYM',ISYM,'2',FLOV(ISYM,2)
705 CONTINUE
C WRITE(*,*)'ORBSYM',ORBSYM
DO 122 I=1,NIRRED
IWRK(I)=0
NUMSYM(I)=0
122 CONTINUE
DO 123 I=1,NTRI
KLPNT(I)=0
123 CONTINUE
IJ=0
DO 124 I=1,NBF
ISYM=ORBSYM(I)
DO 124 J=1,I
JSYM=ORBSYM(J)
IJSYM=IEOR(ISYM,JSYM)
IJ=IJ+1
DO 125 IRR=1,NIRRED
IF (IJSYM.EQ.(IRR-1)) NUMSYM(IRR)=NUMSYM(IRR)+1
125 CONTINUE
IWRK(IJSYM+1)=IWRK(IJSYM+1)+1
KLPNT(IJ)=IWRK(IJSYM+1)
124 CONTINUE
IJLEN=NUMSYM(1)
DO 126 I=1,NTRI
IJPNT(I)=0
126 CONTINUE
IJ=0
DO 127 I=2,NBF
ISYM=ORBSYM(I)
DO 127 J=1,I
IJ=IJ+1
JSYM=ORBSYM(J)
IJSYM=IEOR(ISYM,JSYM)
IJPNT(IJ)=IJPNT(IJ-1)+IJLEN
IJLEN=NUMSYM(IJSYM+1)
127 CONTINUE
C WRITE (JOUT,*) ' PTOCC',PTOCC
C WRITE (JOUT,*) ' NUMSYM',NUMSYM
C WRITE (JOUT,*) ' IJPNT',IJPNT
C WRITE (JOUT,*) ' KLPNT',KLPNT
RETURN
END
C
C ******************
C---------------------------***** SETMBF *****--------------------------
C ******************
C
SUBROUTINE SETMBF(MBUF,IBUF)
IMPLICIT REAL*8 (A-H,O-Z)
MBUF=IBUF
RETURN
END
C
C ********************
C-------------------------****** SORTI *******-------------------------
C ********************
C
SUBROUTINE SORTI(BKT,IBKT,BUF,IBUF,LENGTH,LTYP,IBKTSP,INTBUF,NBF,
. NO,ITAP60,ITAP61,ITAP62,ITAP63,ITAP64,ITAP65,
. ITAP66,ITAP78,JOUT)
IMPLICIT REAL*8 (A-H,O-Z)
DIMENSION BKT(IBKTSP),BUF(INTBUF),IBKT(IBKTSP*2),
. IBUF(INTBUF*2)
DATA ITEMP /255/
11 FORMAT (' ')
12 FORMAT ('************************************************')
19 FORMAT (4I3,F20.12)
C WRITE(*,*) ' IN SORTI '
CALL ZERO(BKT,IBKTSP)
C
INTLEN=(INTOWP(LENGTH)-2)/INTOWP(1)
MAXVAL=INTOWP(INTLEN)/(1+INTOWP(1))
IVOFF=(MAXVAL+3)/INTOWP(1)
C WRITE (JOUT,*) ' LENGTH',LENGTH
C WRITE (JOUT,*) ' INTLEN',INTLEN
C WRITE (JOUT,*) ' MAXVAL',MAXVAL
C WRITE (JOUT,*) ' IVOFF',IVOFF
C
IBFLEN=(INTOWP(INTBUF)-2)/INTOWP(1)
MAXBUF=INTOWP(IBFLEN)/(1+INTOWP(1))
IBOFF=(MAXBUF+3)/INTOWP(1)
C WRITE (JOUT,*) ' MAXBUF=',MAXBUF
CALL SREW(ITAP78)
C
111 CALL ZERO(BUF,INTBUF)
CALL SREAD(ITAP78,BUF,INTOWP(INTBUF))
C
CALL SETMBF(IFLG,IBUF(1))
C WRITE (JOUT,*) ' IFLG=',IFLG
CALL SETMBF(MBUF,IBUF(2))
C WRITE (JOUT,*) ' MBUF=',MBUF
DO 101 II=1,MBUF
CALL SETMBF(IJKL,IBUF(2+II))
I=ISHFT(IJKL,-24)
J=IAND(ITEMP,ISHFT(IJKL,-16))
K=IAND(ITEMP,ISHFT(IJKL,-8))
L=IAND(ITEMP,IJKL)
RINT=BUF(IBOFF+II)
C WRITE (JOUT,11)
C WRITE (JOUT,12)
C WRITE (JOUT,*) ' ********* INTS AS READ INTO SORTI *******'
C WRITE (JOUT,11)
C WRITE (JOUT,12)
C WRITE (JOUT,19) I,J,K,L,RINT
IF (L.GT.NO) THEN
IF (J.GT.NO) THEN
NTYP=1
ELSE
NTYP=6
END IF
ELSE IF (K.GT.NO) THEN
IF (J.GT.NO) THEN
NTYP=5
ELSE
NTYP=3
END IF
ELSE IF (I.LE.NO) THEN
NTYP=0
ELSE IF (J.GT.NO) THEN
NTYP=2
ELSE
NTYP=4
END IF
C WRITE (JOUT,*) ' NTYP',NTYP
ITAP=60+NTYP
NOFF=NTYP*LENGTH
C WRITE (JOUT,*) ' NOFF',NOFF
IFILL=IBKT(INTOWP(NOFF)+2)+1
C WRITE (JOUT,*) ' IFILL',IFILL
IF (IFILL.GT.MAXVAL) THEN
C WRITE (JOUT,*) ' BUCKET DUMPED'
C WRITE (JOUT,*) ' IFILL',IFILL
C WRITE (JOUT,*) ' NTYP',NTYP
C WRITE (JOUT,*) ' LENGTH',LENGTH
CALL BKTDMP(BKT(NOFF+1),LENGTH,ITAP)
CALL ZERO(BKT(NOFF+1),LENGTH)
IFILL=1
END IF
IBKT(INTOWP(NOFF)+2+IFILL)=IJKL
BKT(IVOFF+NOFF+IFILL)=RINT
IBKT(INTOWP(NOFF)+2)=IFILL
C IF (NTYP.EQ.3) THEN
C WRITE (JOUT,19) I,J,K,L,BKT(IVOFF+NOFF+IFILL)
C END IF
C
101 CONTINUE
IF (IFLG.EQ.0) GOTO 111
DO 22 JTYP=1,LTYP
ITAP=59+JTYP
NOFF=(JTYP-1)*LENGTH
IBKT(INTOWP(NOFF)+1)=-1
CALL BKTDMP(BKT(NOFF+1),LENGTH,ITAP)
22 CONTINUE
C
RETURN
END