next up previous contents
Next: B. Performance Statistics Collection Up: NWCHEM Programmer's Guide, Release Previous: 11. Documenting New Modules   Contents

Subsections


A. Integral Application Programmer's Interface

This appendix describes the interface to all routines for the NWChem integral API. This includes the actual subroutine documentation and design specifications.

A.1 INT-API: Initialization, Integral Accuracy and Termination

These routines set the scope for the integral computation that is about to be performed.

A.1.1 int_init

This is the main initialization routine for integrals. Default memory requirements, accuracy thresholds, and other initializations for all base integral codes are set here. This routine will read (from the rtdb) any integral settings changed by the user.

Syntax:

 
      subroutine int_init(rtdb, nbas, bases)
 
      integer rtdb        ! [input] run time data base handle 
      integer nbas        ! [input] number of basis sets to be used 
      integer bases(nbas) ! [input] basis set handles

A.1.2 intd_init

This is the main initialization routine for integral derivatives. Default memory requirements, accuracy thresholds, and other initializations for all base integral codes are set here. This routine will read (from the rtdb) any integral settings changed by the user.

Syntax:

 
      subroutine intd_init(rtdb,nbas,bases)
 
      integer rtdb        ! [input] run time data base handle 
      integer nbas        ! [input] number of basis sets to be used 
      integer bases(nbas) ! [input] basis set handles

A.1.3 int_terminate

This is the main termination routine for integrals. After this call the INT-API is ready for re-initialization.

Syntax:

 
      subroutine int_terminate()
No formal arguments

A.1.4 intd_terminate

This is the main termination routine for integral derivatives. After this call the INT-API is ready for re-initialization.

Syntax:

 
      subroutine intd_terminate()
No formal arguments

A.1.5 intdd_terminate

This is the main termination routine for integral second derivatives. After this call the INT-API is ready for re-initialization.

Syntax:

 
      subroutine intdd_terminate()
No formal arguments

A.1.6 int_acc_std

This routine sets the integral threshold for radial cutoffs in all integral codes used in the api via a parameter statement. Other routines have access via the apiP.fh common blocks and the set/get API.

Syntax:

 
      subroutine int_acc_std()
The default ''standard'' value for the integral accuracy is:
 
c      parameter(val_def = 1.0d-15)

A.1.7 int_acc_high

This routine sets the integral threshold to ``high'' accuracy for radial cutoffs in all integral codes used in the api via a parameter statement. Other routines have access via the apiP.fh common blocks and the set/get API.

Syntax:

 
      subroutine int_acc_high()
The default ''high accuracy'' value for the integral API is:
 
c      parameter (val_def_high = 1.0d-30)
This is needed for certain algorithms within NWChem, e.g., the Schwarz inequality screening.

A.1.8 int_acc_get

This routine returns the current integral threshold for radial cutoffs in all integral codes used in the api via a parameter statement.

Syntax:

 
      subroutine int_acc_get(retval)
 
      double precision retval ! [output] current threshold

A.1.9 int_acc_set

This routine sets the current integral threshold for radial cutoffs in all integral codes used in the api via a parameter statement.

Syntax:

 
      subroutine int_acc_set(setval)
 
      double precision setval ! [input] new threshold

A.2 INT-API: Memory Managment Routines

These routines compute, store, and return memory requirements for particular ``classes'' of integral computations. These routines are ``overloaded'' since the application uses the same query function whether integrals or integral derivatives are computed. For example, int_mem_2e4c is used to get the maximum buffer size and scratch array size for both integrals computed using int_2e4c and integral derivatives computed using intd_2e4c. The INT-API is also designed such that if you initialize INT-API for integral derivatives, the memory estimates are also valid for integrals as well.

A.2.1 int_mem

This routine returns the maximum buffer and scratch array sizes for both one electron and two electron (4 center) integrals.

Syntax:

 
      subroutine int_mem(max1e, maxg, mscratch_1e, mscratch_2e)
 
      integer max1e       ! [output] max 1e buffer size 
      integer maxg        ! [output] max 2e4c buffer size 
      integer mscratch_1e ! [output] max scr for 1e ints 
      integer mscratch_2e ! [output] max scr for 2e ints

A.2.2 int_mem_1e

This routine returns the maximum buffer and scratch array sizes for one electron (2 center) integrals.

Syntax:

 
      subroutine int_mem_1e(max1e, mscratch_1e)
 
      integer max1e       ! [output] max 1e buffer size 
      integer mscratch_1e ! [output] max scr for 1e ints

A.2.3 int_mem_2e4c

This routine returns the maximum buffer and scratch array sizes for two electron (4 center) integrals.

Syntax:

 
      subroutine int_mem_2e4c(maxg, mscratch_2e)
 
      integer maxg        ! [output] max 2e4c buffer size 
      integer mscratch_2e ! [output] max scr for 2e ints

A.2.4 int_mem_h1

This routine returns the maximum buffer and scratch array sizes for one electron hamiltonian integrals.

Syntax:

 
      subroutine int_mem_h1(maxh1, mscratch_h1)
 
      integer maxh1       ! [output] max buffer size for H1 ints 
      integer mscratch_h1 ! [output] max scr size for H1 ints

A.2.5 int_mem_2eec

This routine returns the maximum buffer and scratch array sizes for two electron (3 center) integrals.

Syntax:

 
      subroutine int_mem_2e3c(maxg, mscratch_2e3c)
 
      integer maxg           ! [output] max buf size for 2e3c ints 
      integer mscratch_2e3c  ! [output] max scr size for 2e3c ints

A.2.6 int_mem_2e2c

This routine returns the maximum buffer and scratch array sizes for two electron (2 center) integrals.

Syntax:

 
      subroutine int_mem_2e2c(maxg, mscratch_2e2c)
 
      integer maxg          ! [output] max buf size for 2e2c ints 
      integer mscratch_2e2c ! [output] max scr size for 2e2c ints

A.2.7 int_mem_3ov

This routine returns the maximum buffer and scratch array sizes for one electron (3 center) integrals.

Syntax:

 
      subroutine int_mem_3ov(maxbuf, mscratch_3ov)
 
      integer maxbuf       ! [output] max buf size for 3 center ov 
      integer mscratch_3ov ! [output] max scr size for 3 center ov

A.2.8 int_mem_print

This routine prints the maximum buffer and scratch array sizes for all known ``classes'' of integrals.

Syntax:

 
      subroutine int_mem_print()

A.2.9 intb_mem_2e4c

This routine returns the maximum buffer and scratch array sizes for two electron (4 center) integrals from the blocking interface.

Syntax:

 
      subroutine intb_mem_2e4c(maxg, mscratch_2e)
 
      integer maxg        ! [output] max buf size for blocked 2e4c ints 
      integer mscratch_2e ! [output] max scr size for blocked 2e4c ints

A.3 INT-API: Integral Routines

These routines compute and return integrals based on shell quartets or groups of shell quartets.

A.3.1 int_1estv

This is an internal routine that most of the external 1 electron routines call. This is the actual workhorse routine. This routine computes the 1 electron integrals S, T, and V:

\begin{eqnarray*}
S & = & ({\mu}\vert{\nu}) \\
& = & \int_{-\infty}^{\infty} g...
...a}}{\vert r_{1}-R_{\alpha}\vert}g_{\nu}(X_{\nu},r_{1})dr_{1} \\
\end{eqnarray*}

If an ECP is defined then the ECP integral contributions are summed directly into the V integrals.

If a relativistic basis is defined then the one-electron integrals for the case where both shells are relativistic are modified to

\begin{eqnarray*}
S & = & ({\mu^L}\vert{\nu^L})
- ({\mu^S}\vert\frac{\alpha^2}...
...alpha}}{\vert r_{1}-R_{\alpha}\vert}\cdot\nabla\vert{\nu^S}) \\
\end{eqnarray*}

Syntax:

 
      subroutine int_1estv(i_basis,ish,j_basis,jsh,lscr,scr,lstv,S,T,V, 
     &    doS,doT,doV)
 
      integer i_basis ! [input] basis set handle for ish 
      integer ish     ! [input] i shell/contraction 
      integer j_basis ! [input] basis set handle for jsh 
      integer jsh     ! [input] j shell/contraction 
      integer lscr    ! [input] length of scratch array 
      integer lstv               ! [input] length of integral buffer 
      double precision scr(lscr) ! [scratch] scratch array 
      double precision S(lstv)   ! [output] overlap integrals 
      double precision T(lstv)   ! [output] kinetic energy integrals 
      double precision V(lstv)   ! [output] potential energy integrals 
      logical doS                ! [input] flag for overlap integrals 
      logical doT                ! [input] flag for kinetic energy integrals 
      logical doV                ! [input] flag for potential energy integrals

A.3.2 int_1eov

This routine computes the 1 electron overlap integrals ($S$):

\begin{eqnarray*}
S & = & ({\mu}\vert{\nu}) \\
& = & \int_{-\infty}^{\infty}g_{\mu}(X_{\mu},r_{1})g_{\nu}(X_{\nu},r_{1})dr_{1}
\end{eqnarray*}

Syntax:

 
      subroutine int_1eov(i_basis,ish,j_basis,jsh,lscr,scr,lov,Ov)
 
      integer i_basis ! [input] basis set handle for ish 
      integer ish     ! [input] i shell/contraction 
      integer j_basis ! [input] basis set handle for jsh 
      integer jsh     ! [input] j shell/contraction 
      integer lscr    ! [input] length of scratch array 
      double precision scr(lscr) ! [scratch] scratch array 
      integer lov                ! [input] length of Ov buffer 
      double precision Ov(lov)   ! [output] overlap integrals

A.3.3 int_1eke

This routine computes the 1 electron kinetic energy integrals, ($T$).:

\begin{eqnarray*}
T & = & ({\mu}\vert\frac{-1}{2}\nabla^{2}\vert{\nu}) \\
& = ...
...r_{1})\frac{-1}{2}\nabla^{2}(r_{1})g_{\nu}(X_{\nu},r_{1})dr_{1}
\end{eqnarray*}

Syntax:

 
      subroutine int_1eke(i_basis,ish,j_basis,jsh,lscr,scr,lke,Ke)
 
      integer i_basis ! [input] basis set handle for ish 
      integer ish     ! [input] i shell/contraction 
      integer j_basis ! [input] basis set handle for jsh 
      integer jsh     ! [input] j shell/contraction 
      integer lscr    ! [input] length of scratch array 
      double precision scr(lscr) ! [scratch] scratch array 
      integer lke                ! [input] length of Ke buffer 
      double precision Ke(lke)   ! [output] kinetic energy integrals

A.3.4 int_1epe

This routine computes the 1 electron potential integrals, ($V$):

\begin{eqnarray*}
V & = & ({\mu}\vert\sum_{\alpha}\frac{-Z_{\alpha}}{\vert r_{1}...
...lpha}}{\vert r_{1}-R_{\alpha}\vert}g_{\nu}(X_{\nu},r_{1})dr_{1}
\end{eqnarray*}

If an ECP is defined then the ECP integral contributions are summed directly into the V integrals.

Syntax:

 
      subroutine int_1epe(i_basis,ish,j_basis,jsh,lscr,scr,lpe,Pe)
 
      integer i_basis ! [input] basis set handle for ish 
      integer ish     ! [input] i shell/contraction 
      integer j_basis ! [input] basis set handle for jsh 
      integer jsh     ! [input] j shell/contraction 
      integer lscr    ! [input] length of scratch array 
      double precision scr(lscr) ! [scratch] scratch array 
      integer lpe                ! [input] length of Pe buffer 
      double precision Pe(lpe)   ! [output] kinetic energy integrals

A.3.5 int_1eh1

This routine computes the 1 electron hamiltonian, ($H1$).

\begin{eqnarray*}
H1 & = & T + V \\
T & = & ({\mu}\vert\frac{-1}{2}\nabla^{2}\v...
...lpha}}{\vert r_{1}-R_{\alpha}\vert}g_{\nu}(X_{\nu},r_{1})dr_{1}
\end{eqnarray*}

If an ECP is defined then the ECP integral contributions are summed directly into the $H1$ integrals.

If a relativistic basis is defined then the one-electron integrals for the case where both shells are relativistic are the modified integrals.

Syntax:

 
      subroutine int_1eh1(i_basis,ish,j_basis,jsh,lscr,scr,lh1,H1)
 
      integer i_basis ! [input] basis set handle for ish 
      integer ish     ! [input] i shell/contraction 
      integer j_basis ! [input] basis set handle for jsh 
      integer jsh     ! [input] j shell/contraction 
      integer lscr    ! [input] length of scratch array 
      double precision scr(lscr) ! [scratch] scratch array 
      integer lh1                ! [input] length of H1 buffer. 
      double precision H1(lh1)   ! [output] one electron

A.3.6 int_1eall

This routine computes the 1 electron integrals S, T, and V:

\begin{eqnarray*}
S & = & ({\mu}\vert{\nu}) \\
& = & \int_{{-}\infty}^{\infty}...
...ha}}
{\vert r_{1}-R_{\alpha}\vert}g_{\nu}(X_{\nu},r_{1})dr_{1}
\end{eqnarray*}

Syntax:

  
      subroutine int_1eall(i_basis,ish,j_basis,jsh,lscr,scr,lstv,S,T,V)
 
      integer i_basis ! [input] basis set handle for ish 
      integer ish     ! [input] i shell/contraction 
      integer j_basis ! [input] basis set handle for jsh 
      integer jsh     ! [input] j shell/contraction 
      integer lscr    ! [input] length of scratch array 
      double precision scr(lscr) ! [scratch] scratch array 
      integer lstv               ! [input] length of one electron buffers 
      double precision T(lstv)   ! [output] kinetic integral buffer 
      double precision V(lstv)   ! [output] potential integral buffer 
      double precision S(lstv)   ! [output] overlap integral buffer
 
      integer i_basis ! [input] basis set handle for ish 
      integer ish     ! [input] i shell/contraction 
      integer j_basis ! [input] basis set handle for jsh 
      integer jsh     ! [input] j shell/contraction 
      integer lscr    ! [input] length of scratch array 
      integer lstv               ! [input] length of integral buffer 
      double precision scr(lscr) ! [scratch] scratch array 
      double precision S(lstv)   ! [output] overlap integrals 
      double precision T(lstv)   ! [output] kinetic energy integrals 
      double precision V(lstv)   ! [output] potential energy integrals 
      logical doS                ! [input] flag for overlap integrals 
      logical doT                ! [input] flag for kinetic energy integrals 
      logical doV                ! [input] flag for potential energy integrals

A.3.7 int_1cg

This routine computes the integral of the one center gaussian.

\begin{eqnarray*}
({\mu}) = \int_{-\infty}^{\infty} g_{\mu}(X_{\mu},r_{1})dr_{1}
\end{eqnarray*}

Syntax:

 
      subroutine int_1cg(i_basis,ish,lscr,scr,l1g,G1e)
 
      integer i_basis ! [input] basis set handle 
      integer ish     ! [input] lexical shell/contraction index 
      integer lscr    ! [input] length of scratch array 
      double precision scr(lscr)  ! [scratch] scratch space  
      integer l1g     ! [input] length of integral buffer array 
      double precision G1e(l1g)   ! [output] one center gaussian integrals

A.3.8 int_1e3ov

This routine computes the 3 center overlap integral:

\begin{eqnarray*}
({\mu}{\nu}{\lambda}) = \int_{-\infty}^{\infty} g_{\mu}(X_{\mu...
...{1})g_{\nu}(X_{\nu},r_{1})g_{\lambda}(X_{\lambda},r_{1})dr
_{1}
\end{eqnarray*}

Syntax:
 
      subroutine int_1e3ov (i_basis, ish, j_basis, jsh, k_basis, ksh, 
     &       lscr, scr, lov3, OV3) 
c
  
      integer i_basis            ! [input] basis set handle for ish 
      integer ish                ! [input] i shell/contraction 
      integer j_basis            ! [input] basis set handle for jsh 
      integer jsh                ! [input] j shell/contraction 
      integer k_basis            ! [input] basis set handle for ksh 
      integer ksh                ! [input] k shell/contraction 
      integer lscr               ! [input] length of scratch v 
      double precision scr(lscr) ! [scratch] scratch array 
      integer lov3               ! [input] length of 3c overlap buffer 
      double precision OV3(lov3) ! [output] 3c overlap integrals

A.3.9 int_l1e3ov

This routine computes the 3 center overlap integral with labels and it removes ``zero'' integrals:

\begin{eqnarray*}
({\mu}{\nu}{\lambda}) = \int_{-\infty}^{\infty} g_{\mu}(X_{\mu},r_{1})g_{\nu}(X_{\nu},r_{1}g_{\lambda}(X_{\lambda},r_{1})dr_
{1}
\end{eqnarray*}

Syntax:

 
      subroutine int_l1e3ov(i_basis, ish, j_basis, jsh, k_basis, ksh, 
     &       zerotol, lov3, OV3, ilab, jlab, klab, numov3, lscr, scr)
 
      integer i_basis            ! [input] basis set handle for ish 
      integer ish                ! [input] i shell/contraction 
      integer j_basis            ! [input] basis set handle for jsh 
      integer jsh                ! [input] j shell/contraction 
      integer k_basis            ! [input] basis set handle for ksh 
      integer ksh                ! [input] k shell/contraction 
      double precision zerotol   ! [input] "zero" tolerance threshold 
      integer lov3               ! [input] length of 3c overlap array 
      double precision OV3(lov3) ! [output] 3c overlap integrals 
      integer ilab(lov3)         ! [output] i labels for 3c overlap ints 
      integer jlab(lov3)         ! [output] j labels for 3c overlap ints 
      integer klab(lov3)         ! [output] k labels for 3c overlap ints 
      integer numov3             ! [output] number of integrals and labels  
c . . . . . . . . . . . . . . . .!          generated and returned 
      integer lscr               ! [input] length of scratch array 
      double precision scr(lscr) ! [input] scratch array

A.3.10 int_l1eall

This routine computes the 1 electron integrals S, T, and V with labels and it removes ``zero'' integrals:

\begin{eqnarray*}
S & = & ({\mu}\vert{\nu}) \\
& = & \int_{{-}\infty}^{\infty}...
...ha}}
{\vert r_{1}-R_{\alpha}\vert}g_{\nu}(X_{\nu},r_{1})dr_{1}
\end{eqnarray*}

If an ECP is defined then the ECP integral contributions are summed directly into the V integrals.

Syntax:

 
      subroutine int_l1eall(i_basis, ish, j_basis, jsh, zerotol, 
     &       ilab, jlab, lstv, S, T, V, lscr, scr, numstv)
 
      integer i_basis ! [input] basis set handle for ish 
      integer ish     ! [input] i shell/contraction 
      integer j_basis ! [input] basis set handle for jsh 
      integer jsh     ! [input] j shell/contraction 
      integer lscr    ! [input] length of scratch array 
      double precision zerotol ! [input] zero threshold for integrals 
      double precision scr(lscr) ! [scratch] scratch array 
      integer lstv               ! [input] length of one electron buffers 
      integer ilab(lstv)         ! [output] i bas. fun. index array 
      integer jlab(lstv)         ! [output] j bas. fun. index array 
      double precision T(lstv)   ! [output] kinetic integral buffer 
      double precision V(lstv)   ! [output] potential integral buffer 
      double precision S(lstv)   ! [output] overlap integral buffer 
      integer numstv             ! [output] number of returned integrals

A.3.11 int_pgen1e

This routine prints a generic one electron block of integrals. This requires the labels be generated and input to this routine.

Syntax:

 
      subroutine int_pgen1e(msg, i_basis, ish, j_basis, jsh,  
     &       ilab, jlab, l1e, Gen1e, print_level)
 
      character*(*) msg           ! [input] informational message 
      integer i_basis             ! [input] basis set handle for i shell 
      integer j_basis             ! [input] basis set handle for j shell 
      integer ish                 ! [input] i shell 
      integer jsh                 ! [input] j shell  
      integer l1e                 ! [input] number of integrals and labels 
      integer ilab(l1e)           ! [input] i basis functions labels 
      integer jlab(l1e)           ! [input] j basis functions labels 
      double precision Gen1e(l1e) ! [input] integrals to be printed 
      integer print_level         ! [input] print level to be used 
c. . . . . . . . . . . . . .! print_level = 0 print lables and integrals 
c. . . . . . . . . . . . . .!             = 1 also print shell info.

A.3.12 int_l1eh1

This routine computes the 1 electron hamiltonian, ($H1$) with labels and ``zero'' integrals removed.

\begin{eqnarray*}
H1 & = & T + V \\
T & = & ({\mu}\vert\frac{-1}{2}\nabla^{2}\v...
...lpha}}{\vert r_{1}-R_{\alpha}\vert}g_{\nu}(X_{\nu},r_{1})dr_{1}
\end{eqnarray*}

If an ECP is defined then the ECP integral contributions are summed directly into the $H1$ integrals.

Syntax:

 
      subroutine int_l1eh1(i_basis, ish, j_basis, jsh, zerotol, 
     &       ilab, jlab, lh1, H1, lscr, scr, numgen)
 
      integer i_basis ! [input] basis set handle for ish 
      integer ish     ! [input] i shell/contraction 
      integer j_basis ! [input] basis set handle for jsh 
      integer jsh     ! [input] j shell/contraction 
      integer lscr    ! [input] length of scratch array 
      double precision zerotol   ! [input] zero threshold  
      double precision scr(lscr) ! [scratch] scratch array 
      integer lh1                ! [input] length of 1e buffers. 
      integer numgen             ! [output] number of H1 integrals 
      integer ilab(lh1)          ! [output] i bas fun labels array 
      integer jlab(lh1)          ! [output] j bas fun labels array 
      double precision H1(lh1)   ! [output] 1e H1 integrals

A.3.13 int_l1eke

This routine computes the 1 electron kinetic energy integrals, ($T$). with labels and ``zero'' integrals removed:

\begin{eqnarray*}
T & = & ({\mu}\vert\frac{-1}{2}\nabla^{2}\vert{\nu}) \\
& = ...
...r_{1})\frac{-1}{2}\nabla^{2}(r_{1})g_{\nu}(X_{\nu},r_{1})dr_{1}
\end{eqnarray*}

Syntax:

 
      subroutine int_l1eke(i_basis, ish, j_basis, jsh, zerotol, 
     &       ilab, jlab, lke, Ke, lscr, scr, numgen)
 
      integer i_basis ! [input] basis set handle for ish 
      integer ish     ! [input] i shell/contraction 
      integer j_basis ! [input] basis set handle for jsh 
      integer jsh     ! [input] j shell/contraction 
      integer lscr    ! [input] length of scratch array 
      double precision scr(lscr) ! [scratch] scratch array 
      double precision zerotol   ! [input] zero threshold 
      integer lke                ! [input] length of 1e buffers 
      integer numgen             ! [output] number of Ke integrals 
      integer ilab(lke)          ! [output] i bas fun labels array 
      integer jlab(lke)          ! [output] j bas fun labels array 
      double precision Ke(lke)   ! [output] kinetic energy integrals

A.3.14 int_l1eov

This routine computes the 1 electron overlap integrals ($S$) with labels and ``zero'' integrals removed:

\begin{eqnarray*}
S & = & ({\mu}\vert{\nu}) \\
& = & \int_{-\infty}^{\infty}g_{\mu}(X_{\mu},r_{1})g_{\nu}(X_{\nu},r_{1})dr_{1}
\end{eqnarray*}

Syntax:

 
      subroutine int_l1eov(i_basis, ish, j_basis, jsh, zerotol, 
     &       ilab, jlab, lov, Ov, lscr, scr, numgen)
 
      integer i_basis ! [input] basis set handle for ish 
      integer ish     ! [input] i shell/contraction 
      integer j_basis ! [input] basis set handle for jsh 
      integer jsh     ! [input] j shell/contraction 
      integer lscr    ! [input] length of scratch array 
      double precision scr(lscr) ! [scratch] scratch array 
      double precision zerotol   ! [input] zero threshold 
      integer lov                ! [input] length of overlap buffer 
      integer numgen             ! [output] num of ints generated 
      integer ilab(lov)          ! [output] i bas fun labels array 
      integer jlab(lov)          ! [output] j bas fun labels array 
      double precision Ov(lov)   ! [output] overlap integral buffer

A.3.15 int_l1epe

This routine computes the 1 electron potential integrals, ($V$): If an ECP is defined then the ECP integral contributions are summed directly into the V integrals. Integrals are computed with labels and ``zero'' integrals removed.

\begin{eqnarray*}
V & = & ({\mu}\vert\sum_{\alpha}\frac{-Z_{\alpha}}{\vert r_{1}...
...lpha}}{\vert r_{1}-R_{\alpha}\vert}g_{\nu}(X_{\nu},r_{1})dr_{1}
\end{eqnarray*}

Syntax:

 
      subroutine int_l1epe(i_basis, ish, j_basis, jsh, zerotol, 
     &       ilab, jlab, lpe, Pe, lscr, scr, numgen)
 
      integer i_basis ! [input] basis set handle for ish 
      integer ish     ! [input] i shell/contraction 
      integer j_basis ! [input] basis set handle for jsh 
      integer jsh     ! [input] j shell/contraction 
      integer lscr    ! [input] length of scratch array 
      double precision scr(lscr) ! [scratch] scratch array 
      double precision zerotol   ! [input] zero integral threshold 
      integer lpe                ! [input] length of potential buffer 
      integer numgen             ! [output] number of integrals generated 
      integer ilab(lpe)          ! [output] i bas fun labels array 
      integer jlab(lpe)          ! [output] j bas fun labels array 
      double precision Pe(lpe)   ! [output] potential integrals

A.3.16 int_l1gen1e

This routine generates labels for general 2 index one electron integrals. This is mostly unused since the other integral type specific label routines are now used. This routine requires that the integral block be computed prior to the label call. Other routines now integrate label generation with computation.

Syntax:

 
      subroutine int_lgen1e(i_basis, ish, j_basis, jsh, zerotol, 
     &       ilab, jlab, l1e, Gen1e, lscr, scr, numgen)
 
      integer i_basis ! [input] bra basis set handle 
      integer ish     ! [input] bra shell lexical index 
      integer j_basis ! [input] ket basis set handle 
      integer jsh     ! [input] ket shell lexical index 
      double precision zerotol ! [input] zero threshold 
      integer l1e       ! [input] length of buffers for integrals 
      integer ilab(l1e) ! [output] i bas func labels array 
      integer jlab(l1e) ! [output] j bas func labels array 
      double precision Gen1e(l1e) ! [input/output] 1e integrals 
      integer lscr ! [input] length of scratch array 
      double precision scr(lscr) ! [scratch] array 
      integer numgen ! [output] number of integrals  
c . . . . . . . . . .!           saved and returned

A.3.17 int_2e2c

this routine computes the 2 center 2 electron integrals:

\begin{eqnarray*}
({\mu}\vert{\nu}) = \int_{-\infty}^{\infty} g_{\mu}(X_{\mu},r_{1})\frac{1}{r_{12}}g_{\nu}(X_{\nu},r_{2})dr_{1}dr_{2}
\end{eqnarray*}

Syntax:

 
      subroutine int_2e2c(brain, ish, ketin, jsh,  
     &       lscr, scr, leri, eri)
 
      integer brain ! [input] bra basis set handle 
      integer ish   ! [input] shell/contraction index 
      integer ketin ! [input] ket basis set handle 
      integer jsh   ! [input] shell/contraction index 
      integer lscr  ! [input] length of scratch array 
      double precision scr(lscr) ! [scratch] array 
      integer leri  ! [input] length of integral array 
      double precision eri(leri) ! [output] 2e2c integrals

A.3.18 int_2e2c

this routine computes the 2 center 2 electron integrals with labels and ``zero'' integrals removed:

\begin{eqnarray*}
({\mu}\vert{\nu}) = \int_{-\infty}^{\infty} g_{\mu}(X_{\mu},r_{1})\frac{1}{r_{12}}g_{\nu}(X_{\nu},r_{2})dr_{1}dr_{2}
\end{eqnarray*}

Syntax:

 
      subroutine int_l2e2c(brain, ish, ketin, jsh,  
     &       zerotol, leri, eri, nint, ilab, jlab,  
     &       lscr, scr)
 
      integer brain ! [input] bra basis set handle 
      integer ish   ! [input] shell/contraction index 
      integer ketin ! [input] ket basis set handle 
      integer jsh   ! [input] shell/contraction index 
      integer lscr  ! [input] length of scratch array 
      double precision scr(lscr) ! [scratch] array 
      double precision zerotol   ! [input] zero threshold 
      integer leri  ! [input] length of integral array 
      integer nint  ! [output] num of ints computed 
      integer ilab(leri) ! [output] i bas func label array 
      integer jlab(leri) ! [output] j bas func label array 
      double precision eri(leri) ! [output] 2e2c integrals

A.3.19 int_l2e3c

this routine computes the 3 center 2 electron integrals with labels and ``zero'' integrals removed:

\begin{eqnarray*}
({\mu}\vert{\nu}{\lambda}) = \int_{-\infty}^{\infty} g_{\mu}(X...
...g_{\nu}(X_{\nu},r_{2}g_{\lambda}(X_{\lambda},r_{2})dr_{1}dr_{2}
\end{eqnarray*}

Syntax:

 
      subroutine int_l2e3c(brain, ish, ketin, jsh, ksh, 
     &       zerotol, canket, leri, eri, nint, ilab, jlab, klab, 
     &       lscr, scr)
 
      integer brain ! [input] bra basis set handle 
      integer ish   ! [input] shell/contraction index 
      integer ketin ! [input] ket basis set handle 
      integer jsh   ! [input] shell/contraction index 
      integer ksh   ! [input] shell/contraction index 
      integer lscr  ! [input] length of scratch array 
      double precision scr(lscr) ! [scratch] array 
      double precision zerotol   ! [input] zero threshold 
      integer leri  ! [input] length of integral array 
      integer  nint ! [output] number of integrals computed 
      integer ilab(leri) ! [output] i bas fun labels array 
      integer jlab(leri) ! [output] j bas fun labels array 
      integer klab(leri) ! [output] k bas fun labels array 
      double precision eri(leri) ! [output] 2e3c integrals 
      logical canket ! [input] canonicalize ket bas. fun. label pairs

A.3.20 int_2e3c

this routine computes the 3 center 2 electron integrals:

\begin{eqnarray*}
({\mu}\vert{\nu}{\lambda}) = \int_{-\infty}^{\infty} g_{\mu}(X...
...g_{\nu}(X_{\nu},r_{2}g_{\lambda}(X_{\lambda},r_{2})dr_{1}dr_{2}
\end{eqnarray*}

Syntax:

 
      subroutine int_2e3c(brain, ish, ketin, jsh, ksh, 
     &       lscr, scr, leri, eri)
 
      integer brain ! [input] bra basis set handle 
      integer ish   ! [input] shell/contraction index 
      integer ketin ! [input] ket basis set handle 
      integer jsh   ! [input] shell/contraction index 
      integer ksh   ! [input] shell/contraction index 
      integer lscr  ! [input] length of scratch array 
      double precision scr(lscr) ! [scratch] array 
      integer leri  ! [input] length of integral array 
      double precision eri(leri) ! [output] 2e3c integrals

A.3.21 int_2e4c

this routine computes the 4 center (traditional) 2 electron integrals:

\begin{eqnarray*}
({\mu}{\rho}\vert{\nu}{\lambda}) = \int_{-\infty}^{\infty} g_{...
..._{\nu}
(X_{\nu},r_{2}g_{\lambda}(X_{\lambda},r_{2})dr_{1}dr_{2}
\end{eqnarray*}

Syntax:

 
      subroutine int_2e4c(brain, ish, jsh, ketin, ksh, lsh, 
     &       lscr, scr, leri, eri)
 
      integer brain ! [input] bra basis set handle 
      integer ish   ! [input] shell/contraction index 
      integer jsh   ! [input] shell/contraction index 
      integer ketin ! [input] ket basis set handle 
      integer ksh   ! [input] shell/contraction index 
      integer lsh   ! [input] shell/contraction index 
      integer lscr  ! [input] length of scratch array 
      double precision scr(lscr) ! [scratch] array 
      integer leri  ! [input] length of integral array 
      double precision eri(leri) ! [output] 2e4c integrals

A.3.22 int_l2e4c

this routine computes the 4 center (traditional) 2 electron integrals with labels and ``zero'' integrals removed:

\begin{eqnarray*}
({\mu}{\rho}\vert{\nu}{\lambda}) = \int_{-\infty}^{\infty} g_{...
..._{\nu}
(X_{\nu},r_{2}g_{\lambda}(X_{\lambda},r_{2})dr_{1}dr_{2}
\end{eqnarray*}

Syntax:

 
      subroutine int_l2e4c(brain, ish, jsh, ketin, ksh, lsh, 
     &       zerotol, canonicalize, leri, eri, nint, ilab, jlab, klab, 
     &       llab, lscr, scr)
 
      integer brain ! [input] bra basis set handle 
      integer ish   ! [input] shell/contraction index 
      integer jsh   ! [input] shell/contraction index 
      integer ketin ! [input] ket basis set handle 
      integer ksh   ! [input] shell/contraction index 
      integer lsh   ! [input] shell/contraction index 
      double precision zerotol ! [input] zero threshold 
      integer lscr  ! [input] length of scratch array 
      double precision scr(lscr) ! [scratch] array 
      integer leri  ! [input] length of integral array 
      integer nint  ! [output] number of integrals computed 
      integer ilab(leri) ! [output] i bas fun label array  
      integer jlab(leri) ! [output] j bas fun label array  
      integer klab(leri) ! [output] k bas fun label array  
      integer llab(leri) ! [output] l bas fun label array  
      double precision eri(leri) ! [output] 2e4c integrals 
      logical canonicalize ! [input] canonicalize labels

A.3.23 intb_init4c

This logical function sets up the blocking integral API based on the input of a group of shell quartets (a block).

Return Values:
.true. blocking API initialization okay
.false. blocking API detected a problem

Side Effects: The shell quartet information may be reordered since this routine pulls out blocks that consist of only $s$, $p$, and $sp$ functions. Thes blocks are computed using the $sp$ rotated axis code since it is faster than even the Texas integral code.

The following code excerpt describes the proper use of the blocking API routines.
Pseudo Code:

 
 
* begin atom/shell loops 
 
      call collect_group_of_shells() 
      okay = intb_init4c($\cdots$) ! with group of shells info      
      if (.not.okay) stop ' error setting up blocking interface ' 
00001 continue 
      more = intb_2e4c($\cdots$) ! with group of shells info 
      call use_integrals_in_some_way() 
      if (more) goto 00001 
 
* end atom/shell loops

Syntax:

 
      logical function intb_init4c(brain, icl, jcl, ketin, kcl, lcl, 
     &    num_q, q4, use_q4, lscr, scr, l_erilab, block_eff)
 
      integer brain      ! [input] basis set handle for bra basis 
      integer ketin      ! [input] basis set handle for ket basis 
      integer num_q      ! [input] number of quartets 
      integer icl(num_q) ! [input] i-contraction labels for quartets 
      integer jcl(num_q) ! [input] j-contraction labels for quartets 
      integer kcl(num_q) ! [input] k-contraction labels for quartets 
      integer lcl(num_q) ! [input] l-contraction labels for quartets 
      double precision q4(num_q) ! [input] scaling factors 
      logical use_q4            ! [input] true if scaling 
      integer l_erilab   ! [input] size of eri and label arrays that  
*................................. will be used in intb_2e4c.F 
      integer lscr       ! [input] length of scratch array 
      double precision scr(lscr)  ! [input] scratch array 
      double precision block_eff  ! [output] blocking efficiency

A.3.24 intb_2e4c

This logical function returns the integrals and labels based on the input of a group of shell quartets (a block). This function cannot be called without a call to intb_init4c using the same block information. ``zero'' integrals are removed.

\begin{eqnarray*}
({\mu}{\rho}\vert{\nu}{\lambda}) = \int_{-\infty}^{\infty} g_{...
..._{\nu}
(X_{\nu},r_{2}g_{\lambda}(X_{\lambda},r_{2})dr_{1}dr_{2}
\end{eqnarray*}

Return Values:
.true. more integrals from this block another call to intb_2e4c required
.false. all integrals from this block computed

The following code excerpt describes the proper use of the blocking API routines.
Pseudo Code:

 
 
* begin atom/shell loops 
 
      call collect_group_of_shells() 
      okay = intb_init4c($\cdots$) ! with group of shells info      
      if (.not.okay) stop ' error setting up blocking interface ' 
00001 continue 
      more = intb_2e4c($\cdots$) ! with group of shells info 
      call use_integrals_in_some_way() 
      if (more) goto 00001 
 
* end atom/shell loops

Syntax:

 
      logical function intb_2e4c(brain, icl, jcl, ketin, kcl, lcl, 
     $     num_q, q4, use_q4, zerotol, canonicalize, 
     $     ilab, jlab, klab, llab, eri, 
     $     l_erilab, nints, lscr, scr)
 
      integer brain             ! [input]  basis handle for bra  
      integer ketin             ! [input]  basis handle for ket  
      integer num_q             ! [input]  number of quartets input 
      integer icl(num_q)        ! [input]  i-contraction quartet labels 
      integer jcl(num_q)        ! [input]  j-contraction quartet labels 
      integer kcl(num_q)        ! [input]  k-contraction quartet labels 
      integer lcl(num_q)        ! [input]  l-contraction quartet labels 
      logical use_q4            ! [input]  logical for use of q4 
      double precision q4(num_q) ! [input] symmetry prefactors for ints 
*      
      integer l_erilab          ! [input]  length of eri and label arrays 
      integer ilab(l_erilab)    ! [output] integral labels for ``i''  
      integer jlab(l_erilab)    ! [output] integral labels for ``j''  
      integer klab(l_erilab)    ! [output] integral labels for ``k''  
      integer llab(l_erilab)    ! [output] integral labels for ``l''  
      integer nints              ! [output] number of integrals returned 
      double precision eri(l_erilab) ! [output] integral values 
      integer lscr              ! [input] length of scratch array 
      double precision scr(lscr) ! [input] scratch array 
      double precision zerotol  ! [input] zero integral threshold 
      logical canonicalize      ! [input] Canonicalize integral labels?

A.3.25 intb_nw_2e4c

This logical function returns the integrals and labels based on the input of a group of shell quartets (a block). This interfaces to the NWChem McMurchie-Davidson code. This routine should never be called directly by an application module!! ``zero'' integrals are removed.

\begin{eqnarray*}
({\mu}{\rho}\vert{\nu}{\lambda}) = \int_{-\infty}^{\infty} g_{...
..._{\nu}
(X_{\nu},r_{2}g_{\lambda}(X_{\lambda},r_{2})dr_{1}dr_{2}
\end{eqnarray*}

Return Values:
.true. more integrals from this block another call to intb_2e4c required
.false. all integrals from this block computed

Syntax:

 
      logical function intb_nw_2e4c(brain, icl, jcl, ketin, kcl, lcl, 
     $     num_q, q4, use_q4, zerotol, canonicalize, 
     $     ilab, jlab, klab, llab, eri, 
     $     l_erilab, nints, lscr, scr)
 
      integer brain             ! [input]  basis set handle for bra  
      integer ketin             ! [input]  basis set handle for ket  
      integer num_q             ! [input]  number of quartets input 
      integer icl(num_q)        ! [input]  i-contraction quartet labels 
      integer jcl(num_q)        ! [input]  j-contraction quartet labels 
      integer kcl(num_q)        ! [input]  k-contraction quartet labels 
      integer lcl(num_q)        ! [input]  l-contraction quartet labels 
      logical use_q4            ! [input]  logical for use of q4 
      double precision q4(num_q) ! [input] symmetry prefactors for ints 
*      
      integer l_erilab          ! [input]  length of eri and label arrays 
      integer ilab(l_erilab)    ! [output] integral labels for ``i''  
      integer jlab(l_erilab)    ! [output] integral labels for ``j''  
      integer klab(l_erilab)    ! [output] integral labels for ``k''  
      integer llab(l_erilab)    ! [output] integral labels for ``l''  
      integer nints              ! [output] number of integrals returned 
      double precision eri(l_erilab) ! [output] integral values 
      integer lscr              ! [input] length of scratch array 
      double precision scr(lscr) ! [input] scratch array 
      double precision zerotol  ! [input] zero integral threshold 
      logical canonicalize      ! [input] Canonicalize integral labels?

A.4 INT-API: Property Integral Routines

These routines compute and return property integrals based on shell pairs.

A.4.1 int_mpole

This routine returns multipole integrals up to the level $lmax$

The general form is $< shell \vert pole \vert shell >$. Integrals are returned in shell blocks of $<ish\vert L\vert jsh>$ $L$=0 to $lmax$ one block for each $L$ value.

For example $ish$ = p and $L$ = 1 and $jsh$ = p you would get (3*1*3)+(3*3*3)=36 integrals. The order would be:
$<x\vert x>$ $<x\vert y>$ $<x\vert z>$ $<y\vert x>$ $<y\vert y>$ $\ldots$ $<z\vert z>$ (first nine)
$<x\vert x\vert x>$ $<x\vert x\vert y>$ $<x\vert x\vert z>$ $<x\vert y\vert x>$ $<x\vert y\vert y>$ $\ldots$ $<x\vert z\vert z>$ (second nine)
$<y\vert x\vert x>$ $<y\vert x\vert y>$ $<y\vert x\vert z>$ $<y\vert y\vert x>$ $<y\vert y\vert y>$ $\ldots$ $<y\vert z\vert z>$ (third nine)
$<z\vert x\vert x>$ $<z\vert x\vert y>$ $<z\vert x\vert z>$ $<z\vert y\vert x>$ $<z\vert y\vert y>$ $\ldots$ $<z\vert z\vert z>$ (fourth nine)

The integral for each L value computed is:

\begin{eqnarray*}
({\mu}{\hat{L}}{\lambda}) = \int_{-\infty}^{\infty} g_{\mu}(X,r_{1})\hat{L}g_{\lambda}(X,r_{1})dr_{1}
\end{eqnarray*}

See the int_order code inside $\ldots$/NWints/int for specific order of a set of shells and dipole order.

Syntax:

 
      subroutine int_mpole(i_basis, ish, j_basis, jsh, lmax, centerl, 
     &    lscr, scr, lmpint, MP)
 
      integer i_basis             ! [input] basis set handle for ish 
      integer ish                 ! [input] i shell/contraction 
      integer j_basis             ! [input] basis set handle for jsh 
      integer jsh                 ! [input] j shell/contraction 
      integer lmax                ! [input] maximum lvalue for  
c . . . . . . . . . . . . . . . . !   multipole integrals in this batch 
      double precision centerl(3) ! [input] coordinates of multipole 
      integer lscr                ! [input] length of scratch array 
      double precision scr(lscr)  ! [input] scratch array 
      integer lmpint              ! [input] length of multipole ints 
      double precision MP(lmpint) ! [output] multipole integrals

A.4.2 int_projpole

This routine computes projected multipole integrals up to level lmax (0$\rightarrow$lmax):
The general form is $<$pole$\vert$shell$>$

Integrals are returned in $<$pole$\vert$shell$>$ blocks one block for each L value 0$\rightarrow$lmax.

For example, a multipole, L = 1 and a d shell would yield (1+3)*6 = 24 integrals.

The order would be:
$<0\vert xx>$ $<0\vert xy>$ $<0\vert xz>$ $<0\vert yy>$ $\ldots$ $<0\vert zz>$ first six
$<x\vert xx>$ $<x\vert xy>$ $<x\vert xz>$ $<x\vert yy>$ $\ldots$ $<x\vert zz>$ second six
$<y\vert xx>$ $<y\vert xy>$ $<y\vert xz>$ $<y\vert yy>$ $\ldots$ $<y\vert zz>$ third six
$<z\vert xx>$ $<z\vert xy>$ $<z\vert xz>$ $<z\vert yy>$ $\ldots$ $<z\vert zz>$ fourth six

Syntax:

 
      subroutine int_projpole(i_basis, ish, centerl, lmax,  
     &    lscr, scr, lmpint, MP)
 
      integer i_basis             ! [input] basis set handle for ish 
      integer ish                 ! [input] i shell/contraction 
      integer lmax                ! [input] maximum lvalue for  
c . . . . . . . . . . . . . . . . !      multipole ints in this batch 
      double precision centerl(3) ! [input] coordinates of multipole 
      integer lscr                ! [input] length of scratch array 
      double precision scr(lscr)  ! [input] scratch array 
      integer lmpint              ! [input/output] length of  
c . . . . . . . . . . . . . . . . !       multipole integrals array 
      double precision MP(lmpint) ! [output] multipole integrals

A.5 INT-API: Miscellaneous Routines

These routines do a variety of functions mostly internal to the INT-API but may require use by those integrating a new base integral code into NWChem. These should be used with care and rarely in any application module.

A.5.1 exact_mem

This routine computes the memory required by the McMurchie-Davidson integral code developed at PNNL. This calls specific routines listed below for each integral type. The data is stored in a common block (apiP.fh) for fast retrieval. This routine should never be called directly by a NWChem application module.

Syntax:

 
      subroutine exact_mem(rtdb,bases,nbas)
 
      integer rtdb        ! [input] the RTDB handle 
      integer nbas        ! [input] number of basis sets 
      integer bases(nbas) ! [input] basis set handles

Debugging Note: using a set directive to set the variable ``int:full_mem'' to true will force the more expensive $O(N^4)$ algorithm to be used to compute the memory requirements for the 2-electron integrals.

A.5.2 emem_3ov

This routine computes the memory for the 3-center overlap integrals based on the basis sets used. This routine should never be called directly by a NWChem application module.

Syntax:

 
      subroutine emem_3ov(ibasin,jbasin,kbasin,lsz_buf,memsize)
 
      integer ibasin  ! [input] basis set handle for ``i'' contractions 
      integer jbasin  ! [input] basis set handle for ``j'' contractions 
      integer kbasin  ! [input] basis set handle for ``k'' contractions 
      integer lsz_buf ! [output] maximum size of integral buffer  
      integer memsize ! [output] memory needed for scratch array

A.5.3 emem_1e

This routine computes the memory for any type of 1e integrals based on the basis sets used. This routine should never be called directly by a NWChem application module.

Syntax:

 
      subroutine emem_1e(brain, ketin, max1e, memsize)
 
      integer brain   ! [input] bra basis set handle 
      integer ketin   ! [input] ket basis set handle 
      integer max1e   ! [output] max size of 1e integrals buffer 
      integer memsize ! [output] max size of scratch space for 1e integral evaluation

A.5.4 emem_1e_dk

This routine computes the memory for the requested type of Douglas-Kroll integrals for the given fitting basis sets. This routine should never be called directly by a NWChem application module.

Syntax:

 
      subroutine emem_1e_dk(brain, ketin, max1e, memsize)
 
      integer brain   ! [input] bra basis set handle 
      integer ketin   ! [input] ket basis set handle 
      integer max1e   ! [output] max size of 1e integrals buffer 
      integer memsize ! [output] max size of scratch space for 1e integral evaluation

A.5.5 emem_1e_rel

This routine computes the memory for any type of relativistic 1e integrals based on the basis sets used. This routine should never be called directly by a NWChem application module.

Syntax:

 
      subroutine emem_1e_rel(brain, ketin, max1e, memsize)
 
      integer brain   ! [input] bra basis set handle 
      integer ketin   ! [input] ket basis set handle 
      integer max1e   ! [output] max size of 1e integrals buffer 
      integer memsize ! [output] max size of scratch space for 1e integral evaluation

A.5.6 emem_2e4c

This routine computes the memory required by the McMurchie-Davidson algorithm for 4 center two electron integrals based on the basis sets used.

The exact algorithm is an N$^4$ and an N$^2$ approximate algorithm is used here. Exact memory is computed for integrals over the following classes:

An additional 10% is added to the maximum exact memory computation for each of these classes. Additional classes that have been periodically problematic are: This routine should never be called directly by a NWChem application module.

Syntax:

 
      subroutine emem_2e4c(brain, ketin, maxg, memsize)
 
      integer brain   ! [input] bra basis set handle 
      integer ketin   ! [input] ket basis set handle 
      integer maxg    ! [output] max size of 2e integrals buffer 
      integer memsize ! [output] max size of scratch space for 2e integral evaluation

A.5.7 emem_2e3c

This routine computes the memory required for the the two electron three center integrals using the McMurchie-Davidson algorithm. This routine should never be called directly by a NWChem application module.

Syntax:

 
      subroutine emem_2e3c(brain, ketin, maxg, memsize)
 
      integer brain   ! [input] bra basis set handle 
      integer ketin   ! [input] ket basis set handle 
      integer maxg    ! [output] max size of 2e integrals buffer 
      integer memsize ! [output] max size of scratch space for 2e integral evaluation

A.5.8 emem_2e2c

This routine computes the memory required for the the two electron two center integrals using the McMurchie-Davidson algorithm. This routine should never be called directly by a NWChem application module.

Syntax:

 
      subroutine emem_2e2c(brain, ketin, maxg, memsize)
 
      integer brain   ! [input] bra basis set handle 
      integer ketin   ! [input] ket basis set handle 
      integer maxg    ! [output] max size of 2e integrals buffer 
      integer memsize ! [output] max size of scratch space for 2e integral evaluation

A.5.9 emem_2e4c_full

This routine computes the memory required by the McMurchie-Davidson algorithm for 4 center two electron integrals based on the basis sets used.

The exact algorithm is an N$^4$ and costly. This routine is used primarily as a debugging tool This routine should never be called directly by a NWChem application module.

Syntax:

 
      subroutine emem_2e4c_full(brain, ketin, maxg, memsize)
 
      integer brain   ! [input] bra basis set handle 
      integer ketin   ! [input] ket basis set handle 
      integer maxg    ! [output] max size of 2e integrals buffer 
      integer memsize ! [output] max size of scratch space for 2e integral evaluation

A.5.10 int_nbf_max

This routine computes the maximum cartesian nbf for a given basis set. Used in many memory computing routines to deterine maximum buffer sizes needed for integral computations. This also includes any general contraction information. This routine should never be called directly by a NWChem application module. Syntax:
 
      subroutine int_nbf_max(basisin,nbf_max)
 
      integer basisin  ! [input] basis set handle 
      integer nbf_max  ! [output] maximum number of basis functions

A.5.11 int_mem_zero

This routine zeros the memory pointers in the apiP.fh common that pertain to the memory utilization of the integral suite. This routine should never be called directly by a NWChem application module.

Syntax:

 
      subroutine int_mem_zero()
There are no formal arguments to this routine

A.5.12 api_is_ecp_basis

This routine identifies basis set handles to INT-API that store ECP information. This routine should never be called directly by a NWChem application module.

Syntax:

 
      logical function api_is_ecp_basis(basisin)
 
      integer basisin ! [input] basis set handle
Return value is true if ``basisin'' represents an ECP

A.5.13 emem_1e_pvp

This routine computes the memory for the p.Vp type 1e integrals based on the basis sets used. These integrals are in essence double derivative potential energy integrals of which only the dot product (diagonal) integrals are included. This routine should never be called directly by a NWChem application module.

Syntax:

 
      subroutine emem_1e_pvp(brain, ketin, max1e, memsize, rel_typ)
 
      integer brain   ! [input] bra basis set handle 
      integer ketin   ! [input] ket basis set handle 
      integer rel_typ ! [input] type of integrals to be computed 
      integer max1e   ! [output] max size of 1e integrals buffer 
      integer memsize ! [output] max size of scratch space for 1e integral evaluation

A.5.14 exactd_mem

This routine computes the memory required by the McMurchie-Davidson integral derivative code developed at PNNL. This calls specific routines listed below for each integral derivative type. The data is stored in a common block (apiP.fh) for fast retrieval from the int_mem routines.

Syntax:

 
      subroutine exactd_mem(rtdb,bases,nbas)
 
      integer rtdb        ! [input] the RTDB handle 
      integer nbas        ! [input] number of basis sets 
      integer bases(nbas) ! [input} array of basis set handles

Debugging Note: using a set directive to set the variable ``int:full_mem'' to true will force the more expensive $O(N^4)$ algorithm to be used to compute the memory requirements for the 2-electron integral derivatives.

A.5.15 emem_d1e

This routine determines the maximum buffer and scratch size for the one electron derivative integrals. This routine should not be called by application code. Syntax:
 
      subroutine emem_d1e(brain, ketin, max1e, memsize)
 
      integer brain   ! [input] bra basis set handle 
      integer ketin   ! [input] ket basis set handle 
      integer max1e   ! [output] max size of 1e integrals buffer 
      integer memsize ! [output] max size of scratch space for 1e integral evaluation

A.5.16 emem_d1e_rel

This routine determines the maximum buffer and scratch size for the one electron derivative relativistic integrals. This routine should not be called by application code. Syntax:
 
      subroutine emem_d1e_rel(brain, ketin, max1e, memsize)
 
      integer brain   ! [input] bra basis set handle 
      integer ketin   ! [input] ket basis set handle 
      integer max1e   ! [output] max size of 1e integrals buffer 
      integer memsize ! [output] max size of scratch space for 1e integral evaluation

A.5.17 emem_d2e4c

This routine determines the maximum buffer and scratch size for the given basis sets to compute 2 electron derivative integrals. The logic used is similar to that of the integral routine. This routine should not be called by application code. Syntax:
 
      subroutine emem_d2e4c(brain, ketin, maxg, memsize)
 
      integer brain   ! [input] bra basis set handle 
      integer ketin   ! [input] ket basis set handle 
      integer maxg    ! [output] max size of 2e integrals buffer 
      integer memsize ! [output] max size of scratch space for 2e integral evaluation

A.5.18 emem_d2e4c_full

This routine determines the maximum buffer and scratch size for the given basis sets to compute 2 electron derivative integrals. The logic used is similar to that of the integral routine. This routine should not be called by application code. this routine computes the complete memory requirements using an $O(N^4$) algorithm Syntax:
 
      subroutine emem_d2e4c_full(brain, ketin, maxg, memsize)
 
      integer brain   ! [input] bra basis set handle 
      integer ketin   ! [input] ket basis set handle 
      integer maxg    ! [output] max size of 2e integrals buffer 
      integer memsize ! [output] max size of scratch space for 2e integral evaluation

A.5.19 int_canon

This routine canonicalizes integral lables such that: $i \geq j$, $k \geq l$, and $ij \geq kl$

Syntax:

 
      subroutine int_canon(i, j, k, l, ii, jj, kk, ll)
 
      integer i,j,k,l      ! [input] labels 
      integer ii,jj,kk,ll  ! [output] canonical labels

A.5.20 int_chk_init

This function checks to see that the integral API is initialized. Returns .true. if initialized and .false. if not.

Syntax:

 
      logical function int_chk_init(msg)
 
      character*(*) msg ! [input] usually indentfy calling routine

A.5.21 int_chk_sh

This function checks to see that the given shell is valid Returns .true. if so else returns .false. if not. This subroutine call can be replaced by a statement function sequence:
 
#include "basP.fh" 
#include "geobasmapP.fh" 
      logical inline_chk_sh 
      inline_chk_sh(bra,ish) = 
     1     ((ish.gt.0) .and. (ish.le.ncont_tot_gb(bra)))
Where bra is the lexical basis index (not the handle). or you could use the following with the handle.
 
      inline_chk_sh(bra,ish) = 
     1     ((ish.gt.0) .and.  
     2(ish.le.ncont_tot_gb(bra+Basis_Handle_Offset)))

Syntax:

 
      logical function int_chk_sh(basisin,shell)
 
      integer basisin ! [input] basis set handle 
      integer shell ! [input] lexical shell index

A.5.22 int_nospherical_check

This routine stubs out routines that are not ready for spherical basis functions by forcing an error condition.

Syntax:

 
      subroutine int_nospherical_check(basisin,tine)
 
      integer basisin     ! [input] basis set handle 
      character*(*) tine  ! [input] routine identifier

A.5.23 int_nogencont_check

This routine stubs out routines that are not ready for general contraction basis functions by forcing an error condition.

Syntax:

 
      subroutine int_nogencont_check(basisin,tine)
 
      integer basisin     ! [input] basis set handle 
      character*(*) tine  ! [input] routine identifier

A.5.24 int_nospshell_check

This routine stubs out routines that are not ready for sp shells type basis functions by forcing an error condition.

Syntax:

 
      subroutine int_nospshell_check(basisin,tine)
 
      integer basisin     ! [input] basis set handle 
      character*(*) tine  ! [input] routine identifier

A.5.25 int_bothsp_gc_check

This routine checks to see if the basis sets used have both sp shells/type basis functions and general contractions. The 2e integral codes cannot handle this.

Syntax:

 
      subroutine int_bothsp_gc_check(basesin,nbas,tine)
 
      integer nbas           ! [input] number of basis sets 
      integer basesin(nbas)  ! [input] basis set handles 
      character*(*) tine     ! [input] routine identifier

A.5.26 int_hf1sp

This is a layer routine that calls the McMurchie-Davidson one electron routine. This layer routine handles all permutations to compute sp integrals. This routine should never be called by an application module.

Syntax:

 
      subroutine int_hf1sp( 
     &       xyzi,expi,coefi, i_nprim, i_ngen, Li, ictri, 
     &       xyzj,expj,coefj, j_nprim, j_ngen, Lj, ictrj, 
     &       xyz,zan,exinv,nat,S,T,V,lstv,doS,doT,doV,canAB, 
     &       dryrun,scr,lscr,msg)
For an integral $<i\vert Operator\vert j>$
 
      integer i_nprim  ! [input] num. prims on function i 
      integer i_ngen   ! [input] num general conts on func. i 
      integer Li       ! [input] angular momentum of func. i   
      integer ictri    ! [input] lexical atom index for function i  
      integer j_nprim  ! [input] num. prims on function j      
      integer j_ngen   ! [input] num general conts on func. j  
      integer Lj       ! [input] angular momentum of func. j   
      integer ictrj    ! [input] lexical atom index for function j  
      integer nat      ! [input] number of atoms 
      integer lscr     ! [input] size of scratch array 
      integer lstv     ! [input] size of any integral buffer 
      double precision xyzi(3)  ! [input] position of center i 
      double precision expi(i_nprim) ! [input] exponents on i 
      double precision coefi(i_nprim,i_ngen) ! [input] i coeffs 
      double precision xyzj(3)  ! [input] position of center j 
      double precision expj(j_nprim)  ! [input] exponents on j 
      double precision coefj(j_nprim,j_ngen)  ! [input] j coeffs 
      double precision xyz(3,nat)  ! [input] all atom positions 
      double precision zan(nat)  ! [input] charges on all atoms 
      double precision exinv(nat)   ! [input] inverse nuclear exponents 
      double precision scr(lscr)  ! [scratch] scratch buffers 
      double precision S(lstv)  ! [output] overlap integrals 
      double precision T(lstv)  ! [output] kinetic energy integrals 
      double precision V(lstv)  ! [output] potential integrals 
      logical doS     ! [input] compute overlap (True/False) 
      logical doT     ! [input] compute kinetic (True/False) 
      logical doV     ! [input] compute potential (True/False) 
      logical canAB   ! [input] compute only canonical ints (false only) 
      logical dryrun  ! [input] true means only compute required memory 
      character*(*) msg ![input] calling func. identification message

A.5.27 int_hf1sp_ecp

This is a layer routine that calls the McMurchie-Davidson one electron routine. This layer routine handles all options for computing ecp integrals. This routine should never be called by an application module.

Syntax:

 
      subroutine int_hf1sp_ecp( 
     &       xyzi,expi,coefi, i_nprim, i_ngen, Li, ictri, 
     &       xyzj,expj,coefj, j_nprim, j_ngen, Lj, ictrj, 
     &       xyz,zan,exinv,nat,S,T,V,lstv,doS,doT,doV,canAB, 
     &       dryrun,scr,lscr,msg)
For an integral $<i\vert Operator\vert j>$
 
      integer i_nprim  ! [input] num. prims on function i 
      integer i_ngen   ! [input] num general conts on func. i 
      integer Li       ! [input] angular momentum of func. i   
      integer ictri    ! [input] lexical atom index for function i  
      integer j_nprim  ! [input] num. prims on function j      
      integer j_ngen   ! [input] num general conts on func. j  
      integer Lj       ! [input] angular momentum of func. j   
      integer ictrj    ! [input] lexical atom index for function j  
      integer nat      ! [input] number of atoms 
      integer lscr     ! [input] size of scratch array 
      integer lstv     ! [input] size of any integral buffer 
      double precision xyzi(3)  ! [input] position of center i 
      double precision expi(i_nprim) ! [input] exponents on i 
      double precision coefi(i_nprim,i_ngen) ! [input] i coeffs 
      double precision xyzj(3)  ! [input] position of center j 
      double precision expj(j_nprim)  ! [input] exponents on j 
      double precision coefj(j_nprim,j_ngen)  ! [input] j coeffs 
      double precision xyz(3,nat)  ! [input] all atom positions 
      double precision zan(nat)  ! [input] charges on all atoms 
      double precision exinv(nat)   ! [input] inverse nuclear exponents 
      double precision scr(lscr)  ! [scratch] scratch buffers 
      double precision S(lstv)  ! [output] overlap integrals 
      double precision T(lstv)  ! [output] kinetic energy integrals 
      double precision V(lstv)  ! [output] potential integrals 
      logical doS     ! [input] compute overlap (True/False) 
      logical doT     ! [input] compute kinetic (True/False) 
      logical doV     ! [input] compute potential (True/False) 
      logical canAB   ! [input] compute only canonical ints (false only) 
      logical dryrun  ! [input] true means only compute required memory 
      character*(*) msg ![input] calling func. identification message

A.5.28 int_1psp

This routine transforms integrals from the way they were computed $(p\vert s)$, $(p\vert p)$ to $(p\vert sp)$. The transformation is done in place as follows:
  computed transformed  
  order order  
 1 (x$\vert$s) (x$\vert$s)  
 2 (y$\vert$s) (x$\vert$x) 2 $\rightarrow$ 5
 3 (z$\vert$s) (x$\vert$y) 3 $\rightarrow$ 9
 4 (x$\vert$x) (x$\vert$z) 4 $\rightarrow$ 2
 5 (x$\vert$y) (y$\vert$s) 5 $\rightarrow$ 3
 6 (x$\vert$z) (y$\vert$x) 6 $\rightarrow$ 4
 7 (y$\vert$x) (y$\vert$y) 7 $\rightarrow$ 6
 8 (y$\vert$y) (y$\vert$z) 8 $\rightarrow$ 7
 9 (y$\vert$z) (z$\vert$s) 9 $\rightarrow$ 8
10 (z$\vert$x) (z$\vert$x)  
11 (z$\vert$y) (z$\vert$y)  
12 (z$\vert$z) (z$\vert$z)  

Syntax:

 
      subroutine int_1psp(block,num_blocks)
 
      integer num_blocks  ! [input] num. blocks to transform 
      double precision block(12,num_blocks) ! [input/output]  
c. . . . . . . . . . . . . . . . . . . . . .! integral block

A.5.29 int_1dsp

This routine transforms integrals from the way they were computed $(d\vert s)$, $(d\vert p)$ to $(d\vert sp)$. The transformation is done in place as follows:
  computed transformed  
   order order  
 1 (xx$\vert$s) (xx$\vert$s)  
 2 (xy$\vert$s) (xx$\vert$x)  2 $\rightarrow$ 5  
 3 (xz$\vert$s) (xx$\vert$y)  3 $\rightarrow$ 9  
 4 (yy$\vert$s) (xx$\vert$z)  4 $\rightarrow$ 13 
 5 (yz$\vert$s) (xy$\vert$s)  5 $\rightarrow$ 17 
 6 (zz$\vert$s) (xy$\vert$x)  6 $\rightarrow$ 21 
 7 (xx$\vert$x) (xy$\vert$y)  7 $\rightarrow$ 2  
 8 (xx$\vert$y) (xy$\vert$z)  8 $\rightarrow$ 3  
 9 (xx$\vert$z) (xz$\vert$s)  9 $\rightarrow$ 4  
10 (xy$\vert$x) (xz$\vert$x) 10 $\rightarrow$ 6  
11 (xy$\vert$y) (xz$\vert$y) 11 $\rightarrow$ 7  
12 (xy$\vert$z) (xz$\vert$z) 12 $\rightarrow$ 8  
13 (xz$\vert$x) (yy$\vert$s) 13 $\rightarrow$ 10 
14 (xz$\vert$y) (yy$\vert$x) 14 $\rightarrow$ 11 
15 (xz$\vert$z) (yy$\vert$y) 15 $\rightarrow$ 12 
16 (yy$\vert$x) (yy$\vert$z) 16 $\rightarrow$ 14 
17 (yy$\vert$y) (yz$\vert$s) 17 $\rightarrow$ 15 
18 (yy$\vert$z) (yz$\vert$x) 18 $\rightarrow$ 16 
19 (yz$\vert$x) (yz$\vert$y) 19 $\rightarrow$ 18 
20 (yz$\vert$y) (yz$\vert$z) 20 $\rightarrow$ 19 
21 (yz$\vert$z) (zz$\vert$s) 21 $\rightarrow$ 20 
22 (zz$\vert$x) (zz$\vert$x)  
23 (zz$\vert$y) (zz$\vert$y)  
24 (zz$\vert$z) (zz$\vert$z)  

Syntax:

 
      subroutine int_1dsp(block,num_blocks)
 
      integer num_blocks  ! [input] num. blocks to transform 
      double precision block(24,num_blocks) ! [input/output]  
c . . . . . . . . . . . . . . . . . . . . . ! integral block

A.5.30 int_1spsp

This routine transforms integrals from the way they were computed $(s\vert s)$, $(s\vert p)$, $(p\vert s)$, $(p\vert p)$ to $(sp\vert sp)$. The transformation is done in place as follows:
  computed transformed  
  order order  
 1 (s$\vert$s) (s$\vert$s)  
 2 (s$\vert$x) (s$\vert$x)  
 3 (s$\vert$y) (s$\vert$y)  
 4 (s$\vert$z) (s$\vert$z)  
 5 (x$\vert$s) (x$\vert$s)  
 6 (y$\vert$s) (x$\vert$x)  6 $\rightarrow$ 9
 7 (z$\vert$s) (x$\vert$y)  7 $\rightarrow$ 13
 8 (x$\vert$x) (x$\vert$z)  8 $\rightarrow$ 6
 9 (x$\vert$y) (y$\vert$s)  9 $\rightarrow$ 7
10 (x$\vert$z) (y$\vert$x) 10 $\rightarrow$ 8
11 (y$\vert$x) (y$\vert$y) 11 $\rightarrow$ 10
12 (y$\vert$y) (y$\vert$z) 12 $\rightarrow$ 11
13 (y$\vert$z) (z$\vert$s) 13 $\rightarrow$ 12
14 (z$\vert$x) (z$\vert$x)  
15 (z$\vert$y) (z$\vert$y)  
16 (z$\vert$z) (z$\vert$z)  

Syntax:

 
      subroutine int_1spsp(block,num_blocks)
 
      integer num_blocks        ! [input] num. blocks to transform 
      double precision block(16,num_blocks) ! [input/output]  
c . . . . . . . . . . . . . . . . . . . . . ! integral block

A.5.31 int_1spa

This routine transforms integrals from the way they were computed $(s\vert X)$, $(p\vert X)$, to $(sp\vert X)$. The transformation is NOT done in place: Syntax:
 
      subroutine int_sp1a(sp_block,s_block,p_block,sizeb,num_blocks)
 
      integer sizeb  ! [input] size of non sp block 
      integer num_blocks ! [input] num of blocks to transform 
* 
* . . . . . . . . . . . . . . .! [output] (sp|X) transformed integral block 
      double precision sp_block(sizeb,1:4,num_blocks)  
* 
* . . . . . . . . . . . . . . . . . . . . . .! [input] computed (s|X) block 
      double precision s_block(sizeb,num_blocks) 
* 
* . . . . . . . . . . . . . . . . . . . . . .! [input] computed (p|X) block 
      double precision p_block(sizeb,2:4,num_blocks)

A.5.32 int_sp1b

This routine transforms integrals from the way they were computed $(X\vert s)$, $(X\vert p)$, to $(X\vert sp)$. The transformation is NOT done in place: Syntax:
 
      subroutine int_sp1b(sp_block,s_block,p_block,sizea,num_blocks)
 
      integer sizea ! [input] size of non sp block 
      integer num_blocks ! [input] num of blocks to transform 
* 
* . . . . . . . . . . . . . . .! [output] (X|sp) transformed integral block 
      double precision sp_block(1:4,sizea,num_blocks) 
* 
* . . . . . . . . . . . . . . . . . . . . . .! [input] computed (X|s) block 
      double precision s_block(sizea,num_blocks) 
* 
* . . . . . . . . . . . . . . . . . . . . . .! [input] computed (X|p) block 
      double precision p_block(2:4,sizea,num_blocks)

A.5.33 int_nint

This routine computes the number of integrals for a given shell/contraction grouping; if an input shell is zero then the routine ignores this shell. This routine will work for both cartesian and spherical basis sets. This routine should never be called by an NWChem application module.

Syntax:

 
      integer function int_nint(ibasin,icnt,jbasin,jcnt, 
     &       kbasin,kcnt,lbasin,lcnt)
 
      integer ibasin   ! [input] basis set handle for icnt 
      integer icnt     ! [input] contraction index (e.g., ish) 
      integer jbasin   ! [input] basis set handle for jcnt 
      integer jcnt     ! [input] contraction index (e.g., jsh) 
      integer kbasin   ! [input] basis set handle for kcnt 
      integer kcnt     ! [input] contraction index (e.g., ksh) 
      integer lbasin   ! [input] basis set handle for lcnt 
      integer lcnt     ! [input] contraction index (e.g., lsh)

A.5.34 int_unint

This routine computes the number of integrals for a given shell/contraction grouping; if an input shell is zero then the routine ignores this shell. The input shell must be a unique shell in the sense of the basis set API. This routine will work for both cartesian and spherical basis sets. This routine should never be called by an NWChem application module.

Syntax:

 
      integer function int_unint(ibasin,icnt,jbasin,jcnt, 
     &       kbasin,kcnt,lbasin,lcnt)
 
      integer ibasin   ! [input] basis set handle for icnt 
      integer icnt     ! [input] unique contraction index (e.g., ish) 
      integer jbasin   ! [input] basis set handle for jcnt 
      integer jcnt     ! [input] unique contraction index (e.g., jsh) 
      integer kbasin   ! [input] basis set handle for kcnt 
      integer kcnt     ! [input] unique contraction index (e.g., ksh) 
      integer lbasin   ! [input] basis set handle for lcnt 
      integer lcnt     ! [input] unique contraction index (e.g., lsh)

A.5.35 int_nint_cart

This routine computes the number of integrals for a given shell/contraction grouping; if an input shell is zero then the routine ignores this shell. This routine will work for both cartesian and spherical basis sets, but returns the cartesian size (this is how the integrals are computed!). This routine should never be called by an NWChem application module.

Syntax:

 
      integer function int_nint_cart(ibasin,icnt,jbasin,jcnt, 
     &       kbasin,kcnt,lbasin,lcnt)
 
      integer ibasin   ! [input] basis set handle for icnt 
      integer icnt     ! [input] contraction index (e.g., ish) 
      integer jbasin   ! [input] basis set handle for jcnt 
      integer jcnt     ! [input] contraction index (e.g., jsh) 
      integer kbasin   ! [input] basis set handle for kcnt 
      integer kcnt     ! [input] contraction index (e.g., ksh) 
      integer lbasin   ! [input] basis set handle for lcnt 
      integer lcnt     ! [input] contraction index (e.g., lsh)

A.5.36 int_unint_cart

This routine computes the number of integrals for a given shell/contraction grouping; if an input shell is zero then the routine ignores this shell. The input shell must be a unique shell in the sense of the basis set API. This routine will work for both cartesian and spherical basis sets, but returns the cartesian size (this is how the integrals are computed!). This routine should never be called by an NWChem application module.

Syntax:

 
      integer function int_unint_cart(ibasin,icnt,jbasin,jcnt, 
     &       kbasin,kcnt,lbasin,lcnt)
 
      integer ibasin   ! [input] basis set handle for icnt 
      integer icnt     ! [input] unique contraction index (e.g., ish) 
      integer jbasin   ! [input] basis set handle for jcnt 
      integer jcnt     ! [input] unique contraction index (e.g., jsh) 
      integer kbasin   ! [input] basis set handle for kcnt 
      integer kcnt     ! [input] unique contraction index (e.g., ksh) 
      integer lbasin   ! [input] basis set handle for lcnt 
      integer lcnt     ! [input] unique contraction index (e.g., lsh)


next up previous contents
Next: B. Performance Statistics Collection Up: NWCHEM Programmer's Guide, Release Previous: 11. Documenting New Modules   Contents
Dunyou Wang 2009-03-13