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 double precision,
allocatable :: recvbuffer(:), sendbuffer(:)
21 integer :: itag, isend, irecv
22 integer :: nrecv, nsend, ibuf_recv, ibuf_send, ibuf_send_next
23 integer,
dimension(^ND) :: isize
24 integer,
dimension(:),
allocatable :: recvrequest, sendrequest
25 integer,
dimension(:,:),
allocatable :: recvstatus, sendstatus
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
49 logical,
optional :: fine_^lin
51 double precision :: eta^
d, invdxco^
d
52 double precision :: bfluxco(sco%ixgs^s,nws),bfluxfi(sfi%ixgs^s,nws)
53 double precision :: slopes(sco%ixgs^s,
ndim),b_energy_change(ixg^t)
59 double precision :: sigmau(ixg^t),sigmad(ixg^t),sigma(ixg^t,1:
ndim), alpha(ixg^t,1:
ndim)
61 double precision :: f1(ixg^t),f2(ixg^t),f3(ixg^t),f4(ixg^t)
63 integer :: ixco^
l,ixfi^
l
64 integer :: idim1,idim2,ix^de,idim3,ixfis^
l,ixgs^
l,ixcos^
l,ixfisc^
l
66 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
67 integer :: hxfi^
l,jxfi^
l,hijxfi^
l,hjixfi^
l,hjjxfi^
l
68 integer :: iihxfi^
l,iijxfi^
l,ijhxfi^
l,ijjxfi^
l,ihixfi^
l,ijixfi^
l,ihjxfi^
l
69 integer :: jihxfi^
l,jijxfi^
l,jjhxfi^
l,jjjxfi^
l,jhixfi^
l,jjixfi^
l,jhjxfi^
l
73 call mpistop(
"CT prolongation not implemented in 1D. But CT is not needed.")
94 {
if(
present(fine_min^din)) fine_min^
d=fine_min^din;}
95 {
if(
present(fine_max^din)) fine_max^
d=fine_max^din;}
109 ixcosmin^
d=ixcomin^
d-1;
110 ixcosmax^
d=ixcomax^
d;
112 ixfismin^
d=ixfimin^
d-1;
113 ixfismax^
d=ixfimax^
d;
116 associate(wcos=>sco%ws, wfis=>sfi%ws,wco=>sco%w, wfi=>sfi%w)
118 ixgsmin^
d=sfi%ixGsmin^
d;
119 ixgsmax^
d=sfi%ixGsmax^
d;
122 ixcosvmin^
d(idim1)=ixcomin^
d-
kr(^
d,idim1);
123 ixcosvmax^
d(idim1)=ixcomax^
d;
124 ixfisvmin^
d(idim1)=ixfimin^
d-
kr(^
d,idim1);
125 ixfisvmax^
d(idim1)=ixfimax^
d;
134 invdxco^
d=1.d0/dxco^
d;
141 ixfisemin^
d=max(1-
kr(^
d,idim1),ixfisvmin^
d(idim1)-2*(1-
kr(^
d,idim1)));
142 ixfisemax^
d=min(ixgsmax^
d,ixfisvmax^
d(idim1)+2*(1-
kr(^
d,idim1)));
145 ixcose^
l=ixcosv^
l(idim1)^ladd(1-
kr(idim1,^
d));
146 ixfise^
l=ixfisv^
l(idim1)^ladd2*(1-
kr(idim1,^
d));
149 bfluxfi(ixfise^s,idim1)=wfis(ixfise^s,idim1)*sfi%surfaceC(ixfise^s,idim1)
155 idim3=1+mod(idim1+1,3)
157 bfluxco(ixcose^s,idim1) = zero
160 ixfisc^
l=ixfise^
l+ix2*
kr(idim2,^
d);
162 ixfisc^
l=ixfisc^
l+ix3*
kr(idim3,^
d);
164 bfluxco(ixcose^s,idim1)=bfluxco(ixcose^s,idim1)+bfluxfi(ixfiscmin^
d:ixfiscmax^
d:2,idim1)
171 ixcosvmin^d(^d)=ixcosvmin^d(^d)+1
172 ixfisvmin^d(^d)=ixfisvmin^d(^d)+2
175 ixcosvmax^d(^d)=ixcosvmax^d(^d)-1
176 ixfisvmax^d(^d)=ixfisvmax^d(^d)-2
181 ixcose^l=ixcosv^l(idim1);
185 if ((.not.fine_min^d).or.(.not.ghost))
then
186 ixcosemin^d=ixcosvmin^d(idim1)-1
188 if ((.not.fine_max^d).or.(.not.ghost))
then
189 ixcosemax^d=ixcosvmax^d(idim1)+1
194 bfluxco(ixcose^s,idim1)=wcos(ixcose^s,idim1)*sco%surfaceC(ixcose^s,idim1)
201 ixcos^l=ixcosv^l(idim1);
203 if(idim1==idim2) cycle
206 jxcos^l=ixcos^l+kr(idim2,^d);
207 hxcos^l=ixcos^l-kr(idim2,^d);
208 slopes(ixcos^s,idim2)=0.125d0*(bfluxco(jxcos^s,idim1)-bfluxco(hxcos^s,idim1))
211 ixfiscmin^d=ixfisvmin^d(idim1)+ix2*kr(^d,idim2);
212 ixfiscmax^d=ixfisvmax^d(idim1)+ix2*kr(^d,idim2);
213 bfluxfi(ixfiscmin^d:ixfiscmax^d:2,idim1)=half*(bfluxco(ixcos^s,idim1)&
214 +(2*ix2-1)*slopes(ixcos^s,idim2))
221 jxcos^l=ixcos^l+kr(idim3,^d);
222 hxcos^l=ixcos^l-kr(idim3,^d);
223 slopes(ixcos^s,idim3)=0.125d0*(bfluxco(jxcos^s,idim1)-bfluxco(hxcos^s,idim1))
224 if(lvc(idim1,idim2,idim3)<1) cycle
227 {ixfiscmin^d=ixfisvmin^d(idim1)+ix2*kr(^d,idim2)+ix3*kr(^d,idim3);}
228 {ixfiscmax^d=ixfisvmax^d(idim1)+ix2*kr(^d,idim2)+ix3*kr(^d,idim3);}
229 bfluxfi(ixfiscmin^d:ixfiscmax^d:2,idim1)=quarter*bfluxco(ixcos^s,idim1)&
230 +quarter*(2*ix2-1)*slopes(ixcos^s,idim2)&
231 +quarter*(2*ix3-1)*slopes(ixcos^s,idim3)
245 if (lvc(idim1,idim2,idim3)<1) cycle
247 hxfi^l=ixfi^l-kr(idim1,^d);
248 jxfi^l=ixfi^l+kr(idim1,^d);
250 hijxfi^l=hxfi^l+kr(idim3,^d);
251 hjixfi^l=hxfi^l+kr(idim2,^d);
252 hjjxfi^l=hijxfi^l+kr(idim2,^d);
254 iihxfi^l=ixfi^l-kr(idim3,^d);
255 iijxfi^l=ixfi^l+kr(idim3,^d);
256 ihixfi^l=ixfi^l-kr(idim2,^d);
257 ihjxfi^l=ihixfi^l+kr(idim3,^d);
258 ijixfi^l=ixfi^l+kr(idim2,^d);
259 ijhxfi^l=ijixfi^l-kr(idim3,^d);
260 ijjxfi^l=ijixfi^l+kr(idim3,^d);
262 jihxfi^l=jxfi^l-kr(idim3,^d);
263 jijxfi^l=jxfi^l+kr(idim3,^d);
264 jhixfi^l=jxfi^l-kr(idim2,^d);
265 jhjxfi^l=jhixfi^l+kr(idim3,^d);
266 jjixfi^l=jxfi^l+kr(idim2,^d);
267 jjhxfi^l=jjixfi^l-kr(idim3,^d);
268 jjjxfi^l=jjixfi^l+kr(idim3,^d);
271 abs(bfluxfi(jhixfimin^d:jhixfimax^d:2,idim2))&
272 + abs(bfluxfi(jhjxfimin^d:jhjxfimax^d:2,idim2))&
273 + abs(bfluxfi(jjixfimin^d:jjixfimax^d:2,idim2))&
274 + abs(bfluxfi(jjjxfimin^d:jjjxfimax^d:2,idim2))&
275 + abs(bfluxfi(jihxfimin^d:jihxfimax^d:2,idim3))&
276 + abs(bfluxfi(jijxfimin^d:jijxfimax^d:2,idim3))&
277 + abs(bfluxfi(jjhxfimin^d:jjhxfimax^d:2,idim3))&
278 + abs(bfluxfi(jjjxfimin^d:jjjxfimax^d:2,idim3))
281 abs(bfluxfi(ihixfimin^d:ihixfimax^d:2,idim2))&
282 + abs(bfluxfi(ihjxfimin^d:ihjxfimax^d:2,idim2))&
283 + abs(bfluxfi(ijixfimin^d:ijixfimax^d:2,idim2))&
284 + abs(bfluxfi(ijjxfimin^d:ijjxfimax^d:2,idim2))&
285 + abs(bfluxfi(iihxfimin^d:iihxfimax^d:2,idim3))&
286 + abs(bfluxfi(iijxfimin^d:iijxfimax^d:2,idim3))&
287 + abs(bfluxfi(ijhxfimin^d:ijhxfimax^d:2,idim3))&
288 + abs(bfluxfi(ijjxfimin^d:ijjxfimax^d:2,idim3))
290 sigma(ixco^s,idim1)=sigmau(ixco^s)+sigmad(ixco^s)
291 where(sigma(ixco^s,idim1)/=zero)
292 sigma(ixco^s,idim1)=abs(sigmau(ixco^s)-sigmad(ixco^s))/sigma(ixco^s,idim1)
294 sigma(ixco^s,idim1)=zero
305 if (lvc(idim1,idim2,idim3)<1) cycle
311 alpha(ixco^s,idim1)=(sco%dx(ixco^s,idim2)-sco%dx(ixco^s,idim3))/(sco%dx(ixco^s,idim2)+sco%dx(ixco^s,idim3))
320 if (idim1==idim2) cycle
321 ixfiscmin^d=ixfismin^d+1;
322 ixfiscmax^d=ixfismax^d-1;
323 jxfisc^l=ixfisc^l+kr(idim1,^d);
324 hxfisc^l=ixfisc^l-kr(idim1,^d);
325 ipxfisc^l=ixfisc^l+kr(idim2,^d);
326 imxfisc^l=ixfisc^l-kr(idim2,^d);
327 jpxfisc^l=jxfisc^l+kr(idim2,^d);
328 jmxfisc^l=jxfisc^l-kr(idim2,^d);
329 hpxfisc^l=hxfisc^l+kr(idim2,^d);
331 bfluxfi(ixfiscmin^d:ixfiscmax^d:2,idim1)=&
332 half*(bfluxfi(jxfiscmin^d:jxfiscmax^d:2,idim1)&
333 +bfluxfi(hxfiscmin^d:hxfiscmax^d:2,idim1))&
334 -quarter*(bfluxfi(ipxfiscmin^d:ipxfiscmax^d:2,idim2)&
335 -bfluxfi(jpxfiscmin^d:jpxfiscmax^d:2,idim2)&
336 -bfluxfi(imxfiscmin^d:imxfiscmax^d:2,idim2)&
337 +bfluxfi(jmxfiscmin^d:jmxfiscmax^d:2,idim2))
339 bfluxfi(ipxfiscmin^d:ipxfiscmax^d:2,idim1)=&
340 half*(bfluxfi(jpxfiscmin^d:jpxfiscmax^d:2,idim1)&
341 +bfluxfi(hpxfiscmin^d:hpxfiscmax^d:2,idim1))&
342 -quarter*(bfluxfi(ipxfiscmin^d:ipxfiscmax^d:2,idim2)&
343 -bfluxfi(jpxfiscmin^d:jpxfiscmax^d:2,idim2)&
344 -bfluxfi(imxfiscmin^d:imxfiscmax^d:2,idim2)&
345 +bfluxfi(jmxfiscmin^d:jmxfiscmax^d:2,idim2))
349 if (lvc(idim1,idim2,idim3)<1) cycle
351 hxfi^l=ixfi^l-kr(idim1,^d);
352 jxfi^l=ixfi^l+kr(idim1,^d);
354 hijxfi^l=hxfi^l+kr(idim3,^d);
355 hjixfi^l=hxfi^l+kr(idim2,^d);
356 hjjxfi^l=hijxfi^l+kr(idim2,^d);
358 iihxfi^l=ixfi^l-kr(idim3,^d);
359 iijxfi^l=ixfi^l+kr(idim3,^d);
360 ihixfi^l=ixfi^l-kr(idim2,^d);
361 ihjxfi^l=ihixfi^l+kr(idim3,^d);
362 ijixfi^l=ixfi^l+kr(idim2,^d);
363 ijhxfi^l=ijixfi^l-kr(idim3,^d);
364 ijjxfi^l=ijixfi^l+kr(idim3,^d);
366 jihxfi^l=jxfi^l-kr(idim3,^d);
367 jijxfi^l=jxfi^l+kr(idim3,^d);
368 jhixfi^l=jxfi^l-kr(idim2,^d);
369 jhjxfi^l=jhixfi^l+kr(idim3,^d);
370 jjixfi^l=jxfi^l+kr(idim2,^d);
371 jjhxfi^l=jjixfi^l-kr(idim3,^d);
372 jjjxfi^l=jjixfi^l+kr(idim3,^d);
375 f1(ixco^s)=bfluxfi(ihixfimin^d:ihixfimax^d:2,idim2)&
376 -bfluxfi(jhixfimin^d:jhixfimax^d:2,idim2)&
377 -bfluxfi(ijixfimin^d:ijixfimax^d:2,idim2)&
378 +bfluxfi(jjixfimin^d:jjixfimax^d:2,idim2)
380 f2(ixco^s)=bfluxfi(ihjxfimin^d:ihjxfimax^d:2,idim2)&
381 -bfluxfi(jhjxfimin^d:jhjxfimax^d:2,idim2)&
382 -bfluxfi(ijjxfimin^d:ijjxfimax^d:2,idim2)&
383 +bfluxfi(jjjxfimin^d:jjjxfimax^d:2,idim2)
385 f3(ixco^s)=bfluxfi(iihxfimin^d:iihxfimax^d:2,idim3)&
386 -bfluxfi(jihxfimin^d:jihxfimax^d:2,idim3)&
387 -bfluxfi(iijxfimin^d:iijxfimax^d:2,idim3)&
388 +bfluxfi(jijxfimin^d:jijxfimax^d:2,idim3)
390 f4(ixco^s)=bfluxfi(ijhxfimin^d:ijhxfimax^d:2,idim3)&
391 -bfluxfi(jjhxfimin^d:jjhxfimax^d:2,idim3)&
392 -bfluxfi(ijjxfimin^d:ijjxfimax^d:2,idim3)&
393 +bfluxfi(jjjxfimin^d:jjjxfimax^d:2,idim3)
395 bfluxfi(ixfimin^d:ixfimax^d:2,idim1)=&
396 half*(bfluxfi(hxfimin^d:hxfimax^d:2,idim1)+bfluxfi(jxfimin^d:jxfimax^d:2,idim1))&
397 +6.25d-2*((3.d0+alpha(ixco^s,idim2))*f1(ixco^s)&
398 +(1.d0-alpha(ixco^s,idim2))*f2(ixco^s)&
399 +(3.d0-alpha(ixco^s,idim3))*f3(ixco^s)&
400 +(1.d0+alpha(ixco^s,idim3))*f4(ixco^s))
402 bfluxfi(ijixfimin^d:ijixfimax^d:2,idim1)=&
403 half*(bfluxfi(hjixfimin^d:hjixfimax^d:2,idim1)+bfluxfi(jjixfimin^d:jjixfimax^d:2,idim1))&
404 +6.25d-2*((3.d0+alpha(ixco^s,idim2))*f1(ixco^s)&
405 +(1.d0-alpha(ixco^s,idim2))*f2(ixco^s)&
406 +(1.d0+alpha(ixco^s,idim3))*f3(ixco^s)&
407 +(3.d0-alpha(ixco^s,idim3))*f4(ixco^s))
409 bfluxfi(iijxfimin^d:iijxfimax^d:2,idim1)=&
410 half*(bfluxfi(hijxfimin^d:hijxfimax^d:2,idim1)+bfluxfi(jijxfimin^d:jijxfimax^d:2,idim1))&
411 +6.25d-2*((1.d0-alpha(ixco^s,idim2))*f1(ixco^s)&
412 +(3.d0+alpha(ixco^s,idim2))*f2(ixco^s)&
413 +(3.d0-alpha(ixco^s,idim3))*f3(ixco^s)&
414 +(1.d0+alpha(ixco^s,idim3))*f4(ixco^s))
416 bfluxfi(ijjxfimin^d:ijjxfimax^d:2,idim1)=&
417 half*(bfluxfi(hjjxfimin^d:hjjxfimax^d:2,idim1)+bfluxfi(jjjxfimin^d:jjjxfimax^d:2,idim1))&
418 +6.25d-2*((1.d0-alpha(ixco^s,idim2))*f1(ixco^s)&
419 +(3.d0+alpha(ixco^s,idim2))*f2(ixco^s)&
420 +(1.d0+alpha(ixco^s,idim3))*f3(ixco^s)&
421 +(3.d0-alpha(ixco^s,idim3))*f4(ixco^s))
429 ixfiscmax^d=ixfimax^d;
430 ixfiscmin^d=ixfimin^d-kr(^d,idim1);
431 where(sfi%surfaceC(ixfisc^s,idim1)/=zero)
432 wfis(ixfisc^s,idim1)=bfluxfi(ixfisc^s,idim1)/sfi%surfaceC(ixfisc^s,idim1)
434 wfis(ixfisc^s,idim1)=zero
438 if(phys_total_energy.and. .not.prolongprimitive)
then
439 b_energy_change(ixfi^s)=0.5d0*sum(wfi(ixfi^s,iw_mag(:))**2,dim=ndim+1)
441 call phys_face_to_center(ixfi^l,sfi)
442 if(phys_total_energy.and. .not.prolongprimitive)
then
443 b_energy_change(ixfi^s)=0.5d0*sum(wfi(ixfi^s,iw_mag(:))**2,dim=ndim+1)-&
444 b_energy_change(ixfi^s)
445 wfi(ixfi^s,iw_e)=wfi(ixfi^s,iw_e)+b_energy_change(ixfi^s)
459 integer :: igrid, iigrid, idims, iside, ineighbor, ipe_neighbor
460 integer :: nx^
d, i^
d, ic^
d, inc^
d
468 nx^
d=ixmhi^
d-ixmlo^
d+1;
470 do iigrid=1,igridstail; igrid=igrids(iigrid);
474 i^dd=
kr(^dd,^
d)*(2*iside-3);
475 if (neighbor_pole(i^dd,igrid)/=0) cycle
476 if (neighbor_type(i^dd,igrid)==neighbor_coarse)
then
477 ineighbor =neighbor(1,i^dd,igrid)
478 ipe_neighbor=neighbor(2,i^dd,igrid)
479 if (
refine(ineighbor,ipe_neighbor))
then
480 allocate(
pface(iside,^
d,igrid)%face(1^
d%1:nx^dd))
483 pface(iside,^
d,igrid)%face(1^
d%1:nx^dd)=&
484 ps(igrid)%ws(ixmlo^
d-1^
d%ixM^t,^
d)
486 pface(iside,^
d,igrid)%face(1^
d%1:nx^dd)=&
487 ps(igrid)%ws(ixmhi^
d^
d%ixM^t,^
d)
489 if (ipe_neighbor/=
mype) nsend_fc(^
d)=nsend_fc(^
d)+1
496 if (refine(igrid,mype))
then
502 i^d=kr(^d,idims)*(2*iside-3);
503 if (neighbor_pole(i^d,igrid)/=0) cycle
504 if (neighbor_type(i^d,igrid)==neighbor_fine)
then
505 {
do ic^db=1+int((1+i^db)/2),2-int((1-i^db)/2)
507 ineighbor=neighbor_child(1,inc^d,igrid)
508 ipe_neighbor=neighbor_child(2,inc^d,igrid)
513 if (ipe_neighbor/=mype) nrecv_fc(idims)=nrecv_fc(idims)+1
531 integer :: iigrid,igrid,ineighbor,ipe_neighbor
532 integer :: idims,iside,i^
d,ic^
d,inc^
d,nx^
d
533 integer :: recvsize, sendsize
546 nrecv=nrecv+nrecv_fc(^
d)
547 nsend=nsend+nsend_fc(^
d)
548 nx^
d=1^
d%nx^dd=ixmhi^dd-ixmlo^dd+1;
550 recvsize=recvsize+nrecv_fc(^
d)*isize(^
d)
551 sendsize=sendsize+nsend_fc(^
d)*isize(^
d)
558 allocate(recvbuffer(recvsize),recvstatus(mpi_status_size,nrecv), &
560 recvrequest=mpi_request_null
565 do iigrid=1,igridstail; igrid=igrids(iigrid);
575 if (ineighbor>0.and.ipe_neighbor/=
mype)
then
576 {
if (idims==^
d) iside=ic^
d\}
578 i^
d=
kr(^
d,idims)*(2*iside-3);
579 if (neighbor_pole(i^
d,igrid)/=0) cycle
582 itag=4**^nd*(igrid-1)+{inc^
d*4**(^
d-1)+}
584 call mpi_irecv(recvbuffer(ibuf_recv),isize(idims), &
585 mpi_double_precision,ipe_neighbor,itag, &
587 ibuf_recv=ibuf_recv+isize(idims)
598 allocate(sendbuffer(sendsize),sendstatus(mpi_status_size,nsend),sendrequest(nsend))
599 sendrequest=mpi_request_null
602 do iigrid=1,igridstail; igrid=igrids(iigrid);
606 i^dd=kr(^dd,^d)*(2*iside-3);
608 if (neighbor_pole(i^dd,igrid)/=0) cycle
609 if (neighbor_type(i^dd,igrid)==neighbor_coarse)
then
610 ineighbor =neighbor(1,i^dd,igrid)
611 ipe_neighbor=neighbor(2,i^dd,igrid)
612 if (refine(ineighbor,ipe_neighbor))
then
613 if (ipe_neighbor/=mype)
then
614 ic^dd=1+modulo(node(pig^dd_,igrid)-1,2);
615 inc^d=-2*i^d+ic^d^d%inc^dd=ic^dd;
616 itag=4**^nd*(ineighbor-1)+{inc^dd*4**(^dd-1)+}
618 ibuf_send_next=ibuf_send+isize(^d)
619 sendbuffer(ibuf_send:ibuf_send_next-1)=&
620 reshape(
pface(iside,^d,igrid)%face,(/isize(^d)/))
621 call mpi_isend(sendbuffer(ibuf_send),isize(^d), &
622 mpi_double_precision,ipe_neighbor,itag, &
623 icomm,sendrequest(isend),ierrmpi)
624 ibuf_send=ibuf_send_next
634 call mpi_waitall(nrecv,recvrequest,recvstatus,ierrmpi)
635 deallocate(recvstatus,recvrequest)
640 call mpi_waitall(nsend,sendrequest,sendstatus,ierrmpi)
641 deallocate(sendbuffer,sendstatus,sendrequest)
649 if (nrecv>0)
deallocate(recvbuffer)
654 integer :: igrid, iigrid, iside
656 do iigrid=1,igridstail; igrid=igrids(iigrid);
658 if (
associated(
pface(iside,^
d,igrid)%face))
then
659 deallocate(
pface(iside,^
d,igrid)%face)
668 integer,
dimension(2^D&),
intent(in) :: child_igrid, child_ipe
669 integer,
intent(in) :: igrid, ipe
670 integer :: iside, i^
d, ic^
d
675 if (ic^
d==iside)
then
676 i^dd=
kr(^dd,^
d)*(2*iside-3);
694 integer,
intent(in) :: ichild
697 integer :: ineighbor,ipe_neighbor,ibufnext
698 integer :: iside,iotherside,i^
d,nx^
d
701 nx^
d=ixmhi^
d-ixmlo^
d+1;
711 i^dd=
kr(^dd,^
d)*(2*iside-3);
714 if (neighbor_pole(i^dd,ichild)/=0) cycle
722 if (ineighbor>0)
then
724 if (ipe_neighbor==
mype)
then
725 sfi%ws(ixmlo^
d-1^
d%ixM^t,^
d)=
pface(iotherside,^
d,ineighbor)%face(1^
d%1:nx^dd)
727 ibufnext=ibuf_recv+isize(^
d)
728 sfi%ws(ixmlo^
d-1^
d%ixM^t,^
d)=reshape(&
729 source=recvbuffer(ibuf_recv:ibufnext-1),&
730 shape=shape(sfi%ws(ixmlo^
d-1^
d%ixM^t,^
d)))
735 if (ipe_neighbor==
mype)
then
736 sfi%ws(ixmhi^
d^
d%ixM^t,^
d)=
pface(iotherside,^
d,ineighbor)%face(1^
d%1:nx^dd)
738 ibufnext=ibuf_recv+isize(^
d)
739 sfi%ws(ixmhi^
d^
d%ixM^t,^
d)=reshape(&
740 source=recvbuffer(ibuf_recv:ibufnext-1),&
741 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.
double precision, 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...