1      subroutine int_init_dso(maxbuf,maxscr,basis,npt)
2c
3c $Id$
4c
5      implicit none
6c
7#include "hnd_pointers.fh"
8#include "bas.fh"
9#include "errquit.fh"
10#include "hnd_tol.fh"
11c
12      integer maxbuf    ! [output] buffer space for integrals
13      integer maxscr    ! [output] scratch space needed
14      integer basis     ! [input] basis set info
15      integer npt       ! [input] number of grid points to be calculated
16c
17      integer lmax, iblk, i, mroots
18c
19c     set default tolerance
20c
21      itol = 15
22c
23c     Define Hermite polynomial values
24c
25      call hnd_whermt
26      call hnd_wleg
27c
28c     set up memory requirements: get max L first
29c
30      lmax = -1
31      if (.not.bas_high_angular(basis,lmax))
32     &   call errquit('int_init_dso: lmax error',lmax, INT_ERR)
33      lmax = lmax + 1
34c
35c     Calculate maximum buffer needed
36c
37      maxbuf = lmax*(lmax+1)*lmax*(lmax+1)/4*npt*9
38c
39c     Calculate maximum scratch space needed
40c
41      mroots = (2*lmax+2-2)/2+1
42      iblk = lmax*lmax*4*mroots
43      maxscr = 3*iblk
44      maxscr = max(maxbuf,maxscr)
45c
46c     Set pointers for scratch space
47c
48      dsot(1) = 1
49      do i = 2, 3
50         dsot(i) = 1 + (i-1)*iblk
51      enddo
52c
53c     If spherical basis, allocate scratch space for transformation
54c     A little smaller than maxbuf: we will use maxbuf size
55c
56      maxscr = max(maxscr,maxbuf)
57c
58      return
59      end
60