1c $Id$
2*
3**********************************************************************
4C> \ingroup nwint
5C> @{
6C>
7C> \brief Integrate Gaussians over all space
8C>
9C> This routine computes the integral of the one center gaussian.
10C> \f{eqnarray*}{
11C> ({\mu}) = \int_{-\infty}^{\infty} g_{\mu}(X_{\mu},r_{1})dr_{1}
12C> \f}
13C>
14c:tex-% This is part of the API Standard Integral routines
15c:tex-\subsection{int\_1cg}
16c:tex-This routine computes the integral of the one center gaussian.
17c:tex-\begin{eqnarray*}
18c:tex-({\mu}) = \int_{-\infty}^{\infty} g_{\mu}(X_{\mu},r_{1})dr_{1}
19c:tex-\end{eqnarray*}
20c:tex-
21c:tex-{\it Syntax:}
22c:tex-\begin{verbatim}
23      subroutine int_1cg(i_basis,ish,lscr,scr,l1g,G1e)
24c:tex-\end{verbatim}
25      implicit none
26#include "apiP.fh"
27#include "errquit.fh"
28#include "nwc_const.fh"
29#include "basP.fh"
30#include "basdeclsP.fh"
31#include "geomP.fh"
32#include "geobasmapP.fh"
33#include "mafdecls.fh"
34#include "bas_exndcf_dec.fh"
35#include "bas_ibs_dec.fh"
36#include "int_nbf.fh"
37#include "util.fh"
38c::external subroutines used
39c... errquit
40c::functions
41      logical cando_nw_1e
42      logical cando_nw
43      logical int_chk_init
44      logical int_chk_sh
45      external int_chk_init
46      external int_chk_sh
47      external cando_nw_1e
48      external cando_nw
49c::passed
50c:tex-\begin{verbatim}
51      integer i_basis !< [Input] basis set handle
52      integer ish     !< [Input] lexical shell/contraction index
53      integer lscr    !< [Input] length of scratch array
54      double precision scr(lscr)  !< [Scratch] scratch space
55      integer l1g     !< [Input] length of integral buffer array
56      double precision G1e(l1g)   !< [Output] one center gaussian integrals
57c:tex-\end{verbatim}
58c::local
59      logical any_spherical
60      logical shells_ok
61      integer i_geom, ibas, ucont
62      integer Li, i_prim, i_gen, i_iexp, i_icfp, i_cent
63      integer i_nbf_x, i_nbf_s
64c
65#include "bas_exndcf_sfn.fh"
66#include "bas_ibs_sfn.fh"
67c
68c check initialization and shells
69c
70      if (.not.int_chk_init('int_1cg'))
71     &       call errquit('int_1cg: int_init was not called' ,0,
72     &       INT_ERR)
73c
74      shells_ok = int_chk_sh(i_basis,ish)
75      if (.not.shells_ok)
76     &       call errquit('int_1cg: invalid contraction/shell',0,
77     &       BASIS_ERR)
78c
79      ibas = i_basis + BASIS_HANDLE_OFFSET
80c
81      ucont   = (sf_ibs_cn2ucn(ish,ibas))
82      Li      = infbs_cont(CONT_TYPE ,ucont,ibas)
83      i_prim  = infbs_cont(CONT_NPRIM,ucont,ibas)
84      i_gen   = infbs_cont(CONT_NGEN ,ucont,ibas)
85      i_iexp  = infbs_cont(CONT_IEXP ,ucont,ibas)
86      i_icfp  = infbs_cont(CONT_ICFP ,ucont,ibas)
87      i_cent  = (sf_ibs_cn2ce(ish,ibas))
88      i_geom  = ibs_geom(ibas)
89c
90      if (cando_nw_1e(i_basis,ish,0)) then
91        call int_hf1sp(
92     &        coords(1,i_cent,i_geom),
93     &        dbl_mb(mb_exndcf(i_iexp,ibas)),
94     &        dbl_mb(mb_exndcf(i_icfp,ibas)),
95     &        i_prim, i_gen, Li, i_cent,
96     &        coords(1,i_cent,i_geom), DCexp, DCcoeff,
97     &        1, 1, 0, i_cent,
98     &        coords(1,1,i_geom),charge(1,i_geom),
99     &        geom_invnucexp(1,i_geom),ncenter(i_geom),
100c............................. doS    doT     doV     canonical
101     &        G1e,scr,scr,l1g,.true.,.false.,.false.,.false.,
102c.............. dryrun
103     &        .false.,scr,lscr,'int_1cg')
104      elseif (cando_nw(i_basis,ish,0)) then
105        call hf1(
106     &        coords(1,i_cent,i_geom),
107     &        dbl_mb(mb_exndcf(i_iexp,ibas)),
108     &        dbl_mb(mb_exndcf(i_icfp,ibas)),
109     &        i_prim, i_gen, Li,
110     &        coords(1,i_cent,i_geom),DCexp,
111     &        DCcoeff, 1, 1, 0,
112     &        coords(1,1,i_geom),charge(1,i_geom),
113     &        geom_invnucexp(1,i_geom),ncenter(i_geom),
114c............................. doS    doT     doV     canonical
115     &         G1e,scr,scr,l1g,.true.,.false.,.false.,.false.,
116c.............. dryrun
117     &         .false.,scr,lscr)
118      else
119        call errquit('int_1cg: could not do sp or nw integrals',0,
120     &       INT_ERR)
121      endif
122c
123*     G1e now has the cartesian integral block  (ilo:ihi)
124*
125      any_spherical = bas_spherical(ibas)
126      if (.not.any_spherical) return
127c
128c ... reset general contractions for sp shells to 1 since they are handled
129c     as a block of 4.
130c ... since int_nbf_* arrays are set to the appropriate size.
131c
132      if (li.eq.-1) i_gen = 1
133c
134*.. transform on i component
135      i_nbf_x = int_nbf_x(Li)
136      i_nbf_s = int_nbf_s(Li)
137      call spcart_tran1e(G1e,scr,
138     &    1,i_nbf_x,0,1,
139     &    1,i_nbf_s,Li,i_gen,
140     &    .false.)
141c
142      end
143C> @}
144