BLOCKS, IO, MESH: Rename nchild to nchildren.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
parent
35f3490eb8
commit
7a4e402c8a
@ -36,10 +36,10 @@ module blocks
|
|||||||
|
|
||||||
! module parameters
|
! module parameters
|
||||||
!
|
!
|
||||||
integer(kind=4), parameter :: ndims = NDIMS
|
integer(kind=4), parameter :: ndims = NDIMS
|
||||||
integer(kind=4), parameter :: nsides = 2
|
integer(kind=4), parameter :: nsides = 2
|
||||||
integer(kind=4), parameter :: nfaces = 2**(ndims - 1)
|
integer(kind=4), parameter :: nfaces = 2**(ndims - 1)
|
||||||
integer(kind=4), parameter :: nchild = 2**ndims
|
integer(kind=4), parameter :: nchildren = 2**ndims
|
||||||
|
|
||||||
!! BLOCK STRUCTURE POINTERS (they have to be defined before block structures)
|
!! BLOCK STRUCTURE POINTERS (they have to be defined before block structures)
|
||||||
!!
|
!!
|
||||||
@ -72,7 +72,7 @@ module blocks
|
|||||||
|
|
||||||
! pointers to child meta blocks
|
! pointers to child meta blocks
|
||||||
!
|
!
|
||||||
type(pointer_meta) :: child(nchild)
|
type(pointer_meta) :: child(nchildren)
|
||||||
|
|
||||||
! pointers to neighbor meta blocks
|
! pointers to neighbor meta blocks
|
||||||
!
|
!
|
||||||
@ -221,7 +221,7 @@ module blocks
|
|||||||
public :: pointer_meta, pointer_info
|
public :: pointer_meta, pointer_info
|
||||||
public :: block_meta, block_data, block_info
|
public :: block_meta, block_data, block_info
|
||||||
public :: list_meta, list_data
|
public :: list_meta, list_data
|
||||||
public :: nchild, ndims, nsides, nfaces
|
public :: nchildren, ndims, nsides, nfaces
|
||||||
public :: initialize_blocks, finalize_blocks
|
public :: initialize_blocks, finalize_blocks
|
||||||
public :: set_last_id, get_last_id, get_mblocks, get_dblocks, get_nleafs
|
public :: set_last_id, get_last_id, get_mblocks, get_dblocks, get_nleafs
|
||||||
public :: link_blocks, unlink_blocks
|
public :: link_blocks, unlink_blocks
|
||||||
@ -372,7 +372,7 @@ module blocks
|
|||||||
nullify(pmeta%next)
|
nullify(pmeta%next)
|
||||||
nullify(pmeta%parent)
|
nullify(pmeta%parent)
|
||||||
nullify(pmeta%data)
|
nullify(pmeta%data)
|
||||||
do i = 1, nchild
|
do i = 1, nchildren
|
||||||
nullify(pmeta%child(i)%ptr)
|
nullify(pmeta%child(i)%ptr)
|
||||||
end do
|
end do
|
||||||
do k = 1, nfaces
|
do k = 1, nfaces
|
||||||
@ -464,7 +464,7 @@ module blocks
|
|||||||
|
|
||||||
! nullify children
|
! nullify children
|
||||||
!
|
!
|
||||||
do i = 1, nchild
|
do i = 1, nchildren
|
||||||
nullify(pmeta%child(i)%ptr)
|
nullify(pmeta%child(i)%ptr)
|
||||||
end do
|
end do
|
||||||
|
|
||||||
@ -1383,7 +1383,7 @@ module blocks
|
|||||||
|
|
||||||
! local arrays
|
! local arrays
|
||||||
!
|
!
|
||||||
integer, dimension(nchild) :: config, order
|
integer, dimension(nchildren) :: config, order
|
||||||
integer, dimension(ndims,nsides,nfaces) :: set
|
integer, dimension(ndims,nsides,nfaces) :: set
|
||||||
|
|
||||||
! local variables
|
! local variables
|
||||||
@ -1407,7 +1407,7 @@ module blocks
|
|||||||
|
|
||||||
! iterate over all child blocks
|
! iterate over all child blocks
|
||||||
!
|
!
|
||||||
do p = 1, nchild
|
do p = 1, nchildren
|
||||||
|
|
||||||
! create child meta and data blocks
|
! create child meta and data blocks
|
||||||
!
|
!
|
||||||
@ -1722,13 +1722,13 @@ module blocks
|
|||||||
|
|
||||||
! set blocks configurations
|
! set blocks configurations
|
||||||
!
|
!
|
||||||
do p = 1, nchild
|
do p = 1, nchildren
|
||||||
pblock%child(order(p))%ptr%config = config(p)
|
pblock%child(order(p))%ptr%config = config(p)
|
||||||
end do
|
end do
|
||||||
|
|
||||||
! connect blocks in chain
|
! connect blocks in chain
|
||||||
!
|
!
|
||||||
do p = 2, nchild
|
do p = 2, nchildren
|
||||||
pblock%child(order(p ))%ptr%prev => pblock%child(order(p-1))%ptr
|
pblock%child(order(p ))%ptr%prev => pblock%child(order(p-1))%ptr
|
||||||
pblock%child(order(p-1))%ptr%next => pblock%child(order(p ))%ptr
|
pblock%child(order(p-1))%ptr%next => pblock%child(order(p ))%ptr
|
||||||
end do
|
end do
|
||||||
@ -1736,8 +1736,8 @@ module blocks
|
|||||||
! insert this chain after the parent block
|
! insert this chain after the parent block
|
||||||
!
|
!
|
||||||
pneigh => pblock%next
|
pneigh => pblock%next
|
||||||
pfirst => pblock%child(order( 1))%ptr
|
pfirst => pblock%child(order( 1))%ptr
|
||||||
plast => pblock%child(order(nchild))%ptr
|
plast => pblock%child(order(nchildren))%ptr
|
||||||
if (associated(pneigh)) then
|
if (associated(pneigh)) then
|
||||||
pneigh%prev => plast
|
pneigh%prev => plast
|
||||||
plast%next => pneigh
|
plast%next => pneigh
|
||||||
@ -1760,7 +1760,7 @@ module blocks
|
|||||||
|
|
||||||
! iterate over all children and allocate data blocks
|
! iterate over all children and allocate data blocks
|
||||||
!
|
!
|
||||||
do p = 1, nchild
|
do p = 1, nchildren
|
||||||
|
|
||||||
! assign a pointer to the current child
|
! assign a pointer to the current child
|
||||||
!
|
!
|
||||||
@ -1807,7 +1807,7 @@ module blocks
|
|||||||
|
|
||||||
! iterate over all children and allocate data blocks
|
! iterate over all children and allocate data blocks
|
||||||
!
|
!
|
||||||
do p = 1, nchild
|
do p = 1, nchildren
|
||||||
|
|
||||||
! assign a pointer to the current child
|
! assign a pointer to the current child
|
||||||
!
|
!
|
||||||
@ -1825,7 +1825,7 @@ module blocks
|
|||||||
|
|
||||||
! connect blocks in chain
|
! connect blocks in chain
|
||||||
!
|
!
|
||||||
do p = 2, nchild
|
do p = 2, nchildren
|
||||||
pblock%child(order(p ))%ptr%data%prev => &
|
pblock%child(order(p ))%ptr%data%prev => &
|
||||||
pblock%child(order(p-1))%ptr%data
|
pblock%child(order(p-1))%ptr%data
|
||||||
pblock%child(order(p-1))%ptr%data%next => &
|
pblock%child(order(p-1))%ptr%data%next => &
|
||||||
@ -1836,8 +1836,8 @@ module blocks
|
|||||||
!
|
!
|
||||||
pdata => pblock%data%next
|
pdata => pblock%data%next
|
||||||
|
|
||||||
pfirst => pblock%child(order( 1))%ptr
|
pfirst => pblock%child(order( 1))%ptr
|
||||||
plast => pblock%child(order(nchild))%ptr
|
plast => pblock%child(order(nchildren))%ptr
|
||||||
|
|
||||||
if (associated(pdata)) then
|
if (associated(pdata)) then
|
||||||
pdata%prev => plast%data
|
pdata%prev => plast%data
|
||||||
@ -1945,7 +1945,7 @@ module blocks
|
|||||||
|
|
||||||
! deallocate child blocks
|
! deallocate child blocks
|
||||||
!
|
!
|
||||||
do p = 1, nchild
|
do p = 1, nchildren
|
||||||
call metablock_unset_leaf(pblock%child(p)%ptr)
|
call metablock_unset_leaf(pblock%child(p)%ptr)
|
||||||
call deallocate_metablock(pblock%child(p)%ptr)
|
call deallocate_metablock(pblock%child(p)%ptr)
|
||||||
end do
|
end do
|
||||||
@ -2044,7 +2044,7 @@ module blocks
|
|||||||
|
|
||||||
! check children IDs
|
! check children IDs
|
||||||
!
|
!
|
||||||
do p = 1, nchild
|
do p = 1, nchildren
|
||||||
ptemp => pblock%child(p)%ptr
|
ptemp => pblock%child(p)%ptr
|
||||||
if (associated(ptemp)) then
|
if (associated(ptemp)) then
|
||||||
if (ptemp%id .le. 0 .or. ptemp%id .gt. last_id) then
|
if (ptemp%id .le. 0 .or. ptemp%id .gt. last_id) then
|
||||||
|
12
src/io.F90
12
src/io.F90
@ -2021,7 +2021,7 @@ module io
|
|||||||
! references to other modules
|
! references to other modules
|
||||||
!
|
!
|
||||||
use blocks , only : block_meta, list_meta
|
use blocks , only : block_meta, list_meta
|
||||||
use blocks , only : get_last_id, get_mblocks, nchild, nsides, nfaces
|
use blocks , only : get_last_id, get_mblocks, nchildren, nsides, nfaces
|
||||||
use error , only : print_error
|
use error , only : print_error
|
||||||
use hdf5 , only : hid_t, hsize_t
|
use hdf5 , only : hid_t, hsize_t
|
||||||
use hdf5 , only : h5gcreate_f, h5gclose_f
|
use hdf5 , only : h5gcreate_f, h5gclose_f
|
||||||
@ -2071,7 +2071,7 @@ module io
|
|||||||
am(1) = get_mblocks()
|
am(1) = get_mblocks()
|
||||||
cm(1) = get_last_id()
|
cm(1) = get_last_id()
|
||||||
dm(1) = get_mblocks()
|
dm(1) = get_mblocks()
|
||||||
dm(2) = nchild
|
dm(2) = nchildren
|
||||||
pm(1) = get_mblocks()
|
pm(1) = get_mblocks()
|
||||||
pm(2) = NDIMS
|
pm(2) = NDIMS
|
||||||
qm(1) = get_mblocks()
|
qm(1) = get_mblocks()
|
||||||
@ -2142,7 +2142,7 @@ module io
|
|||||||
zmn(l) = pmeta%zmin
|
zmn(l) = pmeta%zmin
|
||||||
zmx(l) = pmeta%zmax
|
zmx(l) = pmeta%zmax
|
||||||
|
|
||||||
do p = 1, nchild
|
do p = 1, nchildren
|
||||||
if (associated(pmeta%child(p)%ptr)) chl(l,p) = pmeta%child(p)%ptr%id
|
if (associated(pmeta%child(p)%ptr)) chl(l,p) = pmeta%child(p)%ptr%id
|
||||||
end do
|
end do
|
||||||
|
|
||||||
@ -2247,7 +2247,7 @@ module io
|
|||||||
! references to other modules
|
! references to other modules
|
||||||
!
|
!
|
||||||
use blocks , only : block_meta, list_meta
|
use blocks , only : block_meta, list_meta
|
||||||
use blocks , only : nchild, nsides, nfaces
|
use blocks , only : nchildren, nsides, nfaces
|
||||||
use blocks , only : get_mblocks
|
use blocks , only : get_mblocks
|
||||||
use blocks , only : metablock_set_id, metablock_set_cpu &
|
use blocks , only : metablock_set_id, metablock_set_cpu &
|
||||||
, metablock_set_refine, metablock_set_config &
|
, metablock_set_refine, metablock_set_config &
|
||||||
@ -2307,7 +2307,7 @@ module io
|
|||||||
!
|
!
|
||||||
am(1) = get_mblocks()
|
am(1) = get_mblocks()
|
||||||
dm(1) = get_mblocks()
|
dm(1) = get_mblocks()
|
||||||
dm(2) = nchild
|
dm(2) = nchildren
|
||||||
pm(1) = get_mblocks()
|
pm(1) = get_mblocks()
|
||||||
pm(2) = NDIMS
|
pm(2) = NDIMS
|
||||||
qm(1) = get_mblocks()
|
qm(1) = get_mblocks()
|
||||||
@ -2405,7 +2405,7 @@ module io
|
|||||||
|
|
||||||
if (par(l) .gt. 0) pmeta%parent => block_array(par(l))%ptr
|
if (par(l) .gt. 0) pmeta%parent => block_array(par(l))%ptr
|
||||||
|
|
||||||
do p = 1, nchild
|
do p = 1, nchildren
|
||||||
if (chl(l,p) .gt. 0) then
|
if (chl(l,p) .gt. 0) then
|
||||||
pmeta%child(p)%ptr => block_array(chl(l,p))%ptr
|
pmeta%child(p)%ptr => block_array(chl(l,p))%ptr
|
||||||
end if
|
end if
|
||||||
|
26
src/mesh.F90
26
src/mesh.F90
@ -445,7 +445,7 @@ module mesh
|
|||||||
! import external procedures and variables
|
! import external procedures and variables
|
||||||
!
|
!
|
||||||
use blocks , only : block_meta, block_data, list_meta, list_data
|
use blocks , only : block_meta, block_data, list_meta, list_data
|
||||||
use blocks , only : ndims, nchild, nsides, nfaces
|
use blocks , only : ndims, nchildren, nsides, nfaces
|
||||||
use blocks , only : allocate_datablock, deallocate_datablock
|
use blocks , only : allocate_datablock, deallocate_datablock
|
||||||
use blocks , only : append_datablock, remove_datablock
|
use blocks , only : append_datablock, remove_datablock
|
||||||
use blocks , only : link_blocks, unlink_blocks, refine_block
|
use blocks , only : link_blocks, unlink_blocks, refine_block
|
||||||
@ -771,7 +771,7 @@ module mesh
|
|||||||
! import external procedures and variables
|
! import external procedures and variables
|
||||||
!
|
!
|
||||||
use blocks , only : block_meta, block_data, list_meta, list_data
|
use blocks , only : block_meta, block_data, list_meta, list_data
|
||||||
use blocks , only : nchild, ndims, nsides, nfaces
|
use blocks , only : nchildren, ndims, nsides, nfaces
|
||||||
use blocks , only : get_nleafs
|
use blocks , only : get_nleafs
|
||||||
use blocks , only : refine_block, derefine_block
|
use blocks , only : refine_block, derefine_block
|
||||||
use blocks , only : append_datablock, remove_datablock, link_blocks
|
use blocks , only : append_datablock, remove_datablock, link_blocks
|
||||||
@ -1091,7 +1091,7 @@ module mesh
|
|||||||
|
|
||||||
! iterate over all children
|
! iterate over all children
|
||||||
!
|
!
|
||||||
do p = 1, nchild
|
do p = 1, nchildren
|
||||||
|
|
||||||
! assign a pointer to the current child
|
! assign a pointer to the current child
|
||||||
!
|
!
|
||||||
@ -1113,7 +1113,7 @@ module mesh
|
|||||||
|
|
||||||
! iterate over all children
|
! iterate over all children
|
||||||
!
|
!
|
||||||
do p = 1, nchild
|
do p = 1, nchildren
|
||||||
|
|
||||||
! assign a pointer to the current child
|
! assign a pointer to the current child
|
||||||
!
|
!
|
||||||
@ -1170,7 +1170,7 @@ module mesh
|
|||||||
! find the case when child blocks are spread across at least 2 processors
|
! find the case when child blocks are spread across at least 2 processors
|
||||||
!
|
!
|
||||||
flag = .false.
|
flag = .false.
|
||||||
do p = 1, nchild
|
do p = 1, nchildren
|
||||||
flag = flag .or. (pmeta%child(p)%ptr%cpu /= pmeta%cpu)
|
flag = flag .or. (pmeta%child(p)%ptr%cpu /= pmeta%cpu)
|
||||||
end do
|
end do
|
||||||
|
|
||||||
@ -1178,7 +1178,7 @@ module mesh
|
|||||||
|
|
||||||
! iterate over all children
|
! iterate over all children
|
||||||
!
|
!
|
||||||
do p = 1, nchild
|
do p = 1, nchildren
|
||||||
|
|
||||||
! generate the tag for communication
|
! generate the tag for communication
|
||||||
!
|
!
|
||||||
@ -1233,7 +1233,7 @@ module mesh
|
|||||||
|
|
||||||
end if ! if child is are on different processes
|
end if ! if child is are on different processes
|
||||||
|
|
||||||
end do ! nchilds
|
end do ! nchildren
|
||||||
|
|
||||||
end if ! children spread over different processes
|
end if ! children spread over different processes
|
||||||
|
|
||||||
@ -1545,7 +1545,7 @@ module mesh
|
|||||||
|
|
||||||
! import external procedures and variables
|
! import external procedures and variables
|
||||||
!
|
!
|
||||||
use blocks , only : block_meta, block_data, nchild
|
use blocks , only : block_meta, block_data, nchildren
|
||||||
use coordinates , only : ng, nh, in, jn, kn, im, jm, km
|
use coordinates , only : ng, nh, in, jn, kn, im, jm, km
|
||||||
use coordinates , only : ib, ie, jb, je, kb, ke
|
use coordinates , only : ib, ie, jb, je, kb, ke
|
||||||
use equations , only : nv
|
use equations , only : nv
|
||||||
@ -1671,7 +1671,7 @@ module mesh
|
|||||||
|
|
||||||
! iterate over all children
|
! iterate over all children
|
||||||
!
|
!
|
||||||
do p = 1, nchild
|
do p = 1, nchildren
|
||||||
|
|
||||||
! assign pointer to the current child
|
! assign pointer to the current child
|
||||||
!
|
!
|
||||||
@ -1708,7 +1708,7 @@ module mesh
|
|||||||
pchild%data%u(1:nv,1:im,1:jm,1:km) = u(1:nv,il:iu,jl:ju,kl:ku)
|
pchild%data%u(1:nv,1:im,1:jm,1:km) = u(1:nv,il:iu,jl:ju,kl:ku)
|
||||||
#endif /* NDIMS == 3 */
|
#endif /* NDIMS == 3 */
|
||||||
|
|
||||||
end do ! nchild
|
end do ! nchildren
|
||||||
|
|
||||||
! deallocate local arrays
|
! deallocate local arrays
|
||||||
!
|
!
|
||||||
@ -1745,7 +1745,7 @@ module mesh
|
|||||||
! import external procedures and variables
|
! import external procedures and variables
|
||||||
!
|
!
|
||||||
use blocks , only : ndims
|
use blocks , only : ndims
|
||||||
use blocks , only : block_meta, block_data, nchild
|
use blocks , only : block_meta, block_data, nchildren
|
||||||
use coordinates , only : ng, nh, in, jn, kn, im, jm, km
|
use coordinates , only : ng, nh, in, jn, kn, im, jm, km
|
||||||
use coordinates , only : ih, jh, kh, ib, jb, kb, ie, je, ke
|
use coordinates , only : ih, jh, kh, ib, jb, kb, ie, je, ke
|
||||||
use equations , only : nv
|
use equations , only : nv
|
||||||
@ -1786,7 +1786,7 @@ module mesh
|
|||||||
|
|
||||||
! iterate over all children
|
! iterate over all children
|
||||||
!
|
!
|
||||||
do p = 1, nchild
|
do p = 1, nchildren
|
||||||
|
|
||||||
! assign a pointer to the current child
|
! assign a pointer to the current child
|
||||||
!
|
!
|
||||||
@ -1859,7 +1859,7 @@ module mesh
|
|||||||
+ pchild%u(1:nv,ip:iu:2,jl:ju:2,kp:ku:2))))
|
+ pchild%u(1:nv,ip:iu:2,jl:ju:2,kp:ku:2))))
|
||||||
#endif /* NDIMS == 3 */
|
#endif /* NDIMS == 3 */
|
||||||
|
|
||||||
end do ! p = 1, nchild
|
end do ! p = 1, nchildren
|
||||||
|
|
||||||
#ifdef PROFILE
|
#ifdef PROFILE
|
||||||
! stop accounting time for the block restriction
|
! stop accounting time for the block restriction
|
||||||
|
Loading…
x
Reference in New Issue
Block a user