! inlist for SpaceInn massive star grid, mesa version 7385
! Parameters input via run_star_extras.f not in inlist
! Input via run_star_extras.f: new_Z, new_Y, initial_mass, overshoot_f_above_burn_h, min_D_mix
! evolve main sequence model starting from ZAMS

&star_job

  ! history and profile columns
  ! history_columns_file = 'hist.list'
  ! profile_columns_file = 'prof.list'

!!! begin with a pre-main sequence model
    create_pre_main_sequence_model = .false.
    
!!! start from ZAMS:
    relax_Z = .true.
    change_Z = .true.
    relax_initial_Z = .true.
    change_initial_Z = .true.
    
    relax_Y = .true.
    change_Y = .true.
    relax_initial_Y = .true.
    change_initial_Y = .true.

!!! Composition and opacities (Asplund09+OPAL):    
    kappa_file_prefix = 'a09'
    kappa_lowT_prefix = 'lowT_fa05_a09p'
    initial_zfracs = 6
    kappa_CO_prefix = 'a09_co'
    
    change_lnPgas_flag = .true.
    change_initial_lnPgas_flag = .true.
    new_lnPgas_flag = .true.
    
    change_net = .true.
    new_net_name = 'pp_cno_extras_o18_ne22.net'
    change_initial_net = .true.

  ! display on-screen plots
    pgstar_flag = .false.

/ !end of star_job namelist


&controls

!!! Starting specifications
    !run_star_extras.f input

!!! Atmosphere
    which_atm_option = 'photosphere_tables'


!!! Mixing
  ! Diffusive mixing
  ! Minimal mixing in radiative zone
    set_min_D_mix = .true.
    !min_D_mix set via run_star_extras.f
    remove_small_D_limit = 0        ! set to 0, so as not to interfere with min_D_mix
    
  ! Convection MLT
    mixing_length_alpha = 1.8
        
    use_Ledoux_criterion = .false.   ! No difference with Schwartzschild criterion
    
  ! Over- and undershooting
    D_mix_ov_limit = 5d-2    !1d2    ! Overshooting shuts off when the exponential decay has dropped the diffusion
                                     ! coefficient to this level.
    
    overshoot_f0_above_burn_h = 0.001
    !overshoot_f_above_burn_h = 0.0 set via run_star_extras
    
    num_cells_for_smooth_brunt_B = 0 
    num_cells_for_smooth_gradL_composition_term = 0


!!! Time step control
    varcontrol_target = 2.5d-5
    
    max_age = 2d10
    max_years_for_timestep = 1d7
    
  ! Controlling the time steps near the TAMS
    !delta_lg_XH_cntr_min = -6                         ! delta_H/H -> only parameter
    !delta_lg_XH_cntr_max = 0
    !delta_lg_XH_cntr_limit = 0.01
  
  ! Stop condition
  ! stop when the center mass fraction of h1 drops below this limit
    xa_central_lower_limit_species(1) = 'h1'
    xa_central_lower_limit(1) = 1d-3
    when_to_stop_rtol = 1d-3
    when_to_stop_atol = 1d-3


!!! Mesh grid
    max_allowed_nz = 10000                  ! Maximum number of grid points allowed.
    mesh_delta_coeff = 0.5                   ! A smaller value decreases the max allowed deltas and increases the number of grid points.
    mesh_min_dlnR = 1d-9                     ! Limit on difference in lnR across cell. Do not go below 1d-14!
    cubic_interpolation_in_Z = .true.
    
    xa_function_species(1) = 'he4'                     ! name of nuclide as defined in chem_def
    xa_function_weight(1) = 100                         ! 
    xa_function_param(1) = 1d-2                        ! 
         
    xa_function_species(2) = 'he3'                     ! name of nuclide as defined in chem_def
    xa_function_weight(2) = 100                         !
    xa_function_param(2) = 1d-5
    
    mesh_dlogX_dlogP_extra(:) = 0.1                   ! resol coeff for chemical gradients
    mesh_dlogX_dlogP_full_on(:) = 2                 ! additional resol on for gradient larger than this
    mesh_dlogX_dlogP_full_off(:) = 1               ! additional resol off for gradient smaller than this
      
    mesh_logX_species(1) = 'he4'                       ! taking into account abundance of He4
    mesh_logX_min_for_extra(1) = -6                   ! for abundances larger than ~
    mesh_logX_species(2) = 'n14'                       ! taking into account abundance of N14
    mesh_logX_min_for_extra(2) = -6
    mesh_logX_species(3) = 'c12'
    mesh_logX_min_for_extra(3) = -6
    
    xtra_coef_czb_full_on = 1.0             ! use this coef if center_he4 below this
    xtra_coef_czb_full_off = 1.0            ! i.e. always on MS
    
    !xtra_coef_a_l_hb_czb = 0.1
    !xtra_dist_a_l_hb_czb = 3.0
    
    xtra_coef_a_l_nb_czb = 0.1                       ! resol coeff above lower nonburn convective boundary
    xtra_dist_a_l_nb_czb = 10.0                        ! distance above lower nonburn convective boundary
    
    xtra_coef_b_l_nb_czb = 0.1                       ! resol coeff below lower nonburn convective boundary
    xtra_dist_b_l_nb_czb = 3.0                         ! distance below lower nonburn convective boundary
      
    
    okay_to_remesh = .true.

!!! Input and Output
    max_num_profile_models = 500          ! max. # of profile models
    profile_interval = 100                ! necessary for final computations
    history_interval = 1
    terminal_cnt = 10
    write_header_frequency = 5
    
  ! GYRE output
    write_pulse_info_with_profile = .true.
    pulse_info_format = 'GYRE'
    add_atmosphere_to_pulse_info = .true.

/ ! end of controls namelist
