From b2dbb01cd85705428eac1aed4a3bcd25688214ec Mon Sep 17 00:00:00 2001 From: Grzegorz Kowal Date: Thu, 16 Jan 2014 17:58:28 -0200 Subject: [PATCH] BLOCKS: Rename datablock_set_dims() to set_block_dimensions(). Signed-off-by: Grzegorz Kowal --- src/blocks.F90 | 78 +++++++++++++++++++++++++++++++------------------- src/mesh.F90 | 4 +-- 2 files changed, 50 insertions(+), 32 deletions(-) diff --git a/src/blocks.F90 b/src/blocks.F90 index e2680f7..0016756 100644 --- a/src/blocks.F90 +++ b/src/blocks.F90 @@ -264,6 +264,7 @@ module blocks ! declare public subroutines ! public :: initialize_blocks, finalize_blocks + public :: set_block_dimensions public :: append_metablock, remove_metablock public :: append_datablock, remove_datablock public :: allocate_metablock, deallocate_metablock @@ -274,7 +275,6 @@ module blocks public :: metablock_set_id, metablock_set_cpu, metablock_set_refine & , metablock_set_config, metablock_set_level, metablock_set_position & , metablock_set_coord, metablock_set_bounds, metablock_set_leaf - public :: datablock_set_dims #ifdef DEBUG public :: check_metablock #endif /* DEBUG */ @@ -443,6 +443,53 @@ module blocks ! !=============================================================================== ! +! subroutine SET_BLOCK_DIMENSIONS: +! ------------------------------- +! +! Subroutine sets the number of variables, fluxes and block dimensions +! (without ghost cells) for arrays allocated in data blocks. +! +! Arguments: +! +! nv - the number of variables stored in %u and %q; +! nf - the number of fluxes stored in %f; +! ni - the block dimension along X; +! nj - the block dimension along Y; +! nk - the block dimension along Z; +! +!=============================================================================== +! + subroutine set_block_dimensions(nv, nf, ni, nj, nk) + +! local variables are not implicit by default +! + implicit none + +! subroutine arguments +! + integer(kind=4), intent(in) :: nv, nf, ni, nj, nk +! +!------------------------------------------------------------------------------- +! +! set the number of variables and fluxes +! + nvars = nv + nflux = nf + +! set the block dimensions +! + nx = ni + ny = nj +#if NDIMS == 3 + nz = nk +#endif /* NDIMS == 3 */ + +!------------------------------------------------------------------------------- +! + end subroutine set_block_dimensions +! +!=============================================================================== +! ! subroutine APPEND_METABLOCK: ! --------------------------- ! @@ -2599,35 +2646,6 @@ module blocks ! end subroutine metablock_set_bounds ! -!=============================================================================== -! -! datablock_set_dims: subroutine sets the number of variables and dimensions -! for arrays allocated in data blocks -! -!=============================================================================== -! - subroutine datablock_set_dims(nv, nf, ni, nj, nk) - - implicit none - -! input arguments -! - integer(kind=4), intent(in) :: nv, nf, ni, nj, nk -! -!------------------------------------------------------------------------------- -! - nvars = nv - nflux = nf - nx = ni - ny = nj -#if NDIMS == 3 - nz = nk -#endif /* NDIMS == 3 */ - -!------------------------------------------------------------------------------- -! - end subroutine datablock_set_dims -! #ifdef DEBUG !!============================================================================== !! diff --git a/src/mesh.F90 b/src/mesh.F90 index 8f3e484..20e521d 100644 --- a/src/mesh.F90 +++ b/src/mesh.F90 @@ -86,7 +86,7 @@ module mesh ! import external procedures and variables ! - use blocks , only : datablock_set_dims + use blocks , only : set_block_dimensions use coordinates , only : xmin, xmax, ymin, ymax, zmin, zmax use coordinates , only : toplev, im, jm, km use equations , only : nv @@ -131,7 +131,7 @@ module mesh ! set data block dimensions ! - call datablock_set_dims(nv, nv, im, jm, km) + call set_block_dimensions(nv, nv, im, jm, km) ! only master prepares the mesh statistics file !