27 integer,
intent(in) :: ixi^
l, ixo^
l
28 double precision,
intent(in) :: wprim(ixi^s, 1:nw)
29 double precision,
intent(in) :: x(ixi^s, 1:
ndim)
30 logical,
intent(in) :: w_flag(ixi^s,1:nw)
31 character(len=*),
intent(in) :: subname
32 integer :: iw,iiw,ix^
d
37 {
do ix^db= ixo^lim^db\}
38 if(w_flag(ix^
d,iw))
then
39 write(*,*)
"Error: small value of ", trim(prim_wnames(iw)),wprim(ix^
d,iw),&
40 " encountered when call ", subname
42 write(*,*)
"Location: ", x(ix^
d,:)
43 write(*,*)
"Cell number: ", ix^
d
45 write(*,*) trim(prim_wnames(iiw)),
": ",wprim(ix^
d,iiw)
49 write(*,*)
"Saving status at the previous time step"
59 integer,
intent(in) :: ixi^
l, ixo^
l
60 logical,
intent(in) :: w_flag(ixi^s,1:nw)
61 double precision,
intent(inout) :: w(ixi^s, 1:nw)
62 double precision,
intent(in) :: x(ixi^s, 1:
ndim)
63 integer,
optional,
intent(in) :: windex
64 integer :: iw, kxo^
l, ix^
d, i, nwstart, nwend
66 if(
present(windex))
then
74 do iw = nwstart, nwend
75 {
do ix^db= ixo^lim^db\}
77 if (w_flag(ix^
d,iw))
then
81 {kxomin^
d= max(ix^
d-i, iximin^
d);
82 kxomax^
d= min(ix^
d+i, iximax^
d);\}
85 if(any(w_flag(kxo^s,iw) .eqv. .false.))
exit
88 if(any(w_flag(kxo^s,iw) .eqv. .false.))
then
94 w(ix^
d, iw) = sum(w(kxo^s, iw), w_flag(kxo^s,iw) .eqv. .false.)&
95 / count(w_flag(kxo^s,iw) .eqv. .false.)
98 write(*,*)
"no cells without error were found in cube of size", &
100 write(*,*)
"at location:", x(ix^
d, 1:
ndim)
101 write(*,*)
"at index:", ix^
d
102 write(*,*)
"w numer:", iw
105 write(*,*)
"replace with small values"
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.
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_average(ixIL, ixOL, w, x, w_flag, windex)
logical, dimension(:), allocatable, public small_values_fix_iw
Whether to apply small value fixes to certain variables.
subroutine, public small_values_error(wprim, x, ixIL, ixOL, w_flag, subname)
character(len=20), public small_values_method
How to handle small values.