&star_job

  ! Avoid printing a lot of stuff in the terminal to begin with. We don't need this.
    show_log_description_at_start = .false.

  ! We do not want to load from a saved model or use PMS model
    load_saved_model = .false.
    create_pre_main_sequence_model = .true.
    
    kappa_lowT_prefix = 'lowT_fa05_a09p'
    initial_zfracs = 6

  ! Nuclear Network
    change_net = .true.
    new_net_name = 'pp_cno_extras_o18_ne22.net'
    change_initial_net = .true.

  ! no pgstar
    pgstar_flag = .false.
    
    pause_before_terminate = .false.
    
  ! Some terminate options to help control the output generated by mesa

    save_photo_when_terminate = .false.
    save_model_when_terminate = .true.
    write_profile_when_terminate = .false.
    save_pulse_data_when_terminate = .false.

  ! Rotation flags -- LOOK AT LATER
    new_rotation_flag = .false.
    change_rotation_flag = .false.
    change_initial_rotation_flag = .false.

    new_omega = 0
    set_omega = .false.
    set_initial_omega = .false.

    save_model_filename = TAMS_MODEL_FILENAME

/ !end of star_job namelist


&controls

  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  !! THINGS TO VARY
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    star_history_name = STAR_HISTORY_NAME
    initial_mass = INITIAL_MASS
    mixing_length_alpha = MIXING_LENGTH_ALPHA
    overshoot_f_above_burn_h_core = OVERSHOOT_F_ABOVE_BURN_H_CORE
    min_D_mix = MIN_D_MIX

    initial_y = INITIAL_Y
    initial_z = INITIAL_Z

    varcontrol_target = 3d-5

  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  !! OUTPUT CONTROLS
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  ! Setting up LOG directory
    log_directory = LOGS_DIR
      
  ! Specify how often to write info to the terminal
    terminal_interval = 200

  ! Specify when to write out photos
    photo_interval = 100000
    photo_directory = './photos'

  ! Do not save profiles
    write_profiles_flag = .false.


  ! Saved all computed stellar parameters for each model in the history file
    history_interval = 1
    
  ! Print output to be used with GYRE
  !  write_pulse_data_with_profile = .true.
    pulse_data_format = 'GYRE'
    add_atmosphere_to_pulse_data = .true.
    add_center_point_to_pulse_data = .true.
    keep_surface_point_for_pulse_data = .true.
    add_double_points_to_pulse_data = .true.
    interpolate_rho_for_pulse_data = .true.
    threshold_grad_mu_for_double_point = 5d0


  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  !! CORE BOUNDARY CONTROLS
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    alpha_bdy_core_overshooting = 5
    he_core_boundary_h1_fraction = 1d-2

  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  !! STOPPING CONTROLS
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  ! stop when the center mass fraction of h1 drops below this limit
  ! In my scheme, I would set this in the 'var' inlist
    xa_central_lower_limit_species(1) = 'he4'
    xa_central_lower_limit(1) = 1d-3               ! This is end core-He burning

    HB_limit = 0.95d0
    
  ! target controls for exras_finish_step
    x_logical_ctrl(1) = .true.
    x_ctrl(1) = X_CTRL_1
    x_ctrl(2) = X_CTRL_2




  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  !! MIXING CONTROLS
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    !mixing_length_alpha = 2d0
    remove_small_D_limit = 1d-6
    use_Ledoux_criterion = .true.
  
  ! Do not smooth N^2
    num_cells_for_smooth_gradL_composition_term = 0

    alpha_semiconvection = 0d0
    semiconvection_option = 'Langer_85 mixing; gradT = gradr'
    thermohaline_coeff = 0d0
    alt_scale_height_flag = .true.
    MLT_option = 'Cox'
    mlt_gradT_fraction = -1
    okay_to_reduce_gradT_excess = .false.

  ! Defining a minimum diffusive mixing (applicable in the radiative zones)
    set_min_D_mix = .true.
    !min_D_mix = 5d1

  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  !! OVERSHOOTING/CONVECTION CONTROLS
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    D_mix_ov_limit = 5d-2
    max_brunt_B_for_overshoot = 0
    limit_overshoot_Hp_using_size_of_convection_zone = .true.
    overshoot_alpha = -1				 

    predictive_mix(1) = .true.
    predictive_zone_type(1) = 'burn_H'
    predictive_zone_loc(1) = 'core'
    predictive_bdy_loc(1) = 'any'

    conv_bdy_mix_softening_f0 = 0.002
    conv_bdy_mix_softening_f = 0.001
    conv_bdy_mix_softening_min_D_mix = 1d-1
    
    overshoot_f0_above_burn_h_core = 0.001
    !step_overshoot_f_above_burn_h_core = 0.201
    !overshoot_f_above_burn_h_core = 0.021


    overshoot_f_below_nonburn_shell = 0.005     
    overshoot_f0_below_nonburn_shell = 0.005


    smooth_convective_bdy = .false.

  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  !! ELEMENTAL DIFFUSION CONTROLS
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    do_element_diffusion = .false.

  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  !! ATMOSPHERE CONTROLS
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    which_atm_option = 'simple_photosphere'

  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  !! OPACITY CONTROLS
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    cubic_interpolation_in_X = .false.
    cubic_interpolation_in_Z = .false.

  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  !! ASTEROSEISMOLOGY CONTROLS
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    num_cells_for_smooth_brunt_B = 0
    interpolate_rho_for_pulsation_info = .true.

  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  !! MESH & RESOLUTION CONTROLS
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  ! This is important to properly resolve the gravity modes near the convective core boundary
    max_allowed_nz = 40000
      
  ! global mesh resolution factor
    mesh_delta_coeff = 0.2
    mesh_adjust_use_quadratic = .true.
    mesh_adjust_get_T_from_E = .true.

      
  ! Additional resolution based on the pressure and temperature profiles
    P_function_weight = 40
    T_function1_weight = 110 

    T_function2_weight = 0
    T_function2_param = 2d4

    gradT_function_weight = 0

    xtra_coef_os_above_burn_h = 0.1d0
    xtra_dist_os_above_burn_h = 2d0

    mesh_dlogX_dlogP_extra = 0.15             ! resol coeff for chemical gradients
    mesh_dlogX_dlogP_full_on = 1d-6           ! additional resol on for gradient larger than this
    mesh_dlogX_dlogP_full_off = 1d-12         ! additional resol off for gradient smaller than this
      
    mesh_logX_species(1) = 'he4'              ! taking into account abundance of He4
      
  ! Additional resolution near the boundaries of the convective regions
    xtra_coef_czb_full_on = 0.0
    xtra_coef_czb_full_off = 1.0
      
    xtra_coef_a_l_hb_czb = 0.1                ! resol coeff above lower nonburn convective boundary
    xtra_dist_a_l_hb_czb = 2                  ! distance above lower nonburn convective boundary
      
    xtra_coef_b_l_hb_czb = 0.1                ! resol coeff below lower nonburn convective boundary
    xtra_dist_b_l_hb_czb = 2                  ! distance below lower nonburn convective boundary
      
/ ! end of controls namelist
