-
Notifications
You must be signed in to change notification settings - Fork 0
/
CCDMAT3.UNIXFORT
3624 lines (3624 loc) · 108 KB
/
CCDMAT3.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
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
cets The following is called by a C program which handles dynamic
cets allocation of memory.
subroutine fentry(core,icore,maxcor)
cets PROGRAM CCDMAT
C
C VERSION : 3
C WRITTEN BY: GUSTAVO E. SCUSERIA
C
C**********************************************************************
C* NOTICE OF PROGRAM MODIFICATION *
C**********************************************************************
C* BY: GUSTAVO E. SCUSERIA *
C* UPDATED: JUNE 26 , 1988. *
C* REASON: INCLUDE D2 POINT GROUP CONSTANTS. *
C**********************************************************************
C* BY: RICHARD REMINGTON search: c5-22-88 *
C* DATE: MAY 22, 1988 *
C* REASON: DECREASE CORE TO RUN IN 7MB ON 9370 *
C**********************************************************************
C* BY: GUSTAVO E. SCUSERIA *
C* UPDATED: DECEMBER 17, 1987 *
C* REASON: ALL LOOPS SYMMETRY ADAPTED *
C* : Z2, T2 AND TAU SYMMETRY-PACKED *
C**********************************************************************
C* BY: GUSTAVO E. SCUSERIA *
C* UPDATED: MARCH 7 , 1988. *
C* REASON: TAKE OUT FORMGC TO COMPILE IT LEVEL 2 *
C**********************************************************************
C* VERSION : CCDMAT -ORIGINAL- *
C* BY : ANDREW C. SCHEINER *
C* DATE : MAY 25 , 1987 *
C**********************************************************************
IMPLICIT INTEGER (A-Z)
CHARACTER*4 OPTION,CLABEL(20),RSTR,CHAR
cets REAL*8 CORE(1),ECOR,ETOT
real*8 core(maxcor),ecor,etot
COMMON/TAPES/ITAP81,ITAP82,ITAP83,ITAP99
c5-22-88 DIMENSION ICORE(3000000),I30(200)
cets DIMENSION ICORE(400000),I30(200)
dimension icore(intowp(maxcor)),i30(200)
cets EQUIVALENCE (CORE,ICORE)
cets CALL NOUNFL
call drum
c5-22-88 MAXCOR=1500000
cets MAXCOR= 200000
CALL ZERO(CORE,MAXCOR)
C
CALL TSTART(6)
C
INPUT=5
JOUT=6
WRITE(JOUT,6000)
6000 FORMAT( 56('-'),/,56('-'),/,
.' EFFECTIVE ONE- & TWO PDM FOR COUPLED CLUSTER PROGRAM',/,
.' WRITTEN BY ANDY SCHEINER & GUSTAVO SCUSERIA' ,/,
.' VERSION DEC 17 1987 ',/,56('-'),/,56('-') )
ITAP30=30
ITAP68=68
ITAP69=69
ITAP81=81
ITAP82=82
ITAP83=83
ITAP99=99
C
CALL RFILE(ITAP30)
CALL RFILE(ITAP68)
CALL RFILE(ITAP69)
CALL RFILE(ITAP81)
CALL RFILE(ITAP82)
CALL RFILE(ITAP83)
CALL RFILE(ITAP99)
C
CALL WREADW(ITAP30,I30,200,101,LWORD)
MPOINT=I30(2)
MCONST=I30(3)
MCALCS=I30(4)
NCALCS=I30(5)
NBF=I30(18)
NBFAO=I30(22)
NIRRED=I30(28)
NSYMHF=I30(41)
MXCOEF=I30(42)
NTR=(NBF*(NBF+1))/2
NTRAO=(NBFAO*(NBFAO+1))/2
C
IC=0
C
CALL ZERO(CORE,MAXCOR)
C
EIGVAL=1
NLAMDA=WPADTI(EIGVAL+NBF)
PTOCC=NLAMDA+NSYMHF
ITYP=PTOCC+NBF
FLOV=ITYP+NSYMHF
ORBSYM=FLOV+4*NIRRED
FZO=ORBSYM+NBF
FZV=FZO+NBF
NFZO=FZV+NBF
NFZV=NFZO+NIRRED
NT3=NFZV+NIRRED
ITEMP=NT3+NIRRED
NC=ITEMP+MCALCS
ITEP=NC+NSYMHF
WTEMP=IADTWP(ITEP+NIRRED)
TOP=WTEMP+NBF-1
C
CALL READ30(ITAP30,MPOINT,MCONST,MCALCS,NCALCS,NBF,NSYMHF,MXCOEF,
. CORE(EIGVAL),ICORE(NLAMDA),ICORE(ITEMP),JOUT,ICORE(NC)
. ,NO,CORE(WTEMP),ICORE(PTOCC),ICORE(ITYP),ICORE(ORBSYM)
. ,ICORE(FLOV),NIRRED,ICORE(ITEP),ENUC,ESCF,CHAR,NORD)
NV=NBF-NO
NTRO=NO*(NO+1)/2
NTRV=NV*(NV+1)/2
NO2=NO*NO
NV2=NV*NV
NOV=MAX0(NO,NV)
N2OV=MAX0(NO*NV,NTRV)
C
C READ CCSD INPUT
C
CALL LOCATE (INPUT,'# CCSD ###',IERR)
IF(IERR.NE.0) THEN
WRITE (JOUT,6007)
WRITE ( 4,6007)
6007 FORMAT(//,2X,' WARNING! NO INPUT TO CCSD HAS BEEN FOUND.',/,
. 2X,' DEFAULT PARAMETERS WILL BE USED.',//)
OPTION='CCSD'
NGO=2
NMIN =2
MINDIM=2
MAXDIM=8
MAXIT=20
CONVI=7
DO 622 I=1,NIRRED
ICORE(NFZO+I-1)=0
622 ICORE(NFZV+I-1)=0
ELSE
READ(5,6004)CLABEL
6004 FORMAT(20A4)
READ(5,6002)EPSI,NGO,NMIN ,MINDIM,MAXDIM,FLDIIS,IRSTR
IF(EPSI .EQ.0)EPSI =5
IF(NGO .EQ.0)NGO =2
IF(NMIN .EQ.0)NMIN =2
IF(MINDIM.EQ.0)MINDIM=2
IF(MAXDIM.EQ.0)MAXDIM=8
IF(IRSTR.NE.1) RSTR='NO '
IF(IRSTR.EQ.1) RSTR='YES '
READ(5,6002)CONVI,MAXIT
IF(CONVI .EQ.0)CONVI =7
IF(MAXIT .EQ.0)MAXIT =20
6002 FORMAT(16I5)
DO 623 I=1,NIRRED
623 READ(INPUT,6051)ICORE(NFZO+I-1),ICORE(NFZV+I-1)
6051 FORMAT(I2,1X,I2)
READ(INPUT,6052)OPTION, PRTS
6052 FORMAT(A4,1X,5X,A4)
END IF
WRITE(JOUT,6022)CLABEL,OPTION,CHAR,NORD
6022 FORMAT(//,2X,'***** CC PARAMETERS *****',
. /,2X,'LABEL = ',20A4,
. /,2X,'OPTION = ',A4,
C . /,2X,'RSTR = ',A4,
C . /,2X,'CONVI = ',I4,
C . /,2X,'MAXIT = ',I4,
C . /,2X,'FLDIIS = ',I4,
C . /,2X,'LENBUF = ',I6,
. /,2X,'SYMM = ',A4,I1)
CALL NCOUNT(ICORE(ORBSYM),ICORE(FLOV),NIRRED,NO,NV,NBF,
. ICORE(FZO),ICORE(FZV),NT1,NT2,
. ICORE(NT3),NTAU,OPTION)
C
C ~~~~~~~~~~~~ ALLOCATE CORE MEMORY ~~~~~~~~~~~~~~~~
C
TOFF=ITEMP
TADD=TOFF+NO*NO*2
IOFF=TADD+NV*NV
INO=IOFF+NTR
INV=INO+NOV
INTRO=INV+NOV
INTRV=INTRO+N2OV
ZLX=INTRV+NO*NV
AOFF=ZLX+NV*NV
AADD=AOFF+NO*NO
COFF=AADD+NO*NO
CADD=COFF+NV*NV
DOFF=CADD+NO*NO
DADD=DOFF+NO*NV
EOFF=DADD+NO*NV
EADD=EOFF+NO*NV
T1=IADTWP(EADD+NO*NO)
Z1=T1+NO*NV
TOP=Z1+NO*NV
IF(OPTION.EQ.'SDT1')THEN
Y3=TOP
W3=Y3+NTAU
TOP=W3+NTAU
T3OFF=WPADTI(TOP)
T3ADD=T3OFF+NO*NO*NIRRED*2
MOO=IADTWP(T3ADD+NV*NV*NIRRED)
NVV=MOO+NO*NO
TOP=NVV+NV*NV
ELSE
Y3=1
W3=1
T3OFF=1
T3ADD=1
MOO=1
NVV=1
ENDIF
C
C FORM SYMMETRY-PACKING ARRAYS AND OFFSETS
C
CALL OFFSET(ICORE(INO),ICORE(INV),ICORE(INTRO),ICORE(INTRV),
. ICORE(ZLX),ICORE(IOFF),
. NBF,NO,NV,NOV,NTRO,NTRV,N2OV,NTR,JOUT)
CALL SYMARR(ICORE(ORBSYM),ICORE(FLOV),NIRRED,NO,NV,NBF,NOV,NM,
. ICORE(FZO),ICORE(FZV),ICORE(NFZO),ICORE(NFZV),
. ICORE(TOFF),ICORE(TADD),ICORE(INO),ICORE(INV),NO2,NV2,
. ICORE(T3OFF),ICORE(T3ADD),OPTION,
. NSGOO,NSGOV,NSHOV,NSLOV,
. ICORE(AOFF),ICORE(AADD),ICORE(COFF),ICORE(CADD),
. ICORE(DOFF),ICORE(DADD),ICORE(EOFF),ICORE(EADD))
C
WRITE(JOUT,6428)NSGOO,NSGOV,NSHOV,NSLOV
6428 FORMAT(/,'LENGTH OF SYMMETRY-PACKED TWO-PDM',
. /,' GA TERMS = ',I8,
. /,' GC TERMS = ',I8,
. /,' GD TERMS = ',I8,
. /,' GE TERMS = ',I8)
MAXPDM=NSGOO
IF(NSGOV.GT.MAXPDM)MAXPDM=NSGOV
IF(NSHOV.GT.MAXPDM)MAXPDM=NSHOV
IF(NSLOV.GT.MAXPDM)MAXPDM=NSLOV
C
C READ TAPE 69
C
CALL SREAD(ITAP69,NM,1)
CALL SREAD(ITAP69,NDIMT2,1)
C
T2=TOP
Z2=T2+NDIMT2
TAU=Z2+NDIMT2
TOP=TAU+NDIMT2
IF (TOP.GT.MAXCOR) THEN
WRITE (JOUT,*) ' BEFORE READ TAPE 69 : NOT ENOUGH CORE'
WRITE (JOUT,*) ' TOP ',TOP,' MAXCOR ',MAXCOR
STOP
END IF
C
WRITE(JOUT,6049)
6049 FORMAT(/,' POINTERS TO FILE69')
CALL RGETSA(ITAP69,IT169)
WRITE (JOUT,*) ' IT169=',IT169
CALL SREAD(ITAP69,CORE(T1),INTOWP(NO*NV))
C
CALL RGETSA(ITAP69,IT269)
WRITE (JOUT,*) ' IT269=',IT269
CALL SREAD(ITAP69,CORE(T2),INTOWP(NDIMT2))
CALL FRMTAU(ICORE(ORBSYM),ICORE(FLOV),NIRRED,NO,NV,
. CORE(TAU),CORE(T2),NDIMT2,CORE(T1))
C CALL UNPKT2(ICORE(ORBSYM),ICORE(FLOV),NIRRED,NO,NV,NBF,NO2,NTRV,
C . NTR,CORE(T2),CORE(T2),NDIMT2,JOUT)
C CALL GRMTAU(CORE(TAU),CORE(T2),CORE(T1),NO,NV,NO2,NV2,NTRO,NTRV,
C . ICORE(IOFF),NTR,JOUT)
C
CALL RGETSA(ITAP69,IETOT)
WRITE (JOUT,*) ' IETOT=',IETOT
CALL SREAD(ITAP69,ETOT,INTOWP(1))
C
CALL RGETSA(ITAP69,IEC)
WRITE (JOUT,*) ' IECOR=',IEC
CALL SREAD(ITAP69,ECOR,INTOWP(1))
C
CALL RGETSA(ITAP69,IZ169)
WRITE (JOUT,*) ' IZ169=',IZ169
CALL SREAD(ITAP69,CORE(Z1),INTOWP(NO*NV))
C
CALL RGETSA(ITAP69,IZ269)
WRITE (JOUT,*) ' IZ269=',IZ269
CALL SREAD(ITAP69,CORE(Z2),INTOWP(NDIMT2))
C
WRITE(*,*)
WRITE(*,*)'ECOR FROM FILE69 ',ECOR
WRITE(*,*)'ETOT FROM FILE69 ',ETOT
C
QOO=TOP
QVV=QOO+NTRO
QOV=QVV+NTRV
GBUF=SEC2I(100)/INTOWP(1)
BUF=QOV+NO*NV
IBUF=WPADTI(BUF)
GMAT=BUF+GBUF
GAMAT=GMAT
GCMAT=GMAT
GDMAT=GMAT
GEMAT=GMAT
VALV2=GMAT+MAXPDM
VALOV=VALV2+NTRV
T3Z2=VALOV+NV*NO
VALOV2=T3Z2+NO*NV*NV
VALOV3=VALOV2+NV2*NO
VALO3V=VALOV3+NV2*NO
Q1=VALO3V+NV*NO2*NO
Q2=Q1+NO*NV
Q3=Q2+NO*NV
TZ2=Q3+NO*NV
VALO=TZ2+NO2
VALV=VALO+NO
Q1A=VALV+NV
TZA=Q1A+NO*NO
TOP=TZA+NO*NO
ICOR = TOP *8/1024
IMCOR =MAXCOR*8/1024
WRITE(JOUT,6001)IMCOR,MAXCOR,ICOR,TOP
6001 FORMAT(//,' MAXIMUM CORE = ',I7,2X,'K BYTES OR ',I9 ,' REAL',
. ' WORDS',/,
. ' REQUIRED CORE = ',I7,2X,'K BYTES OR ',I9 ,' REAL',
. ' WORDS',//)
IF (TOP.GT.MAXCOR) THEN
WRITE (JOUT,*) ' NOT ENOUGH CORE'
WRITE (JOUT,*) ' TOP ',TOP,' MAXCOR ',MAXCOR
STOP
END IF
C
CALL FORMGD(CORE(GDMAT),CORE(TAU),CORE(T2),CORE(T1),CORE(Z2),
. CORE(Z1),NO,NV,NO2,NV2,NTRO,NTRV,ICORE(IOFF),NTR,
. CORE(Q1),CORE(Q2),CORE(Q3),CORE(TZ2),CORE(VALO),
. CORE(VALV),JOUT,OPTION,
. ICORE(ORBSYM),ICORE(FLOV),ICORE(ZLX),ICORE(INO),ICORE(INV),
. ICORE(NT3),NIRRED,NTAU,NOV,ICORE(T3OFF),ICORE(T3ADD),CORE(W3),
. CORE(MOO),CORE(NVV),CORE(Y3),NDIMT2,ICORE(TOFF),ICORE(TADD),
. ICORE(DOFF),ICORE(DADD),NSHOV)
CALL WRTGD(CORE(BUF),ICORE(IBUF),GBUF,NBF,NO,NV,ITAP68,
. CORE(GDMAT),NSHOV,ICORE(IOFF),NTR,JOUT,ICNT,
. ICORE(DOFF),ICORE(DADD),ICORE(INO),
. ICORE(FLOV),ICORE(ORBSYM),NIRRED)
C
CALL FORMGA(CORE(GAMAT),CORE(TAU),CORE(T2),CORE(T1),CORE(Z2),
. CORE(Z1),NO,NV,NO2,NV2,NTRO,NTRV,ICORE(IOFF),NTR,JOUT,
. ICORE(ZLX),ICORE(FLOV),ICORE(ORBSYM),NIRRED,
. CORE(Q1A),CORE(TZA),OPTION,CORE(MOO),
. NDIMT2,ICORE(TOFF),ICORE(TADD),
. ICORE(AOFF),ICORE(AADD),ICORE(INO),NSGOO)
CALL WRTGA(CORE(BUF),ICORE(IBUF),GBUF,NBF,NO,NV,ITAP68,
. CORE(GAMAT),NSGOO,ICORE(IOFF),NTR,JOUT,ICNT,
. ICORE(AOFF),ICORE(AADD),ICORE(INO),
. ICORE(FLOV),ICORE(ORBSYM),NIRRED)
C
CALL FORMGF(CORE(BUF),ICORE(IBUF),GBUF,CORE(TAU),CORE(T2),
. CORE(T1),CORE(Z2),CORE(Z1),NO,CORE(VALOV),CORE(VALOV2),
. NV,NO2,NV2,NTRO,NTRV,ICNT,ICORE(ZLX),CORE(VALV2),
. CORE(VALOV3),CORE(VALO3V),ICORE(IOFF),NTR,CORE(VALV),
. JOUT,ITAP68,OPTION,
. ICORE(ORBSYM),ICORE(FLOV),CORE(T3Z2),ICORE(INO),ICORE(INV),
. ICORE(NT3),NIRRED,NTAU,NOV,ICORE(T3OFF),ICORE(T3ADD),
. CORE(W3),CORE(Y3),NDIMT2,ICORE(TOFF),ICORE(TADD))
C
CALL FORMGB(CORE(BUF),ICORE(IBUF),GBUF,CORE(TAU),CORE(Z2),
. NO,NV,NO2,NV2,NTRO,
. NTRV,ICNT,ICORE(IOFF),NTR,ICORE(ZLX),
. JOUT,ITAP68,ICORE(FLOV),ICORE(ORBSYM),NIRRED,
. NDIMT2,ICORE(TOFF),ICORE(TADD))
C
CALL FORMGC(CORE(GCMAT),CORE(TAU),CORE(T2),CORE(T1),CORE(Z2),
. CORE(Z1),NO,NV,NO2,NV2,NTRO,NTRV,ICORE(IOFF),NTR,JOUT,
. ICORE(ZLX),ICORE(FLOV),ICORE(ORBSYM),NIRRED,
. OPTION,CORE(NVV),NDIMT2,ICORE(TOFF),ICORE(TADD),
. ICORE(COFF),ICORE(CADD),NSGOV,ICORE(INO),ICORE(INV),NOV)
CALL WRTGC(CORE(BUF),ICORE(IBUF),GBUF,NBF,NO,NV,ITAP68,
. CORE(GCMAT),NSGOV,ICORE(IOFF),NTR,JOUT,ICNT,
. ICORE(COFF),ICORE(CADD),ICORE(INO),ICORE(INV),NOV,
. ICORE(FLOV),ICORE(ORBSYM),NIRRED)
C
CALL FORMGE(CORE(GEMAT),CORE(TAU),CORE(T2),CORE(T1),CORE(Z2),
. CORE(Z1),NO,NV,NO2,NV2,NTRO,NTRV,ICORE(IOFF),NTR,
. CORE(Q1),CORE(Q2),CORE(Q3),CORE(VALO),JOUT,OPTION,
. ICORE(ORBSYM),ICORE(FLOV),ICORE(ZLX),ICORE(INO),ICORE(INV),
. ICORE(NT3),NIRRED,NTAU,NOV,ICORE(T3OFF),ICORE(T3ADD),CORE(W3)
. ,CORE(Y3),NDIMT2,ICORE(TOFF),ICORE(TADD),
. ICORE(EOFF),ICORE(EADD),NSLOV)
CALL WRTGE(CORE(BUF),ICORE(IBUF),GBUF,NBF,NO,NV,ITAP68,
. CORE(GEMAT),NSLOV,ICORE(IOFF),NTR,JOUT,ICNT,
. ICORE(EOFF),ICORE(EADD),ICORE(INO),NOV,
. ICORE(FLOV),ICORE(ORBSYM),NIRRED)
C
CALL FORMQ(CORE(QOO),CORE(QVV),CORE(QOV),CORE(TAU),CORE(T2),
. CORE(T1),CORE(Z2),CORE(Z1),NO,NV,NO2,NV2,NTRO,NTRV,
. ICORE(IOFF),NTR,JOUT,OPTION,
. ICORE(ORBSYM),ICORE(FLOV),ICORE(ZLX),ICORE(INO),ICORE(INV),
. ICORE(NT3),NIRRED,NTAU,NOV,ICORE(T3OFF),ICORE(T3ADD),CORE(W3),
. CORE(MOO),CORE(NVV),NDIMT2,ICORE(TOFF),ICORE(TADD))
CALL WRTQQ(CORE(BUF),ICORE(IBUF),GBUF,NBF,NO,NV,ITAP68,
. CORE(QOO),NTRO,CORE(QVV),NTRV,CORE(QOV),ICORE(IOFF),
. NTR,JOUT,ICNT)
C
C
WRITE(JOUT,6059)
6059 FORMAT(//,18X,' >>> CONSTRUCTION OF ONE & TWO-PDM COMPLETED <<<')
CALL RCLOSE(ITAP30,3)
CALL RCLOSE(ITAP68,3)
CALL RCLOSE(ITAP69,3)
CALL RCLOSE(ITAP81,3)
CALL RCLOSE(ITAP82,3)
CALL RCLOSE(ITAP83,3)
CALL RCLOSE(ITAP99,3)
CALL TSTOP(6)
END
C
C ********************
C-------------------------****** FORMGA ******-------------------------
C ********************
C
C
SUBROUTINE FORMGA(GAMAT,TAU,T2,T1,Z2,Z1,NO,NV,NO2,NV2,NTRO,NTRV,
. IOFF,NTR,JOUT,ZLX,FLOV,ORBSYM,NIRRED,
. Q1,TZ,OPTION,MOO,NDIMT2,TOFF,TADD,
. AOFF,AADD,ITR,NSGOO)
IMPLICIT INTEGER (A-Z)
CHARACTER*4 OPTION
REAL*8 GAMAT(NSGOO),T1(NO,NV),
. Z1(NO,NV),VAL,VAL2,FAC,FAC1,FACIJ,FACKL,FACTR
REAL * 8 Q1(NO,NO),TZ(NO,NO),MOO(NO,NO),
. T2(NDIM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AT(IJKL)-4.D0*(TZ(K,L)+Q1(K,L))
942 CONTINUE
941 CONTINUE
911 CONTINUE
C
DO 811 I=1,NO
DO 821 J=1,I
IJ=ITR(I)+J
DO 841 K=1,I
VAL=TZ(I,K)+Q1(I,K)
K1=K
IF(K.EQ.I)K1=J
DO 842 L=1,K1
IF(L.NE.J)GO TO 842
KL=ITR(K)+L
IJKL=AOFF(IJ)+AADD(KL)
GAMAT(IJKL)=GAMAT(IJKL)+VAL
842 CONTINUE
841 CONTINUE
821 CONTINUE
811 CONTINUE
C
DO 711 I=1,NO
DO 721 J=1,I
IJ=ITR(I)+J
DO 741 K=1,I
VAL=TZ(J,K)+Q1(J,K)
K1=K
IF(K.EQ.I)K1=J
DO 742 L=1,K1
IF(L.NE.I)GO TO 742
KL=ITR(K)+L
IJKL=AOFF(IJ)+AADD(KL)
GAMAT(IJKL)=GAMAT(IJKL)+VAL
742 CONTINUE
741 CONTINUE
721 CONTINUE
711 CONTINUE
C
C
DO 611 I=1,NO
DO 621 J=1,I
IJ=ITR(I)+J
DO 641 K=1,I
IF(K.NE.J)GO TO 641
K1=K
IF(K.EQ.I)K1=J
DO 642 L=1,K1
KL=ITR(K)+L
IJKL=AOFF(IJ)+AADD(KL)
GAMAT(IJKL)=GAMAT(IJKL)+TZ(I,L)+Q1(I,L)
642 CONTINUE
641 CONTINUE
621 CONTINUE
611 CONTINUE
C
C
DO 511 I=1,NO
DO 521 J=1,I
IJ=ITR(I)+J
DO 541 K=1,I
IF(K.NE.I)GO TO 541
K1=J
DO 542 L=1,K1
KL=ITR(K)+L
IJKL=AOFF(IJ)+AADD(KL)
GAMAT(IJKL)=GAMAT(IJKL)+TZ(J,L)+Q1(J,L)
542 CONTINUE
541 CONTINUE
521 CONTINUE
511 CONTINUE
C
C
C
C DO 2222 I=1,NO
C DO 2222 J=1,I
C IJ=IOFF(I)+J
C DO 2222 K=1,I
C M=K
C IF (K.EQ.I) M=J
C DO 2222 L=1,M
C KL=IOFF(K)+L
C IJKL=IOFF(IJ)+KL
C WRITE (JOUT,1) I,J,K,L,GAMAT(IJKL)
C2222 CONTINUE
C
C RETURN
END
C ********************
C-------------------------****** FORMGB ******-------------------------
C ********************
C
C
SUBROUTINE FORMGB(BUF,IBUF,GBUF,TAU,Z2,NO,NV,NO2,NV2,NTRO,NTRV,
. ICNT,IOFF,NTR,ZLX,JOUT,ITAP68,FLOV,ORBSYM,
. NIRRED,NDIMT2,TOFF,TADD)
IMPLICIT INTEGER (A-Z)
COMMON/BUFFER/TOL,IBFLEN,MAXBUF,IBOFF
REAL*8 BUF(GBUF),VAL,TOL,Z2(NDIMT2),TAU(NDIMT2)
DIMENSION IOFF(NTR),ZLX(NV,NV),IBUF(GBUF*2),ORBSYM(NO+NV),
. FLOV(NIRRED,4),TOFF(NO,NO,2),TADD(NV,NV)
C
WRITE(*,*)'GBMAT'
WRITE(*,*)'ICNT= ',ICNT
DO 10 A=1,NV
ASYM=ORBSYM(A+NO)
DO 20 B=1,A
BSYM=ORBSYM(B+NO)
ABSYM=IEOR(ASYM,BSYM)
DO 30 C=1,A
CSYM=ORBSYM(C+NO)
ACSYM=IEOR(ASYM,CSYM)
BCSYM=IEOR(BSYM,CSYM)
DSYM=IEOR(ABSYM,CSYM)+1
FD=FLOV(DSYM,3)-NO
LD=FLOV(DSYM,4)-NO
ZLBC=ZLX(B,C)
MAXD=C
IF (C.EQ.A) MAXD=B
IF (LD.GT.MAXD) LD=MAXD
DO 40 D=FD,LD
ZLBD=ZLX(B,D)
VAL=0.0D+00
DO 50 I=1,NO
ISYM=ORBSYM(I)
JSYM=IEOR(ISYM,ACSYM)+1
FJ=FLOV(JSYM,1)
LJ=FLOV(JSYM,2)
DO 60 J=FJ,LJ
IJBD=TOFF(I,J,ZLBD)+TADD(B,D)
IJAC=TOFF(I,J,1 )+TADD(A,C)
VAL=VAL+TAU(IJAC)*Z2(IJBD)+TAU(IJBD)*Z2(IJAC)
60 CONTINUE
JSYM=IEOR(ISYM,BCSYM)+1
FJ=FLOV(JSYM,1)
LJ=FLOV(JSYM,2)
DO 61 J=FJ,LJ
IJAD=TOFF(I,J,1 )+TADD(A,D)
IJBC=TOFF(I,J,ZLBC)+TADD(B,C)
VAL=VAL+TAU(IJBC)*Z2(IJAD)+TAU(IJAD)*Z2(IJBC)
61 CONTINUE
50 CONTINUE
IF (DABS(VAL).GT.TOL) THEN
LBL=IOR(B+NO,ISHFT(A+NO,8))
LBL=IOR(C+NO,ISHFT(LBL,8))
LBL=IOR(D+NO,ISHFT(LBL,8))
IF (ICNT.GT.MAXBUF) THEN
CALL SWRIT(ITAP68,IBUF,INTOWP(GBUF))
CALL ZERO(BUF,GBUF)
ICNT=1
ENDIF
IBUF(1)=0
IBUF(2)=ICNT
IBUF(2+ICNT)=LBL
BUF(ICNT+IBOFF)=VAL
ICNT=ICNT+1
ENDIF
40 CONTINUE
30 CONTINUE
20 CONTINUE
10 CONTINUE
C
RETURN
END
C**********************************************************************
C* IMPORTANT NOTICE!!!! *
C* *
C* PLEASE COMPILE THIS AT OPTIMIZATION LEVEL 2 or LOWER *
C* *
C* IMPORTANT NOTICE!!!! *
C**********************************************************************
C* NOTICE OF PROGRAM MODIFICATION *
C**********************************************************************
C* BY: RICHARD REMINGTON search: c5-22-88 *
C* DATE: MAY 22, 1988 *
C* REASON: DECREASE CORE TO RUN IN 7MB ON 9370 *
C**********************************************************************
C
SUBROUTINE FORMGC(GCMAT,TAU,T2,T1,Z2,Z1,NO,NV,NO2,NV2,NTRO,NTRV,
. IOFF,NTR,JOUT,ZLX,FLOV,ORBSYM,NIRRED,
. OPTION,NVV,NDIMT2,TOFF,TADD,
. COFF,CADD,NSGOV,INO,INV,NOV)
IMPLICIT INTEGER (A-Z)
CHARACTER*4 OPTION
REAL*8 GCMAT(NSGOV),Z2(NDIMT2),T2(NDIMT2),T1(NO,NV),
. Z1(NO,NV),TAU(NDIMT2),NVV(NV,NV),
. VAL,VAL2,FACIJ,FACAB
DIMENSION IOFF(NTR),ZLX(NV,NV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COFF(AB)+CADD(IJ)
VAL=0.0D+00
VAL2=0.0D+00
DO 57 K=1,NO
KSYM=ORBSYM(K)
VAL=VAL+T1(K,A)*Z1(K,B)
DO 67 L=1,NO
LSYM=ORBSYM(L)
KLSYM=IEOR(KSYM,LSYM)
CSYM=IEOR(KLSYM,ASYM)+1
FC=FLOV(CSYM,3)-NO
TC=FLOV(CSYM,4)-NO
DO 77 C=FC,TC
ZLAC=ZLX(A,C)
ZLBC=ZLX(B,C)
KLAC=TOFF(K,L,ZLAC)+TADD(A,C)
KLBC=TOFF(K,L,ZLBC)+TADD(B,C)
VAL2=VAL2+T2(KLAC)*Z2(KLBC)
77 CONTINUE
67 CONTINUE
57 CONTINUE
GCMAT(ABIJ)=GCMAT(ABIJ)+(VAL+VAL+VAL+VAL+VAL2+VAL2+VAL2
. +VAL2)*FACAB
47 CONTINUE
48 CONTINUE
30 CONTINUE
20 CONTINUE
10 CONTINUE
C
RETURN
END
C ********************
C-------------------------****** FORMGC ******-------------------------
C ********************
C
C
C ********************
C-------------------------****** FORMGD ******-------------------------
C ********************
C
C
SUBROUTINE FORMGD(GDMAT,TAU,T2,T1,Z2,Z1,NO,NV,NO2,NV2,NTRO,NTRV,
. IOFF,NTR,Q1,Q2,Q3,TZ2,VALO,VALV,JOUT,OPTION,
. ORBSYM,FLOV,ZLX,ITR,ITV,NT3,NIRRED,NTAU,NOV,
. T3OFF,T3ADD,W3,MOO,NVV,Y3,NDIMT2,TOFF,TADD,
. DOFF,DADD,NSHOV)
IMPLICIT INTEGER (A-Z)
COMMON/TAPES/ITAP81,ITAP82,ITAP83,ITAP99
CHARACTER*4 OPTION
REAL*8 GDMAT(NSHOV),VALO(NO),
. T1(NO,NV),Z1(NO,NV),Q1(NO,NV),Q2(NO,NV),
. VALV(NV),Q3(NO,NV),TZ2(NO,NO),W3(NTAU),MOO(NO,NO),
. NVV(NV,NV),Y3(NTAU)
REAL*8 VAL,VAL1,VAL2,VAL3,VAL4,VAL5,VAL6,VAL7,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