A fast and precise DFT wavelet code

# Build_Kernel.f90 File Reference

Routines to build the kernel used by the Poisson solver. More...

Go to the source code of this file.

## Functions/Subroutines

subroutine Periodic_Kernel (n1, n2, n3, nker1, nker2, nker3, h1, h2, h3, itype_scf, karray, iproc, nproc)
Build the kernel of the Poisson operator with surfaces Boundary conditions in an interpolating scaling functions basis. Beware of the fact that the nonperiodic direction is y! SYNOPSIS.
subroutine fourtrans_isf (n, ftisf)
Calculate the fourier transform Suppose the output symmetric and real.
subroutine fourtrans (p, htp)
Transform the wavelet filters.
subroutine Surfaces_Kernel (n1, n2, n3, m3, nker1, nker2, nker3, h1, h2, h3, itype_scf, karray, iproc, nproc)
Build the kernel of the Poisson operator with surfaces Boundary conditions in an interpolating scaling functions basis. Beware of the fact that the nonperiodic direction is y! SYNOPSIS.
subroutine calculates_green_opt (n, n_scf, itype_scf, intorder, xval, yval, c, mu, hres, g_mu)
subroutine calculates_green_opt_muzero (n, n_scf, intorder, xval, yval, c, hres, green)
subroutine indices (nimag, nelem, intrn, extrn, nindex)
subroutine Free_Kernel (n01, n02, n03, nfft1, nfft2, nfft3, n1k, n2k, n3k, hx, hy, hz, itype_scf, iproc, nproc, karray)
Build the kernel of a gaussian function for interpolating scaling functions. Do the parallel HalFFT of the symmetrized function and stores into memory only 1/8 of the grid divided by the number of processes nproc.
subroutine gauconv_ffts (itype_scf, pgauss, hx, hy, hz, n1, n2, n3, nk1, nk2, nk3, n_range, fwork, fftwork, kffts)
subroutine analytic_integral (alpha, ntot, m, fwork)
Here alpha correspondes to sqrtalpha in mathematica the final result is fwork(j+m)-fwork(j-m).
subroutine gauss_conv_scf (itype_scf, pgauss, hgrid, dx, n_range, n_scf, x_scf, y_scf, kernel_scf, work)
subroutine inserthalf (n1, n3, lot, nfft, i1, zf, zw)
subroutine kernelfft (n1, n2, n3, nd1, nd2, nd3, nk1, nk2, nk3, nproc, iproc, zf, zr)
Calculates the FFT of the distributed kernel (Based on suitable modifications of S.Goedecker routines).
subroutine realcopy (lot, nfft, n2, nk1, nk2, zin, zout)
subroutine switch (nfft, n2, lot, n1, lzt, zt, zw)
subroutine mpiswitch (j3, nfft, Jp2st, J2st, lot, n1, nd2, nd3, nproc, zmpi1, zw)
subroutine gequad (p, w, urange, drange, acc)
The conversion from d0 to dp type should be finished.
subroutine fill_halfft (nreal, n1, n_range, nfft, kernelreal, halfft)
subroutine copyreal (n1, nk1, nfft, halfft, kernelfour)

## Detailed Description

Routines to build the kernel used by the Poisson solver.

Definition in file Build_Kernel.f90.

## Function Documentation

 subroutine analytic_integral ( real(dp),intent(in) alpha, integer,intent(in) ntot, integer,intent(in) m, real(dp),dimension(0:ntot),intent(inout) fwork )

Here alpha correspondes to sqrtalpha in mathematica the final result is fwork(j+m)-fwork(j-m).

Definition at line 1096 of file Build_Kernel.f90.

References wofz_mod().

Referenced by gauconv_ffts().

Here is the call graph for this function:

Here is the caller graph for this function:

 subroutine calculates_green_opt ( integer,intent(in) n, integer,intent(in) n_scf, integer,intent(in) itype_scf, integer,intent(in) intorder, real(dp),dimension(0:n_scf),intent(in) xval, real(dp),dimension(0:n_scf),intent(in) yval, real(dp),dimension(intorder+1),intent(in) c, real(dp),intent(in) mu, real(dp),intent(in) hres, real(dp),dimension(n),intent(out) g_mu )

Definition at line 572 of file Build_Kernel.f90.

References min, module_base::ndebug, and scf_recursion().

Referenced by Surfaces_Kernel().

Here is the call graph for this function:

Here is the caller graph for this function:

 subroutine calculates_green_opt_muzero ( integer,intent(in) n, integer,intent(in) n_scf, integer,intent(in) intorder, real(dp),dimension(0:n_scf),intent(in) xval, real(dp),dimension(0:n_scf),intent(in) yval, real(dp),dimension(intorder+1),intent(in) c, real(dp),intent(in) hres, real(dp),dimension(n),intent(out) green )

Definition at line 710 of file Build_Kernel.f90.

Referenced by Surfaces_Kernel().

Here is the caller graph for this function:

 subroutine copyreal ( integer,intent(in) n1, integer,intent(in) nk1, integer,intent(in) nfft, real(dp),dimension(2,n1,nfft),intent(in) halfft, real(dp),dimension(nk1,nfft),intent(out) kernelfour )

Definition at line 1908 of file Build_Kernel.f90.

 subroutine fill_halfft ( integer,intent(in) nreal, integer,intent(in) n1, integer,intent(in) n_range, integer,intent(in) nfft, real(dp),dimension(nreal,nfft),intent(in) kernelreal, real(dp),dimension(2,n1,nfft),intent(out) halfft )

Definition at line 1882 of file Build_Kernel.f90.

References min.

 subroutine fourtrans ( real(dp),intent(in) p, real(dp),intent(out) htp )

Transform the wavelet filters.

Definition at line 150 of file Build_Kernel.f90.

References m.

Referenced by fourtrans_isf().

Here is the caller graph for this function:

 subroutine fourtrans_isf ( integer,intent(in) n, real(dp),dimension(0:n),intent(out) ftisf )

Calculate the fourier transform Suppose the output symmetric and real.

Definition at line 100 of file Build_Kernel.f90.

References fourtrans().

Referenced by Periodic_Kernel().

Here is the call graph for this function:

Here is the caller graph for this function:

 subroutine Free_Kernel ( integer,intent(in) n01, integer,intent(in) n02, integer,intent(in) n03, integer,intent(in) nfft1, integer,intent(in) nfft2, integer,intent(in) nfft3, integer,intent(in) n1k, integer,intent(in) n2k, integer,intent(in) n3k, real(dp),intent(in) hx, real(dp),intent(in) hy, real(dp),intent(in) hz, integer,intent(in) itype_scf, integer,intent(in) iproc, integer,intent(in) nproc, real(dp),dimension(n1k,n2k,n3k/nproc),intent(out) karray )

Build the kernel of a gaussian function for interpolating scaling functions. Do the parallel HalFFT of the symmetrized function and stores into memory only 1/8 of the grid divided by the number of processes nproc.

SYNOPSIS Build the kernel (karray) of a gaussian function for interpolating scaling functions

Parameters:
 n01,n02,n03 Mesh dimensions of the density nfft1,nfft2,nfft3 Dimensions of the FFT grid (HalFFT in the third direction) n1k,n2k,n3k Dimensions of the kernel FFT hgrid Mesh step itype_scf Order of the scaling function (8,14,16) MODIFICATION Different calculation of the gaussian times ISF integral, LG, Dec 2009

Definition at line 836 of file Build_Kernel.f90.

References gauconv_ffts(), gequad(), max, and module_base::ndebug.

Referenced by createKernel().

Here is the call graph for this function:

Here is the caller graph for this function:

 subroutine gauconv_ffts ( integer,intent(in) itype_scf, real(dp),intent(in) pgauss, real(dp),intent(in) hx, real(dp),intent(in) hy, real(dp),intent(in) hz, integer,intent(in) n1, integer,intent(in) n2, integer,intent(in) n3, integer,intent(in) nk1, integer,intent(in) nk2, integer,intent(in) nk3, integer,intent(in) n_range, real(dp),dimension(0:n_range),intent(inout) fwork, real(dp),dimension(2,max(n1,n2,n3) fftwork, real(dp),dimension(max(nk1,nk2,nk3) kffts )

Definition at line 1023 of file Build_Kernel.f90.

References analytic_integral(), fft_1d_ctoc(), and min.

Referenced by Free_Kernel().

Here is the call graph for this function:

Here is the caller graph for this function:

 subroutine gauss_conv_scf ( integer,intent(in) itype_scf, real(dp),intent(in) pgauss, real(dp),intent(in) hgrid, real(dp),intent(in) dx, integer,intent(in) n_range, integer,intent(in) n_scf, real(dp),dimension(0:n_scf),intent(in) x_scf, real(dp),dimension(0:n_scf),intent(in) y_scf, real(dp),dimension(-n_range:n_range),intent(inout) kernel_scf, real(dp),dimension(-n_range:n_range),intent(inout) work )

Definition at line 1246 of file Build_Kernel.f90.

References scf_recursion().

Here is the call graph for this function:

 subroutine gequad ( real(dp),dimension(*),intent(out) p, real(dp),dimension(*),intent(out) w, real(dp),intent(out) urange, real(dp),intent(out) drange, real(dp),intent(out) acc )

The conversion from d0 to dp type should be finished.

Definition at line 1684 of file Build_Kernel.f90.

Referenced by Free_Kernel(), and two_center_two_electrons().

Here is the caller graph for this function:

 subroutine indices ( integer,intent(out) nimag, integer,intent(in) nelem, integer,intent(in) intrn, integer,intent(in) extrn, integer,intent(out) nindex )

Definition at line 799 of file Build_Kernel.f90.

Referenced by Surfaces_Kernel().

Here is the caller graph for this function:

 subroutine inserthalf ( integer,intent(in) n1, integer,intent(in) n3, integer,intent(in) lot, integer,intent(in) nfft, integer,intent(in) i1, real(dp),dimension(n1/2+1,n3/2+1),intent(in) zf, real(dp),dimension(2,lot,n3/2),intent(out) zw )

Definition at line 1299 of file Build_Kernel.f90.

Referenced by kernelfft().

Here is the caller graph for this function:

 subroutine kernelfft ( integer,intent(in) n1, integer,intent(in) n2, integer,intent(in) n3, integer,intent(in) nd1, integer,intent(in) nd2, integer,intent(in) nd3, integer,intent(in) nk1, integer,intent(in) nk2, integer,intent(in) nk3, integer,intent(in) nproc, integer,intent(in) iproc, real(dp),dimension(n1/2+1,n3/2+1,nd2/nproc),intent(in) zf, real(dp),dimension(nk1,nk2,nk3/nproc),intent(inout) zr )

Calculates the FFT of the distributed kernel (Based on suitable modifications of S.Goedecker routines).

SYNOPSIS

Parameters:
 zf,: Real kernel (input) zf(i1,i2,i3) zr,: Distributed Kernel FFT zr(2,i1,i2,i3) nproc,: number of processors used as returned by MPI_COMM_SIZE iproc,: [0:nproc-1] number of processor as returned by MPI_COMM_RANK n1,n2,n3,: logical dimension of the transform. As transform lengths most products of the prime factors 2,3,5 are allowed. The detailed table with allowed transform lengths can be found in subroutine ctrig_sg nd1,nd2,nd3,: Dimensions of work arrays

Definition at line 1347 of file Build_Kernel.f90.

Here is the call graph for this function:

 subroutine mpiswitch ( integer,intent(in) j3, integer,intent(in) nfft, integer,intent(inout) Jp2st, integer,intent(inout) J2st, integer,intent(in) lot, integer,intent(in) n1, integer,intent(in) nd2, integer,intent(in) nd3, integer,intent(in) nproc, real(dp),dimension(2,n1,nd2/nproc,nd3/nproc,nproc) zmpi1, real(dp),dimension(2,lot,n1) zw )

Definition at line 1654 of file Build_Kernel.f90.

Referenced by kernelfft().

Here is the caller graph for this function:

 subroutine Periodic_Kernel ( integer,intent(in) n1, integer,intent(in) n2, integer,intent(in) n3, integer,intent(in) nker1, integer,intent(in) nker2, integer,intent(in) nker3, real(dp),intent(in) h1, real(dp),intent(in) h2, real(dp),intent(in) h3, integer,intent(in) itype_scf, real(dp),dimension(nker1,nker2,nker3/nproc),intent(out) karray, integer,intent(in) iproc, integer,intent(in) nproc )

Build the kernel of the Poisson operator with surfaces Boundary conditions in an interpolating scaling functions basis. Beware of the fact that the nonperiodic direction is y! SYNOPSIS.

Parameters:
 n1,n2,n3 Dimensions for the FFT nker1,nker2,nker3 Dimensions of the kernel (nker3=n3/2+1) nker(1,2)=n(1,2)/2+1 h1,h2,h3 Mesh steps in the three dimensions itype_scf Order of the scaling function iproc,nproc Number of process, number of processes karray output array

Definition at line 21 of file Build_Kernel.f90.

References fourtrans_isf(), min, and module_base::ndebug.

Referenced by createKernel().

Here is the call graph for this function:

Here is the caller graph for this function:

 subroutine realcopy ( integer,intent(in) lot, integer,intent(in) nfft, integer,intent(in) n2, integer,intent(in) nk1, integer,intent(in) nk2, real(dp),dimension(2,lot,n2),intent(in) zin, real(dp),dimension(nk1,nk2),intent(out) zout )

Definition at line 1617 of file Build_Kernel.f90.

Referenced by kernelfft().

Here is the caller graph for this function:

 subroutine Surfaces_Kernel ( integer,intent(in) n1, integer,intent(in) n2, integer,intent(in) n3, integer,intent(in) m3, integer,intent(in) nker1, integer,intent(in) nker2, integer,intent(in) nker3, real(dp),intent(in) h1, real(dp),intent(in) h2, real(dp),intent(in) h3, integer,intent(in) itype_scf, real(dp),dimension(nker1,nker2,nker3/nproc),intent(out) karray, integer,intent(in) iproc, integer,intent(in) nproc )

Build the kernel of the Poisson operator with surfaces Boundary conditions in an interpolating scaling functions basis. Beware of the fact that the nonperiodic direction is y! SYNOPSIS.

Parameters:
 n1,n2,n3 Dimensions for the FFT m3 Actual dimension in non-periodic direction nker1,nker2,nker3 Dimensions of the kernel (nker3=n3/2+1) nker(1,2)=n(1,2)/2+1 h1,h2,h3 Mesh steps in the three dimensions itype_scf Order of the scaling function iproc,nproc Number of process, number of processes karray output array

Definition at line 185 of file Build_Kernel.f90.

Referenced by createKernel().

Here is the call graph for this function:

Here is the caller graph for this function:

 subroutine switch ( integer,intent(in) nfft, integer,intent(in) n2, integer,intent(in) lot, integer,intent(in) n1, integer,intent(in) lzt, real(dp),dimension(2,lzt,n1) zt, real(dp),dimension(2,lot,n2) zw )

Definition at line 1635 of file Build_Kernel.f90.

Referenced by kernelfft().

Here is the caller graph for this function: