[table of contents] [master index] [comments] [modules] [programs] [variables] [types] [procedures]
PURPOSE
Declare dimensions ngrid(3) of fft grid Declare global data structures that are defined on an fft grid Routines to allocate, deallocate and manipulate grid data Functions G_to_fft, G_to_bz, norm to manipulate wavevectors
SOURCE
module grid_mod use const_mod !use string_mod implicit none private ! Public data structures public :: ngrid ! dimensions ngrid(:)=(N1,N2,N3) of grid public :: rho_grid ! rho on r-grid (r,N_monomer) public :: omega_grid ! omega on r-grid (r,N_monomer) public :: ksq_grid ! k**2 on k-grid ! Public procedures public :: input_grid public :: allocate_grid public :: deallocate_grid public :: make_ksq public :: max_Gabs public :: G_to_fft public :: G_to_bz public :: Greal_to_bz public :: norm integer :: ngrid(3) real(long), ALLOCATABLE :: rho_grid(:,:,:,:) real(long), ALLOCATABLE :: omega_grid(:,:,:,:) real(long), ALLOCATABLE :: ksq_grid(:,:,:)
VARIABLE
integer ngrid(3) :: Number of grid points in each direction
VARIABLE
real(long) rho_grid(0:,0:,0:,N_monomer) density of each monomer type
VARIABLE
real(long) omega_grid(0:,0:,0:,N_monomer) potential for each monomer type
VARIABLE
real(long) ksq_grid(0:,0:,0:) wave vector magnitude squared, for FFT use
SUBROUTINE
input_grid
PURPOSE
Input integer array ngrid(1:dim) from input script
SOURCE
subroutine input_grid
SUBROUTINE
allocate_grid
PURPOSE
Allocate memory needed by the grid module data structures rho_grid, omega_grid, ksq_grid
SOURCE
subroutine allocate_grid(N_monomer) implicit none integer, intent(IN) :: N_monomer
SUBROUTINE
make_ksq
PURPOSE
Calculate values of k**2 and store in ksq_grid(:,:,:)
COMMENT
calculates norm(G_to_bz(G)) for each wavevector G
SOURCE
subroutine make_ksq(G_basis) implicit none real(long) :: G_basis(:,:)
SUBROUTINE
destroy_grid
PURPOSE
deallocate(return) the memory used by grid_data
SOURCE
subroutine deallocate_grid implicit none
SUBROUTINE
G_to_fft(G)
PURPOSE
Shift any reciprocal wave vector G = [G(1),..,G(dim)] to an equivalent wavevector with indices 0 <= G(i) < ngrid(i)
SOURCE
function G_to_fft(G) implicit none integer :: G_to_fft(3) integer, intent(IN) :: G(:)
SUBROUTINE
G_to_bz
PURPOSE
Shift any reciprocal wave vector of the crystal to the first Brillouin zone of the grid unit cell, i.e., to the equivalent wavevector with the smallest absolute magnitude.
ARGUMENTS
integer G(3) - array containing integer indices of wavevector
SOURCE
function G_to_bz(G) use unit_cell_mod, only : G_basis implicit none integer :: G_to_bz(3) integer, intent(IN) :: G(:) ! wave vector index
SUBROUTINE
max_Gabs
PURPOSE
calculate the max magniture of vectors in FFT grid
SOURCE
function max_Gabs(G_basis) implicit none real(long) :: max_Gabs real(long),intent(IN) :: G_basis(:,:)
SUBROUTINE
norm(G,G_basis)
PURPOSE
Calculate the squared magnitude of vector G
SOURCE
function norm(G,G_basis) use group_mod, only : operator(.dot.) implicit none real(long) :: norm integer,intent(IN) :: G(:) real(long),intent(IN) :: G_basis(:,:)