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
94 character(len=std_len) :: filename
98 call mpistop(
"Number of output files is limited to 10000 (0...9999)")
101 if (
present(suffix))
then
103 trim(suffix), ix, extension
105 write(filename,
"(a,i4.4,a)") trim(
base_filename), ix, extension
112 amode = ior(mpi_mode_create, mpi_mode_wronly)
113 call mpi_file_open(mpi_comm_self,filename,amode, &
117 print *,
"Error, cannot create file ", trim(filename)
132 integer,
intent(in) :: fh
133 integer(kind=MPI_OFFSET_KIND),
intent(in) :: offset_tree
134 integer(kind=MPI_OFFSET_KIND),
intent(in) :: offset_block
135 character(len=*),
intent(in) :: dataset_names(:)
136 integer,
intent(in) :: nw_vars
137 integer,
dimension(MPI_STATUS_SIZE) :: st
140 character(len=name_len) :: dname
143 call mpi_file_write(fh, int(offset_tree), 1, mpi_integer, st, er)
144 call mpi_file_write(fh, int(offset_block), 1, mpi_integer, st, er)
145 call mpi_file_write(fh, nw_vars, 1, mpi_integer, st, er)
146 call mpi_file_write(fh,
ndir, 1, mpi_integer, st, er)
147 call mpi_file_write(fh,
ndim, 1, mpi_integer, st, er)
148 call mpi_file_write(fh,
levmax, 1, mpi_integer, st, er)
149 call mpi_file_write(fh,
nleafs, 1, mpi_integer, st, er)
150 call mpi_file_write(fh,
nparents, 1, mpi_integer, st, er)
151 call mpi_file_write(fh,
it, 1, mpi_integer, st, er)
154 call mpi_file_write(fh,
global_time, 1, mpi_double_precision, st, er)
156 call mpi_file_write(fh, [ xprobmin^
d ],
ndim, &
157 mpi_double_precision, st, er)
158 call mpi_file_write(fh, [ xprobmax^
d ],
ndim, &
159 mpi_double_precision, st, er)
166 call mpi_file_write(fh,
periodb,
ndim, mpi_logical, st, er)
170 name_len, mpi_character, st, er)
173 call mpi_file_write(fh,
stagger_grid, 1, mpi_logical, st, er)
178 dname = trim(adjustl((dataset_names(iw))))
179 call mpi_file_write(fh, dname, name_len, mpi_character, st, er)
183 call mpi_file_write(fh,
physics_type, name_len, mpi_character, st, er)
194 call mpi_file_write(fh,
snapshotnext, 1, mpi_integer, st, er)
196 call mpi_file_write(fh,
snapshotnext+1, 1, mpi_integer, st, er)
198 call mpi_file_write(fh,
slicenext, 1, mpi_integer, st, er)
199 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
integer, 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