# name   type   default   need in Fortran?   ifdef    fortran name    fortran type
#
# note, name can have two values, as (a, b).  a will be the name used
# in the inputs file, b is the variable name in the C++ class.


@namespace: castro Castro static

#-----------------------------------------------------------------------------
# category: AMR
#-----------------------------------------------------------------------------

# highest order used in interpolation
state_interp_order           int           1

# how to do limiting of the state data when interpolating
# 0: only prevent new extrema
# 1: preserve linear combinations of state variables
lin_limit_state_interp       int           0

# Number of ghost zones for state data to have. Note that
# if you are using radiation, choosing this to be zero will
# be overridden since radiation needs at least one ghost zone.
state_nghost                 int           0

# do we do the hyperbolic reflux at coarse-fine interfaces?
do_reflux                    int           1

# whether to re-compute new-time source terms after a reflux
# Note: this only works for the CTU and simple-SDC time_integration_method
# drivers
update_sources_after_reflux  int           1

# should we apply the sources one by one or all at once?
apply_sources_consecutively  int           0

# should we have state data for custom load-balancing weighting?
use_custom_knapsack_weights  int           0

#-----------------------------------------------------------------------------
# category: hydrodynamics
#-----------------------------------------------------------------------------

# the coefficient of the artificial viscosity
difmag                       Real          0.1                y

# the small density cutoff.  Densities below this value will be reset
small_dens                   Real         -1.e200             y

# the small temperature cutoff.  Temperatures below this value will
# be reset
small_temp                   Real         -1.e200             y

# the small pressure cutoff.  Pressures below this value will be reset
small_pres                   Real         -1.e200             y

# the small specific internal energy cutoff.  Internal energies below this
# value will be reset
small_ener                   Real         -1.e200             y

# permits hydro to be turned on and off for running pure rad problems
do_hydro                     int          -1                  y

# how do we advance in time? 0 = CTU + Strang, 1 is not used, 2 = SDC, 3 = simplified-SDC
time_integration_method      int           0                  y

# do we use a limiter with the fourth-order accurate reconstruction?
limit_fourth_order           int           1                  y

# for fourth order, we usually assume that the initialization is done
# to cell centers and we convert to cell-averages.  With this option,
# we take the initialization as cell-averages (except for T, which we
# compute to fourth-order through the EOS after initialization).
initialization_is_cell_average  int        0                  n

# should we use a reconstructed version of Gamma_1 in the Riemann
# solver? or the default zone average (requires SDC
# integration, since we do not trace)
use_reconstructed_gamma1     int           0                  y

# if true, define an additional source term
add_ext_src                  int           0

# whether to use the hybrid advection scheme that updates
# z-angular momentum, cylindrical momentum, and azimuthal
# momentum (3D only)
hybrid_hydro                 int           0                  y

# reconstruction type:
# 0: piecewise linear;
# 1: classic Colella \& Woodward ppm;
# 2: extrema-preserving ppm
ppm_type                     int           1                  y

# various methods of giving temperature a larger role in the
# reconstruction---see Zingale \& Katz 2015
ppm_temp_fix                 int           0                  y

# do we construct :math:`\gamma_e = p/(\rho e) + 1` and bring it
# to the interfaces for additional thermodynamic information
# (this is the Colella \& Glaz technique) or do we use :math:`(\rho e)`
# (the classic \castro\ behavior).  Note this also uses
# :math:`\tau = 1/\rho` instead of :math:`\rho`.
ppm_predict_gammae           int           0                  y

# for piecewise linear, reconstruction order to use
# 1 = piecewise constant, 2 = piecewise linear
plm_iorder                   int           2                  y

# for piecewise linear, what limiter to use?
# 1 = 2nd order MC, 2 = 4th order MC
plm_limiter                  int           2                  y

# for piecewise linear, MOL or SDC, do well-balanced reconstruction on
# pressure
plm_well_balanced            int           0                  y

# do we drop from our regular Riemann solver to HLL when we
# are in shocks to avoid the odd-even decoupling instability?
hybrid_riemann               int           0                  y

# which Riemann solver do we use:
# 0: Colella, Glaz, \& Ferguson (a two-shock solver);
# 1: Colella \& Glaz (a two-shock solver)
# 2: HLLC
riemann_solver               int           0                  y

# for the Colella \& Glaz Riemann solver, the maximum number
# of iterations to take when solving for the star state
cg_maxiter                   int          12                  y

# for the Colella \& Glaz Riemann solver, the tolerance to
# demand in finding the star state
cg_tol                       Real          1.0e-5             y

# for the Colella \& Glaz Riemann solver, what to do if
# we do not converge to a solution for the star state.
# 0 = do nothing; print iterations and exit
# 1 = revert to the original guess for p-star
# 2 = do a bisection search for another 2 * cg_maxiter iterations.
cg_blend                     int           2                  y

# should we use the EOS in the Riemann solver to ensure
# thermodynamic consistency?
use_eos_in_riemann           int           0                  y

# flatten the reconstructed profiles around shocks to prevent them
# from becoming too thin
use_flattening               int           1                  y

# after we add the transverse correction to the interface states, replace
# the predicted pressure with an EOS call (using :math:`e` and :math:`\rho`).
transverse_use_eos           int           0                  y

# if the transverse interface state correction, if the new density is
# negative, then replace all of the interface quantities with their
# values without the transverse correction.
transverse_reset_density     int           1                  y

# if the interface state for :math:`(\rho e)` is negative after we add the
# transverse terms, then replace the interface value of :math:`(\rho e)`
# with a value constructed from the :math:`(\rho e)` evolution equation
transverse_reset_rhoe        int           0                  y

# Threshold value of (E - K) / E such that above eta1, the hydrodynamic
# pressure is derived from E - K; otherwise, we use the internal energy
# variable UEINT.
dual_energy_eta1             Real          1.0e0              y

# Threshold value of (E - K) / E such that above eta2, we update the
# internal energy variable UEINT to match E - K. Below this, UEINT
# remains unchanged.
dual_energy_eta2             Real          1.0e-4             y

# for the piecewise linear reconstruction, do we subtract off :math:`(\rho g)`
# from the pressure before limiting?
use_pslope                   int           1                  y

# Should we limit the density fluxes so that we do not create small densities?
limit_fluxes_on_small_dens   int           0                  y

# Should we limit the momentum fluxes so that we do not create large velocities?
limit_fluxes_on_large_vel    int           0                  y

# If we're limiting the fluxes to avoid large velocities, this is the speed limit.
speed_limit                  Real          2.99792458e10      y

# Which method to use when resetting a negative/small density
# 1 = Reset to characteristics of adjacent zone with largest density
# 2 = Use average of all adjacent zones for all state variables
density_reset_method         int           1                  y

# Whether or not to allow the internal energy to be less than the
# internal energy corresponding to small_temp
allow_small_energy           int           1                  y

# permits sponge to be turned on and off
do_sponge                    int           0                  y

# if we are using the sponge, whether to use the implicit solve for it
sponge_implicit              int           1                  y

# if we are using user-defined source terms, are these solved implicitly?
ext_src_implicit             int           0                  y

# extrapolate the source terms (gravity and rotation) to :math:`n+1/2`
# timelevel for use in the interface state prediction
source_term_predictor        int           0

# set the flattening parameter to zero to force the reconstructed profiles
# to be flat, resulting in a first-order method
first_order_hydro            int           0                  y

# if we are doing an external -x boundary condition, who do we interpret it?
xl_ext_bc_type               string        ""                 y

# if we are doing an external +x boundary condition, who do we interpret it?
xr_ext_bc_type               string        ""                 y

# if we are doing an external -y boundary condition, who do we interpret it?
yl_ext_bc_type               string        ""                 y

# if we are doing an external +y boundary condition, who do we interpret it?
yr_ext_bc_type               string        ""                 y

# if we are doing an external -z boundary condition, who do we interpret it?
zl_ext_bc_type               string        ""                 y

# if we are doing an external +z boundary condition, who do we interpret it?
zr_ext_bc_type               string        ""                 y

# if we are doing HSE boundary conditions, do we zero the velocity?
hse_zero_vels                int           0                  y

# if we are doing HSE boundary conditions, should we get the temperature
# via interpolation (using model_parser) or hold it constant?
hse_interp_temp              int           0                  y

# if we are doing HSE boundary conditions, how do we treat the velocity?
# reflect? or outflow?
hse_reflect_vels             int           0                  y

# integration order for SDC integration
# valid options are 2 and 4
sdc_order                    int           2                  y

# which quadrature type to use with SDC?  0 = Gauss-Lobatto, 1 = Radau
sdc_quadrature               int           0                  y

# number of extra SDC iterations to take beyond the order
sdc_extra                    int           0                  y

# which SDC nonlinear solver to use?  1 = Newton, 2 = VODE, 3 = VODE for first iter
sdc_solver                   int           1                  y

# relative tolerance for the nonlinear solve on rho with SDC
sdc_solver_tol_dens           Real          1.e-6              y

# relative tolerance for the nonlinear solve on rho X_k with SDC
sdc_solver_tol_spec           Real          1.e-6              y

# relative tolerance for the nonlinear solve on (rho e) or (rho E) with SDC
sdc_solver_tol_ener           Real          1.e-6              y

# absolute tolerance for species with SDC (this will be multiplied by
# the current rho in the zone to define the absolute tolerance on (rho
# X)).
sdc_solver_atol               Real          1.e-10              y

# factor by which to reduce the SDC solver tol for each iteration before the last
# (e.g., for iteration k out of kmax iterations, the tol is
# :math:`\epsilon/f^{(k_\mathrm{max} - k)}`
sdc_solver_relax_factor      Real          1.0                y

# do we solve for (rho e) or (rho E) in the SDC nonlinear solve?
sdc_solve_for_rhoe           int           1                  y

# do we use the analytic or numerical Jacobian?
sdc_use_analytic_jac         int           1                  y

#-----------------------------------------------------------------------------
# category: timestep control
#-----------------------------------------------------------------------------

# a fixed timestep to use for all steps (negative turns it off)
fixed_dt                     Real         -1.0

# the initial timestep (negative uses the step returned from the timestep
# constraints)
initial_dt                   Real         -1.0

# the smallest valid timestep---if we go below this, we abort
dt_cutoff                    Real          0.0

# the largest valid timestep---limit all timesteps to be no larger than this
max_dt                       Real          1.e200

# the effective Courant number to use---we will not allow the hydrodynamic
# waves to cross more than this fraction of a zone over a single timestep
cfl                          Real          0.8                y

# a factor by which to reduce the first timestep from that requested by
# the timestep estimators
init_shrink                  Real          1.0

# the maximum factor by which the timestep can increase from one step to
# the next.
change_max                   Real          1.1

# enforce that the AMR plot interval must be hit exactly
plot_per_is_exact            int           0

# enforce that the AMR small plot interval must be hit exactly
small_plot_per_is_exact      int           0

# Retry a timestep if it violated the timestep-limiting criteria over
# the course of an advance. The criteria will suggest a new timestep
# that satisfies the criteria, and we will do subcycled timesteps
# on the same level until we reach the original target time.
use_retry                    int           0

# Tolerance to use when evaluating whether to do a retry.
# The timestep suggested by the retry will be multiplied by
# (1 + this factor) before comparing the actual timestep to it.
# If set to some number slightly larger than zero, then this
# prevents retries that are caused by small numerical differences.
retry_tolerance              Real          0.02

# If we're doing retries, set the target threshold for changes in density
# if a retry is triggered by a negative density. If this is set to a negative
# number then it will disable retries using this criterion.
retry_neg_dens_factor        Real          1.e-1

# When performing a retry, the factor to multiply the current
# timestep by when trying again.
retry_subcycle_factor        Real          0.5

# Check for a possible post-timestep regrid if certain stability
# criteria were violated.
use_post_step_regrid         int           0

# Do not permit more subcycled timesteps than this parameter.
# Set to a negative value to disable this criterion.
max_subcycles                int           10

# Number of iterations for the SDC advance.
sdc_iters                    int           2

#-----------------------------------------------------------------------------
# category: reactions
#-----------------------------------------------------------------------------

# Limit the timestep based on how much the burning can change the internal
# energy of a zone. The timestep is equal to
# ``dtnuc``  :math:`\cdot\,(e / \dot{e})`.
dtnuc_e                      Real          1.e200             y

# Limit the timestep based on how much the burning can change the species
# mass fractions of a zone. The timestep is equal to
# ``dtnuc``  :math:`\cdot\,(X / \dot{X})`.
dtnuc_X                      Real          1.e200             y

# If we are using the timestep limiter based on changes in $X$, set a threshold
# on the species abundance below which the limiter is not applied. This helps
# prevent the timestep from becoming very small due to changes in trace species.
dtnuc_X_threshold            Real          1.e-3              y

# permits reactions to be turned on and off -- mostly for efficiency's sake
do_react                     int          -1                  y

# minimum temperature for allowing reactions to occur in a zone
react_T_min                  Real          0.0                y

# maximum temperature for allowing reactions to occur in a zone
react_T_max                  Real          1.e200             y

# minimum density for allowing reactions to occur in a zone
react_rho_min                Real          0.0                y

# maximum density for allowing reactions to occur in a zone
react_rho_max                Real          1.e200             y

# disable burning inside hydrodynamic shock regions
disable_shock_burning        int           0                  y

# initial guess for the temperature when inverting the EoS (e.g. when
# calling eos_input_re)
T_guess                     Real           1.e8               y

#-----------------------------------------------------------------------------
# category: diffusion
#-----------------------------------------------------------------------------

# enable thermal diffusion
diffuse_temp                 int           0                  y     DIFFUSION

# set a cutoff density for diffusion -- we zero the term out below this density
diffuse_cutoff_density       Real          -1.e200            y     DIFFUSION

# secondary cutoff density -- there will be a linear dropoff in the diffusion
# coefficient between this and the primary cutoff density. This should be the
# larger of the two
diffuse_cutoff_density_hi    Real          -1.e200            y     DIFFUSION

# scaling factor for conductivity
diffuse_cond_scale_fac       Real          1.0                y     DIFFUSION


#-----------------------------------------------------------------------------
# category: gravity and rotation
#-----------------------------------------------------------------------------

# permits gravity calculation to be turned on and off
do_grav                      int          -1                  y

# to we recompute the center used for the multipole gravity solve each step?
moving_center                int           0

# determines how the gravitational source term is added to the momentum and
# energy state variables.
grav_source_type             int           4                  y

# permits rotation calculation to be turned on and off
do_rotation                  int          -1                  y

# the rotation period for the corotating frame
rotational_period            Real         -1.e200             y        ROTATION        rot_period

# the rotation periods time evolution---this allows the rotation rate to
# change durning the simulation time
rotational_dPdt              Real          0.0                y        ROTATION        rot_period_dot

# permits the centrifugal terms in the rotation to be turned on and off
rotation_include_centrifugal int           1                  y        ROTATION

# permits the Coriolis terms in the rotation to be turned on and off
rotation_include_coriolis    int           1                  y        ROTATION

# permits the d(omega)/dt terms in the rotation to be turned on and off
rotation_include_domegadt    int           1                  y        ROTATION

# Which reference frame to measure the state variables with respect to.
# The standard in the literature when using a rotating reference frame
# is to measure the state variables with respect to an observer fixed
# in that rotating frame. If this option is disabled by setting it to 0,
# the state variables will be measured with respect to an observer fixed
# in the inertial frame (but the frame will still rotate).
state_in_rotating_frame      int           1                  y        ROTATION

# determines how the rotation source terms are added to the momentum and
# energy equations
rot_source_type              int           4                  y        ROTATION

# we can do a implicit solution of the rotation update to allow
# for better coupling of the Coriolis terms
implicit_rotation_update     int           1                  y        ROTATION

# the coordinate axis (:math:`x=1`, :math:`y=2`, :math:`z=3`) for the rotation vector
rot_axis                     int           3                  y        ROTATION

# include a central point mass
use_point_mass               int           0                  y        GRAVITY

# mass of the point mass
point_mass                   Real          0.0                y        GRAVITY

# if we have a central point mass, we can prevent mass from building
# up in the zones adjacent to it by keeping their density constant and
# adding their mass to the point mass object
point_mass_fix_solution      int           0                  y        GRAVITY

#-----------------------------------------------------------------------------
# category: parallelization
#-----------------------------------------------------------------------------

# determines whether we use accelerators for specific loops
do_acc                       int          -1                  y

bndry_func_thread_safe       int           1


#-----------------------------------------------------------------------------
# category: embiggening
#-----------------------------------------------------------------------------

# the factor by which to extend the domain upon restart for embiggening
grown_factor                 int           1                  y

# used with the embiggening routines to determine how to extend the domain
star_at_center               int          -1


#-----------------------------------------------------------------------------
# category: self-consistent field initialization
#-----------------------------------------------------------------------------

# Should we use SCF to construct the initial model?
do_scf_initial_model         int           0

# Maximum density on the domain when using SCF
scf_maximum_density          Real          -1.e6

# Equatorial and polar radii of the star constructed by SCF
scf_equatorial_radius        Real          -1.e9
scf_polar_radius             Real          -1.e9

# SCF relaxation tolerance
scf_relax_tol                Real          1.e-3

# Maximum number of SCF iterations
scf_max_iterations           int           30



#-----------------------------------------------------------------------------
# category: refinement
#-----------------------------------------------------------------------------


do_special_tagging           int           0

spherical_star               int           0


#-----------------------------------------------------------------------------
# category: diagnostics, I/O
#-----------------------------------------------------------------------------

# verbosity level (higher numbers mean more output)
(v, verbose)                 int           0

# do we dump the old state into the checkpoint files too?
dump_old                     bool          false

# display warnings in Fortran90 routines
print_fortran_warnings       int           (0, 1)

# display information about updates to the state (how much mass, momentum, energy added)
print_update_diagnostics     int           (0, 1)

# calculate losses of material through physical grid boundaries
track_grid_losses            int            0                    y

# how often (number of coarse timesteps) to compute integral sums (for runtime diagnostics)
sum_interval                 int           -1

# how often (simulation time) to compute integral sums (for runtime diagnostics)
sum_per                      Real          -1.0e0

# display center of mass diagnostics
show_center_of_mass          int           0

# abort if we exceed CFL = 1 over the cource of a timestep
hard_cfl_limit               int           1

# a string describing the simulation that will be copied into the
# plotfile's ``job_info`` file
job_name                     string        ""

# write a final plotfile and checkpoint upon completion
output_at_completion         int           1

# Do we want to reset the time in the checkpoint?
# This ONLY takes effect if amr.regrid_on_restart = 1 and amr.checkpoint_on_restart = 1,
# (which require that max_step and stop_time be less than the value in the checkpoint)
# and you set it to value greater than this default value.
reset_checkpoint_time        Real          -1.e200

# Do we want to reset the number of steps in the checkpoint?
# This ONLY takes effect if amr.regrid_on_restart = 1 and amr.checkpoint_on_restart = 1,
# (which require that max_step and stop_time be less than the value in the checkpoint)
# and you set it to value greater than this default value.
reset_checkpoint_step        int           -1





#-----------------------------------------------------------------------------
# category: particles
#-----------------------------------------------------------------------------

# permits tracer particle calculation to be turned on and off
do_tracer_particles          int           0       n      AMREX_PARTICLES


@namespace: particles Castro static

# the level of verbosity for the tracer particle (0 or 1)
(v, particle_verbose)                int            0

# the name of an input file containing the total particle number and the initial position of each particle.
particle_init_file           string        ""

# the name of a file with new particles at restart
particle_restart_file        string        ""

# to restart from a checkpoint that was written with ``USE_PARTICLES`` =FALSE
restart_from_nonparticle_chkfile     int      0

# the name of timestamp files.
particle_output_file         string        ""

# the name of a directory in which timestamp files are stored.
timestamp_dir        	      string        ""

# whether the local densities at given positions of particles are stored in output files
timestamp_density            int           1

# whether the local temperatures at given positions of particles are stored in output files
timestamp_temperature        int           0



@namespace: gravity Gravity static

# what type
gravity_type                 string        "fillme"           y


# if doing constant gravity, what is the acceleration
const_grav                   Real          0.0                y

# Check if the user wants to compute the boundary conditions using the
# brute force method.  Default is false, since this method is slow.
direct_sum_bcs               int           0

# ratio of dr for monopole gravity binning to grid resolution
drdxfac                     int            1

# the maximum mulitpole order to use for multipole BCs when doing
# Poisson gravity
(max_multipole_order, lnum) int            0

# the level of verbosity for the gravity solve (higher number means more
# output on the status of the solve / multigrid
(v, verbose)                int            0

# do we perform the synchronization at coarse-fine interfaces?
no_sync                     int            0

# do we do a composite solve?
no_composite                int            0

# should we apply a lagged correction to the potential that
# gets us closer to the composite solution? This makes the
# resulting fine grid calculation slightly more accurate,
# at the cost of an additional Poisson solve per timestep.
do_composite_phi_correction int            1

# For all gravity types, we can choose a maximum level for explicitly
# calculating the gravity and associated potential. Above that level,
# we interpolate from coarser levels.
max_solve_level              int           MAX_LEV-1

# For non-Poisson gravity, do we want to construct the gravitational
# acceleration by taking the gradient of the potential, rather than
# constructing it directly?
get_g_from_phi              int            0                  y

# how many FMG cycles?
mlmg_max_fmg_iter            int           0                  n

# Do agglomeration?
mlmg_agglomeration           int           1                  n
mlmg_consolidation           int           1                  n

# Do N-Solve?
mlmg_nsolve                  int           0                  n

@namespace: diffusion Diffusion static

# the level of verbosity for the diffusion solve (higher number means
# more output)
(v, verbose)                int            0

# Use MLMG as the operator
mlmg_maxorder                int           4                  n

@namespace: radsolve RadSolve static

# the linear solver option to use
level_solver_flag            int           1                  n

use_hypre_nonsymmetric_terms int           0                  n

reltol                       Real          1.e-10             n

abstol                       Real          1.e-10             n

maxiter                      int           40                 n

alpha                        Real          1.0                n

beta                         Real          1.0                n

(v, verbose)                 int           0                  n
