-
Notifications
You must be signed in to change notification settings - Fork 0
/
CCSDT1.FORT10
961 lines (961 loc) · 33.2 KB
/
CCSDT1.FORT10
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
C
C CCSDT-1A SUBROUTINE. WRITTEN BY GUSTAVO E. SCUSERIA. OCTOBER 7, 1988.
C
C***********************************************************************
C NOTICE OF PROGRAM MODIFICATION
C***********************************************************************
c Moved to PSI area on 2/4/89 by clj.
C***********************************************************************
C BY: GUSTAVO E. SCUSERIA
C DATE: NOVEMBER 2, 1988
C REASON: RCLOSE (ITAP81,4) AFTER UPDATING T1 & T2
C***********************************************************************
SUBROUTINE CCSDT1( S,T1N,T2 ,T1,TAU,NO,NV,NDIMT2,NIT,
. ORBSYM,FLOV,NIRRED,TOFF,TADD,ZLX,FZO,FZV,
. UOFF,VADD,OPTION,RSTR,NT3,DOFF,DADD,EOFF,EADD,
. FOFF,FADD,ITV,ITR,IPQ,DIN,EIN,FIN,SORT,FOCK,
. AUX1,AUX2,AUX3,SUX1,SUX2,SUX3,
. XAR1,XAR2,NOACT,NVACT,MAXO,MAXV,MAXOV,
. AR1,AR2,SUX11,SUX22,XAR3,XAR4,AUX4,AUX5)
IMPLICIT INTEGER(A-Z)
REAL*8 S(NDIMT2),T1N(NO,NV),T2(NDIMT2),T1(NO,NV),TAU(*),FOCK(*),
. VAL,VAL1,VAL2,DIN(*),EIN(*),FIN(*),
. AUX1(NV,NO),AUX2(NV,NO),AUX3(NV,NV),SUX11(NO*NV),
. AUX4(NO,NO),AUX5(NO,NV),
. SUX1(NV*NO),SUX2(NV*NO),SUX3(NV*NV),SUX22(NO*NV),
. XAR1(MAXV,MAXOV),XAR2(MAXV,MAXOV),
. XAR3(MAXO,MAXOV),XAR4(MAXO,MAXOV),
. AR1(MAXOV,MAXOV),AR2(MAXOV,MAXOV)
CHARACTER*4 OPTION,RSTR,SORT
INTEGER ORBSYM(*),FLOV(NIRRED,4),TOFF(NO,NO,2,NIRRED),ZLX(NV,NV),
. TADD(NV,NV,NIRRED),FZO(NO),FZV(NV),UOFF(NO,NO,2),NT3(8),
. VADD(NV,NV),DOFF(*),DADD(*),FOFF(*),FADD(*),EOFF(*),
. EADD(*),ITR(*),ITV(*),IPQ(*)
C
SORT='NO '
ITAP81=81
IF(NIT.EQ.3)THEN
WRITE(6,*)'ENTERING CCSDT-1A SUBROUTINE'
CALL TIMIT(1,6)
END IF
C
IF(NIT.EQ.1.AND.RSTR.EQ.'NO ')GO TO 9900
IF(NIT.EQ.0.AND.RSTR.EQ.'YES ')GO TO 9900
C
C ADD CCSDT TERMS TO T2 EQUATION. F INTS.
C
CALL RFILE(ITAP81)
I81=1
DO 6290 A=1,NV
IF(FZV(A).EQ.1)GO TO 6290
ASYM=ORBSYM(A+NO)
DO 6285 U=1,NO
IF(FZO(U).EQ.1)GO TO 6285
USYM=ORBSYM(U)
AUSYM=IEOR(ASYM,USYM)
AUS=AUSYM+1
DIM=NT3(AUS)
CALL WREADW (ITAP81,TAU,INTOWP(DIM),I81,I81)
DO 6282 XSYM=1,NIRRED
XBI=0
DO 6220 B=1,NV
IF(FZV(B).EQ.1)GO TO 6220
BSYM=ORBSYM(B+NO)
DO 6215 I=1,NO
IF(FZO(I).EQ.1)GO TO 6215
ISYM=ORBSYM(I)
BISYM=IEOR(BSYM,ISYM)
IF(BISYM.NE.XSYM-1)GO TO 6215
AUBIS=IEOR(AUSYM,XSYM-1)
XBI=XBI+1
XGAV=0
DO 6210 GA=1,NV
IF(FZV(GA).EQ.1)GO TO 6210
GASYM=ORBSYM(GA+NO)
VSYM=IEOR(GASYM,AUBIS)+1
FV=FLOV(VSYM,1)
LV=FLOV(VSYM,2)
ZLGAB=ZLX(GA,B)
DO 6205 V=FV,LV
XGAV=XGAV+1
VIGAB=TOFF(V,I,ZLGAB,AUS)+TADD(GA,B,AUS)
VIBGA=TOFF(I,V,ZLGAB,AUS)+TADD(GA,B,AUS)
AR1(XBI,XGAV)=TAU(VIGAB)
AR2(XBI,XGAV)=TAU(VIBGA)
6205 CONTINUE
6210 CONTINUE
6215 CONTINUE
6220 CONTINUE
LIMBI=XBI
LIMGAV=XGAV
C WRITE(6,*)'A=',A,' U=',U,' XSYM=',XSYM,' LIM=',LIMBI,LIMGAV
BESYM=IEOR(ASYM,XSYM-1)
BEUSYM=IEOR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A=UOFF(U,V,1)+VADD(BE,GA)
S(UVBEGA)=S(UVBEGA)+SUX11(XGAV)+SUX22(XGAV)
VUGABE=UOFF(V,U,1)+VADD(GA,BE)
S(VUGABE)=S(VUGABE)+SUX11(XGAV)+SUX22(XGAV)
6246 CONTINUE
6251 CONTINUE
DO 6252 GA=BE+1,NV
IF(FZV(GA).EQ.1)GO TO 6252
GASYM=ORBSYM(GA+NO)
VSYM=IEOR(GASYM,BEUSYM)+1
FV=FLOV(VSYM,1)
LV=FLOV(VSYM,2)
DO 6247 V=FV,LV
XGAV=XGAV+1
VUGABE=UOFF(V,U,1)+VADD(GA,BE)
S(VUGABE)=S(VUGABE)+SUX11(XGAV)+SUX22(XGAV)
6247 CONTINUE
6252 CONTINUE
6270 CONTINUE
6282 CONTINUE
6285 CONTINUE
6290 CONTINUE
IF(NIT.EQ.3)THEN
WRITE(6,*)'END CCSDT F TERMS'
CALL TIMIT(1,6)
END IF
C
C ADD CCSDT TERMS TO T1 EQUATION. D INTS.
C
I81=1
DO 3190 A=1,NV
IF(FZV(A).EQ.1)GO TO 3190
ASYM=ORBSYM(A+NO)
DO 3185 I=1,NO
IF(FZO(I).EQ.1)GO TO 3185
ISYM=ORBSYM(I)
IASYM=IEOR(ISYM,ASYM)+1
DIM=NT3(IASYM)
CALL WREADW (ITAP81,TAU,INTOWP(DIM),I81,I81)
IA=ITR(A)+I
DO 3180 U=1,NO
IF(FZO(U).EQ.1)GO TO 3180
USYM=ORBSYM(U)
BESYM=USYM
FBE=FLOV(BESYM+1,3)-NO
LBE=FLOV(BESYM+1,4)-NO
DO 3175 BE=FBE,LBE
DO 3170 J=1,NO
IF(FZO(J).EQ.1)GO TO 3170
JSYM=ORBSYM(J)
IJSYM=IEOR(ISYM,JSYM)
JA=ITR(A)+J
BSYM=IEOR(IJSYM,ASYM)+1
FB=FLOV(BSYM,3)-NO
LB=FLOV(BSYM,4)-NO
DO 3165 B=FB,LB
IB=ITR(B)+I
JB=ITR(B)+J
ZLBEB=ZLX(BE,B)
ZLBBE=ZLX(B,BE)
IAJB=DOFF(MAX0(IA,JB))+DADD(MIN0(IA,JB))
IBJA=DOFF(MAX0(IB,JA))+DADD(MIN0(IB,JA))
JUBEB=TOFF(J,U,ZLBEB,IASYM)+TADD(BE,B,IASYM)
JUBBE=TOFF(J,U,ZLBBE,IASYM)+TADD(B,BE,IASYM)
T1N(U,BE)=T1N(U,BE)+(DIN(IAJB)+DIN(IAJB)-DIN(IBJA))
. *(TAU(JUBBE)-TAU(JUBEB))
CHS! . *(TAU(JUBEB)-TAU(JUBBE))
3165 CONTINUE
3170 CONTINUE
3175 CONTINUE
3180 CONTINUE
3185 CONTINUE
3190 CONTINUE
IF(NIT.EQ.3)THEN
WRITE(6,*)'END CCSDT D TERMS'
CALL TIMIT(1,6)
END IF
C
C ADD CCSDT TERMS TO T2 EQUATION. E INTS.
C
I81=1
DO 6490 BE=1,NV
IF(FZV(BE).EQ.1)GO TO 6490
BESYM=ORBSYM(BE+NO)
DO 6485 I=1,NO
IF(FZO(I).EQ.1)GO TO 6485
ISYM=ORBSYM(I)
BEISYM=IEOR(BESYM,ISYM)
BEIS=BEISYM+1
DIM=NT3(BEIS)
CALL WREADW (ITAP81,TAU,INTOWP(DIM),I81,I81)
DO 6482 XSYM=1,NIRRED
XAJ=0
DO 6420 A=1,NV
IF(FZV(A).EQ.1)GO TO 6420
ASYM=ORBSYM(A+NO)
DO 6415 J=1,NO
IF(FZO(J).EQ.1)GO TO 6415
JSYM=ORBSYM(J)
AJSYM=IEOR(ASYM,JSYM)
IF(AJSYM.NE.XSYM-1)GO TO 6415
BEIAJS=IEOR(BEISYM,XSYM-1)
XAJ=XAJ+1
XGAV=0
DO 6410 GA=1,NV
IF(FZV(GA).EQ.1)GO TO 6410
GASYM=ORBSYM(GA+NO)
VSYM=IEOR(GASYM,BEIAJS)+1
FV=FLOV(VSYM,1)
LV=FLOV(VSYM,2)
ZLGAA=ZLX(GA,A)
DO 6405 V=FV,LV
XGAV=X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EGA=UOFF(U,V,1)+VADD(BE,GA)
S(UVBEGA)=S(UVBEGA)+SUX11(XGAV)+SUX22(XGAV)
6445 CONTINUE
6450 CONTINUE
DO 6451 GA=BE,BE
IF(FZV(GA).EQ.1)GO TO 6451
GASYM=ORBSYM(GA+NO)
VSYM=IEOR(GASYM,BEUSYM)+1
FV=FLOV(VSYM,1)
LV=FLOV(VSYM,2)
DO 6446 V=FV,LV
XGAV=XGAV+1
UVBEGA=UOFF(U,V,1)+VADD(BE,GA)
S(UVBEGA)=S(UVBEGA)+SUX11(XGAV)+SUX22(XGAV)
VUGABE=UOFF(V,U,1)+VADD(GA,BE)
S(VUGABE)=S(VUGABE)+SUX11(XGAV)+SUX22(XGAV)
6446 CONTINUE
6451 CONTINUE
DO 6452 GA=BE+1,NV
IF(FZV(GA).EQ.1)GO TO 6452
GASYM=ORBSYM(GA+NO)
VSYM=IEOR(GASYM,BEUSYM)+1
FV=FLOV(VSYM,1)
LV=FLOV(VSYM,2)
DO 6447 V=FV,LV
XGAV=XGAV+1
VUGABE=UOFF(V,U,1)+VADD(GA,BE)
S(VUGABE)=S(VUGABE)+SUX11(XGAV)+SUX22(XGAV)
6447 CONTINUE
6452 CONTINUE
6470 CONTINUE
6482 CONTINUE
6485 CONTINUE
6490 CONTINUE
IF(NIT.EQ.3)THEN
WRITE(6,*)'END CCSDT E TERMS'
CALL TIMIT(1,6)
END IF
CALL RCLOSE(ITAP81,4)
9900 CONTINUE
C
C
C CCSDT-1 EQUATION E ANF F INTS CONTRIBUTION
C
C CALL RDINTS(64,II,NTIN,NLOV,6,BUF,IBUF,INTBUF,
C . IPQ,NT2,ITR,NV,ITRO,IMX,ITRV,NM,NO,FZO,FZV,
C . EOFF,EADD,NM ,NONO,ITR,NOV,ITR,NOV)
C
C CALL RDINTS(65,II,NTIN,NLVO,6,BUF,IBUF,INTBUF,
C . IPQ,NT2,ITR,NV,ITRO,IMX,ITRV,NM,NO,FZO,FZV,
C . FOFF,FADD,NVNV,NM ,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570
XJ=IPQ(J)+J
JSYM=ORBSYM(J)
IJSYM=IEOR(ISYM,JSYM)
DO 3560 B=1,NV
IF(FZV(B).EQ.1)GO TO 3560
XB=IPQ(B+NO)+B+NO
BSYM=ORBSYM(B+NO)
ABSYM=IEOR(ASYM,BSYM)
DO 3550 K=1,NO
IF(FZO(K).EQ.1)GO TO 3550
XK=IPQ(K)+K
KSYM=ORBSYM(K)
IJKSYM=IEOR(IJSYM,KSYM)
CSYM=IEOR(IJKSYM,ABSYM)+1
FC=FLOV(CSYM,3)-NO
LC=FLOV(CSYM,4)-NO
LC2=LC
IF(LC.GT.B)LC2=B
DO 3552 C=FC,LC2
IF(FZV(C).EQ.1)GO TO 3552
XC=IPQ(C+NO)+C+NO
ZLBC=ZLX(B,C)
JKBC=TOFF(J,K,ZLBC,AIS)+TADD(B,C,AIS)
VAL=FOCK(XI)+FOCK(XJ)+FOCK(XK)
. -FOCK(XA)-FOCK(XB)-FOCK(XC)
TAU(JKBC)=TAU(JKBC)/VAL
3552 CONTINUE
3550 CONTINUE
3560 CONTINUE
3570 CONTINUE
CALL WWRITW(ITAP81,TAU,INTOWP(DIM),I81,I81)
9985 CONTINUE
9990 CONTINUE
CALL RCLOSE(ITAP81,3)
C
6755 FORMAT(5(I4,1X),2(D12.6,2X))
IF(NIT.EQ.3)THEN
WRITE(6,*)'END E & F TERMS T3 EQUATION + MO DIVISION'
CALL TIMIT(1,6)
END IF
C
C IF(SORT.EQ.'YES ')
C .CALL SORTT(TAU,T2,NTAU,ORBSYM,NO,NV,FLOV,NIRRED,NT3,TOFF,TADD,
C . ITAP81,ITAP97,ZLX)
C CALL FRTAU(TAU,T2,T1 ,UOFF,VADD,ORBSYM,FLOV,NO,NV,
C . NDIMT2,NIRRED,FZO,FZV,OPTION)
C
C
C
C
C ******************
C ENDING CCSDT STUFF
C ******************
C
RETURN
END