177integer,
intent(in) :: dir
178double precision,
dimension(0:nw+nwauxio),
intent(in):: normconv
181double precision :: dxdim^DM, xdim^LIM^DM
184double precision :: origin(1:3), spacing(1:3)
186integer :: wholeExtent(1:6), size_single, length, size_length
188integer,
dimension(ndim) :: myshape
190character(len=1024) :: filename, outfilehead, line
191character(len=name_len) :: wnamei(1:nw+nwauxio),xandwnamei(1:ndim+nw+nwauxio)
204 xdim^lim1=
xprob^lim2;
205 xdim^lim2=
xprob^lim3;
209 xdim^lim1=
xprob^lim1;
210 xdim^lim2=
xprob^lim3;
214 xdim^lim1=
xprob^lim1;
215 xdim^lim2=
xprob^lim2;
219 xdim^lim1=
xprob^lim2;
220 xdim^lim2=
xprob^lim3;
221 call mpistop(
"slice direction not clear in output_collapsed_vti")
228 xdim^lim1=
xprob^lim2;
231 xdim^lim1=
xprob^lim1;
234 xdim^lim1=
xprob^lim2;
235 call mpistop(
"slice direction not clear in output_collapsed_vti")
242myshape = shape(collapseddata)
247length = ^dm&myshape(^dm)*
248length = length*size_single
249{^dm&wholeextent(^dm*2)=myshape(^dm); }
250{^dm&spacing(^dm) = dxdim^dm; }
251{^dm&origin(^
d) = xdimmin^dm; }
255 if(.not.fileopen)
then
257 write(filename,
"(a,i1.1,a,i1.1,a,i4.4,a)") trim(
base_filename)//
'_d',dir,&
259 open(
unitcollapse,file=filename,status=
'unknown',form=
'formatted')
266write(
unitcollapse,
'(a)',advance=
'no')
'<VTKFile type="ImageData"'
268 write(
unitcollapse,
'(a)')
' version="0.1" byte_order="LittleEndian">'
270 write(
unitcollapse,
'(a)')
' version="0.1" byte_order="BigEndian">'
273write(
unitcollapse,
'(a,3(1pe14.6),a,6(i10),a,3(1pe14.6),a)')
' <ImageData Origin="',&
274 origin,
'" WholeExtent="',wholeextent,
'" Spacing="',spacing,
'">'
276write(
unitcollapse,
'(2a)')
'<DataArray type="Float32" Name="TIME" ',&
277 'NumberOfTuples="1" format="ascii">'
284 '<Piece Extent="',wholeextent,
'">'
292 '<DataArray type="Float32" Name="',trim(wnamei(iw)),&
293 '" format="appended" offset="',offset,
'"/>'
294 offset = offset + length + size_length
303open(
unitcollapse,file=filename,access=
'stream',form=
'unformatted',position=
'append')
313 write(
unitcollapse) real(collapseddata(iw)*normconv(iw))
316 write(
unitcollapse) (real(collapseddata(ix1,iw)*normconv(iw)),ix1=1,myshape(1))
319 write(
unitcollapse) ((real(collapseddata(ix1,ix2,iw)*normconv(iw)),ix1=1,&
320 myshape(1)),ix2=1,myshape(2))
325open(
unitcollapse,file=filename,status=
'unknown',form=
'formatted',position=
'append')
381integer,
intent(in) :: igrid, jgrid, dir
385integer :: ig^D, level, ig^Dtargetmin, ig^Dtargetmax
386integer :: ix^Dtarget^LIM, idim^Dtarget^LIM
387integer :: ixMdim^LLIM^D, ix^Dorig, ix^D
393{^d& ig^d = tree%node%ig^d; }
394level = tree%node%level
396nx^d=ixmhi^d-ixmlo^d+1;
401 ig^dtargetmin = int(dble(ig^d-1)/2.0d0**(level-
collapselevel))+1
402 ig^dtargetmax = ig^dtargetmin
410ix^dtargetmin = nx^d*(ig^dtargetmin-1)+1
411ix^dtargetmax = nx^d*ig^dtargetmax
419 idim1target^lim=ix2target^lim;
420 idim2target^lim=ix3target^lim;
421 ixmdim^llim1=
ixm^llim2;
422 ixmdim^llim2=
ixm^llim3;
426 idim1target^lim=ix1target^lim;
427 idim2target^lim=ix3target^lim;
428 ixmdim^llim1=
ixm^llim1;
429 ixmdim^llim2=
ixm^llim3;
433 idim1target^lim=ix1target^lim;
434 idim2target^lim=ix2target^lim;
435 ixmdim^llim1=
ixm^llim1;
436 ixmdim^llim2=
ixm^llim2;
438 call mpistop(
"slice direction not clear in integrate_subnode")
442 do ix1orig = ixmdimlo1,ixmdimhi1
443 do ix2orig = ixmdimlo2,ixmdimhi2
445 collapseddata(ix1,ix2,1:nw+
nwauxio) = collapseddata(ix1,ix2,1:nw+
nwauxio) &
451 do ix^dm = idim^dmtargetmin,idim^dmtargetmax\}
453 collapseddata(ix1,ix2,1:nw+
nwauxio) = collapseddata(ix1,ix2,1:nw+
nwauxio) + ps_sub(jgrid)%w(ix1orig,ix2orig,1:nw+
nwauxio)
461 idim1target^lim=ix2target^lim;
462 ixmdim^llim1=
ixm^llim2;
465 idim1target^lim=ix1target^lim;
466 ixmdim^llim1=
ixm^llim1;
468 call mpistop(
"slice direction not clear in integrate_subnode")
472 do ix1orig = ixmdimlo1,ixmdimhi1
474 collapseddata(ix1,1:nw+
nwauxio) = collapseddata(ix1,1:nw+
nwauxio) &
479 do ix^dm = idim^dmtargetmin,idim^dmtargetmax\}
481 collapseddata(ix1,1:nw+
nwauxio) = collapseddata(ix1,1:nw+
nwauxio) + ps_sub(jgrid)%w(ix1orig,1:nw+
nwauxio)
497integer,
intent(in) :: igrid, jgrid, dir
498double precision,
dimension(0:nw+nwauxio),
intent(out) :: normconv
500double precision :: dx^D
501double precision,
dimension(ixMlo^D-1:ixMhi^D,ndim) :: xC_TMP, xC
502double precision,
dimension(ixMlo^D:ixMhi^D,ndim) :: xCC_TMP, xCC
503double precision,
dimension(ixMlo^D-1:ixMhi^D,nw+nwauxio) :: wC_TMP
504double precision,
dimension(ixMlo^D:ixMhi^D,nw+nwauxio) :: wCC_TMP
505integer :: ixC^L, ixCC^L
520 ps_sub(jgrid)%w(ixmlo2:ixmhi2,ixmlo3:ixmhi3,1:nw+
nwauxio) = &
521 ps_sub(jgrid)%w(ixmlo2:ixmhi2,ixmlo3:ixmhi3,1:nw+
nwauxio) &
522 + wcc_tmp(ix,ixmlo2:ixmhi2,ixmlo3:ixmhi3,1:nw+
nwauxio) * dx1
527 ps_sub(jgrid)%w(ixmlo2:ixmhi2,ixmlo3:ixmhi3,iw) = &
528 ps_sub(jgrid)%w(ixmlo2:ixmhi2,ixmlo3:ixmhi3,iw) &
529 + wcc_tmp(ix,ixmlo2:ixmhi2,ixmlo3:ixmhi3,iw) * &
530 ps(igrid)%dx(ix,ixmlo2:ixmhi2,ixmlo3:ixmhi3,1)
534 ps_sub(jgrid)%x(ixmlo2:ixmhi2,ixmlo3:ixmhi3,1:
ndim) = &
535 ps(igrid)%x(ixmlo1,ixmlo2:ixmhi2,ixmlo3:ixmhi3,1:
ndim)
539 ps_sub(jgrid)%w(ixmlo1:ixmhi1,ixmlo3:ixmhi3,1:nw+
nwauxio) = &
540 ps_sub(jgrid)%w(ixmlo1:ixmhi1,ixmlo3:ixmhi3,1:nw+
nwauxio) &
541 + wcc_tmp(ixmlo1:ixmhi1,ix,ixmlo3:ixmhi3,1:nw+
nwauxio) * dx2
546 ps_sub(jgrid)%w(ixmlo1:ixmhi1,ixmlo3:ixmhi3,iw) = &
547 ps_sub(jgrid)%w(ixmlo1:ixmhi1,ixmlo3:ixmhi3,iw) &
548 + wcc_tmp(ixmlo1:ixmhi1,ix,ixmlo3:ixmhi3,iw) * &
549 ps(igrid)%dx(ixmlo1:ixmhi1,ix,ixmlo3:ixmhi3,2)
553 ps_sub(jgrid)%x(ixmlo1:ixmhi1,ixmlo3:ixmhi3,1:
ndim) = &
554 ps(igrid)%x(ixmlo1:ixmhi1,ixmlo2,ixmlo3:ixmhi3,1:
ndim)
558 ps_sub(jgrid)%w(ixmlo1:ixmhi1,ixmlo2:ixmhi2,1:nw+
nwauxio) = &
559 ps_sub(jgrid)%w(ixmlo1:ixmhi1,ixmlo2:ixmhi2,1:nw+
nwauxio) &
560 + wcc_tmp(ixmlo1:ixmhi1,ixmlo2:ixmhi2,ix,1:nw+
nwauxio) * dx3
565 ps_sub(jgrid)%w(ixmlo1:ixmhi1,ixmlo2:ixmhi2,iw) = &
566 ps_sub(jgrid)%w(ixmlo1:ixmhi1,ixmlo2:ixmhi2,iw) &
567 + wcc_tmp(ixmlo1:ixmhi1,ixmlo2:ixmhi2,ix,iw) * &
568 ps(igrid)%dx(ixmlo1:ixmhi1,ixmlo2:ixmhi2,ix,3)
572 ps_sub(jgrid)%x(ixmlo1:ixmhi1,ixmlo2:ixmhi2,1:
ndim) = &
573 ps(igrid)%x(ixmlo1:ixmhi1,ixmlo2:ixmhi2,ixmlo3,1:
ndim)
575 print*,
'subnode, dir: ', dir
576 call mpistop(
"slice direction not clear in collapse_subnode")
584 ps_sub(jgrid)%w(ixmlo2:ixmhi2,1:nw+
nwauxio) = &
585 ps_sub(jgrid)%w(ixmlo2:ixmhi2,1:nw+
nwauxio) &
586 + wcc_tmp(ix,ixmlo2:ixmhi2,1:nw+
nwauxio) * dx1
591 ps_sub(jgrid)%w(ixmlo2:ixmhi2,iw) = &
592 ps_sub(jgrid)%w(ixmlo2:ixmhi2,iw) &
593 + wcc_tmp(ix,ixmlo2:ixmhi2,iw) * &
594 ps(igrid)%dx(ix,ixmlo2:ixmhi2,1)
598 ps_sub(jgrid)%x(ixmlo2:ixmhi2,1:
ndim) = &
599 ps(igrid)%x(ixmlo1,ixmlo2:ixmhi2,1:
ndim)
603 ps_sub(jgrid)%w(ixmlo1:ixmhi1,1:nw+
nwauxio) = &
604 ps_sub(jgrid)%w(ixmlo1:ixmhi1,1:nw+
nwauxio) &
605 + wcc_tmp(ixmlo1:ixmhi1,ix,1:nw+
nwauxio) * dx2
610 ps_sub(jgrid)%w(ixmlo1:ixmhi1,iw) = &
611 ps_sub(jgrid)%w(ixmlo1:ixmhi1,iw) &
612 + wcc_tmp(ixmlo1:ixmhi1,ix,iw) * &
613 ps(igrid)%dx(ixmlo1:ixmhi1,ix,2)
617 ps_sub(jgrid)%x(ixmlo1:ixmhi1,1:
ndim) = &
618 ps(igrid)%x(ixmlo1:ixmhi1,ixmlo2,1:
ndim)
620 call mpistop(
"slice direction not clear in collapse_subnode")
631 ps_sub(jgrid)%w(iw) = ps_sub(jgrid)%w(iw) + wcc_tmp(ix,iw) * ps(igrid)%dx(ix,1)
635ps_sub(jgrid)%x(1:
ndim) = ps(igrid)%x(ixmlo1,1:
ndim)