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
36 {
do ix^db= ixo^lim^db\}
37 if(w_flag(ix^
d,iw))
then
38 write(*,*)
"Error: small value of ", trim(prim_wnames(iw)),wprim(ix^
d,iw),&
39 " encountered when call ", subname
41 write(*,*)
"Location: ", x(ix^
d,:)
42 write(*,*)
"Cell number: ", ix^
d
44 write(*,*) trim(prim_wnames(iiw)),
": ",wprim(ix^
d,iiw)
48 write(*,*)
"Saving status at the previous time step"
58 integer,
intent(in) :: ixi^
l, ixo^
l
59 logical,
intent(in) :: w_flag(ixi^s,1:nw)
60 double precision,
intent(inout) :: w(ixi^s, 1:nw)
61 double precision,
intent(in) :: x(ixi^s, 1:
ndim)
62 integer,
optional,
intent(in) :: windex
63 integer :: iw, kxo^
l, ix^
d, i, nwstart, nwend
65 if(
present(windex))
then
73 do iw = nwstart, nwend
74 {
do ix^db= ixo^lim^db\}
76 if (w_flag(ix^
d,iw))
then
80 {kxomin^
d= max(ix^
d-i, iximin^
d);
81 kxomax^
d= min(ix^
d+i, iximax^
d);\}
84 if(any(w_flag(kxo^s,iw) .eqv. .false.))
exit
87 if(any(w_flag(kxo^s,iw) .eqv. .false.))
then
93 w(ix^
d, iw) = sum(w(kxo^s, iw), w_flag(kxo^s,iw) .eqv. .false.)&
94 / count(w_flag(kxo^s,iw) .eqv. .false.)
97 write(*,*)
"no cells without error were found in cube of size", &
99 write(*,*)
"at location:", x(ix^
d, 1:
ndim)
100 write(*,*)
"at index:", ix^
d
101 write(*,*)
"w numer:", iw
104 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.
integer, 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.