C 11 APR 08 - MWS - ECPPAR: CORRECTLY COPY "NONE" TO ANOTHER ATOM.
C 19 SEP 05 - MWS - KILL H OR I FUNCTION RUNS
C  5 JUL 05 - MWS - SELECT NEW ATOM,BASIS,EFP,PCM,DAF DIMENSIONS
C 13 FEB 05 - MWS - PAD COMMON BLOCK NSHEL
C  9 DEC 03 - MWS - SYNCH COMMON BLOCK RUNOPT
C 26 MAR 03 - JMS - EXTENSIVE REWRITING
C 26 MAR 02 - MWS - ECPPAR: TRAP ECP JOBS WITH NO CORE POTENTIALS
C 25 OCT 01 - MK  - ECPPAR: MODEL CORE POTENTIAL INTERFACING
C 11 JUN 00 - MWS - ECCPAR: PRINT ADJUSTED ELECTRON COUNTS
C 13 MAR 99 - MWS - ECPPAR: FIX LENGTH OF INTEGER DAF RECORDS
C  5 JAN 99 - MWS - CHANGE ECP SPELLING FROM SBK TO SBKJC
C  1 DEC 98 - BMB - COMPLETE REWRITE OF ECP CODE-MANY FUNCTIONS CHANGED
C 10 NOV 94 - MWS - REMOVE FTNCHEK WARNINGS
C 31 MAY 95 - MWS - ECCODR,ECPPAR: USE DERCHK CALL
C 29 MAR 95 - MWS - CHECK AGAINST IMPROPER F GRADIENT USE
C 11 AUG 94 - BMB - FIXED MEMORY OVERFLOW BUG IN ECCODR
C 10 AUG 94 - MWS - INCREASE NUMBER OF DAF RECORDS
C 26 JUL 93 - BMB - CHANGED HOW DYNAMIC MEMORY ARRAYS ARE REFERENCED
C 11 JUN 93 - BMB - MODIFIED TO INCLUDE THE LANTHANIDES & F-FUNCTIONS
C 10 NOV 92 - MK  - INTERFACE TO HONDO, MELDF, GAUSSIAN, GAMESS-UK
C 20 MAR 92 - MWS - CLEAN UP /COD*EC/ COMMONS
C 12 MAR 92 - MWS - REDIMENSION TO 500 ATOMS
C 20 FEB 92 - TLW - ECPPAR: ADD CALL TO FNDGRP
C 11 JAN 92 - TLW - ECPPAR: MAKE READS PARALLEL
C 10 JAN 92 - TLW - CHANGE REWIND TO CALL SEQREW
C  4 JAN 92 - TLW - MAKE WRITE PARALLEL;ADD COMMON PAR
C 24 MAY 91 - MWS - ECPPAR: ADD HEAVY ELEMENT SBKJC DEFINITIONS
C 25 FEB 91 - MWS - ECPPAR: FIX COPYING OF POTENTIALS
C 10 OCT 90 - MWS - ECPPAR: FIX HW 2ND TRANS. SERIES TYPO
C 12 SEP 90 - TRC - MAKE $ECP FREE FORMAT, CHECK RUNS SKIP ENCODING
C 19 JUN 90 - MWS - FIX REMOVAL OF CORE ELECTRONS WHEN $ECP GIVEN
C  4 DEC 89 - KAN - INITIALIZATION AND UTILITY ROUTINES FOR ECP CODE.
C*MODULE ECPLIB  *DECK DAWERT
      SUBROUTINE DAWERT
C
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
C        -----  ROUTINE ALLOCATES PARAMETERS SPECIFYING THE     -----
C        -----  PIECEWISE CHEBYCHEV POLYNOMIAL FIT TO THE       -----
C        -----  DAWSON-ERROR FUNCTION.                          -----
C
      COMMON /DERFCM/ C(246),IFRST(40),ILAST(40),H
C
      H = 0.25D+00
C ... 0.00 < X <= 0.25  INTERVAL NO. 1, ABS.ERROR = 3.0831115438446D-
      IFRST( 1)= 1
      ILAST( 1)= 8
      C( 1)=-0.2227673357873D-15
      C( 2)=-0.3603041588494D-08
      C( 3)= 0.5641900599881D+00
      C( 4)=-0.1855716761667D-04
      C( 5)=-0.3758028089842D+00
      C( 6)=-0.2937263239086D-02
      C( 7)= 0.1586735773807D+00
      C( 8)=-0.3712362707925D-01
C ... 0.25 < X <= 0.50  INTERVAL NO. 2, ABS.ERROR = 1.6200374375330D-
      IFRST( 2)= 9
      ILAST( 2)=16
      C( 9)= 0.1654923320373D-05
      C(10)=-0.4283673776908D-04
      C(11)= 0.5646780085194D+00
      C(12)=-0.3216632920741D-02
      C(13)=-0.3626661648377D+00
      C(14)=-0.3697874666458D-01
      C(15)= 0.2103001701512D+00
      C(16)=-0.7233313577516D-01
C ... 0.50 < X <= 0.75  INTERVAL NO. 3, ABS.ERROR = 2.6527224861184D-
      IFRST( 3)=17
      ILAST( 3)=24
      C(17)=-0.4909038422764D-03
      C(18)= 0.6169678713757D-02
      C(19)= 0.5309521767077D+00
      C(20)= 0.9902446632012D-01
      C(21)=-0.5497719612405D+00
      C(22)= 0.1699289458172D+00
      C(23)= 0.8215358267937D-01
      C(24)=-0.3800879631724D-01
C ... 0.75 < X <= 1.00  INTERVAL NO. 4, ABS.ERROR = 2.1188384380366D-
      IFRST( 4)=25
      ILAST( 4)=32
      C(25)=-0.8860184581188D-02
      C(26)= 0.8182679610811D-01
      C(27)= 0.2361899484096D+00
      C(28)= 0.7408443731368D+00
      C(29)=-0.1393552470603D+01
      C(30)= 0.8398504617092D+00
      C(31)=-0.2153157176716D+00
      C(32)= 0.1898293835776D-01
C ... 1.00 < X <= 1.25  INTERVAL NO. 5, ABS.ERROR = 1.0054179711005D-
      IFRST( 5)=33
      ILAST( 5)=40
      C(33)=-0.2622864777452D-01
      C(34)= 0.2070481292278D+00
      C(35)=-0.1517729522946D+00
      C(36)= 0.1410375745664D+01
      C(37)=-0.2088589931697D+01
      C(38)= 0.1273821623264D+01
      C(39)=-0.3662054027830D+00
      C(40)= 0.4151758125850D-01
C ... 1.25 < X <= 1.50  INTERVAL NO. 6, ABS.ERROR = 1.2743583965857D-
      IFRST( 6)=41
      ILAST( 6)=48
      C(41)= 0.7652753217902D-01
      C(42)=-0.3496979906426D+00
      C(43)= 0.1142731303255D+01
      C(44)=-0.2641065409391D+00
      C(45)=-0.7870989692331D+00
      C(46)= 0.6659477061060D+00
      C(47)=-0.2082257760423D+00
      C(48)= 0.2389272621700D-01
C ... 1.50 < X <= 1.75  INTERVAL NO. 7, ABS.ERROR = 3.2651215065016D-
      IFRST( 7)=49
      ILAST( 7)=55
      C(49)= 0.4634935721533D+00
      C(50)=-0.2162775089324D+01
      C(51)= 0.4787745789535D+01
      C(52)=-0.4340108008393D+01
      C(53)= 0.1951017416635D+01
      C(54)=-0.4390388356211D+00
      C(55)= 0.3981846570969D-01
C ... 1.75 < X <= 2.00  INTERVAL NO. 8, ABS.ERROR = 8.9706020389713D-
      IFRST( 8)=56
      ILAST( 8)=63
      C(56)= 0.9892135872598D+00
      C(57)=-0.4311631180681D+01
      C(58)= 0.8556855041877D+01
      C(59)=-0.8017503990110D+01
      C(60)= 0.4106390132111D+01
      C(61)=-0.1197913275632D+01
      C(62)= 0.1884269501482D+00
      C(63)=-0.1248598098755D-01
C ... 2.00 < X <= 2.25  INTERVAL NO. 9, ABS.ERROR = 3.1388225352202D-
      IFRST( 9)=64
      ILAST( 9)=71
      C(64)= 0.4508582229747D+00
      C(65)=-0.2475021032343D+01
      C(66)= 0.5870952943693D+01
      C(67)=-0.5834804573043D+01
      C(68)= 0.3041872702481D+01
      C(69)=-0.8863349469112D+00
      C(70)= 0.1377496059452D+00
      C(71)=-0.8952617645264D-02
C ... 2.25 < X <= 2.50  INTERVAL NO.10, ABS.ERROR = 3.5207392556913D-
      IFRST(10)=72
      ILAST(10)=78
      C(72)=-0.2479150925527D+01
      C(73)= 0.6465442349154D+01
      C(74)=-0.5832144628726D+01
      C(75)= 0.2684557558935D+01
      C(76)=-0.6830155078836D+00
      C(77)= 0.9186854104822D-01
      C(78)=-0.5120121563474D-02
C ... 2.50 < X <= 2.75  INTERVAL NO.11, ABS.ERROR = 1.5842438472191D-
      IFRST(11)=79
      ILAST(11)=85
      C(79)=-0.2550246682056D+01
      C(80)= 0.6663085650406D+01
      C(81)=-0.6057008239737D+01
      C(82)= 0.2819123791215D+01
      C(83)=-0.7278168845029D+00
      C(84)= 0.9975271609922D-01
      C(85)=-0.5693960934877D-02
C ... 2.75 < X <= 3.00  INTERVAL NO.12, ABS.ERROR = 2.1390000881638D-
      IFRST(12)=86
      ILAST(12)=92
      C(86)=-0.1437322524459D+01
      C(87)= 0.4244945032011D+01
      C(88)=-0.3866819653025D+01
      C(89)= 0.1760657886042D+01
      C(90)=-0.4399493394691D+00
      C(91)= 0.5797869518089D-01
      C(92)=-0.3166941925883D-02
C ... 3.00 < X <= 3.25  INTERVAL NO.13, ABS.ERROR = 1.2176926134089D-
      IFRST(13)=93
      ILAST(13)=99
      C(93)= 0.4326982515539D-01
      C(94)= 0.1278541925538D+01
      C(95)=-0.1389457146276D+01
      C(96)= 0.6567745067205D+00
      C(97)=-0.1631568799154D+00
      C(98)= 0.2094831465123D-01
      C(99)=-0.1101922864715D-02
C ... 3.25 < X <= 3.50  INTERVAL NO.14, ABS.ERROR = 4.2543746303636D-
      IFRST(14)=100
      ILAST(14)=106
      C(100)= 0.1115286202567D+01
      C(101)=-0.7098356509943D+00
      C(102)= 0.1477452918517D+00
      C(103)= 0.2274875774917D-01
      C(104)=-0.1601072077271D-01
      C(105)= 0.2728999281923D-02
      C(106)=-0.1616695274909D-03
C ... 3.50 < X <= 3.75  INTERVAL NO.15, ABS.ERROR = 2.3193003073629D-
      IFRST(15)=107
      ILAST(15)=112
      C(107)= 0.1346851272697D+01
      C(108)=-0.1125834241251D+01
      C(109)= 0.4583884751028D+00
      C(110)=-0.1007033665315D+00
      C(111)= 0.1153266357142D-01
      C(112)=-0.5427038297057D-03
C ... 3.75 < X <= 4.00  INTERVAL NO.16, ABS.ERROR = 2.6108004647085D-
      IFRST(16)=113
      ILAST(16)=118
      C(113)= 0.1220883963156D+01
      C(114)=-0.9581085557663D+00
      C(115)= 0.3690371210149D+00
      C(116)=-0.7689811239270D-01
      C(117)= 0.8360797545174D-02
      C(118)=-0.3736140672117D-03
C ... 4.00 < X <= 4.25  INTERVAL NO.17, ABS.ERROR = 1.7570833676928D-
      IFRST(17)=119
      ILAST(17)=124
      C(119)= 0.1079863694049D+01
      C(120)=-0.7816343308043D+00
      C(121)= 0.2806819253411D+00
      C(122)=-0.5477512389825D-01
      C(123)= 0.5590565502644D-02
      C(124)=-0.2348302397877D-03
C ... 4.25 < X <= 4.50  INTERVAL NO.18, ABS.ERROR = 1.0521805648978D-
      IFRST(18)=125
      ILAST(18)=130
      C(125)= 0.9600857053756D+00
      C(126)=-0.6404875010594D+00
      C(127)= 0.2141383549717D+00
      C(128)=-0.3908625281056D-01
      C(129)= 0.3740753346938D-02
      C(130)=-0.1475725788623D-03
C ... 4.50 < X <= 4.75  INTERVAL NO.19, ABS.ERROR = 6.2718719107124D-
      IFRST(19)=131
      ILAST(19)=136
      C(131)= 0.8652746664820D+00
      C(132)=-0.5349723088368D+00
      C(133)= 0.1671594028443D+00
      C(134)=-0.2862620440719D-01
      C(135)= 0.2576075398247D-02
      C(136)=-0.9569143876433D-04
C ... 4.75 < X <= 5.00  INTERVAL NO.20, ABS.ERROR = 3.9639402871217D-
      IFRST(20)=137
      ILAST(20)=142
      C(137)= 0.7900679556534D+00
      C(138)=-0.4556957919175D+00
      C(139)= 0.1337277737706D+00
      C(140)=-0.2157594052042D-01
      C(141)= 0.1832563601783D-02
      C(142)=-0.6432286463678D-04
C ... 5.00 < X <= 5.25  INTERVAL NO.21, ABS.ERROR = 2.4784618801732D-
      IFRST(21)=143
      ILAST(21)=148
      C(143)= 0.7290302365904D+00
      C(144)=-0.3945841937680D+00
      C(145)= 0.1092502418252D+00
      C(146)=-0.1667318620030D-01
      C(147)= 0.1341496314853D-02
      C(148)=-0.4464581143111D-04
C ... 5.25 < X <= 5.50  INTERVAL NO.22, ABS.ERROR = 1.6431300764452D-
      IFRST(22)=149
      ILAST(22)=154
      C(149)= 0.6781821897825D+00
      C(150)=-0.3461064436915D+00
      C(151)= 0.9076079662805D-01
      C(152)=-0.1314681150288D-01
      C(153)= 0.1005173704471D-02
      C(154)=-0.3181374631822D-04
C ... 5.50 < X <= 5.75  INTERVAL NO.23, ABS.ERROR = 1.1222134332911D-
      IFRST(23)=155
      ILAST(23)=160
      C(155)= 0.6349563489690D+00
      C(156)=-0.3067739392218D+00
      C(157)= 0.7644326048783D-01
      C(158)=-0.1054063730153D-01
      C(159)= 0.7679506117711D-03
      C(160)=-0.2317563630640D-04
C ... 5.75 < X <= 6.00  INTERVAL NO.24, ABS.ERROR = 7.8559381222476D-
      IFRST(24)=161
      ILAST(24)=166
      C(161)= 0.5976075476333D+00
      C(162)=-0.2742701592908D+00
      C(163)= 0.6512719379650D-01
      C(164)=-0.8570613370193D-02
      C(165)= 0.5964515294181D-03
      C(166)=-0.1720313448459D-04
C ... 6.00 < X <= 6.25  INTERVAL NO.25, ABS.ERROR = 4.6252335295094D-
      IFRST(25)=167
      ILAST(25)=171
      C(167)= 0.4530821605957D+00
      C(168)=-0.1556937202255D+00
      C(169)= 0.2621052097467D-01
      C(170)=-0.2184050212463D-02
      C(171)= 0.7237572572194D-04
C ... 6.25 < X <= 6.50  INTERVAL NO.26, ABS.ERROR = 3.5389913222161D-
      IFRST(26)=172
      ILAST(26)=176
      C(172)= 0.4314398767018D+00
      C(173)=-0.1418342842259D+00
      C(174)= 0.2288200151943D-01
      C(175)=-0.1828741476402D-02
      C(176)= 0.5815166332468D-04
C ... 6.50 < X <= 6.75  INTERVAL NO.27, ABS.ERROR = 2.7426949600340D-
      IFRST(27)=177
      ILAST(27)=181
      C(177)= 0.4119346702408D+00
      C(178)=-0.1298244601295D+00
      C(179)= 0.2010878728234D-01
      C(180)=-0.1544113849832D-02
      C(181)= 0.4719618664240D-04
C ... 6.75 < X <= 7.00  INTERVAL NO.28, ABS.ERROR = 2.1502799540940D-
      IFRST(28)=182
      ILAST(28)=186
      C(182)= 0.3942461802274D+00
      C(183)=-0.1193370928285D+00
      C(184)= 0.1777693657917D-01
      C(185)=-0.1313662248549D-02
      C(186)= 0.3865502003464D-04
C ... 7.00 < X <= 7.25  INTERVAL NO.29, ABS.ERROR = 1.7034818000639D-
      IFRST(29)=187
      ILAST(29)=191
      C(187)= 0.3781177456714D+00
      C(188)=-0.1101165554215D+00
      C(189)= 0.1580007215659D-01
      C(190)=-0.1125279834923D-02
      C(191)= 0.3192276744812D-04
C ... 7.25 < X <= 7.50  INTERVAL NO.30, ABS.ERROR = 1.3624212868990D-
      IFRST(30)=192
      ILAST(30)=196
      C(192)= 0.3633408065001D+00
      C(193)=-0.1019602554247D+00
      C(194)= 0.1411174419289D-01
      C(195)=-0.9699476170226D-03
      C(196)= 0.2656330616446D-04
C ... 7.50 < X <= 7.75  INTERVAL NO.31, ABS.ERROR = 1.0990319765369D-
      IFRST(31)=197
      ILAST(31)=201
      C(197)= 0.3497439218126D+00
      C(198)=-0.9470569276499D-01
      C(199)= 0.1266017939918D-01
      C(200)=-0.8408550675085D-03
      C(201)= 0.2225784919574D-04
C ... 7.75 < X <= 8.00  INTERVAL NO.32, ABS.ERROR = 8.9381835266522D-
      IFRST(32)=202
      ILAST(32)=206
      C(202)= 0.3371845853069D+00
      C(203)=-0.8822105128463D-01
      C(204)= 0.1140456233287D-01
      C(205)=-0.7327946570967D-03
      C(206)= 0.1877023896668D-04
C ... 8.00 < X <= 8.25  INTERVAL NO.33, ABS.ERROR = 7.3210326689832D-
      IFRST(33)=207
      ILAST(33)=211
      C(207)= 0.3255431584494D+00
      C(208)=-0.8239832407718D-01
      C(209)= 0.1031237441518D-01
      C(210)=-0.6417393667562D-03
      C(211)= 0.1592339503986D-04
C ... 8.25 < X <= 8.50  INTERVAL NO.34, ABS.ERROR = 6.0371707633067D-
      IFRST(34)=212
      ILAST(34)=216
      C(212)= 0.3147180811939D+00
      C(213)=-0.7714810368023D-01
      C(214)= 0.9357439877093D-02
      C(215)=-0.5645414814808D-03
      C(216)= 0.1358301324217D-04
C ... 8.50 < X <= 8.75  INTERVAL NO.35, ABS.ERROR = 5.0113246885530D-
      IFRST(35)=217
      ILAST(35)=221
      C(217)= 0.3046231027165D+00
      C(218)=-0.7239608540250D-01
      C(219)= 0.8518560948886D-02
      C(220)=-0.4987218951555D-03
      C(221)= 0.1164632612927D-04
C ... 8.75 < X <= 9.00  INTERVAL NO.36, ABS.ERROR = 4.1842085352073D-
      IFRST(36)=222
      ILAST(36)=226
      C(222)= 0.2951839772317D+00
      C(223)=-0.6807982796391D-01
      C(224)= 0.7778392737741D-02
      C(225)=-0.4423078514719D-03
      C(226)= 0.1003385659715D-04
C ... 9.00 < X <= 9.25  INTERVAL NO.37, ABS.ERROR = 3.5125236053091D-
      IFRST(37)=227
      ILAST(37)=231
      C(227)= 0.2863364933588D+00
      C(228)=-0.6414655846973D-01
      C(229)= 0.7122648855400D-02
      C(230)=-0.3937177713169D-03
      C(231)= 0.8683627129358D-05
C ... 9.25 < X <= 9.50  INTERVAL NO.38, ABS.ERROR = 2.9645175203541D-
      IFRST(38)=232
      ILAST(38)=236
      C(232)= 0.2780246155388D+00
      C(233)=-0.6055132372497D-01
      C(234)= 0.6539470823348D-02
      C(235)=-0.3516734769846D-03
      C(236)= 0.7546893357357D-05
C ... 9.50 < X <= 9.75  INTERVAL NO.39, ABS.ERROR = 2.5142110615661D-
      IFRST(39)=237
      ILAST(39)=241
      C(237)= 0.2701996594546D+00
      C(238)=-0.5725581832360D-01
      C(239)= 0.6018987049956D-02
      C(240)=-0.3151372568482D-03
      C(241)= 0.6585092705791D-05
C ... 9.75 < X <= 10.0  INTERVAL NO.40, ABS.ERROR = 2.1422863483167D-
      IFRST(40)=242
      ILAST(40)=246
      C(242)= 0.2628187673463D+00
      C(243)=-0.5422707501601D-01
      C(244)= 0.5552907092188D-02
      C(245)=-0.2832594125266D-03
      C(246)= 0.5767453330918D-05
      RETURN
      END
C*MODULE ECPLIB  *DECK DAWT
      SUBROUTINE DAWT
C
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
C        -----  ROUTINE ALLOCATES PARAMETERS SPECIFYING         -----
C        -----  THE PIECEWISE CHEBYSHEV POLONOMIAL FIT TO       -----
C        -----  THE DAWSON FUNCTION.                            -----
C
      COMMON /DAWFCM/ C(249),IFRST(40),ILAST(40),H
C
      H = 0.25D+00
C ... 0.00 < X <= 0.25  INTERVAL NO. 1, ABS.ERROR = 1.6571632954765D-
      IFRST( 1)= 1
      ILAST( 1)= 8
      C( 1)=-0.1587492209085D-15
      C( 2)= 0.1000000001679D+01
      C( 3)=-0.2200140634227D-06
      C( 4)=-0.6666582802511D+00
      C( 5)=-0.1406923341036D-03
      C( 6)= 0.2678610335986D+00
      C( 7)=-0.5192471402032D-02
      C( 8)=-0.6640836596489D-01
C ... 0.25 < X <= 0.50  INTERVAL NO. 2, ABS.ERROR = 3.1585400961376D-
      IFRST( 2)= 9
      ILAST( 2)=16
      C( 9)=-0.1012320887742D-04
      C(10)= 0.1000229551438D+01
      C(11)=-0.2249318275452D-02
      C(12)=-0.6542497725108D+00
      C(13)=-0.4207802992979D-01
      C(14)= 0.3555122257011D+00
      C(15)=-0.1112488455006D+00
      C(16)=-0.8490860462189D-02
C ... 0.50 < X <= 0.75  INTERVAL NO. 3, ABS.ERROR = 1.5242918038894D-
      IFRST( 3)=17
      ILAST( 3)=24
      C(17)=-0.4921356497286D-03
      C(18)= 0.1006613917835D+01
      C(19)=-0.3889997394948D-01
      C(20)=-0.5358795704274D+00
      C(21)=-0.2746372044452D+00
      C(22)= 0.6337005279825D+00
      C(23)=-0.2989429214171D+00
      C(24)= 0.4661336966923D-01
C ... 0.75 < X <= 1.00  INTERVAL NO. 4, ABS.ERROR = 9.9014130228170D-
      IFRST( 4)=25
      ILAST( 4)=32
      C(25)= 0.2895369459824D-03
      C(26)= 0.1001188430399D+01
      C(27)=-0.2450339520101D-01
      C(28)=-0.5518735978257D+00
      C(29)=-0.2745338921003D+00
      C(30)= 0.6506738753191D+00
      C(31)=-0.3141764870712D+00
      C(32)= 0.5101503644671D-01
C ... 1.00 < X <= 1.25  INTERVAL NO. 5, ABS.ERROR = 1.8118839761883D-
      IFRST( 5)=33
      ILAST( 5)=40
      C(33)= 0.4002056337725D-01
      C(34)= 0.7312836053563D+00
      C(35)= 0.7635870948288D+00
      C(36)=-0.1834201228325D+01
      C(37)= 0.9813999234300D+00
      C(38)=-0.8984573983721D-01
      C(39)=-0.7076886296272D-01
      C(40)= 0.1660415104457D-01
C ... 1.25 < X <= 1.50  INTERVAL NO. 6, ABS.ERROR = 8.9031004790741D-
      IFRST( 6)=41
      ILAST( 6)=48
      C(41)= 0.1852097215132D+00
      C(42)=-0.7878409599634D-01
      C(43)= 0.2705240106371D+01
      C(44)=-0.4425988758096D+01
      C(45)= 0.3062214704197D+01
      C(46)=-0.1094631867084D+01
      C(47)= 0.1994346954993D+00
      C(48)=-0.1461141450065D-01
C ... 1.50 < X <= 1.75  INTERVAL NO. 7, ABS.ERROR = 2.2932766796657D-
      IFRST( 7)=49
      ILAST( 7)=56
      C(49)= 0.2566795947043D+00
      C(50)=-0.4340789653964D+00
      C(51)= 0.3460647185102D+01
      C(52)=-0.5316677310217D+01
      C(53)= 0.3691359889577D+01
      C(54)=-0.1360915547303D+01
      C(55)= 0.2619748477425D+00
      C(56)=-0.2090002809252D-01
C ... 1.75 < X <= 2.00  INTERVAL NO. 8, ABS.ERROR = 5.7358562344234D-
      IFRST( 8)=57
      ILAST( 8)=64
      C(57)=-0.2953293234440D+00
      C(58)= 0.1741536362797D+01
      C(59)=-0.2179107446162D+00
      C(60)=-0.1857700863729D+01
      C(61)= 0.1737803495672D+01
      C(62)=-0.6982079451638D+00
      C(63)= 0.1369430933680D+00
      C(64)=-0.1077900614057D-01
C ... 2.00 < X <= 2.25  INTERVAL NO. 9, ABS.ERROR = 7.9634077110313D-
      IFRST( 9)=65
      ILAST( 9)=71
      C(65)=-0.1683235354314D+01
      C(66)= 0.6579307910802D+01
      C(67)=-0.7452680221211D+01
      C(68)= 0.4159630869064D+01
      C(69)=-0.1268324481886D+01
      C(70)= 0.2038507675752D+00
      C(71)=-0.1359998434782D-01
C ... 2.25 < X <= 2.50  INTERVAL NO.10, ABS.ERROR = 4.9522164147220D-
      IFRST(10)=72
      ILAST(10)=78
      C(72)=-0.1172884307439D+01
      C(73)= 0.5243170888632D+01
      C(74)=-0.5994671204809D+01
      C(75)= 0.3310821796507D+01
      C(76)=-0.9902715162510D+00
      C(77)= 0.1552556976676D+00
      C(78)=-0.1006003345052D-01
C ... 2.50 < X <= 2.75  INTERVAL NO.11, ABS.ERROR = 4.0683012514364D-
      IFRST(11)=79
      ILAST(11)=85
      C(79)= 0.2453071419396D+00
      C(80)= 0.1843675794804D+01
      C(81)=-0.2597381166786D+01
      C(82)= 0.1499064046402D+01
      C(83)=-0.4464691670097D+00
      C(84)= 0.6815297792976D-01
      C(85)=-0.4243532816569D-02
C ... 2.75 < X <= 3.00  INTERVAL NO.12, ABS.ERROR = 1.7797319173951D-
      IFRST(12)=86
      ILAST(12)=92
      C(86)= 0.1711553394682D+01
      C(87)=-0.1366851519128D+01
      C(88)= 0.3331226440003D+00
      C(89)= 0.7176989090082D-01
      C(90)=-0.5525697253082D-01
      C(91)= 0.1093749119900D-01
      C(92)=-0.7553007453680D-03
C ... 3.00 < X <= 3.25  INTERVAL NO.13, ABS.ERROR = 3.6681768733615D-
      IFRST(13)=93
      ILAST(13)=99
      C(93)= 0.2517095374277D+01
      C(94)=-0.2990903746754D+01
      C(95)= 0.1697891140418D+01
      C(96)=-0.5401196813139D+00
      C(97)= 0.9911334144514D-01
      C(98)=-0.9840574037905D-02
      C(99)= 0.4103935013215D-03
C ... 3.25 < X <= 3.50  INTERVAL NO.14, ABS.ERROR = 1.1128875598843D-
      IFRST(14)=100
      ILAST(14)=106
      C(100)= 0.2590851813134D+01
      C(101)=-0.3134054423500D+01
      C(102)= 0.1813437074513D+01
      C(103)=-0.5897752524597D+00
      C(104)= 0.1110979078173D+00
      C(105)=-0.1138103745567D-01
      C(106)= 0.4927876094977D-03
C ... 3.50 < X <= 3.75  INTERVAL NO.15, ABS.ERROR = 1.4752643551219D-
      IFRST(15)=107
      ILAST(15)=113
      C(107)= 0.2263419843285D+01
      C(108)=-0.2574296380066D+01
      C(109)= 0.1414605080120D+01
      C(110)=-0.4381747671623D+00
      C(111)= 0.7867466333846D-01
      C(112)=-0.7681612002974D-02
      C(113)= 0.3168638795614D-03
C ... 3.75 < X <= 4.00  INTERVAL NO.16, ABS.ERROR = 9.2281737806843D-
      IFRST(16)=114
      ILAST(16)=120
      C(114)= 0.1858711024930D+01
      C(115)=-0.1925962656395D+01
      C(116)= 0.9817358192129D+00
      C(117)=-0.2839951967696D+00
      C(118)= 0.4777651946157D-01
      C(119)=-0.4378302333256D-02
      C(120)= 0.1696776598692D-03
C ... 4.00 < X <= 4.25  INTERVAL NO.17, ABS.ERROR = 2.0758506025231D-
      IFRST(17)=121
      ILAST(17)=126
      C(121)= 0.1097210930469D+01
      C(122)=-0.8018697789038D+00
      C(123)= 0.2901340972873D+00
      C(124)=-0.5698500686831D-01
      C(125)= 0.5849148664856D-02
      C(126)=-0.2469443250448D-03
C ... 4.25 < X <= 4.50  INTERVAL NO.18, ABS.ERROR = 1.1124878795954D-
      IFRST(18)=127
      ILAST(18)=132
      C(127)= 0.9640388573940D+00
      C(128)=-0.6448585002328D+00
      C(129)= 0.2160731515099D+00
      C(130)=-0.3951479965599D-01
      C(131)= 0.3788248790079D-02
      C(132)=-0.1496796030551D-03
C ... 4.50 < X <= 4.75  INTERVAL NO.19, ABS.ERROR = 6.3691274476696D-
      IFRST(19)=133
      ILAST(19)=138
      C(133)= 0.8660393462895D+00
      C(134)=-0.5357754986697D+00
      C(135)= 0.1674970705868D+00
      C(136)=-0.2869722599326D-01
      C(137)= 0.2583548621624D-02
      C(138)=-0.9600615594536D-04
C ... 4.75 < X <= 5.00  INTERVAL NO.20, ABS.ERROR = 3.8777869804107D-
      IFRST(20)=139
      ILAST(20)=144
      C(139)= 0.7902176622367D+00
      C(140)=-0.4558460385033D+00
      C(141)= 0.1337881166153D+00
      C(142)=-0.2158806335901D-01
      C(143)= 0.1833781835739D-02
      C(144)=-0.6437185220420D-04
C ... 5.00 < X <= 5.25  INTERVAL NO.21, ABS.ERROR = 2.4793500585929D-
      IFRST(21)=145
      ILAST(21)=150
      C(145)= 0.7290485015677D+00
      C(146)=-0.3946016171968D+00
      C(147)= 0.1092568925649D+00
      C(148)=-0.1667445598850D-01
      C(149)= 0.1341617573053D-02
      C(150)=-0.4465044476092D-04
C ... 5.25 < X <= 5.50  INTERVAL NO.22, ABS.ERROR = 1.6431300764452D-
      IFRST(22)=151
      ILAST(22)=156
      C(151)= 0.6781842728186D+00
      C(152)=-0.3461083410440D+00
      C(153)= 0.9076148811696D-01
      C(154)=-0.1314693754430D-01
      C(155)= 0.1005185194663D-02
      C(156)=-0.3181416541338D-04
C ... 5.50 < X <= 5.75  INTERVAL NO.23, ABS.ERROR = 1.1226575225010D-
      IFRST(23)=157
      ILAST(23)=162
      C(157)= 0.6349565075405D+00
      C(158)=-0.3067740750644D+00
      C(159)= 0.7644330701296D-01
      C(160)=-0.1054064526443D-01
      C(161)= 0.7679512928007D-03
      C(162)=-0.2317565958947D-04
C ... 5.75 < X <= 6.00  INTERVAL NO.24, ABS.ERROR = 7.8470563380506D-
      IFRST(24)=163
      ILAST(24)=168
      C(163)= 0.5976070486768D+00
      C(164)=-0.2742697363056D+00
      C(165)= 0.6512705037617D-01
      C(166)=-0.8570589057672D-02
      C(167)= 0.5964494688669D-03
      C(168)=-0.1720306463540D-04
C ... 6.00 < X <= 6.25  INTERVAL NO.25, ABS.ERROR = 5.6132876125048D-
      IFRST(25)=169
      ILAST(25)=174
      C(169)= 0.5649180454987D+00
      C(170)=-0.2470090261752D+00
      C(171)= 0.5603266263223D-01
      C(172)=-0.7053466938578D-02
      C(173)= 0.4698947566794D-03
      C(174)=-0.1297991257161D-04
C ... 6.25 < X <= 6.50  INTERVAL NO.26, ABS.ERROR = 3.5389913222161D-
      IFRST(26)=175
      ILAST(26)=179
      C(175)= 0.4314398767018D+00
      C(176)=-0.1418342842259D+00
      C(177)= 0.2288200151943D-01
      C(178)=-0.1828741476402D-02
      C(179)= 0.5815166332468D-04
C ... 6.50 < X <= 6.75  INTERVAL NO.27, ABS.ERROR = 2.7426949600340D-
      IFRST(27)=180
      ILAST(27)=184
      C(180)= 0.4119346702408D+00
      C(181)=-0.1298244601295D+00
      C(182)= 0.2010878728234D-01
      C(183)=-0.1544113849832D-02
      C(184)= 0.4719618664240D-04
C ... 6.75 < X <= 7.00  INTERVAL NO.28, ABS.ERROR = 2.1502799540940D-
      IFRST(28)=185
      ILAST(28)=189
      C(185)= 0.3942461802274D+00
      C(186)=-0.1193370928285D+00
      C(187)= 0.1777693657917D-01
      C(188)=-0.1313662248549D-02
      C(189)= 0.3865502003464D-04
C ... 7.00 < X <= 7.25  INTERVAL NO.29, ABS.ERROR = 1.7034818000639D-
      IFRST(29)=190
      ILAST(29)=194
      C(190)= 0.3781177456714D+00
      C(191)=-0.1101165554215D+00
      C(192)= 0.1580007215659D-01
      C(193)=-0.1125279834923D-02
      C(194)= 0.3192276744812D-04
C ... 7.25 < X <= 7.50  INTERVAL NO.30, ABS.ERROR = 1.3624212868990D-
      IFRST(30)=195
      ILAST(30)=199
      C(195)= 0.3633408065001D+00
      C(196)=-0.1019602554247D+00
      C(197)= 0.1411174419289D-01
      C(198)=-0.9699476170226D-03
      C(199)= 0.2656330616446D-04
C ... 7.50 < X <= 7.75  INTERVAL NO.31, ABS.ERROR = 1.0990319765369D-
      IFRST(31)=200
      ILAST(31)=204
      C(200)= 0.3497439218126D+00
      C(201)=-0.9470569276499D-01
      C(202)= 0.1266017939918D-01
      C(203)=-0.8408550675085D-03
      C(204)= 0.2225784919574D-04
C ... 7.75 < X <= 8.00  INTERVAL NO.32, ABS.ERROR = 8.9381835266522D-
      IFRST(32)=205
      ILAST(32)=209
      C(205)= 0.3371845853069D+00
      C(206)=-0.8822105128463D-01
      C(207)= 0.1140456233287D-01
      C(208)=-0.7327946570967D-03
      C(209)= 0.1877023896668D-04
C ... 8.00 < X <= 8.25  INTERVAL NO.33, ABS.ERROR = 7.3210326689832D-
      IFRST(33)=210
      ILAST(33)=214
      C(210)= 0.3255431584494D+00
      C(211)=-0.8239832407718D-01
      C(212)= 0.1031237441518D-01
      C(213)=-0.6417393667562D-03
      C(214)= 0.1592339503986D-04
C ... 8.25 < X <= 8.50  INTERVAL NO.34, ABS.ERROR = 6.0371707633067D-
      IFRST(34)=215
      ILAST(34)=219
      C(215)= 0.3147180811939D+00
      C(216)=-0.7714810368023D-01
      C(217)= 0.9357439877093D-02
      C(218)=-0.5645414814808D-03
      C(219)= 0.1358301324217D-04
C ... 8.50 < X <= 8.75  INTERVAL NO.35, ABS.ERROR = 5.0113246885530D-
      IFRST(35)=220
      ILAST(35)=224
      C(220)= 0.3046231027165D+00
      C(221)=-0.7239608540250D-01
      C(222)= 0.8518560948886D-02
      C(223)=-0.4987218951555D-03
      C(224)= 0.1164632612927D-04
C ... 8.75 < X <= 9.00  INTERVAL NO.36, ABS.ERROR = 4.1842085352073D-
      IFRST(36)=225
      ILAST(36)=229
      C(225)= 0.2951839772317D+00
      C(226)=-0.6807982796391D-01
      C(227)= 0.7778392737741D-02
      C(228)=-0.4423078514719D-03
      C(229)= 0.1003385659715D-04
C ... 9.00 < X <= 9.25  INTERVAL NO.37, ABS.ERROR = 3.5125236053091D-
      IFRST(37)=230
      ILAST(37)=234
      C(230)= 0.2863364933588D+00
      C(231)=-0.6414655846973D-01
      C(232)= 0.7122648855400D-02
      C(233)=-0.3937177713169D-03
      C(234)= 0.8683627129358D-05
C ... 9.25 < X <= 9.50  INTERVAL NO.38, ABS.ERROR = 2.9645175203541D-
      IFRST(38)=235
      ILAST(38)=239
      C(235)= 0.2780246155388D+00
      C(236)=-0.6055132372497D-01
      C(237)= 0.6539470823348D-02
      C(238)=-0.3516734769846D-03
      C(239)= 0.7546893357357D-05
C ... 9.50 < X <= 9.75  INTERVAL NO.39, ABS.ERROR = 2.5142110615661D-
      IFRST(39)=240
      ILAST(39)=244
      C(240)= 0.2701996594546D+00
      C(241)=-0.5725581832360D-01
      C(242)= 0.6018987049956D-02
      C(243)=-0.3151372568482D-03
      C(244)= 0.6585092705791D-05
C ... 9.75 < X <= 10.0  INTERVAL NO.40, ABS.ERROR = 2.1422863483167D-
      IFRST(40)=245
      ILAST(40)=249
      C(245)= 0.2628187673463D+00
      C(246)=-0.5422707501601D-01
      C(247)= 0.5552907092188D-02
      C(248)=-0.2832594125266D-03
      C(249)= 0.5767453330918D-05
      RETURN
      END
C*MODULE ECPLIB  *DECK DCO
      DOUBLE PRECISION FUNCTION DCO(L,M,KX,KY,KZ,LP,MP,
     *                              FPQR,ZLM,LMF,LMX,LMY,LMZ)
C
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
      DIMENSION FPQR(25,25,25),ZLM(*),LMF(*),LMX(*),LMY(*),LMZ(*)
C
C        -----  ROUTINE EVALUATES ANGULAR MOMENTUM COUPLING     -----
C        -----  COEFFICIENTS.                                   -----
C
C FOR A GIVEN SET OF L AND M, THIS ROUTINE CALCULATES THE TYPE 1
C (L,M=0) OR THE TYPE 2 ANGULAR INTEGRALS. (IE THE SECOND LINE OF
C EQ 28 OR 29 IN MD'S PAPER) YOU STILL MUST DO THE SUMS.
C
      ID = L*(L+1)-M+1
      IMN= LMF(ID)
      IMX= LMF(ID+1)-1
      JD = LP*(LP+1)-MP+1
      JMN= LMF(JD)
      JMX= LMF(JD+1)-1
      SUMI= 0.0D+00
      DO 120 I=IMN,IMX
         IX = LMX(I)+KX+1
         IY = LMY(I)+KY+1
         IZ = LMZ(I)+KZ+1
         SUMJ= 0.0D+00
         DO 110 J=JMN,JMX
            JX = IX+LMX(J)
            JY = IY+LMY(J)
            JZ = IZ+LMZ(J)
  110    SUMJ= SUMJ+ZLM(J)*FPQR(JX,JY,JZ)
  120 SUMI= SUMI+ZLM(I)*SUMJ
      DCO = SUMI
      RETURN
      END
C*MODULE ECPLIB  *DECK ECCODR
      SUBROUTINE ECCODR(DCOEF1,JFST1,LBECP1,DCOEF2,JFST2,LBECP2,
     *                  FPQR,ZLM,LMF,LMX,LMY,LMZ,NUMDER)
C
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
      DIMENSION DCOEF1(*),JFST1(*),LBECP1(9,*),
     *          DCOEF2(*),JFST2(*),LBECP2(6,*),FPQR(25,25,25),
     *          ZLM(581),LMF(122),LMZ(581),LMX(581),LMY(581)
C
      COMMON /ECPDIM/ NCOEF1,NCOEF2,J1LEN,J2LEN,LLIM,NLIM,NTLIM,J4LEN
      COMMON /IOFILE/ IR,IW,IP,IJK,IPK,IDAF,NAV,IODA(950)
      LOGICAL GOPARR,DSKWRK,MASWRK
      COMMON /PAR   / ME,MASTER,NPROC,IBTYP,IPTIM,GOPARR,DSKWRK,MASWRK
C
C        -----  ROUTINE PRE-CALCULATES INTEGRAL FORMULAS FOR    -----
C        -----  FOR CALCULATION OF THE MATRIX ELEMENTS OF THE   -----
C        -----  EFFECTIVE CORE POTENTIAL.                       -----
C        -----  FOR A CARTESIAN GAUSSIAN BASIS.                 -----
C
C        -----  SPECIFY THE MAXIMAL TYPE OF BASIS FUNCTION      -----
C        -----  AND MAXIMAL TYPE OF PROJECTION OPER.            -----
C
      CALL TSECND(TIME0)
C
C        -----  SET UP BASIS ANGULAR INTEGRALS.                 -----
C
      CALL ECPINI(LMF,LMX,LMY,LMZ)
      CALL ZTAB(ZLM)
      CALL FTAB(FPQR,NLIM-1)
C
C        -----  SET UP THE CODE FOR THE INTEGRALS OF THE LOCAL  -----
C        -----  OPERATOR POTENTIAL.                             -----
C
      CALL ECCOD1(DCOEF1,JFST1,LBECP1,FPQR,ZLM,LMF,LMX,LMY,LMZ,NUMDER)
C
C        -----  SET UP THE CODE FOR THE INTEGRALS OF ANGULAR    -----
C        -----  MOMENTUM PROJECTION OPERATOR.                   -----
C
      CALL ECCOD2(DCOEF2,JFST2,LBECP2,FPQR,ZLM,LMF,LMX,LMY,LMZ)
      CALL TSECND(TIME)
      TSTEP = TIME-TIME0
      TIME0 = TIME
      IF(MASWRK) WRITE(IW,9010) TSTEP
C
      RETURN
 9010 FORMAT(10X,'ECP ANGULAR INTS......... ',F8.2,' SECONDS')
      END
C*MODULE ECPLIB  *DECK ECCOD1
      SUBROUTINE ECCOD1(DCOEF1,JFST1,LBECP1,FPQR,ZLM,LMF,LMX,LMY,LMZ,
     *                  NUMDER)
C
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
      DIMENSION DCOEF1(*),JFST1(*),LBECP1(9,*),FPQR(25,25,25),
     *          ZLM(*),LMF(*),LMX(*),LMY(*),LMZ(*)
C
C        -----  ROUTINE FINDS FORMULA CODE FOR THE REGULAR      -----
C        -----  THREE-CENTER ONE ELECTRON INTEGRALS.            -----
C        REGULAR MEANING TYPE 1 ANGULAR INTEGRALS
C
      COMMON /ECPDIM/ NCOEF1,NCOEF2,J1LEN,J2LEN,LLIM,NLIM,NTLIM,J4LEN
      COMMON /GBASE / NFST(8),NX(84),NY(84),NZ(84)
      COMMON /IOFILE/ IR,IW,IP,IJK,IPK,IDAF,NAV,IODA(950)
C
      PARAMETER(SQRFPI=3.5449077018110D+00, TOL=1.0D-10)
C
C BINCO -- INDEXED COMBINATIONS (B!/(A!(B-A)!)) INDEXED BY B AND A
C          AS:  (B,A): (0,0),(1,0),(1,1),(2,0),(2,1),(2,2)...
C AKA PASCAL'S TRIANGLE, ENTRIES THROUGH I FUNCTIONS (G HESSIANS)
C
      DIMENSION BINCO(28),IA(128)
      DATA BINCO/           1.0D+00,
     1                  1.0D+00, 1.0D+00,
     2               1.0D+00, 2.0D+00, 1.0D+00,
     3            1.0D+00, 3.0D+00, 3.0D+00, 1.0D+00,
     4         1.0D+00, 4.0D+00, 6.0D+00, 4.0D+00, 1.0D+00,
     5      1.0D+00, 5.0D+00,10.0D+00,10.0D+00, 5.0D+00,1.0D+00,
     6   1.0D+00,6.0D+00,15.0D+00,20.0D+00,15.0D+00,6.0D+00,1.0D+00/
C
      J= 0
      DO 110 I=1,128
C        IA(I)=(I*(I-1))/2
         IA(I)= J
  110 J= J+I
C
      JNDX = 0
      JJLST= 0
C LOOP OVER POSSIBLE I SHELLS
      DO 230 NN1=1,NLIM
         NF1 = NFST(NN1)
         NL1 = NFST(NN1+1)-1
         IF(NUMDER.EQ.0 .OR. NN1.LT.NLIM) THEN
            NN2LIM= NN1
         ELSE
            NN2LIM= NN1-NUMDER
         END IF
C LOOP OVER THE I SHELL ANGUALR MOMENTUM FUNCTIONS
         DO 220 N1=NF1,NL1
            N1T = IA(N1)
            MX1 = IA(NX(N1)+1)+1
            MY1 = IA(NY(N1)+1)+1
            MZ1 = IA(NZ(N1)+1)+1
C LOOP OVER THE POSSIBLE J SHELLS (NOTE J SHELL <= I SHELL)
            DO 210 NN2=1,NN2LIM
               NF2 = NFST(NN2)
               NL2 = MIN0(NFST(NN2+1)-1,N1)
C LOOP OVER J SHELL ANGULAR MOMENTUM
               DO 200 N2=NF2,NL2
                  INDX = N2+N1T
                  MX2 = IA(NX(N2)+1)+1
                  MY2 = IA(NY(N2)+1)+1
                  MZ2 = IA(NZ(N2)+1)+1
                  LLMAX= NN1+NN2-2
C LOOP OVER LA, MU, KX...
                  DO 190 LA=0,LLMAX
                     DO 180 MU=-LA,LA
                        DO 170 KX=0,NX(N1)
                           DO 160 KY=0,NY(N1)
                              DO 150 KZ=0,NZ(N1)
                                 DO 140 KXP=0,NX(N2)
                                    DO 130 KYP=0,NY(N2)
                                       DO 120 KZP=0,NZ(N2)
                              KA = KX+KY+KZ+KXP+KYP+KZP
C
C NOTE NO NONZERO INTEGRALS FOR LA > KA
C IF KA + LA IS EVEN GO AHEAD AND CALCULATE THE ANGULAR INTEGRAL
C
                              IF(MOD(LA+KA,2).NE.1 .AND. LA.LE.KA) THEN
      DC=DCO(0,0,KX+KXP,KY+KYP,KZ+KZP,LA,MU,FPQR,ZLM,LMF,LMX,LMY,LMZ)
C
C IF THE INTEGRAL IS NON-ZERO THEN STORE IT AWAY FOR FUTURE USE
C
                                 IF(ABS(DC).LT.TOL) GO TO 120
                                 JNDX = JNDX+1
                                 LBECP1(1,JNDX)= KA
                                 LBECP1(2,JNDX)= LA
                                 LBECP1(3,JNDX)= MU
                                 LBECP1(4,JNDX)= KX
                                 LBECP1(5,JNDX)= KY
                                 LBECP1(6,JNDX)= KZ
                                 LBECP1(7,JNDX)= KXP
                                 LBECP1(8,JNDX)= KYP
                                 LBECP1(9,JNDX)= KZP
C
C THE INTEGRAL IS MULTIPLIED BY THE COMBINATION FACTORS AND BY SQRT(4PI)
C SINCE THERE IS AN EXTRA 1/SQRT(4PI) IN THE INTEGRAL
C
      DCOEF1(JNDX)= BINCO(MX1+KX) *BINCO(MY1+KY) *BINCO(MZ1+KZ) *
     *              BINCO(MX2+KXP)*BINCO(MY2+KYP)*BINCO(MZ2+KZP)*
     *              DC*SQRFPI
                              END IF
  120                                  CONTINUE
  130                               CONTINUE
  140                            CONTINUE
  150                         CONTINUE
  160                      CONTINUE
  170                   CONTINUE
  180                CONTINUE
  190             CONTINUE
                  JFST1(INDX)  = JJLST+1
                  JFST1(INDX+1)= JNDX+1
                  JJLST= JNDX
  200          CONTINUE
  210       CONTINUE
  220    CONTINUE
  230 CONTINUE
C
C CHECK TO BE SURE THAT THE ARRAY HAS STAYED WITHIN BOUNDS
C
      IF(JNDX.GT.NCOEF1) THEN
         WRITE(IW,9010) JNDX,NCOEF1
         CALL ABRT
      END IF
      NCOEF1= JNDX
      RETURN
 9010 FORMAT(/'****ECCOD1 OUT OF BOUNDS, USED ',I7,' ALLOWED ',I7)
      END
C*MODULE ECPLIB  *DECK ECCOD2
      SUBROUTINE ECCOD2(DCOEF2,JFST2,LBECP2,FPQR,ZLM,LMF,LMX,LMY,LMZ)
C
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
      DIMENSION DCOEF2(*),JFST2(*),LBECP2(6,*),FPQR(25,25,25),
     *          ZLM(*),LMF(*),LMX(*),LMY(*),LMZ(*)
C
      COMMON /ECPDIM/ NCOEF1,NCOEF2,J1LEN,J2LEN,LLIM,NLIM,NTLIM,J4LEN
      COMMON /GBASE / NFST(8),NX(84),NY(84),NZ(84)
      COMMON /IOFILE/ IR,IW,IP,IJK,IPK,IDAF,NAV,IODA(950)
C
      PARAMETER(TOL=1.0D-10)
C
C BINCO -- INDEXED COMBINATIONS (B!/(A!(B-A)!)) INDEXED BY B AND A
C          AS:  (B,A): (0,0),(1,0),(1,1),(2,0),(2,1),(2,2)...
C AKA PASCAL'S TRIANGLE, ENTRIES THROUGH I FUNCTIONS (G HESSIANS)
C
      DIMENSION BINCO(28),IA(8)
      DATA BINCO/            1.0D+00,
     1                  1.0D+00, 1.0D+00,
     2              1.0D+00, 2.0D+00, 1.0D+00,
     3           1.0D+00, 3.0D+00, 3.0D+00, 1.0D+00,
     4        1.0D+00, 4.0D+00, 6.0D+00, 4.0D+00, 1.0D+00,
     5     1.0D+00, 5.0D+00,10.0D+00,10.0D+00, 5.0D+00,1.0D+00,
     6  1.0D+00,6.0D+00,15.0D+00,20.0D+00,15.0D+00,6.0D+00,1.0D+00/
C
C        -----  ROUTINE FINDS FORMULA CODE FOR ONE-ELECTRON     -----
C        -----  THREE-CENTER INTEGRALS INVOLVING PROJECTION     -----
C        -----  OPERATORS.                                      -----
C
C THE TYPE 2 ANGULAR INTEGRAL TABLE GENERATOR
C
      J= 0
      DO 110 I=1,8
C        IA(I)=(I*(I-1))/2
         IA(I)= J
  110 J= J+I
C
      JNDX = 0
      JJLST= 0
      LLLIM= LLIM-1
      DO 200 L=0,LLLIM
         DO 190 M=L,-L,-1
            LMINDX =(L*(L+1)-M)*NTLIM
            DO 180 NN=1,NLIM
               NF = NFST(NN)
               NL = NFST(NN+1)-1
               L2MX = L+NN-1
               DO 170 N=NF,NL
                  INDX = LMINDX+N
                  MX = IA(NX(N)+1)+1
                  MY = IA(NY(N)+1)+1
                  MZ = IA(NZ(N)+1)+1
                  DO 160 LA=0,L2MX
                     DO 150 MU=-LA,LA
                        DO 140 KX=0,NX(N)
                           DO 130 KY=0,NY(N)
                              DO 120 KZ=0,NZ(N)
                                 IS = KX+KY+KZ
      DC= DCO(L,M,KX,KY,KZ,LA,MU,FPQR,ZLM,LMF,LMX,LMY,LMZ)
                                 IF(ABS(DC).LT.TOL) GO TO 120
                                 JNDX = JNDX+1
                                 LBECP2(1,JNDX)= LA
                                 LBECP2(2,JNDX)= IS
                                 LBECP2(3,JNDX)= MU
                                 LBECP2(4,JNDX)= KX
                                 LBECP2(5,JNDX)= KY
                                 LBECP2(6,JNDX)= KZ
      DCOEF2(JNDX)= BINCO(MX+KX)*BINCO(MY+KY)*BINCO(MZ+KZ)*DC
  120                         CONTINUE
  130                      CONTINUE
  140                   CONTINUE
  150                CONTINUE
  160             CONTINUE
                  JFST2(INDX)  = JJLST+1
                  JFST2(INDX+1)= JNDX+1
                  JJLST= JNDX
  170          CONTINUE
  180       CONTINUE
  190    CONTINUE
  200 CONTINUE
C
C CHECK TO BE SURE THAT THE ARRAY HAS STAYED WITHIN BOUNDS
C
      IF(JNDX.GT.NCOEF2) THEN
         WRITE(IW,9010) JNDX,NCOEF2
         CALL ABRT
      END IF
      NCOEF2= JNDX
      RETURN
 9010 FORMAT(/'****ECCOD2 OUT OF BOUNDS, USED ',I6,' ALLOWED ',I5)
      END
C*MODULE ECPLIB  *DECK ECCOD3
      SUBROUTINE ECCOD3(FPQR,DCOEF4,ZLM,LMF,LMX,LMY,LMZ)
C
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
      DIMENSION FPQR(25,25,25),DCOEF4(*),
     *          ZLM(*),LMF(*),LMX(*),LMY(*),LMZ(*)
C
      COMMON /ECPDIM/ NCOEF1,NCOEF2,J1LEN,J2LEN,LLIM,NLIM,NTLIM,J4LEN
      COMMON /GBASE / NFST(8),NX(84),NY(84),NZ(84)
C
      DATA SQRFPI/3.5449077018110D+00/
C
      IIIDX=0
      DO 140 L=0,LLIM-1
         DO 130 M=L,-L,-1
            LMINDX =(L*(L+1)-M)*NTLIM
            DO 120 NN=1,NLIM
               NF = NFST(NN)
               NL = NFST(NN+1)-1
               DO 110 N= NF,NL
                  INDX = LMINDX+N
                  IIIDX= MAX0(INDX,IIIDX)
      DCOEF4(INDX)= DCO(0,0,NX(N),NY(N),NZ(N),L,M,
     *                  FPQR,ZLM,LMF,LMX,LMY,LMZ)*SQRFPI
  110          CONTINUE
  120       CONTINUE
  130    CONTINUE
  140 CONTINUE
      IF(IIIDX.GT.J4LEN) THEN
         WRITE(6,*) 'DCOEF4 OUT OF BOUNDS IN ECCOD3 ',IIIDX
         CALL ABRT
      END IF
      RETURN
      END
C*MODULE ECPLIB  *DECK ECPINI
      SUBROUTINE ECPINI(LMF,LMX,LMY,LMZ)
C
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
      DIMENSION LMF(122),LMX(581),LMY(581),LMZ(581)
C
      COMMON /GBASE / NFST(8),NX(84),NY(84),NZ(84)
C
C LMF (FIRST) POINT TO THE FIRST PARTS OF THE
C SPHERICAL HARMONIC COEF TABLE (ZLM) AND TO THE CORRESPONDING POWERS
C OF X, Y, AND Z STORED IN LMX, LMY, LMZ (GOOD THROUGH L=10)
C
      DIMENSION ILMF(122),ILMX(581),ILMY(581),ILMZ(581)
      DIMENSION INFST(8),INX(84),INY(84),INZ(84)
      DATA ILMF/1, 2,3,4, 5,7,8,10,11, 12,14,16,18,20,22,23,
     *25,28,30,34,36,39,41,43,45, 47,50,53,57,61,64,67,70,72,76,78,
     *81,85,88,94,98,104,107,111,114,117,121,125,128,
     *131,135,139,145,151,157,163,167,171,175,178,184,188,194,197,
     *201,206,210,218,224,233,239,247,251,256,260,264,270,276,282,
     *288,292, 296,301,306,314,322,331,340,348,356,361,366,371,375,383,
     *389,398,404,412,416, 421,427,432,442,450,462,471,483,491,501,506,
     *512,517,522,530,538,547,556,564,572,577, 582/
      DATA ILMX/0, 1,0,0, 2,0,1,0,0,0,1, 3,1,2,0,1,1,0,0,0,0,1,2,0,
     *4,2,0,3,1,2,0,0,2,1,1,0,0,0,0,0,1,1,2,0,3,1, 5,3,1,0,2,4,3,1,1,3,
     *2,0,2,0,1,1,1,0,0,0,0,0,0,1,1,2,2,0,0,3,1,4,2,0, 6,4,2,0,5,3,1,4,
     *2,0,4,2,0,3,1,1,3,2,0,2,0,2,0,1,1,1,0,0,0,0,0,0,0,1,1,1,2,0,2,0,3,
     *1,3,1,4,2,0,5,3,1, 7,3,5,1,6,4,0,2,5,3,1,5,3,1,4,2,0,4,2,0,3,1,3,
     *1,3,1,2,0,2,0,2,0,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,2,0,2,0,2,0,3,1,3,
     *1,4,2,0,4,2,0,5,3,1,0,4,2,6, 8,6,4,2,0,7,5,3,1,6,4,2,0,6,4,2,0,5,
     *3,1,5,3,1,4,0,2,4,0,2,4,0,2,3,1,3,1,3,1,2,0,2,0,2,0,2,0,1,1,1,1,0,
     *0,0,0,0,0,0,0,0,1,1,1,1,2,0,2,0,2,0,3,1,3,1,3,1,4,2,0,4,2,0,5,3,1,
     *5,3,1,6,4,2,0,7,5,3,1, 9,7,5,3,1,8,6,4,2,0,7,5,3,1,7,5,3,1,6,4,2,
     *0,6,4,2,0,5,3,1,5,3,1,5,3,1,4,0,2,4,0,2,4,0,2,3,1,3,1,3,1,3,1,2,0,
     *2,0,2,0,2,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,0,2,0,2,0,2,0,
     *3,1,3,1,3,1,4,2,0,4,2,0,4,2,0,5,3,1,5,3,1,6,4,2,0,6,4,2,0,7,5,3,1,
     *8,6,4,2,0, 10,8,6,4,2,0,9,7,5,3,1,8,6,4,2,0,8,6,4,2,0,7,5,3,1,7,5,
     *3,1,6,4,2,0,6,4,2,0,6,4,2,0,5,3,1,5,3,1,5,3,1,4,0,2,4,0,2,4,0,2,4,
     *0,2,3,1,3,1,3,1,3,1,2,0,2,0,2,0,2,0,2,0,1,1,1,1,1,0,0,0,0,0,0,0,
     *0,0,0,0,1,1,1,1,1,2,0,2,0,2,0,2,0,3,1,3,1,3,1,3,1,0,2,4,0,2,4,0,2,
     *4,5,3,1,5,3,1,5,3,1,6,4,2,0,6,4,2,0,7,5,3,1,7,5,3,1,8,6,4,2,0,9,7,
     *5,3,1/
      DATA ILMY/0, 0,0,1, 0,2,0,0,0,1,1, 0,2,0,2,0,0,0,0,1,1,1,1,3,
     *0,2,4,0,2,0,2,2,0,0,0,0,0,0,1,1,1,1,1,3,1,3, 0,2,4,4,2,0,0,2,2,0,
     *0,2,0,2,0,0,0,0,0,0,1,1,1,1,1,1,1,3,3,1,3,1,3,5, 0,2,4,6,0,2,4,0,
     *2,4,0,2,4,0,2,2,0,0,2,0,2,0,2,0,0,0,0,0,0,0,1,1,1,1,1,1,1,3,1,3,1,
     *3,1,3,1,3,5,1,3,5, 0,4,2,6,0,2,6,4,0,2,4,0,2,4,0,2,4,0,2,4,0,2,0,
     *2,0,2,0,2,0,2,0,2,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,3,1,3,1,3,1,3,1,
     *3,1,3,5,1,3,5,1,3,5,7,3,5,1, 0,2,4,6,8,0,2,4,6,0,2,4,6,0,2,4,6,0,
     *2,4,0,2,4,0,4,2,0,4,2,0,4,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,0,0,0,0,
     *0,0,0,0,1,1,1,1,1,1,1,1,1,3,1,3,1,3,1,3,1,3,1,3,1,3,5,1,3,5,1,3,5,
     *1,3,5,1,3,5,7,1,3,5,7, 0,2,4,6,8,0,2,4,6,8,0,2,4,6,0,2,4,6,0,2,4,
     *6,0,2,4,6,0,2,4,0,2,4,0,2,4,0,4,2,0,4,2,0,4,2,0,2,0,2,0,2,0,2,0,2,
     *0,2,0,2,0,2,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,3,1,3,1,3,1,3,
     *1,3,1,3,1,3,1,3,5,1,3,5,1,3,5,1,3,5,1,3,5,1,3,5,7,1,3,5,7,1,3,5,7,
     *1,3,5,7,9, 0,2,4,6,8,10,0,2,4,6,8,0,2,4,6,8,0,2,4,6,8,0,2,4,6,0,2,
     *4,6,0,2,4,6,0,2,4,6,0,2,4,6,0,2,4,0,2,4,0,2,4,0,4,2,0,4,2,0,4,2,0,
     *4,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,1,
     *1,1,1,1,1,1,1,1,1,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,5,3,1,5,3,1,5,3,
     *1,1,3,5,1,3,5,1,3,5,1,3,5,7,1,3,5,7,1,3,5,7,1,3,5,7,1,3,5,7,9,1,3,
     *5,7,9/
      DATA ILMZ/0, 0,1,0, 0,0,1,2,0,1,0, 0,0,1,1,2,0,3,1,2,0,1,0,0,
     *0,0,0,1,1,2,2,0,0,3,1,4,2,0,3,1,2,0,1,1,0,0, 0,0,0,1,1,1,2,2,0,0,
     *3,3,1,1,4,2,0,5,3,1,4,2,0,3,1,2,0,2,0,1,1,0,0,0, 0,0,0,0,1,1,1,2,
     *2,2,0,0,0,3,3,1,1,4,4,2,2,0,0,5,3,1,6,4,2,0,5,3,1,4,2,0,3,3,1,1,2,
     *2,0,0,1,1,1,0,0,0, 0,0,0,0,1,1,1,1,2,2,2,0,0,0,3,3,3,1,1,1,4,4,2,
     *2,0,0,5,5,3,3,1,1,6,4,2,0,7,5,3,1,6,4,2,0,5,3,1,4,4,2,2,0,0,3,3,1,
     *1,2,2,2,0,0,0,1,1,1,0,0,0,0, 0,0,0,0,0,1,1,1,1,2,2,2,2,0,0,0,0,3,
     *3,3,1,1,1,4,4,4,2,2,2,0,0,0,5,5,3,3,1,1,6,6,4,4,2,2,0,0,7,5,3,1,8,
     *6,4,2,0,7,5,3,1,6,4,2,0,5,5,3,3,1,1,4,4,2,2,0,0,3,3,3,1,1,1,2,2,2,
     *0,0,0,1,1,1,1,0,0,0,0, 0,0,0,0,0,1,1,1,1,1,2,2,2,2,0,0,0,0,3,3,3,
     *3,1,1,1,1,4,4,4,2,2,2,0,0,0,5,5,5,3,3,3,1,1,1,6,6,4,4,2,2,0,0,7,7,
     *5,5,3,3,1,1,8,6,4,2,0,9,7,5,3,1,8,6,4,2,0,7,5,3,1,6,6,4,4,2,2,0,0,
     *5,5,3,3,1,1,4,4,4,2,2,2,0,0,0,3,3,3,1,1,1,2,2,2,2,0,0,0,0,1,1,1,1,
     *0,0,0,0,0, 0,0,0,0,0,0,1,1,1,1,1,2,2,2,2,2,0,0,0,0,0,3,3,3,3,1,1,
     *1,1,4,4,4,4,2,2,2,2,0,0,0,0,5,5,5,3,3,3,1,1,1,6,6,6,4,4,4,2,2,2,0,
     *0,0,7,7,5,5,3,3,1,1,8,8,6,6,4,4,2,2,0,0,9,7,5,3,1,10,8,6,4,2,0,9,
     *7,5,3,1,8,6,4,2,0,7,7,5,5,3,3,1,1,6,6,4,4,2,2,0,0,5,5,5,3,3,3,1,1,
     *1,4,4,4,2,2,2,0,0,0,3,3,3,3,1,1,1,1,2,2,2,2,0,0,0,0,1,1,1,1,1,0,0,
     *0,0,0/
      DATA INFST/1,2,5,11,21,36,57,85/
      DATA INX/0,1,0,0,2,0,0,1,1,0,3,0,0,2,2,1,0,1,0,1,4,0,0,3,3,1,0,
     *1,0,2,2,0,2,1,1, 5,0,0,4,4,1,0,1,0,3,3,2,0,2,0,3,1,1,2,2,1,
     *6,0,0,5,5,1,0,1,0,4,4,2,0,2,0,4,1,1,3,3,0,3,3,2,1,2,1,2/,
     1     INY/0,0,1,0,0,2,0,1,0,1,0,3,0,1,0,2,2,0,1,1,0,4,0,1,0,3,3,
     *0,1,2,0,2,1,2,1, 0,5,0,1,0,4,4,0,1,2,0,3,3,0,2,1,3,1,2,1,2,
     *0,6,0,1,0,5,5,0,1,2,0,4,4,0,2,1,4,1,3,0,3,2,1,3,3,1,2,2/,
     2     INZ/0,0,0,1,0,0,2,0,1,1,0,0,3,0,1,0,1,2,2,1,0,0,4,0,1,0,1,
     *3,3,0,2,2,1,1,2, 0,0,5,0,1,0,1,4,4,0,2,0,2,3,3,1,1,3,1,2,2,
     *0,0,6,0,1,0,1,5,5,0,2,0,2,4,4,1,1,4,0,3,3,1,2,1,2,3,3,2/
C
      DO 110 I = 1,122
         LMF(I)= ILMF(I)
  110 CONTINUE
      DO 120 J = 1,581
         LMX(J)= ILMX(J)
         LMY(J)= ILMY(J)
         LMZ(J)= ILMZ(J)
  120 CONTINUE
      DO 130 K = 1,8
         NFST(K)= INFST(K)
  130 CONTINUE
      DO 140 L = 1,84
         NX(L) = INX(L)
         NY(L) = INY(L)
         NZ(L) = INZ(L)
  140 CONTINUE
      RETURN
      END
C*MODULE ECPLIB  *DECK ECPPAR
      SUBROUTINE ECPPAR
C
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
      PARAMETER (MXATM=2000, MXSH=5000, MXGTOT=20000)
C
      COMMON /ECP2  / CLP(400),ZLP(400),NLP(400),KFRST(MXATM,6),
     *                KLAST(MXATM,6),LMAX(MXATM),LPSKIP(MXATM),
     *                IZCORE(MXATM)
      COMMON /ECPDIM/ NCOEF1,NCOEF2,J1LEN,J2LEN,LLIM,NLIM,NTLIM,J4LEN
C
      COMMON /CIFILS/ NFT11,NFT12,NFT13,NFT14,NFT15,NFT16,IDAF20,NEMEMX
      COMMON /FMCOM / X(1)
      COMMON /INFOA / NATOMS,ICH,MUL,NBASIS,NQMT,NE,NA,NB,
     *                ZAN(MXATM),C(3,MXATM),IAN(MXATM)
      COMMON /INTOPT/ ISCHWZ,IECP,NECP,IEFLD
      COMMON /INTRFC/ FRIEND,AIMPAC,RPAC,PLTORB,MOLPLT
      COMMON /IOFILE/ IR,IW,IP,IJK,IPK,IDAF,NAV,IODA(950)
      COMMON /MACHIN/ NWDVAR,MAXFM,MAXSM,LIMFM,LIMSM
      COMMON /NSHEL / EX(MXGTOT),CS(MXGTOT),CP(MXGTOT),CD(MXGTOT),
     *                CF(MXGTOT),CG(MXGTOT),CH(MXGTOT),CI(MXGTOT),
     *                KSTART(MXSH),KATOM(MXSH),KTYPE(MXSH),KNG(MXSH),
     *                KLOC(MXSH),KMIN(MXSH),KMAX(MXSH),NSHELL
      LOGICAL GOPARR,DSKWRK,MASWRK
      COMMON /PAR   / ME,MASTER,NPROC,IBTYP,IPTIM,GOPARR,DSKWRK,MASWRK
      COMMON /RUNOPT/ RUNTYP,EXETYP,NEVALS,NGLEVL,NHLEVL
C
      LOGICAL AIMPAC,PLTORB,MOLPLT,RPAC,FRNDLY
C
      CHARACTER*8 STRING,PPNAME,PPTYPE
      CHARACTER*4 ATMSYM(MXATM)
C
      DIMENSION TYPELP(MXATM),KKL(5),KKF(5)
      DIMENSION CCLP(30),NNLP(30),ZZLP(30)
      DIMENSION MLDECP(40),MLDAIX(20),XMLDAI(20),CMLDAI(20)
C
      DATA ANONE/8HNONE    /, SBKJC/8HSBKJC   /, SBK/8HSBK     /,
     *     CHECK/8HCHECK   /,   GEN/8HGEN     /,  HW/8HHW      /,
     *     BLANK/8H        /
      DATA FRNDLY/.FALSE./
C
C FIRST, -INITIALIZE FOR NO ECP-.
C NECP   IS THE TOTAL NUMBER OF ELECTRONS REMOVED BY THE ECP.
C IZCORE IS THE NUMBER OF ELECTRONS REMOVED FROM EACH ATOM.
C LPSKIP SHOULD BE 0 IF ELECTRONS ARE BEING REMOVED
C
      NECP= 0
      DO 110 I=1,NATOMS
         LPSKIP(I)= 1
         IZCORE(I)= 0
         LMAX(I)  = 0
  110 CONTINUE
C
C PREPARE FOR ECP RUNS...DEFINE THE POTENTIALS, INITIALIZE
C THE COMMONS, ADJUST NUCLEAR Z AND ELECTRON COUNTS, ETC.
C     IECP=0 PSEUDOPOTENTIALS ARE NOT BEING USED,
C            THIS ROUTINE IS NOT CALLED.
C     IECP=1 USER WANTS TO READ IN $ECP.
C     IECP=2 USER WANTS TO USE SBKJC FOR ALL ATOMS.
C     IECP=3 USER WANTS TO USE HW FOR ALL ATOMS.
C
      IF(IECP.EQ.0 .OR. IECP.EQ.5) GO TO 999
C
      IF(MASWRK) WRITE(IW,9010)
      PPNAME = '        '
      PPTYPE = '        '
      IF(FRIEND.NE.BLANK) FRNDLY=.TRUE.
      IF(FRNDLY) THEN
         CALL SETLAB(2,ATMSYM)
         WRITE(NFT16,9020)
      END IF
C
C POSITION INPUT TO $ECP IF IT IS TO BE READ
C
      IF(IECP.EQ.1) THEN
         CALL SEQREW(IR)
         CALL FNDGRP(IR,' $ECP   ',JEOF)
         IF(JEOF.EQ.1) THEN
            IF(MASWRK) WRITE(IW,9030)
            CALL ABRT
         END IF
      END IF
C
      IADD= 0
      PTYPE= ANONE
      DO 180 ICNTR=1,NATOMS
         NUCZ= INT(ZAN(ICNTR))
         LPSKIP(ICNTR)= 0
         IEOF= 0
C
C        READ(IR,*) TYPELP(ICNTR),PTYPE,IZCORE(ICNTR),LMAX(ICNTR)
C
         IF(IECP.EQ.1) THEN
            IEOF= 0
            IERR= 0
            CALL RDCARD('$ECP   1',IEOF)
            KSIZE=-8
            CALL GSTRNG(PPNAME,KSIZE)
            IF(PPNAME.EQ.'$END     ') THEN
               IF(MASWRK) WRITE(IW,9040)
               CALL ABRT
            END IF
            READ(UNIT=PPNAME,FMT='(A8)') TYPELP(ICNTR)
            KSIZE=-8
            CALL GSTRNG(PPTYPE,KSIZE)
            READ(UNIT=PPTYPE,FMT='(A8)') PTYPE
            IF(PTYPE.EQ.SBK) PTYPE = SBKJC
            IZCORE(ICNTR)= IFIND('IZCORE  ',IERR)
            IF(IERR.NE.0) CALL ABRT
            LMAX(ICNTR)= IFIND('LMAX    ',IERR)
            IF(IERR.NE.0) CALL ABRT
         END IF
C
         IF(IECP.EQ.2) THEN
            IF(NUCZ.LT.100) THEN
               WRITE(UNIT=STRING,FMT='(A5,1H-,I2)') SBKJC,NUCZ
            ELSE
               WRITE(UNIT=STRING,FMT='(A5,I3)') SBKJC,NUCZ
            END IF
            READ(UNIT=STRING,FMT='(A8)') TYPELP(ICNTR)
            PTYPE= SBKJC
            IF(NUCZ.LE.2) PTYPE=ANONE
         END IF
C
         IF(IECP.EQ.3) THEN
            WRITE(UNIT=STRING,FMT='(A4,I4)') HW,NUCZ
            READ(UNIT=STRING,FMT='(A8)') TYPELP(ICNTR)
            PTYPE= HW
            IF(NUCZ.LE.10) PTYPE=ANONE
         END IF
C
C ALL ELECTRON (NO CORE POTENTIAL) ATOM
C
         IF(PTYPE.EQ.ANONE) THEN
            LPSKIP(ICNTR)=1
            IZCORE(ICNTR)=0
            LMAX(ICNTR)=0
            GO TO 180
         END IF
C
C STEVENS,BASCH,KRAUSS TYPE POTENTIAL
C
         IF(PTYPE.EQ.SBKJC) THEN
            IF( 3.LE.NUCZ .AND. NUCZ.LE.10) LMAX(ICNTR)=1
            IF(11.LE.NUCZ .AND. NUCZ.LE.31) LMAX(ICNTR)=2
            IF(32.LE.NUCZ .AND. NUCZ.LE.71) LMAX(ICNTR)=3
            IF(NUCZ.EQ.57) LMAX(ICNTR)=4
            IF(72.LE.NUCZ .AND. NUCZ.LE.86) LMAX(ICNTR)=4
C
            IF( 3.LE.NUCZ .AND. NUCZ.LE.10) IZCORE(ICNTR)= 2
            IF(11.LE.NUCZ .AND. NUCZ.LE.18) IZCORE(ICNTR)=10
            IF(19.LE.NUCZ .AND. NUCZ.LE.20) IZCORE(ICNTR)=18
            IF(21.LE.NUCZ .AND. NUCZ.LE.31) IZCORE(ICNTR)=10
            IF(32.LE.NUCZ .AND. NUCZ.LE.36) IZCORE(ICNTR)=28
            IF(37.LE.NUCZ .AND. NUCZ.LE.38) IZCORE(ICNTR)=36
            IF(39.LE.NUCZ .AND. NUCZ.LE.49) IZCORE(ICNTR)=28
            IF(50.LE.NUCZ .AND. NUCZ.LE.71) IZCORE(ICNTR)=46
            IF(55.LE.NUCZ .AND. NUCZ.LE.56) IZCORE(ICNTR)=54
            IF(72.LE.NUCZ .AND. NUCZ.LE.81) IZCORE(ICNTR)=60
            IF(82.LE.NUCZ .AND. NUCZ.LE.86) IZCORE(ICNTR)=78
            IF(NUCZ.GT.86) THEN
               IF(MASWRK)
     *            WRITE(IW,*) 'NO BUILT IN -SBKJC- POTENTIALS PAST RN!'
               CALL ABRT
            END IF
         END IF
C
         IF(PTYPE.EQ.HW) THEN
            IF(11.LE.NUCZ .AND. NUCZ.LE.20) LMAX(ICNTR)=2
            IF(21.LE.NUCZ .AND. NUCZ.LE.54) LMAX(ICNTR)=3
C
            IF(11.LE.NUCZ .AND. NUCZ.LE.18) IZCORE(ICNTR)=10
            IF(19.LE.NUCZ .AND. NUCZ.LE.30) IZCORE(ICNTR)=18
            IF(31.LE.NUCZ .AND. NUCZ.LE.36) IZCORE(ICNTR)=28
            IF(37.LE.NUCZ .AND. NUCZ.LE.48) IZCORE(ICNTR)=36
            IF(49.LE.NUCZ .AND. NUCZ.LE.54) IZCORE(ICNTR)=46
            IF(NUCZ.GT.54) THEN
               IF(MASWRK)
     *            WRITE(IW,*) 'NO BUILT IN -HW- POTENTIALS PAST XE!'
               CALL ABRT
            END IF
         END IF
C
C        ----- CHECK IF THIS POTENTIAL HAS OCCURED BEFORE -----
C
         IF(ICNTR.EQ.1) GO TO 135
         DO 130 JCNTR=1,ICNTR-1
            IF(TYPELP(ICNTR).NE.TYPELP(JCNTR)) GO TO 130
            IF(LPSKIP(JCNTR).EQ.1) THEN
C                  HERE WE ARE COPYING -NONE- TO THE NEW ATOM.
               LPSKIP(ICNTR) = 1
               IZCORE(ICNTR) = 0
               LMAX(ICNTR)   = 0
               GO TO 175
            ELSE
C                  COPY THIS ATOM'S POTENTIAL FROM ANOTHER'S
               LMN = 1
               LMX = LMAX(JCNTR)+1
               DO L=LMN,LMX
                  KFRST(ICNTR,L)= KFRST(JCNTR,L)
                  KLAST(ICNTR,L)= KLAST(JCNTR,L)
               ENDDO
               LMAX(ICNTR)= LMAX(JCNTR)
               IZCORE(ICNTR)= IZCORE(JCNTR)
               GO TO 175
            ENDIF
  130    CONTINUE
  135    CONTINUE
C
C         ----- READ IN THE POTENTIALS -----
C THE ORDER IS U(LMAX), AND THEN U(L-LMAX), L=1,LMAX-1
C E.G. WHEN LMAX=2, FIRST U(D), THEN U(S-D) AND U(P-D)
C
         IF(PTYPE.EQ.GEN) THEN
            LMN = 1
            LMX = LMAX(ICNTR)+1
            DO 150 L=LMN,LMX
C              READ(IR,*) NGPOT
               IEOF= 0
               IERR= 0
               CALL RDCARD('$ECP   2',IEOF)
               NGPOT = IFIND('NGPOT  ',IERR)
               KF = IADD+1
               KL = IADD+NGPOT
               IF(KL.GT.400) THEN
                  IF(MASWRK) WRITE(IW,9050)
                  CALL ABRT
               END IF
               KFRST(ICNTR,L)= KF
               KLAST(ICNTR,L)= KL
               DO 140 K=KF,KL
C                 READ(IR,*) CLP(K),NLP(K),ZLP(K)
                  IEOF= 0
                  IERR= 0
                  CALL RDCARD('$ECP   3',IEOF)
                  CLP(K)= RFIND('ECP COEF',IERR)
                  IF(IERR.NE.0) CALL ABRT
                  NLP(K)= IFIND('POLYNO N',IERR)
                  IF(IERR.NE.0) CALL ABRT
                  ZLP(K)= RFIND('ECP EXP.',IERR)
                  IF(IERR.NE.0) CALL ABRT
  140          CONTINUE
               IADD = KL
  150       CONTINUE
         END IF
C
C     ------- LOAD BUILT IN SBKJC OR HW POTENTIALS ------
C
         IF(PTYPE.EQ.SBKJC) THEN
            CALL SBKPOT(NUCZ,KKF,KKL,CCLP,NNLP,ZZLP,ICORE)
C           IZCORE(ICNTR)= ICORE
         END IF
         IF(PTYPE.EQ.HW) THEN
            CALL HWPOT(NUCZ,KKF,KKL,CCLP,NNLP,ZZLP,ICORE)
C           IZCORE(ICNTR)= ICORE
         END IF
C
         IF(PTYPE.EQ.SBKJC .OR. PTYPE.EQ.HW) THEN
            LMN = 1
            LMX = LMAX(ICNTR)+1
            DO 170 L=LMN,LMX
               NGPOT = KKL(L)-KKF(L)+1
               KF = IADD+1
               KL = IADD+NGPOT
               IF(KL.GT.400) THEN
                  IF(MASWRK) WRITE(IW,9050)
                  CALL ABRT
               END IF
               KFRST(ICNTR,L)= KF
               KLAST(ICNTR,L)= KL
               KADD= KKF(L)-1
               DO 160 K=1,NGPOT
                  CLP(IADD+K)= CCLP(KADD+K)
                  NLP(IADD+K)= NNLP(KADD+K)
                  ZLP(IADD+K)= ZZLP(KADD+K)
  160          CONTINUE
               IADD= KL
  170       CONTINUE
         END IF
C
C ADJUST THE NUMBER OF ELECTRONS AND THE NUCLEAR CHARGE
C
  175    CONTINUE
         NE = NE-IZCORE(ICNTR)
         NA = NA-IZCORE(ICNTR)/2
         NB = NB-IZCORE(ICNTR)/2
         ZAN(ICNTR)=ZAN(ICNTR)-IZCORE(ICNTR)
  180 CONTINUE
C
C        -----  PRINT THE POTENTIALS BEING USED -----
C
      IF(FRNDLY) THEN
         MLDDPP= 0
         DO 200 ICNTR=1,NATOMS
            IF(LPSKIP(ICNTR).EQ.1) MLDECP(ICNTR)= 0
            IF(LPSKIP(ICNTR).EQ.1) GO TO 200
            NCNTR = ICNTR-1
            DO 190 JCNTR=1,NCNTR
               IF(TYPELP(ICNTR).NE.TYPELP(JCNTR)) GO TO 190
               MLDECP(ICNTR)= MLDECP(JCNTR)
               GO TO 200
  190       CONTINUE
            MLDDPP= MLDDPP+1
            MLDECP(ICNTR)= MLDDPP
  200    CONTINUE
         MLDDPP= 0
         WRITE(NFT16,FMT='((4HMELD,(10I4)))')
     1                  (MLDECP(ICNTR),ICNTR=1,NATOMS)
      END IF
C
      NUMECP=0
      DO 250 ICNTR=1,NATOMS
         IF(FRNDLY) THEN
            IF(LPSKIP(ICNTR).EQ.1) MLDECP(ICNTR)=0
         END IF
         IF(LPSKIP(ICNTR).EQ.1) GO TO 250
         NUMECP= NUMECP+1
C CHECK FOR DUPLICATION
         NCNTR = ICNTR-1
         DO 210 JCNTR=1,NCNTR
            IF(TYPELP(ICNTR).NE.TYPELP(JCNTR)) GO TO 210
C PRINT DUPLICATION MESSAGE
            IF(MASWRK) WRITE(IW,9060) TYPELP(ICNTR),ICNTR,JCNTR
            IF(.NOT.FRNDLY) GO TO 250
            WRITE(NFT16,9070) TYPELP(ICNTR),IZCORE(ICNTR),LMAX(ICNTR)
            WRITE(NFT16,9080) ATMSYM(ICNTR),LMAX(ICNTR),IZCORE(ICNTR)
            WRITE(NFT16,9090) ATMSYM(ICNTR),LMAX(ICNTR),IZCORE(ICNTR)
            GO TO 250
  210    CONTINUE
C PRINT UNIQUE POTENTIAL
         IF(FRNDLY) MLDDPP= MLDDPP+1
         IF(MASWRK) WRITE(IW,9100)
     *               TYPELP(ICNTR),ICNTR,IZCORE(ICNTR),LMAX(ICNTR)
         IF(FRNDLY) THEN
            WRITE(NFT16,FMT='(4HHOND,A8,2I5)')
     1               TYPELP(ICNTR),      IZCORE(ICNTR),LMAX(ICNTR)
            WRITE(NFT16,FMT='(''GAMECARDS  '',A2)') ATMSYM(ICNTR)
            WRITE(NFT16,FMT='(4HGAME,2I4,4X,''! LMAX, ZCORE'')')
     *                                   LMAX(ICNTR),IZCORE(ICNTR)
            WRITE(NFT16,FMT='(4HGAUS,A2,2I5)')      ATMSYM(ICNTR),
     1                                   LMAX(ICNTR),IZCORE(ICNTR)
         END IF
         LMN = 1
         LMX = LMAX(ICNTR)+1
         IF(FRNDLY) WRITE(NFT16,9110) MLDDPP,ZAN(ICNTR),LMX-2
         DO 240 L=LMN,LMX
            LM1=L-2
            IF(L.EQ.LMN) LM1=LMX-1
            IF(MASWRK) WRITE(IW,9120) LM1
            KF = KFRST(ICNTR,L)
            KL = KLAST(ICNTR,L)
            IF(FRNDLY) THEN
               WRITE(NFT16,9130) KL-KF+1,LM1
               WRITE(NFT16,9140) KL-KF+1,LM1
               WRITE(NFT16,9150) LM1,KL-KF+1
               IF(L.EQ.LMN) THEN
                  MLDAIL= LMX-1
                  MLDIND= 0
                  DO 220 K=KF,KL
                     MLDIND=MLDIND+1
                     MLDAIX(MLDIND)= NLP(K)
                     XMLDAI(MLDIND)= ZLP(K)
                     CMLDAI(MLDIND)= CLP(K)
  220             CONTINUE
               ELSE
            WRITE(NFT16,9160) KL-KF+1,LM1
            WRITE(NFT16,FMT='((4HMELD,(1X,10I3)))')(NLP(K),K=KF,KL)
            WRITE(NFT16,FMT='((4HMELD,(5F16.8)))') (ZLP(K),K=KF,KL)
            WRITE(NFT16,FMT='((4HMELD,(5F16.8)))') (CLP(K),K=KF,KL)
               END IF
            END IF
            KK= 1
            DO 230 K=KF,KL
               IF(MASWRK) WRITE(IW,9170) KK,CLP(K),NLP(K),ZLP(K)
               IF(FRNDLY) THEN
                  CALL ECPPHO(NFT16,NLP(K),CLP(K),ZLP(K))
                  WRITE(NFT16,FMT='(4HGAME,I4,2F16.8)')
     1                              NLP(K),CLP(K),ZLP(K)
                  WRITE(NFT16,FMT='(4HGAUS,I5,2F16.8)')
     1                              NLP(K),ZLP(K),CLP(K)
               END IF
  230       KK= KK+1
  240    CONTINUE
         IF(.NOT.FRNDLY) GO TO 250
         WRITE(NFT16,9180) MLDIND,MLDAIL
         WRITE(NFT16,FMT='((4HMELD,(1X,10I3)))')(MLDAIX(K),K=1,MLDIND)
         WRITE(NFT16,FMT='((4HMELD,(5F16.8)))') (XMLDAI(K),K=1,MLDIND)
         WRITE(NFT16,FMT='((4HMELD,(5F16.8)))') (CMLDAI(K),K=1,MLDIND)
  250 CONTINUE
C
      IF(NUMECP.EQ.0) THEN
         IF(MASWRK) WRITE(IW,9190)
         CALL ABRT
      END IF
C
      IF(FRNDLY) THEN
         WRITE(NFT16,FMT='(''HOND $END'')')
         WRITE(NFT16,9200) MLDDPP
         WRITE(NFT16,FMT='(''GAUS '')')
         CALL FLSHBF(NFT16)
      END IF
C
      NECP= 0
      DO 260 I=1,NATOMS
  260 NECP= NECP+IZCORE(I)
      IF(MASWRK) WRITE(IW,9210) NECP,NE,NA,NB
C
      VNN= ENUC(NATOMS,ZAN,C)
      IF(MASWRK) WRITE(IW,9220) VNN
C
C CHECK FOR THE MAXIMUM BASIS TYPE
C 1 IS ADDED HERE SINCE BASCHK RETURNS THE REAL ANGULAR MOMETUM
C
      CALL BASCHK(MAXANG)
      IF(MAXANG.GE.5) THEN
         IF(MASWRK) WRITE(IW,*) 'ECP INTEGRALS CODED ONLY FOR SPDFG'
         CALL ABRT
      END IF
      MAXANG= MAXANG+1
C
      CALL DERCHK(NUMDER)
      NLIM= MAXANG+NUMDER
C
C CHECK FOR THE MAXIMUM POTENTIAL TYPE: S=0, P=1, ..., G=4 IS OK
C
      LLIM= 0
      DO 270 IAT=1,NATOMS
         LLIM= MAX0(LMAX(IAT),LLIM)
  270 CONTINUE
      NLIM= MAX0(NLIM,LLIM)
C
C TESTS TO SEE IF WE CAN DO THIS RUN ...
C
      IF(MAXANG.GE.6) THEN
         WRITE(IW,9230)
         CALL ABRT
      END IF
C
      IF(LLIM.GE.5) THEN
         WRITE(IW,9240)
         CALL ABRT
      END IF
C
      IF(NUMDER.GT.0 .AND. MAXANG.EQ.6) THEN
         DO 290 JSH=1,NSHELL
            IF(KTYPE(JSH).NE.4) GO TO 290
            DO 280 IAT=1,NATOMS
               IF(KATOM(JSH).EQ.IAT) GO TO 280
               IF(LPSKIP(IAT).EQ.0) THEN
                  WRITE(IW,9250)
                  CALL ABRT
               END IF
  280       CONTINUE
  290    CONTINUE
      END IF
C
C SPECIFY THE MAXIMAL TYPE OF BASIS FUNCTION
C
      NTLIM=(NLIM*(NLIM+1)*(NLIM+2))/6
C
C INITIALIZE NCOEF1 BASED ON NLIM
C
      NCOEF1= 8520
      NCOEF2= 3424
      IF(NLIM.EQ.5) THEN
         NCOEF1= 71660
         NCOEF2= 10555
      ELSE IF(NLIM.EQ.6) THEN
         NCOEF1= 280000
         NCOEF2= 28940
      ELSE IF(NLIM.EQ.7) THEN
         IF(NUMDER.EQ.1) THEN
            NCOEF1= 284868
            NCOEF2= 28940
         ELSE
            NCOEF1= 892584
            NCOEF2= 60382
         END IF
      END IF
C
C LOOK AT -ECCOD1/2- TO SEE THAT -JFST1/2- REALLY DO NEED 1 EXTRA
C
      J1LEN =(NTLIM*NTLIM+NTLIM)/2+1
      J2LEN =(LLIM-1)*(LLIM+1)*NTLIM+NTLIM+1
      J4LEN = J2LEN-1
C
      CALL VALFM(LOADFM)
      LDCF1 = LOADFM+ 1
      LJIN  = LDCF1 + NCOEF1
      LLB1  = LJIN  +(J1LEN-1)/NWDVAR+1
      LDCF2 = LLB1  +(9*NCOEF1)/NWDVAR
      LLJ2  = LDCF2 + NCOEF2
      LLB2  = LLJ2  +(J2LEN-1)/NWDVAR+1
      LFPQR = LLB2  +(6*NCOEF2)/NWDVAR
      LZLM  = LFPQR + 25*25*25
      LLMF  = LZLM  +(581+3)
      LLMX  = LLMF  +(121+3)/NWDVAR
      LLMY  = LLMX  +(581+3)/NWDVAR
      LLMZ  = LLMY  +(581+3)/NWDVAR
      LAST  = LLMZ  +(581+3)/NWDVAR
      NEED  = LAST  - LDCF1
      CALL GETFM(NEED)
      IF(EXETYP.EQ.CHECK) GO TO 300
C
C     ----- ENCODE THE ECP ANGULAR INTEGRALS -----
C
      CALL ECCODR(X(LDCF1),X(LJIN),X(LLB1),X(LDCF2),X(LLJ2),X(LLB2),
     *            X(LFPQR),X(LZLM),X(LLMF),X(LLMX),X(LLMY),X(LLMZ),
     *            NUMDER)
C
      LDAF91=(J1LEN-1)/NWDVAR+1+(9*NCOEF1-1)/NWDVAR+1
      LDAF93=(J2LEN-1)/NWDVAR+1+(6*NCOEF2)/NWDVAR
      CALL DAWRIT(IDAF,IODA,X(LDCF1),NCOEF1,90,0)
      CALL DAWRIT(IDAF,IODA,X(LJIN) ,LDAF91,91,1)
      CALL DAWRIT(IDAF,IODA,X(LDCF2),NCOEF2,92,0)
      CALL DAWRIT(IDAF,IODA,X(LLJ2) ,LDAF93,93,1)
  300 CONTINUE
      CALL RETFM(NEED)
C
  999 CONTINUE
      RETURN
 9010 FORMAT(/10X,14(1H-)/10X,'ECP POTENTIALS'/10X,14(1H-))
 9020 FORMAT('HOND $ECP'/
     *       'GAMEPSEUDO ECP'/
     *       'MELD$'/
     *       'MELD$  ECP-TO-ATOM MAPPING'/
     *       'GAUS!!!! $ECP -- REPLACE THESE LINES',
     *       ' BY ECP CARD DEFINITION:'/
     *       'GAUS!!!!  7 FOR EACH ATOM WITH ECP READ IN,',
     1       '  9 FOR EACH ATOM WITHOUT ECP'/
     2       '!!!!GAUS  IN THE ORDER DEFINED BY ZMAT.')
 9030 FORMAT(/' *** ERROR *** NO $ECP GROUP FOUND FOR ECP=READ'/)
 9040 FORMAT(/' *** ERROR ***'
     *       /' AN UNEXPECTED $END WAS ENCOUNTERED IN $ECP GROUP.'
     *       /' EVERY ATOM IN THE MOLECULE MUST BE DEFINED IN $ECP.'/)
 9050 FORMAT(/' *** ERROR *** EXCEEDED INTERNAL ECP STORAGE'/)
 9060 FORMAT(/' PARAMETERS FOR "',A8,'" ON ATOM ',I4,
     *        ' ARE THE SAME AS ATOM',I4)
 9070 FORMAT('HOND',A8,2I5)
 9080 FORMAT('GAME!!!!   ',A2,4X,2I4,' -- DUPLICATED')
 9090 FORMAT('HGAUS',A2,2I5)
 9100 FORMAT(/' PARAMETERS FOR "',A8,'" ON ATOM ',I4,
     *        ' WITH ZCORE ',I3,' AND LMAX ',I2,' ARE')
 9110 FORMAT('MELD$'/'MELD$  DEFINITION OF ECP NO.',I3,
     *       '. CHANGE ATOMIC CHARGE TO',F4.0/
     *       'MELD',I4,'  $ MAX. L FOR ANGULAR PROJECTION SUM')
 9120 FORMAT(' FOR L=',I2,6X,'COEFF',4X,'N',11X,'ZETA')
 9130 FORMAT('HOND',I5,3X,2HL=,I1)
 9140 FORMAT('GAME',I8,4X,'! NUMBER OF TERMS FOR L=',I1)
 9150 FORMAT('GAUSL=',I1,2X,'COMPONENT'/'GAUS',I2)
 9160 FORMAT('MELD',I4,'  $ NO. OF TERMS FOR L=',I1,
     *       ' TERM IN THE ANGULAR PROJECTOR')
 9170 FORMAT(I5,F15.5,I5,F15.5)
 9180 FORMAT('MELD',I4,'  $ NO. OF TERMS FOR L=',I1,
     *       ' (ANGULAR-INDEPENDENT PART)')
 9190 FORMAT(/' *** ERROR ***'
     *       /' THIS RUN HAS NO ATOMS WITH A CORE POTENTIAL,'
     *       /' BUT THIS RUN DOES NOT SAY ECP=NONE IN $CONTRL.'/)
 9200 FORMAT('MELD$ ===>  THE TOTAL NUMBER OF (USER-DEFINED) ECPS IS',
     *        I3)
 9210 FORMAT(/' THE ECP RUN REMOVES',I5,' CORE ELECTRONS,',
     *        ' AND THE SAME NUMBER OF PROTONS.'
     *       /' NUMBER OF ELECTRONS KEPT IN THE CALCULATION IS =',I5
     *       /' NUMBER OF OCCUPIED ORBITALS (ALPHA) KEPT IS    =',I5
     *       /' NUMBER OF OCCUPIED ORBITALS (BETA ) KEPT IS    =',I5)
 9220 FORMAT(' THE ADJUSTED NUCLEAR REPULSION ENERGY=',F20.10)
 9230 FORMAT(/' THE ECP INTEGRALS ARE LIMITED TO SPDFG BASIS',
     *        ' FUNCTIONS.')
 9240 FORMAT(/' THE ECP INTEGRALS ARE LIMITED TO SPDFG CORE',
     *        ' POTENTIALS.')
 9250 FORMAT(/' THE ECP GRADIENT INTEGRALS ARE LIMITED TO SPD BASIS,'
     *       /' FUNCTIONS, EXCEPT FOR THE FOLLOWING SPECIAL CASE:'
     *       /' IF THE ONLY ATOM WITH F FUNCTIONS IS ALSO'
     *       /'    THE ONLY ATOM WITH A CORE POTENTIAL,'
     *       /' THEN SPDF ECP GRADIENTS ARE POSSIBLE.')
      END
C*MODULE ECPLIB  *DECK ECPPHO
      SUBROUTINE ECPPHO(IOUNIT,INDEX,X1,X2)
C
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
C ... WRITE ECP PARAMETERS IN HONDO 8 FORMAT (F10,I5,F10)
C
      CHARACTER*10 STRING
      CHARACTER*14 LOCAL
      DIMENSION STRING(2),X(2)
C
      PARAMETER (TENTH=0.1D+00)
C
      X(1)=X1
      X(2)=X2
      DO I=1,2
         IF(ABS(X(I)).GT.TENTH) THEN
            WRITE(UNIT=LOCAL,FMT='(G14.8)') X(I)
            STRING(I)=LOCAL(1:10)
         ELSE
            WRITE(UNIT=STRING(I),FMT='(F10.8)') X(I)
         END IF
      ENDDO
      WRITE(UNIT=IOUNIT,FMT='(4HHOND,A10,I5,A10)')
     1      STRING(1),INDEX,STRING(2)
C
      RETURN
      END
C*MODULE ECPLIB  *DECK ERRT
      SUBROUTINE ERRT
C
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
      COMMON /ERRFCM/ C(142),IFRST(20),ILAST(20),H
C
C        -----  ROUTINE ALLOCATES PARAMETERS FOR THE POLYNOMIAL -----
C        -----  FIT TO THE ERROR FUNCTION.                      -----
C
      H = 0.25D+00
C ... 0.00 < X <= 0.25  INTERVAL NO. 1, ABS.ERROR = 5.1496584774213D-
      IFRST( 1)= 1
      ILAST( 1)= 8
      C( 1)= 0.9976905682968D-15
      C( 2)= 0.1128379167616D+01
      C( 3)=-0.6825080083050D-07
      C( 4)=-0.3761237879247D+00
      C( 5)=-0.4362679036164D-04
      C( 6)= 0.1132081528735D+00
      C( 7)=-0.1608829014003D-02
      C( 8)=-0.2383745887450D-01
C ... 0.25 < X <= 0.50  INTERVAL NO. 2, ABS.ERROR = 1.0329515021112D-
      IFRST( 2)= 9
      ILAST( 2)=16
      C( 9)=-0.3265133599788D-05
      C(10)= 0.1128453123654D+01
      C(11)=-0.7236769295451D-03
      C(12)=-0.3721384745633D+00
      C(13)=-0.1348362056472D-01
      C(14)= 0.1412226404729D+00
      C(15)=-0.3539596498013D-01
      C(16)=-0.5454029355730D-02
C ... 0.50 < X <= 0.75  INTERVAL NO. 3, ABS.ERROR = 6.1888272284705D-
      IFRST( 3)=17
      ILAST( 3)=24
      C(17)=-0.1801988094647D-03
      C(18)= 0.1130782166249D+01
      C(19)=-0.1400474656066D-01
      C(20)=-0.3295493300819D+00
      C(21)=-0.9653664285517D-01
      C(22)= 0.2398163462058D+00
      C(23)=-0.1014115256923D+00
      C(24)= 0.1378314835685D-01
C ... 0.75 < X <= 1.00  INTERVAL NO. 4, ABS.ERROR = 1.6626700016786D-
      IFRST( 4)=25
      ILAST( 4)=32
      C(25)=-0.4457991000617D-03
      C(26)= 0.1133670008174D+01
      C(27)=-0.2725712863074D-01
      C(28)=-0.2961333291272D+00
      C(29)=-0.1466850258377D+00
      C(30)= 0.2847021965842D+00
      C(31)=-0.1236317583493D+00
      C(32)= 0.1848162923540D-01
C ... 1.00 < X <= 1.25  INTERVAL NO. 5, ABS.ERROR = 5.4747317790316D-
      IFRST( 5)=33
      ILAST( 5)=40
      C(33)= 0.1036667435991D-01
      C(34)= 0.1060681450430D+01
      C(35)= 0.1844323965440D+00
      C(36)=-0.6381386282176D+00
      C(37)= 0.1857801550899D+00
      C(38)= 0.9020967608584D-01
      C(39)=-0.6022465654782D-01
      C(40)= 0.9593725204468D-02
C ... 1.25 < X <= 1.50  INTERVAL NO. 6, ABS.ERROR = 2.1689317009077D-
      IFRST( 6)=41
      ILAST( 6)=47
      C(41)= 0.5096577645657D-01
      C(42)= 0.8301050352144D+00
      C(43)= 0.7461454169558D+00
      C(44)=-0.1399088183681D+01
      C(45)= 0.8049290742492D+00
      C(46)=-0.2123844940215D+00
      C(47)= 0.2202851573626D-01
C ... 1.50 < X <= 1.75  INTERVAL NO. 7, ABS.ERROR = 5.4356519285648D-
      IFRST( 7)=48
      ILAST( 7)=55
      C(48)= 0.1356983343156D+00
      C(49)= 0.4248183601853D+00
      C(50)= 0.1578617255285D+01
      C(51)=-0.2350907279473D+01
      C(52)= 0.1459137006763D+01
      C(53)=-0.4826721286933D+00
      C(54)= 0.8417719176837D-01
      C(55)=-0.6134748458862D-02
C ... 1.75 < X <= 2.00  INTERVAL NO. 8, ABS.ERROR = 1.3677947663382D-
      IFRST( 8)=56
      ILAST( 8)=63
      C(56)= 0.5650617287234D-01
      C(57)= 0.7303727164846D+00
      C(58)= 0.1073427393133D+01
      C(59)=-0.1886956498357D+01
      C(60)= 0.1203543744299D+01
      C(61)=-0.3982083398317D+00
      C(62)= 0.6867500288146D-01
      C(63)=-0.4915782383510D-02
C ... 2.00 < X <= 2.25  INTERVAL NO. 9, ABS.ERROR = 2.7604585284280D-
      IFRST( 9)=64
      ILAST( 9)=70
      C(64)=-0.7044612080369D+00
      C(65)= 0.3313423632378D+01
      C(66)=-0.2688303271381D+01
      C(67)= 0.1159938873721D+01
      C(68)=-0.2789363703341D+00
      C(69)= 0.3510668004553D-01
      C(70)=-0.1778023938338D-02
C ... 2.25 < X <= 2.50  INTERVAL NO.10, ABS.ERROR = 1.8687273950491D-
      IFRST(10)=71
      ILAST(10)=77
      C(71)=-0.8530571392369D+00
      C(72)= 0.3718753089373D+01
      C(73)=-0.3149110592528D+01
      C(74)= 0.1439416506820D+01
      C(75)=-0.3743063133443D+00
      C(76)= 0.5246810708195D-01
      C(77)=-0.3095234433810D-02
C ... 2.50 < X <= 2.75  INTERVAL NO.11, ABS.ERROR = 9.7095664841618D-
      IFRST(11)=78
      ILAST(11)=84
      C(78)=-0.6325006110506D+00
      C(79)= 0.3195352274705D+01
      C(80)=-0.2631359977752D+01
      C(81)= 0.1166146516443D+01
      C(82)=-0.2931400812425D+00
      C(83)= 0.3960487060249D-01
      C(84)=-0.2245448529720D-02
C ... 2.75 < X <= 3.00  INTERVAL NO.12, ABS.ERROR = 7.6525452641363D-
      IFRST(12)=85
      ILAST(12)=91
      C(85)=-0.1578663656307D+00
      C(86)= 0.2160403160352D+01
      C(87)=-0.1690605397678D+01
      C(88)= 0.7098560625163D+00
      C(89)=-0.1685917225356D+00
      C(90)= 0.2146466169506D-01
      C(91)=-0.1144051551819D-02
C ... 3.00 < X <= 3.25  INTERVAL NO.13, ABS.ERROR = 3.9079850466806D-
      IFRST(13)=92
      ILAST(13)=98
      C(92)= 0.3337223693570D+00
      C(93)= 0.1174814163831D+01
      C(94)=-0.8669311383990D+00
      C(95)= 0.3425820853154D+00
      C(96)=-0.7643589524863D-01
      C(97)= 0.9127119866510D-02
      C(98)=-0.4555632670720D-03
C ... 3.25 < X <= 3.50  INTERVAL NO.14, ABS.ERROR = 1.5241141682054D-
      IFRST(14)= 99
      ILAST(14)=105
      C( 99)= 0.6858505344288D+00
      C(100)= 0.5221032227938D+00
      C(101)=-0.3626430750192D+00
      C(102)= 0.1347162453894D+00
      C(103)=-0.2822370117065D-01
      C(104)= 0.3161233228942D-02
      C(105)=-0.1478642225266D-03
C ... 3.50 < X <= 3.75  INTERVAL NO.15, ABS.ERROR = 9.5496943686157D-
      IFRST(15)=106
      ILAST(15)=111
      C(106)= 0.9680982760858D+00
      C(107)= 0.4187846825891D-01
      C(108)=-0.2202918541743D-01
      C(109)= 0.5803572496370D-02
      C(110)=-0.7656564703211D-03
      C(111)= 0.4046317189932D-04
C ... 3.75 < X <= 4.00  INTERVAL NO.16, ABS.ERROR = 2.2239987629291D-
      IFRST(16)=112
      ILAST(16)=117
      C(112)= 0.9910262142894D+00
      C(113)= 0.1110389476297D-01
      C(114)=-0.5503022341054D-02
      C(115)= 0.1365301693295D-02
      C(116)=-0.1695606159046D-03
      C(117)= 0.8432380855083D-05
C ... 4.00 < X <= 4.25  INTERVAL NO.17, ABS.ERROR = 4.4764192352886D-
      IFRST(17)=118
      ILAST(17)=123
      C(118)= 0.9978511542662D+00
      C(119)= 0.2512562013763D-02
      C(120)=-0.1176282812867D-02
      C(121)= 0.2755980203801D-03
      C(122)=-0.3231375012547D-04
      C(123)= 0.1516751945019D-05
C ... 4.25 < X <= 4.50  INTERVAL NO.18, ABS.ERROR = 9.9475983006414D-
      IFRST(18)=124
      ILAST(18)=129
      C(124)= 0.9995577955752D+00
      C(125)= 0.4898449770963D-03
      C(126)=-0.2172069044718D-03
      C(127)= 0.4819046007469D-04
      C(128)=-0.5349400453269D-05
      C(129)= 0.2376735210419D-06
C ... 4.50 < X <= 4.75  INTERVAL NO.19, ABS.ERROR = 6.0396132539609D-
      IFRST(19)=130
      ILAST(19)=135
      C(130)= 0.9999195780401D+00
      C(131)= 0.8461205943888D-04
      C(132)=-0.3562696920198D-04
      C(133)= 0.7504334644182D-05
      C(134)=-0.7907161489129D-06
      C(135)= 0.3334134817123D-07
C ... 4.75 < X <= 5.00  INTERVAL NO.20, ABS.ERROR = 7.4429351570870D-
      IFRST(20)=136
      ILAST(20)=142
      C(136)= 0.8965357422439D+00
      C(137)= 0.1272754720567D+00
      C(138)=-0.6523024655166D-01
      C(139)= 0.1782843628219D-01
      C(140)=-0.2740698420287D-02
      C(141)= 0.2246825024486D-03
      C(142)=-0.7674098014832D-05
      RETURN
      END
C*MODULE ECPLIB  *DECK FTAB
      SUBROUTINE FTAB(FPQR,NMAX)
C
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
      DIMENSION FPQR(25,25,25)
C
      COMMON /IOFILE/ IR,IW,IP,IJK,IPK,IDAF,NAV,IODA(950)
C
      INTEGER P,Q,R
C
C FOR NMAX= 6, N4MAX= 4*NMAX+1=25, AND 3*N4MAX-2=73
      DIMENSION REC(73)
C
C        -----  ROUTINE SETS A TABLE OF F-FUNCTION VALUES.      -----
C WHERE F MEANS THE ANGULAR INTEGRAL GIVEN BY:
C INT[DW X^R Y^S Z^T = O FOR R, S, OR T ODD
C                    =(R-1)!!(S-1)!!(T-1)!!/(R+S+T+1)!!
C                      FOR R, S, AND T EVEN
C NEEDS DIMENSION 4*(MAX REAL ANGULAR MOMENTUM) + 1
C WHERE 1 IS ADDED SINCE WE REALLY NEED THE 0-TH ELEMENT
C THUS FOR F GRADIENTS NEED G(4) SO 4*4+1=17
C
      PARAMETER (ONE=1.0D+00, TWO=2.0D+00, FPI=12.566370614359D+00)
C
      N4MAX = 4*NMAX+1
      IF(N4MAX.GT.25) THEN
         WRITE(IW,9010) NMAX
         CALL ABRT
      END IF
C
      DEN= ONE+TWO
      DO 110 P=3,3*N4MAX-2,2
         REC(P)= ONE/DEN
  110 DEN= DEN+TWO
C
C        -----  ZERO OUT THE TABLE.                             -----
      DO 120 P=1,N4MAX
        DO 120 Q=1,N4MAX
          DO 120 R=1,N4MAX
  120 FPQR(R,Q,P)= 0.0D+00
C        -----  RECURSIVELY GENERATE NON-ZERO ENTRIES.          -----
      FPQR(1,1,1)= FPI
      PM2=-ONE
      DO 150 P=1,N4MAX,2
         QM2=-ONE
         DO 140 Q=1,N4MAX,2
            RM2=-ONE
            DO 130 R=1,N4MAX,2
               IF(P.GT.1) THEN
                  FPQR(P,Q,R)= PM2*FPQR(P-2,Q,R)*REC(P-2+Q+R)
               ELSE IF(Q.GT.1) THEN
                  FPQR(P,Q,R)= QM2*FPQR(P,Q-2,R)*REC(P+Q-2+R)
               ELSE IF(R.GT.1) THEN
                  FPQR(P,Q,R)= RM2*FPQR(P,Q,R-2)*REC(P+Q+R-2)
               END IF
  130       RM2= RM2+TWO
  140    QM2= QM2+TWO
  150 PM2= PM2+TWO
C
      RETURN
 9010 FORMAT(' FTAB: NMAX TOO LARGE =',I3)
      END
C*MODULE ECPLIB  *DECK ZTAB
      SUBROUTINE ZTAB(ZLM)
C
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
      DIMENSION ZLM(*)
C
C        -----  ROUTINE SETS UP THE REAL SPHERICAL HARMONICS    -----
C        -----  IN THE FORM OF LINEAR COMBINATIONS OF           -----
C        -----  CARTESIAN PRODUCTS.                             -----
C IN OTHER WORDS THESE ARE THE COEFFICIENTS OF THE SPHERICAL HARMONICS
C AFTER CONVERTING TO PRODUCTS OF CARTESIAN FUNCTIONS.  THESE ARE
C INDEXED BY LMF AND LML TO BE MATCHED WITH THE CORRECT CARTESIAN
C POWERS SPECIFIED IN LMX, LMY, LMZ. THE MAXIMUM L VALUE REQUIRED IS
C THE SUM OF THE MAXIMUM L VALUES FOR THE TWO BASIS FUNCTION INVOLVED IN
C THE INTEGRAL. THUS TO DO F-GRADIENTS YOU NEED (3+4)=7 AS THE MAXIMUM L
C THESE WILL MATCH THE FORMULA'S GIVEN IN DECK ZFN
C
      PARAMETER (ONE=1.0D+00, TWO=2.0D+00, THR=3.0D+00, FOR=4.0D+00,
     2           FIV=5.0D+00, SIX=6.0D+00, SEV=7.0D+00, EIT=8.0D+00,
     3           F09=9.0D+00, TEN=10.0D+00, F11=11.0D+00, F13=13.0D+00,
     4           F15=15.0D+00, F17=17.0D+00, F19=19.0D+00)
      PARAMETER (ZP5=0.5D+00, FPI=12.566370614359D+00)
C
      DIMENSION FAP(0:17),FAT(0:17)
C
CJMS  LET'S SAVE SOME SQRT CALCULATIONS
C
CC    FAP(0)= SQRT(ONE/(4.0D+00*PI))
CC    FAP(1)= SQRT(ONE/(8.0D+00*PI))
CC     ....
CC    FAP(I)= SQRT(ONE/(4.0D+00*PI)/(2**I))
C
      FAP(0)= SQRT(ONE/FPI)
      FAP(1)= FAP(0)/ SQRT(TWO)
      DO 110 I=2,16,2
         FAP(I  )= FAP(I-2)*ZP5
         FAP(I+1)= FAP(I-1)*ZP5
  110 CONTINUE
      DO 120 I=0,17
  120 FAT(I)= FAP(I)*THR
C
      SR3= SQRT(THR)
      SR5= SQRT(FIV)
      SR7= SQRT(SEV)
      S11= SQRT(F11)
      S13= SQRT(F13)
      S15= SQRT(F15)
      S17= SQRT(F17)
      S19= SQRT(F19)
C
      S3BYS5= SR3*SR5
      S3BYS7= SR3*SR7
      S5BYS7= SR5*SR7
      S5XS11= SR5*S11
      S7XS11= SR7*S11
      S7XS13= SR7*S13
      SR0119= SQRT(119.0D+00)
      SR0221= SQRT(221.0D+00)
      SR0247= SQRT(247.0D+00)
      SR0323= SQRT(323.0D+00)
      SR0385= S5BYS7*S11
      SR1001= S7XS11*S13
      SR3003= SR1001*SR3
      SR5005= SR1001*SR5
      SR1309= S7XS11*S17
      SR1365= S3BYS5*S7XS13
      SR2431= SR0221*S11
      S13585= SR0247*S5XS11
CJMS
C ---
C L= 0, ML= 0
      ZLM(  1)= FAP(0)
C ---
C L= 1, ML=+1,0,-1
C     POWERS (X, Z, Y)
      ZLM(  2)= SR3*FAP(0)
      ZLM(  3)= ZLM(  2)
      ZLM(  4)= ZLM(  2)
C ---
C L= 2, ML=+2...-2
C     POWERS ([5]X^2+[6]Y^2,[7]XZ,[8]Z^2+[9],[10]YZ,[11]XY)
      ZLM(  5)= S15*FAP(2)
      ZLM(  6)=-ZLM(  5)
      ZLM(  7)= ZLM(  5)*TWO
      TEMP    = SR5*FAP(2)
      ZLM(  8)= TEMP*THR
      ZLM(  9)=-TEMP
      ZLM( 10)= ZLM(  7)
      ZLM( 11)= ZLM(  7)
C ---
C L= 3, ML=+3...-3
C     POWERS ([12]X^3+[13]XY^2,[14]X^2Z+[15]Y^2Z,[16]XZ^2+[17]X,
C             [18]Z^3+[19]Z,[20]YZ^2+[21]Y,[22]XYZ,[23]X^2Y+[24]Y^3)
      ZLM( 12)= S5BYS7*FAP(3)
      ZLM( 13)=-ZLM( 12)*THR
      ZLM( 14)= S3BYS7*SR5*FAP(2)
      ZLM( 15)=-ZLM( 14)
      TEMP    = S3BYS7*FAP(3)
      ZLM( 16)= TEMP*FIV
      ZLM( 17)=-TEMP
      TEMP    = SR7*FAP(2)
      ZLM( 18)= TEMP*FIV
      ZLM( 19)=-TEMP*THR
      ZLM( 20)= ZLM( 16)
      ZLM( 21)= ZLM( 17)
      ZLM( 22)= ZLM( 14)*TWO
      ZLM( 23)=-ZLM( 13)
      ZLM( 24)=-ZLM( 12)
C ---
C L= 4, ML=+4...-4
      ZLM( 25)= S5BYS7*FAT(6)
      ZLM( 26)=-ZLM( 25)*SIX
      ZLM( 27)= ZLM( 25)
      ZLM( 28)= S5BYS7*FAT(3)
      ZLM( 29)=-ZLM( 28)*THR
      TEMP    = SR5*FAT(4)
      ZLM( 30)= TEMP*SEV
      ZLM( 31)=-ZLM( 30)
      ZLM( 32)= TEMP
      ZLM( 33)=-TEMP
      TEMP    = SR5*FAT(3)
      ZLM( 34)= TEMP*SEV
      ZLM( 35)=-TEMP*THR
      TEMP    = FAT(6)
      ZLM( 36)= TEMP*FIV*SEV
      ZLM( 37)=-TEMP*FIV*SIX
      ZLM( 38)= TEMP*THR
      ZLM( 39)= ZLM( 34)
      ZLM( 40)= ZLM( 35)
      TEMP    = SR5*FAT(2)
      ZLM( 41)= TEMP*SEV
      ZLM( 42)=-TEMP
      ZLM( 43)=-ZLM( 29)
      ZLM( 44)=-ZLM( 28)
      ZLM( 45)= S5BYS7*FAT(2)
      ZLM( 46)=-ZLM( 45)
C ---
C L= 5, ML=+5...-5
      ZLM( 47)= S7XS11*FAT(7)
      ZLM( 48)=-ZLM( 47)*TEN
      ZLM( 49)= ZLM( 47)*FIV
      ZLM( 50)= SR0385*FAT(6)
      ZLM( 51)=-ZLM( 50)*SIX
      ZLM( 52)= ZLM( 50)
      TEMP    = SR0385*FAP(7)
      ZLM( 53)= TEMP*THR*THR
      ZLM( 54)=-TEMP*THR*F09
      ZLM( 55)= TEMP*THR
      ZLM( 56)=-TEMP
      TEMP    = SR0385*SR3*FAP(4)
      ZLM( 57)= TEMP*THR
      ZLM( 58)=-ZLM( 57)
      ZLM( 59)=-TEMP
      ZLM( 60)= TEMP
      TEMP    = S3BYS5*S11*FAP(6)
      ZLM( 61)= TEMP*21.0D+00
      ZLM( 62)=-TEMP*14.0D+00
      ZLM( 63)= TEMP
      TEMP    = S11*FAP(6)
      ZLM( 64)= TEMP*63.0D+00
      ZLM( 65)=-TEMP*70.0D+00
      ZLM( 66)= TEMP*15.0D+00
      ZLM( 67)= ZLM( 61)
      ZLM( 68)= ZLM( 62)
      ZLM( 69)= ZLM( 63)
      TEMP    = SR0385*SR3*FAP(2)
      ZLM( 70)= TEMP*THR
      ZLM( 71)=-TEMP
      ZLM( 72)=-ZLM( 54)
      ZLM( 73)=-ZLM( 55)
      ZLM( 74)=-ZLM( 53)
      ZLM( 75)=-ZLM( 56)
      ZLM( 76)= SR0385*FAT(2)
      ZLM( 77)=-ZLM( 76)
      ZLM( 78)= ZLM( 49)
      ZLM( 79)= ZLM( 48)
      ZLM( 80)= ZLM( 47)
C ---
C L= 6, ML=+6...-6
      ZLM( 81)= SR3003*FAP(9)
      ZLM( 82)=-ZLM( 81)*F15
      ZLM( 83)=-ZLM( 82)
      ZLM( 84)=-ZLM( 81)
      ZLM( 85)= SR1001*FAT(7)
      ZLM( 86)=-ZLM( 85)*TEN
      ZLM( 87)= ZLM( 85)*FIV
      TEMP    = S7XS13*FAT(8)
      ZLM( 88)= TEMP*F11
      ZLM( 89)=-TEMP*F11*SIX
      ZLM( 90)= ZLM( 88)
      ZLM( 91)=-TEMP
      ZLM( 92)= TEMP*SIX
      ZLM( 93)=-TEMP
      TEMP    = SR1365*FAP(7)
      ZLM( 94)= TEMP*F11
      ZLM( 95)=-TEMP*THR*F11
      ZLM( 96)= TEMP*THR*THR
      ZLM( 97)=-TEMP*THR
      TEMP    = SR1365*FAP(9)
      ZLM( 98)= TEMP*THR*F11
      ZLM( 99)=-ZLM( 98)
      ZLM(100)=-TEMP*THR*SIX
      ZLM(101)= TEMP*THR*SIX
      ZLM(102)= TEMP
      ZLM(103)=-TEMP
      TEMP    = S3BYS7*S13*FAP(6)
      ZLM(104)= TEMP*THR*F11
      ZLM(105)=-TEMP*THR*TEN
      ZLM(106)= TEMP*FIV
      TEMP    = S13*FAP(8)
      ZLM(107)= TEMP*231.0D+00
      ZLM(108)=-TEMP*315.0D+00
      ZLM(109)= TEMP*105.0D+00
      ZLM(110)=-TEMP*FIV
      ZLM(111)= ZLM(104)
      ZLM(112)= ZLM(105)
      ZLM(113)= ZLM(106)
      TEMP    = SR1365*FAP(7)
      ZLM(114)= TEMP*THR*F11
      ZLM(115)=-TEMP*THR*SIX
      ZLM(116)= TEMP
      ZLM(117)=-ZLM( 95)
      ZLM(118)=-ZLM( 94)
      ZLM(119)=-ZLM( 96)
      ZLM(120)=-ZLM( 97)
      TEMP    = S7XS13*FAT(4)
      ZLM(121)= TEMP*F11
      ZLM(122)=-ZLM(121)
      ZLM(123)=-TEMP
      ZLM(124)= TEMP
      ZLM(125)= ZLM( 87)
      ZLM(126)= ZLM( 86)
      ZLM(127)= ZLM( 85)
      TEMP    = SR3003*FAP(9)
      ZLM(128)= TEMP*SIX
      ZLM(129)=-TEMP*20.0D+00
      ZLM(130)= ZLM(128)
C ---
C L= 7, ML=-7
      ZLM(131)= S5XS11*S13*FAT(10)
      ZLM(132)= ZLM(131)*SEV*FIV
      ZLM(133)=-ZLM(131)*SEV*THR
      ZLM(134)=-ZLM(131)*SEV
C L= 7, ML=-6
      ZLM(135)= SR5005*FAT(9)
      ZLM(136)=-ZLM(135)*F15
      ZLM(137)=-ZLM(135)
      ZLM(138)=-ZLM(136)
C L= 7, ML=-5
      TEMP    = SR0385*FAT(10)
      ZLM(139)= TEMP*F13
      ZLM(140)=-ZLM(139)*TEN
      ZLM(141)= ZLM(139)*FIV
      ZLM(142)=-TEMP
      ZLM(143)=-ZLM(142)*TEN
      ZLM(144)= ZLM(142)*FIV
C L= 7, ML=-4
      TEMP    = SR0385*FAT(8)
      ZLM(145)= TEMP*F13
      ZLM(146)=-TEMP*F13*SIX
      ZLM(147)= ZLM(145)
      ZLM(148)=-TEMP*THR
      ZLM(149)= TEMP*THR*SIX
      ZLM(150)= ZLM(148)
C L= 7, ML=-3
      TEMP    = S5BYS7*FAT(10)
      ZLM(151)= TEMP*F11*F13
      ZLM(152)=-ZLM(151)*THR
      ZLM(153)=-TEMP*F11*SIX
      ZLM(154)=-ZLM(153)*THR
      ZLM(155)= TEMP*THR
      ZLM(156)=-TEMP*F09
C L= 7, ML=-2
      TEMP    = S5BYS7*FAT(9)
      ZLM(157)= TEMP*F11*F13
      ZLM(158)=-ZLM(157)
      ZLM(159)=-TEMP*F11*TEN
      ZLM(160)=-ZLM(159)
      ZLM(161)= TEMP*F15
      ZLM(162)=-ZLM(161)
C L= 7, ML=-1
      TEMP    = SR7*S15*FAP(10)
      ZLM(163)= TEMP*429.0D+00
      ZLM(164)=-TEMP*495.0D+00
      ZLM(165)= TEMP*135.0D+00
      ZLM(166)=-TEMP*FIV
C L= 7, ML= 0
      TEMP    = S15*FAP(8)
      ZLM(167)= TEMP*429.0D+00
      ZLM(168)=-TEMP*693.0D+00
      ZLM(169)= TEMP*315.0D+00
      ZLM(170)=-TEMP*35.0D+00
C L= 7, ML= 1
      ZLM(171)= ZLM(163)
      ZLM(172)= ZLM(164)
      ZLM(173)= ZLM(165)
      ZLM(174)= ZLM(166)
C L= 7, ML= 2
      ZLM(175)= ZLM(157)*TWO
      ZLM(176)= ZLM(159)*TWO
      ZLM(177)= ZLM(161)*TWO
C L= 7, ML= 3
      ZLM(178)=-ZLM(152)
      ZLM(179)=-ZLM(151)
      ZLM(180)=-ZLM(154)
      ZLM(181)=-ZLM(153)
      ZLM(182)=-ZLM(156)
      ZLM(183)=-ZLM(155)
C L= 7, ML= 4
      ZLM(184)= ZLM(145)*FOR
      ZLM(185)=-ZLM(184)
      ZLM(186)= ZLM(148)*FOR
      ZLM(187)=-ZLM(186)
C L= 7, ML= 5
      ZLM(188)= ZLM(141)
      ZLM(189)= ZLM(140)
      ZLM(190)= ZLM(139)
      ZLM(191)= ZLM(144)
      ZLM(192)= ZLM(143)
      ZLM(193)= ZLM(142)
C L= 7, ML= 6
      TEMP    = SR5005*FAT(7)
      ZLM(194)= TEMP*THR
      ZLM(195)=-TEMP*TEN
      ZLM(196)= ZLM(194)
C L= 7, ML= 7
      ZLM(197)=-ZLM(131)
      ZLM(198)=-ZLM(132)
      ZLM(199)=-ZLM(133)
      ZLM(200)=-ZLM(134)
C ---
C L= 8, ML=-8
      ZLM(201)= SR2431*SR5*FAT(14)
      ZLM(202)=-ZLM(201)*2.8D+01
      ZLM(203)= ZLM(201)*7.0D+01
      ZLM(204)= ZLM(202)
      ZLM(205)= ZLM(201)
C L= 8, ML=-7
      ZLM(206)= SR2431*SR5*FAT(10)
      ZLM(207)=-ZLM(206)*SEV*THR
      ZLM(208)= ZLM(206)*SEV*FIV
      ZLM(209)=-ZLM(206)*SEV
C L= 8, ML=-6
      TEMP    = SR2431*SR3*FAP(11)
      ZLM(210)= TEMP*F15
      ZLM(211)=-ZLM(210)*F15
      ZLM(212)=-ZLM(211)
      ZLM(213)=-ZLM(210)
      ZLM(214)=-TEMP
      ZLM(215)= ZLM(210)
      ZLM(216)=-ZLM(215)
      ZLM(217)= TEMP
C L= 8, ML=-5
      TEMP    = SR1001*S17*FAT(10)
      ZLM(218)= TEMP*FIV
      ZLM(219)=-ZLM(218)*TEN
      ZLM(220)= ZLM(218)*FIV
      ZLM(221)=-TEMP
      ZLM(222)= TEMP*TEN
      ZLM(223)= ZLM(221)*FIV
C L= 8, ML=-4
      TEMP    = SR1309*FAT(12)
      ZLM(224)= TEMP*F13*FIV
      ZLM(225)= ZLM(224)
      ZLM(226)=-ZLM(224)*SIX
      ZLM(227)=-TEMP*F13*TWO
      ZLM(228)= ZLM(227)
      ZLM(229)=-ZLM(227)*SIX
      ZLM(230)= TEMP
      ZLM(231)= TEMP
      ZLM(232)=-TEMP*SIX
C L= 8, ML=-3
      TEMP    = SR1309*S3BYS5*FAP(10)
      ZLM(233)= TEMP*F13*THR
      ZLM(234)=-ZLM(233)*THR
      ZLM(235)=-TEMP*F13*TWO
      ZLM(236)=-ZLM(235)*THR
      ZLM(237)= TEMP*THR
      ZLM(238)=-ZLM(237)*THR
C L= 8, ML=-2
      TEMP    = SR0119*SR5*FAT(11)
      ZLM(239)= TEMP*F11*F13
      ZLM(240)=-ZLM(239)
      ZLM(241)= ZLM(240)
      ZLM(242)= ZLM(239)
      ZLM(243)= TEMP*F11*THR
      ZLM(244)=-ZLM(243)
      ZLM(245)=-TEMP
      ZLM(246)= TEMP
C L= 8, ML=-1
      TEMP    = S17*FAT(10)
      ZLM(247)= TEMP*7.15D+02
      ZLM(248)=-TEMP*1.001D+03
      ZLM(249)= TEMP*3.85D+02
      ZLM(250)=-TEMP*3.5D+01
C L= 8, ML= 0
      TEMP    = S17*FAP(14)
      ZLM(251)= TEMP*6.435D+03
      ZLM(252)=-TEMP*1.2012D+04
      ZLM(253)= TEMP*6.930D+03
      ZLM(254)=-TEMP*1.260D+03
      ZLM(255)= TEMP*3.5D+01
C L= 8, ML= 1
      ZLM(256)= ZLM(247)
      ZLM(257)= ZLM(248)
      ZLM(258)= ZLM(249)
      ZLM(259)= ZLM(250)
C L= 8, ML= 2
      TEMP    = SR0119*SR5*FAT(9)
      ZLM(260)= TEMP*F11*F13
      ZLM(261)=-ZLM(260)
      ZLM(262)= TEMP*F11*THR
      ZLM(263)=-TEMP
C L= 8, ML= 3
      ZLM(264)=-ZLM(234)
      ZLM(265)=-ZLM(233)
      ZLM(266)=-ZLM(236)
      ZLM(267)=-ZLM(235)
      ZLM(268)=-ZLM(238)
      ZLM(269)=-ZLM(237)
C L= 8, ML= 4
      TEMP    = SR1309*FAT(8)
      ZLM(270)= TEMP*F13*FIV
      ZLM(271)=-ZLM(270)
      ZLM(272)=-TEMP*F13*TWO
      ZLM(273)=-ZLM(272)
      ZLM(274)= TEMP
      ZLM(275)=-TEMP
C L= 8, ML= 5
      TEMP    = SR1001*S17*FAT(10)
      ZLM(276)= TEMP*FIV*FIV
      ZLM(277)=-TEMP*FIV*TEN
      ZLM(278)= TEMP*FIV
      ZLM(279)=-TEMP*FIV
      ZLM(280)= TEMP*TEN
      ZLM(281)=-TEMP
C L= 8, ML= 6
      TEMP    = SR2431*SR3*FAP(9)
      ZLM(282)= TEMP*F15*THR
      ZLM(283)=-TEMP*F15*TEN
      ZLM(284)= ZLM(282)
      ZLM(285)=-TEMP*THR
      ZLM(286)= TEMP*TEN
      ZLM(287)= ZLM(285)
C L= 8, ML= 7
      ZLM(288)=-ZLM(209)
      ZLM(289)=-ZLM(208)
      ZLM(290)=-ZLM(207)
      ZLM(291)=-ZLM(206)
C L= 8, ML= 8
      ZLM(292)= ZLM(201)*EIT
      ZLM(293)=-ZLM(292)*SEV
      ZLM(294)=-ZLM(293)
      ZLM(295)=-ZLM(292)
C ---
C L= 9, ML=-9
      ZLM(296)= S13585*S17*FAP(15)
      ZLM(297)=-ZLM(296)*3.6D+01
      ZLM(298)= ZLM(296)*1.26D+02
      ZLM(299)=-ZLM(296)*8.4D+01
      ZLM(300)= ZLM(296)*9.0D+00
C L= 9, ML=-8
      ZLM(301)= S13585*S17*FAT(14)
      ZLM(302)=-ZLM(301)*SEV*FOR
      ZLM(303)= ZLM(301)*SEV*TEN
      ZLM(304)= ZLM(302)
      ZLM(305)= ZLM(301)
C L= 9, ML=-7
      TEMP    = S13585*FAT(15)
      ZLM(306)= TEMP*F17
      ZLM(307)=-ZLM(306)*SEV*THR
      ZLM(308)= ZLM(306)*SEV*FIV
      ZLM(309)=-ZLM(306)*SEV
      ZLM(310)=-TEMP
      ZLM(311)= TEMP*SEV*THR
      ZLM(312)=-TEMP*SEV*FIV
      ZLM(313)= TEMP*SEV
C L= 9, ML=-6
      TEMP    = SR0247*S11*S15*FAP(11)
      ZLM(314)= TEMP*F17
      ZLM(315)=-ZLM(314)*F15
      ZLM(316)=-ZLM(315)
      ZLM(317)=-ZLM(314)
      ZLM(318)=-TEMP*THR
      ZLM(319)=-ZLM(318)*F15
      ZLM(320)=-ZLM(319)
      ZLM(321)=-ZLM(318)
C L= 9, ML=-5
      TEMP    = SR0247*S11*FAT(13)
      ZLM(322)= TEMP*FIV*F17
      ZLM(323)=-ZLM(322)*TEN
      ZLM(324)= ZLM(322)*FIV
      ZLM(325)=-TEMP*FIV*SIX
      ZLM(326)=-ZLM(325)*TEN
      ZLM(327)= ZLM(325)*FIV
      ZLM(328)= TEMP
      ZLM(329)=-TEMP*TEN
      ZLM(330)= TEMP*FIV
C L= 9, ML=-4
      TEMP    = SR5005*S19*FAT(12)
      ZLM(331)= TEMP*F17
      ZLM(332)= ZLM(331)
      ZLM(333)=-ZLM(331)*SIX
      ZLM(334)=-TEMP*TEN
      ZLM(335)= ZLM(334)
      ZLM(336)=-ZLM(334)*SIX
      ZLM(337)= TEMP
      ZLM(338)= TEMP
      ZLM(339)=-TEMP*SIX
C L= 9, ML=-3
      TEMP    = S3BYS5*S7XS11*S19*FAP(13)
      ZLM(340)= TEMP*2.21D+02
      ZLM(341)=-ZLM(340)*THR
      ZLM(342)=-TEMP*F13*THR*FIV
      ZLM(343)=-ZLM(342)*THR
      ZLM(344)= TEMP*F13*THR
      ZLM(345)=-ZLM(344)*THR
      ZLM(346)=-TEMP
      ZLM(347)= TEMP*THR
C L= 9, ML=-2
      TEMP    = S5XS11*S19*FAT(11)
      ZLM(348)= TEMP*2.21D+02
      ZLM(349)=-ZLM(348)
      ZLM(350)=-TEMP*SEV*F13*THR
      ZLM(351)=-ZLM(350)
      ZLM(352)= TEMP*SEV*F13
      ZLM(353)=-ZLM(352)
      ZLM(354)=-TEMP*SEV
      ZLM(355)=-ZLM(354)
C L= 9, ML=-1
      TEMP    = SR5*S19*FAT(14)
      ZLM(356)= TEMP*2.431D+03
      ZLM(357)=-TEMP*4.004D+03
      ZLM(358)= TEMP*2.002D+03
      ZLM(359)=-TEMP*3.08D+02
      ZLM(360)= TEMP*SEV
C L= 9, ML= 0
      TEMP    = S19*FAP(14)
      ZLM(361)= TEMP*1.2155D+04
      ZLM(362)=-TEMP*2.5740D+04
      ZLM(363)= TEMP*1.8018D+04
      ZLM(364)=-TEMP*4.620D+03
      ZLM(365)= TEMP*3.15D+02
C L= 9, ML= 1
      ZLM(366)= ZLM(356)
      ZLM(367)= ZLM(357)
      ZLM(368)= ZLM(358)
      ZLM(369)= ZLM(359)
      ZLM(370)= ZLM(360)
C L= 9, ML= 2
      TEMP    = S5XS11*S19*FAT(9)
      ZLM(371)= TEMP*2.21D+02
      ZLM(372)=-TEMP*2.73D+02
      ZLM(373)= TEMP*9.1D+01
      ZLM(374)=-TEMP*SEV
C L= 9, ML= 3
      ZLM(375)=-ZLM(341)
      ZLM(376)=-ZLM(340)
      ZLM(377)=-ZLM(343)
      ZLM(378)=-ZLM(342)
      ZLM(379)=-ZLM(345)
      ZLM(380)=-ZLM(344)
      ZLM(381)=-ZLM(347)
      ZLM(382)=-ZLM(346)
C L= 9, ML= 4
      TEMP    = SR5005*S19*FAT(8)
      ZLM(383)= TEMP*F17
      ZLM(384)=-ZLM(383)
      ZLM(385)=-TEMP*TEN
      ZLM(386)=-ZLM(385)
      ZLM(387)= TEMP
      ZLM(388)=-ZLM(387)
C L= 9, ML= 5
      ZLM(389)= ZLM(324)
      ZLM(390)= ZLM(323)
      ZLM(391)= ZLM(322)
      ZLM(392)= ZLM(327)
      ZLM(393)= ZLM(326)
      ZLM(394)= ZLM(325)
      ZLM(395)= ZLM(330)
      ZLM(396)= ZLM(329)
      ZLM(397)= ZLM(328)
C L= 9, ML= 6
      TEMP    = SR0247*S3BYS5*S11*FAP(9)
      ZLM(398)= TEMP*F17*THR
      ZLM(399)=-TEMP*F17*TEN
      ZLM(400)= ZLM(398)
      ZLM(401)=-TEMP*THR*THR
      ZLM(402)= TEMP*THR*TEN
      ZLM(403)= ZLM(401)
C L= 9, ML= 7
      ZLM(404)=-ZLM(309)
      ZLM(405)=-ZLM(308)
      ZLM(406)=-ZLM(307)
      ZLM(407)=-ZLM(306)
      ZLM(408)=-ZLM(313)
      ZLM(409)=-ZLM(312)
      ZLM(410)=-ZLM(311)
      ZLM(411)=-ZLM(310)
C L= 9, ML= 8
      ZLM(412)= ZLM(301)*EIT
      ZLM(413)=-ZLM(412)*SEV
      ZLM(414)=-ZLM(413)
      ZLM(415)=-ZLM(412)
C L= 9, ML= 9
      ZLM(416)= ZLM(300)
      ZLM(417)= ZLM(299)
      ZLM(418)= ZLM(298)
      ZLM(419)= ZLM(297)
      ZLM(420)= ZLM(296)
C ---
C L=10, ML=-10
      ZLM(421)= SR0323*SR3003*FAP(17)
      ZLM(422)=-ZLM(421)*4.5D+01
      ZLM(423)= ZLM(421)*2.10D+02
      ZLM(424)=-ZLM(423)
      ZLM(425)=-ZLM(422)
      ZLM(426)=-ZLM(421)
C L=10, ML=-9
      ZLM(427)= SR0323*SR3003*SR5*FAP(15)
      ZLM(428)=-ZLM(427)*3.6D+01
      ZLM(429)= ZLM(427)*1.26D+02
      ZLM(430)=-ZLM(427)*8.4D+01
      ZLM(431)= ZLM(427)*9.0D+00
C L=10, ML=-8
      TEMP    = SR5005*S17*SR3*FAP(16)
      ZLM(432)= TEMP*F19
      ZLM(433)=-ZLM(432)*SEV*FOR
      ZLM(434)= ZLM(432)*SEV*TEN
      ZLM(435)= ZLM(433)
      ZLM(436)= ZLM(432)
      ZLM(437)=-TEMP
      ZLM(438)=-ZLM(437)*SEV*FOR
      ZLM(439)= ZLM(437)*SEV*TEN
      ZLM(440)= ZLM(438)
      ZLM(441)= ZLM(437)
C L=10, ML=-7
      TEMP    = SR5005*S17*FAT(15)
      ZLM(442)= TEMP*F19
      ZLM(443)=-ZLM(442)*SEV*THR
      ZLM(444)= ZLM(442)*SEV*FIV
      ZLM(445)=-ZLM(442)*SEV
      ZLM(446)=-TEMP*THR
      ZLM(447)=-ZLM(446)*SEV*THR
      ZLM(448)= ZLM(446)*SEV*FIV
      ZLM(449)=-ZLM(446)*SEV
C L=10, ML=-6
      TEMP    = SR5005*FAT(17)
      ZLM(450)= TEMP*3.23D+02
      ZLM(451)=-ZLM(450)*F15
      ZLM(452)=-ZLM(451)
      ZLM(453)=-ZLM(450)
      ZLM(454)=-TEMP*1.02D+02
      ZLM(455)=-ZLM(454)*F15
      ZLM(456)=-ZLM(455)
      ZLM(457)=-ZLM(454)
      ZLM(458)= TEMP*THR
      ZLM(459)=-ZLM(458)*F15
      ZLM(460)=-ZLM(459)
      ZLM(461)=-ZLM(458)
C L=10, ML=-5
      TEMP    = SR1001*FAT(13)
      ZLM(462)= TEMP*3.23D+02
      ZLM(463)=-ZLM(462)*TEN
      ZLM(464)= ZLM(462)*FIV
      ZLM(465)=-TEMP*1.70D+02
      ZLM(466)=-ZLM(465)*TEN
      ZLM(467)= ZLM(465)*FIV
      ZLM(468)= TEMP*F15
      ZLM(469)=-ZLM(468)*TEN
      ZLM(470)= ZLM(468)*FIV
C L=10, ML=-4
      TEMP    = SR5005*FAT(14)
      ZLM(471)= TEMP*3.23D+02
      ZLM(472)= ZLM(471)
      ZLM(473)=-ZLM(471)*SIX
      ZLM(474)=-TEMP*2.55D+02
      ZLM(475)= ZLM(474)
      ZLM(476)=-ZLM(474)*SIX
      ZLM(477)= TEMP*4.5D+01
      ZLM(478)= ZLM(477)
      ZLM(479)=-ZLM(477)*SIX
      ZLM(480)=-TEMP
      ZLM(481)= ZLM(480)
      ZLM(482)=-ZLM(480)*SIX
C L=10, ML=-3
      TEMP    = SR5005*FAT(13)
      ZLM(483)= TEMP*3.23D+02
      ZLM(484)=-ZLM(483)*THR
      ZLM(485)=-TEMP*3.57D+02
      ZLM(486)=-ZLM(485)*THR
      ZLM(487)= TEMP*1.05D+02
      ZLM(488)=-ZLM(487)*THR
      ZLM(489)=-TEMP*SEV
      ZLM(490)=-ZLM(489)*THR
C L=10, ML=-2
      TEMP    = SR0385*FAT(16)
      ZLM(491)= TEMP*4.199D+03
      ZLM(492)=-ZLM(491)
      ZLM(493)=-TEMP*6.188D+03
      ZLM(494)=-ZLM(493)
      ZLM(495)= TEMP*2.730D+03
      ZLM(496)=-ZLM(495)
      ZLM(497)=-TEMP*3.64D+02
      ZLM(498)=-ZLM(497)
      ZLM(499)= TEMP*SEV
      ZLM(500)=-ZLM(499)
C L=10, ML=-1
      TEMP    = SR0385*SR3*FAP(14)
      ZLM(501)= TEMP*4.199D+03
      ZLM(502)=-TEMP*7.956D+03
      ZLM(503)= TEMP*4.914D+03
      ZLM(504)=-TEMP*1.092D+03
      ZLM(505)= TEMP*6.3D+01
C L=10, ML= 0
      TEMP    = S3BYS7*FAP(16)
      ZLM(506)= TEMP*4.6189D+04
      ZLM(507)=-TEMP*1.09395D+05
      ZLM(508)= TEMP*9.0090D+04
      ZLM(509)=-TEMP*3.0030D+04
      ZLM(510)= TEMP*3.465D+03
      ZLM(511)=-TEMP*6.3D+01
C L=10, ML= 1
      ZLM(512)= ZLM(501)
      ZLM(513)= ZLM(502)
      ZLM(514)= ZLM(503)
      ZLM(515)= ZLM(504)
      ZLM(516)= ZLM(505)
C L=10, ML= 2
      ZLM(517)= ZLM(491)*TWO
      ZLM(518)= ZLM(493)*TWO
      ZLM(519)= ZLM(495)*TWO
      ZLM(520)= ZLM(497)*TWO
      ZLM(521)= ZLM(499)*TWO
C L=10, ML= 3
      ZLM(522)=-ZLM(484)
      ZLM(523)=-ZLM(483)
      ZLM(524)=-ZLM(486)
      ZLM(525)=-ZLM(485)
      ZLM(526)=-ZLM(488)
      ZLM(527)=-ZLM(487)
      ZLM(528)=-ZLM(490)
      ZLM(529)=-ZLM(489)
C L=10, ML= 4
      ZLM(530)= ZLM(471)*FOR
      ZLM(531)=-ZLM(530)
      ZLM(532)= ZLM(474)*FOR
      ZLM(533)=-ZLM(532)
      ZLM(534)= ZLM(477)*FOR
      ZLM(535)=-ZLM(534)
      ZLM(536)= ZLM(480)*FOR
      ZLM(537)=-ZLM(536)
C L=10, ML= 5
      ZLM(538)= ZLM(462)
      ZLM(539)= ZLM(463)
      ZLM(540)= ZLM(464)
      ZLM(541)= ZLM(465)
      ZLM(542)= ZLM(466)
      ZLM(543)= ZLM(467)
      ZLM(544)= ZLM(468)
      ZLM(545)= ZLM(469)
      ZLM(546)= ZLM(470)
C L=10, ML= 6
      ZLM(547)= ZLM(450)*SIX
      ZLM(548)=-ZLM(450)*2.0D+01
      ZLM(549)= ZLM(547)
      ZLM(550)= ZLM(454)*SIX
      ZLM(551)=-ZLM(454)*2.0D+01
      ZLM(552)= ZLM(550)
      ZLM(553)= ZLM(458)*SIX
      ZLM(554)=-ZLM(458)*2.0D+01
      ZLM(555)= ZLM(553)
C L=10, ML= 7
      ZLM(556)=-ZLM(445)
      ZLM(557)=-ZLM(444)
      ZLM(558)=-ZLM(443)
      ZLM(559)=-ZLM(442)
      ZLM(560)=-ZLM(449)
      ZLM(561)=-ZLM(448)
      ZLM(562)=-ZLM(447)
      ZLM(563)=-ZLM(446)
C L=10, ML= 8
      ZLM(564)= ZLM(432)*EIT
      ZLM(565)=-ZLM(432)*5.6D+01
      ZLM(566)=-ZLM(565)
      ZLM(567)=-ZLM(564)
      ZLM(568)= ZLM(437)*EIT
      ZLM(569)=-ZLM(437)*5.6D+01
      ZLM(570)=-ZLM(569)
      ZLM(571)=-ZLM(568)
C L=10, ML= 9
      ZLM(572)= ZLM(431)
      ZLM(573)= ZLM(430)
      ZLM(574)= ZLM(429)
      ZLM(575)= ZLM(428)
      ZLM(576)= ZLM(427)
C L=10, ML= 10
      ZLM(577)= ZLM(421)*TEN
      ZLM(578)=-ZLM(421)*1.20D+02
      ZLM(579)= ZLM(421)*2.52D+02
      ZLM(580)= ZLM(578)
      ZLM(581)= ZLM(577)
C
      RETURN
      END
