20 integer,
intent(in) :: i^
d
24 jg^
d=tree%node%ig^
d+i^
d;
32 if (
poleb(1,2).and.jg2==0)
then
33 jg2=1; jg3=1+modulo(jg3+ng3(1)/2-1,ng3(1))
35 if (
poleb(2,2).and.jg2==ng2(1)+1)
then
36 jg2=ng2(1); jg3=1+modulo(jg3+ng3(1)/2-1,ng3(1))
39 if (poleb(1,1).and.jg1==0)
then
41 {
if (^d==phi_) jg^d=1+modulo(jg^d+ng^d(1)/2-1,ng^d(1))\}
45 if (jg^d>=1.and.jg^d<=ng^d(1)|.and.)
then
46 tree_neighbor%node => tree_root(jg^d)%node
48 nullify(tree_neighbor%node)
59 integer,
intent(in) :: i^
d
60 integer,
intent(out) :: my_neighbor_type
61 logical,
dimension(ndim),
intent(out) :: pole
63 integer :: level, ig^
d, ic^
d, n_ic^
d, inp^
d
69 if (
associated(my_neighbor%node))
then
72 {
if ((
poleb(2,^
d).and.ig^
d==
ng^
d(1).and.i^
d==1) .or. &
73 (
poleb(1,^
d).and.ig^
d==1.and.i^
d==-1)) pole(^
d)=.true.\}
75 if (my_neighbor%node%leaf)
then
88 {
if ((
poleb(2,^
d).and.ig^
d==
ng^
d(level).and.i^
d==1) .or. &
89 (
poleb(1,^
d).and.ig^
d==1.and.i^
d==-1)) pole(^
d)=.true.\}
93 ic^
d=1+modulo(ig^
d-1,2);
94 inp^
d=int((ic^
d+i^
d+1)/2)-1;
95 my_neighbor%node => tree%node%parent%node
97 my_neighbor%node => my_neighbor%node%neighbor(ic^
d,^
d)%node
98 if (.not.
associated(my_neighbor%node))
then
103 if (my_neighbor%node%leaf)
then
106 {
if (i^d==0 .or. pole(^d))
then
111 my_neighbor%node => my_neighbor%node%child(n_ic^d)%node
112 if (
associated(my_neighbor%node))
then
113 if (my_neighbor%node%leaf)
then
133 logical,
dimension(ndim) :: pole
134 integer :: my_neighbor_type, i^
d, iside
138 i^dd=
kr(^dd,^
d)*(2*iside-3);
139 call find_neighbor(my_neighbor,my_neighbor_type,tree,i^dd,pole)
140 select case (my_neighbor_type)
141 case (neighbor_sibling, neighbor_fine)
142 tree%node%neighbor(iside,^
d)%node => my_neighbor%node
143 if (
associated(my_neighbor%node))
then
145 my_neighbor%node%neighbor(iside,^
d)%node => tree%node
147 my_neighbor%node%neighbor(3-iside,^
d)%node => tree%node
151 nullify(tree%node%neighbor(iside,^
d)%node)
subroutine, public find_root_neighbor(tree_neighbor, tree, iD)
find neighors of level-one root blocks
subroutine, public asign_tree_neighbor(tree)
asign tree node neighor
subroutine, public find_neighbor(my_neighbor, my_neighbor_type, tree, iD, pole)
find neighors of all blocks
Module with basic grid data structures.
Module with geometry-related routines (e.g., divergence, curl)
integer, parameter spherical
This module contains definitions of global parameters and variables and some generic functions/subrou...
integer, dimension(3, 3) kr
Kronecker delta tensor.
integer, dimension(:), allocatable ng
number of grid blocks in domain per dimension, in array over levels
integer, dimension(:), allocatable, parameter d
logical, dimension(ndim) periodb
True for dimensions with periodic boundaries.
logical, dimension(2, ndim) poleb
Indicates whether there is a pole at a boundary.