6 double precision,
dimension(:^D&),
pointer :: face
12 end type fake_neighbors
14 type(facealloc),
dimension(:,:,:),
allocatable,
public ::
pface
16 type(fake_neighbors),
dimension(:^D&,:,:),
allocatable,
public ::
fine_neighbors
20 integer :: itag, isend, irecv
21 integer :: nrecv, nsend, ibuf_recv, ibuf_send, ibuf_send_next
22 integer,
dimension(^ND) :: isize
23 integer,
dimension(:),
allocatable :: recvrequest, sendrequest
24 integer,
dimension(:,:),
allocatable :: recvstatus, sendstatus
25 double precision,
allocatable :: recvbuffer(:), sendbuffer(:)
40 subroutine prolong_2nd_stg(sCo,sFi,ixCo^Lin,ixFi^Lin,dxCo^D,xComin^D,dxFi^D,xFimin^D,ghost,fine_^Lin)
44 logical,
intent(in) :: ghost
45 integer,
intent(in) :: ixco^lin, ixfi^lin
46 double precision,
intent(in) :: dxco^
d, xcomin^
d, dxfi^
d, xfimin^
d
47 type(state),
intent(in) :: sco
48 type(state),
intent(inout) :: sfi
50 logical,
optional :: fine_^lin
53 double precision :: eta^
d, invdxco^
d
54 integer :: ixco^
l,ixfi^
l
55 integer :: idim1,idim2,ix^de,idim3,ixfis^
l,ixgs^
l,ixcos^
l,ixfisc^
l
57 integer :: hxcos^
l,jxcos^
l,ixcose^
l,ixfise^
l,hxfisc^
l,jxfisc^
l,ipxfisc^
l,ixcosc^
l,imxfisc^
l,jpxfisc^
l,jmxfisc^
l,hpxfisc^
l
58 integer :: hxfi^
l,jxfi^
l,hijxfi^
l,hjixfi^
l,hjjxfi^
l
59 integer :: iihxfi^
l,iijxfi^
l,ijhxfi^
l,ijjxfi^
l,ihixfi^
l,ijixfi^
l,ihjxfi^
l
60 integer :: jihxfi^
l,jijxfi^
l,jjhxfi^
l,jjjxfi^
l,jhixfi^
l,jjixfi^
l,jhjxfi^
l
61 double precision :: bfluxco(sco%ixgs^s,nws),bfluxfi(sfi%ixgs^s,nws)
62 double precision :: slopes(sco%ixgs^s,
ndim),b_energy_change(ixg^t)
68 double precision :: sigmau(ixg^t),sigmad(ixg^t),sigma(ixg^t,1:
ndim), alpha(ixg^t,1:
ndim)
70 double precision :: f1(ixg^t),f2(ixg^t),f3(ixg^t),f4(ixg^t)
74 call mpistop(
"CT prolongation not implemented in 1D. But CT is not needed.")
95 {
if(
present(fine_min^din)) fine_min^
d=fine_min^din;}
96 {
if(
present(fine_max^din)) fine_max^
d=fine_max^din;}
110 ixcosmin^
d=ixcomin^
d-1;
111 ixcosmax^
d=ixcomax^
d;
113 ixfismin^
d=ixfimin^
d-1;
114 ixfismax^
d=ixfimax^
d;
117 associate(wcos=>sco%ws, wfis=>sfi%ws,wco=>sco%w, wfi=>sfi%w)
119 ixgsmin^
d=sfi%ixGsmin^
d;
120 ixgsmax^
d=sfi%ixGsmax^
d;
123 ixcosvmin^
d(idim1)=ixcomin^
d-
kr(^
d,idim1);
124 ixcosvmax^
d(idim1)=ixcomax^
d;
125 ixfisvmin^
d(idim1)=ixfimin^
d-
kr(^
d,idim1);
126 ixfisvmax^
d(idim1)=ixfimax^
d;
135 invdxco^
d=1.d0/dxco^
d;
142 ixfisemin^
d=max(1-
kr(^
d,idim1),ixfisvmin^
d(idim1)-2*(1-
kr(^
d,idim1)));
143 ixfisemax^
d=min(ixgsmax^
d,ixfisvmax^
d(idim1)+2*(1-
kr(^
d,idim1)));
146 ixcose^
l=ixcosv^
l(idim1)^ladd(1-
kr(idim1,^
d));
147 ixfise^
l=ixfisv^
l(idim1)^ladd2*(1-
kr(idim1,^
d));
150 bfluxfi(ixfise^s,idim1)=wfis(ixfise^s,idim1)*sfi%surfaceC(ixfise^s,idim1)
156 idim3=1+mod(idim1+1,3)
158 bfluxco(ixcose^s,idim1) = zero
161 ixfisc^
l=ixfise^
l+ix2*
kr(idim2,^
d);
163 ixfisc^
l=ixfisc^
l+ix3*
kr(idim3,^
d);
165 bfluxco(ixcose^s,idim1)=bfluxco(ixcose^s,idim1)+bfluxfi(ixfiscmin^
d:ixfiscmax^
d:2,idim1)
172 ixcosvmin^d(^d)=ixcosvmin^d(^d)+1
173 ixfisvmin^d(^d)=ixfisvmin^d(^d)+2
176 ixcosvmax^d(^d)=ixcosvmax^d(^d)-1
177 ixfisvmax^d(^d)=ixfisvmax^d(^d)-2
182 ixcose^l=ixcosv^l(idim1);
186 if ((.not.fine_min^d).or.(.not.ghost))
then
187 ixcosemin^d=ixcosvmin^d(idim1)-1
189 if ((.not.fine_max^d).or.(.not.ghost))
then
190 ixcosemax^d=ixcosvmax^d(idim1)+1
195 bfluxco(ixcose^s,idim1)=wcos(ixcose^s,idim1)*sco%surfaceC(ixcose^s,idim1)
202 ixcos^l=ixcosv^l(idim1);
204 if(idim1==idim2) cycle
207 jxcos^l=ixcos^l+kr(idim2,^d);
208 hxcos^l=ixcos^l-kr(idim2,^d);
209 slopes(ixcos^s,idim2)=0.125d0*(bfluxco(jxcos^s,idim1)-bfluxco(hxcos^s,idim1))
212 ixfiscmin^d=ixfisvmin^d(idim1)+ix2*kr(^d,idim2);
213 ixfiscmax^d=ixfisvmax^d(idim1)+ix2*kr(^d,idim2);
214 bfluxfi(ixfiscmin^d:ixfiscmax^d:2,idim1)=half*(bfluxco(ixcos^s,idim1)&
215 +(2*ix2-1)*slopes(ixcos^s,idim2))
222 jxcos^l=ixcos^l+kr(idim3,^d);
223 hxcos^l=ixcos^l-kr(idim3,^d);
224 slopes(ixcos^s,idim3)=0.125d0*(bfluxco(jxcos^s,idim1)-bfluxco(hxcos^s,idim1))
225 if(lvc(idim1,idim2,idim3)<1) cycle
228 {ixfiscmin^d=ixfisvmin^d(idim1)+ix2*kr(^d,idim2)+ix3*kr(^d,idim3);}
229 {ixfiscmax^d=ixfisvmax^d(idim1)+ix2*kr(^d,idim2)+ix3*kr(^d,idim3);}
230 bfluxfi(ixfiscmin^d:ixfiscmax^d:2,idim1)=quarter*bfluxco(ixcos^s,idim1)&
231 +quarter*(2*ix2-1)*slopes(ixcos^s,idim2)&
232 +quarter*(2*ix3-1)*slopes(ixcos^s,idim3)
246 if (lvc(idim1,idim2,idim3)<1) cycle
248 hxfi^l=ixfi^l-kr(idim1,^d);
249 jxfi^l=ixfi^l+kr(idim1,^d);
251 hijxfi^l=hxfi^l+kr(idim3,^d);
252 hjixfi^l=hxfi^l+kr(idim2,^d);
253 hjjxfi^l=hijxfi^l+kr(idim2,^d);
255 iihxfi^l=ixfi^l-kr(idim3,^d);
256 iijxfi^l=ixfi^l+kr(idim3,^d);
257 ihixfi^l=ixfi^l-kr(idim2,^d);
258 ihjxfi^l=ihixfi^l+kr(idim3,^d);
259 ijixfi^l=ixfi^l+kr(idim2,^d);
260 ijhxfi^l=ijixfi^l-kr(idim3,^d);
261 ijjxfi^l=ijixfi^l+kr(idim3,^d);
263 jihxfi^l=jxfi^l-kr(idim3,^d);
264 jijxfi^l=jxfi^l+kr(idim3,^d);
265 jhixfi^l=jxfi^l-kr(idim2,^d);
266 jhjxfi^l=jhixfi^l+kr(idim3,^d);
267 jjixfi^l=jxfi^l+kr(idim2,^d);
268 jjhxfi^l=jjixfi^l-kr(idim3,^d);
269 jjjxfi^l=jjixfi^l+kr(idim3,^d);
272 abs(bfluxfi(jhixfimin^d:jhixfimax^d:2,idim2))&
273 + abs(bfluxfi(jhjxfimin^d:jhjxfimax^d:2,idim2))&
274 + abs(bfluxfi(jjixfimin^d:jjixfimax^d:2,idim2))&
275 + abs(bfluxfi(jjjxfimin^d:jjjxfimax^d:2,idim2))&
276 + abs(bfluxfi(jihxfimin^d:jihxfimax^d:2,idim3))&
277 + abs(bfluxfi(jijxfimin^d:jijxfimax^d:2,idim3))&
278 + abs(bfluxfi(jjhxfimin^d:jjhxfimax^d:2,idim3))&
279 + abs(bfluxfi(jjjxfimin^d:jjjxfimax^d:2,idim3))
282 abs(bfluxfi(ihixfimin^d:ihixfimax^d:2,idim2))&
283 + abs(bfluxfi(ihjxfimin^d:ihjxfimax^d:2,idim2))&
284 + abs(bfluxfi(ijixfimin^d:ijixfimax^d:2,idim2))&
285 + abs(bfluxfi(ijjxfimin^d:ijjxfimax^d:2,idim2))&
286 + abs(bfluxfi(iihxfimin^d:iihxfimax^d:2,idim3))&
287 + abs(bfluxfi(iijxfimin^d:iijxfimax^d:2,idim3))&
288 + abs(bfluxfi(ijhxfimin^d:ijhxfimax^d:2,idim3))&
289 + abs(bfluxfi(ijjxfimin^d:ijjxfimax^d:2,idim3))
291 sigma(ixco^s,idim1)=sigmau(ixco^s)+sigmad(ixco^s)
292 where(sigma(ixco^s,idim1)/=zero)
293 sigma(ixco^s,idim1)=abs(sigmau(ixco^s)-sigmad(ixco^s))/sigma(ixco^s,idim1)
295 sigma(ixco^s,idim1)=zero
306 if (lvc(idim1,idim2,idim3)<1) cycle
312 alpha(ixco^s,idim1)=(sco%dx(ixco^s,idim2)-sco%dx(ixco^s,idim3))/(sco%dx(ixco^s,idim2)+sco%dx(ixco^s,idim3))
321 if (idim1==idim2) cycle
322 ixfiscmin^d=ixfismin^d+1;
323 ixfiscmax^d=ixfismax^d-1;
324 jxfisc^l=ixfisc^l+kr(idim1,^d);
325 hxfisc^l=ixfisc^l-kr(idim1,^d);
326 ipxfisc^l=ixfisc^l+kr(idim2,^d);
327 imxfisc^l=ixfisc^l-kr(idim2,^d);
328 jpxfisc^l=jxfisc^l+kr(idim2,^d);
329 jmxfisc^l=jxfisc^l-kr(idim2,^d);
330 hpxfisc^l=hxfisc^l+kr(idim2,^d);
332 bfluxfi(ixfiscmin^d:ixfiscmax^d:2,idim1)=&
333 half*(bfluxfi(jxfiscmin^d:jxfiscmax^d:2,idim1)&
334 +bfluxfi(hxfiscmin^d:hxfiscmax^d:2,idim1))&
335 -quarter*(bfluxfi(ipxfiscmin^d:ipxfiscmax^d:2,idim2)&
336 -bfluxfi(jpxfiscmin^d:jpxfiscmax^d:2,idim2)&
337 -bfluxfi(imxfiscmin^d:imxfiscmax^d:2,idim2)&
338 +bfluxfi(jmxfiscmin^d:jmxfiscmax^d:2,idim2))
340 bfluxfi(ipxfiscmin^d:ipxfiscmax^d:2,idim1)=&
341 half*(bfluxfi(jpxfiscmin^d:jpxfiscmax^d:2,idim1)&
342 +bfluxfi(hpxfiscmin^d:hpxfiscmax^d:2,idim1))&
343 -quarter*(bfluxfi(ipxfiscmin^d:ipxfiscmax^d:2,idim2)&
344 -bfluxfi(jpxfiscmin^d:jpxfiscmax^d:2,idim2)&
345 -bfluxfi(imxfiscmin^d:imxfiscmax^d:2,idim2)&
346 +bfluxfi(jmxfiscmin^d:jmxfiscmax^d:2,idim2))
350 if (lvc(idim1,idim2,idim3)<1) cycle
352 hxfi^l=ixfi^l-kr(idim1,^d);
353 jxfi^l=ixfi^l+kr(idim1,^d);
355 hijxfi^l=hxfi^l+kr(idim3,^d);
356 hjixfi^l=hxfi^l+kr(idim2,^d);
357 hjjxfi^l=hijxfi^l+kr(idim2,^d);
359 iihxfi^l=ixfi^l-kr(idim3,^d);
360 iijxfi^l=ixfi^l+kr(idim3,^d);
361 ihixfi^l=ixfi^l-kr(idim2,^d);
362 ihjxfi^l=ihixfi^l+kr(idim3,^d);
363 ijixfi^l=ixfi^l+kr(idim2,^d);
364 ijhxfi^l=ijixfi^l-kr(idim3,^d);
365 ijjxfi^l=ijixfi^l+kr(idim3,^d);
367 jihxfi^l=jxfi^l-kr(idim3,^d);
368 jijxfi^l=jxfi^l+kr(idim3,^d);
369 jhixfi^l=jxfi^l-kr(idim2,^d);
370 jhjxfi^l=jhixfi^l+kr(idim3,^d);
371 jjixfi^l=jxfi^l+kr(idim2,^d);
372 jjhxfi^l=jjixfi^l-kr(idim3,^d);
373 jjjxfi^l=jjixfi^l+kr(idim3,^d);
376 f1(ixco^s)=bfluxfi(ihixfimin^d:ihixfimax^d:2,idim2)&
377 -bfluxfi(jhixfimin^d:jhixfimax^d:2,idim2)&
378 -bfluxfi(ijixfimin^d:ijixfimax^d:2,idim2)&
379 +bfluxfi(jjixfimin^d:jjixfimax^d:2,idim2)
381 f2(ixco^s)=bfluxfi(ihjxfimin^d:ihjxfimax^d:2,idim2)&
382 -bfluxfi(jhjxfimin^d:jhjxfimax^d:2,idim2)&
383 -bfluxfi(ijjxfimin^d:ijjxfimax^d:2,idim2)&
384 +bfluxfi(jjjxfimin^d:jjjxfimax^d:2,idim2)
386 f3(ixco^s)=bfluxfi(iihxfimin^d:iihxfimax^d:2,idim3)&
387 -bfluxfi(jihxfimin^d:jihxfimax^d:2,idim3)&
388 -bfluxfi(iijxfimin^d:iijxfimax^d:2,idim3)&
389 +bfluxfi(jijxfimin^d:jijxfimax^d:2,idim3)
391 f4(ixco^s)=bfluxfi(ijhxfimin^d:ijhxfimax^d:2,idim3)&
392 -bfluxfi(jjhxfimin^d:jjhxfimax^d:2,idim3)&
393 -bfluxfi(ijjxfimin^d:ijjxfimax^d:2,idim3)&
394 +bfluxfi(jjjxfimin^d:jjjxfimax^d:2,idim3)
396 bfluxfi(ixfimin^d:ixfimax^d:2,idim1)=&
397 half*(bfluxfi(hxfimin^d:hxfimax^d:2,idim1)+bfluxfi(jxfimin^d:jxfimax^d:2,idim1))&
398 +6.25d-2*((3.d0+alpha(ixco^s,idim2))*f1(ixco^s)&
399 +(1.d0-alpha(ixco^s,idim2))*f2(ixco^s)&
400 +(3.d0-alpha(ixco^s,idim3))*f3(ixco^s)&
401 +(1.d0+alpha(ixco^s,idim3))*f4(ixco^s))
403 bfluxfi(ijixfimin^d:ijixfimax^d:2,idim1)=&
404 half*(bfluxfi(hjixfimin^d:hjixfimax^d:2,idim1)+bfluxfi(jjixfimin^d:jjixfimax^d:2,idim1))&
405 +6.25d-2*((3.d0+alpha(ixco^s,idim2))*f1(ixco^s)&
406 +(1.d0-alpha(ixco^s,idim2))*f2(ixco^s)&
407 +(1.d0+alpha(ixco^s,idim3))*f3(ixco^s)&
408 +(3.d0-alpha(ixco^s,idim3))*f4(ixco^s))
410 bfluxfi(iijxfimin^d:iijxfimax^d:2,idim1)=&
411 half*(bfluxfi(hijxfimin^d:hijxfimax^d:2,idim1)+bfluxfi(jijxfimin^d:jijxfimax^d:2,idim1))&
412 +6.25d-2*((1.d0-alpha(ixco^s,idim2))*f1(ixco^s)&
413 +(3.d0+alpha(ixco^s,idim2))*f2(ixco^s)&
414 +(3.d0-alpha(ixco^s,idim3))*f3(ixco^s)&
415 +(1.d0+alpha(ixco^s,idim3))*f4(ixco^s))
417 bfluxfi(ijjxfimin^d:ijjxfimax^d:2,idim1)=&
418 half*(bfluxfi(hjjxfimin^d:hjjxfimax^d:2,idim1)+bfluxfi(jjjxfimin^d:jjjxfimax^d:2,idim1))&
419 +6.25d-2*((1.d0-alpha(ixco^s,idim2))*f1(ixco^s)&
420 +(3.d0+alpha(ixco^s,idim2))*f2(ixco^s)&
421 +(1.d0+alpha(ixco^s,idim3))*f3(ixco^s)&
422 +(3.d0-alpha(ixco^s,idim3))*f4(ixco^s))
430 ixfiscmax^d=ixfimax^d;
431 ixfiscmin^d=ixfimin^d-kr(^d,idim1);
432 where(sfi%surfaceC(ixfisc^s,idim1)/=zero)
433 wfis(ixfisc^s,idim1)=bfluxfi(ixfisc^s,idim1)/sfi%surfaceC(ixfisc^s,idim1)
435 wfis(ixfisc^s,idim1)=zero
439 if(phys_total_energy.and. .not.prolongprimitive)
then
440 b_energy_change(ixfi^s)=0.5d0*sum(wfi(ixfi^s,iw_mag(:))**2,dim=ndim+1)
442 call phys_face_to_center(ixfi^l,sfi)
443 if(phys_total_energy.and. .not.prolongprimitive)
then
444 b_energy_change(ixfi^s)=0.5d0*sum(wfi(ixfi^s,iw_mag(:))**2,dim=ndim+1)-&
445 b_energy_change(ixfi^s)
446 wfi(ixfi^s,iw_e)=wfi(ixfi^s,iw_e)+b_energy_change(ixfi^s)
460 integer :: igrid, iigrid, idims, iside, ineighbor, ipe_neighbor
461 integer :: nx^
d, i^
d, ic^
d, inc^
d
469 nx^
d=ixmhi^
d-ixmlo^
d+1;
471 do iigrid=1,igridstail; igrid=igrids(iigrid);
475 i^dd=
kr(^dd,^
d)*(2*iside-3);
476 if (neighbor_pole(i^dd,igrid)/=0) cycle
477 if (neighbor_type(i^dd,igrid)==neighbor_coarse)
then
478 ineighbor =neighbor(1,i^dd,igrid)
479 ipe_neighbor=neighbor(2,i^dd,igrid)
480 if (
refine(ineighbor,ipe_neighbor))
then
481 allocate(
pface(iside,^
d,igrid)%face(1^
d%1:nx^dd))
484 pface(iside,^
d,igrid)%face(1^
d%1:nx^dd)=&
485 ps(igrid)%ws(ixmlo^
d-1^
d%ixM^t,^
d)
487 pface(iside,^
d,igrid)%face(1^
d%1:nx^dd)=&
488 ps(igrid)%ws(ixmhi^
d^
d%ixM^t,^
d)
490 if (ipe_neighbor/=
mype) nsend_fc(^
d)=nsend_fc(^
d)+1
497 if (refine(igrid,mype))
then
503 i^d=kr(^d,idims)*(2*iside-3);
504 if (neighbor_pole(i^d,igrid)/=0) cycle
505 if (neighbor_type(i^d,igrid)==neighbor_fine)
then
506 {
do ic^db=1+int((1+i^db)/2),2-int((1-i^db)/2)
508 ineighbor=neighbor_child(1,inc^d,igrid)
509 ipe_neighbor=neighbor_child(2,inc^d,igrid)
514 if (ipe_neighbor/=mype) nrecv_fc(idims)=nrecv_fc(idims)+1
532 integer :: iigrid,igrid,ineighbor,ipe_neighbor
533 integer :: idims,iside,i^
d,ic^
d,inc^
d,nx^
d
534 integer :: recvsize, sendsize
547 nrecv=nrecv+nrecv_fc(^
d)
548 nsend=nsend+nsend_fc(^
d)
549 nx^
d=1^
d%nx^dd=ixmhi^dd-ixmlo^dd+1;
551 recvsize=recvsize+nrecv_fc(^
d)*isize(^
d)
552 sendsize=sendsize+nsend_fc(^
d)*isize(^
d)
559 allocate(recvbuffer(recvsize),recvstatus(mpi_status_size,nrecv), &
561 recvrequest=mpi_request_null
566 do iigrid=1,igridstail; igrid=igrids(iigrid);
576 if (ineighbor>0.and.ipe_neighbor/=
mype)
then
577 {
if (idims==^
d) iside=ic^
d\}
579 i^
d=
kr(^
d,idims)*(2*iside-3);
580 if (neighbor_pole(i^
d,igrid)/=0) cycle
583 itag=4**^nd*(igrid-1)+{inc^
d*4**(^
d-1)+}
585 call mpi_irecv(recvbuffer(ibuf_recv),isize(idims), &
586 mpi_double_precision,ipe_neighbor,itag, &
588 ibuf_recv=ibuf_recv+isize(idims)
599 allocate(sendbuffer(sendsize),sendstatus(mpi_status_size,nsend),sendrequest(nsend))
600 sendrequest=mpi_request_null
603 do iigrid=1,igridstail; igrid=igrids(iigrid);
607 i^dd=kr(^dd,^d)*(2*iside-3);
609 if (neighbor_pole(i^dd,igrid)/=0) cycle
610 if (neighbor_type(i^dd,igrid)==neighbor_coarse)
then
611 ineighbor =neighbor(1,i^dd,igrid)
612 ipe_neighbor=neighbor(2,i^dd,igrid)
613 if (refine(ineighbor,ipe_neighbor))
then
614 if (ipe_neighbor/=mype)
then
615 ic^dd=1+modulo(node(pig^dd_,igrid)-1,2);
616 inc^d=-2*i^d+ic^d^d%inc^dd=ic^dd;
617 itag=4**^nd*(ineighbor-1)+{inc^dd*4**(^dd-1)+}
619 ibuf_send_next=ibuf_send+isize(^d)
620 sendbuffer(ibuf_send:ibuf_send_next-1)=&
621 reshape(
pface(iside,^d,igrid)%face,(/isize(^d)/))
622 call mpi_isend(sendbuffer(ibuf_send),isize(^d), &
623 mpi_double_precision,ipe_neighbor,itag, &
624 icomm,sendrequest(isend),ierrmpi)
625 ibuf_send=ibuf_send_next
635 call mpi_waitall(nrecv,recvrequest,recvstatus,ierrmpi)
636 deallocate(recvstatus,recvrequest)
641 call mpi_waitall(nsend,sendrequest,sendstatus,ierrmpi)
642 deallocate(sendbuffer,sendstatus,sendrequest)
650 if (nrecv>0)
deallocate(recvbuffer)
655 integer :: igrid, iigrid, iside
657 do iigrid=1,igridstail; igrid=igrids(iigrid);
659 if (
associated(
pface(iside,^
d,igrid)%face))
then
660 deallocate(
pface(iside,^
d,igrid)%face)
669 integer,
dimension(2^D&),
intent(in) :: child_igrid, child_ipe
670 integer,
intent(in) :: igrid, ipe
671 integer :: iside, i^
d, ic^
d
676 if (ic^
d==iside)
then
677 i^dd=
kr(^dd,^
d)*(2*iside-3);
695 integer,
intent(in) :: ichild
698 integer :: ineighbor,ipe_neighbor,ibufnext
699 integer :: iside,iotherside,i^
d,nx^
d
702 nx^
d=ixmhi^
d-ixmlo^
d+1;
712 i^dd=
kr(^dd,^
d)*(2*iside-3);
715 if (neighbor_pole(i^dd,ichild)/=0) cycle
723 if (ineighbor>0)
then
725 if (ipe_neighbor==
mype)
then
726 sfi%ws(ixmlo^
d-1^
d%ixM^t,^
d)=
pface(iotherside,^
d,ineighbor)%face(1^
d%1:nx^dd)
728 ibufnext=ibuf_recv+isize(^
d)
729 sfi%ws(ixmlo^
d-1^
d%ixM^t,^
d)=reshape(&
730 source=recvbuffer(ibuf_recv:ibufnext-1),&
731 shape=shape(sfi%ws(ixmlo^
d-1^
d%ixM^t,^
d)))
736 if (ipe_neighbor==
mype)
then
737 sfi%ws(ixmhi^
d^
d%ixM^t,^
d)=
pface(iotherside,^
d,ineighbor)%face(1^
d%1:nx^dd)
739 ibufnext=ibuf_recv+isize(^
d)
740 sfi%ws(ixmhi^
d^
d%ixM^t,^
d)=reshape(&
741 source=recvbuffer(ibuf_recv:ibufnext-1),&
742 shape=shape(sfi%ws(ixmhi^
d^
d%ixM^t,^
d)))
type(fake_neighbors), dimension(:^d &,:,:), allocatable, public fine_neighbors
subroutine, public old_neighbors(child_igrid, child_ipe, igrid, ipe)
integer, dimension(:,:^d &,:), allocatable, public old_neighbor
subroutine, public store_faces
To achive consistency and thus conservation of divergence, when refining a block we take into account...
subroutine, public comm_faces
When refining a coarse block with fine neighbours, it is necessary prolong consistently with the alre...
subroutine, public already_fine(sFi, ichild, fine_L)
This routine fills the fine faces before prolonging. It is the face equivalent of fix_conserve.
type(facealloc), dimension(:,:,:), allocatable, public pface
subroutine, public end_comm_faces
subroutine, public 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 ...
subroutine, public deallocatebfaces
Module with basic grid data structures.
logical, dimension(:,:), allocatable, save refine
This module contains definitions of global parameters and variables and some generic functions/subrou...
integer, dimension(3, 3) kr
Kronecker delta tensor.
integer, parameter ndim
Number of spatial dimensions for grid variables.
integer icomm
The MPI communicator.
integer mype
The rank of the current MPI task.
integer, dimension(:), allocatable, parameter d
integer ixm
the mesh range of a physical block without ghost cells
integer ierrmpi
A global MPI error return code.
integer npe
The number of MPI tasks.
integer nghostcells
Number of ghost cells surrounding a grid.
This module defines the procedures of a physics module. It contains function pointers for the various...