-
Notifications
You must be signed in to change notification settings - Fork 0
/
CICPHF.UNIXFORT
9854 lines (9852 loc) · 325 KB
/
CICPHF.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
SUBROUTINE ABORTS
COMMON /TAPES/ NOUT,ICHK,IT30,IT42,IT47,IT52,IT58,IT94,IT96,IT98
WRITE(NOUT,*) ' ABORTS CALLED '
WRITE(ICHK,*) ' ABORTS CALLED '
STOP
END
SUBROUTINE ALLOC(ORBTBF,JCODE,IJORD,IOFF,IJDEP)
IMPLICIT INTEGER (A-Z)
COMMON /TAPES/ NOUT,ICHK,IT30,IT42,IT47,IT52,IT58,IT94,IT96,IT98
COMMON /DIMSG/ SYMORB,NUMIJ,NBF,NMAX,NBFORB,NSYM,NDF,NORBS
COMMON /FUNCS/ IOCC,JOCC,KOCC,NTYPES,NBSET,NAT
COMMON /OCCS/ NSPE,NSA,NSB,NALP,NOP,NDOC,LFERM,NUOC,IJIND,IJIND3
COMMON/OCCS2/NUMCOR,NCOR,FDOC,CORDOC,NUMVIR,FVIR,LUOC,NUMDEP,VUOC
COMMON /TYPES/ NTYDOC,NTYUOC
DIMENSION ORBTBF(NORBS),JCODE(NORBS),IJORD(NUMIJ),IOFF(NUMIJ)
DIMENSION IJDEP(NUMIJ)
DIMENSION ITYP(9)
C
CTJL WRITE(ICHK,2222)
C2222 FORMAT(/' IN ALLOC')
CALL IZERO(ITYP,9)
CTJL WRITE(*,*) ' JCODE ',JCODE
C
IOFF(1) = 0
DO 314 I=1,NUMIJ-1
IOFF(I+1) = IOFF(I) + I
314 CONTINUE
C
DO 315 IORB=1,NORBS
NTYP=JCODE(IORB)
IF (NTYP.GT.9 .OR. NTYP.LE.0) THEN
WRITE(NOUT,201) IORB,NTYP
201 FORMAT(/' JCODE(',I3,')=',I4/
1 ' I DO NOT RECOGNIZE THIS TYPE.')
CALL MABORT
END IF
ITYP(NTYP)=ITYP(NTYP)+1
315 CONTINUE
IF (ITYP(1).NE.0 .OR. ITYP(2).NE.0) THEN
WRITE(NOUT,202)
202 FORMAT(/' THERE ARE SOME FZC OR FZV IN THE DRT'/
1 ' I CAN NOT RUN A GRADIENT FROM THIS.')
CALL MABORT
END IF
NUOC=ITYP(4)+ITYP(6)
LFERM=NUOC+1
NDOC=NUOC+ITYP(3)+ITYP(5)
CTJL
NTYDOC = ITYP(3) + ITYP(5)
NTYUOC = ITYP(4) + ITYP(6)
NUMVIR = ITYP(4)
VUOC = NUMVIR*ITYP(6)
FVIR = ITYP(6) + 1
LUOC = FVIR - 1
NUMCOR = ITYP(3)
NCOR = LFERM + NUMCOR - 1
FDOC = LFERM + NUMCOR
IF(NUMCOR.EQ.0) NCOR = -999
CORDOC = ITYP(5)*NUMCOR
NUMDEP = VUOC + CORDOC
CTJL WRITE(*,*) ' NUMDEP,CORDOC,VUOC',NUMDEP,CORDOC,VUOC
C DO 9240 IJ = 1,NUMIJ
C IJDEP(IJ) = NUMDEP + 1
C9240 CONTINUE
IJDC = 0
DO 9200 I = FDOC,NDOC
DO 9210 J = LFERM,NCOR
IJ = IOFF(I) + J
IJDC = IJDC + 1
IJDEP(IJ) = IJDC
9210 CONTINUE
9200 CONTINUE
DO 9220 I = FVIR,NUOC
DO 9230 J = 1,LUOC
IJ = IOFF(I) + J
IJDC = IJDC + 1
IJDEP(IJ) = IJDC
9230 CONTINUE
9220 CONTINUE
WRITE(*,*) ' THE NUMBER OF DEPENDENT PAIRS IS',IJDC
IF(NUMDEP.EQ.0) NUMDEP = 1
CTJL WRITE(*,*) ' NUMCOR,NCOR,FDOC,CORDOC',NUMCOR,NCOR,FDOC,CORDOC
CTJL
CWA
C WRITE(6,*) ' JCODE AND ITYP ARRAYS'
C WRITE(6,'(14I5)') (JCODE(I),I=1,NBF)
C WRITE(6,'(14I5)') (ITYP(I),I=1,9)
CWA
NOP=NDOC+1
NALP=NDOC+ITYP(7)
NSA=NALP+1
NSB=NALP+ITYP(9)
NSPE=ITYP(9)
WRITE(*,*) ' THE NUMBER OF SPECIAL ORBITALS IS',NSPE
IF (NSB.NE.NORBS) THEN
WRITE(NOUT,203) NSB,NORBS
203 FORMAT(/' ORBITALS MISCOUNTED IN ALLOC',2I5)
CALL MABORT
END IF
C
C WRITE(NOUT,"(' IORB IBF JCODE')")
C DO IORB=1,NORBS
C IBF=ORBTBF(IORB)
C NTYP=JCODE(IBF)
C WRITE(NOUT,"(3I5)") IORB,IBF,NTYP
C END DO
IF (ITYP(3)+ITYP(5) .EQ. 0) THEN
WRITE(NOUT,204)
204 FORMAT(/' THERE ARE NO DOUBLY OCCUPIED ORBITALS.'/
1 ' IT IS NECESSARY TO MODIFY THE PROGRAM. ')
CALL MABORT
END IF
C
C CHECK TO SEE IF THE ORDER OF THE DRT ORBS IS AS EXPECTED
C
DO 316 IORB=1,NUOC
IBF=ORBTBF(IORB)
NTYP=JCODE(IBF)
IF(NTYP.NE.6 .AND. NTYP.NE.4) GOTO 10
316 CONTINUE
DO 317 IORB=LFERM,NDOC
IBF=ORBTBF(IORB)
NTYP=JCODE(IBF)
IF(NTYP.NE.3 .AND. NTYP.NE.5) GOTO 10
317 CONTINUE
IF (ITYP(7).EQ.0) THEN
NOP=0
NALP=0
ELSE
DO 318 IORB=NOP,NALP
IBF=ORBTBF(IORB)
IF (JCODE(IBF).NE.7) GOTO 10
318 CONTINUE
END IF
IF (NSPE.EQ.0) THEN
NSA=0
NSB=0
ELSE
DO 319 IORB=NSA,NSB
IBF=ORBTBF(IORB)
IF (JCODE(IBF).NE.9) GOTO 10
319 CONTINUE
END IF
GOTO 12
10 WRITE(NOUT,205) IORB,IBF,JCODE(IBF)
205 FORMAT(/' THE DRT ORBITALS ARE OUT OF ORDER.'/
1' IORB=',I5,' IBF=',I5,' NTYPE=',I5)
CALL MABORT
12 CONTINUE
WRITE(NOUT,206) 1,NUOC,LFERM,NDOC
206 FORMAT(/' THE UNOCCUPIED ORBITALS: ',2I5/
1' THE DOUBLY OCCUPIED ORBITALS:',2I5/)
IF (NOP.NE.0) WRITE(NOUT,207) NOP,NALP
207 FORMAT(' THE SINGLY OCCUPIED ORBITALS:',2I5/)
IF (NSPE.NE.0) WRITE(NOUT,208) NSA,NSB
208 FORMAT(' THE SPECIAL ORBITALS: ',2I5/)
C
C CONSRTUCT DRT TO INDEP PAIR ORDERING ARRAY
DO 320 II=1,NUMIJ
IJORD(II)=0
320 CONTINUE
IJIND=0
DO 321 I=LFERM,NDOC
IO=IOFF(I)
DO 322 J=1,NUOC
IJ=IO+J
IJIND=IJIND+1
IJORD(IJ)=IJIND
322 CONTINUE
321 CONTINUE
IF (NOP.EQ.0) GOTO 14
DO 323 I=NOP,NALP
IO=IOFF(I)
DO 324 J=1,NDOC
IJ=IO+J
IJIND=IJIND+1
IJORD(IJ)=IJIND
324 CONTINUE
323 CONTINUE
14 CONTINUE
IF (NSPE.EQ.0) GOTO 16
DO 325 I=NSA,NSB
IO=IOFF(I)
DO 326 J=1,I-1
IJ=IO+J
IJIND=IJIND+1
IJORD(IJ)=IJIND
326 CONTINUE
325 CONTINUE
16 CONTINUE
WRITE(NOUT,209) IJIND,IJIND+2
209 FORMAT(' THE NUMBER OF INDEPENDENT PAIRS IS',I5/
1' PLUS THE TWO CI COEFFICIENTS MAKES',I5/)
RETURN
END
SUBROUTINE B0MAT(ALPHA,BETA,EPS,EPA,U,SS,W,ZETA,CC,OCC,EIG,
1INTS,BUF,IJORD,IOFF,KADD,LADD,IJGRP,IJADD,ORBSYM,ORBTBF,JCODE,
2JT1C,E11,E22,E12,LG,BOX,C,X,IOUT,EX,RS,IJDEP,VEC,DIP,EAVF,
3LSTEPA,EX2,HA11,HA22,HA12)
IMPLICIT REAL*8 (A-H,O-Z)
integer r
cets REAL*16 DET
real*8 det
REAL*8 INTS(NMAX),E11(1),E22(1),E12(1),LG(NORBS,NORBS),BOXX(9)
REAL*8 CDIP(3),A2,DEBYE,FAC,A1,A1S2,EAVF(NUMIJ),LSTEPA(NUMIJ)
REAL*8 EX2(IJIND),HA11(NDF),HA22(NDF),HA12(NDF)
LOGICAL IVIR,JVIR
INTEGER FDOC,CORDOC,IJDEP(NUMIJ),FVIR,VUOC
DIMENSION ALPHA(NUMIJ),BETA(NUMIJ),EPS(NUMIJ),EPA(NORBS,NORBS),
1U(NORBS,NORBS),SS(NUMIJ,NDF),W(NORBS,NORBS,NDF),BUF(NUMIJ),
2ZETA(NUMIJ,NORBS),CC(IJIND,IJIND3),OCC(NORBS),EIG(NORBS),
3BOX(NDF),X(NDF),C(IJIND,NDF),XCIJA(28),EX(IJIND),RS(NUMDEP,NDF),
4 VEC(NORBS,NORBS),DIP(NUMIJ,3)
INTEGER IJORD(NUMIJ),IOFF(NUMIJ),KADD(1),LADD(1),IJGRP(1),
1IJADD(1),ORBSYM(1),ORBTBF(1),JCODE(1),IA47(192),
2JT1C(1),IOUT(NORBS),IAJT(20)
COMMON /TAPES/ NOUT,ICHK,IT30,IT42,IT47,IT52,IT58,IT94,IT96,IT98
COMMON /DIMSG/ ISYMRB,NUMIJ,NBF,NMAX,NBFORB,NSYM,NDF,NORBS
COMMON /POINT/ FOCC(5),IPOINT(5),JPOINT(5),NSORB(5)
COMMON /FUNCS/ IOCC,JOCC,KOCC,NTYPES,NBSET,NAT
COMMON /IEXT/ IPRINT,IGRP,ICIDIP
COMMON /OCCS/ NSPE,NSA,NSB,NALP,NOP,NDOC,LFERM,NUOC,IJIND,IJIND3
COMMON/OCCS2/NUMCOR,NCOR,FDOC,CORDOC,NUMVIR,FVIR,LUOC,NUMDEP,VUOC
COMMON /LOC42/ IA42(100),IBF2AT(284)
COMMON /CALCJ/ ICALT,IDERT,ICIT
COMMON /TCSCF/ DERC1,DERC2,CI1,CI2,H11,H12,H22,ONE,ITCSCF
C
WRITE(ICHK,2222)
2222 FORMAT(/' IN B0MAT')
NORBSQ=NORBS*NORBS
A1S2=0.50D+00
A4 = 4.0D+00
A2 = 2.0D+00
A1 = 1.0D+00
DEBYE = 2.541765480D+00
IT98=98
C
C READ BACK IN S DERIVATIVE INTEGRALS
C
IS=1
DO 101 IDF=1,NDF
CALL WREADW(IT94,SS(1,IDF),INTOWP(NUMIJ),IS,IS)
IF (IAND(IPRINT,64) .NE. 0) THEN
WRITE(NOUT,1101) IDF
1101 FORMAT(/' THE SA MATRIX FOR DEGREE ',I5,' AS READ IN B0MAT')
CALL PRINT(SS(1,IDF),NUMIJ,NORBS,NOUT)
END IF
101 CONTINUE
CTJL
C INITIALIZE ROUTINE FOR CALCULATION OF A MATRIX.
CTJL
CALL GETA(CC,EPS,ZETA,ALPHA,BETA)
CALL GETB(CC,EPS,ZETA,ALPHA,BETA,SS)
CALL GETCV(RS,EX,EAVF,LG,SS)
CTJL
C
C CONSTRUCT ETA,ZETA,W,A,B0
C
CTJL WRITE(ICHK,2223)
C2223 FORMAT(/' CALLING GETINT')
CALL GETINT(CC,EPS,ZETA,OCC,ALPHA,BETA,IJORD,KADD,LADD,IJADD,
1IJGRP,ORBSYM,INTS,SS,EPA,JT1C,IOFF,EAVF)
CTJL DO 173 I=1,NORBS
C IO = IOFF(I)
C DO 174 J=1,I
CTJL IJ = IO + J
CTJL WRITE(*,*) ' I,J,ALP,BET ',I,J,ALPHA(IJ),BETA(IJ)
C 174 CONTINUE
C WRITE(*,*) ' I,OCC(I) ',I,OCC(I)
C 173 CONTINUE
CTJL IF (IAND(IPRINT,16) .NE. 0) THEN
CTJL WRITE(NOUT,2231)
C2231 FORMAT(/' THE A MATRIX AS CONSTRUCTED IN GETINT:')
CTJL CALL MATOUT(CC,IJIND,IJIND3,IJIND,IJIND3,NOUT)
CTJL END IF
IF (ICIT.EQ.1) GOTO 2300
C
C READ LAGRANGIAN AND ZERO OUT BOX
C
CALL ZERO(BOX,NDF)
CALL WREADW(IT47,IA47,192,1,JUNK)
WRITE(ICHK,9014) IA47(120)
9014 FORMAT(' IA47(120) ',I8)
CALL WREADW(IT47,LG,INTOWP(NORBS*NORBS),IA47(120),
1 JUNK)
C WRITE(ICHK,9015)
C9015 FORMAT(' READ IN LAGRANGIAN ')
CTJL WRITE(*,*) ' CI LAGRANGIAN'
CTJL CALL MATOUT(LG,NORBS,NORBS,NORBS,NORBS,NOUT)
C
C
C CALL FOR CI FIRST DERIVATIVE
C
CTJL
CTJL WRITE(*,*) ' THE A AND B MATRICES BEFORE '
CTJL CALL MATOUT(CC,IJIND,IJIND3,IJIND,IJIND3,NOUT)
CTJL
CALL GTINTS(CC,EPS,ZETA,OCC,ALPHA,BETA,IJORD,KADD,LADD,IJADD,
1IJGRP,ORBSYM,INTS,SS,EPA,JT1C,IOFF,EX,RS,LG,IJDEP,BOX,EAVF,
2LSTEPA,E11,E12,E22)
C
CALL GTINT2(CC,EPS,ZETA,OCC,ALPHA,BETA,IJORD,KADD,LADD,IJADD,
1IJGRP,ORBSYM,INTS,SS,EPA,JT1C,IOFF,EX,RS,LG,IJDEP,BOX,EAVF,
2LSTEPA,EX2,E11,E12,E22,HA11,HA22,HA12)
C
CTJL
CTJL WRITE(*,*) ' THE EX VECTOR'
C DO 28847 ITJL = 1,IJIND
C WRITE(*,*) ITJL,EX(ITJL)
CTJL EX(ITJL) = EX(ITJL)*A2
28847 CONTINUE
CTJL
CTJL IF (IAND(IPRINT,16) .NE. 0) THEN
C WRITE(NOUT,2231)
C2231 FORMAT(/' THE A MATRIX AS CONSTRUCTED IN GETINT:')
C CALL MATOUT(CC,IJIND,IJIND3,IJIND,IJIND3,NOUT)
CTJL END IF
C WRITE(NOUT,9022)
C9022 FORMAT(/' B0 MATRIX AS WRITTEN TO IT96')
C CALL MATOUT(C,IJIND,NDF,IJIND,NDF,NOUT)
C
C STORE B0 ON IT96
C
CTJL CALL RFILE(IT96) THIS IS NOW DONE IN FAMAT
IC=1
CALL WWRITW(IT96,C,INTOWP(IJIND*NDF),IC,JUNK)
WRITE(ICHK,9011)
9011 FORMAT(' C WRITTEN TO IT96 ')
CALL ZERO(C,IJIND)
C
C READ LAGRANGIAN
C
CTJL CALL WREADW(IT47,IA47,192,1,JUNK)
CTJL WRITE(ICHK,9014) IA47(120)
C9014 FORMAT(' IA47(120) ',I8)
CTJL CALL WREADW(IT47,LG,INTOWP(NORBS*NORBS),IA47(120),
CTJL 1 JUNK)
CTJL WRITE(ICHK,9015)
C9015 FORMAT(' READ IN LAGRANGIAN ')
C WRITE(*,*) ' CI LAGRANGIAN'
C CALL MATOUT(LG,NORBS,NORBS,NORBS,NORBS,NOUT)
CTJL
DO 400 IXDF=1,NDF
CTJL WRITE(*,*) ' BOX ,IDF',BOX(IXDF),IXDF
DO 410 I=1,NORBS
DO 420 R=1,I-1
IR=IOFF(I)+R
BOX(IXDF)=BOX(IXDF)-SS(IR,IXDF)*(LG(I,R)+LG(R,I))
420 CONTINUE
II=IOFF(I)+I
BOX(IXDF)=BOX(IXDF)-SS(II,IXDF)*LG(I,I)
410 CONTINUE
CTJL WRITE(*,*) ' BOX ,IDF',BOX(IXDF),IXDF
400 CONTINUE
CTJL
CTJL WRITE(NOUT,*) (BOX(IXDF),IXDF=1,NDF)
CTJL
C WRITE(*,*) ' THE EX2 VECTOR'
C DO 29847 ITJL = 1,IJIND
C WRITE(*,*) ITJL,EX2(ITJL)
29847 CONTINUE
CTJL DO 26847 IDF = 1,NDF
CTJL WRITE(*,*) ' THE RS VECTOR FOR DEGREE OF FREEDOM',IDF
CTJL DO 27847 ITJL = 1,CORDOC
CTJL WRITE(*,*) ITJL,RS(ITJL,IDF)
27847 CONTINUE
26847 CONTINUE
CTJL
C IR=0
C DO 430 I=1,NORBS
C DO 440 R=1,I
C IR=IR+1
C INDEX=IJORD(IR)
C IF(INDEX.NE.0)C(INDEX,1)=LG(R,I)-LG(I,R)
C IF(INDEX.NE.0)C(INDEX,1)=((LG(R,I)-LG(I,R)) - EX(INDEX))
C440 CONTINUE
C430 CONTINUE
CTJL FAC = -A1
DO 120 I=LFERM,NDOC
IO=IOFF(I)
DO 130 J=1,NUOC
FAC = OCC(J)-OCC(I)
IJ=IO+J
IJND=IJORD(IJ)
C(IJND,1)=((LG(J,I)-LG(I,J)) + FAC*EX(IJND) + EX2(IJND))
CTJL WRITE(*,*) ' J,I,IJND,EX2 ',J,I,IJND,EX2(IJND)
130 CONTINUE
120 CONTINUE
IF (NOP.EQ.0) GOTO 200
DO 140 I=NOP,NALP
IO=IOFF(I)
DO 150 J=1,NDOC
CTJL FAC = -A1S2
CTJL IF(J.GE.LFERM) FAC = A1S2
FAC = OCC(J)-OCC(I)
CTJL WRITE(*,*) ' IN ALP:UOC,DOC PART: FAC ',FAC
IJ=IO+J
IJND=IJORD(IJ)
C(IJND,1)=((LG(J,I)-LG(I,J)) + FAC*EX(IJND) + EX2(IJND))
CTJL WRITE(*,*) ' J,I,IJND,EX2 ',J,I,IJND,EX2(IJND)
CTJL WRITE(*,*) ' J,I,OJ,OI,F',J,I,OCC(J),OCC(I),FAC
150 CONTINUE
140 CONTINUE
200 CONTINUE
IF (NSPE.EQ.0) GOTO 110
DO 160 I=NSA,NSB
IO=IOFF(I)
DO 170 J=1,I-1
FAC = OCC(J)-OCC(I)
IJ=IO+J
IJND=IJORD(IJ)
C(IJND,1)=((LG(J,I)-LG(I,J)) + FAC*EX(IJND) + EX2(IJND))
170 CONTINUE
160 CONTINUE
110 CONTINUE
C
IF(ITCSCF.EQ.1) THEN
CWA
C REMEMBER THAT LG(I,J) IS TWICE THE LAGRANGIAN AND WE THUS
C ARE SOLVING FOR 2Z.
XXWA1=DERC1
XXWA2=DERC2
DERC1=-A4*CI1*XXWA1
DERC2=-A4*CI2*XXWA2
C(IJIND-1,1) = DERC1
C(IJIND,1) = DERC2
END IF
CWA WRITE(*,*) ' ITCSCF,DERC1,DERC2 ',ITCSCF,DERC1,DERC2
WRITE(6,*) ' ITCSCF,ETA1,ETA2 ',ITCSCF,DERC1,DERC2
C
CTJL DO 329 I=1,IJIND
C WRITE(NOUT,3001) I,C(I,1)
C3001 FORMAT(/' I = ',I6,' C(I,1) = ',F20.8)
C 329 CONTINUE
C
C SOLVE FOR Z IN AT*Z=C
C
CALL FLINX(CC,IJIND,IJIND,1,DET)
C WRITE(NOUT,301) DET
CTJL WRITE(*,*) ' THE Z-VECTOR '
C DO 330 I=1,IJIND
C WRITE(*,*) I,C(I,1)
C3309 FORMAT(5X,I5,F20.15)
C 330 CONTINUE
DO 331 I=1,IJIND
CC(I,1)=C(I,1)
331 CONTINUE
C
C READ IN B0
C
CALL WREADW(IT96,C,INTOWP(IJIND*NDF),IC,JUNK)
CTJL WRITE(NOUT,9021)
C9021 FORMAT(/' B0 MATRIX FROM IT96')
C CALL MATOUT(C,IJIND,NDF,IJIND,NDF,NOUT)
CTJL DO 332 IIJ=1,IJIND
C WRITE(*,*) ' IJIND,CC ',IIJ,CC(IIJ,1)
DO 332 IDF=1,NDF
CTJL WRITE(*,*) ' (XIJ+XJI)*SA ',BOX(IDF),IDF
DO 333 IIJ=1,IJIND
CTJL IF(IDF.EQ.3) THEN
CTJL WRITE(NOUT,*) C(IIJ,IDF),CC(IIJ,1),CC(IIJ,1)*C(IIJ,IDF),IDF,IIJ
CTJL END IF
CTJL BOXX(IDF)=C(IIJ,IDF)*CC(IIJ,1)
BOX(IDF) = BOX(IDF) + C(IIJ,IDF)*CC(IIJ,1)
333 CONTINUE
332 CONTINUE
CTJL WRITE(*,*)
CTJL WRITE(NOUT,*) (IDF,BOXX(IDF),IDF=1,NDF)
CWA
C REMEMBER THAT LG(I,J) IS TWICE THE LAGRANGIAN AND WE THUS
C SOLVED FOR 2Z.
DO 334 IDF=1,NDF
BOX(IDF)=BOX(IDF)*A1S2
CTJL WRITE(*,*) ' BOX FROM CPHF ',BOX(IDF),IDF
334 CONTINUE
WRITE(*,*)
C
CALL WREADW(IT42,IA42,100,1,JUNK)
CALL WREADW(IT42,X,INTOWP(NDF),IA42(15),JUNK)
DO 335 IDF=1,NDF
CTJL WRITE(*,*) ' BOX FROM DERIV ',X(IDF),IDF
BOX(IDF)=BOX(IDF)+X(IDF)
335 CONTINUE
C
CALL PRN11(BOX,NDF)
C
CTJL
CTJL WRITE OUT IOUT , IJORD AND Z MATRICES FOR USE IN CALCULATION
CTJL OF CI DIPOLE MOMENTS
CTJL
CTJL IAJT(1)=21
CTJL IAJT(2)=IAJT(1)+INTOWP(NORBS)
CTJL IAJT(3)=IAJT(2)+INTOWP(NUMIJ)
CTJL IAJT(4)=IAJT(3)+INTOWP(IJIND)
CTJL IAJT(11)=NBF
CTJL IAJT(12)=NUMIJ
CTJL IAJT(13)=INTOWP(IJIND)
CTJL CALL WWRITW(IT96,IAJT,20,1,JUNK)
CTJL WRITE(ICHK,*) ' AFTER WRITE 1'
CTJL CALL WWRITW(IT96,IOUT,NBF,IAJT(1),JUNK)
CTJL WRITE(ICHK,*) ' AFTER WRITE 2'
CTJL CALL WWRITW(IT96,IJORD,NUMIJ,IAJT(2),JUNK)
CTJL WRITE(ICHK,*) ' AFTER WRITE 3'
CTJL CALL WWRITW(IT96,CC,INTOWP(IJIND),IAJT(3),JUNK)
CTJL WRITE(ICHK,*) ' AFTER WRITE 4'
C
C LET'S CALCULATE THE CI DIPOLE MOMENT IF DESIRED.
C
IF(ICIDIP.EQ.1) CALL CIDIP(DIP,VEC,E11,EPA,CC,IOFF,IJORD,IJDEP,
1 EAVF,LG,OCC,ORBSYM)
CTJL READ(27,3333) NBATRI
C3333 FORMAT(10I5)
C DO 3334 I = 1,NBATRI
C READ(27,3335) DIP(I,1),DIP(I,2),DIP(I,3)
C3335 FORMAT(3F20.10)
C3334 CONTINUE
CTJL
C CALL ZERO(CDIP,3)
CTJL CALL MATOUT(VEC,NORBS,NORBS,NORBS,NORBS,6)
C DO 170 IDIP = 1,3
C CALL SQUR(DIP(1,IDIP),LG,NBF)
CTJL CALL PRINT(DIP(1,IDIP),NUMIJ,NORBS,6)
CTJL CALL MATOUT(LG,NORBS,NORBS,NORBS,NORBS,6)
C CALL ZERO(EPA,NBF*NBF)
C CALL MXMB(VEC,NBF,1,LG,1,NBF,EPA,1,NBF,NBF,NBF,NBF)
C CALL ZERO(LG,NBF*NBF)
C CALL MXMB(EPA,1,NBF,VEC,1,NBF,LG,1,NBF,NBF,NBF,NBF)
CTJL CALL MATOUT(LG,NORBS,NORBS,NORBS,NORBS,6)
C IJ = 0
C DO 180 I = 1,NBF
C DO 190 J = 1,I
C IJ = IJ + 1
C IJND = IJORD(IJ)
C IF(IJND.EQ.0) GOTO 190
C CDIP(IDIP) = CDIP(IDIP) + LG(I,J)*CC(IJND,1)
CTJL WRITE(*,*) ' IJIND,CC ',IJND,CC(IJND,1)
CTJL WRITE(*,*) ' I,J,IDIP,CDIP',I,J,IDIP,CDIP(IDIP)
CTJL WRITE(*,*) ' LG,CC ',LG(I,J),CC(IJND,1)
C 190 CONTINUE
C 180 CONTINUE
C 170 CONTINUE
C DO 200 I=1,3
C CDIP(I) = CDIP(I)*DEBYE
C 200 CONTINUE
C WRITE(*,3335) (CDIP(I),I=1,3)
CTJL
C
RETURN
C
C
C
C SOLVE FOR U IN A*U=B0
C
2300 CALL GTINT3(CC,EPS,ZETA,OCC,ALPHA,BETA,IJORD,KADD,LADD,IJADD,
1IJGRP,ORBSYM,INTS,BUF,ORBTBF,JCODE,EIG,SS,EPA,W,JT1C,IOFF,
2E11,E22,E12)
CALL GTINT4(CC,EPS,ZETA,OCC,ALPHA,BETA,IJORD,KADD,LADD,IJADD,
1IJGRP,ORBSYM,INTS,BUF,ORBTBF,JCODE,EIG,SS,EPA,W,JT1C,IOFF,
2E11,E22,E12)
CTJL IF (IAND(IPRINT,16) .NE. 0) THEN
CTJL WRITE(NOUT,2231)
CTJL CALL MATOUT(CC,IJIND,IJIND3,IJIND,IJIND3,NOUT)
CTJL END IF
WRITE(ICHK,2224)
2224 FORMAT(/' CALLING FLIN')
CALL FLINX(CC,IJIND,IJIND,NDF,DET)
CTJL WRITE(NOUT,301) DET
301 FORMAT(/' DETERMINANT FROM FLIN =',G18.8)
C
C FILL OUT U ARRAY FOR EACH DEGREE OF FREEDOM
C
CALL RFILE(IT98)
CIBM CALL SREW(IT98)
IU=1
DO 201 IDF=1,NDF
C
DO 202 I=1,NORBS
DO 202 J=1,NORBS
202 U(I,J)=0.0D+00
C
IJ=0
NCVIRT=0
DO 203 I=1,NORBS
IVIR=.FALSE.
IF (I.LT.LFERM) NCVIRT=NCVIRT+1
DO 203 J=1,I
JVIR=.FALSE.
IF (J.LT.LFERM) NCVIRT=NCVIRT+1
IJ=IJ+1
INDEX=IJORD(IJ)
IF (INDEX .NE. 0) U(I,J)=CC(INDEX,IDF+IJIND)
U(J,I)= -U(I,J)-SS(IJ,IDF)
IF (NCVIRT.EQ.1) THEN
C IF (IVIR.XOR.JVIR) THEN
TEMP=U(I,J)
U(I,J)=U(J,I)
U(J,I)=TEMP
END IF
203 CONTINUE
C
DO 204 I=1,NORBS
II=IOFF(I)+I
204 U(I,I)=-A1S2*SS(II,IDF)
C
IF (IAND(IPRINT,16) .NE. 0) THEN
WRITE(NOUT,1001) IDF
1001 FORMAT(/' THE U MATRIX FOR DEGREE OF FREEDOM ',I4)
CALL MATOUT(U,NORBS,NORBS,NORBS,NORBS,NOUT)
END IF
C
CALL WWRITW(IT98,U,INTOWP(NORBSQ),IU,IU)
201 CONTINUE
C
RETURN
END
PROGRAM CICPHF
C***********************************************************************
C GENERAL COUPLED-PERTURBED HARTREE-FOCK PROGRAM FOR CI FIRST ***
C***********************************************************************
C NOTICE OF PROGRAM MODIFICATION *
C BY: WESLEY ALLEN *
C DATE: JANUARY 5, 1987 *
C REASON: ADD INPUT OPTION TO ALLOW 3 REF. CI GRADIENT CALCULATIONS. *
C KSPE= NO. OF SPECIAL ORBITALS. LSPE(I) CONTAINS THE *
C INTEGER LABELS OF THE SPECIAL ORBITALS, I.E. THE NUMBERS *
C ASSIGNED TO THEM AS IN THE DRT INPUT. *
C ONLY KSPE=2 WORKS CURRENTLY WITH THE 3 REFERENCES *
C (SPE1)2 (SPE2)2 (SPE1)(SPE2) (OPEN-SHELL SINGLET) *
C BY: WESLEY ALLEN *
C DATE: NOVEMBER 1, 1986 *
C REASON: FIXING UP THE CI DIPOLE MOMENT *
C REASON: (SEE GRCPHF PROGRAM FOR A DETAILED DESCRIPTION OF THE BUG) *
C BY: TJL *
C DATE: AUGUST 3, 1985 *
C REASON: WRITE CI ENERGY TO FILE 11 *
C BY: TJL *
C DATE: APRIL 14, 1985 *
C REASON: IMPLEMENT COR'S AND VIR'S FOR OPEN SHELL *
C REASON: OPEN SHELL SINGLETS STILL DO NOT WORK; WITH OR WITHOUT C/V *
C REASON: COR'S AND VIR'S FOR DIPOLE MOMENTS HAVE ALSO BEEN IMPL. *
C REASON: THESE HAVE NOT BEEN TESTED. *
C UNIT 3 TO CHECK *
C REASON: CHANGE UNIT NUMBERS !! 2=>52, 82=>56, 21=>55, JTAP1=>94 *
C REASON: CHANGE UNIT NUMBERS !! 8=>58, 20=>53, 22=>42, JTAP2=>96 *
C REASON: CHANGE UNIT NUMBERS !!12=>54, 57=>47 , IUTAP=>98 *
C BY: RICHARD REMINGTON *
C DATE: FEBRUARY 22, 1985 *
C REASON: ADD SUBROUTINE PRN11 IN ORDER TO WRITE CI GRADIENTS INTO *
C FILES 11, 30, AND THE OUTPUT (FILE6). *
C***********************************************************************
C
REAL*8 Z(1200000)
INTEGER IZ(1)
EQUIVALENCE (IZ(1), Z(1))
COMMON /TAPES/ NOUT,ICHK,IT30,IT42,IT47,IT52,IT58,IT94,IT96,IT98
COMMON /FILES/ IT54,IT97
C
1000 FORMAT(///,10X,' >>>>> GENERAL CPHF CALCULATION COMPLETED <<<<< ')
C
MAXCOR=1200000
ICHK = 3
NOUT = 6
IT30 = 30
IT42 = 42
IT47 = 47
IT52 = 52
IT54 = 54
IT58 = 58
IT94 = 94
IT96 = 96
IT97 = 97
C
call drum
CALL TSTART(3)
CALL TSTART(6)
cets CALL NOUNFL
C
CALL MAIN(IZ,Z,MAXCOR)
C
CALL RCLOSE(IT96,3)
CTJL CALL RCLOSE(IT30,3)
C
WRITE(NOUT,1000)
C
CALL TSTOP(3)
CALL TSTOP(6)
C
STOP
END
SUBROUTINE CIDIP(DIPINT,VEC,SCR1,SCR2,Z,IOFF,IJORD,IJDEP,EAVF,LG,
1 OCC,ORBSYM)
IMPLICIT INTEGER (A-Z)
C
REAL*8 DIPINT(NUMIJ,3),VEC(NORBS,NORBS),SCR1(NORBS,NORBS)
REAL*8 SCR2(NORBS,NORBS),Z(IJIND),CIDM(3),CIDC(3),CIDT(3)
REAL*8 EAVF(NUMIJ),LG(NBF,NBF),OCC(NBF)
REAL*8 DEBYE,FAC,A0,A1,A1S2,CITM,FAC2,A4,KAPPA1,KAPPA2
REAL*8 DERC1,DERC2,CI1,CI2,H11,H12,H22,ONE,KAPPA(3)
INTEGER IOFF(NUMIJ),IJORD(NUMIJ),IJDEP(NUMIJ),ORBSYM(NBF)
C
COMMON /TAPES/ NOUT,ICHK,IT30,IT42,IT47,IT52,IT58,IT94,IT96,IT98
COMMON /DIMSG/ ISYMRB,NUMIJ,NBF,NMAX,NBFORB,NSYM,NDF,NORBS
COMMON /FUNCS/ IOCC,JOCC,KOCC,NTYPES,NBSET,NAT
COMMON /IEXT/ IPRINT,IGRP,ICIDIP
COMMON /OCCS/ NSPE,NSA,NSB,NALP,NOP,NDOC,LFERM,NUOC,IJIND,IJIND3
COMMON/OCCS2/NUMCOR,NCOR,FDOC,CORDOC,NUMVIR,FVIR,LUOC,NUMDEP,VUOC
COMMON/TCSCF/DERC1,DERC2,CI1,CI2,H11,H12,H22,ONE,ITCSCF
C
DATA DEBYE / 2.541765480D+00 /
DATA A0,A1,A1S2,A4 / 0.0D+00,1.0D+00,0.5D+00,4.0D0/
DATA A2 / 2.0D0/
C
1 FORMAT(5X,'THE CI DIPOLE MOMENT ',10X,3F20.10)
2 FORMAT(5X,'CORRECTION TO CI D.M.',10X,3F20.10)
3 FORMAT(5X,'THE TOTAL CI DIPOLE MOMENT',5X,3F20.10)
4 FORMAT(5X,'MAGNITUDE OF THE CI D.M.',7X,F20.10,5X,'DEBYES')
5 FORMAT(//,5X,'KAPPA CONTRIBUTION TO DIPOLE MOMENT'/)
6 FORMAT(5X,3F20.10)
C
DIPTAP = 59
WPOINT = 1
CALL RFILE(DIPTAP)
CALL WREADW(DIPTAP,DIPINT,INTOWP(3*NUMIJ),WPOINT,WPOINT)
CALL WREADW(DIPTAP,CIDM,INTOWP(3),WPOINT,WPOINT)
C
CALL ZERO(CIDC,3)
CTJL CALL MATOUT(VEC,NORBS,NORBS,NORBS,NORBS,6)
DO 110 IDIP = 1,3
CALL SQUR(DIPINT(1,IDIP),SCR1,NBF)
CTJL CALL PRINT(DIPINT(1,IDIP),NUMIJ,NORBS,6)
CTJL CALL MATOUT(SCR1,NORBS,NORBS,NORBS,NORBS,6)
CALL ZERO(SCR2,NBF*NBF)
CALL MXMB(VEC,NBF,1,SCR1,1,NBF,SCR2,1,NBF,NBF,NBF,NBF)
CALL ZERO(SCR1,NBF*NBF)
CALL MXMB(SCR2,1,NBF,VEC,1,NBF,SCR1,1,NBF,NBF,NBF,NBF)
C WRITE(*,*) ' IDIP = ',IDIP
C CALL MATOUT(SCR1,NORBS,NORBS,NORBS,NORBS,6)
CTJL FAC = A1
CWA
C OCC(I) CORRESPONDS TO F(I).
C Z IS REALLY 2Z.
DO 120 I=LFERM,NDOC
IO=IOFF(I)
C ISM = ORBSYM(I)
DO 130 J=1,NUOC
FAC = OCC(I) - OCC(J)
IJ=IO+J
IJND=IJORD(IJ)
C JSM = ORBSYM(J)
C IF(IDIP.EQ.3)WRITE(*,*)' DI,HZ,Z ',CIDC(IDIP),SCR1(I,J),Z(IJND)
C IF(IDIP.EQ.3)WRITE(*,*)' ISM,JSM ',ISM,JSM
CIDC(IDIP) = CIDC(IDIP) + SCR1(I,J)*Z(IJND)*FAC
130 CONTINUE
120 CONTINUE
C WRITE(*,*)
IF (NOP.EQ.0) GOTO 200
DO 140 I=NOP,NALP
IO=IOFF(I)
DO 150 J=1,NDOC
C FAC = A1S2
C IF(J.GE.LFERM) FAC = -A1S2
FAC = OCC(I) - OCC(J)
IJ=IO+J
IJND=IJORD(IJ)
C IF(IDIP.EQ.2)WRITE(*,*)' DI,HY,Z ',CIDC(IDIP),SCR1(I,J),Z(IJND)
CIDC(IDIP) = CIDC(IDIP) + SCR1(I,J)*Z(IJND)*FAC
150 CONTINUE
140 CONTINUE
200 CONTINUE
C WRITE(*,*)
IF (NSPE.EQ.0) GOTO 520
DO 160 I=NSA,NSB
IO=IOFF(I)
DO 170 J=1,I-1
FAC = OCC(I) - OCC(J)
IJ=IO+J
IJND=IJORD(IJ)
CIDC(IDIP) = CIDC(IDIP) + SCR1(I,J)*Z(IJND)*FAC
170 CONTINUE
160 CONTINUE
CWA
C ZETA IS REALLY 2ZETA.
IF(ITCSCF.EQ.1)THEN
KAPPA1=SCR1(NSB,NSB)-SCR1(NSA,NSA)
KAPPA2=(Z(IJIND-1)*CI2-Z(IJIND)*CI1)*CI1*CI2
KAPPA(IDIP)=-A2*KAPPA1*KAPPA2
CIDC(IDIP)=CIDC(IDIP)+KAPPA(IDIP)
KAPPA(IDIP)=KAPPA(IDIP)*DEBYE
END IF
520 CONTINUE
CTJL
IJ = 0
DO 500 I = 1,NBF
II = IOFF(I) + I
DO 510 J = 1,I
JJ = IOFF(J) + J
IJ = IJ + 1
IJCV = IJDEP(IJ)
IF(IJCV.EQ.0) GO TO 510
CWA FAC = A1/(EAVF(JJ)-EAVF(II))
FAC = A1/(EAVF(II)-EAVF(JJ))
C IF(IDIP.EQ.3) WRITE(*,*)' DI,HZ ',CIDC(IDIP),SCR1(I,J)
C FAC2 = (LG(J,I)-LG(I,J))
C IF(IDIP.EQ.2)WRITE(*,*)' FAC,X ',FAC,FAC2
CIDC(IDIP) = CIDC(IDIP) + FAC*(LG(J,I)-LG(I,J))*SCR1(I,J)
510 CONTINUE
500 CONTINUE
CTJL
110 CONTINUE
WRITE(6,5)
WRITE(6,6) (KAPPA(I),I=1,3)
DO 210 I=1,3
CIDC(I) = CIDC(I)*DEBYE
CIDT(I) = CIDC(I) + CIDM(I)
210 CONTINUE
WRITE(*,*)
WRITE(*,*)
WRITE(*,1) (CIDM(I),I=1,3)
WRITE(*,2) (CIDC(I),I=1,3)
WRITE(*,3) (CIDT(I),I=1,3)
WRITE(*,*)
WRITE(*,*)
CITM = CIDT(1)*CIDT(1) + CIDT(2)*CIDT(2) + CIDT(3)*CIDT(3)
CITM = DSQRT(CITM)
WRITE(*,4) CITM
C
RETURN
END
SUBROUTINE DERMAT(VEC,SCR1,SCR2,SS,BUF1,BUF2,IOFF,JT1C)
IMPLICIT REAL*8 (A-H,O-Z)
DIMENSION VEC(NORBS,NORBS),SCR1(NUMIJ),SCR2(NUMIJ),
1BUF1(NUMIJ,NDF),BUF2(NUMIJ,NDF,NBSET),SS(NUMIJ)
INTEGER IOFF(NUMIJ),JT1C(1)
COMMON /TAPES/ NOUT,ICHK,IT30,IT42,IT47,IT52,IT58,IT94,IT96,IT98
COMMON /DIMSG/ ISYMRB,NUMIJ,NBF,NMAX,NBFORB,NSYM,NDF,NORBS
COMMON /FUNCS/ IOCC,JOCC,KOCC,NTYPES,NBSET,NAT
COMMON /LOC42/ IA42(100),IBF2AT(284)
COMMON /IEXT/ IPRINT,IGRP,ICIDIP
C
CTJL WRITE(ICHK,2222)
C2222 FORMAT(/' IN DERMAT')
CALL RFILE(IT94)
CIBM CALL SREW(IT94)
CALL WREADW(IT42,IBF2AT,NORBS,IA42(11),JUNK)
C
C READ IN IT42 DATA; TRANSFORM TO MO BASIS; STORE ON IT94
C
C READ S DERIVATIVE INTEGRALS
CALL WREADW(IT42,BUF1,INTOWP(NUMIJ*3),IA42(12),JUNK)
CALL SAMAT(BUF1,NUMIJ,SS,NUMIJ,VEC,IOFF,SCR1,SCR2,JT1C)
C
C READ H DERIVATIVE INTEGRALS
CALL WREADW(IT42,BUF1,INTOWP(NUMIJ*NDF),IA42(14),JUNK)
IS=JT1C(NDF)+INTOWP(NUMIJ)
DO 107 IABC=1,NDF
IF (IAND(IPRINT,4) .NE. 0) THEN
WRITE(NOUT,1001) IABC
1001 FORMAT(/' THE HA MATRIX FOR DEGREE OF FREEDOM ',I5)
CALL PRINT(BUF1(1,IABC),NUMIJ,NORBS,NOUT)
END IF
CALL MOCONV(BUF1(1,IABC),NUMIJ,SS,NUMIJ,VEC,SCR1,SCR2)
JT1C(IABC+NDF)=IS
CALL WWRITW(IT94,SS,INTOWP(NUMIJ),IS,IS)
IF (IAND(IPRINT,4) .NE. 0) THEN
WRITE(NOUT,1002) IABC
1002 FORMAT(/' THE HM MATRIX FOR DEGREE OF FREEDOM ',I5)
CALL PRINT(SS,NUMIJ,NORBS,NOUT)
WRITE(NOUT,1003) IABC,JT1C(IABC+NDF),IS
1003 FORMAT(/' HM FOR DEGREE ',I5,' WRITTEN TO WORD ',I8,
1 ' NEXT WORD IS ',I8)
END IF
107 CONTINUE
C
C READ 2E DERIVATIVE INTEGRALS (T MATRIX)
CTJL WRITE(ICHK,*) ' IA42(17),NBSET,NDF,NUMIJ = ',
CTJL 1 IA42(17),NBSET,NDF,NUMIJ
CALL WREADW(IT42,BUF2,INTOWP(NBSET*NDF*NUMIJ),IA42(17),JUNK)
IJT=2*NDF
DO 108 ISET = 1,NBSET
DO 108 IABC = 1,NDF
IF (IAND(IPRINT,8) .NE. 0) THEN
WRITE(NOUT,1004) ISET,IABC
1004 FORMAT(/' THE TA MATRIX FOR SET ',I5,' DEGREE ',
* I5)
CALL PRINT(BUF2(1,IABC,ISET),NUMIJ,NORBS,NOUT)
END IF
CALL MOCONV(BUF2(1,IABC,ISET),NUMIJ,SS,NUMIJ,VEC,SCR1,
* SCR2)
IJT=IJT+1
JT1C(IJT)=IS
CALL WWRITW(IT94,SS,INTOWP(NUMIJ),IS,IS)
IF (IAND(IPRINT,8) .NE. 0) THEN
WRITE(NOUT,1005) ISET,IABC
1005 FORMAT(/' THE TM MATRIX FOR SET ',I5,' DEGREE ',
* I5)
CALL PRINT(SS,NUMIJ,NORBS,NOUT)
WRITE(NOUT,1006) IABC,IJT,JT1C(IJT),IS
1006 FORMAT(/' TM FOR DEGREE ',I5,' IN JT1C ',I5/
1 ' WRITTEN TO WORD',I5,' NEXT WORD IS ',I8)
END IF
108 CONTINUE
RETURN
END
FUNCTION DOT(A,NA,B,NB,N)
IMPLICIT REAL*8 (A-H,O-Z)
DIMENSION A(1),B(1)
IAPT=1
IBPT=1
D=0.0
DO 10 I=1,N
D=D+A(IAPT)*B(IBPT)
IAPT=IAPT+NA
IBPT=IBPT+NB
10 CONTINUE
DOT=D
RETURN
END
SUBROUTINE DRMAT2(VEC,SCR1,SCR2,SS,BUF1,BUF2,IOFF,JT1C)
IMPLICIT REAL*8 (A-H,O-Z)
DIMENSION VEC(NORBS,NORBS),SCR1(NUMIJ),SCR2(NUMIJ),
1BUF1(NUMIJ,NDF),BUF2(NUMIJ,NDF,NBSET),SS(NUMIJ)
INTEGER IOFF(NUMIJ),JT1C(1)
COMMON /TAPES/ NOUT,ICHK,IT30,IT42,IT47,IT52,IT58,IT94,IT96,IT98
COMMON /DIMSG/ ISYMRB,NUMIJ,NBF,NMAX,NBFORB,NSYM,NDF,NORBS
COMMON /FUNCS/ IOCC,JOCC,KOCC,NTYPES,NBSET,NAT
COMMON /LOC42/ IA42(100),IBF2AT(284)
COMMON /IEXT/ IPRINT,IGRP,ICIDIP
C
CTJL WRITE(ICHK,2222)
C2222 FORMAT(/' IN DERMAT')
CALL RFILE(IT94)
CIBM CALL SREW(IT94)
CALL WREADW(IT42,IBF2AT,NORBS,IA42(11),JUNK)
C
C READ IN IT42 DATA; TRANSFORM TO MO BASIS; STORE ON IT94
C
C READ S DERIVATIVE INTEGRALS
CALL WREADW(IT42,BUF1,INTOWP(NUMIJ*3),IA42(12),JUNK)
CALL SAMAT(BUF1,NUMIJ,SS,NUMIJ,VEC,IOFF,SCR1,SCR2,JT1C)
C
C READ H DERIVATIVE INTEGRALS
CALL WREADW(IT42,BUF1,INTOWP(NUMIJ*NDF),IA42(14),JUNK)
IS=JT1C(NDF)+INTOWP(NUMIJ)
DO 107 IABC=1,NDF
IF (IAND(IPRINT,4) .NE. 0) THEN
WRITE(NOUT,1001) IABC
1001 FORMAT(/' THE HA MATRIX FOR DEGREE OF FREEDOM ',I5)
CALL PRINT(BUF1(1,IABC),NUMIJ,NORBS,NOUT)
END IF
CALL MOCONV(BUF1(1,IABC),NUMIJ,SS,NUMIJ,VEC,SCR1,SCR2)
JT1C(IABC+NDF)=IS
CALL WWRITW(IT94,SS,INTOWP(NUMIJ),IS,IS)
IF (IAND(IPRINT,4) .NE. 0) THEN
WRITE(NOUT,1002) IABC
1002 FORMAT(/' THE HM MATRIX FOR DEGREE OF FREEDOM ',I5)
CALL PRINT(SS,NUMIJ,NORBS,NOUT)
WRITE(NOUT,1003) IABC,JT1C(IABC+NDF),IS
1003 FORMAT(/' HM FOR DEGREE ',I5,' WRITTEN TO WORD ',I8,
1 ' NEXT WORD IS ',I8)
END IF
107 CONTINUE
C
C READ 2E DERIVATIVE INTEGRALS (T MATRIX)
CTJL WRITE(*,*) ' IA42(17),NBSET,NDF,NUMIJ = ',
CTJL 1 IA42(17),NBSET,NDF,NUMIJ
CALL WREADW(IT42,BUF2,INTOWP(NBSET*NDF*NUMIJ),IA42(17),JUNK)
CTJL CALL ZERO(BUF2,NBSET*NDF*NUMIJ)
CTJL WRITE(*,*) ' LAST WORD + 1 = ',JUNK
CTJL WRITE(*,*) ' LAST ELEMENT ',BUF2(28,9,7)
IJT=2*NDF
DO 108 IABC = 1,NDF
DO 108 ISET = 1,NBSET
IF (IAND(IPRINT,8) .NE. 0) THEN
WRITE(NOUT,1004) ISET,IABC
1004 FORMAT(/' THE TA MATRIX FOR SET ',I5,' DEGREE ',
* I5)
CALL PRINT(BUF2(1,IABC,ISET),NUMIJ,NORBS,NOUT)
END IF
CALL MOCONV(BUF2(1,IABC,ISET),NUMIJ,SS,NUMIJ,VEC,SCR1,
* SCR2)
IJT=IJT+1
JT1C(IJT)=IS
CALL WWRITW(IT94,SS,INTOWP(NUMIJ),IS,IS)
IF (IAND(IPRINT,8) .NE. 0) THEN
WRITE(NOUT,1005) ISET,IABC
1005 FORMAT(/' THE TM MATRIX FOR SET ',I5,' DEGREE ',
* I5)
CALL PRINT(SS,NUMIJ,NORBS,NOUT)
WRITE(NOUT,1006) IABC,IJT,JT1C(IJT),IS
1006 FORMAT(/' TM FOR DEGREE ',I5,' IN JT1C ',I5/
1 ' WRITTEN TO WORD',I5,' NEXT WORD IS ',I8)
END IF
108 CONTINUE
RETURN
END
SUBROUTINE FAMAT(EPA,TA,HA,BUF,IOFF,JT1C,IOUT,DROL,LSTEPA)
IMPLICIT REAL*8 (A-H,O-Z)
INTEGER IOFF(NUMIJ),JT1C(1),IOUT(NORBS),DROL(NORBS)
DIMENSION EPA(NORBS,NORBS),TA(NUMIJ),HA(NUMIJ),BUF(NUMIJ,NBSET)
REAL*8 LSTEPA(NUMIJ)