# ------------------  INPUTS TO MAIN PROGRAM  -------------------
#max_step = 2732918
stop_time = 1700.0
max_step = 300

# PROBLEM SIZE & GEOMETRY

geometry.coord_sys = 0                  # 0 => cart, 1 => RZ  2=>spherical

    # >>>>>>>>>>>>>  BC FLAGS <<<<<<<<<<<<<<<<
    # 0 = Interior           3 = Symmetry
    # 1 = Inflow             4 = SlipWall
    # 2 = Outflow            5 = NoSlipWall
    # >>>>>>>>>>>>>  BC FLAGS <<<<<<<<<<<<<<<<

#if AMREX_SPACEDIM == 3

  geometry.is_periodic = 1          1          0
  geometry.prob_lo     = 0          0          0
  geometry.prob_hi     = 10.240e7   10.240e7   15.360e7
  amr.n_cell           = 640        640        960

  castro.fill_ambient_bc = 1
  castro.ambient_fill_dir = 2
  castro.lo_bc = 0   0   3
  castro.hi_bc = 0   0   2

# elif AMREX_SPACEDIM == 2

  geometry.is_periodic = 1          0
  geometry.prob_lo     = 0          0
  geometry.prob_hi     = 30.720e7   15.360e7
  amr.n_cell           = 1920       960

  castro.fill_ambient_bc = 1
  castro.ambient_fill_dir = 1
  castro.lo_bc       =  0   3
  castro.hi_bc       =  0   2

#endif

castro.domain_is_plane_parallel = 1
castro.hydro_memory_footprint_ratio = 3

# WHICH PHYSICS
castro.do_hydro = 1           #hydrodynamics
castro.do_react = 1           #microphysics
castro.do_grav = 1            #gravity

castro.do_sponge = 1          #using sponge
castro.sponge_timescale = 1.0e-6
castro.sponge_upper_density = 1.0e-1
castro.sponge_lower_density =  1.0e-2

castro.ppm_type = 1
castro.grav_source_type = 2
castro.use_pslope = 1
castro.ppm_well_balanced = 1
castro.pslope_cutoff_density = 1.0e-2

castro.use_flattening = 1

castro.small_temp = 5.0e5
castro.small_dens = 5.0e-6
castro.limit_fluxes_on_small_dens = 1
castro.retry_small_density_cutoff = 5.0e-5
castro.use_retry = 1
castro.max_subcycles = 16

gravity.gravity_type = ConstantGrav
gravity.const_grav   = -7.06e8

castro.react_rho_min = 1.0e1
castro.react_T_min = 5.0e6

# CONVECTION

castro.drive_initial_convection = 1
castro.drive_initial_convection_reinit_period = 2
castro.drive_initial_convection_tmax = 50

# TIME STEP CONTROL
castro.cfl            = 0.7     # cfl number for hyperbolic system
castro.init_shrink    = 0.01     # scale back initial timestep
castro.change_max     = 1.1     # max time step growth

# DIAGNOSTICS & VERBOSITY
castro.sum_interval   = 1       # timesteps between computing mass
castro.v              = 1       # verbosity in Castro.cpp
amr.v                 = 1       # verbosity in Amr.cpp


# REFINEMENT / REGRIDDING
amr.max_level       = 1            # maximum level number allowed
amr.ref_ratio       = 4 2          # refinement ratio
amr.regrid_int      = 2 2         # how often to regrid

#if AMREX_SPACEDIM == 3
  amr.max_grid_size   = 64
  amr.blocking_factor = 32
  amr.grid_eff        = 0.7
  amr.n_error_buf     = 4 2         # number of buffer cells in error est
#elif AMREX_SPACEDIM == 2
  amr.max_grid_size   = 256
  amr.blocking_factor = 64
  amr.n_error_buf     = 4 2         # number of buffer cells in error est
#endif

# CHECKPOINT FILES
amr.check_file      = chk        # root name of checkpoint file
amr.check_per       = 0.5        # size of timestep between checkpoints
amr.check_int       = 100         # number of timesteps between checkpoints

# PLOTFILES
amr.plot_file        = plt        # root name of plotfile
amr.plot_per         = 0.5        # set a plot every half second
amr.derive_plot_vars = ALL

# DATA LOG
amr.data_log = log

# problem initialization

problem.model_name =  "glasner_T7.hse.dx10000.00cm"

problem.apply_vel_field = 0
problem.apply_temp_field = 1
problem.width = 1.0e6
problem.amplitude = 0.05
problem.num_vortices_x = 10
problem.num_vortices_y = 9
problem.width_ratio = 1.8

# Microphysics

integrator.jacobian = 1
integrator.rtol_spec = 1.e-6
integrator.atol_spec = 1.e-6
integrator.rtol_enuc = 1.e-6

# refinement

amr.refinement_indicators = dens temp edot

amr.refine.dens.max_level = 2
amr.refine.dens.value_greater = 1.0e2
amr.refine.dens.field_name = density

amr.refine.temp.max_level = 2
amr.refine.temp.value_greater = 3.0e7
amr.refine.temp.field_name = Temp

amr.refine.edot.max_level = 2
amr.refine.edot.value_greater = 1.0e11
amr.refine.edot.field_name = enuc
