Add the field 'coord' to meta block structure.

BLOCK STRUCTURE

 - add a new field 'coord' to store block coordinates in the units of
   the effective resolution;
 - add a subroutine metablock_set_coord() to set the block coordinates;
This commit is contained in:
Grzegorz Kowal 2010-10-11 02:10:47 -03:00
parent a8dd14def4
commit 8757789042

View File

@ -113,6 +113,10 @@ module blocks
! 0 - do nothing
! 1 - refine
integer(kind=4) :: coord(ndims) ! coordinate of the lower
! corner in the effective
! resolution
logical :: leaf ! leaf flag
real(kind=8) :: xmin, xmax ! bounds for the x direction
@ -317,6 +321,10 @@ module blocks
pmeta%refine = 0
pmeta%leaf = .false.
! initialize the coordinate
!
pmeta%coord(:) = 0
! initialize bounds of the block
!
pmeta%xmin = 0.0
@ -740,6 +748,35 @@ module blocks
!
!===============================================================================
!
! metablock_set_coord: subroutine sets the coordinates of the meta block
!
!===============================================================================
!
subroutine metablock_set_coord(pmeta, px, py, pz)
implicit none
! input/output arguments
!
type(block_meta), pointer, intent(inout) :: pmeta
integer(kind=4) , intent(in) :: px, py, pz
!
!-------------------------------------------------------------------------------
!
! set the coordintaes
!
pmeta%coord(1) = px
pmeta%coord(2) = py
#if NDIMS == 3
pmeta%coord(3) = pz
#endif /* NDIMS == 3 */
!-------------------------------------------------------------------------------
!
end subroutine metablock_set_coord
!
!===============================================================================
!
! metablock_setbounds: subroutine sets the bounds of data block
!
!===============================================================================