subroutine grid_obtain(iatom,npt,xyz,wt,jwt,coord) implicit double precision (a-h,o-z) logical coord dimension xyz(3,*), wt(*)Obtain a block of grid points and weights.
xyz
.
Note that the grid is returned sequentially within each atom, but it is possible to take individual atoms in any order. Note also that at the first call for an atom, grid_obtain allocates memory internally, which persists for the benefit of later calls. Thus when an atom is done, the calling routine should take steps to release the stack.
The following is a complete code fragment which will read through the whole molecular grid.
include "common/big" include "common/cgeom" nblock=128 ipt=icorr(nblock*3) iwt=icorr(nblock) call grid_open(record) do icen=1,ncen ibase = icorr(0) do iblock=1,2**30 ! effectively an infinite loop npt=nblock call grid_obtain (icen,npt,q(ipt),q(iwt),-1,.true.) if (npt.le.0) goto 448 write (iout,449) 'X',(q(ipt-3+i*3),i=1,npt) write (iout,449) 'Y',(q(ipt-2+i*3),i=1,npt) write (iout,449) 'Z',(q(ipt-1+i*3),i=1,npt) write (iout,449) 'W',(q(iwt-1+i),i=1,npt) write (iout,*) ' ' 449 format(1x,a,8f15.8) end do 448 call corlsr(ibase) end do call corlsr(ipt)
P.J. Knowles and H.-J. Werner