MPI-AMRVAC 3.2
The MPI - Adaptive Mesh Refinement - Versatile Advection Code (development version)
Loading...
Searching...
No Matches
mod_global_parameters.t
Go to the documentation of this file.
1!> This module contains definitions of global parameters and variables and some
2!> generic functions/subroutines used in AMRVAC.
3!>
5 use mpi
11
12 implicit none
13 public
14
15 !> minimum and maximum domain boundaries for each dimension
16 double precision :: xprob^l
17 !> store unstretched cell size of current level
18 double precision :: dxlevel(^nd)
19 !> stretch factor between cells at AMR level 1, per dimension
20 double precision :: qstretch_baselevel(^nd)
21
22 !> physical extent of stretched border in symmetric stretching
23 double precision :: xstretch^d
24
25 !> to monitor timeintegration loop at given wall-clock time intervals
26 double precision :: time_between_print
27
28 !> accumulated wall-clock time spent on boundary conditions
29 double precision :: time_bc
30
31 !> global time step
32 double precision :: dt
33
34 !> The Courant (CFL) number used for the simulation
35 double precision :: courantpar
36
37
38 !> If dtpar is positive, it sets the timestep dt, otherwise courantpar is used
39 !> to limit the time step based on the Courant condition.
40 double precision :: dtpar
41
42 !> For resistive MHD, the time step is also limited by the diffusion time:
43 !> \f$ dt < dtdiffpar \times dx^2/eta \f$
44 double precision :: dtdiffpar
45
46 !> The global simulation time
47 double precision :: global_time
48
49 !> Start time for the simulation
50 double precision :: time_init
51
52 !> End time for the simulation
53 double precision :: time_max
54
55 !> Ending wall time (in hours) for the simulation
56 double precision :: wall_time_max
57
58 !> Stop the simulation when the time step becomes smaller than this value
59 double precision :: dtmin
60
61 !> Conversion factor for length unit
62 double precision :: length_convert_factor
63
64 !> Conversion factor for time unit
65 double precision :: time_convert_factor
66
67 !> Fix the AMR grid after this time
68 double precision :: tfixgrid
69
70 ! Physics factors
71 !> Physical scaling factor for length
72 double precision :: unit_length=1.d0
73
74 !> Physical scaling factor for time
75 double precision :: unit_time=1.d0
76
77 !> Physical scaling factor for density
78 double precision :: unit_density=1.d0
79
80 !> Physical scaling factor for velocity
81 double precision :: unit_velocity=1.d0
82
83 !> Physical scaling factor for temperature
84 double precision :: unit_temperature=1.d0
85
86 !> Physical scaling factor for pressure
87 double precision :: unit_pressure=1.d0
88
89 !> Physical scaling factor for magnetic field
90 double precision :: unit_magneticfield=1.d0
91
92 !> Physical scaling factor for number density
93 double precision :: unit_numberdensity=1.d0
94
95 !> Physical scaling factor for charge
96 double precision :: unit_charge=1.d0
97
98 !> Physical scaling factor for mass
99 double precision :: unit_mass=1.d0
100
101 !> Normalised speed of light
102 double precision :: c_norm=1.d0
103
104 !> Normalised radiation constant
105 double precision :: arad_norm=1.d0
106
107 !> Physical scaling factor for Opacity
108 double precision :: unit_opacity=1.d0
109
110 !> Physical scaling factor for radiation flux
111 double precision :: unit_radflux=1.d0
112
113 !> Physical scaling factor for radiation energy density
114 double precision :: unit_erad=1.d0
115
116 !> Physical factors useful for radiation fld
118
119 !> error handling
121 double precision :: phys_trac_mask
122
123 double precision :: minfip=1.d0, maxfip=4.d0
124
125 !> amplitude of background dipolar, quadrupolar, octupolar, user's field
126 double precision :: bdip=0.d0
127 double precision :: bquad=0.d0
128 double precision :: boct=0.d0
129 double precision :: busr=0.d0
130 !> Stores the memory and load imbalance, used in printlog
131 double precision :: xload, xmemory
132 double precision :: tvdlfeps
133
134 !> RK2(alfa) method parameters from Butcher tableau
135 double precision :: rk_a21,rk_b1,rk_b2
136 !> IMEX-222(lambda) one-parameter family of schemes
137 double precision :: imex222_lambda
142 !> IMEX_ARS3 parameter ars_gamma
143 double precision :: ars_gamma
145 double precision :: imex_b3,imex_c2,imex_c3
146 !> IMEX_CB3a extra parameters
147 double precision :: imex_a22, imex_a33, imex_ha32
148
149 !> global fastest wave speed needed in fd scheme and glm method
150 double precision :: cmax_global
151
152 !> global fastest flow speed needed in glm method
153 double precision :: vmax_global
154
155 !> times for enhancing spatial resolution for EUV image/spectra
157 !> the white light emission below it (unit=Rsun) is not visible
158 double precision :: r_occultor
159 !> direction of the line of sight (LOS)
160 double precision :: los_theta,los_phi
161 !> rotation of image
162 double precision :: image_rotate
163 !> where the is the origin (X=0,Y=0) of image
164 double precision :: x_origin(1:3)
165 !> Base file name for synthetic EUV spectrum output
166 character(len=std_len) :: filename_spectrum
167 !> Synthetic emission transfer mode: thin or thick
168 character(len=std_len) :: radiation_transfer
169 !> Synthetic emission ray traversal method
170 character(len=std_len) :: ray_method
171 !> Data-resolution image spacing: nominal or minimum actual cell size
172 character(len=std_len) :: dat_resolution_mode
173 !> Synthetic emission physical model selector
174 character(len=std_len) :: emission_model
175 !> Post-process dat-resolution EUV images onto the instrument pixel grid
177 !> Observing frequency for radio free-free synthesis in Hz
178 double precision :: radio_frequency
179 !> Gaussian radio beam full width at half maximum in arcsec
180 double precision :: radio_beam_fwhm
181 !> Output pixel size for radio beam post-processing in arcsec; <=0 uses FWHM/3
182 double precision :: radio_beam_pixel_size
183 !> Number of image pixels processed in one ray-segment MPI batch
185 !> Maximum ray segments per pixel batch, as a factor of radsyn_pixel_batch; <=0 uses memory budget.
186 !> Default value is set from the best spherical u512 benchmark behavior seen so far.
188 !> Approximate per-rank temporary memory budget, in MiB, for automatic ray-segment batch sizing
189 double precision :: radsyn_segment_memory_mb
190 !> Maximum ray segments per segmented MPI all-to-all round, as a factor of radsyn_pixel_batch
192 !> Print synthetic-emission ray-tracing profiling counters
193 logical :: radsyn_verbose
194 !> spectral window
196 !> location of the slit
197 double precision :: location_slit
198 !> for spherical coordinate, region below it (unit=Rsun) is treated as not transparent
199 double precision :: r_opt_thick
200
201 !> domain percentage cut off shifted from each boundary when converting data
202 double precision :: writespshift(^nd,2)
203
204 double precision, allocatable :: entropycoef(:)
205
206 !> extent of grid blocks in domain per dimension, in array over levels
207 double precision, dimension(:), allocatable :: dg^d
208 !> Corner coordinates
209 double precision, allocatable :: rnode(:,:)
210 double precision, allocatable :: rnode_sub(:,:)
211
212 !> spatial steps for all dimensions at all levels
213 double precision, allocatable :: dx(:,:)
214
215 !> Error tolerance for refinement decision
216 double precision, allocatable :: refine_threshold(:)
217 !> Error tolerance ratio for derefinement decision
218 double precision, allocatable :: derefine_ratio(:)
219
220 !> Stretching factors and first cell size for each AMR level and dimension
221 double precision, allocatable :: qstretch(:,:), dxfirst(:,:), &
222 dxfirst_1mq(:,:), dxmid(:,:)
223
224 !> Conversion factors the primitive variables
225 double precision, allocatable :: w_convert_factor(:)
226
227 !> Weights of variables used to calculate error for mesh refinement
228 double precision, allocatable :: w_refine_weight(:)
229
230 !> refinement: lohner estimate wavefilter setting
231 double precision, allocatable :: amr_wavefilter(:)
232
233 !> Maximum number of saves that can be defined by tsave or itsave
234 integer, parameter :: nsavehi=100
235 !> Number of output methods
236 integer, parameter :: nfile = 5
237
238 !> Save output of type N on times tsave(:, N)
239 double precision :: tsave(nsavehi,nfile)
240
241 double precision :: tsavelast(nfile)
242
243 !> Repeatedly save output of type N when dtsave(N) simulation time has passed
244 double precision :: dtsave(nfile)
245
246 !> Start of read out (not counting specified read outs)
247 double precision :: tsavestart(nfile)
248
249 !> Number of spatial dimensions for grid variables
250 integer, parameter :: ndim=^nd
251
252 !> The number of MPI tasks
253 integer :: npe
254
255 !> The rank of the current MPI task
256 integer :: mype
257
258 !> The MPI communicator
259 integer :: icomm
260
261 !> A global MPI error return code
262 integer :: ierrmpi
263
264 !> Per-rank load-balance timing diagnostic toggle (off by default).
265 !> When .true., per-rank wall times are gathered every step and written
266 !> to <basename>_rank_timing.log.
267 logical :: lb_diagnose = .false.
268
269 !> Cost-weighted automatic load balancer toggle (off by default).
270 !> When .true., the SFC partitioner cuts on cumulative measured per-block
271 !> cost rather than on equal block counts.
272 logical :: lb_automatic = .false.
273
274 !> Rebalance every lb_interval cycles when lb_automatic is on.
275 integer :: lb_interval = 10
276
277 !> Exponential-moving-average decay for the per-block cost.
278 !> costlist <- lb_alpha*costlist + (1-lb_alpha)*measured.
279 !> 0 = no memory (volatile), 1 = no update.
280 double precision :: lb_alpha = 0.9d0
281
282 !> Bound on the memory imbalance get_Morton_range_costed may create: no rank
283 !> may hold more than lb_max_block_ratio * (nleafs/npe) blocks. Cost balance
284 !> and memory balance are in tension, as a rank owning cheap blocks must hold
285 !> more of them to match one owning expensive blocks. 1.0 is the equal-block
286 !> cut; larger values allow more freedom to follow cost.
287 !> get_Morton_range_active bounds the same ratio through its wa/wp weights.
288 double precision :: lb_max_block_ratio = 1.25d0
289
290 !> Per-step per-block (per-rank, indexed by igrid) cost accumulator.
291 !> Reset at start of each advance call; filled inside iigrid loops by the
292 !> per-block timer wrappers in mod_advance.t and mod_supertimestepping.t.
293 double precision, dimension(:), allocatable :: block_cost
294
295 !> Per-step per-block cost of the short-characteristics sweep, indexed by
296 !> igrid. Separate from block_cost because rt_sc_solve() runs before advance(),
297 !> which zeroes block_cost on entry. advance() seeds block_cost from this array
298 !> and clears it for the next solve, so both costs share a partition weight.
299 double precision, dimension(:), allocatable :: block_cost_rt
300
301 !> Per-rank wall time spent in the SC radiative-transfer KBA sweep this step,
302 !> for the lb_diagnose rank-timing log. Filled by mod_rt_sc_solvers (which runs
303 !> before advance), gathered and zeroed inside advance's diagnostic block.
304 double precision :: lb_rt_accum = 0.0d0
305
306 !> Persistent global per-Morton-leaf EWMA cost, in seconds (block_cost is a
307 !> wall-clock accumulation). Sized to max_blocks*npe (the upper bound on
308 !> nleafs); only the first nleafs entries are meaningful. Morton numbering
309 !> is invariant across load_balance migration, so costlist values are
310 !> correctly preserved when blocks change rank. Refinement events
311 !> insert/remove Morton indices, after which the EWMA recovers over
312 !> ~5 cycles. Indexed 1..nleafs. Updated by EWMA blend inside
313 !> get_Morton_range_costed.
314 double precision, dimension(:), allocatable :: costlist
315
316 !> Whether the matching costlist slot has ever carried a measurement. Morton
317 !> indices created by a refinement event have not been timed; they are seeded
318 !> with the mean of the measured slots, since costlist is a wall time and any
319 !> fixed seed would be a units error.
320 logical, dimension(:), allocatable :: costlist_seen
321
322 !> MPI file handle for logfile
323 integer :: log_fh
324 !> MPI type for block including ghost cells and its size
326 !> MPI type for block coarsened by 2, and for its children blocks
328 !> MPI type for staggered block coarsened by 2, and for its children blocks
329 integer :: type_coarse_block_stg(^nd,2^d&), type_sub_block_stg(^ND,2^D&)
330 !> MPI type for IO: block excluding ghost cells
332 !> MPI type for IO of staggered variables
334 !> MPI type for IO: cell corner (xc) or cell center (xcc) coordinates
336 !> MPI type for IO: cell corner (wc) or cell center (wcc) variables
338
339 ! geometry and domain setups
340 !> the mesh range of a physical block without ghost cells
341 integer :: ixm^ll
342
343 !> Indices for cylindrical coordinates FOR TESTS, negative value when not used:
344 integer :: r_ = -1
345 integer :: phi_ = -1
346 integer :: z_ = -1
347
348 !> Number of spatial dimensions (components) for vector variables
349 integer :: ndir=ndim
350
351 !> starting dimension for electric field
352 {^ifoned
353 integer, parameter :: sdim=3
354 }
355 {^iftwod
356 integer, parameter :: sdim=3
357 }
358 {^ifthreed
359 integer, parameter :: sdim=1
360 }
361
362 !> number of cells for each dimension in level-one mesh
363 integer :: domain_nx^d
364
365 !> number of cells for each dimension in grid block excluding ghostcells
366 integer :: block_nx^d
367
368 !> Lower index of grid block arrays (always 1)
369 integer, parameter :: {ixglo^d = 1|, }
370
371 !> Upper index of grid block arrays
372 integer :: ixghi^d
373
374 !> Lower index of stagger grid block arrays (always 0)
375 integer, parameter :: {ixgslo^d = 0|, }
376
377 !> Upper index of stagger grid block arrays
378 integer :: ixgshi^d
379
380 !> Number of ghost cells surrounding a grid
381 integer :: nghostcells = 2
382
383 integer, parameter :: stretch_none = 0 !< No stretching
384 integer, parameter :: stretch_uni = 1 !< Unidirectional stretching from a side
385 integer, parameter :: stretch_symm = 2 !< Symmetric stretching around the center
386
387 !> What kind of stretching is used per dimension
388 integer :: stretch_type(ndim)
389 !> (even) number of (symmetrically) stretched
390 !> blocks at AMR level 1, per dimension
392 !> (even) number of (symmetrically) stretched blocks per level and dimension
393 integer, allocatable :: nstretchedblocks(:,:)
394
395 !> grid hierarchy info (level and grid indices)
396 integer, parameter :: nodehi=^nd+1
397 integer, parameter :: plevel_=1
398 integer, parameter :: pig^d_=plevel_+^d
399
400 integer, allocatable :: node(:,:)
401 integer, allocatable :: node_sub(:,:)
402
403 !> grid location info (corner coordinates and grid spacing)
404 integer, parameter :: rnodehi=3*^nd
405 integer, parameter :: rpxmin0_=0
406 integer, parameter :: rpxmin^d_=rpxmin0_+^d
407 integer, parameter :: rpxmax0_=^nd
408 integer, parameter :: rpxmax^d_=rpxmax0_+^d
409 integer, parameter :: rpdx^d_=2*^nd+^d
410
411 !> index number of the latest existing data file
413
414 !> Save output of type N on iterations itsave(:, N)
415 integer :: itsave(nsavehi,nfile)
416
417 integer :: itsavelast(nfile)
418
419 !> Repeatedly save output of type N when ditsave(N) time steps have passed
420 integer :: ditsave(nfile)
421
422 integer :: isavet(nfile)
423
424 integer :: isaveit(nfile)
425
426 !> The level at which to produce line-integrated / collapsed output
427 integer :: collapselevel
428
429 !> Number of saved files of each type
430 integer :: n_saves(1:nfile)
431
432 !> IO: snapshot and collapsed views output numbers/labels
434
435 !> IO: slice output number/label
436 integer :: slicenext
437
438 !> Constant indicating log output
439 integer, parameter :: filelog_ = 1
440
441 !> Constant indicating regular output
442 integer, parameter :: fileout_ = 2
443
444 !> Constant indicating slice output
445 integer, parameter :: fileslice_ = 3
446
447 !> Constant indicating collapsed output
448 integer, parameter :: filecollapse_ = 4
449
450 !> Constant indicating analysis output (see @ref analysis.md)
451 integer, parameter :: fileanalysis_ = 5
452
453 !> Unit for standard input
454 integer, parameter :: unitstdin=5
455
456 !> Unit for standard output
457 integer, parameter :: unitterm=6
458
459 !> Unit for error messages
460 integer, parameter :: uniterr=6
461
462 !> file handle for IO
463 integer, parameter :: unitpar=9
464 integer, parameter :: unitconvert=10
465 integer, parameter :: unitslice=11
466 integer, parameter :: unitsnapshot=12
467 integer, parameter :: unitcollapse=13
468 integer, parameter :: unitanalysis=14
469
470 !> Number of auxiliary variables that are only included in output
471 integer :: nwauxio
472
474
475 !> Resume from the snapshot with this index
476 integer :: snapshotini
477
478 !> number of equilibrium set variables, besides the mag field
479 integer :: number_equi_vars = 0
480
481 integer :: phys_trac_type=1
483 integer :: phys_trac_nzones=1
484 double precision :: phys_trac_zone_splits(10)=-1.d0
485
486 !> integer switchers for type courant
487 integer, parameter :: type_maxsum=1
488 integer, parameter :: type_summax=2
489 integer, parameter :: type_minimum=3
490
491 ! AMR switches
492 !> The maximum number of grid blocks in a processor
493 integer :: max_blocks
494
495 !> The maximum number of levels in the grid refinement
496 integer, parameter :: nlevelshi = 20
497
498 !> Maximal number of AMR levels
500
501 !> Fix the AMR grid after this many time steps
502 integer :: itfixgrid
503
504 !> Reconstruct the AMR grid once every ditregrid iteration(s)
505 integer :: ditregrid
506
507 !> select types of refine criterion
509
510 !> Number of cells as buffer zone
511 integer :: nbufferx^d
512
513 integer :: levmin
514 integer :: levmax
515 integer :: levmax_sub
516
517 ! Miscellaneous
518 !> problem switch allowing different setups in same usr_mod.t
519 integer :: iprob
520
521 !> Kronecker delta tensor
522 integer :: kr(3,3)
523
524 !> Levi-Civita tensor
525 integer :: lvc(3,3,3)
526
527 !> How to compute the CFL-limited time step
528 integer :: type_courant=1
529
530 !> Number of time steps taken
531 integer :: it
532
533 !> Stop the simulation after this many time steps have been taken
534 integer :: it_max
535
536 !> initial iteration count
537 integer :: it_init
538
539 !> If > 1, then in the first slowsteps-1 time steps dt is reduced
540 !> by a factor \f$ 1 - (1- step/slowsteps)^2 \f$
541 integer :: slowsteps
542
543 ! Method switches
544
545 !> Index of the sub-step in a multi-step time integrator
546 integer :: istep
547
548 !> How many sub-steps the time integrator takes
549 integer :: nstep
550
551 !> flux schemes
552 integer, parameter :: fs_hll=1
553 integer, parameter :: fs_hllc=2
554 integer, parameter :: fs_hlld=3
555 integer, parameter :: fs_hllcd=4
556 integer, parameter :: fs_tvdlf=5
557 integer, parameter :: fs_tvdmu=6
558 integer, parameter :: fs_tvd=7
559 integer, parameter :: fs_hancock=8
560 integer, parameter :: fs_cd=9
561 integer, parameter :: fs_cd4=10
562 integer, parameter :: fs_fd=11
563 integer, parameter :: fs_source=12
564 integer, parameter :: fs_nul=13
565
566 !> time stepper type
567 integer :: t_stepper=0
568 integer, parameter :: onestep=1
569 integer, parameter :: twostep=2
570 integer, parameter :: threestep=3
571 integer, parameter :: fourstep=4
572 integer, parameter :: fivestep=5
573
574 !> time integrator method
575 integer :: t_integrator=0
576 integer, parameter :: forward_euler=1
577 integer, parameter :: predictor_corrector=2
578 integer, parameter :: ssprk3=3
579 integer, parameter :: ssprk4=4
580 integer, parameter :: ssprk5=5
581
582 integer, parameter :: imex_euler=6
583 integer, parameter :: imex_sp=7
584 integer, parameter :: rk2_alf=8
585 integer, parameter :: ssprk2=9
586 integer, parameter :: imex_midpoint=10
587 integer, parameter :: imex_trapezoidal=11
588 integer, parameter :: imex_222=12
589
590 integer, parameter :: rk3_bt=13
591 integer, parameter :: imex_ars3=14
592 integer, parameter :: imex_232=15
593 integer, parameter :: imex_cb3a=16
594
595 integer, parameter :: rk4=17
596
597 !> number of grid blocks in domain per dimension, in array over levels
598 integer, dimension(:), allocatable :: ng^d
599
600 !> Which flux scheme of spatial discretization to use (per grid level)
601 integer, allocatable :: flux_method(:)
602
603 !> The spatial discretization for the predictor step when using a two
604 !> step PC method
605 integer, allocatable :: typepred1(:)
606
607 !> Type of slope limiter used for reconstructing variables on cell edges
608 integer, allocatable :: type_limiter(:)
609
610 !> Type of slope limiter used for computing gradients or divergences, when
611 !> typegrad or typediv are set to 'limited'
612 integer, allocatable :: type_gradient_limiter(:)
613
614 !> Coefficient alpha of the explicit diffusive flux of Mignone et al. 2005 eq. B19-B21,
615 !> the second half of PPM's dissipation algorithm. 0 = off (default); the paper says
616 !> "alpha is typically set to 0.1".
617 !>
618 !> F_{i+1/2} -> F_{i+1/2} + k_nu (U_i - U_{i+1}) , k_nu = alpha*max(-D_{i+1/2},0)
619 !>
620 !> D is an undivided multidimensional divergence of v at the interface, so the term is
621 !> active only where the flow converges. Two consequences worth knowing:
622 !> * it is identically zero for a state at rest, so it cannot disturb a hydrostatic
623 !> column -- exact discrete balance survives it untouched;
624 !> * it is proportional to the raw cell difference U_i - U_{i+1}, not to the
625 !> reconstructed face jump, so unlike everything else in the scheme it can see an
626 !> odd-even mode that a face-value reconstruction annihilates.
627 double precision :: ppm_avisc = 0.0d0
628
629 !> Residual-jump velocity reconstruction (RJV). 0 = off (default), 1 = full strength.
630 !>
631 !> PPM's face operator annihilates the odd-even (2 dx) mode: the face value's leading
632 !> term is (q_i + q_{i+1})/2, and adjacent cells carry opposite ripple sign, while the
633 !> slope depends on (q_{i+1} - q_{i-1})/2, where the two cells have the same parity. So
634 !> the mode leaves no trace in w_L or w_R, the Riemann solver sees no jump, and applies
635 !> exactly zero dissipation to it. It never decays once seeded.
636 !>
637 !> But what the operator annihilates is exactly recoverable as its own residual,
638 !>
639 !> e_i = v_i - (P_{i+1/2} + P_{i-1/2})/2 ,
640 !>
641 !> built from the two face values PPM has already computed -- no new stencil. For a
642 !> ripple A(-1)^i, e_i = A(-1)^i at full amplitude; for smooth data e_i = -h^2 v''/8.
643 !> Reinject it as a jump only, leaving the face value (and hence the flux, and hence a
644 !> hydrostatic column) untouched:
645 !>
646 !> w_L(i+1/2) = P_{i+1/2} + beta*s_i*e_i , w_R(i+1/2) = P_{i+1/2} + beta*s_{i+1}*e_{i+1}
647 !>
648 !> with s_i = 1 only where e alternates across three cells, which no smooth field does.
649 !> At beta = 1 this reproduces the piecewise-constant jump for a pure ripple, i.e. full
650 !> first-order dissipation on the null component alone.
651 !>
652 !> Applied to the velocity components only. That is what makes it exact rather than
653 !> approximate: at rest v = 0, so e = 0 identically and the jump is exactly zero, and
654 !> every flux term the velocity enters carries a factor v. Measured inert on a resolved
655 !> sine (l=8 and l=32), a 3-cell tanh front, a discontinuity, and an exponential column.
656 double precision :: ppm_rjv = 0.0d0
657
658 !> background magnetic field location indicator
659 integer :: b0i=0
660
661 !> Limiter used for prolongation to refined grids and ghost cells
662 integer :: prolong_limiter=0
663
664 !> bound (left/min and right.max) speed of Riemann fan
665 integer :: boundspeed
666
667 integer :: nxdiffusehllc
668 !> SSPRK choice of methods (both threestep and fourstep, Shu-Osher 2N* implementation)
669 !> also fivestep SSPRK54
670 integer :: ssprk_order
671 !> RK3 Butcher table
672 integer :: rk3_switch
673 !> IMEX_232 choice and parameters
674 integer :: imex_switch
675
676 !> Array indicating the type of boundary condition per variable and per
677 !> physical boundary
678 integer, allocatable :: typeboundary(:, :)
679 !> boundary condition types
680 integer, parameter :: bc_special=1
681 integer, parameter :: bc_cont=2
682 integer, parameter :: bc_symm=3
683 integer, parameter :: bc_asymm=4
684 integer, parameter :: bc_periodic=5
685 integer, parameter :: bc_aperiodic=6
686 integer, parameter :: bc_noinflow=7
687 integer, parameter :: bc_data=8
688 integer, parameter :: bc_character=9
689 integer, parameter :: bc_icarus=10
690
691 !> wavelength for output
692 integer :: wavelength
693 ! minimum and maximum energy of SXR (keV)
695 !> wave length for spectrum
696 integer :: spectrum_wl
697 !> direction of the slit (for dat resolution only)
698 integer :: direction_slit
699
700
701 !> Cartesian geometry or not
702 logical :: slab
703
704 !> uniform Cartesian geometry or not (stretched Cartesian)
705 logical :: slab_uniform
706
707 !> each cell has its own timestep or not
708 logical :: local_timestep = .false.
709
710 !> whether or not to save an output file
711 logical :: save_file(nfile)
712
713 !> If true, adjust mod_geometry routines to account for grid stretching (but
714 !> the flux computation will not)
716 !> True if a dimension is stretched
717 logical :: stretched_dim(ndim)
718
719 !> If true, restart a previous run from the latest snapshot
721
722 !> If true and restart_from_file is given, convert snapshots to
723 !> other file formats
724 logical :: convert
725
726 !> If true, already convert to output format during the run
727 logical :: autoconvert
728
729 !> If true, convert from conservative to primitive variables in output
730 logical :: saveprim
731
732 !> do time evolving
733 logical :: time_advance
734
735 !> Force timeloop exit when final dt < dtmin
736 logical :: final_dt_exit
737
738 !> If true, reset iteration count and global_time to original values, and
739 !> start writing snapshots at index 0
740 logical :: reset_time
741
742 !> If true, reset iteration count to 0
743 logical :: reset_it
744
745 !> If true, allow final dt reduction for matching time_max on output
747
748 !> If true, call initonegrid_usr upon restarting
749 logical :: firstprocess
750
751 !> If true, allow a restart from a snapshot whose ndir differs from the current
752 !> run (e.g. hd ndir=2 -> mhd ndir=3). Block I/O is ndim-based only, so the data
753 !> loads exactly; use usr_transform_w to place the source vars into the right slots.
755
756 !> If true, wall time is up, modify snapshotnext for later overwrite
757 logical :: pass_wall_time
758
759 !> If true, do H-correction to fix the carbuncle problem at grid-aligned shocks
760 logical :: h_correction=.false.
761
762 !> If true, rebuild the AMR grid upon restarting
763 logical :: reset_grid
764 !> True for using stagger grid
765 logical :: stagger_grid=.false.
766 !> Limit outstanding ghost-cell send requests to avoid MPI request pressure.
767 !> In large-scale MHD tests, the original all-at-once ghost-cell exchange could
768 !> stall during spherical u512 initialization. Batching avoids
769 !> that failure mode, while u256 5-step tests showed less than 0.1% total
770 !> runtime difference. The original path is still available by setting this to
771 !> false; if batching remains stable in broader tests, the old path can be
772 !> removed later.
773 logical :: ghostcell_comm_batched=.true.
775 !> True for record electric field
776 logical :: record_electric_field=.false.
777
778 !> resolution of the images
779 logical :: dat_resolution
780 !> output optical-depth map for synthetic emission when available
781 logical :: output_tau
782 !> output absorption fraction for thick/thin EUV synthesis when available
784
785 !> If collapse(DIM) is true, generate output integrated over DIM
786 logical :: collapse(ndim)
787 !> IO switches for conversion
788 logical :: nocartesian
789
790 !> Use particles module or not
791 logical :: use_particles=.false.
792
793 !> Use multigrid (only available in 2D and 3D)
794 logical :: use_multigrid = .false.
795
796 !> prolongate primitive variables in level-jump ghost cells
797 logical :: prolongprimitive=.false.
798
799 !> coarsen primitive variables in level-jump ghost cells
800 logical :: coarsenprimitive=.false.
801
802 !> Save a snapshot before crash a run met unphysical values
803 logical :: crash=.false.
804
805 !> check and optionally fix unphysical small values (density, gas pressure)
806 logical :: check_small_values=.true.
807
808 !> fix small values with average or replace methods
809 logical :: fix_small_values=.false.
810
811 !> split magnetic field as background B0 field
812 logical :: b0field=.false.
813 logical :: b0fieldalloccoarse=.false.
814 !> Use SI units (.true.) or use cgs units (.false.)
815 logical :: si_unit=.false.
816
817 !> Use TRAC for MHD or 1D HD
818 logical :: phys_trac=.false.
819
820 !> Use escape probability for radiative cooling modification
821 logical :: phys_escape_prob=.false.
822
823 !> Whether to apply flux conservation at refinement boundaries
824 logical :: fix_conserve_global = .true.
826 double precision :: flux_adaptive_diffusion_min
830 !> Use split or unsplit way to add user's source terms, default: unsplit
832 !> if any normal source term is added in split fasion
833 logical :: any_source_split=.false.
834 logical :: dimsplit
835 !> whether IMEX in use or not
837
838 !> need global maximal wave speed
839 logical :: need_global_cmax=.false.
840
841 ! Boundary region parameters
842
843 !> True for dimensions with periodic boundaries
844 logical :: periodb(ndim)
845
846 !> Indicates whether there is a pole at a boundary
847 logical :: poleb(2,ndim)
848
849 !> True for dimensions with aperiodic boundaries
850 logical :: aperiodb(ndim)
851
852 !> True for save physical boundary cells in dat files
854
855 !> whether copy values instead of interpolation in ghost cells of finer blocks
856 logical :: ghost_copy=.false.
857
858 !> if there is an internal boundary
860
861 !> use arcsec as length unit of images/spectra
863 !> big image
864 logical :: big_image
865
866 !> True if a block has any physical boundary
867 logical, allocatable :: phyboundblock(:)
868
869 !> if true write the w variable in output
870 logical, allocatable :: w_write(:)
871
872 logical, allocatable :: writelevel(:)
873
874 logical, allocatable :: loglimit(:), logflag(:)
875
876 ! Parameters
877 character(len=*), parameter :: undefined = 'undefined'
878
879 !> Names of the output methods
880 character(len=40), parameter :: output_names(nfile) = &
881 ['log ', 'normal ', 'slice ', 'collapsed', 'analysis ']
882 !> Which format to use when converting
883 !>
884 !> Options are: tecplot, tecplotCC, vtu, vtuCC, vtuB, vtuBCC,
885 !> tecplotmpi, tecplotCCmpi, vtumpi, vtuCCmpi, vtuBmpi, vtuBCCmpi, pvtumpi, pvtuCCmpi,
886 !> pvtuBmpi, pvtuBCCmpi, tecline, teclinempi, onegrid
887 character(len=std_len) :: convert_type
888
889 character(len=std_len) :: collapse_type
890
891 !> User parameter file
892 character(len=std_len) :: usr_filename
893
894 !> Base file name for simulation output, which will be followed by a number
895 character(len=std_len) :: base_filename
896
897 !> If not 'unavailable', resume from snapshot with this base file name
898 character(len=std_len) :: restart_from_file
899
900 !> Which type of log to write: 'normal', 'special', 'regression_test'
901 character(len=std_len) :: typefilelog
902
903 character(len=std_len) :: typeaverage
904 character(len=std_len) :: typedimsplit
905 character(len=std_len) :: geometry_name='default'
906 character(len=std_len) :: typepoly
907 !> Base file name for synthetic EUV emission output
908 character(len=std_len) :: filename_euv
909 !> Base file name for synthetic SXR emission output
910 character(len=std_len) :: filename_sxr
911 !> Base file name for synthetic white light
912 character(len=std_len) :: filename_whitelight
913 !> white light observation instrument
914 character(len=std_len) :: whitelight_instrument
915
916 !> Which type of TVD method to use
917 character(len=std_len) :: typetvd
918
919 character(len=std_len) :: typediv,typegrad
920
921 !> Which par files are used as input
922 character(len=std_len), allocatable :: par_files(:)
923
924 !> Which type of entropy fix to use with Riemann-type solvers
925 character(len=std_len), allocatable :: typeentropy(:)
926
927 !> Block pointer for using one block and its previous state
928 type(state), pointer :: block
929
930 !$OMP THREADPRIVATE(block,dxlevel,b0i)
931
932contains
933
934 !> Cross product of two vectors
935 pure subroutine cross_product(ixI^L,ixO^L,a,b,axb)
936 integer, intent(in) :: ixi^l, ixo^l
937 double precision, intent(in) :: a(ixi^s,3), b(ixi^s,3)
938 double precision, intent(out) :: axb(ixi^s,3)
939
940 axb(ixo^s,1)=a(ixo^s,2)*b(ixo^s,3)-a(ixo^s,3)*b(ixo^s,2)
941 axb(ixo^s,2)=a(ixo^s,3)*b(ixo^s,1)-a(ixo^s,1)*b(ixo^s,3)
942 axb(ixo^s,3)=a(ixo^s,1)*b(ixo^s,2)-a(ixo^s,2)*b(ixo^s,1)
943 end subroutine cross_product
944
945end module mod_global_parameters
Module with basic data types used in amrvac.
This module contains variables that describe the connectivity of the mesh and also data structures fo...
Module for physical and numeric constants.
This module contains definitions of global parameters and variables and some generic functions/subrou...
character(len=std_len), dimension(:), allocatable typeentropy
Which type of entropy fix to use with Riemann-type solvers.
double precision, dimension(nfile) tsavelast
double precision, dimension(:), allocatable w_convert_factor
Conversion factors the primitive variables.
type(state), pointer block
Block pointer for using one block and its previous state.
double precision xload
Stores the memory and load imbalance, used in printlog.
integer nstep
How many sub-steps the time integrator takes.
logical h_correction
If true, do H-correction to fix the carbuncle problem at grid-aligned shocks.
integer it_max
Stop the simulation after this many time steps have been taken.
logical, dimension(ndim) aperiodb
True for dimensions with aperiodic boundaries.
logical internalboundary
if there is an internal boundary
double precision r_opt_thick
for spherical coordinate, region below it (unit=Rsun) is treated as not transparent
character(len=std_len) filename_sxr
Base file name for synthetic SXR emission output.
integer spectrum_wl
wave length for spectrum
logical nocartesian
IO switches for conversion.
double precision arad_norm
Normalised radiation constant.
double precision ppm_rjv
Residual-jump velocity reconstruction (RJV). 0 = off (default), 1 = full strength.
integer, dimension(:), allocatable typepred1
The spatial discretization for the predictor step when using a two step PC method.
double precision dtdiffpar
For resistive MHD, the time step is also limited by the diffusion time: .
character(len=std_len) typegrad
integer ixgshi
Upper index of stagger grid block arrays.
logical reset_it
If true, reset iteration count to 0.
double precision unit_charge
Physical scaling factor for charge.
integer, parameter bc_noinflow
integer type_coarse_block
MPI type for block coarsened by 2, and for its children blocks.
integer ixghi
Upper index of grid block arrays.
integer, parameter stretch_uni
Unidirectional stretching from a side.
pure subroutine cross_product(ixil, ixol, a, b, axb)
Cross product of two vectors.
character(len=std_len) geometry_name
integer, dimension(3, 3, 3) lvc
Levi-Civita tensor.
double precision unit_time
Physical scaling factor for time.
double precision, dimension(:), allocatable costlist
Persistent global per-Morton-leaf EWMA cost, in seconds (block_cost is a wall-clock accumulation)....
double precision unit_density
Physical scaling factor for density.
logical activate_unit_arcsec
use arcsec as length unit of images/spectra
character(len=std_len) typepoly
logical source_split_usr
Use split or unsplit way to add user's source terms, default: unsplit.
integer, parameter imex_euler
logical lb_diagnose
Per-rank load-balance timing diagnostic toggle (off by default). When .true., per-rank wall times are...
double precision unit_opacity
Physical scaling factor for Opacity.
integer domain_nx
number of cells for each dimension in level-one mesh
integer, parameter unitpar
file handle for IO
double precision, dimension(:), allocatable block_cost
Per-step per-block (per-rank, indexed by igrid) cost accumulator. Reset at start of each advance call...
character(len=std_len) filename_spectrum
Base file name for synthetic EUV spectrum output.
logical, dimension(nfile) save_file
whether or not to save an output file
logical any_source_split
if any normal source term is added in split fasion
logical resume_previous_run
If true, restart a previous run from the latest snapshot.
double precision global_time
The global simulation time.
integer type_block_xc_io
MPI type for IO: cell corner (xc) or cell center (xcc) coordinates.
integer, dimension(nsavehi, nfile) itsave
Save output of type N on iterations itsave(:, N)
double precision unit_mass
Physical scaling factor for mass.
logical use_imex_scheme
whether IMEX in use or not
integer istep
Index of the sub-step in a multi-step time integrator.
double precision time_max
End time for the simulation.
logical output_absorption_fraction
output absorption fraction for thick/thin EUV synthesis when available
double precision radio_beam_fwhm
Gaussian radio beam full width at half maximum in arcsec.
logical, dimension(:), allocatable costlist_seen
Whether the matching costlist slot has ever carried a measurement. Morton indices created by a refine...
integer, dimension(3, 3) kr
Kronecker delta tensor.
double precision xstretch
physical extent of stretched border in symmetric stretching
double precision lb_max_block_ratio
Bound on the memory imbalance get_Morton_range_costed may create: no rank may hold more than lb_max_b...
logical, dimension(:), allocatable logflag
double precision time_init
Start time for the simulation.
logical stretch_uncentered
If true, adjust mod_geometry routines to account for grid stretching (but the flux computation will n...
logical firstprocess
If true, call initonegrid_usr upon restarting.
integer snapshotini
Resume from the snapshot with this index.
double precision small_temperature
error handling
double precision xprob
minimum and maximum domain boundaries for each dimension
integer it
Number of time steps taken.
character(len=std_len) filename_euv
Base file name for synthetic EUV emission output.
logical, dimension(:), allocatable loglimit
double precision, dimension(:), allocatable dg
extent of grid blocks in domain per dimension, in array over levels
integer, parameter bc_character
integer it_init
initial iteration count
integer, dimension(:, :), allocatable typeboundary
Array indicating the type of boundary condition per variable and per physical boundary.
integer ditregrid
Reconstruct the AMR grid once every ditregrid iteration(s)
logical instrument_postprocess
Post-process dat-resolution EUV images onto the instrument pixel grid.
logical saveprim
If true, convert from conservative to primitive variables in output.
double precision ars_gamma
IMEX_ARS3 parameter ars_gamma.
double precision unit_numberdensity
Physical scaling factor for number density.
double precision flux_adaptive_diffusion_min
character(len=std_len) filename_whitelight
Base file name for synthetic white light.
character(len=std_len) convert_type
Which format to use when converting.
double precision unit_pressure
Physical scaling factor for pressure.
integer, parameter type_maxsum
integer switchers for type courant
integer, parameter ndim
Number of spatial dimensions for grid variables.
integer itfixgrid
Fix the AMR grid after this many time steps.
integer, parameter filecollapse_
Constant indicating collapsed output.
integer prolong_limiter
Limiter used for prolongation to refined grids and ghost cells.
double precision, dimension(:), allocatable amr_wavefilter
refinement: lohner estimate wavefilter setting
double precision unit_length
Physical scaling factor for length.
integer, parameter nlevelshi
The maximum number of levels in the grid refinement.
double precision location_slit
location of the slit
logical save_physical_boundary
True for save physical boundary cells in dat files.
double precision vmax_global
global fastest flow speed needed in glm method
logical phys_escape_prob
Use escape probability for radiative cooling modification.
logical stagger_grid
True for using stagger grid.
double precision const_rad_a
Physical factors useful for radiation fld.
double precision cmax_global
global fastest wave speed needed in fd scheme and glm method
double precision time_convert_factor
Conversion factor for time unit.
logical, dimension(:), allocatable phyboundblock
True if a block has any physical boundary.
integer, dimension(:,:), allocatable nstretchedblocks
(even) number of (symmetrically) stretched blocks per level and dimension
integer, dimension(^nd, 2^d &) type_coarse_block_stg
MPI type for staggered block coarsened by 2, and for its children blocks.
logical use_particles
Use particles module or not.
character(len=std_len), dimension(:), allocatable par_files
Which par files are used as input.
integer icomm
The MPI communicator.
logical coarsenprimitive
coarsen primitive variables in level-jump ghost cells
integer, dimension(:), allocatable ng
number of grid blocks in domain per dimension, in array over levels
logical reset_time
If true, reset iteration count and global_time to original values, and start writing snapshots at ind...
double precision bdip
amplitude of background dipolar, quadrupolar, octupolar, user's field
integer b0i
background magnetic field location indicator
integer, parameter imex_trapezoidal
integer, parameter nsavehi
Maximum number of saves that can be defined by tsave or itsave.
logical ghostcell_comm_batched
Limit outstanding ghost-cell send requests to avoid MPI request pressure. In large-scale MHD tests,...
character(len=std_len) whitelight_instrument
white light observation instrument
integer mype
The rank of the current MPI task.
double precision dtpar
If dtpar is positive, it sets the timestep dt, otherwise courantpar is used to limit the time step ba...
integer, dimension(1:nfile) n_saves
Number of saved files of each type.
character(len=std_len) typediv
integer block_nx
number of cells for each dimension in grid block excluding ghostcells
integer type_block_io
MPI type for IO: block excluding ghost cells.
double precision, dimension(nfile) tsavestart
Start of read out (not counting specified read outs)
integer, dimension(nfile) ditsave
Repeatedly save output of type N when ditsave(N) time steps have passed.
integer, dimension(2^d &) type_sub_block
logical, dimension(ndim) collapse
If collapse(DIM) is true, generate output integrated over DIM.
integer, parameter unitstdin
Unit for standard input.
logical local_timestep
each cell has its own timestep or not
double precision dt
global time step
double precision radio_frequency
Observing frequency for radio free-free synthesis in Hz.
integer refine_criterion
select types of refine criterion
character(len=std_len) usr_filename
User parameter file.
logical ghost_copy
whether copy values instead of interpolation in ghost cells of finer blocks
integer slicenext
IO: slice output number/label.
double precision length_convert_factor
Conversion factor for length unit.
integer, parameter nodehi
grid hierarchy info (level and grid indices)
integer ndir
Number of spatial dimensions (components) for vector variables.
integer, parameter uniterr
Unit for error messages.
double precision imex222_lambda
IMEX-222(lambda) one-parameter family of schemes.
double precision courantpar
The Courant (CFL) number used for the simulation.
double precision wall_time_max
Ending wall time (in hours) for the simulation.
integer ixm
the mesh range of a physical block without ghost cells
integer ierrmpi
A global MPI error return code.
logical autoconvert
If true, already convert to output format during the run.
integer, dimension(:), allocatable flux_method
Which flux scheme of spatial discretization to use (per grid level)
double precision, dimension(:), allocatable, parameter d
character(len=std_len) collapse_type
logical slab
Cartesian geometry or not.
integer slowsteps
If > 1, then in the first slowsteps-1 time steps dt is reduced by a factor .
integer ssprk_order
SSPRK choice of methods (both threestep and fourstep, Shu-Osher 2N* implementation) also fivestep SSP...
double precision image_rotate
rotation of image
double precision, dimension(:,:), allocatable qstretch
Stretching factors and first cell size for each AMR level and dimension.
integer, parameter bc_periodic
integer type_block_wc_io
MPI type for IO: cell corner (wc) or cell center (wcc) variables.
double precision radio_beam_pixel_size
Output pixel size for radio beam post-processing in arcsec; <=0 uses FWHM/3.
integer type_courant
How to compute the CFL-limited time step.
integer, parameter bc_special
boundary condition types
integer snapshotnext
IO: snapshot and collapsed views output numbers/labels.
double precision unit_magneticfield
Physical scaling factor for magnetic field.
integer, parameter unitanalysis
logical, dimension(ndim) stretched_dim
True if a dimension is stretched.
logical dat_resolution
resolution of the images
double precision r_occultor
the white light emission below it (unit=Rsun) is not visible
integer, dimension(ndim) nstretchedblocks_baselevel
(even) number of (symmetrically) stretched blocks at AMR level 1, per dimension
integer npe
The number of MPI tasks.
logical output_tau
output optical-depth map for synthetic emission when available
double precision, dimension(^nd) qstretch_baselevel
stretch factor between cells at AMR level 1, per dimension
integer nwauxio
Number of auxiliary variables that are only included in output.
double precision unit_velocity
Physical scaling factor for velocity.
integer index_latest_data
index number of the latest existing data file
integer, dimension(nfile) itsavelast
integer, parameter stretch_none
No stretching.
integer imex_switch
IMEX_232 choice and parameters.
integer, parameter fs_hll
flux schemes
double precision time_between_print
to monitor timeintegration loop at given wall-clock time intervals
integer, parameter unitterm
Unit for standard output.
logical lb_automatic
Cost-weighted automatic load balancer toggle (off by default). When .true., the SFC partitioner cuts ...
double precision, dimension(nfile) dtsave
Repeatedly save output of type N when dtsave(N) simulation time has passed.
integer lb_interval
Rebalance every lb_interval cycles when lb_automatic is on.
logical, dimension(:), allocatable w_write
if true write the w variable in output
logical time_advance
do time evolving
logical prolongprimitive
prolongate primitive variables in level-jump ghost cells
integer iprob
problem switch allowing different setups in same usr_mod.t
character(len=std_len) restart_from_file
If not 'unavailable', resume from snapshot with this base file name.
logical, dimension(ndim) periodb
True for dimensions with periodic boundaries.
double precision c_norm
Normalised speed of light.
integer radsyn_segment_batch_factor
Maximum ray segments per pixel batch, as a factor of radsyn_pixel_batch; <=0 uses memory budget....
logical b0field
split magnetic field as background B0 field
double precision, dimension(:,:), allocatable rnode
Corner coordinates.
integer, parameter filelog_
Constant indicating log output.
character(len=40), dimension(nfile), parameter output_names
Names of the output methods.
double precision unit_temperature
Physical scaling factor for temperature.
double precision unit_radflux
Physical scaling factor for radiation flux.
integer, dimension(:), allocatable type_limiter
Type of slope limiter used for reconstructing variables on cell edges.
double precision, dimension(10) phys_trac_zone_splits
logical final_dt_reduction
If true, allow final dt reduction for matching time_max on output.
logical si_unit
Use SI units (.true.) or use cgs units (.false.)
double precision, dimension(:), allocatable block_cost_rt
Per-step per-block cost of the short-characteristics sweep, indexed by igrid. Separate from block_cos...
logical, dimension(:), allocatable writelevel
integer, parameter unitcollapse
integer, parameter fileout_
Constant indicating regular output.
double precision los_theta
direction of the line of sight (LOS)
integer, parameter type_summax
character(len=std_len) typetvd
Which type of TVD method to use.
integer nbufferx
Number of cells as buffer zone.
double precision, dimension(:), allocatable entropycoef
double precision time_bc
accumulated wall-clock time spent on boundary conditions
double precision, dimension(:,:), allocatable dx
spatial steps for all dimensions at all levels
integer type_block
MPI type for block including ghost cells and its size.
double precision rk_a21
RK2(alfa) method parameters from Butcher tableau.
integer, parameter predictor_corrector
double precision tfixgrid
Fix the AMR grid after this time.
character(len=std_len) dat_resolution_mode
Data-resolution image spacing: nominal or minimum actual cell size.
integer, parameter unitsnapshot
character(len=std_len) radiation_transfer
Synthetic emission transfer mode: thin or thick.
integer nghostcells
Number of ghost cells surrounding a grid.
double precision, dimension(:), allocatable w_refine_weight
Weights of variables used to calculate error for mesh refinement.
integer, parameter sdim
starting dimension for electric field
double precision flux_adaptive_diffusion_scale
integer, parameter forward_euler
logical phys_trac
Use TRAC for MHD or 1D HD.
logical fix_conserve_global
Whether to apply flux conservation at refinement boundaries.
character(len=std_len) typedimsplit
character(len=std_len) typeaverage
character(len= *), parameter undefined
double precision, dimension(nsavehi, nfile) tsave
Save output of type N on times tsave(:, N)
double precision spectrum_window_max
logical need_global_cmax
need global maximal wave speed
logical convert
If true and restart_from_file is given, convert snapshots to other file formats.
logical fix_small_values
fix small values with average or replace methods
integer wavelength
wavelength for output
integer collapselevel
The level at which to produce line-integrated / collapsed output.
logical reset_grid
If true, rebuild the AMR grid upon restarting.
integer, dimension(ndim) stretch_type
What kind of stretching is used per dimension.
logical crash
Save a snapshot before crash a run met unphysical values.
double precision, dimension(^nd) dxlevel
store unstretched cell size of current level
integer t_stepper
time stepper type
double precision, dimension(:,:), allocatable rnode_sub
logical use_multigrid
Use multigrid (only available in 2D and 3D)
integer radsyn_pixel_batch
Number of image pixels processed in one ray-segment MPI batch.
logical slab_uniform
uniform Cartesian geometry or not (stretched Cartesian)
logical radsyn_verbose
Print synthetic-emission ray-tracing profiling counters.
double precision, dimension(:), allocatable refine_threshold
Error tolerance for refinement decision.
character(len=std_len) base_filename
Base file name for simulation output, which will be followed by a number.
integer, parameter rnodehi
grid location info (corner coordinates and grid spacing)
double precision instrument_resolution_factor
times for enhancing spatial resolution for EUV image/spectra
double precision ppm_avisc
Coefficient alpha of the explicit diffusive flux of Mignone et al. 2005 eq. B19-B21,...
double precision radsyn_segment_memory_mb
Approximate per-rank temporary memory budget, in MiB, for automatic ray-segment batch sizing.
double precision spectrum_window_min
spectral window
double precision dtmin
Stop the simulation when the time step becomes smaller than this value.
integer refine_max_level
Maximal number of AMR levels.
integer, parameter fileslice_
Constant indicating slice output.
character(len=std_len) ray_method
Synthetic emission ray traversal method.
double precision, dimension(:), allocatable derefine_ratio
Error tolerance ratio for derefinement decision.
integer, parameter nfile
Number of output methods.
integer max_blocks
The maximum number of grid blocks in a processor.
integer, parameter stretch_symm
Symmetric stretching around the center.
integer, parameter fileanalysis_
Constant indicating analysis output (see Writing a custom analysis subroutine)
logical allow_ndir_change
If true, allow a restart from a snapshot whose ndir differs from the current run (e....
integer r_
Indices for cylindrical coordinates FOR TESTS, negative value when not used:
integer rk3_switch
RK3 Butcher table.
integer, parameter bc_aperiodic
character(len=std_len) typefilelog
Which type of log to write: 'normal', 'special', 'regression_test'.
double precision imex_a22
IMEX_CB3a extra parameters.
integer direction_slit
direction of the slit (for dat resolution only)
integer type_block_io_stg
MPI type for IO of staggered variables.
logical, dimension(2, ndim) poleb
Indicates whether there is a pole at a boundary.
integer boundspeed
bound (left/min and right.max) speed of Riemann fan
logical pass_wall_time
If true, wall time is up, modify snapshotnext for later overwrite.
integer, parameter ixgslo
Lower index of stagger grid block arrays (always 0)
double precision, dimension(1:3) x_origin
where the is the origin (X=0,Y=0) of image
double precision, dimension(^nd, 2) writespshift
domain percentage cut off shifted from each boundary when converting data
character(len=std_len) emission_model
Synthetic emission physical model selector.
logical record_electric_field
True for record electric field.
double precision lb_rt_accum
Per-rank wall time spent in the SC radiative-transfer KBA sweep this step, for the lb_diagnose rank-t...
integer, parameter unitconvert
double precision unit_erad
Physical scaling factor for radiation energy density.
double precision, dimension(:,:), allocatable dxfirst
integer t_integrator
time integrator method
integer, parameter fs_hancock
logical final_dt_exit
Force timeloop exit when final dt < dtmin.
integer, dimension(nfile) isaveit
integer, dimension(:), allocatable type_gradient_limiter
Type of slope limiter used for computing gradients or divergences, when typegrad or typediv are set t...
integer number_equi_vars
number of equilibrium set variables, besides the mag field
integer, dimension(:,:), allocatable node
integer, dimension(:,:), allocatable node_sub
integer radsyn_segment_comm_factor
Maximum ray segments per segmented MPI all-to-all round, as a factor of radsyn_pixel_batch.
integer, parameter type_minimum
double precision lb_alpha
Exponential-moving-average decay for the per-block cost. costlist <- lb_alpha*costlist + (1-lb_alpha)...
integer, dimension(nfile) isavet
integer, parameter imex_midpoint
double precision, dimension(:,:), allocatable dxfirst_1mq
logical check_small_values
check and optionally fix unphysical small values (density, gas pressure)
double precision, dimension(:,:), allocatable dxmid
integer, parameter ixglo
Lower index of grid block arrays (always 1)
integer log_fh
MPI file handle for logfile.