module fd4_block_mod module fd4_globaldef_modTypes:
public type fd4_ghostlistVariables:
integer (kind=i_k), public, parameter :: FD4_GHOST_BND = 0 integer (kind=i_k), public, parameter :: FD4_GHOST_CMM = -1Subroutines and functions:
public subroutine fd4_ghostlist_add (gl, b) public subroutine fd4_ghostlist_remove (gl, b) public function fd4_ghostlist_next (b)
This list abuses the neighbor pointers of blocks to create a doubly linked list. It only works for blocks whose neighbor pointers are unused (ghost blocks, boundary ghost blocks).
Two of the neighbor pointers are used:
b%neigh(1,1)%l ... previous b%neigh(1,2)%l ... next
Identification of ghost blocks:
$pos(1) == FD4_GHOST_BND ... boundary ghost $pos(1) == FD4_GHOST_CMM ... communication ghost
Author: Matthias Lieber
public type fd4_ghostlist type (fd4_block), pointer :: start => NULL () integer (kind=i_k) :: length = 0 logical :: touched = .false. end type fd4_ghostlistComponents:
start | first block of the ghostlist |
length | length of the ghostlist |
touched | indicator if ghostlist has been changed (set in add and remove) |
public subroutine fd4_ghostlist_add (gl, b) type (fd4_ghostlist), intent(inout) :: gl type (fd4_block), pointer :: b end subroutine fd4_ghostlist_addParameters:
gl | the ghostlist |
b | the block to add |
public subroutine fd4_ghostlist_remove (gl, b) type (fd4_ghostlist), intent(inout) :: gl type (fd4_block), pointer :: b end subroutine fd4_ghostlist_removeParameters:
gl | the ghostlist |
b | the block to remove |
Bad things will happen, if the block is not member of the list!
public function fd4_ghostlist_next (b) type (fd4_block), pointer :: b type (fd4_block), pointer :: fd4_ghostlist_next end function fd4_ghostlist_nextParameters:
b | the current block |
fd4_ghostlist_next | return value: next block |
Returns NULL() if b is last block in the list. This routine simply does:
fd4_ghostlist_next => b%neigh(1,2)%l