Documentation for module realspace_grid_types

...

source: realspace_grid_types.F
Loading...

public Types:

realspace_grid_desc_type
...
realspace_grid_desc_p_type
...
realspace_grid_p_type
...
realspace_grid_input_type
...
realspace_grid_type
...

public Subroutines/Functions:

SUBROUTINE
rs_grid_create (rs, desc)
...
Determine the setup of real space grids - this is divided up into the creation of a descriptor and the actual grid itself (see rs_grid_create)
returns the 1D rank of the task which is a cartesian shift away from 1D rank rank_in only possible if rs_grid is a distributed grid
FUNCTION
INTEGER
rs_grid_max_ngpts (desc)
returns the maximum number of points in the local grid of any process to account for the case where the grid may later be reordered
rs1(i) = rs1(i) + rs2(i)*rs3(i)
SUBROUTINE
rs_grid_print (rs, iounit)
Print information on grids to output
releases the given rs grid (see doc/ReferenceCounting.html)
releases the given rs grid descriptor (see doc/ReferenceCounting.html)
Defines a new ordering of ranks on this realspace grid, recalculating the data bounds and reallocating the grid. As a result, each MPI process now has a real rank (i.e. it's rank in the MPI communicator from the pw grid) and a virtual rank (the rank of the process where the data now owned by this process would reside in an ordinary cartesian distribution). NB. Since the grid size required may change, the caller should be sure to release and recreate the corresponding rs_grids The desc%real2virtual and desc%virtual2real arrays can be used to map a physical rank to the 'rank' of data owned by that process and vice versa
SUBROUTINE
rs_grid_retain (rs_grid)
retains the given rs grid (see doc/ReferenceCounting.html)
retains the given rs grid descriptor (see doc/ReferenceCounting.html)
SUBROUTINE
rs_grid_set_box (pw_grid, rs)
Set box matrix info for real space grid This is needed for variable cell simulations
SUBROUTINE
rs_grid_zero (rs)
Initialize grid to zero
SUBROUTINE
rs_pw_transfer (rs, pw, dir)
Copy a function from/to a PW grid type to/from a real space type dir is the named constant rs2pw or pw2rs

Parameters:

INTEGER
:: pw2rs = 12
INTEGER
:: rs2pw = 11
INTEGER
:: rsgrid_automatic = 2
INTEGER
:: rsgrid_distributed = 0
INTEGER
:: rsgrid_replicated = 1

public Types:

TYPE :: realspace_grid_desc_p_type

...


POINTER :: rs_desc ...

TYPE :: realspace_grid_desc_type

...


INTEGER
:: grid_id ...
POINTER :: pw ...
INTEGER
:: ref_count ...
INTEGER(int_8)
:: ngpts ...
INTEGER,
DIMENSION(3) :: npts ...
INTEGER,
DIMENSION(3) :: lb ...
INTEGER,
DIMENSION(3) :: ub ...
INTEGER
:: border ...
INTEGER,
DIMENSION(3) :: perd ...
REAL(dp),
DIMENSION(3,3) :: dh ...
REAL(dp),
DIMENSION(3,3) :: dh_inv ...
LOGICAL
:: orthorhombic ...
LOGICAL
:: parallel ...
LOGICAL
:: distributed ...
INTEGER
:: group ...
INTEGER
:: my_pos ...
LOGICAL
:: group_head ...
INTEGER
:: group_size ...
INTEGER,
DIMENSION(3) :: group_dim ...
INTEGER,
DIMENSION(3) :: group_coor ...
INTEGER,
DIMENSION(3) :: neighbours ...
INTEGER,
DIMENSION(:,:), POINTER :: lb_global ...
INTEGER,
DIMENSION(:,:), POINTER :: ub_global ...
INTEGER,
DIMENSION(:,:), POINTER :: rank2coord ...
INTEGER,
DIMENSION(:,:,:), POINTER :: coord2rank ...
INTEGER,
DIMENSION(:), POINTER :: x2coord ...
INTEGER,
DIMENSION(:), POINTER :: y2coord ...
INTEGER,
DIMENSION(:), POINTER :: z2coord ...
INTEGER
:: my_virtual_pos ...
INTEGER,
DIMENSION(3) :: virtual_group_coor ...
INTEGER,
DIMENSION(:), ALLOCATABLE :: virtual2real ...
INTEGER,
DIMENSION(:), ALLOCATABLE :: real2virtual ...

TYPE :: realspace_grid_input_type

...


INTEGER
:: distribution_type ...
INTEGER
:: distribution_layout ...
REAL(dp)
:: memory_factor ...
LOGICAL
:: lock_distribution ...
INTEGER
:: nsmax ...
REAL(dp)
:: halo_reduction_factor ...

TYPE :: realspace_grid_p_type

...


POINTER :: rs_grid ...

TYPE :: realspace_grid_type

...


POINTER :: desc ...
INTEGER
:: id_nr ...
INTEGER
:: ref_count ...
INTEGER
:: ngpts_local ...
INTEGER,
DIMENSION(3) :: npts_local ...
INTEGER,
DIMENSION(3) :: lb_local ...
INTEGER,
DIMENSION(3) :: ub_local ...
INTEGER,
DIMENSION(3) :: lb_real ...
INTEGER,
DIMENSION(3) :: ub_real ...
INTEGER,
DIMENSION(:), POINTER :: px ...
INTEGER,
DIMENSION(:), POINTER :: py ...
INTEGER,
DIMENSION(:), POINTER :: pz ...
REAL(dp),
DIMENSION(:,:,:), POINTER :: r ...

SUBROUTINErs_grid_create(rs, desc)

...

Arguments:
POINTER
:: rs ...
POINTER
:: desc ...

SUBROUTINErs_grid_create_descriptor(desc, pw_grid, input_settings, border_points)

Determine the setup of real space grids - this is divided up into the creation of a descriptor and the actual grid itself (see rs_grid_create)

Arguments:
POINTER
:: desc ...
POINTER
:: pw_grid ...
INTENT(in)
:: input_settings ...
INTEGER,
INTENT(in),
OPTIONAL
:: border_points ...

FUNCTIONrs_grid_locate_rank(rs_desc, rank_in, shift)

returns the 1D rank of the task which is a cartesian shift away from 1D rank rank_in only possible if rs_grid is a distributed grid

Return Value ::
INTEGER
Arguments:
POINTER
:: rs_desc ...
INTEGER,
INTENT(in)
:: rank_in ...
INTEGER,
INTENT(in)
:: shift(3) ...

FUNCTIONrs_grid_max_ngpts(desc)

returns the maximum number of points in the local grid of any process to account for the case where the grid may later be reordered

Return Value ::
INTEGER
Arguments:
POINTER
:: desc ...

SUBROUTINErs_grid_mult_and_add(rs1, rs2, rs3, scalar)

rs1(i) = rs1(i) + rs2(i)*rs3(i)

Arguments:
POINTER
:: rs1 ...
POINTER
:: rs2 ...
POINTER
:: rs3 ...
REAL(dp),
INTENT(in)
:: scalar ...

SUBROUTINErs_grid_print(rs, iounit)

Print information on grids to output

Arguments:
POINTER
:: rs ...
INTEGER,
INTENT(in)
:: iounit ...

SUBROUTINErs_grid_release(rs_grid)

releases the given rs grid (see doc/ReferenceCounting.html)

Arguments:
POINTER
:: rs_grid the rs grid to release

SUBROUTINErs_grid_release_descriptor(rs_desc)

releases the given rs grid descriptor (see doc/ReferenceCounting.html)

Arguments:
POINTER
:: rs_desc the rs grid descriptor to release

SUBROUTINErs_grid_reorder_ranks(desc, real2virtual)

Defines a new ordering of ranks on this realspace grid, recalculating the data bounds and reallocating the grid. As a result, each MPI process now has a real rank (i.e. it's rank in the MPI communicator from the pw grid) and a virtual rank (the rank of the process where the data now owned by this process would reside in an ordinary cartesian distribution). NB. Since the grid size required may change, the caller should be sure to release and recreate the corresponding rs_grids The desc%real2virtual and desc%virtual2real arrays can be used to map a physical rank to the 'rank' of data owned by that process and vice versa

Arguments:
POINTER
:: desc ...
INTEGER,
INTENT(in)
:: real2virtual(:) ...

SUBROUTINErs_grid_retain(rs_grid)

retains the given rs grid (see doc/ReferenceCounting.html)

Arguments:
POINTER
:: rs_grid the grid to retain

SUBROUTINErs_grid_retain_descriptor(rs_desc)

retains the given rs grid descriptor (see doc/ReferenceCounting.html)

Arguments:
POINTER
:: rs_desc the grid descriptor to retain

SUBROUTINErs_grid_set_box(pw_grid, rs)

Set box matrix info for real space grid This is needed for variable cell simulations

Arguments:
POINTER
:: pw_grid ...
POINTER
:: rs ...

SUBROUTINErs_grid_zero(rs)

Initialize grid to zero

Arguments:
POINTER
:: rs ...

SUBROUTINErs_pw_transfer(rs, pw, dir)

Copy a function from/to a PW grid type to/from a real space type dir is the named constant rs2pw or pw2rs

Arguments:
POINTER
:: rs ...
TYPE(pw_type),
POINTER
:: pw ...
INTEGER,
INTENT(in)
:: dir ...