main.poutBaseName=pout.n3.isomip24.control-noMuCoef.l1l2.prlim.l3.SMB6.5

#domain details
main.domain_size = 800.0e+3 80.0e+3 1.0e+3
amr.num_cells = 200 20 10 

amr.is_periodic = 0 0 0

#bulk constitutive relation and parameters
main.constitutiveRelation = L1L2
main.rateFactor = constRate
constRate.epsSqr0 = 1.0e-12
#constRate.A =  1.9e-22 # A for n=4
constRate.A =  1.71e-17    # A for n=3

# set n= 3 for both options
L1L2.n = 3
GlensLaw.n = 3


#geometry,temperature & basal friction input data
geometry.problem_type = Python
PythonIBC.module = shortshallow
PythonIBC.thicknessFunction = thickness24
#PythonIBC.thicknessFunction = thickness24_200
PythonIBC.topographyFunction = topography24	
PythonIBC.bc_lo = 1 0 # bc type at x = 0, y = 0
PythonIBC.bc_hi = 0 0 # bc type at x = L , y = W


geometry.beta_type = Python
PythonBasalFriction.module = shortshallow
PythonBasalFriction.function = constfriction_24

temperature.type = constant
temperature.value = 268

amr.sigma = 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0

#basal friction relation parameters
main.basalFrictionRelation = pressureLimitedLaw

BasalFrictionPressureLimitedLaw.coefficient = 0.5
BasalFrictionPressureLimitedLaw.model = Tsai

BasalFrictionPressureLimitedLaw.basalFrictionRelation = powerLaw
BasalFrictionPowerLaw.m = 0.3333
BasalFrictionPowerLaw.includeEffectivePressure = false

amr.grounding_line_subdivision = 4

#physical constants
constants.ice_density=918.0
constants.sea_water_density=1028.0

surfaceFlux.type = constantFlux
surfaceFlux.flux_value = 0.3


# Turn this off for this experiment
# # read in muCoefficient from inversion
#muCoefficient.type = LevelData
#inputLevelData.muCoefFile = ../../data/flattened/Control.l3.2d.hdf5
#muCoefficient.muCoefName = muCoef


basalFlux.type = maskedFlux
basalFlux.grounded.type = zeroFlux
basalFlux.floating.type = pythonFlux
basalFlux.floating.module = shortshallow
basalFlux.floating.function = spinbasalsource


#CalvingModel.type = FixedFrontCalvingModel
#CalvingModel.min_thickness = 10.0
#CalvingModel.min_thickness = 5.0

CalvingModel.type = DomainEdgeCalvingModel
CalvingModel.front_lo = 0 0
CalvingModel.front_hi = 1 0 


#velocity solve type -- 0 = Picard, 1 = JFNK
amr.velocity_solver_type = 1

#initial guess 
amr.do_initial_velocity_guess = 1
amr.do_initial_velocity_solve = 1
amr.initial_velocity_guess_type = 1 # linear PDE
amr.initial_velocity_guess_const_mu = 1.0e+6
amr.initial_velocity_guess_solver_type = 1 
amr.initial_velocity_guess_const_vel = 1.0 0.0
#JFNK parameters
JFNKSolver.vtopSafety = 0.95
JFNKSolver.minPicardIterations = 2
JFNKSolver.maxIter = 15
JFNKSolver.absTol = 1.0e+0
JFNKSolver.relTol = 2.0e-3

JFNKSolver.solverType = 0 #Relax solver
JFNKSolver.bottom_solver_type = 2 #Relax solver (since BiCGstab seems to have died in Chombo 3.2)

#PETScJFNKSolver.solverType = 0 #Real  solver, since PETSC solver is not working well
#PETScJFNKSolver.bottom_solver_type = 1  # petsc botton solver

JFNKSolver.RelaxRelTol = 2.0e-4
JFNKSolver.RelaxHang = 0.975
JFNKSolver.maxRelaxIter = 20
JFNKSolver.normType = 0
JFNKSolver.verbosity = 5
JFNKSolver.vtopRelaxTol = 0.005
JFNKSolver.vtopRelaxMinIter = 8
JFNKSolver.numMGSmooth = 8
JFNKSolver.numMGIter = 1
JFNKSolver.h = 0.025
JFNKSolver.switchRate = 1.8
#JFNKSolver.writeResiduals = true
#JFNKSolver.muMin = 1.0e+6
#JFNKSolver.uMaxAbs = 1.0e+6

#wall drag
#amr.wallDrag = true
#amr.wallDragExtra = 1.0e+6


#time stepping
main.maxTime = 400  # maximum time to run to
main.maxStep = 9999999   # maximum number of steps to run
amr.temporal_accuracy = 1
amr.cfl = 0.25 
amr.initial_cfl = 0.25 
amr.max_dt_grow_factor = 1.1 
amr.time_step_ticks = 0


#plotting options
amr.plot_time_interval = 1
amr.plot_prefix = plot.n3.isomip24.control-noMuCoef.l1l2.prlim.l3.

amr.write_solver_rhs = 1
amr.write_viscous_tensor = true
amr.write_thickness_sources = true
amr.write_mu_coefficient = 1

#check points
#amr.check_interval = 1000
amr.check_interval = 500

amr.check_prefix = chk.n3.isomip24.control-noMuCoef.l1l2.prlim.l3.

amr.check_overwrite = 0
amr.verbosity = 5


#AMR mesh options
amr.maxLevel = 10 # finest level allowed in simulation
amr.ref_ratio = 2 2 2 2 2 2 2 2 2 2 2
amr.regrid_interval = 1  # number of timesteps between regridding
amr.blockFactor = 4      # block factor used in grid generation
amr.fill_ratio = 0.85    # how efficient are the grids
amr.nestingRadius = 4    # proper nesting radius required
amr.tags_grow = 4        # amount to buffer tags
amr.tagCap = 2

amr.interpolate_zb = 0 #go back to the IBC to regrid geometry
amr.max_box_size = 40 # largest box length allowed

#AMR tagging
amr.tag_on_grad_velocity = 0

amr.tag_on_grounded_laplacian_velocity = 0
amr.lap_vel_tagging_val = 8.0

amr.tag_grounding_line = 1
amr.grounding_line_tagging_min_vel = 0

#misc options
amr.verbosity = 5
amr.velocity_solve_interval = 1

_fullamr.additional_velocity
_fullamr.diffusion_treatment = implicit
_fullL1L2.additionalVelocitySIAGradSLimit = 1.0e-2

amr.eliminate_remote_ice = true
#amr.velocity_exit =  5e+06 
#END OF TEMPLATE



amr.restart_file = ../../data/chk.spinup.n4.A1.9e-22.l3.2d.hdf5
amr.restart_step = 0
amr.restart_time = 0.0

 
