ABINIT/prep_fourwf [ Functions ]

blocksize= size of block for FFT
cwavef(2,npw*ndat)=planewave coefficients of wavefunction (one spinorial component?).
dtfil <type(datafiles_type)>=variables related to files
gvnlc=matrix elements <G|Vnonlocal|C>
kg_k(3,npw_k)=reduced planewave coordinates.
lmnmax=if useylm=1, max number of (l,m,n) comp. over all type of psps
=if useylm=0, max number of (l,n) comp. over all type of psps
mgfft=maximum size of 1d ffts
mpi_enreg=informations about mpi parallelization
mpsang= 1+maximum angular momentum for nonlocal pseudopotentials
mpssoang= 1+maximum (spin*angular momentum) for nonlocal pseudopotentials
natom=number of atoms in cell.
nband_k=number of bands at this k point for that spin polarization
ndat=number of FFT to do in //
ngfft(18)= contain all needed information about 3D FFT
npw_k=number of plane waves at this k point
nspinor=number of spinorial components of the wavefunctions
ntypat=number of types of atoms in unit cell.
n4,n5,n6 used for dimensionning of vlocal
option_fourwf=option for fourwf (see fourwf.F90)
prtvol=control print volume and debugging output
ucvol=unit cell volume
[bandfft_kpt_tab]= (optional) if present, contains tabs used to implement
the "band-fft" parallelism
if not present, the bandfft_kpt global variable is used
[use_gpu_cuda]= (optional) 1 if Cuda (GPU) is on

ABINIT/prep_getghc [ Functions ]

blocksize= size of block for FFT
cpopt=flag defining the status of cprjin%cp(:)=<Proj_i|Cnk> scalars (see below, side effects)
cwavef(2,npw*my_nspinor*blocksize)=planewave coefficients of wavefunction.
gs_hamk <type(gs_hamiltonian_type)>=all data for the hamiltonian at k
gvnlc=matrix elements <G|Vnonlocal|C>
lambda=factor to be used when computing <G|H-lambda.S|C> - only for sij_opt=-1
Typically lambda is the eigenvalue (or its guess)
mpi_enreg=informations about mpi parallelization
prtvol=control print volume and debugging output
sij_opt= -PAW ONLY- if 0, only matrix elements <G|H|C> have to be computed
(S=overlap) if 1, matrix elements <G|S|C> have to be computed in gsc in addition to ghc
if -1, matrix elements <G|H-lambda.S|C> have to be computed in ghc (gsc not used)

ABINIT/prep_index_wavef_bandpp [ Functions ]

this routine sorts the waves functions by bandpp and by processors
after the alltoall

INPUTS

nproc_band = number of processors below the band
bandpp = number of groups of couple of waves functions
nspinor = number of spin
ndatarecv = total number of values received by the processor and sended
by the other processors band
recvcounts = number of values sended by each processor band and received
by the processor
rdispls = positions of the values received by the processor and
sended by each processor band

abinit/prep_nonlop [ Functions ]

choice: chooses possible output:
choice=1 => a non-local energycontribution
=2 => a gradient with respect to atomic position(s)
=3 => a gradient with respect to strain(s)
=23=> a gradient with respect to atm. pos. and strain(s)
=4 => a 2nd derivative with respect to atomic pos.
=24=> a gradient and 2nd derivative with respect to atomic pos.
=5 => a gradient with respect to k wavevector
=6 => 2nd derivatives with respect to strain and atm. pos.
=7 => no operator, just projections
blocksize= size of block for FFT
cpopt=flag defining the status of cwaveprj=<Proj_i|Cnk> scalars (see below, side effects)
cwavef(2,npw*my_nspinor*blocksize)=planewave coefficients of wavefunction.
gvnlc=matrix elements <G|Vnonlocal|C>
hamk <type(gs_hamiltonian_type)>=data defining the Hamiltonian at a given k (NL part involved here)
idir=direction of the - atom to be moved in the case (choice=2,signs=2),
- k point direction in the case (choice=5,signs=2)
- strain component (1:6) in the case (choice=2,signs=2) or (choice=6,signs=1)
lambdablock(blocksize)=factor to be used when computing (Vln-lambda.S) - only for paw_opt=2
mpi_enreg=informations about mpi parallelization
nnlout=dimension of enlout (when signs=1):
ntypat=number of types of atoms in cell
paw_opt= define the nonlocal operator concerned with
signs= if 1, get contracted elements (energy, forces, stress, ...)
if 2, applies the non-local operator to a function in reciprocal space
tim_nonlop=timing code of the calling routine (can be set to 0 if not attributed)

OUTPUT

==== if (signs==1) ====
enlout_block(nnlout)=
if paw_opt==0, 1 or 2: contribution of this block of states to the nl part of various properties
if paw_opt==3: contribution of this block of states to <c|S|c> (where S=overlap when PAW)
==== if (signs==2) ====
if paw_opt==0, 1, 2 or 4:
gvnlc(2,my_nspinor*npw)=result of the aplication of the nl operator
or one of its derivative to the input vect.
if paw_opt==3 or 4:
gsc(2,my_nspinor*npw*(paw_opt/3))=result of the aplication of (I+S)
to the input vect. (where S=overlap when PAW)

SIDE EFFECTS

==== ONLY IF useylm=1
cwaveprj(natom,my_nspinor) <type(pawcprj_type)>=projected input wave function |c> on non-local projector
=<p_lmn|c> and derivatives
Treatment depends on cpopt parameter:
if cpopt=-1, <p_lmn|in> (and derivatives)
have to be computed (and not saved)
if cpopt= 0, <p_lmn|in> have to be computed and saved
derivatives are eventually computed but not saved
if cpopt= 1, <p_lmn|in> and first derivatives have to be computed and saved
other derivatives are eventually computed but not saved
if cpopt= 2 <p_lmn|in> are already in memory;
only derivatives are computed here and not saved
(if useylm=0, should have cpopt=-1)

ABINIT/prep_sort_wavef_spin [ Functions ]

Compute index used to sort a spinorial wave-function by spin
Sort to have all nspinor=1 fisrt, then all nspinor=2

INPUTS

nproc_band=size of "band" communicator
nspinor=number of spinorial components of the wavefunction
ndatarecv=total number of values on all processors
recvcounts(nproc_band)= number of received values by the processor
rdispls(nproc_band)= offsets of the received values by the processor

OUTPUT

index_wavef(:)=array containing the sorted indexes (pointer, allocated in this routine)

ABINIT/prep_wavef_sym_do [ Functions ]

this routine associates waves functions by two as following
E(G) = C(G) + D(G)
E(-G) = C*(G) + iD*(G)
the values are distributed on the processors in function of
the value of mpi_enreg%distribfft%tab_fftwf2_distrib( (-kg_k_gather(2,i) )

INPUTS

mpi_enreg = informations about mpi parallelization
bandpp = number of couple of waves functions
nspinor = number of spin
ndatarecv = number of values received by the processor and sended
by the other processors band
ndatarecv_tot = total number of received values
(ndatarecv + number of received opposited planewave coordinates)
ndatasend_sym = number of sended values to the processors fft to create opposited
planewave coordinates
tab_proc = positions of opposited planewave coordinates in the list of the
processors fft
cwavef_alltoall = planewave coefficients of wavefunction
( initial of the processor + sended by other processors band)
sendcounts_sym = number of sended values by the processor to each processor fft
sdispls_sym = postions of the sended values by the processor to each processor fft
recvcounts_sym = number of the received values by the processor from each processor fft
rdispls_sym = postions of the received values by the processor from each processor fft

OUTPUT

ewavef_alltoall_sym = planewave coefficients of wavefunction
initial of the processor +
sended by other processors band +
sended by other processors fft +
and compisited if bandpp >1
index_wavef_send = index to send the values in blocks to the other processor fft

ABINIT/prep_wavef_sym_undo [ Functions ]

this routine dissociates each wave function in two waves functions as following
C(G) = ( E*(-G) + E(G))/2
D(G) = i*( E*(-G) - E(G))/2
the values are redistributed on the processors in function of
the value of mpi_enreg%distribfft%tab_fftwf2_distrib( (-kg_k_gather(2,i) )

INPUTS

mpi_enreg = informations about mpi parallelization
bandpp = number of groups of couple of waves functions
nspinor = number of spin
ndatarecv = number of values received by the processor and sended
by the other processors band
ndatarecv_tot = total number of received values
(ndatarecv + number of received opposited planewave coordinates)
ndatasend_sym = number of sended values to the processors fft to create opposited
planewave coordinates
idatarecv0 = position of the planewave coordinates (0,0,0)
sendcounts_sym = number of sended values by the processor to each processor fft
sdispls_sym = postions of the sended values by the processor to each processor fft
recvcounts_sym = number of the received values by the processor to each processor fft
gwavef_alltoall_sym = planewave coefficients of wavefunction
initial of the processor +
sended by other processors band +
sended by other processors fft +
and composited if bandpp >1
index_wavef_send = index to send the values by block to the other processor fft

OUTPUT

gwavef_alltoall = planewave coefficients of wavefunction
( for of the processor + to send to other processors band)