A block object
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(axis_obj), | public | :: | axis(3) |
Axes in x1, x2, and x3 directions |
|||
| type(axis_obj), | public | :: | axis_partition(3) |
Axes of the main partition, (spacing equal to 1 sub-block) |
|||
| real(kind=wp), | public | :: | dx(3) |
Minimum mesh spacing in each direction |
|||
| real(kind=wp), | public, | contiguous, pointer | :: | dxm(:) | => | null() |
Convenience pointer to x-cell spacings |
| real(kind=wp), | public, | contiguous, pointer | :: | dym(:) | => | null() |
Convenience pointer to y-cell spacings |
| real(kind=wp), | public, | contiguous, pointer | :: | dzm(:) | => | null() |
Convenience pointer to z-cell spacings |
| type(MPI_Datatype), | public | :: | gc_slab_i(3) |
MPI derived type for integer gc |
|||
| type(MPI_Datatype), | public | :: | gc_slab_r(3) |
MPI derived type for wp real gc |
|||
| type(hdf5_obj), | public, | pointer | :: | hdf5 | => | null() |
HDF5 object for IO |
| integer, | public | :: | hi(3) |
Array upper bound |
|||
| logical, | public | :: | is_initialized | = | .false. |
Flag to determine whether this has been initialized |
|
| logical, | public | :: | is_partitioned | = | .false. |
Flag for parallel partitioning |
|
| integer, | public | :: | lo(3) |
Array lower bound |
|||
| integer, | public | :: | ngc | = | 2 |
Number of ghostcells |
|
| type(parallel_obj), | public, | pointer | :: | parallel | => | null() |
Associated parallel structure |
| logical, | public | :: | periods(3) | = | .false. |
Periodicity in each direction |
|
| real(kind=wp), | public | :: | pmax(3) |
Min and max locations across all blocks |
|||
| real(kind=wp), | public | :: | pmin(3) |
Min and max locations across all blocks |
|||
| real(kind=wp), | public, | contiguous, pointer | :: | x(:) | => | null() |
Convenience pointer to x-nodal points |
| real(kind=wp), | public | :: | xhi(3) |
Coordinate of the top right corner |
|||
| real(kind=wp), | public | :: | xlo(3) |
Coordinate of the bottom left corner |
|||
| real(kind=wp), | public, | contiguous, pointer | :: | xm(:) | => | null() |
Convenience pointer to x-mid points |
| real(kind=wp), | public | :: | xmax |
Min and max locations across all blocks |
|||
| real(kind=wp), | public | :: | xmin |
Min and max locations across all blocks |
|||
| real(kind=wp), | public, | contiguous, pointer | :: | y(:) | => | null() |
Convenience pointer to y-nodal points |
| real(kind=wp), | public, | contiguous, pointer | :: | ym(:) | => | null() |
Convenience pointer to y-mid points |
| real(kind=wp), | public | :: | ymax |
Min and max locations across all blocks |
|||
| real(kind=wp), | public | :: | ymin |
Min and max locations across all blocks |
|||
| real(kind=wp), | public, | contiguous, pointer | :: | z(:) | => | null() |
Convenience pointer to z-nodal points |
| real(kind=wp), | public, | contiguous, pointer | :: | zm(:) | => | null() |
Convenience pointer to z-mid points |
| real(kind=wp), | public | :: | zmax |
Min and max locations across all blocks |
|||
| real(kind=wp), | public | :: | zmin |
Min and max locations across all blocks |
Finalizes the block object.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(block_obj), | intent(inout) | :: | this |
A block object |
Returns the coordinates of the cell that contains the position p. This subroutine ignores gost cells. As such, it will always return an internal cell of the domain. If the point is located in a ghost cell, the returned cell will be an internal boundary cell that is closest to that ghost cell.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(block_obj), | intent(in) | :: | this |
A block object |
||
| real(kind=wp), | intent(in) | :: | p(3) |
Position to locate |
Cell coordinates
Returns the coordinates of the cell that contains the position p, inclusive of ghost cells.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(block_obj), | intent(in) | :: | this |
A block object |
||
| real(kind=wp), | intent(in) | :: | p(3) |
Position to locate |
Cell coordinates
Prints to stdout information about this block
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(block_obj), | intent(in) | :: | this |
A block object |
Initializes block object.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(block_obj), | intent(inout) | :: | this |
A block object |
||
| integer, | intent(in) | :: | ngc |
Number of ghostcells |
||
| type(parallel_obj), | intent(in), | target | :: | parallel |
Parallel structure to link with |
[DEPRECATED] Initializes block object.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(block_obj), | intent(inout) | :: | this |
A block object |
||
| real(kind=wp), | intent(in) | :: | xlo(3) |
Coordinates of the bottom left corner |
||
| real(kind=wp), | intent(in) | :: | xhi(3) |
Coordinates of the top right corner |
||
| integer, | intent(in) | :: | lo(3) |
Array lower bound |
||
| integer, | intent(in) | :: | hi(3) |
Array upper bound |
||
| integer, | intent(in) | :: | ngc |
Number of ghostcells |
||
| type(parallel_obj), | intent(in), | target | :: | parallel |
Parallel structure to link with |
Returns block ID and rank of the block where the point is located using a binary search alogirthm. Note that this function assumes that the point is within the domain, i.e., (pmin <= p <= pmax) and that any treatment for periodicity has been previously applied.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(block_obj), | intent(in) | :: | this |
A block object |
||
| real(kind=wp), | intent(in) | :: | p(3) |
Position to locate |
MPI rank
Partitions a parent block into sub-blocks based on a given decomposition Nb(3) for parallel simulations. This will also define the partition axes, and update local bounds/extents, and global bounds/extents.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(block_obj), | intent(inout) | :: | this |
A block object |
||
| integer, | intent(in) | :: | Nb(3) |
Number of blocks in each direction |
Reads block data using HDF5.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(block_obj), | intent(inout) | :: | this |
A block object |
||
| character(len=*), | intent(in) | :: | name |
Name of file to write |
Associate convenience pointers.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(block_obj), | intent(inout) | :: | this |
A block object |
Sets block periodicity in each direction.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(block_obj), | intent(inout) | :: | this |
A block object |
||
| logical, | intent(in) | :: | periods(3) |
Periodicity |
Defines MPI derived type for communicating ghostcells.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(block_obj), | intent(inout) | :: | this |
A block object |
Initializes a uniform grid on this block.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(block_obj), | intent(inout) | :: | this |
A block object |
||
| real(kind=wp), | intent(in) | :: | xlo(3) |
Coordinates of the bottom left corner |
||
| real(kind=wp), | intent(in) | :: | xhi(3) |
Coordinates of the top right corner |
||
| integer, | intent(in) | :: | lo(3) |
Array lower bound |
||
| integer, | intent(in) | :: | hi(3) |
Array upper bound |
Computes the bounds of the sub-block form the bounds of the parent block. Each sub-block gets about the same number of grid points in each direction.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | coord(3) |
Coordinates of MPI rank on MPI grid |
||
| integer, | intent(in) | :: | Nb(3) |
Number of blocks in each direction |
||
| integer, | intent(in) | :: | minlo(3) |
Global lo bounds |
||
| integer, | intent(in) | :: | maxhi(3) |
Global hi bounds |
||
| integer, | intent(out) | :: | sublo(3) |
lo bounds of sub-block |
||
| integer, | intent(out) | :: | subhi(3) |
hi bounds of sub-block |
Updates the dimensional extents of the block.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(block_obj), | intent(inout) | :: | this |
A block object |
Updates the ghostcell values of local grid owned by the current MPI rank. Note that each MPI rank stores only its portion of the grid, thus needs to have proper ghostcell values.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(block_obj), | intent(inout) | :: | this |
A block object |
Updates mid points.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(block_obj), | intent(inout) | :: | this |
A block object |
Updates grid spacing arrays.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(block_obj), | intent(inout) | :: | this |
A block object |
Writes block data using HDF5.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(block_obj), | intent(in) | :: | this |
A block object |
||
| character(len=*), | intent(in) | :: | name |
Name of file to write |
Initializes block object.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(block_obj), | intent(inout) | :: | this |
A block object |
||
| integer, | intent(in) | :: | ngc |
Number of ghostcells |
||
| type(parallel_obj), | intent(in), | target | :: | parallel |
Parallel structure to link with |
[DEPRECATED] Initializes block object.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(block_obj), | intent(inout) | :: | this |
A block object |
||
| real(kind=wp), | intent(in) | :: | xlo(3) |
Coordinates of the bottom left corner |
||
| real(kind=wp), | intent(in) | :: | xhi(3) |
Coordinates of the top right corner |
||
| integer, | intent(in) | :: | lo(3) |
Array lower bound |
||
| integer, | intent(in) | :: | hi(3) |
Array upper bound |
||
| integer, | intent(in) | :: | ngc |
Number of ghostcells |
||
| type(parallel_obj), | intent(in), | target | :: | parallel |
Parallel structure to link with |
type :: block_obj !> A block object type(parallel_obj), pointer :: parallel => null() !! Associated parallel structure type(hdf5_obj), pointer :: hdf5 => null() !! HDF5 object for IO type(axis_obj) :: axis(3) !! Axes in x1, x2, and x3 directions integer :: lo(3) !! Array lower bound integer :: hi(3) !! Array upper bound real(wp) :: xlo(3) !! Coordinate of the bottom left corner real(wp) :: xhi(3) !! Coordinate of the top right corner integer :: ngc=2 !! Number of ghostcells real(wp), contiguous, pointer :: x(:) => null() !! Convenience pointer to x-nodal points real(wp), contiguous, pointer :: y(:) => null() !! Convenience pointer to y-nodal points real(wp), contiguous, pointer :: z(:) => null() !! Convenience pointer to z-nodal points real(wp), contiguous, pointer :: xm(:) => null() !! Convenience pointer to x-mid points real(wp), contiguous, pointer :: ym(:) => null() !! Convenience pointer to y-mid points real(wp), contiguous, pointer :: zm(:) => null() !! Convenience pointer to z-mid points real(wp), contiguous, pointer :: dxm(:) => null() !! Convenience pointer to x-cell spacings real(wp), contiguous, pointer :: dym(:) => null() !! Convenience pointer to y-cell spacings real(wp), contiguous, pointer :: dzm(:) => null() !! Convenience pointer to z-cell spacings logical :: periods(3) = .false. !! Periodicity in each direction logical :: is_partitioned = .false. !! Flag for parallel partitioning type(axis_obj) :: axis_partition(3) !! Axes of the main partition, (spacing equal to 1 sub-block) real(wp) :: dx(3) !! Minimum mesh spacing in each direction real(wp) :: pmin(3),pmax(3) !! Min and max locations across all blocks real(wp) :: xmin,xmax !! Min and max locations across all blocks real(wp) :: ymin,ymax !! Min and max locations across all blocks real(wp) :: zmin,zmax !! Min and max locations across all blocks type(MPI_Datatype) :: gc_slab_r(3) !! MPI derived type for wp real gc type(MPI_Datatype) :: gc_slab_i(3) !! MPI derived type for integer gc logical :: is_initialized = .false. !! Flag to determine whether this has been initialized contains generic :: Initialize => block_obj_Init, block_obj_Init2 procedure :: Finalize => block_obj_Final procedure :: SetConveniencePointers => block_obj_SetConveniencePointers procedure :: SetPeriodicity => block_obj_SetPeriodicity procedure :: SetupUniformGrid => block_obj_SetupUniformGrid procedure :: UpdateGridGhostCells => block_obj_UpdateGridGhostCells procedure :: UpdateExtents => block_obj_UpdateExtents procedure :: UpdateMidPoints => block_obj_UpdateMidPoints procedure :: UpdateSpacing => block_obj_UpdateSpacing procedure :: SetupMPITypes => block_obj_SetupMPITypes procedure :: Partition => block_obj_Partition procedure, & nopass :: SubDivideBlock => block_obj_SubDivideBlock procedure :: Write => block_obj_Write procedure :: Read => block_obj_Read procedure :: Locate => block_obj_Locate procedure :: GetOwningCell => block_obj_GetOwningCell procedure :: GetOwningCellWGC => block_obj_GetOwningCellWGC procedure :: Info => block_obj_Info ! Internal/private procedures procedure, private :: block_obj_Init procedure, private :: block_obj_Init2 end type block_obj