20 character(len=*),
intent(in):: aux_variable_names
21 integer,
intent(in) :: nwc
22 character(len=name_len) :: names(1:nwc)
24 integer:: space_position,iw
25 character(len=name_len):: wname
26 character(len=std_len):: scanstring
30 scanstring=trim(adjustl(aux_variable_names))
31 space_position=index(scanstring,
' ')
33 do while (space_position==1)
34 scanstring=scanstring(2:)
35 space_position=index(scanstring,
' ')
37 wname=scanstring(:space_position-1)
38 scanstring=scanstring(space_position+1:)
39 space_position=index(scanstring,
' ')
41 names(iw)=trim(adjustl(wname))
47 integer,
intent(in) :: ixo^l
49 count_ix = product([ ixomax^d ] - [ ixomin^d ] + 1)
57 integer,
intent(in) :: igrid
60 integer,
intent(out) :: n_ghost(2*
ndim)
62 integer,
intent(out) :: ixo^
l
64 integer,
intent(out) :: n_values
73 if(ps(igrid)%is_physical_boundary(2*idim-1)) n_ghost(idim)=
nghostcells
75 if(ps(igrid)%is_physical_boundary(2*idim)) n_ghost(
ndim+idim)=
nghostcells
79 {ixomin^
d = ixmlo^
d - n_ghost(^
d)\}
80 {ixomax^
d = ixmhi^
d + n_ghost(
ndim+^
d)\}
90 integer,
intent(out) :: fh
91 integer,
intent(in) :: ix
92 character(len=*),
intent(in) :: extension
93 character(len=*),
intent(in),
optional :: suffix
96 character(len=std_len) :: filename
99 call mpistop(
"Number of output files is limited to 10000 (0...9999)")
102 if (
present(suffix))
then
104 trim(suffix), ix, extension
106 write(filename,
"(a,i4.4,a)") trim(
base_filename), ix, extension
113 amode = ior(mpi_mode_create, mpi_mode_wronly)
114 call mpi_file_open(mpi_comm_self,filename,amode, &
118 print *,
"Error, cannot create file ", trim(filename)
133 integer,
intent(in) :: fh
134 integer(kind=MPI_OFFSET_KIND),
intent(in) :: offset_tree
135 integer(kind=MPI_OFFSET_KIND),
intent(in) :: offset_block
136 character(len=*),
intent(in) :: dataset_names(:)
137 integer,
intent(in) :: nw_vars
138 integer,
dimension(MPI_STATUS_SIZE) :: st
141 character(len=name_len) :: dname
144 call mpi_file_write(fh, int(offset_tree), 1, mpi_integer, st, er)
145 call mpi_file_write(fh, int(offset_block), 1, mpi_integer, st, er)
146 call mpi_file_write(fh, nw_vars, 1, mpi_integer, st, er)
147 call mpi_file_write(fh,
ndir, 1, mpi_integer, st, er)
148 call mpi_file_write(fh,
ndim, 1, mpi_integer, st, er)
149 call mpi_file_write(fh,
levmax, 1, mpi_integer, st, er)
150 call mpi_file_write(fh,
nleafs, 1, mpi_integer, st, er)
151 call mpi_file_write(fh,
nparents, 1, mpi_integer, st, er)
152 call mpi_file_write(fh,
it, 1, mpi_integer, st, er)
155 call mpi_file_write(fh,
global_time, 1, mpi_double_precision, st, er)
157 call mpi_file_write(fh, [ xprobmin^
d ],
ndim, &
158 mpi_double_precision, st, er)
159 call mpi_file_write(fh, [ xprobmax^
d ],
ndim, &
160 mpi_double_precision, st, er)
167 call mpi_file_write(fh,
periodb,
ndim, mpi_logical, st, er)
171 name_len, mpi_character, st, er)
174 call mpi_file_write(fh,
stagger_grid, 1, mpi_logical, st, er)
179 dname = trim(adjustl((dataset_names(iw))))
180 call mpi_file_write(fh, dname, name_len, mpi_character, st, er)
184 call mpi_file_write(fh,
physics_type, name_len, mpi_character, st, er)
195 call mpi_file_write(fh,
snapshotnext, 1, mpi_integer, st, er)
197 call mpi_file_write(fh,
snapshotnext+1, 1, mpi_integer, st, er)
199 call mpi_file_write(fh,
slicenext, 1, mpi_integer, st, er)
200 call mpi_file_write(fh,
collapsenext, 1, mpi_integer, st, er)
subroutine, public mpistop(message)
Exit MPI-AMRVAC with an error message.
Module with basic grid data structures.
integer, save nleafs
Number of leaf block.
integer, save nparents
Number of parent blocks.
This module contains definitions of global parameters and variables and some generic functions/subrou...
character(len=std_len) geometry_name
integer domain_nx
number of cells for each dimension in level-one mesh
double precision global_time
The global simulation time.
integer it
Number of time steps taken.
integer, parameter ndim
Number of spatial dimensions for grid variables.
logical save_physical_boundary
True for save physical boundary cells in dat files.
logical stagger_grid
True for using stagger grid.
integer block_nx
number of cells for each dimension in grid block excluding ghostcells
double precision, dimension(:), allocatable, parameter d
integer ndir
Number of spatial dimensions (components) for vector variables.
integer ierrmpi
A global MPI error return code.
integer snapshotnext
IO: snapshot and collapsed views output numbers/labels.
logical, dimension(ndim) periodb
True for dimensions with periodic boundaries.
integer, parameter unitsnapshot
integer nghostcells
Number of ghost cells surrounding a grid.
character(len=std_len) base_filename
Base file name for simulation output, which will be followed by a number.
logical pass_wall_time
If true, wall time is up, modify snapshotnext for later overwrite.
This module defines the procedures of a physics module. It contains function pointers for the various...
procedure(sub_write_info), pointer phys_write_info
character(len=name_len) physics_type
String describing the physics type of the simulation.
Writes D-1 slice, can do so in various formats, depending on slice_type.
integer slicenext
the file number of slices