-
Notifications
You must be signed in to change notification settings - Fork 0
/
CICPHF.FORT10
2351 lines (2351 loc) · 70.5 KB
/
CICPHF.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 CICPHF
C***********************************************************************
C GENERAL COUPLED-PERTURBED HARTREE-FOCK PROGRAM FOR CI FIRST ***
C***********************************************************************
C NOTICE OF PROGRAM MODIFICATION *
C***********************************************************************
c Moved to PSI distribution disk on 020289 - clj.
C***********************************************************************
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 TSTART(3)
CALL TSTART(6)
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 MAIN(IZ,Z,MAXCOR)
IMPLICIT INTEGER (A-Z)
REAL*8 Z(MAXCOR),FOCC,DRTVER,CI1,CI2,CITR,H11,H12,H22,ONE
REAL*8 DERC1,DERC2
INTEGER IZ(1),IA47(192),LABEL(26),CICOEF(2)
CWA
COMMON /INPSPE/ KSPE,LSPE(5)
CWA
COMMON /TAPES/ NOUT,ICHK,IT30,IT42,IT47,IT52,IT58,IT94,IT96,IT98
COMMON /DIMSG/ SYMORB,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 /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
COMMON /LOC42/ IA42(100),IBF2AT(284)
CTJL COMMON /DRTI/ IA(30000)
COMMON /IEXT/ IPRINT,IGRP,ICIDIP
COMMON /CALCJ/ ICALT,IDERT,ICIT
C
EQUIVALENCE (CICOEF,CITR)
C
WRITE(NOUT,1000)
1000 FORMAT(//10X,'THE GENERAL COUPLED PERTURBED HARTREE-FOCK PROGRAM',
+ /,10X,' BASED ON LUCK AND A GOOD GUESS ',
+ //,10X,' GRCPHF PROGRAM WRITTEN BY ',
+ /,10X,' PATIENT BUT FRUSTRATED PEOPLE ',//)
C
C READ IN SOME CONSTANTS FROM TAPES 42,47,58
C
C WRITE(ICHK,2222)
C2222 FORMAT(/' IN MAIN')
CTJL DRTTOP=30000
C
INPUT=5
CALL LOCATE(INPUT,'# GRCPHF #',IERR)
IF (IERR .EQ. 0) THEN
CWA
READ(INPUT,'(3I5)') IPRINT,ICIDIP,KSPE
IF(KSPE.NE.0) READ(INPUT,'(5I5)') (LSPE(I),I=1,KSPE)
ELSE
WRITE(NOUT,990)
IPRINT = 0
ICIDIP = 0
990 FORMAT(/' # GRCPHF # NOT FOUND IN INPUT FILE; USING DEFAULTS')
END IF
C WRITE(ICHK,2300) IPRINT
C2300 FORMAT(/' IPRINT=',I5)
CALL RFILE(IT30)
CALL RFILE(IT42)
CALL RFILE(IT47)
CALL RFILE(IT58)
CTJL WRITE(ICHK,9002)
9002 FORMAT(' BEFORE TAPE47 READ')
CALL WREADW(IT47,IA47,192,1,JUNK)
CTJL WRITE(ICHK,9003)
9003 FORMAT(' BEFORE TAPE42 READ ')
CALL WREADW(IT42,IA42,100,1,JUNK)
CTJL WRITE(ICHK,9004)
9004 FORMAT(' AFTER TAPE 42 READ')
NBF=IA47(1)
IOCC=IA47(2)
JOCC=IA47(3)
KOCC=IA47(4)
NIJ=IA47(5)
NAT=IA47(6)
NDF=NAT*3
NTYPES=IA47(7)
ICALT=IA47(8)
IDERT=IA47(9)
ICIT=IA47(10)
CICOEF(1) = IA47(14)
CICOEF(2) = IA47(15)
CI1 = CITR
CICOEF(1) = IA47(16)
CICOEF(2) = IA47(17)
CI2 = CITR
WRITE(*,*) ' THE CI COEFFICIENTS '
WRITE(*,*) CI1,CI2
C
C CHECK FOR ERRORS ON 47
C
IF (ICALT .EQ. 3) THEN
ITCSCF=0
ELSE IF (ICALT .EQ. 4) THEN
ITCSCF=1
ELSE
WRITE(NOUT,1001) ICALT
CALL MABORT
1001 FORMAT(/' THIS PROGRAM DOES GENERAL SCF OR TCSCF'
1 /' CAN NOT HANDLE YOUR CALTYP OF :',I5)
END IF
CTJL WRITE(ICHK,9005)
9005 FORMAT(' FIRST TEST')
C IF (ITCSCF .EQ. 1) THEN
C WRITE(NOUT,1002)
C1002 FORMAT(/' TEMPORARILY CANNOT DO SCF 2ND OF TCSCF')
C CALL MABORT
C END IF
IF (IA47(10).EQ.1) THEN
IF (IA47(9).NE.2) THEN
WRITE(NOUT,1003) IA47(9)
1003 FORMAT(/' THIS IS SCF SECOND . YOUR DERTYP IS : ',I5)
CALL MABORT
END IF
ELSE IF (IA47(10).EQ.2.OR.IA47(10).EQ.4) THEN
IF (IA47(9).NE.1) THEN
WRITE(NOUT,1004) IA47(9)
1004 FORMAT(/' THIS IS CI FIRST . YOUR DERTYP IS : ',I5)
CALL MABORT
END IF
ELSE
WRITE(NOUT,1005) IA47(10)
1005 FORMAT(/' THIS IS CI OR SCF . YOUR CITYP IS : ',I5)
CALL MABORT
END IF
C
NAT42=IA42(2)
NUM=IA42(3)
NBSET=IA42(8)
WRITE(*,*) ' NBSET ' ,NBSET
ISALC=IA42(12)
ISA2LC=IA42(13)
IHALC=IA42(14)
ITALC=IA42(17)
C
C COMPARE 22 DATA TO 47 DATA AS A CHECK
C
CTJL IF (NAT42 .NE. NAT) THEN
C WRITE(NOUT,1006) NAT42,NAT
C CALL MABORT
C1006 FORMAT(/' THE NUMBER OF ATOMS IS INCONSISTANT: ',2I5)
C END IF
C IF (NUM .NE. NBF) THEN
C WRITE(NOUT,1007) NUM,NBF
C CALL MABORT
C1007 FORMAT(/' THE NUMBER OF BASIS FUNCTIONS IS INCONSISTANT: ',
C * 2I5)
C END IF
C
CALL WREADW(IT58,DRTVER,INTOWP(1),1,END)
CALL WREADW(IT58,LABEL,26,END,END)
CALL WREADW(IT58,NBF,1,END,END)
CALL WREADW(IT58,NSYM,1,END,END)
CALL WREADW(IT58,NORBS,1,END,END)
END=END+3
CALL WREADW(IT58,NREFS,1,END,END)
END=END+5
CALL WREADW(IT58,ORBSYM,1,END,END)
CALL WREADW(IT58,SYMORB,1,END,END)
CALL WREADW(IT58,NUMIJ,1,END,END)
CALL WREADW(IT58,NGROUP,1,END,END)
END=END+1
CALL WREADW(IT58,NMAX,1,END,END)
CTJL WRITE(NOUT,1008) DRTVER,LABEL,NBF,NSYM,NORBS,NREFS,ORBSYM,NUMIJ,
C 1NGROUP,NMAX
C1008 FORMAT(/' READING DATA FROM DRT TAPE, VERSION=',F10.6
C 1/' LABEL FROM DRT: ',26A3/
C 2/' DRT INFORMATION:'/' NBF=',I5,' NSYM=',I5,' NORBS=',I5,
C 3/' NREFS=',I5,' ORBSYM=',I5,' NUMIJ=',I5,' NGROUP=',I5,
CTJL 4' NMAX=',I5)
IF (NORBS .NE. NBF) THEN
WRITE(NOUT,1009) NORBS,NBF
CALL MABORT
1009 FORMAT(/' THIS DRT CONTAINS FROZEN ORBITALS.'
1 /' NORBS=',I6,' NBF=',I6)
END IF
IF (NORBS .NE. IA47(1)) THEN
WRITE(NOUT,1010) NORBS,IA47(1)
CALL MABORT
1010 FORMAT(/' THE NUMBER OF ORBITALS BETWEEN TAPES 47 AND 8 IS INCO
*N SISTANT.'/' NORBS=',I6,' FROM IT47=',I6)
END IF
IF (NREFS .NE. 1) THEN
WRITE(NOUT,1011) NREFS
CALL MABORT
1011 FORMAT(/' THE NUMBER OF REFERENCES IS: ',I5,
1 /' THIS PROGRAM HANDLES ONLY SINGLE REFERENCES!')
END IF
C
C ALLOCATE CORE FOR DRT ARRAYS
C
IOFF=1
IJORD=IOFF+NUMIJ
CTJL
IJDEP = IJORD + NUMIJ
CTJL KADD=IJORD+NUMIJ
KADD=IJDEP+NUMIJ
LADD=KADD+SYMORB
IJADD=LADD+SYMORB
IJGRP=IJADD+NUMIJ
ORBTBF=IJGRP+NUMIJ
IOUT=ORBTBF+NORBS
ORBSYM=IOUT+NORBS
JCODE=ORBSYM+NORBS
JT1C=JCODE+NORBS
DROL=JT1C+4*NDF+NBSET*NDF
ITOP=DROL+NORBS
CTJL WRITE(NOUT,2012) ITOP,DRTTOP
C2012 FORMAT(/' THERE ARE ',I5,' WORDS NEEDED ',I5,' AVAILABLE')
CTJL IF (ITOP .GT. DRTTOP) THEN
IF (ITOP .GT. INTOWP(MAXCOR)) THEN
WRITE(NOUT,1012) ITOP,INTOWP(MAXCOR)
CALL MABORT
1012 FORMAT(/' FOR DRT ARRAYS, PROGRAM REQUESTS ',I8,' WORDS.'
1 /' ONLY ',I8,' ARE AVAILABLE. INCREASE MAXCOR')
END IF
CALL ZERO(IZ,ITOP)
C
CALL GETDRT(IZ(KADD),IZ(LADD),IZ(IJADD),IZ(IJGRP),IZ(ORBTBF),
1IZ(IOUT),IZ(ORBSYM),IZ(JCODE),NGROUP)
CALL ALLOC(IZ(ORBTBF),IZ(JCODE),IZ(IJORD),IZ(IOFF),IZ(IJDEP))
C
IF (ITCSCF .EQ. 1) IJIND=IJIND+2
IJIND2=IJIND
IJIND3=IJIND2+NDF
C
C READ IN DATA FOR SHELL TYPES
C
CALL WREADW(IT47,FOCC,INTOWP(5),IA47(104),JUNK)
CALL WREADW(IT47,NSORB,5,IA47(105),JUNK)
WRITE(ICHK,1050) (FOCC(III), III=1,5), (NSORB(JJJ),JJJ=1,5)
1050 FORMAT(/' FOCC:',5F5.3/' NSORB:',5I5)
CALL REGIST
C
C ALLOCATE CORE FOR PRELIMINARY ARRAYS
C
EIG = IADTWP(ITOP)
CTJL EIG=1
OCC=EIG+NORBS
ALPHA=OCC+NORBS
BETA=ALPHA+NUMIJ
EPS=BETA+NUMIJ
VEC=EPS+NUMIJ
SCR=VEC+NORBS*NORBS
TOP=SCR+NORBS*NORBS
CALL ZERO(Z(EIG),TOP-EIG)
C
C GET SOME ARRAYS FROM IT47 AND ROTATE TO DRT ORDER
C
CALL READ47(IA47,IZ(IOFF),IZ(DROL),IZ(ORBTBF),Z(EIG),Z(OCC),
1Z(ALPHA),Z(BETA),Z(EPS),Z(VEC),Z(SCR))
C
C GET DERIVATIVE INTEGRALS FROM TAPE42; TRANSFORM TO MO BASIS
C
SS=SCR
SCR1=SS+NUMIJ
SCR2=SCR1+NUMIJ
BUF=SCR2+NUMIJ
ITOP=BUF+NDF*NUMIJ*NBSET
IF (ITOP .GT. MAXCOR) THEN
WRITE(NOUT,1020) ITOP,MAXCOR
CALL MABORT
1020 FORMAT(/' REQUIRE ',I8,' WORDS OF CORE FOR DERMAT.'
1 /' ONLY ',I8,' WORDS ARE AVAILABLE.')
END IF
CALL ZERO(Z(SS),ITOP-SS)
IF(ITCSCF.EQ.1) THEN
CALL DRMAT2(Z(VEC),Z(SCR1),Z(SCR2),Z(SS),Z(BUF),Z(BUF),
1IZ(IOFF),IZ(JT1C))
ELSE
CALL DERMAT(Z(VEC),Z(SCR1),Z(SCR2),Z(SS),Z(BUF),Z(BUF),
1IZ(IOFF),IZ(JT1C))
END IF
C
C CONSTRUCT DERIV FOCK MATRIX
C
CTJL EPA=VEC
EPA=SS
C
C LSTEPA IS FOR THE NBSET DERIV LAGRANGIAN FOR CI FIRST
C (LENGTH NUMIJ)
C
CTJL
NEPA = EPA
C IF(ITCSCF.EQ.1) THEN
HA11 = EPA
HA22 = HA11 + NDF
HA12 = HA22 + NDF
EPA = HA12 + NDF
C END IF
CTJL
LSTEPA=EPA
TA=EPA+NORBS*NORBS
HA=TA+NUMIJ
BUF=HA+NUMIJ
ITOP=BUF+NBSET*NUMIJ
CALL ZERO(Z(NEPA),ITOP-NEPA)
C
C IF TCSCF-CI GRADIENT CALCULATION CALL FAMAT2.
C
IF(ITCSCF.EQ.1) THEN
CALL FAMAT2(Z(EPA),Z(TA),Z(HA),Z(BUF),IZ(IOFF),IZ(JT1C),
1 IZ(IOUT),IZ(DROL),Z(LSTEPA),Z(ALPHA),Z(BETA))
CALL HAMAT(Z(HA),Z(BUF),IZ(IOFF),IZ(JT1C),IZ(IOUT),IZ(DROL),
1 Z(HA11),Z(HA22),Z(HA12))
ELSE
CALL FAMAT(Z(EPA),Z(TA),Z(HA),Z(BUF),IZ(IOFF),IZ(JT1C),
1 IZ(IOUT),IZ(DROL),Z(LSTEPA))
END IF
C
C CONSTRUCT A AND B0 MATRICIES IN 'CC' AND SOLVE A*U=B0
C
C
C THE EXTRA ARRAYS ECIJA(NUMIJ,NDF),BOX(NDF),X(NDF)
C ARE ALLOCATED FOR CONVENIENCE OVER THE TOP OF SOME OF THESE
C ARRAYS FOR CI FIRST
C ( U(NORBS,NORBS) IS STILL UNUSED IN CI FIRST)
C
CTJL LG=EPA
CTJL U=LG+NORBS*NORBS
CTJL SS=U+NORBS*NORBS
CTJL W=SS+NUMIJ*NDF
CTJL ECIJA=W
CTJL BOX=W+NUMIJ*NDF
CTJL X=W
CTJL
EX = EPA + NORBS*NORBS
EX2 = EX + IJIND
RS = EX2 + IJIND
EAVF = RS + (NUMDEP)*NDF
DIP = EAVF + NUMIJ
U = DIP + NUMIJ*3
CTJL
CTJL U=EPA+NORBS*NORBS
LG=U
SS=LG+NORBS*NORBS
W=SS+NUMIJ*NDF
BOX=W
X=BOX+NDF
ZETA=W+NORBS*NORBS*NDF
CC=ZETA+NUMIJ*NORBS
C=CC+IJIND*IJIND
INTS=CC+IJIND*IJIND3
BUF=INTS+NMAX
E11=BUF+NORBS*NORBS
E22=E11+NORBS*NORBS
E12=E22+NORBS*NORBS
ITOP=E12+NORBS*NORBS
IF (ITOP .GT. MAXCOR) THEN
WRITE(NOUT,1030) ITOP,MAXCOR
CALL MABORT
1030 FORMAT(/' PROGRAM REQUESTED ',I8,' WORDS BEFORE B0MAT.'
1 /' THERE ARE ONLY ',I8,' WORDS AVAILABLE.')
END IF
CTJL
CALL ZERO(Z(EX),ITOP-EX)
CTJL
CALL B0MAT(Z(ALPHA),Z(BETA),Z(EPS),Z(EPA),Z(U),Z(SS),Z(W),
1Z(ZETA),Z(CC),Z(OCC),Z(EIG),Z(INTS),Z(BUF),IZ(IJORD),IZ(IOFF),
2IZ(KADD),IZ(LADD),IZ(IJGRP),IZ(IJADD),IZ(ORBSYM),IZ(ORBTBF),
3IZ(JCODE),IZ(JT1C),Z(E11),Z(E22),Z(E12),Z(LG),Z(BOX),
4Z(C),Z(X),IZ(IOUT),Z(EX),Z(RS),IZ(IJDEP),Z(VEC),Z(DIP),Z(EAVF),
5Z(LSTEPA),Z(EX2),Z(HA11),Z(HA22),Z(HA12))
IF (ICIT.EQ.2.OR.ICIT.EQ.4) RETURN
U=1
W=U+NORBS*NORBS*NDF
EPA=U
SA=EPA+NORBS*NORBS*NDF
UAWB=W+NORBS*NORBS*NDF
SAEB=UAWB+NDF*NDF
DTOT=SAEB+NDF*NDF
ITOP=DTOT+NDF*NDF
IF (ITOP .GT. MAXCOR) THEN
WRITE(NOUT,1031) ITOP,MAXCOR
1031 FORMAT(/' FOR FINAL ',I8,' WORDS ARE REQUIRED.'
1 /' ONLY ',I8,' WORDS AVAILABLE.')
CALL MABORT
END IF
CALL ZERO(Z,ITOP)
CALL FINAL(Z(U),Z(W),Z(EPA),Z(SA),Z(UAWB),Z(SAEB),Z(DTOT),
1IZ(JT1C),IZ(IOFF))
RETURN
END
SUBROUTINE REGIST
IMPLICIT INTEGER (A-Z)
REAL*8 FOCC
COMMON /TAPES/ NOUT,ICHK,IT30,IT42,IT47,IT52,IT58,IT94,IT96,IT98
COMMON /DIMSG/ SYMORB,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 /OCCS/ NSPE,NSA,NSB,NALP,NOP,NDOC,LFERM,NUOC,IJIND,IJIND3
C
CTJL WRITE(ICHK,2222)
C2222 FORMAT(/' IN REGIST')
IPOINT(1)=IOCC+1
JPOINT(1)=1
DO 10 I=2,NTYPES+1
JPOINT(I)=JPOINT(I-1)+NSORB(I-1)
10 IPOINT(I)=IPOINT(I-1)+NSORB(I)
IT1=NTYPES+1
WRITE(*,101)
WRITE(*,99) (IPOINT(I), I=1,IT1)
WRITE(*,102)
WRITE(*,99) (JPOINT(I), I=1,IT1)
99 FORMAT(2X,5I5)
101 FORMAT(' THE IPOINT ARRAY:')
102 FORMAT(' THE JPOINT ARRAY:')
RETURN
END
SUBROUTINE MOCONV(SA,NNA,SM,NNM,EAO,U,T)
IMPLICIT REAL*8 (A-H,O-Z)
INTEGER P,Q,PQ
DIMENSION SA(NNA),SM(NNM),EAO(NBF,NORBS),U(NORBS),T(NNA)
COMMON /DIMSG/ ISYMRB,NUMIJ,NBF,NMAX,NBFORB,NSYM,NDF,NORBS
C
A0=0.0D+00
A1=1.0D+00
A1S2=0.50D+00
DO 101 IJ=1,NNA
101 T(IJ)=SA(IJ)
DO 102 IJ=1,NNM
102 SM(IJ)=A0
C
PQ=0
DO 40 P=1,NBF
DO 5 II=1,NORBS
5 U(II)=A0
E=A1
DO 20 Q=1,P
PQ=PQ+1
IF (P .EQ. Q) E=A1S2
F=T(PQ)*E
DO 10 J=1,NORBS
10 U(J)=U(J)+EAO(Q,J)*F
20 CONTINUE
IJ=0
DO 30 I=1,NORBS
U1I=U(I)
DO 25 J=1,I
IJ=IJ+1
SM(IJ)=SM(IJ)+U1I*EAO(P,J)+U(J)*EAO(P,I)
25 CONTINUE
30 CONTINUE
40 CONTINUE
RETURN
END
SUBROUTINE READ47(IA47,IOFF,DROL,ORBTBF,EIG,OCC,ALPHA,BETA,
1EPS,VEC,SCR)
IMPLICIT REAL*8 (A-H,O-Z)
INTEGER IOFF(NUMIJ),ORBTBF(NORBS),IA47(192),DROL(NORBS),IREP(2)
DIMENSION EIG(NORBS),OCC(NORBS),ALPHA(NUMIJ),BETA(NUMIJ)
DIMENSION EPS(NUMIJ),VEC(NORBS,NORBS),SCR(2,NORBS)
EQUIVALENCE (IREP(1),REPN)
COMMON /REN/ REPNUC
COMMON /TAPES/ NOUT,ICHK,IT30,IT42,IT47,IT52,IT58,IT94,IT96,IT98
COMMON /DIMSG/ ISYMRB,NUMIJ,NBF,NMAX,NBFORB,NSYM,NDF,NORBS
COMMON /IEXT/ IPRINT,IGRP,ICIDIP
C
C READ DATA FROM IT47
CTJL WRITE(ICHK,2222)
C2222 FORMAT(/' IN READ47')
IREP(1)=IA47(12)
IREP(2)=IA47(13)
REPNUC=REPN
WRITE(ICHK,3333)REPNUC
WRITE(NOUT,3333) REPNUC
3333 FORMAT(/' THE NUCLEAR REPULSION ENERGY FROM TAPE47 =',F20.10)
CALL WREADW(IT47,EIG,INTOWP(NORBS),IA47(103),JUNK)
IF (IAND(IPRINT,2) .NE. 0) THEN
WRITE(NOUT,101) 'EIG '
WRITE(NOUT,102) (EIG(III),III=1,NORBS)
END IF
C
CALL WREADW(IT47,ALPHA,INTOWP(NUMIJ),IA47(106),JUNK)
IF (IAND(IPRINT,2) .NE. 0) THEN
WRITE(NOUT,101) 'ALPHA'
CALL PRINT(ALPHA,NUMIJ,NORBS,NOUT)
END IF
C
CALL WREADW(IT47,BETA,INTOWP(NUMIJ),IA47(107),JUNK)
IF (IAND(IPRINT,2) .NE. 0) THEN
WRITE(NOUT,101) 'BETA '
CALL PRINT(BETA,NUMIJ,NORBS,NOUT)
END IF
C
NORBSQ=NORBS*NORBS
CALL WREADW(IT47,VEC,INTOWP(NORBSQ),IA47(110),JUNK)
IF (IAND(IPRINT,2) .NE. 0) THEN
WRITE(NOUT,101) 'VEC '
CALL MATOUT(VEC,NORBS,NORBS,NORBS,NORBS,NOUT)
END IF
C
CALL WREADW(IT47,EPS,INTOWP(NUMIJ),IA47(111),JUNK)
IF (IAND(IPRINT,2) .NE. 0) THEN
WRITE(NOUT,101) 'EPS '
CALL PRINT(EPS,NUMIJ,NORBS,NOUT)
END IF
C
CALL WREADW(IT47,SCR,INTOWP(2*NORBS),IA47(113),JUNK)
DO 301 I=1,NORBS
301 OCC(I)=SCR(1,I)+SCR(2,I)
IF (IAND(IPRINT,2) .NE. 0) THEN
WRITE(NOUT,101) 'OCC '
WRITE(NOUT,102) (OCC(III),III=1,NORBS)
END IF
C
CALL WREADW(IT47,DROL,NORBS,IA47(117),JUNK)
IF (IAND(IPRINT,2) .NE. 0) THEN
WRITE(NOUT,101) ' DROL '
WRITE(NOUT,104) (DROL(III),III=1,NORBS)
WRITE(NOUT,*) ' ORBTBF ',ORBTBF
END IF
C
C RE-ORDER TO DRT ORDERING
CALL ORDER(EIG,SCR,ORBTBF)
IF (IAND(IPRINT,2) .NE. 0) THEN
WRITE(NOUT,103) 'EIG '
WRITE(NOUT,102) (EIG(III),III=1,NORBS)
END IF
C
CALL ORDER(OCC,SCR,ORBTBF)
IF (IAND(IPRINT,2) .NE. 0) THEN
WRITE(NOUT,103) 'OCC '
WRITE(NOUT,102) (OCC(III),III=1,NORBS)
END IF
C
CALL ORDER1(ALPHA,SCR,IOFF,ORBTBF)
IF (IAND(IPRINT,2) .NE. 0) THEN
WRITE(NOUT,103) 'ALPHA'
CALL PRINT(ALPHA,NUMIJ,NORBS,NOUT)
END IF
C
CALL ORDER1(BETA,SCR,IOFF,ORBTBF)
IF (IAND(IPRINT,2) .NE. 0) THEN
WRITE(NOUT,103) 'BETA '
CALL PRINT(BETA,NUMIJ,NORBS,NOUT)
END IF
C
CALL ORDER2(VEC,SCR,ORBTBF)
IF (IAND(IPRINT,2) .NE. 0) THEN
WRITE(NOUT,103) 'VEC '
CALL MATOUT(VEC,NORBS,NORBS,NORBS,NORBS,NOUT)
END IF
C
101 FORMAT(3X,A5,' ARRAY AS READ FROM TAPE47:')
102 FORMAT(5F15.6)
103 FORMAT(3X,A5,' ARRAY AFTER RE-ORDERING TO DRT:')
104 FORMAT(10I5)
RETURN
END
SUBROUTINE ORDER(A,SCR,ORBTBF)
IMPLICIT REAL*8 (A-H,O-Z)
INTEGER ORBTBF(NORBS)
DIMENSION A(NORBS),SCR(NORBS)
COMMON /DIMSG/ ISYMRB,NUMIJ,NBF,NMAX,NBFORB,NSYM,NDF,NORBS
C
DO 101 I=1,NORBS
SCR(I)=A(I)
101 A(I)=0.0D+00
C
DO 102 IOR=1,NORBS
IBF=ORBTBF(IOR)
CTJL
CTJL WRITE(*,*) ' IOR,IBF ',IOR,IBF
102 A(IOR)=SCR(IBF)
RETURN
END
SUBROUTINE ORDER1(A,SCR,IOFF,ORBTBF)
IMPLICIT REAL*8 (A-H,O-Z)
DIMENSION A(NUMIJ),SCR(NUMIJ)
INTEGER ORBTBF(NORBS),IOFF(NUMIJ)
COMMON /DIMSG/ ISYMRB,NUMIJ,NBF,NMAX,NBFORB,NSYM,NDF,NORBS
C
DO 101 IJ=1,NUMIJ
SCR(IJ)=A(IJ)
101 A(IJ)=0.0D+00
C
IJ=0
DO 102 IOR=1,NORBS
IBF=ORBTBF(IOR)
DO 102 JOR=1,IOR
IJ=IJ+1
JBF=ORBTBF(JOR)
IBM=MAX0(IBF,JBF)
JBM=MIN0(IBF,JBF)
IJBF=IOFF(IBM)+JBM
102 A(IJ)=SCR(IJBF)
RETURN
END
SUBROUTINE ORDER2(A,SCR,ORBTBF)
IMPLICIT REAL*8 (A-H,O-Z)
DIMENSION A(NORBS,NORBS),SCR(NORBS,NORBS)
INTEGER ORBTBF(NORBS)
COMMON /DIMSG/ ISYMRB,NUMIJ,NBF,NMAX,NBFORB,NSYM,NDF,NORBS
C
DO 101 I=1,NORBS
DO 101 J=1,NORBS
SCR(I,J)=A(I,J)
101 A(I,J)=0.0D+00
C
DO 102 IOR=1,NORBS
IBF=ORBTBF(IOR)
DO 102 J=1,NORBS
102 A(J,IOR)=SCR(J,IBF)
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
SUBROUTINE SAMAT(SA,NNA,SS,NNM,VEC,IOFF,U,T,JT1C)
IMPLICIT REAL*8 (A-H,O-Z)
DIMENSION SA(NNA,NDF),SS(NNM),VEC(NORBS,NORBS),U(1),T(1)
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
DATA ZERO,ONE / 0.0D+00 , 1.0D+00 /
1 FORMAT(//,2X,' SA (MO BASIS) MATRIX, IABC = ',I5,' IXYZ = ',I5/)
C
C TRANSFORM SA INTEGRALS FROM AO TO MO BASIS
WRITE(ICHK,2222)
2222 FORMAT(/' IN SAMAT')
IS=1
KABC=0
IF (IAND(IPRINT,4) .NE. 0) THEN
DO 1010 IABC=1,3
WRITE(NOUT,1011) IABC
1011 FORMAT(/' THE S MATRIX AS READ FROM 42 FOR XYZ = ',I5)
CALL PRINT(SA(1,IABC),NUMIJ,NORBS,NOUT)
1010 CONTINUE
WRITE(NOUT,1012) (IBF2AT(III), III=1,NORBS)
1012 FORMAT(/' IBF2AT:',10I5)
END IF
C
DO 105 IABC=1,NAT
DO 104 IXYZ=1,3
KABC=KABC+1
C
DO 101 I=1,NUMIJ
101 SS(I)=ZERO
C
DO 103 I=1,NORBS
IA=IOFF(I)
DO 102 J=1,I
IF(IBF2AT(I).NE.IABC.AND.IBF2AT(J).NE.IABC)
* GO TO 102
IJ=IA+J
SX=SA(IJ,IXYZ)
IF(IBF2AT(I).NE.IABC) SX=-SX
SS(IJ)=SX
102 CONTINUE
103 CONTINUE
C
IF (IAND(IPRINT,4) .NE. 0) THEN
WRITE(NOUT,1001) KABC
1001 FORMAT(/' THE SA MATRIX FOR DEGREE OF FREEDOM',I5)
CALL PRINT(SS,NUMIJ,NORBS,NOUT)
END IF
C
CALL MOCONV(SS,NNM,SS,NNM,VEC,U,T)
JT1C(KABC)=IS
CALL WWRITW(IT94,SS,INTOWP(NUMIJ),IS,IS)
C
IF (IAND(IPRINT,4) .NE. 0) THEN
WRITE(NOUT,1002) KABC
1002 FORMAT(/' THE SM MATRIX FOR DEGREE OF FREEDOM',I5)
CALL PRINT(SS,NUMIJ,NORBS,NOUT)
WRITE(NOUT,1003) KABC,JT1C(KABC),IS
1003 FORMAT(/' MO S MATRIX ',I5,' WRITTEN TO POSITION ',I8,' N
*EXT POSITION ',I8)
END IF
104 CONTINUE
105 CONTINUE
C
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)
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 /CALCJ/ ICALT,IDERT,ICIT
C
WRITE(ICHK,2222)
2222 FORMAT(/' IN FAMAT')
NORBSQ=NORBS*NORBS
IHA=JT1C(NDF+1)
IEA=2*NDF+NBSET*NDF
ISEA=JT1C(IEA)+INTOWP(NUMIJ)
DO 1 IDF=1,NDF
IEA=IEA+1
DO 10 I=1,NORBS
DO 10 J=1,NORBS
10 EPA(I,J)=0.0D+00
C
CALL WREADW(IT94,HA,INTOWP(NUMIJ),IHA,IHA)
IF (IAND(IPRINT,32) .NE. 0) THEN
WRITE(NOUT,1101) IDF,IHA
1101 FORMAT(/' HA FOR DEGREE OF FREEDOM ',I5,' IHA=',I8)
CALL PRINT(HA,NUMIJ,NORBS,NOUT)
END IF
DO 2 IBSET=1,NBSET
ITA=2*NDF+(IBSET-1)*NDF+IDF
CALL WREADW(IT94,TA,INTOWP(NUMIJ),JT1C(ITA),JUNK)
IF (IAND(IPRINT,32) .NE. 0) THEN
WRITE(NOUT,1102) IDF,ITA,JT1C(ITA)
1102 FORMAT(/' TA FOR DEGREE ',I5,' ITA=',I8,' JT1C=',I8)
CALL PRINT(TA,NUMIJ,NORBS,NOUT)
END IF
F=FOCC(IBSET)/(2.0D+00)
CTJL WRITE(*,*) ' NBSET,OCC ',IBSET,FOCC(IBSET)
DO 2 J=1,NUMIJ
CTJL BUF(J,IBSET)=TA(J)
BUF(J,IBSET)=HA(J)*F+TA(J)
C IF(IDF.EQ.1.OR.IDF.EQ.3.AND.IBSET.EQ.2.OR.IBSET.EQ.3) THEN
C IF(BUF(J,IBSET).GT.1.0D-6) THEN
C WRITE(*,*) ' J,IDF ',J,IDF
C WRITE(*,*) ' H,F,T,EA ',HA(J),F,TA(J),BUF(J,IBSET)
C END IF
C END IF
2 CONTINUE
C
DO 3 ITYP=1,NTYPES
IMIN=JPOINT(ITYP)
IMAX=JPOINT(ITYP+1)-1
CTJL IF(IDF.EQ.1) THEN
CTJL WRITE(*,*) ' ITYP,IMIN,IMAX ',ITYP,IMIN,IMAX
CTJL END IF
DO 3 IYY=IMIN,IMAX
IBF=DROL(IYY)
IORB=IOUT(IBF)
DO 3 JYY=1,NORBS
JBF=DROL(JYY)
JORB=IOUT(JBF)
CTJL IF(IDF.EQ.1) THEN
CTJL WRITE(*,*) ' IBF,IORB,JBF,JORB ',IBF,IORB,JBF,JORB
CTJL END IF
IJMN=MIN0(IORB,JORB)
IJMX=MAX0(IORB,JORB)
IJ=IOFF(IJMX)+IJMN
C3 EPA(IORB,JORB)=BUF(IJ,ITYP)
EPA(IORB,JORB)=BUF(IJ,ITYP)
C IF(IDF.EQ.1.OR.IDF.EQ.3.AND.ITYP.EQ.2.OR.ITYP.EQ.3) THEN
C IF(EPA(IORB,JORB).GT.1.0D-6) THEN
C WRITE(*,*) ' IDF,I,J,EPA ',IDF,IORB,JORB,EPA(IORB,JORB)
C END IF
C END IF
3 CONTINUE
C
JT1C(IEA)=ISEA
CALL WWRITW(IT94,EPA,INTOWP(NORBS*NORBS),ISEA,ISEA)
IF (IAND(IPRINT,32) .NE. 0) THEN
WRITE(NOUT,1103) IDF,IEA,JT1C(IEA)
1103 FORMAT(/' EPA FOR DEGREE ',I5,' IEA=',I8,' JT1C=',
* I8)
CALL MATOUT(EPA,NORBS,NORBS,NORBS,NORBS,NOUT)
END IF
1 CONTINUE
C
C CODE FOR NBSET EPA FOR CI FIRST
C
CTJL IF (ICIT.EQ.1) RETURN
CALL RFILE(IT96)
ISEA=1
IADHA=JT1C(NDF+1)
IADTA=JT1C(2*NDF+(NBSET-1)*NDF+1)
DO 312 IDF=1,NDF
CALL WREADW(IT94,HA,INTOWP(NUMIJ),IADHA,IADHA)
CALL WREADW(IT94,TA,INTOWP(NUMIJ),IADTA,IADTA)
DO 311 IJ=1,NUMIJ
LSTEPA(IJ)=HA(IJ)+TA(IJ)
C
311 CONTINUE
CTJL WRITE(*,*) ' IN FAMAT; ISEA = ',ISEA,' BEFORE'
CALL WWRITW(IT96,LSTEPA,INTOWP(NUMIJ),ISEA,ISEA)
CTJL WRITE(*,*) ' IN FAMAT; ISEA = ',ISEA,' AFTER '
IF (IAND(IPRINT,32) .NE. 0) THEN
CTJL IF (IDF.EQ.1) THEN
WRITE(NOUT,1104) IDF
1104 FORMAT(/' LSTEPA FOR DEGREE ',I5)
CALL PRINT(LSTEPA,NUMIJ,NORBS,NOUT)
END IF
312 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 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