28 integer,
intent(in) :: ixi^
l, ixo^
l
29 double precision,
intent(in) :: wprim(ixi^s, 1:nw)
30 double precision,
intent(in) :: x(ixi^s, 1:
ndim)
31 logical,
intent(in) :: w_flag(ixi^s,1:nw)
32 character(len=*),
intent(in) :: subname
34 double precision :: x^
d
35 integer :: iw,iiw,ix^
d
39 {
do ix^db= ixo^lim^db\}
40 if(w_flag(ix^
d,iw))
then
41 write(*,*)
"Error: small value of ", trim(prim_wnames(iw)),wprim(ix^
d,iw),&
42 " encountered when call ", subname
44 write(*,*)
"Location: ", x(ix^
d,:)
53 x1=x(ix^
d,1)*cos(x(ix^
d,2))
54 x2=x(ix^
d,1)*sin(x(ix^
d,2))
60 x1=x(ix^d,1)*cos(x(ix^d,phi_))
61 x2=x(ix^d,1)*sin(x(ix^d,phi_))
63 write(*,*)
"Cartesian location: ", x^d
65 x1=x(ix^d,1){^nooned*sin(x(ix^d,2))}{^ifthreed*cos(x(ix^d,3))}
67 x2=x(ix^d,1)*cos(x(ix^d,2))}
69 x2=x(ix^d,1)*sin(x(ix^d,2))*sin(x(ix^d,3))
70 x3=x(ix^d,1)*cos(x(ix^d,2))}
71 write(*,*)
"Cartesian location: ", x^d
73 write(*,*)
"No converter for coordinate=",coordinate
75 write(*,*)
"Cell number: ", ix^d
77 write(*,*) trim(prim_wnames(iiw)),
": ",wprim(ix^d,iiw)
81 write(*,*)
"Saving status at the previous time step"
91 integer,
intent(in) :: ixi^
l, ixo^
l
92 logical,
intent(in) :: w_flag(ixi^s,1:nw)
93 double precision,
intent(inout) :: w(ixi^s, 1:nw)
94 double precision,
intent(in) :: x(ixi^s, 1:
ndim)
95 integer,
optional,
intent(in) :: windex
96 integer :: iw, kxo^
l, ix^
d, i, nwstart, nwend
98 if(
present(windex))
then
106 do iw = nwstart, nwend
107 {
do ix^db= ixo^lim^db\}
109 if (w_flag(ix^
d,iw))
then
113 {kxomin^
d= max(ix^
d-i, iximin^
d);
114 kxomax^
d= min(ix^
d+i, iximax^
d);\}
117 if(any(w_flag(kxo^s,iw) .eqv. .false.))
exit
120 if(any(w_flag(kxo^s,iw) .eqv. .false.))
then
126 w(ix^
d, iw) = sum(w(kxo^s, iw), w_flag(kxo^s,iw) .eqv. .false.)&
127 / count(w_flag(kxo^s,iw) .eqv. .false.)
130 write(*,*)
"no cells without error were found in cube of size", &
132 write(*,*)
"at location:", x(ix^
d, 1:
ndim)
133 write(*,*)
"at index:", ix^
d
134 write(*,*)
"w numer:", iw
137 write(*,*)
"replace with small values"
Module with geometry-related routines (e.g., divergence, curl)
integer, parameter cartesian
integer, parameter cylindrical
integer, parameter cartesian_expansion
integer, parameter cartesian_stretched
This module contains definitions of global parameters and variables and some generic functions/subrou...
double precision small_pressure
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.
integer mype
The rank of the current MPI task.
double precision, dimension(:), allocatable, parameter d
logical crash
Save a snapshot before crash a run met unphysical values.
double precision small_density
Module for handling problematic values in simulations, such as negative pressures.
subroutine, public small_values_average(ixil, ixol, w, x, w_flag, windex)
integer, public small_values_daverage
Average over this many cells in each direction.
logical, public trace_small_values
trace small values in the source file using traceback flag of compiler
subroutine, public small_values_error(wprim, x, ixil, ixol, w_flag, subname)
logical, dimension(:), allocatable, public small_values_fix_iw
Whether to apply small value fixes to certain variables.
character(len=20), public small_values_method
How to handle small values.