7 double precision,
dimension(:^D&,:),
allocatable :: w
113 integer :: nghostcellsCo, interpolation_order
114 integer :: nx^D, nxCo^D, ixG^L, i^D, ic^D, inc^D, idir
117 ixm^l=ixg^l^lsubnghostcells;
124 nx^d=ixmmax^d-ixmmin^d+1;
129 interpolation_order=1
131 interpolation_order=2
134 call mpistop(
"Undefined typeghostfill")
138 if (nghostcellsco+interpolation_order-1>
nghostcells)
then 139 call mpistop(
"interpolation order for prolongation in getbc too high")
148 ixs_srl_min^d(:,-1)=ixmmin^d
149 ixs_srl_min^d(:, 0)=ixmmin^d
152 ixs_srl_max^d(:, 0)=ixmmax^d
153 ixs_srl_max^d(:, 1)=ixmmax^d
155 ixr_srl_min^d(:,-1)=1
156 ixr_srl_min^d(:, 0)=ixmmin^d
157 ixr_srl_min^d(:, 1)=ixmmax^d+1
159 ixr_srl_max^d(:, 0)=ixmmax^d
160 ixr_srl_max^d(:, 1)=ixgmax^d
162 ixs_r_min^d(:,-1)=ixcommin^d
163 ixs_r_min^d(:, 0)=ixcommin^d
166 ixs_r_max^d(:, 0)=ixcommax^d
167 ixs_r_max^d(:, 1)=ixcommax^d
170 ixr_r_min^d(:, 1)=ixmmin^d
171 ixr_r_min^d(:, 2)=ixmmin^d+nxco^d
172 ixr_r_min^d(:, 3)=ixmmax^d+1
174 ixr_r_max^d(:, 1)=ixmmin^d-1+nxco^d
175 ixr_r_max^d(:, 2)=ixmmax^d
176 ixr_r_max^d(:, 3)=ixgmax^d
178 ixs_p_min^d(:, 0)=ixmmin^d-(interpolation_order-1)
179 ixs_p_min^d(:, 1)=ixmmin^d-(interpolation_order-1)
180 ixs_p_min^d(:, 2)=ixmmin^d+nxco^d-nghostcellsco-(interpolation_order-1)
181 ixs_p_min^d(:, 3)=ixmmax^d+1-nghostcellsco-(interpolation_order-1)
182 ixs_p_max^d(:, 0)=ixmmin^d-1+nghostcellsco+(interpolation_order-1)
183 ixs_p_max^d(:, 1)=ixmmin^d-1+nxco^d+nghostcellsco+(interpolation_order-1)
184 ixs_p_max^d(:, 2)=ixmmax^d+(interpolation_order-1)
185 ixs_p_max^d(:, 3)=ixmmax^d+(interpolation_order-1)
189 ixs_p_min^d(:, 0)=ixmmin^d
190 ixs_p_max^d(:, 3)=ixmmax^d
191 ixs_p_max^d(:, 1)=ixmmin^d-1+nxco^d+(interpolation_order-1)
192 ixs_p_min^d(:, 2)=ixmmin^d+nxco^d-(interpolation_order-1)
195 ixr_p_min^d(:, 0)=ixcommin^d-nghostcellsco-(interpolation_order-1)
196 ixr_p_min^d(:, 1)=ixcommin^d-(interpolation_order-1)
197 ixr_p_min^d(:, 2)=ixcommin^d-nghostcellsco-(interpolation_order-1)
198 ixr_p_min^d(:, 3)=ixcommax^d+1-(interpolation_order-1)
199 ixr_p_max^d(:, 0)=
nghostcells+(interpolation_order-1)
200 ixr_p_max^d(:, 1)=ixcommax^d+nghostcellsco+(interpolation_order-1)
201 ixr_p_max^d(:, 2)=ixcommax^d+(interpolation_order-1)
202 ixr_p_max^d(:, 3)=ixcommax^d+nghostcellsco+(interpolation_order-1)
206 ixr_p_min^d(:, 3)=ixcommax^d+1
207 ixr_p_max^d(:, 1)=ixcommax^d+(interpolation_order-1)
208 ixr_p_min^d(:, 2)=ixcommin^d-(interpolation_order-1)
214 allocate(pole_buf%ws(ixgs^t,nws))
217 { ixs_srl_stg_min^d(idir,-1)=ixmmin^d-
kr(idir,^d)
219 ixs_srl_stg_min^d(idir,0) =ixmmin^d-
kr(idir,^d)
220 ixs_srl_stg_max^d(idir,0) =ixmmax^d
221 ixs_srl_stg_min^d(idir,1) =ixmmax^d-
nghostcells+1-
kr(idir,^d)
222 ixs_srl_stg_max^d(idir,1) =ixmmax^d
224 ixr_srl_stg_min^d(idir,-1)=1-
kr(idir,^d)
226 ixr_srl_stg_min^d(idir,0) =ixmmin^d-
kr(idir,^d)
227 ixr_srl_stg_max^d(idir,0) =ixmmax^d
228 ixr_srl_stg_min^d(idir,1) =ixmmax^d+1-
kr(idir,^d)
229 ixr_srl_stg_max^d(idir,1) =ixgmax^d
231 ixs_r_stg_min^d(idir,-1)=ixcommin^d-
kr(idir,^d)
233 ixs_r_stg_min^d(idir,0) =ixcommin^d-
kr(idir,^d)
234 ixs_r_stg_max^d(idir,0) =ixcommax^d
235 ixs_r_stg_min^d(idir,1) =ixcommax^d+1-
nghostcells-
kr(idir,^d)
236 ixs_r_stg_max^d(idir,1) =ixcommax^d
238 ixr_r_stg_min^d(idir,0)=1-
kr(idir,^d)
240 ixr_r_stg_min^d(idir,1)=ixmmin^d-
kr(idir,^d)
241 ixr_r_stg_max^d(idir,1)=ixmmin^d-1+nxco^d
242 ixr_r_stg_min^d(idir,2)=ixmmin^d+nxco^d-
kr(idir,^d)
243 ixr_r_stg_max^d(idir,2)=ixmmax^d
244 ixr_r_stg_min^d(idir,3)=ixmmax^d+1-
kr(idir,^d)
245 ixr_r_stg_max^d(idir,3)=ixgmax^d
250 ixs_p_stg_min^d(idir,0)=ixmmin^d-1
251 ixs_p_stg_max^d(idir,0)=ixmmin^d-1+nghostcellsco
252 ixs_p_stg_min^d(idir,1)=ixmmin^d-1
253 ixs_p_stg_max^d(idir,1)=ixmmin^d-1+nxco^d+nghostcellsco
254 ixs_p_stg_min^d(idir,2)=ixmmax^d-nxco^d-nghostcellsco
255 ixs_p_stg_max^d(idir,2)=ixmmax^d
256 ixs_p_stg_min^d(idir,3)=ixmmax^d-nghostcellsco
257 ixs_p_stg_max^d(idir,3)=ixmmax^d
259 ixr_p_stg_min^d(idir,0)=ixcommin^d-1-nghostcellsco
260 ixr_p_stg_max^d(idir,0)=ixcommin^d-1
261 ixr_p_stg_min^d(idir,1)=ixcommin^d-1
262 ixr_p_stg_max^d(idir,1)=ixcommax^d+nghostcellsco
263 ixr_p_stg_min^d(idir,2)=ixcommin^d-1-nghostcellsco
264 ixr_p_stg_max^d(idir,2)=ixcommax^d
265 ixr_p_stg_min^d(idir,3)=ixcommax^d+1-1
266 ixr_p_stg_max^d(idir,3)=ixcommax^d+nghostcellsco
271 ixs_p_stg_min^d(idir,0)=ixmmin^d
272 ixs_p_stg_max^d(idir,0)=ixmmin^d-1+nghostcellsco+(interpolation_order-1)
273 ixs_p_stg_min^d(idir,1)=ixmmin^d
274 ixs_p_stg_max^d(idir,1)=ixmmin^d-1+nxco^d+nghostcellsco+(interpolation_order-1)
275 ixs_p_stg_min^d(idir,2)=ixmmax^d+1-nxco^d-nghostcellsco-(interpolation_order-1)
276 ixs_p_stg_max^d(idir,2)=ixmmax^d
277 ixs_p_stg_min^d(idir,3)=ixmmax^d+1-nghostcellsco-(interpolation_order-1)
278 ixs_p_stg_max^d(idir,3)=ixmmax^d
280 ixr_p_stg_min^d(idir,0)=ixcommin^d-nghostcellsco-(interpolation_order-1)
281 ixr_p_stg_max^d(idir,0)=ixcommin^d-1
282 ixr_p_stg_min^d(idir,1)=ixcommin^d
283 ixr_p_stg_max^d(idir,1)=ixcommax^d+nghostcellsco+(interpolation_order-1)
284 ixr_p_stg_min^d(idir,2)=ixcommin^d-nghostcellsco-(interpolation_order-1)
285 ixr_p_stg_max^d(idir,2)=ixcommax^d
286 ixr_p_stg_min^d(idir,3)=ixcommax^d+1
287 ixr_p_stg_max^d(idir,3)=ixcommax^d+nghostcellsco+(interpolation_order-1)
296 sizes_srl_send_stg(idir,i^d)={(ixs_srl_stg_max^d(idir,i^d)-ixs_srl_stg_min^d(idir,i^d)+1)|*}
297 sizes_srl_recv_stg(idir,i^d)={(ixr_srl_stg_max^d(idir,i^d)-ixr_srl_stg_min^d(idir,i^d)+1)|*}
298 sizes_r_send_stg(idir,i^d)={(ixs_r_stg_max^d(idir,i^d)-ixs_r_stg_min^d(idir,i^d)+1)|*}
308 sizes_r_recv_stg(idir,i^d)={(ixr_r_stg_max^d(idir,i^d)-ixr_r_stg_min^d(idir,i^d)+1)|*}
309 sizes_p_send_stg(idir,i^d)={(ixs_p_stg_max^d(idir,i^d)-ixs_p_stg_min^d(idir,i^d)+1)|*}
310 sizes_p_recv_stg(idir,i^d)={(ixr_p_stg_max^d(idir,i^d)-ixr_p_stg_min^d(idir,i^d)+1)|*}
319 ixs_srl_min^d(-1,0)=1
320 ixs_srl_min^d( 1,0)=ixmmin^d
321 ixs_srl_min^d( 2,0)=1
322 ixs_srl_max^d(-1,0)=ixmmax^d
323 ixs_srl_max^d( 1,0)=ixgmax^d
324 ixs_srl_max^d( 2,0)=ixgmax^d
326 ixr_srl_min^d(-1,0)=1
327 ixr_srl_min^d( 1,0)=ixmmin^d
328 ixr_srl_min^d( 2,0)=1
329 ixr_srl_max^d(-1,0)=ixmmax^d
330 ixr_srl_max^d( 1,0)=ixgmax^d
331 ixr_srl_max^d( 2,0)=ixgmax^d
334 ixs_r_min^d( 1,0)=ixcommin^d
335 ixs_r_max^d(-1,0)=ixcommax^d
336 ixs_r_max^d( 1,0)=ixcogmax^d
339 ixr_r_max^d(-1,1)=ixmmin^d-1+nxco^d
340 ixr_r_min^d( 1,2)=ixmmin^d+nxco^d
341 ixr_r_max^d( 1,2)=ixgmax^d
344 ixs_p_max^d( 1,2)=ixgmax^d
347 ixr_p_max^d( 1,2)=ixcogmax^d
356 integer,
intent(in) :: nwstart, nwbc
357 integer :: i^D, ic^D, inc^D, iib^D
360 if (i^d==0|.and.) cycle
364 if (iib^d==2|.or.) cycle
366 {
do ic^db=1+int((1-i^db)/2),2-int((1+i^db)/2)
367 inc^db=2*i^db+ic^db\}
380 integer,
intent(inout) :: comm_type
381 integer,
intent(in) :: ix^L, ixG^L, nwstart, nwbc
383 integer,
dimension(ndim+1) :: fullsize, subsize, start
385 ^
d&fullsize(^
d)=ixgmax^
d;
387 ^
d&subsize(^
d)=ixmax^
d-ixmin^
d+1;
389 ^
d&start(^
d)=ixmin^
d-1;
390 start(
ndim+1)=nwstart-1
392 call mpi_type_create_subarray(
ndim+1,fullsize,subsize,start,mpi_order_fortran, &
393 mpi_double_precision,comm_type,
ierrmpi)
394 call mpi_type_commit(comm_type,
ierrmpi)
401 integer :: i^D, ic^D, inc^D, iib^D
404 if (i^d==0|.and.) cycle
409 if (iib^d==2|.or.) cycle
411 {
do ic^db=1+int((1-i^db)/2),2-int((1+i^db)/2)
412 inc^db=2*i^db+ic^db\}
423 subroutine getbc(time,qdt,psb,nwstart,nwbc,req_diag)
427 double precision,
intent(in) :: time, qdt
429 integer,
intent(in) :: nwstart
430 integer,
intent(in) :: nwbc
431 logical,
intent(in),
optional :: req_diag
433 double precision :: time_bcin
434 integer :: my_neighbor_type, ipole, idims, iside, nwhead, nwtail
435 integer :: iigrid, igrid, ineighbor, ipe_neighbor
436 integer :: nrecvs, nsends, isizes
437 integer :: ixG^L, ixR^L, ixS^L, ixB^L, ixI^L, k^L
438 integer :: i^D, n_i^D, ic^D, inc^D, n_inc^D, iib^D, idir
441 integer :: isend_buf(
npwbuf), ipwbuf, nghostcellsco,iB
443 integer :: ibuf_start, ibuf_next
445 integer,
dimension(1) :: shapes
446 logical :: req_diagonal, NeedProlong(-1:1^d&)
452 nwtail=nwstart+nwbc-1
454 req_diagonal = .true.
455 if (
present(req_diag)) req_diagonal = req_diag
457 time_bcin=mpi_wtime()
465 do iigrid=1,igridstail; igrid=igrids(iigrid);
475 kmin^d=merge(0, 1, idims==^d)
476 kmax^d=merge(0, 1, idims==^d)
481 if(idims > 1 .and. neighbor_type(-1,0,igrid)==neighbor_boundary) ixbmin1=ixgmin1
482 if(idims > 1 .and. neighbor_type( 1,0,igrid)==neighbor_boundary) ixbmax1=ixgmax1}
484 if(idims > 1 .and. neighbor_type(-1,0,0,igrid)==neighbor_boundary) ixbmin1=ixgmin1
485 if(idims > 1 .and. neighbor_type( 1,0,0,igrid)==neighbor_boundary) ixbmax1=ixgmax1
486 if(idims > 2 .and. neighbor_type(0,-1,0,igrid)==neighbor_boundary) ixbmin2=ixgmin2
487 if(idims > 2 .and. neighbor_type(0, 1,0,igrid)==neighbor_boundary) ixbmax2=ixgmax2}
489 i^d=
kr(^d,idims)*(2*iside-3);
491 if (neighbor_type(i^d,igrid) /= neighbor_boundary .and. &
492 .not. psb(igrid)%is_physical_boundary(2*idims-2+iside)) cycle
494 if (neighbor_type(i^d,igrid) /= neighbor_boundary) cycle
496 call bc_phys(iside,idims,time,qdt,psb(igrid),ixg^l,ixb^l)
535 do iigrid=1,igridstail; igrid=igrids(iigrid);
538 ^d&idphyb(^d,igrid)=iib^d;
541 my_neighbor_type=neighbor_type(i^d,igrid)
542 select case (my_neighbor_type)
543 case (neighbor_sibling)
553 do iigrid=1,igridstail; igrid=igrids(iigrid);
558 ^d&iib^d=idphyb(^d,igrid);
560 if (any(neighbor_type(:^d&,igrid)==neighbor_coarse))
then 562 {
#IFDEF EVOLVINGBOUNDARY 565 ixcommin^d=ixcogmin^d+nghostcellsco;
566 ixcommax^d=ixcogmax^d-nghostcellsco;
567 ixmmin^d=ixgmin^d+(nghostcellsco-1);
568 ixmmax^d=ixgmax^d-(nghostcellsco-1);
571 ixm^l=ixg^l^lsubnghostcells;
579 if (
phi_ > 0) ipole=neighbor_pole(i^d,igrid)
580 my_neighbor_type=neighbor_type(i^d,igrid)
581 select case (my_neighbor_type)
582 case (neighbor_sibling)
584 case (neighbor_coarse)
608 do iigrid=1,igridstail; igrid=igrids(iigrid);
609 ^d&iib^d=idphyb(^d,igrid);
612 select case (neighbor_type(i^d,igrid))
613 case (neighbor_sibling)
623 if (isend_buf(ipwbuf)/=0)
deallocate(pwbuf(ipwbuf)%w)
643 do iigrid=1,igridstail; igrid=igrids(iigrid);
645 ^d&iib^d=idphyb(^d,igrid);
648 my_neighbor_type=neighbor_type(i^d,igrid)
653 do iigrid=1,igridstail; igrid=igrids(iigrid);
656 ^d&iib^d=idphyb(^d,igrid);
658 if (any(neighbor_type(:^d&,igrid)==neighbor_fine))
then 661 if (
phi_ > 0) ipole=neighbor_pole(i^d,igrid)
662 my_neighbor_type=neighbor_type(i^d,igrid)
686 do iigrid=1,igridstail; igrid=igrids(iigrid);
687 ^d&iib^d=idphyb(^d,igrid);
690 if(neighbor_type(i^d,igrid)==neighbor_coarse)
call bc_fill_p 695 do iigrid=1,igridstail; igrid=igrids(iigrid);
696 ^d&iib^d=idphyb(^d,igrid);
697 if (any(neighbor_type(:^d&,igrid)==neighbor_coarse))
then 701 my_neighbor_type=neighbor_type(i^d,igrid)
702 if (my_neighbor_type==neighbor_coarse)
then 704 needprolong(i^d)=.true.
753 if (isend_buf(ipwbuf)/=0)
deallocate(pwbuf(ipwbuf)%w)
757 do iigrid=1,igridstail; igrid=igrids(iigrid);
768 kmin2=merge(1, 0, idims .lt. 2 .and. neighbor_type(0,-1,igrid)==1)
769 kmax2=merge(1, 0, idims .lt. 2 .and. neighbor_type(0, 1,igrid)==1)}
771 kmin2=merge(1, 0, idims .lt. 2 .and. neighbor_type(0,-1,0,igrid)==1)
772 kmax2=merge(1, 0, idims .lt. 2 .and. neighbor_type(0, 1,0,igrid)==1)
773 kmin3=merge(1, 0, idims .lt. 3 .and. neighbor_type(0,0,-1,igrid)==1)
774 kmax3=merge(1, 0, idims .lt. 3 .and. neighbor_type(0,0, 1,igrid)==1)}
778 i^d=
kr(^d,idims)*(2*iside-3);
780 if (neighbor_type(i^d,igrid) /= neighbor_boundary .and. &
781 .not. psb(igrid)%is_physical_boundary(2*idims-2+iside)) cycle
783 if (neighbor_type(i^d,igrid) /= neighbor_boundary) cycle
785 call bc_phys(iside,idims,time,qdt,psb(igrid),ixg^l,ixb^l)
801 integer,
intent(in) :: dir(^nd)
803 if (all(dir == 0))
then 805 else if (.not. req_diagonal .and. count(dir /= 0) > 1)
then 815 ipe_neighbor=neighbor(2,i^d,igrid)
816 if (ipe_neighbor/=
mype)
then 818 itag=(3**^nd+4**^nd)*(igrid-1)+{(i^d+1)*3**(^d-1)+}
834 {
do ic^db=1+int((1-i^db)/2),2-int((1+i^db)/2)
835 inc^db=2*i^db+ic^db\}
836 ipe_neighbor=neighbor_child(2,inc^d,igrid)
837 if (ipe_neighbor/=
mype)
then 839 itag=(3**^nd+4**^nd)*(igrid-1)+3**^nd+{inc^d*4**(^d-1)+}
840 call mpi_irecv(psb(igrid)%w,1,
type_recv_r(iib^d,inc^d), &
845 mpi_double_precision,ipe_neighbor,
itag, &
857 ineighbor=neighbor(1,i^d,igrid)
858 ipe_neighbor=neighbor(2,i^d,igrid)
862 if (ipe_neighbor==
mype)
then 865 psb(ineighbor)%w(ixr^s,nwhead:nwtail)=&
866 psb(igrid)%w(ixs^s,nwhead:nwtail)
869 itag=(3**^nd+4**^nd)*(ineighbor-1)+{(n_i^d+1)*3**(^d-1)+}
879 reshape(psb(igrid)%ws(ixs^s,idir),shapes)
892 n_i^d=i^d^d%n_i^dd=-i^dd;\}
894 if (ipe_neighbor==
mype)
then 896 call pole_copy(psb(ineighbor)%w,ixg^l,ixr^l,psb(igrid)%w,ixg^l,ixs^l)
898 if (isend_buf(ipwbuf)/=0)
then 901 deallocate(pwbuf(ipwbuf)%w)
903 allocate(pwbuf(ipwbuf)%w(ixs^s,nwhead:nwtail))
904 call pole_buffer(pwbuf(ipwbuf)%w,ixs^l,ixs^l,psb(igrid)%w,ixg^l,ixs^l)
906 isend_buf(ipwbuf)=
isend 907 itag=(3**^nd+4**^nd)*(ineighbor-1)+{(n_i^d+1)*3**(^d-1)+}
908 isizes={(ixsmax^d-ixsmin^d+1)*}*nwbc
909 call mpi_isend(pwbuf(ipwbuf)%w,isizes,mpi_double_precision, &
911 ipwbuf=1+modulo(ipwbuf,
npwbuf)
919 reshape(psb(igrid)%ws(ixs^s,idir),shapes)
937 if ({.not.(i^d==0.or.i^d==2*ic^d-3)|.or.})
return 947 {kmin^d=merge(0, 1, idims==^d)
948 kmax^d=merge(0, 1, idims==^d)
952 if(idims > 1 .and. neighbor_type(-1,0,igrid)==neighbor_boundary) ixbmin1=ixcogmin1
953 if(idims > 1 .and. neighbor_type( 1,0,igrid)==neighbor_boundary) ixbmax1=ixcogmax1}
955 if(idims > 1 .and. neighbor_type(-1,0,0,igrid)==neighbor_boundary) ixbmin1=ixcogmin1
956 if(idims > 1 .and. neighbor_type( 1,0,0,igrid)==neighbor_boundary) ixbmax1=ixcogmax1
957 if(idims > 2 .and. neighbor_type(0,-1,0,igrid)==neighbor_boundary) ixbmin2=ixcogmin2
958 if(idims > 2 .and. neighbor_type(0, 1,0,igrid)==neighbor_boundary) ixbmax2=ixcogmax2}
967 ii^d=
kr(^d,idims)*(2*iside-3);
968 if ({abs(i^d)==1.and.abs(ii^d)==1|.or.}) cycle
969 if (neighbor_type(ii^d,igrid)/=neighbor_boundary) cycle
970 call bc_phys(iside,idims,time,0.d0,psc(igrid),
ixcog^l,ixb^l)
975 ineighbor=neighbor(1,i^d,igrid)
976 ipe_neighbor=neighbor(2,i^d,igrid)
980 if (ipe_neighbor==
mype)
then 981 ixs^l=
ixs_r_^l(iib^d,i^d);
982 ixr^l=
ixr_r_^l(iib^d,n_inc^d);
983 psb(ineighbor)%w(ixr^s,nwhead:nwtail)=&
984 psc(igrid)%w(ixs^s,nwhead:nwtail)
987 itag=(3**^nd+4**^nd)*(ineighbor-1)+3**^nd+{n_inc^d*4**(^d-1)+}
988 call mpi_isend(psc(igrid)%w,1,
type_send_r(iib^d,i^d), &
997 reshape(psc(igrid)%ws(ixs^s,idir),shapes)
1002 mpi_double_precision,ipe_neighbor,
itag, &
1008 ixs^l=
ixs_r_^l(iib^d,i^d);
1011 n_inc^d=2*i^d+(3-ic^d)^d%n_inc^dd=-2*i^dd+ic^dd;\}
1013 if (ipe_neighbor==
mype)
then 1014 ixr^l=
ixr_r_^l(iib^d,n_inc^d);
1015 call pole_copy(psb(ineighbor)%w,ixg^l,ixr^l,psc(igrid)%w,
ixcog^l,ixs^l)
1017 if (isend_buf(ipwbuf)/=0)
then 1020 deallocate(pwbuf(ipwbuf)%w)
1022 allocate(pwbuf(ipwbuf)%w(ixs^s,nwhead:nwtail))
1025 isend_buf(ipwbuf)=
isend 1026 itag=(3**^nd+4**^nd)*(ineighbor-1)+3**^nd+{n_inc^d*4**(^d-1)+}
1027 isizes={(ixsmax^d-ixsmin^d+1)*}*nwbc
1028 call mpi_isend(pwbuf(ipwbuf)%w,isizes,mpi_double_precision, &
1030 ipwbuf=1+modulo(ipwbuf,
npwbuf)
1038 reshape(psc(igrid)%ws(ixs^s,idir),shapes)
1039 ibuf_start=ibuf_next
1043 mpi_double_precision,ipe_neighbor,
itag, &
1055 double precision :: tmp(ixgs^t)
1056 integer :: ixS^L,ixR^L,n_i^D,ixSsync^L,ixRsync^L
1057 integer :: idir, idirect
1059 ineighbor=neighbor(1,i^d,igrid)
1060 ipe_neighbor=neighbor(2,i^d,igrid)
1061 ipole=neighbor_pole(i^d,igrid)
1062 idirect={abs(i^d)|+}
1067 if (ipe_neighbor==mype)
then 1078 psb(igrid)%ws(ixr^s,idir) = psb(ineighbor)%ws(ixs^s,idir)
1094 psb(igrid)%ws(ixr^s,idir) = tmp(ixs^s)
1102 n_i^d=i^d^d%n_i^dd=-i^dd;\}
1104 if (ipe_neighbor==mype)
then 1110 call pole_copy_stg(psb(igrid)%ws,ixr^l,psb(ineighbor)%ws,ixs^l,idir)
1119 shape=shape(psb(igrid)%ws(ixs^s,idir)))
1121 call pole_copy_stg(psb(igrid)%ws,ixr^l,pole_buf%ws,ixs^l,idir)
1129 integer,
intent(in) :: i^D,idir
1130 integer,
intent(inout) :: ixR^L,ixS^L
1131 integer,
intent(out) :: ixRsync^L,ixSsync^L
1137 if (i^d == -1 .and. idir == ^d)
then 1138 ixrsyncmin^d = ixrmax^d
1139 ixrsyncmax^d = ixrmax^d
1140 ixssyncmin^d = ixsmax^d
1141 ixssyncmax^d = ixsmax^d
1142 ixrmax^d = ixrmax^d - 1
1143 ixsmax^d = ixsmax^d - 1
1144 else if (i^d == 1 .and. idir == ^d)
then 1145 ixrsyncmin^d = ixrmin^d
1146 ixrsyncmax^d = ixrmin^d
1147 ixssyncmin^d = ixsmin^d
1148 ixssyncmax^d = ixsmin^d
1149 ixrmin^d = ixrmin^d + 1
1150 ixsmin^d = ixsmin^d + 1
1159 ipole=neighbor_pole(i^d,igrid)
1162 {
do ic^db=1+int((1-i^db)/2),2-int((1+i^db)/2)
1163 inc^db=2*i^db+ic^db\}
1165 ineighbor=neighbor_child(1,inc^d,igrid)
1166 ipe_neighbor=neighbor_child(2,inc^d,igrid)
1167 if (ipe_neighbor==mype)
then 1171 psb(igrid)%ws(ixr^s,idir)=psc(ineighbor)%ws(ixs^s,idir)
1179 shape=shape(psb(igrid)%ws(ixr^s,idir)))
1186 {
do ic^db=1+int((1-i^db)/2),2-int((1+i^db)/2)
1187 inc^db=2*i^db+ic^db\}
1190 n_i^d=i^d^d%n_i^dd=-i^dd;\}
1192 ineighbor=neighbor_child(1,inc^d,igrid)
1193 ipe_neighbor=neighbor_child(2,inc^d,igrid)
1195 if (ipe_neighbor==mype)
then 1210 shape=shape(psb(igrid)%ws(ixr^s,idir)))
1224 ic^d=1+modulo(node(pig^d_,igrid)-1,2);
1225 if ({.not.(i^d==0.or.i^d==2*ic^d-3)|.or.})
return 1227 ipe_neighbor=neighbor(2,i^d,igrid)
1228 if (ipe_neighbor/=mype)
then 1231 itag=(3**^nd+4**^nd)*(igrid-1)+3**^nd+{inc^d*4**(^d-1)+}
1232 call mpi_irecv(psc(igrid)%w,1,
type_recv_p(iib^d,inc^d), &
1233 ipe_neighbor,itag,icomm,recvrequest(irecv),ierrmpi)
1234 if(stagger_grid)
then 1237 mpi_double_precision,ipe_neighbor,itag,&
1249 {
do ic^db=1+int((1-i^db)/2),2-int((1+i^db)/2)
1250 inc^db=2*i^db+ic^db\}
1253 ineighbor=neighbor_child(1,inc^d,igrid)
1254 ipe_neighbor=neighbor_child(2,inc^d,igrid)
1259 if (ipe_neighbor==mype)
then 1261 psc(ineighbor)%w(ixr^s,nwhead:nwtail) &
1262 =psb(igrid)%w(ixs^s,nwhead:nwtail)
1265 itag=(3**^nd+4**^nd)*(ineighbor-1)+3**^nd+{n_inc^d*4**(^d-1)+}
1266 call mpi_isend(psb(igrid)%w,1,
type_send_p(iib^d,inc^d), &
1267 ipe_neighbor,itag,icomm,sendrequest(isend),ierrmpi)
1268 if(stagger_grid)
then 1275 reshape(psb(igrid)%ws(ixs^s,idir),shapes)
1276 ibuf_start=ibuf_next
1280 mpi_double_precision,ipe_neighbor,itag, &
1288 n_inc^d=inc^d^d%n_inc^dd=ic^dd-i^dd;\}
1290 if (ipe_neighbor==mype)
then 1293 if(stagger_grid)
then 1301 if (isend_buf(ipwbuf)/=0)
then 1302 call mpi_wait(sendrequest(isend_buf(ipwbuf)), &
1303 sendstatus(:,isend_buf(ipwbuf)),ierrmpi)
1304 deallocate(pwbuf(ipwbuf)%w)
1306 allocate(pwbuf(ipwbuf)%w(ixs^s,nwhead:nwtail))
1307 call pole_buffer(pwbuf(ipwbuf)%w,ixs^
l,ixs^
l,psb(igrid)%w,ixg^
l,ixs^
l)
1309 isend_buf(ipwbuf)=isend
1310 itag=(3**^nd+4**^nd)*(ineighbor-1)+3**^nd+{n_inc^d*4**(^d-1)+}
1311 isizes={(ixsmax^d-ixsmin^d+1)*}*nwbc
1312 call mpi_isend(pwbuf(ipwbuf)%w,isizes,mpi_double_precision, &
1313 ipe_neighbor,itag,icomm,sendrequest(isend),ierrmpi)
1314 ipwbuf=1+modulo(ipwbuf,
npwbuf)
1315 if(stagger_grid)
then 1322 reshape(psb(igrid)%ws(ixs^s,idir),shapes)
1323 ibuf_start=ibuf_next
1327 mpi_double_precision,ipe_neighbor,itag, &
1339 ic^d=1+modulo(node(pig^d_,igrid)-1,2);
1340 if ({.not.(i^d==0.or.i^d==2*ic^d-3)|.or.})
return 1342 ineighbor=neighbor(1,i^d,igrid)
1343 ipe_neighbor=neighbor(2,i^d,igrid)
1344 ipole=neighbor_pole(i^d,igrid)
1349 if(ipe_neighbor==mype)
then 1350 n_inc^d=-2*i^d+ic^d;
1354 psc(igrid)%ws(ixr^s,idir)=psb(ineighbor)%ws(ixs^s,idir)
1361 shape=shape(psc(igrid)%ws(ixr^s,idir)))
1370 n_inc^d=2*i^d+(3-ic^d)^d%n_inc^dd=-2*i^dd+ic^dd;\}
1372 if (ipe_neighbor==mype)
then 1385 shape=shape(psc(igrid)%ws(ixr^s,idir)))
1399 integer :: ixFi^L,ixCo^L,ii^D
1400 double precision :: dxFi^D, dxCo^D, xFimin^D, xComin^D, invdxCo^D
1403 dxfi^d=rnode(rpdx^d_,igrid);
1405 invdxco^d=1.d0/dxco^d;
1411 xfimin^d=rnode(rpxmin^d_,igrid)-dble(nghostcells)*dxfi^d;
1412 xcomin^d=rnode(rpxmin^d_,igrid)-dble(nghostcells)*dxco^d;
1414 if(stagger_grid.and.phyboundblock(igrid))
then 1416 ixcomin^d=int((xfimin^d+(dble(ixfimin^d)-half)*dxfi^d-xcomin^d)*invdxco^d)+1-1;
1417 ixcomax^d=int((xfimin^d+(dble(ixfimax^d)-half)*dxfi^d-xcomin^d)*invdxco^d)+1+1;
1420 ii^d=kr(^d,idims)*(2*iside-3);
1421 if(neighbor_type(ii^d,igrid)/=neighbor_boundary) cycle
1422 if(( {(iside==1.and.idims==^d.and.ixcomin^d<ixcogmin^d+nghostcells)|.or.} ) &
1423 .or.( {(iside==2.and.idims==^d.and.ixcomax^d>ixcogmax^d-nghostcells)|.or. }))
then 1424 {ixbmin^d=merge(ixcogmin^d,ixcomin^d,idims==^d);}
1425 {ixbmax^d=merge(ixcogmax^d,ixcomax^d,idims==^d);}
1426 call bc_phys(iside,idims,time,0.d0,psc(igrid),
ixcog^l,ixb^l)
1432 if(prolongprimitive)
then 1438 ixcomin^d=int((xfimin^d+(dble(ixfimin^d)-half)*dxfi^d-xcomin^d)*invdxco^d)+1-1;
1439 ixcomax^d=int((xfimin^d+(dble(ixfimax^d)-half)*dxfi^d-xcomin^d)*invdxco^d)+1+1;
1441 psc(igrid)%w,psc(igrid)%x)
1444 select case (typeghostfill)
1450 write (unitterm,*)
"Undefined typeghostfill ",typeghostfill
1451 call mpistop(
"Undefined typeghostfill")
1455 psc(igrid)%w,psc(igrid)%x)
1461 logical,
dimension(-1:1^D&) :: NeedProlong
1462 logical :: fine_^Lin
1463 integer :: ixFi^L,ixCo^L
1464 double precision :: dxFi^D,dxCo^D,xFimin^D,xComin^D,invdxCo^D
1468 if(i^d>-1) fine_min^din=(.not.needprolong(i^dd-kr(^d,^dd)).and.neighbor_type(i^dd-kr(^d,^dd),igrid)/=1)
1469 if(i^d<1) fine_max^din=(.not.needprolong(i^dd+kr(^d,^dd)).and.neighbor_type(i^dd+kr(^d,^dd),igrid)/=1)
1474 dxfi^d=rnode(rpdx^d_,igrid);
1476 invdxco^d=1.d0/dxco^d;
1478 xfimin^d=rnode(rpxmin^d_,igrid)-dble(nghostcells)*dxfi^d;
1479 xcomin^d=rnode(rpxmin^d_,igrid)-dble(nghostcells)*dxco^d;
1484 ixcomin^d=int((xfimin^d+(dble(ixfimin^d)-half)*dxfi^d-xcomin^d)*invdxco^d)+1-1;
1485 ixcomax^d=int((xfimin^d+(dble(ixfimax^d)-half)*dxfi^d-xcomin^d)*invdxco^d)+1+1;
1487 call prolong_2nd_stg(psc(igrid),psb(igrid),ixco^l,ixfi^l,dxco^d,xcomin^d,dxfi^d,xfimin^d,.true.,fine_^lin)
1490 needprolong(i^d)=.false.
1495 dxCo^D,invdxCo^D,xComin^D)
1497 integer,
intent(in) :: ixFi^L
1498 double precision,
intent(in) :: dxFi^D, xFimin^D,dxCo^D, invdxCo^D, xComin^D
1500 integer :: ixCo^D, jxCo^D, hxCo^D, ixFi^D, ix^D, iw, idims, nwmin,nwmax
1501 double precision :: xCo^D, xFi^D, eta^D
1502 double precision :: slopeL, slopeR, slopeC, signC, signR
1503 double precision :: slope(1:nw,ndim)
1505 double precision :: signedfactorhalf^D
1510 if(prolongprimitive)
then 1518 {
do ixfi^db = ixfi^lim^db
1521 xfi^db=xfimin^db+(dble(ixfi^db)-half)*dxfi^db
1526 ixco^db=int((xfi^db-xcomin^db)*invdxco^db)+1
1530 xco^db=xcomin^db+(dble(ixco^db)-half)*dxco^db \}
1545 eta^d=(xfi^d-xco^d)*invdxco^d;
1579 ix^d=2*int((ixfi^d+ixmlo^d)/2)-ixmlo^d;
1580 {signedfactorhalf^d=(xfi^d-xco^d)*invdxco^d*two
1581 if(dabs(signedfactorhalf^d**2-1.0d0/4.0d0)>smalldouble)
call mpistop(
"error in bc_prolong")
1582 eta^d=signedfactorhalf^d*(one-psb(igrid)%dvolume(ixfi^dd) &
1583 /sum(psb(igrid)%dvolume(ix^d:ix^d+1^d%ixFi^dd))) \}
1590 hxco^d=ixco^d-kr(^d,idims)\
1591 jxco^d=ixco^d+kr(^d,idims)\
1594 slopel=psc(igrid)%w(ixco^d,iw)-psc(igrid)%w(hxco^d,iw)
1595 sloper=psc(igrid)%w(jxco^d,iw)-psc(igrid)%w(ixco^d,iw)
1596 slopec=half*(sloper+slopel)
1599 signr=sign(one,sloper)
1600 signc=sign(one,slopec)
1601 select case(typeprolonglimit)
1603 slope(iw,idims)=slopec
1605 slope(iw,idims)=signr*max(zero,min(dabs(sloper), &
1608 slope(iw,idims)=two*signr*max(zero,min(dabs(sloper), &
1609 signr*slopel,signr*half*slopec))
1611 slope(iw,idims)=signr*max(zero,min(two*signr*slopel, &
1612 (dabs(sloper)+two*slopel*signr)*third,two*dabs(sloper)))
1614 slope(iw,idims)=signc*max(zero,min(dabs(slopec), &
1615 signc*slopel,signc*sloper))
1621 psb(igrid)%w(ixfi^d,nwmin:nwmax)=psc(igrid)%w(ixco^d,nwmin:nwmax)+&
1622 {(slope(nwmin:nwmax,^d)*eta^d)+}
1626 if(prolongprimitive)
call phys_to_conserved(ixg^ll,ixfi^l,psb(igrid)%w,psb(igrid)%x)
1631 dxCo^D,invdxCo^D,xComin^D)
1633 integer,
intent(in) :: ixFi^L
1634 double precision,
intent(in) :: dxFi^D, xFimin^D,dxCo^D, invdxCo^D, xComin^D
1636 integer :: ixCo^D, ixFi^D, nwmin,nwmax
1637 double precision :: xFi^D
1639 if(prolongprimitive)
then 1647 {
do ixfi^db = ixfi^lim^db
1649 xfi^db=xfimin^db+(dble(ixfi^db)-half)*dxfi^db
1653 ixco^db=int((xfi^db-xcomin^db)*invdxco^db)+1\}
1656 psb(igrid)%w(ixfi^d,nwmin:nwmax)=psc(igrid)%w(ixco^d,nwmin:nwmax)
1660 if(prolongprimitive)
call phys_to_conserved(ixg^ll,ixfi^l,psb(igrid)%w,psb(igrid)%x)
1664 subroutine pole_copy(wrecv,ixIR^L,ixR^L,wsend,ixIS^L,ixS^L)
1666 integer,
intent(in) :: ixIR^L,ixR^L,ixIS^L,ixS^L
1667 double precision :: wrecv(ixir^s,1:nw), wsend(ixis^s,1:nw)
1673 iside=int((i^d+3)/2)
1676 select case (typeboundary(iw,ib))
1678 wrecv(ixr^s,iw) = wsend(ixsmax^d:ixsmin^d:-1^d%ixS^s,iw)
1680 wrecv(ixr^s,iw) =-wsend(ixsmax^d:ixsmin^d:-1^d%ixS^s,iw)
1682 call mpistop(
"Pole boundary condition should be symm or asymm")
1691 integer,
intent(in) :: ixR^L,ixS^L,idirs
1692 double precision :: wrecv(ixgs^t,1:nws), wsend(ixgs^t,1:nws)
1696 iside=int((i^d+3)/2)
1698 select case (typeboundary(iw_mag(idirs),ib))
1700 wrecv(ixr^s,idirs) = wsend(ixsmax^d:ixsmin^d:-1^d%ixS^s,idirs)
1702 wrecv(ixr^s,idirs) =-wsend(ixsmax^d:ixsmin^d:-1^d%ixS^s,idirs)
1704 call mpistop(
"Pole boundary condition should be symm or asymm")
1711 subroutine pole_buffer(wrecv,ixIR^L,ixR^L,wsend,ixIS^L,ixS^L)
1713 integer,
intent(in) :: ixIR^L,ixR^L,ixIS^L,ixS^L
1714 double precision :: wrecv(ixir^s,nwhead:nwtail), wsend(ixis^s,1:nw)
1720 iside=int((i^d+3)/2)
1723 select case (typeboundary(iw,ib))
1725 wrecv(ixr^s,iw) = wsend(ixsmax^d:ixsmin^d:-1^d%ixS^s,iw)
1727 wrecv(ixr^s,iw) =-wsend(ixsmax^d:ixsmin^d:-1^d%ixS^s,iw)
1729 call mpistop(
"Pole boundary condition should be symm or asymm")
1741 do iigrid=1,igridstail; igrid=igrids(iigrid);
1750 call phys_get_aux(.true.,psb(igrid)%w,ps(igrid)%x,ixg^l,ix^l,
"bc")
1756 end subroutine getbc 1762 integer,
intent(out) :: iib^D
1765 if(s%is_physical_boundary(2*^d) .and. &
1766 s%is_physical_boundary(2*^d-1))
then 1768 else if(s%is_physical_boundary(2*^d-1))
then 1770 else if(s%is_physical_boundary(2*^d))
then integer, dimension(-1:1^d &,-1:1^d &), target type_send_r_p2
integer, dimension(-1:1^d &, 0:3^d &), target type_recv_p_f
integer, dimension(-1:1, 0:3) ixs_p_
integer, dimension(-1:1, 0:3) ixr_r_
This module contains definitions of global parameters and variables and some generic functions/subrou...
integer, dimension(-1:1^d &, 0:3^d &), target type_recv_r_p1
subroutine pole_copy_stg(wrecv, ixRL, wsend, ixSL, idirs)
integer, dimension(-1:2^d &,-1:1^d &), target type_recv_srl_f
update ghost cells of all blocks including physical boundaries
integer, dimension(-1:2,-1:1) ixs_srl_
integer, dimension(:^d &,:^d &), pointer type_recv_srl
subroutine bc_recv_restrict
Receive from fine neighbor.
subroutine create_bc_mpi_datatype(nwstart, nwbc)
integer, dimension(-1:1, 0:3) ixr_p_
integer, dimension(:^d &,:^d &), pointer type_send_r
integer max_blocks
The maximum number of grid blocks in a processor.
subroutine put_bc_comm_types()
subroutine coarsen_grid(sFi, ixFiGL, ixFiL, sCo, ixCoGL, ixCoL)
coarsen one grid to its coarser representative
integer, dimension(:,:), allocatable recvstatus_srl
integer, dimension(-1:1^d &, 0:3^d &), target type_recv_p_p2
integer, dimension(-1:2^d &,-1:1^d &), target type_recv_srl_p2
integer, dimension(:), allocatable sendrequest_r
subroutine bc_fill_p
fill coarser representative with data from coarser neighbors
subroutine bc_prolong
do prolongation for fine blocks after receipt data from coarse neighbors
integer, dimension(-1:1^d &) sizes_srl_recv_total
integer, dimension(0:3^d &) sizes_r_recv_total
integer, dimension(:,:), allocatable recvstatus_r
integer, dimension(^nd, 0:3^d &) sizes_r_recv_stg
integer, dimension(-1:2^d &,-1:1^d &), target type_send_srl_f
integer itag
MPI recv send variables for AMR.
subroutine bc_recv_srl
Receive from sibling at same refinement level.
integer, dimension(:), allocatable sendrequest_p
procedure(sub_boundary_adjust), pointer phys_boundary_adjust
logical function skip_direction(dir)
logical phys_req_diagonal
Whether the physics routines require diagonal ghost cells, for example for computing a curl...
integer, dimension(:^d &,:^d &), pointer type_recv_r
integer, dimension(-1:1,-1:1) ixs_r_
integer, dimension(:^d &,:^d &), pointer type_recv_p
integer, dimension(:,:), allocatable sendstatus_r
integer, dimension(-1:1^d &, 0:3^d &), target type_recv_r_f
integer, parameter ixglo
Lower index of grid block arrays (always 1)
subroutine interpolation_copy(ixFiL, dxFiD, xFiminD, dxCoD, invdxCoD, xCominD)
subroutine bc_recv_prolong
Receive from coarse neighbor.
integer, dimension(-1:1^d &, 0:3^d &), target type_send_p_p2
integer, dimension(^nd,-1:1^d &) sizes_srl_send_stg
integer, dimension(:,:), allocatable sendstatus
logical, dimension(ndim) aperiodb
True for dimensions with aperiodic boundaries.
integer, dimension(-1:2^d &,-1:1^d &), target type_send_srl_p1
double precision, dimension(:), allocatable sendbuffer_srl
integer, dimension(-1:1^d &, 0:3^d &), target type_recv_p_p1
integer nghostcells
Number of ghost cells surrounding a grid.
subroutine prolong_2nd_stg(sCo, sFi, ixCoLin, ixFiLin, dxCoD, xCominD, dxFiD, xFiminD, ghost, fine_Lin)
This subroutine performs a 2nd order prolongation for a staggered field F, preserving the divergence ...
integer, dimension(^nd,-1:1) ixs_srl_stg_
integer ixghi
Upper index of grid block arrays.
integer nbuff_bc_recv_srl
character(len=std_len) typeghostfill
double precision, dimension(:), allocatable sendbuffer_r
integer, dimension(:), allocatable recvrequest_r
logical stagger_grid
True for using stagger grid.
integer, dimension(:), allocatable recvrequest
procedure(sub_convert), pointer phys_to_conserved
integer ierrmpi
A global MPI error return code.
integer, dimension(^nd,-1:1^d &) sizes_srl_recv_stg
integer, dimension(-1:1^d &, 0:3^d &), target type_recv_r_p2
integer, dimension(0:3^d &) sizes_p_recv_total
integer, dimension(:), allocatable recvrequest_p
integer, dimension(^nd,-1:1) ixr_srl_stg_
subroutine getbc(time, qdt, psb, nwstart, nwbc, req_diag)
do update ghost cells of all blocks including physical boundaries
integer, parameter unitterm
Unit for standard output.
integer, dimension(3, 3) kr
Kronecker delta tensor.
subroutine pole_copy(wrecv, ixIRL, ixRL, wsend, ixISL, ixSL)
integer, dimension(^nd,-1:1^d &) sizes_r_send_stg
integer, dimension(:), allocatable, parameter d
integer mype
The rank of the current MPI task.
subroutine identifyphysbound(s, iibD)
integer, dimension(^nd, 0:3) ixr_r_stg_
integer, dimension(^nd, 0:3^d &) sizes_p_recv_stg
subroutine interpolation_linear(ixFiL, dxFiD, xFiminD, dxCoD, invdxCoD, xCominD)
integer, parameter npwbuf
The number of interleaving sending buffers for ghost cells.
integer, dimension(:,:), allocatable sendstatus_srl
integer, dimension(-1:1^d &) sizes_r_send_total
integer, dimension(0:3^d &) sizes_p_send_total
subroutine bc_phys(iside, idims, time, qdt, s, ixGL, ixBL)
fill ghost cells at a physical boundary
integer, dimension(^nd, 0:3) ixs_p_stg_
subroutine mpistop(message)
Exit MPI-AMRVAC with an error message.
integer, dimension(^nd,-1:1) ixs_r_stg_
integer, dimension(-1:1^d &, 0:3^d &), target type_send_p_f
subroutine bc_fill_r
fill restricted ghost cells after receipt
subroutine bc_send_prolong
Send to finer neighbor.
integer, dimension(-1:1^d &) sizes_srl_send_total
double precision, dimension(ndim) dxlevel
integer, dimension(-1:2,-1:1) ixr_srl_
integer nbuff_bc_send_srl
integer, dimension(:,:), allocatable recvstatus
subroutine bc_send_srl
Send to sibling at same refinement level.
integer, parameter ndim
Number of spatial dimensions for grid variables.
double precision, dimension(:), allocatable recvbuffer_p
subroutine pole_buffer(wrecv, ixIRL, ixRL, wsend, ixISL, ixSL)
integer, dimension(^nd, 0:3) ixr_p_stg_
integer, dimension(:), allocatable sendrequest_srl
integer, dimension(:^d &,:^d &), pointer type_send_p
integer icomm
The MPI communicator.
integer, dimension(^nd, 0:3) l
integer, dimension(:,:), allocatable sendstatus_p
double precision, dimension(:), allocatable recvbuffer_r
subroutine get_bc_comm_type(comm_type, ixL, ixGL, nwstart, nwbc)
integer, dimension(:), allocatable recvrequest_srl
This module defines the procedures of a physics module. It contains function pointers for the various...
procedure(sub_convert), pointer phys_to_primitive
integer, dimension(:,:), allocatable node
procedure(sub_get_aux), pointer phys_get_aux
integer, dimension(-1:1^d &,-1:1^d &), target type_send_r_f
integer, dimension(:^d &,:^d &), pointer type_send_srl
integer, dimension(-1:1^d &, 0:3^d &), target type_send_p_p1
subroutine bc_prolong_stg(NeedProlong)
integer, dimension(:), allocatable sendrequest
double precision, dimension(:), allocatable recvbuffer_srl
subroutine bc_send_restrict
Send to coarser neighbor.
double precision time_bc
accumulated wall-clock time spent on boundary conditions
integer, dimension(-1:2^d &,-1:1^d &), target type_send_srl_p2
logical, dimension(:), allocatable phyboundblock
True if a block has any physical boundary.
subroutine indices_for_syncing(idir, iD, ixRL, ixSL, ixRsyncL, ixSsyncL)
double precision, dimension(:), allocatable sendbuffer_p
double precision, dimension(:,:), allocatable rnode
Corner coordinates.
subroutine getintbc(time, ixGL)
fill inner boundary values
integer, dimension(^nd, 0:3^d &) sizes_p_send_stg
integer, dimension(-1:1^d &,-1:1^d &), target type_send_r_p1
integer, dimension(-1:2^d &,-1:1^d &), target type_recv_srl_p1
subroutine bc_fill_srl
fill siblings ghost cells with received data
integer, dimension(:,:), allocatable recvstatus_p