-
Notifications
You must be signed in to change notification settings - Fork 0
/
BONDEX.FORT10
1398 lines (1397 loc) · 37.2 KB
/
BONDEX.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
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
PROGRAM BONDEX
C THE BOND-INDEX AND VALENCE PROGRAM
C**********************************************************************
C* NOTICE OF PROGRAM MODIFICATION *
C**********************************************************************
c Moved to PSI distribution disk on 020389 - clj.
C**********************************************************************
C* BY: RICHARD REMINGTON search: c3-18-88 *
C* DATE: MARCH 18, 1988 *
C* REASON: DECREASE CORE TO RUN IN 7MB ON 9370 *
C* and remove variable "GY" in block data section *
C**********************************************************************
C* BY: GUSTAVO E. SCUSERIA *
C* DATE: APRIL 30, 1987 *
C* REASON: BUG FOR TCSCF CASE FIXED *
C**********************************************************************
C* BY: GUSTAVO E. SCUSERIA *
C* DATE: MAY 18, 1987 *
C* REASON: PRINT OUT GEOMETRY *
C**********************************************************************
C
C
C *****************************************************
C *****************************************************
C ** A PROGRAM TO CALCULATE SOPHISTICATED NUMBERS ? **
C ** **
C ** BROUGHT TO YOU BY **
C ** **
C ** GES **
C *****************************************************
C *****************************************************
C
C PLEASE NOTIFY ANY WEIRD RESULTS OR BUGS.
C
C INPUT: SET UP # BONDEX ## IN YOUR INPUT FILE
C ISCFCI, IPRNT, ITYFC (3I5)
C ISCFCI= 0,1 SCF CALCULATION
C 2 CI CALCULATION
C IPRNT = 0,1 MINIMUM PRINT OUT
C 2 EXTENDED PRINT OUT INCLUDING DENSITY MATRIX
C ITYFC = 3 SPD FUNCTIONS (INPUT$ CODES)
C = 5 IF F OR G ARE PRESENT (PINPUT$ CODES)
C
C NOTE!! IF USING ISCFCI=2 , 3RD FLAG IN # ONEPDM ## MUST BE .GE. 1
C AND FIRST FLAG .EQ. 1 (YES, THE PRINT OPTION!)
C YOU'LL ALSO NEED TO RUN MASTER$ BEFORE ONEPDM$
C (AND INTS$ BEFORE MASTER$, SORRY)
C
C IF USING MORE THAN 200 BFS OR 112 ATOMS TAKE A LOOK AT THE FORTRAN
C LAST UPDATE : APRIL 7, 1987
C
C
IMPLICIT REAL*8 (A-H,O-Z)
c3-18-88 DIMENSION CC(360000),IA(1)
DIMENSION CC(360000),IA(1)
DIMENSION I30(200),A30(100)
COMMON/BASIS/NBASIS,NBFAO,NBFSO,NBATRI
COMMON/COORD/CHGS(112),X(3,112),WW(112)
COMMON/FLAGS/MPOINT,MCONST
COMMON/FUNCS/NATOM,N3N,NSYM
COMMON/GAUSS/ZS(200),CS(200)
COMMON/NORBS/NAST(112),NAED(112)
COMMON/NSHEL/KNUC(200),KTYPE(200),KPRIM(200),KLOC(200),
1 KMIN(200),KMAX(200),KNG(200),NSHELL,NPRIM
COMMON/PARAS/MXCOEF,LOCVEC
COMMON/QVALS/QORB(256),QATM(112),QNET(112)
COMMON/SIGNS/IOFF(500),IPRNT
COMMON/CI101/IOPEN,IOCC,JOCC,KOCC
EQUIVALENCE (CC,IA)
EQUIVALENCE (I30,A30)
1 FORMAT(//,2X,' THE BOND-INDEX AND VALENCE PROGRAM'/
. ,2X,' GES VERSION 05.18.87 '/)
2 FORMAT(16I5)
3 FORMAT(/,2X,' PARAMETERS'/
* 2X,' ISCFCI = ',I8/
* 2X,' IPRNT = ',I8/
* 2X,' ITYFC = ',I8/
* 2X,' NBASIS = ',I8/
* 2X,' NBFAO = ',I8/
* 2X,' NBFSO = ',I8/
* 2X,' NBATRI = ',I8/
* 2X,' NATOM = ',I8/
* 2X,' N3N = ',I8/
* 2X,' NSYM = ',I8/
* 2X,' IOPEN = ',I8/
* 2X,' NSHELL = ',I8/
* 2X,' NPRIM = ',I8/)
4 FORMAT(/,3X,20A4)
5 FORMAT(//,2X,' ENUC = ',F20.10/
1 2X,' ESCF = ',F20.10/)
6 FORMAT(//,2X,' REQUIRED MEMORY EXCEEDS MAXCOR'/
1 2X,' ICMAX = ',I10,5X,' MAXCOR = ',I10/)
7 FORMAT(//,2X,' WARNING! NO INPUT TO BONDEX HAS BEEN FOUND. '/
1 2X,' DEFAULT PARAMETERS WILL BE USED. ',/)
C
CALL TSTART(6)
CALL NOUNFL
C
ITAPE3=3
INPUT=5
ITAPE6=6
ITAP30=30
MAXCOR=360000
c3-18-88 MAXCOR=360000
CALL RFILE(ITAP30)
C
WRITE(6,1)
WRITE(3,1)
C
C ISCFCI IS A PARAMETER FOR TYPE OF WAVE FUNCTION
C ISCFCI = 0 OR 1 FOR SCF
C ISCFCI = 2 FOR CI
C IPRINT IS A PARAMETER FOR SIZE OF OUTPUT
C ITYFC IS A PARAMETER FOR DEALING WITH SPD (3) OR FG (5) BFS.
C
C SET UP DEFAULT VALUES IF INPUT TO PROPER IS NOT FOUND
C
ISCFCI = 1
IPRINT = 0
ITYFC = 3
C
CALL LOCATE(INPUT,'# BONDEX #',IERR)
C
IF(IERR .NE. 0) WRITE(6,7)
IF(IERR .NE. 0) GOTO 100
READ(5,2) ISCFCI,IPRNT, ITYFC
IF(ISCFCI.EQ.0)ISCFCI=1
IF(ITYFC .EQ.0)ITYFC=3
100 CONTINUE
IOFF(1)=0
DO 101 I=1,499
101 IOFF(I+1)=IOFF(I)+I
C
CALL SREW(ITAP30)
CALL WREADW(ITAP30,I30,200,101,JUNK)
MPOINT=I30(2)
MCONST=I30(3)
NCALCS=I30(5)
NBFSO=I30(18)
NATOM=I30(19)
NBFAO=I30(22)
NSHELL=I30(27)
NPRIM=I30(32)
NSYM=I30(41)
MXCOEF=I30(42)
IOPEN=I30(43)
NBASIS=NBFSO
N3N=NATOM*3
NBATRI=IOFF(NBFAO+1)
C
WRITE(6,3) ISCFCI,IPRNT,ITYFC,NBASIS,NBFAO,NBFSO,NBATRI,NATOM,
1 N3N,NSYM,IOPEN,NSHELL,NPRIM
C
C READ IN LABELS
JUNK=101+MCONST+MPOINT+NCALCS-1
CALL WREADW(ITAP30,LOCCAL,1,JUNK,JUNK)
CALL WREADW(ITAP30,I30,60,LOCCAL,LOCCAL)
WRITE(6,4) (I30(I),I=1,20)
CALL WREADW(ITAP30,I30,20,LOCCAL,JUNK)
LOCVEC=I30(1)
C
C READ IN GEOMETRY
LOCCAL=LOCCAL+20
CALL WREADW(ITAP30,X,NATOM*6,LOCCAL,LOCCAL)
WRITE(6,994)
994 FORMAT(//,'GEOMETRY FROM FILE30',/)
DO 66 I=1,NATOM
WRITE(6,993)I,X(1,I),X(2,I),X(3,I)
993 FORMAT(1X,I4,5X,3(F12.8,5X))
66 CONTINUE
C
C READ IN ENUC AND ESCF
CALL WREADW(ITAP30,A30,20,LOCCAL,LOCCAL)
ENUC=A30(1)
ESCF=A30(2)
WRITE(6,5) ENUC,ESCF
C
C READ IN BASIS SET INFORMATION
CC WRITE(6,21)
WRITE(3,21)
21 FORMAT(//,2X,' NOW YOU ARE IN BASSET'/)
IC1=1
C.................UAS.....
CALL BASSET(CC(IC1),ITYFC)
C
C READ IN EIGENVECTORS
CC WRITE(6,22)
WRITE(3,22)
22 FORMAT(//,2X,'NOW YOU ARE IN EIGVEC'/)
IC1=1
IC2=IC1+NBFAO*NBFSO
IC3=IC2+NBASIS
IC4=IC3+NBASIS
IC5=IC4+NBFSO*NBFSO
IC6=IC5+NBFAO*NBFSO
ICMAX=IC6+NBFAO*NBFSO
IF(ICMAX.GT.MAXCOR) GO TO 399
C................UAS EIG OCC ESO EAO EE......
CALL EIVEC(CC(IC1),CC(IC2),CC(IC3),CC(IC4),CC(IC5),CC(IC6))
C
C FORM A DENSITY MATRIX
CC WRITE(6,23)
WRITE(3,23)
23 FORMAT(//,2X,' NOW YOU ARE IN DENSTY'/)
IC1=1
IC2=IC1+NBFAO*NBFSO
IC3=IC2+NBASIS
IC4=IC3+NBASIS
IC5=IC4+NBFSO*NBFSO
IC6=IC5+NBFAO*NBFSO
ICMAX=IC6+NBATRI
IF(ICMAX.GT.MAXCOR) GO TO 399
C.................OCC EAO P.......
CALL DENSTY(CC(IC3),CC(IC5),CC(IC6),ISCFCI)
C
C CALCULATE THE DAM INDEX
CC WRITE(6,27)
WRITE(3,27)
27 FORMAT(//,2X,' NOW YOU ARE IN VINDEX'/)
IC1=1
IC2=IC1+NBFAO*NBFSO
IC3=IC2+NBASIS
IC4=IC3+NBASIS
IC5=IC4+NBFSO*NBFSO
IC6=IC5+NBFAO*NBFSO
IOV=IC6+NBATRI
IBON=IOV+NBATRI
IPRO=IBON+NBASIS*NBASIS
IVIN=IPRO+NBASIS*NBASIS
IV1 =IVIN+NATOM*NATOM
IE1 =IV1 +NBASIS*NBASIS
IGAMMA=IE1+NBASIS
IPOSV=WPADTI(IGAMMA)
CCC IPOSV=IGAMMA*2-1
IBETA=IGAMMA+NBASIS
IVPOS=WPADTI(IBETA)
IBETAQ=IBETA+NBASIS
IORD=WPADTI(IBETAQ)
IW=IBETAQ+NBASIS
IMINX=IW+NBASIS
ICMAX=IMINX+NBASIS
IF(ICMAX.GT.MAXCOR) GO TO 399
CALL DIPORB(CC(IOV),CC(IC6),CC(IBON),CC(IPRO),CC(IVIN),ISCFCI,
. CC(IV1),CC(IE1),CC(IMINX),
. CC(IGAMMA),CC(IBETA),CC(IBETAQ),CC(IW),
. IA(IPOSV),IA(IVPOS),IA(IORD))
GO TO 400
399 WRITE(6,6) ICMAX,MAXCOR
400 CONTINUE
CALL TSTOP(6)
C
STOP
END
C<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
SUBROUTINE BASSET(UAS,ITYFC)
IMPLICIT REAL*8 (A-H,O-Z)
DIMENSION UAS(NBFAO,NBFSO)
DIMENSION CONTR(600),I30(200)
COMMON/BASIS/NBASIS,NBFAO,NBFSO,NBATRI
COMMON/COORD/CHGS(112),XX(3,112),WW(112)
COMMON/FLAGS/MPOINT,MCONST
COMMON/FUNCS/NATOM,N3N,NSYM
COMMON/GAUSS/ZS(200),CS(200)
COMMON/NORBS/NAST(112),NAED(112)
COMMON/NSHEL/KNUC(200),KTYPE(200),KPRIM(200),KLOC(200),
1 KMIN(200),KMAX(200),KNG(200),NSHELL,NPRIM
COMMON/SIGNS/IPQ(500),IPRNT
DATA ZERO / 0.0D+00 /
1 FORMAT(//,2X,' NPRIM IS ',I5)
2 FORMAT(2X,I5,2F20.10)
3 FORMAT(//,2X,' NSHELL IS ',I5)
4 FORMAT(2X,8I5)
5 FORMAT(//,2X,' NATOM IS ',I5)
6 FORMAT(2X,I5,4F20.10,5X,2I5)
C
ITAP30=30
JUNK=101+MCONST
CALL WREADW(ITAP30,I30,MPOINT,JUNK,JUNK)
C
C READ IN BASIS SET
CALL WREADW(ITAP30,CHGS,NATOM*2,I30(1),JUNK)
CALL WREADW(ITAP30,ZS,NPRIM*2,I30(5),JUNK)
CALL WREADW(ITAP30,CONTR,NPRIM*2*ITYFC,I30(6),JUNK)
CALL WREADW(ITAP30,KPRIM,NSHELL,I30(7),JUNK)
CALL WREADW(ITAP30,KNUC,NSHELL,I30(8),JUNK)
CALL WREADW(ITAP30,KTYPE,NSHELL,I30(9),JUNK)
CALL WREADW(ITAP30,KNG,NSHELL,I30(10),JUNK)
CALL WREADW(ITAP30,KLOC,NSHELL,I30(11),JUNK)
CALL WREADW(ITAP30,KMIN,NSHELL,I30(12),JUNK)
CALL WREADW(ITAP30,KMAX,NSHELL,I30(13),JUNK)
CALL WREADW(ITAP30,UAS,NBFAO*NBFSO*2,I30(29),JUNK)
C
IJ=0
DO 102 I=1,ITYFC
DO 101 J=1,NPRIM
IJ=IJ+1
VALU=CONTR(IJ)
IF(VALU.EQ.ZERO) GO TO 101
CS(J)=VALU
101 CONTINUE
102 CONTINUE
C
IF(IPRNT.LE.3) GO TO 201
WRITE(6,1) NPRIM
DO 103 I=1,NPRIM
103 WRITE(6,2) I,ZS(I),CS(I)
WRITE(6,3) NSHELL
DO 104 I=1,NSHELL
104 WRITE(6,4) I,KNUC(I),KTYPE(I),KPRIM(I),KLOC(I),KMIN(I),KMAX(I),
1 KNG(I)
C
C FORM ARRAIES FOR AO'S
201 CONTINUE
NAST(1)=1
IATOM=1
DO 105 I=1,NSHELL
II=KNUC(I)
IF(II.EQ.IATOM) GO TO 105
IATOM=IATOM+1
NAED(IATOM-1)=KLOC(I)-1
NAST(IATOM)=KLOC(I)
105 CONTINUE
NAED(NATOM)=NBASIS
IF(IPRNT.LE.3) GO TO 202
WRITE(6,5) NATOM
DO 106 I=1,NATOM
106 WRITE(6,6) I,XX(1,I),XX(2,I),XX(3,I),CHGS(I),NAST(I),NAED(I)
202 CONTINUE
C
RETURN
END
C<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
SUBROUTINE EIVEC(UAS,EIG,OCC,ESO,EAO,EE)
IMPLICIT REAL*8 (A-H,O-Z)
DIMENSION UAS(NBFAO,NBFSO),EIG(NBASIS),OCC(NBASIS)
DIMENSION ESO(NBFSO,NBFSO),EAO(NBFAO,NBFSO)
DIMENSION EE(NBFAO*NBFSO)
DIMENSION NLAMDA(10),NCLOSD(10),NOPEN(10),OCT(2)
DIMENSION ALPT(15),BETT(15)
COMMON/BASIS/NBASIS,NBFAO,NBFSO,NBATRI
COMMON/FUNCS/NATOM,N3N,NSYM
COMMON/SIGNS/IPQ(500),IPRNT
COMMON/PARAS/MXCOEF,LOCVEC
COMMON/CI101/IOPEN,IOCX,JOCX,KOCX
DATA ZERO,ONE,TWO / 0.0D+00 , 1.0D+00 , 2.0D+00 /
1 FORMAT(//,2X,' UAS MATRIX'/)
2 FORMAT(//,2X,' NOPEN = ',10I5/)
3 FORMAT(//,2X,' ESO MATRIX'/)
4 FORMAT(//,2X,' EAO MATRIX'/)
C
ITAP30=30
CALL WREADW(ITAP30,EE,MXCOEF*2,LOCVEC,LOCVEC)
CALL WREADW(ITAP30,EIG,NBFSO*2,LOCVEC,LOCVEC)
IF(IPRNT.LE.3) GO TO 201
WRITE(6,1)
CALL MATOUT(UAS,NBFAO,NBFSO,NBFAO,NBFSO,6)
C
C READ IN SO-MO EIGENVECTORS
201 CONTINUE
LOCVEC=LOCVEC+NSYM
CALL WREADW(ITAP30,NLAMDA,NSYM,LOCVEC,LOCVEC)
CALL WREADW(ITAP30,NCLOSD,NSYM,LOCVEC,LOCVEC)
WRITE(3,28) (NLAMDA(I),I=1,NSYM)
28 FORMAT(2X,' NLAMDA = ',10I5/)
WRITE(3,29) (NCLOSD(I),I=1,NSYM)
29 FORMAT(2X,' NCLOSD = ',10I5/)
C
C READ IN COUPLING CONSTANTS FOR OPEN SHELLS
WRITE(3,30) IOPEN
IF(IPRNT.GT.2)
*WRITE(6,30) IOPEN
30 FORMAT(2X,' IOPEN = ',I5/)
IF(IOPEN.NE.0) THEN
KOPEN=IABS(IOPEN)
CALL WREADW(ITAP30,NOPEN,NSYM,LOCVEC,LOCVEC)
WRITE(3,2) (NOPEN(I),I=1,NSYM)
IF(IPRNT.GT.2)
*WRITE(6,2) (NOPEN(I),I=1,NSYM)
CALL WREADW(ITAP30,ALPT,KOPEN*2,LOCVEC,LOCVEC)
WRITE(3,31) (ALPT(I),I=1,KOPEN)
IF(IPRNT.GT.2)
*WRITE(6,31) (ALPT(I),I=1,KOPEN)
31 FORMAT(2X,' ALPT = ',10F12.5/)
CALL WREADW(ITAP30,BETT,KOPEN*2,LOCVEC,LOCVEC)
WRITE(3,32) (BETT(I),I=1,KOPEN)
IF(IPRNT.GT.2)
*WRITE(6,32) (BETT(I),I=1,KOPEN)
32 FORMAT(2X,' BETT = ',10F12.5/)
END IF
IF(IOPEN.GE.0) GO TO 202
OCT(1)=TWO/(ONE-ALPT(1))
OCT(2)=TWO/(ONE-ALPT(3))
C
C FORM OCCUPATION VECTOR
202 CONTINUE
DO 101 I=1,NBASIS
101 OCC(I)=ZERO
ITC=0
I=0
DO 107 ISM=1,NSYM
DO 104 J=I+1,I+NCLOSD(ISM)
OCC(J)=TWO
104 CONTINUE
K=I+NCLOSD(ISM)
IF(IOPEN.LT.0.AND.NOPEN(ISM).NE.0) GO TO 204
IF(IOPEN.EQ.0) GO TO 206
DO 105 J=K+1,K+NOPEN(ISM)
OCC(J)=ONE
105 CONTINUE
GO TO 206
204 CONTINUE
DO 106 J=K+1,K+NOPEN(ISM)
IF(IOPEN.GT.0) GO TO 205
ITC=ITC+1
OCC(J)=OCT(ITC)
GO TO 106
205 OCC(J)=ONE
106 CONTINUE
206 CONTINUE
I=I+NLAMDA(ISM)
107 CONTINUE
C
C FORM SO-MO EIGENVECTOR MATRIX
DO 111 I=1,NBFSO
DO 111 J=1,NBFSO
ESO(I,J)=ZERO
111 CONTINUE
I=0
J=0
DO 115 ISYM=1,NSYM
N=NLAMDA(ISYM)
DO 114 K=J+1,J+N
DO 113 L=J+1,J+N
I=I+1
ESO(L,K)=EE(I)
113 CONTINUE
114 CONTINUE
J=J+N
115 CONTINUE
C
IF(IPRNT.LE.3) GO TO 207
WRITE(6,3)
CALL EIGOUT(ESO,EIG,OCC,NBFSO,NBFSO,NBASIS,NBASIS,6)
C
C TRANSFORM EIGENVECTORS FROM SO TO AO BASIS
207 CONTINUE
DO 117 I=1,NBFAO
DO 117 J=1,NBASIS
VALU=ZERO
DO 116 K=1,NBFSO
VALU=VALU+UAS(I,K)*ESO(K,J)
116 CONTINUE
EAO(I,J)=VALU
117 CONTINUE
IF(IPRNT.LE.3) GO TO 208
WRITE(6,4)
CALL EIGOUT(EAO,EIG,OCC,NBFAO,NBFAO,NBASIS,NBASIS,6)
208 CONTINUE
C
RETURN
END
C<<<<<<<<<<<<<<<<<<
SUBROUTINE DENSTY(OCC,EAO,P,ISCFCI)
IMPLICIT REAL*8 (A-H,O-Z)
DIMENSION OCC(NBASIS),EAO(NBFAO,NBFSO),P(NBATRI)
COMMON/BASIS/NBASIS,NBFAO,NBFSO,NBATRI
COMMON/SIGNS/IOFF(500),IPRNT
DATA ZERO / 0.0D+00 /
1 FORMAT(//,2X,' DENSITY MATRIXIN TINE DENSITY'/)
C
C IF THE WAVE FUNCTION IS NOT AN SCF WAVE FUNCTION THEN READ IN THE
C AO ONE PDM FROM THE MASTER FILE.
C
IF(ISCFCI.GT.1) GOTO 300
C
C FORM DENSITY MATRIX
DO 101 I=1,NBATRI
101 P(I)=ZERO
IJ=0
DO 103 I=1,NBFAO
DO 103 J=1,I
IJ=IJ+1
VALU=ZERO
DO 102 K=1,NBASIS
IF(OCC(K).LE.ZERO) GO TO 102
VALU=VALU+EAO(I,K)*EAO(J,K)*OCC(K)
102 CONTINUE
P(IJ)=VALU
103 CONTINUE
IF(IPRNT.LE.3) GO TO 201
WRITE(6,1)
C CALL PRINT(P,NBATRI,NBFAO,6)
C
201 CONTINUE
RETURN
300 CONTINUE
C
C INITIALIZE THE MASTER FILE.
C
CALL INITMF(1)
C
IF(ISCFCI.EQ.2) CALL MREAD(P,34)
CTJL IF(ISCFCI.EQ.3) CALL MREAD(P,37)
C
IF(IPRNT.LE.3) GO TO 301
WRITE(6,1)
C CALL PRINT(P,NBATRI,NBFAO,6)
301 CONTINUE
RETURN
END
C<<<<<<<<<<<<<<<<<<<<<<
SUBROUTINE DIPORB(OV,D,BOND,PROD,VINDEX,ISCFCI,
. V1,E1,MINDEX,
. GAMMA,BETA,BETAQ,W,
. IPOSV,IVPOS,IORD)
IMPLICIT REAL*8 (A-H,O-Z)
LOGICAL IANDJ,EQUAL
COMMON/BASIS/NT,NBFAO,NBFSO,NBATRI
. /COORD/ZAN(112),C(3,112),WW(112)
. /EXYZS/EX(7,7,13),EY(7,7,13),EZ(7,7,13)
. /FUNCS/NATOM,N3N,NSYM
. /GAUSS/ZS(200),CS(200)
. /IJVEC/IX(84),IY(84),IZ(84),JX(84),JY(84),JZ(84)
. /INDIX/IJX(225),IJY(225),IJZ(225),IJPOS(225)
. /NSHEL/KNUC(200),KTYPE(200),KSTART(200),KLOC(200),
. KMIN(200),KMAX(200),KNG(200),NSHELL,NPRIM
. /ROOT /XX,U(9),WT(9),NROOTS
. /SIGNS/IPQ(500),IPRNT
REAL * 8 MINDEX(NATOM)
DIMENSION OV1 (9000),SAVE(9000)
DIMENSION OV(NBATRI),D(NBATRI),BOND(NT,NT),PROD(NT,NT),
. VINDEX(NATOM,NATOM)
DIMENSION VX0(36),VY0(36),VZ0(36),VX1(36),VY1(36),VZ1(36),
. VX2(36),VY2(36),VZ2(36),VXS(36),VYS(36),VZS(36)
DIMENSION V1(NT*NT),E1(NT),GAMMA(NT),BETA(NT),BETAQ(NT),W(NT),
. IPOSV(NT),IVPOS(NT),IORD(NT)
DATA ITOL / 10 /
DATA PI212 / 1.1283791670955D+00 /
DATA PI32 / 5.56832799683170D+00 /
DATA ZERO,HALF,ONE,TWO / 0.0D+00 , 0.5D+00 , 1.0D+00 , 2.0D+00 /
DATA NQLIM / 7 /
C
TOL=ITOL*2.30258D+00
C ZERO ALL THE CORE
DO 101 I=1,NBATRI
OV(I)=ZERO
101 CONTINUE
C
C:::::::::::::::::::::::::::::
C:::::----- I SHELL -----:::::
C:::::::::::::::::::::::::::::
C
DO 6000 ISH=1,NSHELL
C
IATOM=KNUC(ISH)
AX=C(1,IATOM)
AY=C(2,IATOM)
AZ=C(3,IATOM)
IGMIN=KSTART(ISH)
IGMAX=IGMIN+KNG(ISH)-1
LIT=KTYPE(ISH)
MINI=KMIN(ISH)
MAXI=KMAX(ISH)
LOCI=KLOC(ISH)
C
C:::::::::::::::::::::::::::::
C:::::----- J SHELL -----:::::
C:::::::::::::::::::::::::::::
C
DO 5000 JSH=1,ISH
C
JATOM=KNUC(JSH)
BX=C(1,JATOM)
BY=C(2,JATOM)
BZ=C(3,JATOM)
JGMIN=KSTART(JSH)
JGMAX=JGMIN+KNG(JSH)-1
LJT=KTYPE(JSH)
MINJ=KMIN(JSH)
MAXJ=KMAX(JSH)
LOCJ=KLOC(JSH)
IANDJ=ISH.EQ.JSH
EQUAL=IATOM.EQ.JATOM
C
C ----- WORK OUT INDICES FOR COMBINING INTEGRALS -----
C
MIJ=0
JMAX=MAXJ
II=-1
DO 103 I=MINI,MAXI
II=II+1
JJ=-1
NX=IX(I)
NY=IY(I)
NZ=IZ(I)
IF(IANDJ) JMAX=I
DO 102 J=MINJ,JMAX
MIJ=MIJ+1
JJ=JJ+1
IJX(MIJ)=NX+JX(J)
IJY(MIJ)=NY+JY(J)
IJZ(MIJ)=NZ+JZ(J)
IDXI=LOCI+II
IDXJ=LOCJ+JJ
IDXS=IPQ(MAX0(IDXI,I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LIM
DO 930 NI=1,LIT
IN=IN+NQLIM
DO 929 NJ=1,LJT
JN=IN+NJ
VXS(JN)=EX(NI,NJ,1)
VYS(JN)=EY(NI,NJ,1)
VZS(JN)=EZ(NI,NJ,1)
929 CONTINUE
930 CONTINUE
C
DO 962 I=1,MIJ
NX=IJX(I)
NY=IJY(I)
NZ=IJZ(I)
SX=VXS(NX)
SY=VYS(NY)
SZ=VZS(NZ)
IJ=IJPOS(I)
OV(IJ)=OV(IJ)+SX*SY*SZ*DIJS
962 CONTINUE
C
2000 CONTINUE
C
3000 CONTINUE
4000 CONTINUE
5000 CONTINUE
6000 CONTINUE
IF(IPRNT.GT.2)THEN
WRITE(6,630)
630 FORMAT(1X,//,'OVERLAP MATRIX',/)
CALL PRINT(OV,NBATRI,NBFAO,6)
ENDIF
IF(IPRNT.GT.1)THEN
WRITE(6,631)
631 FORMAT(1X,//,'DENSITY MATRIX',/)
CALL PRINT( D,NBATRI,NBFAO,6)
ENDIF
C
IJK=0
TRACE=0.0D0
DO 5030 I=1,NT
DO 5030 J=1,I
IJK=IJK+1
IF(I.EQ.J)THEN
TRACE=TRACE+D(IJK)*OV(IJK)
ELSE
TRACE=TRACE+2.D0*D(IJK)*OV(IJK)
END IF
5030 CONTINUE
WRITE(6,606)TRACE
606 FORMAT(//,'TRACE OF P*S IS ',F12.6 )
DO 6102 I=1,NT
DO 6101 J=1,NT
PROD(I,J)=0.0D0
DO 6100 K=1,NT
IK=IPQ(MAX0(I,K))+MIN0(I,K)
KJ=IPQ(MAX0(K,J))+MIN0(K,J)
PROD(I,J)=PROD(I,J)+D(IK)*OV(KJ)
6100 CONTINUE
6101 CONTINUE
6102 CONTINUE
DO 6200 IC=1,NATOM
MINDEX(IC)=0.0D0
DO 6200 JC=1,NATOM
6200 VINDEX(IC,JC)=0.0D0
DO 6300 ISH=1,NSHELL
IAT=KNUC(ISH)
IFI=KLOC(ISH)
ILI=IFI+KMAX(ISH)-KMIN(ISH)
DO 6295 JSH=1,NSHELL
JAT=KNUC(JSH)
IFJ=KLOC(JSH)
ILJ=IFJ+KMAX(JSH)-KMIN(JSH)
DO 6290 I=IFI,ILI
DO 6290 J=IFJ,ILJ
VINDEX(IAT,JAT)=VINDEX(IAT,JAT)+PROD(I,J)*PROD(J,I)
C IF(IAT.EQ.JAT)MINDEX(IAT)=MINDEX(IAT)-PROD(I,J)*PROD(J,I)
C IF(I.EQ.J)MINDEX(IAT)=MINDEX(IAT)+2.D0*PROD(I,J)
6290 CONTINUE
6295 CONTINUE
6300 CONTINUE
WRITE(6,673)
673 FORMAT(1X,//,'MULLIKEN BOND-INDEX',/)
CALL MATOUT(VINDEX,NATOM,NATOM,NATOM,NATOM,6)
WRITE(6,683)
683 FORMAT (//,1X,'MULLIKEN VALENCES',/)
C DO 6322 IC=1,NATOM
C WRITE(6,612)IC,MINDEX(IC)
C6322 CONTINUE
DO 6322 IC=1,NATOM
VAL=0.0D0
DO 6320 JC=1,NATOM
IF(JC.EQ.IC)GO TO 6319
VAL=VAL+VINDEX(IC,JC)
6319 CONTINUE
6320 CONTINUE
WRITE(6,612)IC,VAL
6322 CONTINUE
C DO 9898 I=1,NBATRI
C9898 SAVE(I)=OV(I)
C
C CALCULATE S**1/2
C
IW=6
CALL LIGEN3(NT,NBATRI,NT*NT,OV,V1,E1)
C . GAMMA,BETA,BETAQ,W,IPOSV,IVPOS,IORD,P,Q)
IF(IPRNT.GT.1)THEN
WRITE(IW,609)
609 FORMAT(1X,/,'OVERLAP MATRIX EIGENVALUES',/)
WRITE(IW,607) (I,E1(I),I=1,NT)
607 FORMAT(6(1X,I6,2X,F12.6))
ENDIF
IF(IPRNT.GT.2)THEN
WRITE(IW,608)
608 FORMAT(1X,/,'OVERLAP MATRIX EIGENVECTORS',/)
CALL MATOUT (V1,NT,NT,NT,NT,6)
END IF
DO 100 I=1,NT
DO 100 J=1,I
DUM=0.0D+00
DAM=0.0D+00
IJ=IPQ(I)+J
DO 50 K=1,NT
K1INK= (K-1)*NT
DAM=DAM+V1(K1INK+I)*V1(K1INK+J)/ E1(K)
50 DUM=DUM+V1(K1INK+I)*V1(K1INK+J)*DSQRT(E1(K))
C OV1(IJ)=DAM
100 OV(IJ)=DUM
C WRITE(*,*)'INVERSE OF OVERLAP MATRIX'
C CALL PRINT(OV1,NBATRI,NBFAO,6)
C
C DO 5102 I=1,NT
C DO 5101 J=1,NT
C PROD(I,J)=0.0D0
C DO 5100 K=1,NT
C IK=IPQ(MAX0(I,K))+MIN0(I,K)
C KJ=IPQ(MAX0(K,J))+MIN0(K,J)
C PROD(I,J)=PROD(I,J)+OV1(IK)*SAVE(KJ)
C5100 CONTINUE
C5101 CONTINUE
C5102 CONTINUE
C WRITE(*,*)'UNIT MATRIX'
C CALL MATOUT(PROD,NT,NT,NT,NT,6)
IF(IPRNT.GT.2)THEN
WRITE(6,632)
632 FORMAT(1X,//,'HALF OVERLAP MATRIX',/)
CALL PRINT(OV,NBATRI,NBFAO,6)
END IF
DO 7102 I=1,NT
DO 7101 J=1,NT
PROD(I,J)=0.0D0
DO 7100 K=1,NT
IK=IPQ(MAX0(I,K))+MIN0(I,K)
KJ=IPQ(MAX0(K,J))+MIN0(K,J)
PROD(I,J)=PROD(I,J)+OV(IK)*D(KJ)
7100 CONTINUE
7101 CONTINUE
7102 CONTINUE
DO 7105 I=1,NT
DO 7104 J=1,NT
BOND(I,J)=0.0D0
DO 7103 K=1,NT
KJ=IPQ(MAX0(K,J))+MIN0(K,J)
BOND(I,J)=BOND(I,J)+PROD(I,K)*OV(KJ)
7103 CONTINUE
7104 CONTINUE
7105 CONTINUE
TRACE=0.0 D0
DO 7107 I=1,NT
7107 TRACE=TRACE+BOND(I,I)
WRITE(6,611)TRACE
611 FORMAT(//,'TRACE OF S1/2*P*S1/2 IS ',F12.6)
TRACE=0.0 D0
DO 7108 I=1,NT
DO 7108 J=1,NT
7108 TRACE=TRACE+BOND(I,J)*BOND(I,J)
WRITE(6,615)TRACE
615 FORMAT(//,' TRACE OF (S1/2*P*S1/2)**2 IS ',F12.6 )
DO 7200 IC=1,NATOM
DO 7200 JC=1,NATOM
7200 VINDEX(IC,JC)=0.0D0
DO 7300 ISH=1,NSHELL
IAT=KNUC(ISH)
IFI=KLOC(ISH)
ILI=IFI+KMAX(ISH)-KMIN(ISH)
DO 7295 JSH=1,NSHELL
JAT=KNUC(JSH)
IFJ=KLOC(JSH)
ILJ=IFJ+KMAX(JSH)-KMIN(JSH)
DO 7290 I=IFI,ILI
DO 7290 J=IFJ,ILJ
VINDEX(IAT,JAT)=VINDEX(IAT,JAT)+BOND(I,J)*BOND(J,I)
7290 CONTINUE
7295 CONTINUE
7300 CONTINUE
WRITE(6,633)
633 FORMAT(1X,//,'LOWDIN BOND-INDEX',/)
CALL MATOUT(VINDEX,NATOM,NATOM,NATOM,NATOM,6)
WRITE(6,613)
613 FORMAT (//,1X,'LOWDIN VALENCES',/)
DO 7322 IC=1,NATOM
VAL=0.0D0
DO 7320 JC=1,NATOM
IF(JC.EQ.IC)GO TO 7319
VAL=VAL+VINDEX(IC,JC)
7319 CONTINUE
7320 CONTINUE
WRITE(6,612)IC,VAL
612 FORMAT (1X,I4,3X,F12.4)
7322 CONTINUE
C
C ( S1/2*P*S1/2 )**2 ELEM. IJ
C
C DO 8102 I=1,NT
C DO 8101 J=1,NT
C PROD(I,J)=0.0D0
C DO 8100 K=1,NT
C PROD(I,J)=PROD(I,J)+BOND(I,K)*BOND(K,J)
C8100 CONTINUE
C8101 CONTINUE
C8102 CONTINUE
C DO 8200 IC=1,NATOM
C DO 8200 JC=1,NATOM
C8200 VINDEX(IC,JC)=0.0D0
C DO 8300 ISH=1,NSHELL
C IAT=KNUC(ISH)
C IFI=KLOC(ISH)
C ILI=IFI+KMAX(ISH)-KMIN(ISH)
C DO 8295 JSH=1,NSHELL
C JAT=KNUC(JSH)
C IFJ=KLOC(JSH)
C ILJ=IFJ+KMAX(JSH)-KMIN(JSH)
C DO 8290 I=IFI,ILI
C DO 8290 J=IFJ,ILJ
C VINDEX(IAT,JAT)=VINDEX(IAT,JAT)+PROD(I,J)
C8290 CONTINUE
C8295 CONTINUE
C8300 CONTINUE
C WRITE(6,633)
C CALL MATOUT(VINDEX,NATOM,NATOM,NATOM,NATOM,6)
C WRITE(6,613)
C DO 8322 IC=1,NATOM
C VAL=0.0D0
C DO 8320 JC=1,NATOM
C IF(JC.EQ.IC)GO TO 8319
C VAL=VAL+VINDEX(IC,JC)
C8319 CONTINUE
C8320 CONTINUE
C WRITE(6,612)IC,VAL
C8322 CONTINUE
RETURN
END
C======================================================================
SUBROUTINE ECAL(PAX,PAY,PAZ,PBX,PBY,PBZ,PTWO,MAXIJ)
IMPLICIT REAL*8 (A-H,O-Z)
LOGICAL EQUAL
COMMON/EXYZS/EX(7,7,13),EY(7,7,13),EZ(7,7,13)
DATA ZERO,ONE / 0.0D+00 , 1.0D+00 /
C
EX(1,1,1)=ONE