25 integer,
private :: itag
54 integer,
intent(in) :: dir
55 double precision,
intent(in) :: xslice
57 integer :: Njgrid, jgrid
58 integer,
dimension(ndim-1) :: ixsubGlo, ixsubGhi
59 integer,
dimension(ndim-1) :: ixsubMlo, ixsubMhi
60 integer :: size_subblock_io, nx^D, slice_fh, nwexpand
61 integer :: type_subblock_io, type_subblockC_io, type_subblock_x_io, type_subblockC_x_io
62 integer,
dimension(ndim) :: sizes, subsizes, start
63 double precision,
dimension(0:nw+nwauxio) :: normconv
66 nx^d=ixmhi^d-ixmlo^d+1;
82 if(xslice<xprobmin^d.or.xslice>xprobmax^d) &
83 call mpistop(
"slice out of bounds")
94 sizes(1) = ixghi2; sizes(2) = ixghi3;
95 ixsubglo(1) = ixglo2; ixsubglo(2) = ixglo3;
96 ixsubghi(1) = ixghi2; ixsubghi(2) = ixghi3;
97 subsizes(1)=nx2;subsizes(2)=nx3;
98 start(1)=ixmlo2-1;start(2)=ixmlo3-1;
101 sizes(1) = ixghi1; sizes(2) = ixghi3;
102 ixsubglo(1) = ixglo1; ixsubglo(2) = ixglo3;
103 ixsubghi(1) = ixghi1; ixsubghi(2) = ixghi3;
104 subsizes(1)=nx1;subsizes(2)=nx3;
105 start(1)=ixmlo1-1;start(2)=ixmlo3-1;
108 ixsubglo(1) = ixglo1; ixsubglo(2) = ixglo2;
109 ixsubghi(1) = ixghi1; ixsubghi(2) = ixghi2;
110 sizes(1) = ixghi1; sizes(2) = ixghi2;
111 subsizes(1)=nx1;subsizes(2)=nx2;
112 start(1)=ixmlo1-1;start(2)=ixmlo2-1;
115 call mpistop(
"slice direction not clear in put_slice")
121 ixsubglo(1) = ixglo2; ixsubghi(1) = ixghi2;
127 ixsubglo(1) = ixglo1; ixsubghi(1) = ixghi1;
133 call mpistop(
"slice direction not clear in put_slice")
141 {^de&ixsubmlo(^de-1) = ixsubglo(^de-1)+
nghostcells;}
142 {^de&ixsubmhi(^de-1) = ixsubghi(^de-1)-
nghostcells;}
145 sizes(
ndim)=nw+nwexpand
146 subsizes(
ndim)=nw+nwexpand
150 call mpi_type_create_subarray(
ndim,sizes,subsizes,start, &
151 mpi_order_fortran,mpi_double_precision, &
153 call mpi_type_commit(type_subblock_io,
ierrmpi)
158 call mpi_type_create_subarray(
ndim,sizes,subsizes,start, &
159 mpi_order_fortran,mpi_double_precision, &
161 call mpi_type_commit(type_subblock_x_io,
ierrmpi)
165 subsizes(1:
ndim-1) = subsizes(1:
ndim-1) + 1
166 start(1:
ndim-1) = start(1:
ndim-1) - 1
167 sizes(
ndim)=nw+nwexpand
168 subsizes(
ndim)=nw+nwexpand
171 call mpi_type_create_subarray(
ndim,sizes,subsizes,start, &
172 mpi_order_fortran,mpi_double_precision, &
174 call mpi_type_commit(type_subblockc_io,
ierrmpi)
179 call mpi_type_create_subarray(
ndim,sizes,subsizes,start, &
180 mpi_order_fortran,mpi_double_precision, &
182 call mpi_type_commit(type_subblockc_x_io,
ierrmpi)
197 case (
'vtu',
'vtuCC')
206 call mpi_type_free(type_subblock_io,
ierrmpi)
207 call mpi_type_free(type_subblock_x_io,
ierrmpi)
208 call mpi_type_free(type_subblockc_io,
ierrmpi)
209 call mpi_type_free(type_subblockc_x_io,
ierrmpi)
217 character(len=1024) :: filename, xlabel
218 character(len=79) :: xxlabel
220 character(len=name_len) :: wnamei(1:nw+nwauxio),xandwnamei(1:ndim+nw+nwauxio)
221 character(len=1024) :: outfilehead
222 integer :: status(MPI_STATUS_SIZE), ipe
226 inquire(slice_fh,opened=fileopen)
227 if(.not.fileopen)
then
229 write(xlabel,
"(D9.2)")xslice
232 write(xxlabel(1:1),
"(a)")
"+"
234 write(filename,
"(a,i1.1,a,i4.4,a)") trim(
base_filename)//
'_d',dir,
'_x'//trim(xxlabel)//
'_n',
slicenext,
'.vtu'
235 open(slice_fh,file=filename,status=
'unknown',form=
'formatted')
240 write(slice_fh,
'(a)')
'<?xml version="1.0"?>'
241 write(slice_fh,
'(a)',advance=
'no')
'<VTKFile type="UnstructuredGrid"'
243 write(slice_fh,
'(a)')
' version="0.1" byte_order="LittleEndian">'
245 write(slice_fh,
'(a)')
' version="0.1" byte_order="BigEndian">'
247 write(slice_fh,
'(a)')
' <UnstructuredGrid>'
248 write(slice_fh,
'(a)')
'<FieldData>'
249 write(slice_fh,
'(2a)')
'<DataArray type="Float32" Name="TIME" ',&
250 'NumberOfTuples="1" format="ascii">'
252 write(slice_fh,
'(a)')
'</DataArray>'
253 write(slice_fh,
'(a)')
'</FieldData>'
271 if (ipe ==
mype )
then
272 call mpi_send(ps_sub(jgrid)%x,1,type_subblock_x_io,0,itag,
icomm,
ierrmpi)
273 call mpi_send(ps_sub(jgrid)%w,1,type_subblock_io,0,itag+1,
icomm,
ierrmpi)
274 call mpi_send(ps_sub(jgrid)%xC,1,type_subblockc_x_io,0,itag+2,
icomm,
ierrmpi)
275 call mpi_send(ps_sub(jgrid)%wC,1,type_subblockc_io,0,itag+3,
icomm,
ierrmpi)
276 call mpi_send(normconv,nw+nwauxio+1,mpi_double_precision,0,itag+4,
icomm,
ierrmpi)
279 call mpi_recv(ps_sub(njgrid+1)%x,1,type_subblock_x_io,ipe,itag,
icomm,status,
ierrmpi)
280 call mpi_recv(ps_sub(njgrid+1)%w,1,type_subblock_io,ipe,itag+1,
icomm,status,
ierrmpi)
281 call mpi_recv(ps_sub(njgrid+1)%xC,1,type_subblockc_x_io,ipe,itag+2,
icomm,status,
ierrmpi)
282 call mpi_recv(ps_sub(njgrid+1)%wC,1,type_subblockc_io,ipe,itag+3,
icomm,status,
ierrmpi)
283 call mpi_recv(normconv,nw+nwauxio+1,mpi_double_precision,ipe,&
293 write(slice_fh,
'(a)')
'</UnstructuredGrid>'
294 write(slice_fh,
'(a)')
'</VTKFile>'
305 integer,
intent(in) :: jgrid, slice_fh
306 character(len=name_len),
intent(in) :: wnamei(1:nw+nwauxio)
310 integer :: ixC^L, ixCC^L, nc, np, iw
311 integer :: nx^DM, nxC^DM, icell, ix^DM
312 double precision :: x_VTK(1:3)
314 double precision,
parameter :: minvalue = 1.0d-99, maxvalue = 1.0d+99
316 {^dm&ixccmin^dm = ixsubmlo(^dm);}
317 {^dm&ixccmax^dm = ixsubmhi(^dm);}
318 {^dm&ixcmin^dm = ixsubmlo(^dm)-1;}
319 {^dm&ixcmax^dm = ixsubmhi(^dm);}
321 nx^dm=ixccmax^dm-ixccmin^dm+1;
327 write(slice_fh,
'(a,i7,a,i7,a)') &
328 '<Piece NumberOfPoints="',np,
'" NumberOfCells="',nc,
'">'
336 write(slice_fh,
'(a)')
'<CellData>'
341 write(slice_fh,
'(a,a,a)')&
342 '<DataArray type="Float64" Name="',trim(wnamei(iw)),
'" format="ascii">'
343 write(slice_fh,
'(200(1pe14.6))') {^dm&(|}
roundoff_minmax(ps_sub(jgrid)%w(ix^dm,iw)*normconv(iw),minvalue,maxvalue),{ix^dm=ixccmin^dm,ixccmax^dm)}
344 write(slice_fh,
'(a)')
'</DataArray>'
346 write(slice_fh,
'(a)')
'</CellData>'
350 write(slice_fh,
'(a)')
'<PointData>'
355 write(slice_fh,
'(a,a,a)')&
356 '<DataArray type="Float64" Name="',trim(wnamei(iw)),
'" format="ascii">'
357 write(slice_fh,
'(200(1pe14.6))') {^dm&(|}
roundoff_minmax(ps_sub(jgrid)%wC(ix^dm,iw)*normconv(iw),minvalue,maxvalue),{ix^dm=ixcmin^dm,ixcmax^dm)}
358 write(slice_fh,
'(a)')
'</DataArray>'
360 write(slice_fh,
'(a)')
'</PointData>'
371 write(slice_fh,
'(a)')
'<Points>'
372 write(slice_fh,
'(a)')
'<DataArray type="Float32" NumberOfComponents="3" format="ascii">'
374 {
do ix^dmb=ixcmin^dmb,ixcmax^dmb \}
376 x_vtk(1:
ndim)=ps_sub(jgrid)%xC(ix^dm,1:
ndim)*normconv(0);
377 write(slice_fh,
'(3(1pe14.6))') x_vtk
379 write(slice_fh,
'(a)')
'</DataArray>'
380 write(slice_fh,
'(a)')
'</Points>'
388 write(slice_fh,
'(a)')
'<Cells>'
391 write(slice_fh,
'(a)')
'<DataArray type="Int32" Name="connectivity" format="ascii">'
393 {^dm&
do ix^dmb=1,nx^dmb\}
395 write(slice_fh,
'(2(i7,1x))')ix1-1,ix1
397 write(slice_fh,
'(4(i7,1x))')(ix2-1)*nxc1+ix1-1, &
398 (ix2-1)*nxc1+ix1,ix2*nxc1+ix1-1,ix2*nxc1+ix1
401 write(slice_fh,
'(a)')
'</DataArray>'
404 write(slice_fh,
'(a)')
'<DataArray type="Int32" Name="offsets" format="ascii">'
406 write(slice_fh,
'(i7)') icell*(2**(^nd-1))
408 write(slice_fh,
'(a)')
'</DataArray>'
411 write(slice_fh,
'(a)')
'<DataArray type="Int32" Name="types" format="ascii">'
413 {^iftwod vtk_type=3 \}
414 {^ifthreed vtk_type=8 \}
416 write(slice_fh,
'(i2)') vtk_type
418 write(slice_fh,
'(a)')
'</DataArray>'
420 write(slice_fh,
'(a)')
'</Cells>'
424 write(slice_fh,
'(a)')
'</Piece>'
432 character(len=1024) :: filename, xlabel
433 character(len=79) :: xxlabel
435 character(len=name_len) :: wnamei(1:nw+nwauxio),xandwnamei(1:ndim+nw+nwauxio)
436 character(len=1024) :: outfilehead
437 integer :: iw, ipe, itag
438 character(len=1024) :: line
439 integer :: status(MPI_STATUS_SIZE)
442 inquire(slice_fh,opened=fileopen)
443 if(.not.fileopen)
then
445 write(xlabel,
"(D9.2)")xslice
448 write(xxlabel(1:1),
"(a)")
"+"
450 write(filename,
"(a,i1.1,a,i4.4,a)") trim(base_filename)//
'_d',dir,
'_x'//trim(xxlabel)//
'_n',
slicenext,
'.csv'
451 open(slice_fh,file=filename,status=
'unknown',form=
'formatted')
456 do iw=1,ndim+nw+nwauxio-1
457 line = trim(line)//trim(xandwnamei(iw))//
', '
459 line = trim(line)//trim(xandwnamei(ndim+nw+nwauxio))
460 write(slice_fh,
'(a)')trim(line)
473 do jgrid=1,morton_sub_stop(ipe)-morton_sub_start(ipe)+1
474 itag=morton_sub_start(ipe)+jgrid-1
475 if (ipe == mype )
then
476 call mpi_send(ps_sub(jgrid)%x,1,type_subblock_x_io,0,itag,icomm,ierrmpi)
477 call mpi_send(ps_sub(jgrid)%w,1,type_subblock_io,0,itag,icomm,ierrmpi)
478 call mpi_send(normconv,nw+nwauxio+1,mpi_double_precision,0,itag,icomm,ierrmpi)
481 call mpi_recv(ps_sub(njgrid+1)%x,1,type_subblock_x_io,ipe,itag,icomm,status,ierrmpi)
482 call mpi_recv(ps_sub(njgrid+1)%w,1,type_subblock_io,ipe,itag,icomm,status,ierrmpi)
483 call mpi_recv(normconv,nw+nwauxio+1,mpi_double_precision,ipe,&
484 itag,icomm,status,ierrmpi)
499 integer,
intent(in) :: jout, file_handle
501 character(len=1024) ::line, data
502 integer :: ix^D,idir,iw
503 double precision,
parameter :: minvalue = 1.0d-99, maxvalue = 1.0d+99
506 do ix2=ixsubmlo(2),ixsubmhi(2)
507 do ix1=ixsubmlo(1),ixsubmhi(1)
510 do ix1=ixsubmlo(1),ixsubmhi(1)
516 write(
data,
"(es14.6)")
roundoff_minmax(ps_sub(jout)%x(ix1,ix2,idir),minvalue,maxvalue)
519 write(
data,
"(es14.6)")
roundoff_minmax(ps_sub(jout)%x(ix1,idir),minvalue,maxvalue)
522 write(
data,
"(es14.6)")
roundoff_minmax(ps_sub(jout)%x(idir),minvalue,maxvalue)
525 line = trim(line)//trim(data)//
', '
527 do iw = 1,nw+nwauxio-1
529 write(
data,
"(es14.6)")
roundoff_minmax(ps_sub(jout)%w(ix1,ix2,iw)*normconv(iw),minvalue,maxvalue)
532 write(
data,
"(es14.6)")
roundoff_minmax(ps_sub(jout)%w(ix1,iw)*normconv(iw),minvalue,maxvalue)
535 write(
data,
"(es14.6)")
roundoff_minmax(ps_sub(jout)%w(iw)*normconv(iw),minvalue,maxvalue)
537 line = trim(line)//trim(data)//
', '
540 write(
data,
"(es14.6)")
roundoff_minmax(ps_sub(jout)%w(ix1,ix2,nw+nwauxio)*normconv(nw+nwauxio),minvalue,maxvalue)
543 write(
data,
"(es14.6)")
roundoff_minmax(ps_sub(jout)%w(ix1,nw+nwauxio)*normconv(nw+nwauxio),minvalue,maxvalue)
545 line = trim(line)//trim(data)
546 write(file_handle,
'(a)')trim(line)
559 integer,
dimension(max_blocks) :: iorequest
560 integer,
dimension(MPI_STATUS_SIZE,max_blocks) :: iostatus
561 integer(kind=MPI_OFFSET_KIND) :: offset
563 character(len=1024) :: filename, xlabel
564 character(len=79) :: xxlabel
565 integer :: amode, status(MPI_STATUS_SIZE), iwrite
567 nsubleafs=morton_sub_stop(npe-1)
569 write(xlabel,
"(D9.2)")xslice
572 write(xxlabel(1:1),
"(a)")
"+"
574 write(filename,
"(a,i1.1,a,i4.4,a)") trim(base_filename)//
'_d',dir,
'_x'//trim(xxlabel)//
'_n',
slicenext,
'.dat'
577 open(unit=slice_fh,file=filename,status=
'replace')
581 amode=ior(mpi_mode_create,mpi_mode_wronly)
582 call mpi_file_open(icomm,filename,amode,mpi_info_null,slice_fh,ierrmpi)
583 iorequest=mpi_request_null
588 offset=int(size_subblock_io,kind=mpi_offset_kind) &
589 *int(morton_sub_start(mype)+jgrid-2,kind=mpi_offset_kind)
590 call mpi_file_iwrite_at(slice_fh,offset,ps_sub(jgrid)%w,1,type_subblock_io, &
591 iorequest(iwrite),ierrmpi)
594 if (iwrite>0)
call mpi_waitall(iwrite,iorequest,iostatus,ierrmpi)
595 call mpi_barrier(icomm, ierrmpi)
596 call mpi_file_close(slice_fh,ierrmpi)
599 amode=ior(mpi_mode_append,mpi_mode_wronly)
600 call mpi_file_open(mpi_comm_self,filename,amode,mpi_info_null, &
605 {
call mpi_file_write(slice_fh,subsizes(^de-1),1,mpi_integer,status,ierrmpi)\}
608 call mpi_file_write(slice_fh,nsubleafs,1,mpi_integer,status,ierrmpi)
609 call mpi_file_write(slice_fh,levmax_sub,1,mpi_integer,status,ierrmpi)
610 call mpi_file_write(slice_fh,ndim-1,1,mpi_integer,status,ierrmpi)
611 call mpi_file_write(slice_fh,ndir,1,mpi_integer,status,ierrmpi)
612 call mpi_file_write(slice_fh,nw,1,mpi_integer,status,ierrmpi)
614 call mpi_file_write(slice_fh,it,1,mpi_integer,status,ierrmpi)
615 call mpi_file_write(slice_fh,global_time,1,mpi_double_precision,status,ierrmpi)
617 call mpi_file_close(slice_fh,ierrmpi)
626 character(len=name_len) :: wnamei(1:nw+nwauxio),xandwnamei(1:ndim+nw+nwauxio)
627 character(len=1024) :: outfilehead
628 logical,
save :: opened=.false.
629 character(len=1024) ::line, data
630 character(len=1024) :: filename, xlabel
631 character(len=79) :: xxlabel
632 integer :: amode, iwrite, status(MPI_STATUS_SIZE)
636 write(xlabel,
"(D9.2)")xslice
639 write(xxlabel(1:1),
"(a)")
"+"
641 write(filename,
"(a,i1.1,a,i4.4,a)") trim(base_filename)//
'_d',dir,
'_x'//trim(xxlabel)//
'.csv'
644 if (.not. opened .and. mype==0)
then
645 amode=ior(mpi_mode_create,mpi_mode_wronly)
646 amode=ior(amode,mpi_mode_append)
647 call mpi_file_open(mpi_comm_self,filename,amode, &
648 mpi_info_null,slice_fh,ierrmpi)
652 do iw=1,nw+nwauxio+ndim
653 line = trim(line)//
', '//trim(xandwnamei(iw))
656 call mpi_file_write(slice_fh,line,len_trim(line), &
657 mpi_character,status,ierrmpi)
658 call mpi_file_write(slice_fh,achar(10),1,mpi_character,status,ierrmpi)
659 call mpi_file_close(slice_fh, ierrmpi)
663 call mpi_barrier(icomm,ierrmpi)
667 amode=ior(mpi_mode_create,mpi_mode_wronly)
668 amode=ior(amode,mpi_mode_append)
669 call mpi_file_open(mpi_comm_self,filename,amode, &
670 mpi_info_null,slice_fh,ierrmpi)
673 write(
data,
"(es14.6)")global_time
675 write(
data,
"(es14.6)")ps_sub(1)%x
676 line = trim(line)//
', '//trim(data)
678 write(
data,
"(es14.6)")ps_sub(1)%w(iw)*normconv(iw)
679 line = trim(line)//
', '//trim(data)
682 call mpi_file_write(slice_fh,trim(line),len_trim(line), &
683 mpi_character,status,ierrmpi)
684 call mpi_file_write(slice_fh,achar(10),1,mpi_character,status,ierrmpi)
685 call mpi_file_close(slice_fh, ierrmpi)
695 integer,
intent(in) :: dir
696 double precision,
intent(in) :: xslice
697 integer,
intent(in) :: file_handle
698 logical,
intent(in) :: writeonly
699 double precision,
dimension(0:nw+nwauxio),
intent(out) :: normconv
701 integer :: ig^D, jgrid, slice_fh, ipe, mylevmax
702 integer,
dimension(nlevelshi) :: igslice
735 call mpistop(
"slice direction not clear in select_slice")
751 call mpistop(
"slice direction not clear in select_slice")
759 if (.not.writeonly)
then
782 integer,
dimension(MPI_STATUS_SIZE) :: status
785 call mpi_file_write(file_handle,tree%node%leaf,1,mpi_logical, &
789 if (tree%node%leaf)
then
790 if (tree%node%ipe ==
mype.and..not.writeonly)
then
791 mylevmax = max(mylevmax,tree%node%level)
792 call fill_subnode(tree%node%igrid,tree%node%active,jgrid,dir,xslice,normconv)
801 ic^d = igslice(tree%node%level+1) - 2 * tree%node%ig^d + 2
804 call mpistop(
"slice direction not clear in traverse_slice")
829 call mpistop(
"slice direction not clear in traverse_slice")
843 call mpistop(
"slice direction not clear in traverse_slice")
857 integer,
intent(in) :: igrid, dir
858 integer,
intent(inout) :: jgrid
859 logical,
intent(in) :: active
860 double precision,
intent(in) :: xslice
861 double precision,
dimension(0:nw+nwauxio),
intent(out) :: normconv
863 double precision,
dimension(ixMlo^D-1:ixMhi^D,ndim) :: xC_TMP, xC
864 double precision,
dimension(ixMlo^D:ixMhi^D,ndim) :: xCC_TMP, xCC
865 double precision,
dimension(ixMlo^D-1:ixMhi^D,nw+nwauxio) :: wC_TMP
866 double precision,
dimension(ixMlo^D:ixMhi^D,nw+nwauxio) :: wCC_TMP
867 double precision,
dimension(ixG^T) :: x_save
868 integer :: ixslice, nwexpand, ixC^L, ixCC^L
869 logical :: mask(ixG^T)
891 ixslice = minloc(dabs(xslice-ps(igrid)%x(:,dir)),1,mask(:))
896 ixslice = minloc(dabs(xslice-ps(igrid)%x(:,ixmlo2,dir)),1,mask(:,ixmlo2))
898 ixslice = minloc(dabs(xslice-ps(igrid)%x(ixmlo1,:,dir)),1,mask(ixmlo1,:))
900 call mpistop(
"slice direction not clear in fill_subnode")
906 ixslice = minloc(dabs(xslice-ps(igrid)%x(:,ixmlo2,ixmlo3,dir)),1,mask(:,ixmlo2,ixmlo3))
908 ixslice = minloc(dabs(xslice-ps(igrid)%x(ixmlo1,:,ixmlo3,dir)),1,mask(ixmlo1,:,ixmlo3))
910 ixslice = minloc(dabs(xslice-ps(igrid)%x(ixmlo1,ixmlo2,:,dir)),1,mask(ixmlo1,ixmlo2,:))
912 call mpistop(
"slice direction not clear in fill_subnode")
918 xc(:^
d&,dir) = xslice
919 xcc(:^
d&,dir) = xslice
927 ps_sub(jgrid)%w(1:nw+nwexpand) = wcc_tmp(ixslice,1:nw+nwexpand)
928 ps_sub(jgrid)%x(1:
ndim) = xcc_tmp(ixslice,1:
ndim)
929 ps_sub(jgrid)%wC(1:nw+nwexpand) = wc_tmp(ixslice,1:nw+nwexpand)
930 ps_sub(jgrid)%xC(1:
ndim) = xc_tmp(ixslice,1:
ndim)
935 ps_sub(jgrid)%w(ixccmin2:ixccmax2,1:nw+nwexpand) &
936 = wcc_tmp(ixslice,ixccmin2:ixccmax2,1:nw+nwexpand)
937 ps_sub(jgrid)%x(ixccmin2:ixccmax2,1:
ndim) &
938 = xcc_tmp(ixslice,ixccmin2:ixccmax2,1:
ndim)
939 ps_sub(jgrid)%wC(ixcmin2:ixcmax2,1:nw+nwexpand) &
940 = wc_tmp(ixslice,ixcmin2:ixcmax2,1:nw+nwexpand)
941 ps_sub(jgrid)%xC(ixcmin2:ixcmax2,1:
ndim) &
942 = xc_tmp(ixslice,ixcmin2:ixcmax2,1:
ndim)
944 ps_sub(jgrid)%w(ixccmin1:ixccmax1,1:nw+nwexpand) &
945 = wcc_tmp(ixccmin1:ixccmax1,ixslice,1:nw+nwexpand)
946 ps_sub(jgrid)%x(ixccmin1:ixccmax1,1:
ndim) &
947 = xcc_tmp(ixccmin1:ixccmax1,ixslice,1:
ndim)
948 ps_sub(jgrid)%wC(ixcmin1:ixcmax1,1:nw+nwexpand) &
949 = wc_tmp(ixcmin1:ixcmax1,ixslice,1:nw+nwexpand)
950 ps_sub(jgrid)%xC(ixcmin1:ixcmax1,1:
ndim) &
951 = xc_tmp(ixcmin1:ixcmax1,ixslice,1:
ndim)
953 call mpistop(
"slice direction not clear in fill_subnode")
959 ps_sub(jgrid)%w(ixccmin2:ixccmax2,ixccmin3:ixccmax3,1:nw+nwexpand) = &
960 wcc_tmp(ixslice,ixccmin2:ixccmax2,ixccmin3:ixccmax3,1:nw+nwexpand)
961 ps_sub(jgrid)%x(ixccmin2:ixccmax2,ixccmin3:ixccmax3,1:
ndim) = &
962 xcc_tmp(ixslice,ixccmin2:ixccmax2,ixccmin3:ixccmax3,1:
ndim)
963 ps_sub(jgrid)%wC(ixcmin2:ixcmax2,ixcmin3:ixcmax3,1:nw+nwexpand) = &
964 wc_tmp(ixslice,ixcmin2:ixcmax2,ixcmin3:ixcmax3,1:nw+nwexpand)
965 ps_sub(jgrid)%xC(ixcmin2:ixcmax2,ixcmin3:ixcmax3,1:
ndim) = &
966 xc_tmp(ixslice,ixcmin2:ixcmax2,ixcmin3:ixcmax3,1:
ndim)
968 ps_sub(jgrid)%w(ixccmin1:ixccmax1,ixccmin3:ixccmax3,1:nw+nwexpand) = &
969 wcc_tmp(ixccmin1:ixccmax1,ixslice,ixccmin3:ixccmax3,1:nw+nwexpand)
970 ps_sub(jgrid)%x(ixccmin1:ixccmax1,ixccmin3:ixccmax3,1:
ndim) = &
971 xcc_tmp(ixccmin1:ixccmax1,ixslice,ixccmin3:ixccmax3,1:
ndim)
972 ps_sub(jgrid)%wC(ixcmin1:ixcmax1,ixcmin3:ixcmax3,1:nw+nwexpand) = &
973 wc_tmp(ixcmin1:ixcmax1,ixslice,ixcmin3:ixcmax3,1:nw+nwexpand)
974 ps_sub(jgrid)%xC(ixcmin1:ixcmax1,ixcmin3:ixcmax3,1:
ndim) = &
975 xc_tmp(ixcmin1:ixcmax1,ixslice,ixcmin3:ixcmax3,1:
ndim)
977 ps_sub(jgrid)%w(ixccmin1:ixccmax1,ixccmin2:ixccmax2,1:nw+nwexpand) = &
978 wcc_tmp(ixccmin1:ixccmax1,ixccmin2:ixccmax2,ixslice,1:nw+nwexpand)
979 ps_sub(jgrid)%x(ixccmin1:ixccmax1,ixccmin2:ixccmax2,1:
ndim) = &
980 xcc_tmp(ixccmin1:ixccmax1,ixccmin2:ixccmax2,ixslice,1:
ndim)
981 ps_sub(jgrid)%wC(ixcmin1:ixcmax1,ixcmin2:ixcmax2,1:nw+nwexpand) = &
982 wc_tmp(ixcmin1:ixcmax1,ixcmin2:ixcmax2,ixslice,1:nw+nwexpand)
983 ps_sub(jgrid)%xC(ixcmin1:ixcmax1,ixcmin2:ixcmax2,1:
ndim) = &
984 xc_tmp(ixcmin1:ixcmax1,ixcmin2:ixcmax2,ixslice,1:
ndim)
986 call mpistop(
"slice direction not clear in fill_subnode")
994 integer,
intent(in) :: jgrid, dir, nwexpand
998 allocate(ps_sub(jgrid)%w(1:nw+nwexpand),ps_sub(jgrid)%x(1:
ndim))
999 allocate(ps_sub(jgrid)%wC(1:nw+nwexpand),ps_sub(jgrid)%xC(1:
ndim))
1004 allocate(ps_sub(jgrid)%w(ixglo2:ixghi2,1:nw+nwexpand),&
1005 ps_sub(jgrid)%x(ixglo2:ixghi2,1:
ndim), &
1006 ps_sub(jgrid)%wC(ixglo2:ixghi2,1:nw+nwexpand),&
1007 ps_sub(jgrid)%xC(ixglo2:ixghi2,1:
ndim))
1009 allocate(ps_sub(jgrid)%w(ixglo1:ixghi1,1:nw+nwexpand),&
1010 ps_sub(jgrid)%x(ixglo1:ixghi1,1:
ndim), &
1011 ps_sub(jgrid)%wC(ixglo1:ixghi1,1:nw+nwexpand),&
1012 ps_sub(jgrid)%xC(ixglo1:ixghi1,1:
ndim))
1014 call mpistop(
"slice direction not clear in alloc_subnode")
1020 allocate(ps_sub(jgrid)%w(ixglo2:ixghi2,ixglo3:ixghi3,1:nw+nwexpand),&
1021 ps_sub(jgrid)%x(ixglo2:ixghi2,ixglo3:ixghi3,1:
ndim), &
1022 ps_sub(jgrid)%wC(ixglo2:ixghi2,ixglo3:ixghi3,1:nw+nwexpand),&
1023 ps_sub(jgrid)%xC(ixglo2:ixghi2,ixglo3:ixghi3,1:
ndim))
1025 allocate(ps_sub(jgrid)%w(ixglo1:ixghi1,ixglo3:ixghi3,1:nw+nwexpand),&
1026 ps_sub(jgrid)%x(ixglo1:ixghi1,ixglo3:ixghi3,1:
ndim), &
1027 ps_sub(jgrid)%wC(ixglo1:ixghi1,ixglo3:ixghi3,1:nw+nwexpand),&
1028 ps_sub(jgrid)%xC(ixglo1:ixghi1,ixglo3:ixghi3,1:
ndim))
1030 allocate(ps_sub(jgrid)%w(ixglo1:ixghi1,ixglo2:ixghi2,1:nw+nwexpand),&
1031 ps_sub(jgrid)%x(ixglo1:ixghi1,ixglo2:ixghi2,1:
ndim), &
1032 ps_sub(jgrid)%wC(ixglo1:ixghi1,ixglo2:ixghi2,1:nw+nwexpand),&
1033 ps_sub(jgrid)%xC(ixglo1:ixghi1,ixglo2:ixghi2,1:
ndim))
1035 call mpistop(
"slice direction not clear in alloc_subnode")
1042 integer,
intent(in) :: jgrid
1045 call mpistop(
"trying to delete a non-existing grid in dealloc_subnode")
1048 deallocate(ps_sub(jgrid)%w,ps_sub(jgrid)%x,ps_sub(jgrid)%wC,ps_sub(jgrid)%xC)
1058 integer,
intent(in) :: igrid,jgrid,dir
1085 call mpistop(
"slice direction not clear in fill_subnode_info")
1099 call mpistop(
"slice direction not clear in fill_subnode_info")
1109 integer,
intent(in) :: dir
1110 double precision,
intent(in) :: x
1111 integer,
dimension(nlevelshi),
intent(out) :: igslice
1116 call mpistop(
"get_igslice: your slice position is NaN!")
1121 igslice(level) = int((x-xprobmin^
d)/
dg^
d(level))+1
1123 if (x>=xprobmax^
d) igslice(level) = int((xprobmax^
d-xprobmin^
d)/
dg^
d(level))
1125 if (x<=xprobmin^
d) igslice(level) = 1
1128 call mpistop(
"slice direction not clear in get_igslice")
1134 double precision,
intent(in) :: val, minval, maxval
subroutine mpistop(message)
Exit MPI-AMRVAC with an error message.
recursive subroutine traverse_slice(tree)
subroutine put_slice_zerod
subroutine write_slice_vtk(jgrid, slice_fh, wnamei)
subroutine put_slice_line(jout, file_handle)
Module with basic data types used in amrvac.
integer, parameter size_double
Size (in bytes) of double precision real.
Handles computations for coordinates and variables in output.
subroutine calc_grid(qunit, igrid, xC, xCC, xC_TMP, xCC_TMP, wC_TMP, wCC_TMP, normconv, ixCL, ixCCL, first)
Compute both corner as well as cell-centered values for output.
subroutine getheadernames(wnamei, xandwnamei, outfilehead)
get all variables names
subroutine calc_x(igrid, xC, xCC)
computes cell corner (xC) and cell center (xCC) coordinates
Module with basic grid data structures.
integer, dimension(:), allocatable, save morton_sub_start
integer, dimension(:), allocatable, save morton_sub_stop
type(tree_node_ptr), dimension(:^d &), allocatable, save tree_root
Pointers to the coarse grid.
This module contains definitions of global parameters and variables and some generic functions/subrou...
integer, parameter unitslice
double precision global_time
The global simulation time.
double precision, dimension(:), allocatable dg
extent of grid blocks in domain per dimension, in array over levels
integer, parameter ndim
Number of spatial dimensions for grid variables.
double precision time_convert_factor
Conversion factor for time unit.
integer icomm
The MPI communicator.
integer mype
The rank of the current MPI task.
integer, parameter plevel_
integer, dimension(:), allocatable, parameter d
integer ixm
the mesh range (within a block with ghost cells)
integer ierrmpi
A global MPI error return code.
integer npe
The number of MPI tasks.
integer nwauxio
Number of auxiliary variables that are only included in output.
logical, dimension(:), allocatable w_write
double precision, dimension(:,:), allocatable rnode
Corner coordinates.
integer nghostcells
Number of ghost cells surrounding a grid.
double precision, dimension(:,:), allocatable rnode_sub
character(len=std_len) base_filename
Base file name for simulation output, which will be followed by a number.
integer refine_max_level
Maximal number of AMR levels.
integer, dimension(:,:), allocatable node
integer, dimension(:,:), allocatable node_sub
Writes D-1 slice, can do so in various formats, depending on slice_type.
subroutine fill_subnode_info(igrid, jgrid, dir)
subroutine get_igslice(dir, x, igslice)
subroutine fill_subnode(igrid, active, jgrid, dir, xslice, normconv)
integer slicenext
the file number of slices
integer, parameter nslicemax
Maximum number of slices.
subroutine alloc_subnode(jgrid, dir, nwexpand)
subroutine put_slice(dir, xslice)
character(len=std_len) slice_type
choose data type of slice: vtu, vtuCC, dat, or csv
integer, dimension(nslicemax) slicedir
The slice direction for each slice.
double precision function roundoff_minmax(val, minval, maxval)
integer nslices
Number of slices to output.
double precision, dimension(nslicemax) slicecoord
Slice coordinates, see Slice output.
subroutine select_slice(dir, xslice, writeonly, file_handle, normconv)
subroutine dealloc_subnode(jgrid)