
&star_job

    mesa_dir = ''

    ! save_model_when_terminate = .true.
    ! save_model_filename = '15M_z1p4m2_f0p022_schwarzschild_omegaDivOmegaCrit0p4_NoAddVisc'

    ! begin with a pre-MS model
    create_pre_main_sequence_model = .true.
    pre_ms_relax_num_steps = 200
  
    change_net = .true.
    ! new_net_name = 'h_burn.net' ! to make fast test up to core helium depletion
    ! new_net_name = 'approx21_plus_co56.net'
    ! new_net_name = 'o_burn.net'
    ! new_net_name = 'mesa_206.net'
    new_net_name = 'basic.net'


    ! metallicity fractions
    ! 6 = AGSS09 ! 8 = A09_Prz_zfracs
    initial_zfracs = 6


    ! opacity
    kappa_file_prefix = 'a09' ! options: 'a09', 'gs98'
    kappa_lowT_prefix = 'lowT_fa05_a09p'

    ! reaction rates
    set_rates_preference = .true.
    new_rates_preference = 2 !
    	! 1 = NACRE rates (default)
	! 2 = jina reaclib rates -- to match jina where possible
    jina_reaclib_filename = 'jina_reaclib_results_20171204default' ! latest version from JINA Reaclib Database
    set_rate_c12ag = 'jina reaclib' ! Jacqueline uses 'Kunz'
    	! one of 'NACRE', 'jina reaclib', 'Kunz', 'CF88'
	! note: original CF88 rate is actually multiplied by 1.7 as in Timmes' rates
    set_rate_n14pg = 'jina reaclib'
    set_rate_3a = 'jina reaclib'

    ! modified 'history.data' and 'profile.data'
    history_columns_file = 'history_columns.list'
    profile_columns_file = 'profile_columns.list'

    ! change_v_flag = .true.
    ! new_v_flag = .true
    center_ye_limit_for_v_flag = 0.45d0
    gamma1_integral_for_v_flag = 0d0


    ! rotation
    change_rotation_flag = .false. ! 'new_rotation flag' only applies when this is true
    new_rotation_flag = .false.
    	 ! Don't need to include the above lines if rotation is set at the ZAMS as done below. This creates a 
	 ! rotation flag automatically in the subroutine do_rotation_near_zams in star/private/run_star_support.f90.

         ! You might want to start a run at pre-ms but only turn on rotation when near zams
         ! rather than force you to stop the run near zams, change the inlist, and restart.
         ! The following will turn on rotation automatically.
         ! The working definition of "near zams" is
         ! `L_nuc_burn_total/L_phot >= Lnuc_div_L_upper_limit`
         ! `Lnuc_div_L_upper_limit` is in the controls part of the inlist.

    ! set surface rotation
    ! new_surface_rotation_v = 50.0 ! km/s
    ! set_near_zams_surface_rotation_v_steps = 10

    ! set omega/omega_crit ratio
    new_omega_div_omega_crit = 0.8
    ! set_omega_div_omega_crit = .true.
    ! set_initial_omega_div_omega_crit = .false.
         ! the previous controls are “one shot” – they set omega once and are done. however you might need to set 
	 ! omega for several models in a row in order to give things a chance to adjust to the change. the 
	 ! following controls let you do that.
    ! set_near_zams_omega_div_omega_crit_steps = 50 ! this option sets the new omega/omega_crit for x steps

    num_steps_to_relax_rotation = 100
    relax_omega_div_omega_crit = .true.
    near_zams_relax_omega_div_omega_crit = .true. ! this option relaxes the model until is has reached the 
      					     	     ! specified omega/omega_crit
						  ! => works better in a 50Msun star

/ !end of star_job namelist


&controls

    ! starting specifications
    initial_mass = 100
    initial_z = 0.014
    initial_y = 0.266

    ! controls output
    photo_interval = 1000 ! 50
    profile_interval = 1000 ! 10
    history_interval = 50 ! 1
    terminal_interval = 10
    max_num_profile_models = -1

    ! definition of core boundaries
    he_core_boundary_h1_fraction = 0.01 ! he core
    c_core_boundary_he4_fraction = 0.01 ! c core
    o_core_boundary_c12_fraction = 0.01 ! o core
    si_core_boundary_o16_fraction = 0.01 ! si core
    fe_core_boundary_si28_fraction = 0.01 ! iron core

    ! opacities
    use_Type2_opacities = .true.
    Zbase = 1.4d-2
    !kap_Type2_full_off_dZ = 0.00d0
    !kap_Type2_full_on_dZ = 0.00d0
    !kap_Type2_full_off_X = 0.71
    !kap_Type2_full_on_X = 0.70

    ! atmosphere
    Pextra_factor = 2 ! Pressure at optical depth tau is calculated as 'P=tau*g/kap(1+Pextra)'

    ! wind mass loss
    ! 'Dutch' scheme combines several Dutch wind schemes: For O-stars the 'Vink' scheme 
    ! (vink 2000, 2001) and for Wolf-Rayet stars the one from Nugis & Lamers (2000)
    hot_wind_scheme = 'Dutch'
    cool_wind_AGB_scheme = 'Dutch'
    cool_wind_RGB_scheme = 'Dutch'
    Dutch_wind_lowT_scheme = 'de Jager' ! 'van Loon' gives a too strong mass loss ! for Teff<1e4
    Dutch_scaling_factor = 0.85 ! as in GENEC (Maeder & Meynet (2001))


    ! when to stop
    
    ! stop when the star nears ZAMS (Lnuc/L > 0.99)
    ! Lnuc_div_L_zams_limit = 0.99d0
    ! stop_near_zams = .true.

    ! stop when the center mass fraction of element drops below this limit
    ! xa_central_lower_limit_species(1) = 'h1'
    ! xa_central_lower_limit(1) = 0.748
    ! xa_central_lower_limit(1) = 0.01

    ! xa_central_lower_limit_species(1) = 'he4'
    ! xa_central_lower_limit(1) = 1d-5

    ! xa_central_lower_limit_species(2) = 'o16'
    ! xa_central_lower_limit(2) = 1d-5

    ! xa_central_lower_limit_species(3) = 'si28'
    ! xa_central_lower_limit(3) = 1d-5

    ! collapsing core
    fe_core_infall_limit = 1d8 ![cm/s]

    ! mixing controls

      	   ! MLT
    mixing_length_alpha = 1.67
    MLT_option = 'Henyey' ! 'Cox' ! default ! 'Henyey' (for optical less dense medium)

    	   ! semiconvection
    use_Ledoux_criterion = .false.

    ! mlt++
    okay_to_reduce_gradT_excess = .true.


    	   ! CBM
    overshoot_f0_above_nonburn_core = 0.004
    overshoot_f_above_nonburn_core = 0.004
    overshoot_f0_above_nonburn_shell = 0.004
    overshoot_f_above_nonburn_shell = 0.004
    overshoot_f0_below_nonburn_shell = 0.004
    overshoot_f_below_nonburn_shell = 0.004

    overshoot_f0_above_burn_h_core = 0.004
    overshoot_f_above_burn_h_core = 0.004
    overshoot_f0_above_burn_h_shell = 0.004
    overshoot_f_above_burn_h_shell = 0.004
    overshoot_f0_below_burn_h_shell = 0.004
    overshoot_f_below_burn_h_shell = 0.004

    overshoot_f0_above_burn_he_core = 0.004
    overshoot_f_above_burn_he_core = 0.004
    overshoot_f0_above_burn_he_shell = 0.004
    overshoot_f_above_burn_he_shell = 0.004
    overshoot_f0_below_burn_he_shell = 0.004
    overshoot_f_below_burn_he_shell = 0.004

    overshoot_f0_above_burn_z_core = 0.004
    overshoot_f_above_burn_z_core = 0.004
    overshoot_f0_above_burn_z_shell = 0.004
    overshoot_f_above_burn_z_shell = 0.004
    overshoot_f0_below_burn_z_shell = 0.004
    overshoot_f_below_burn_z_shell = 0.004

    min_overshoot_q = 1d-3  ! default: 1d-3, no "overshoot" in starcenter with m < value*mstart
    D_mix_ov_limit = 1d2    ! default: 1d2, shut of "overshoot" when D dropps to this level


    ! rotation
    skip_rotation_in_convection_zones =.true.
    am_D_mix_factor = 0.03333333333333333d00 ! Heger et al. 2000

    ! AM lost through winds
    ! actual_J_lost = adjust_J_fraction*mass_lost*j_rot_avg_surf + 
    !                 (1-adjust_J_fraction)*angular_momentum_removed
    do_adjust_J_lost = .true.
    adjust_J_fraction = 1d0

      ! rotationally induced instabilities (default is 0 for all)
      ! Each rotationally induced diffusion coefficient has a factor that lets you control it. 
      ! Value of 1 gives normal strength; value of 0 turns it off.
      ! These controls are used to determine D_mix, the diffusion coefficient for mixing material.
      ! Note that for regions with brunt N^2 < 0, we set Richardson number to 1, which is 
      ! > Ri_critical and therefore turns off DSI and SSI.
      ! dynamical shear instability
    D_DSI_factor = 0.0
      ! Solberg-Hoiland
    D_SH_factor  = 0.0
      ! secular shear
    D_SSI_factor = 1.0
      ! Eddington-Sweet circulation
    D_ES_factor  = 1.0
      ! Goldreich-Schubert-Fricke
    D_GSF_factor = 0.0
      ! Spruit-Tayler dynamo
    D_ST_factor  = 1.0
      ! Those factors are also used for angular momentum transport (diffusive in MESA) as long as 
      ! 'am_nu_*_factor' < 0

      ! if logT smaller than this -> mixing full on
    D_mix_rotation_max_logT_full_on = 9.4d0
      ! if logT larger than this -> mixing full_off
    D_mix_rotation_min_logT_full_off = 9.5d0

        ! smooth over grid lines
    	! default: 0
    smooth_D_DSI = 0
    smooth_D_SH  = 0
    smooth_D_SSI = 0
    smooth_D_ES  = 0
    smooth_D_GSF = 0
    smooth_D_ST  = 2
    smooth_nu_ST = 2

        ! temporal smoothing. Set to 0 to turn it off
    angsmt_D_DSI = 0.0d0
    angsmt_D_SH  = 0.0d0
    angsmt_D_SSI = 0.0d0
    angsmt_D_ES  = 0.0d0
    angsmt_D_GSF = 0.0d0
    angsmt_D_ST  = 0.2d0
    angsmt_nu_ST = 0.2d0
    angsml       = 1d-3

    ! 'hooks' for artificial additional angular momentum transport
    use_other_am_mixing = .false.
    ! x_ctrl(4) = 1.0d5 ! additional viscosity; 1.0d5; 1.0d10
    ! x_ctrl(5) = 0.0 ! additional mixing -- don't use for now

    ! resolution
    ! (very simple!!)
    max_allowed_nz = 40000
    mesh_delta_coeff = 0.9
    varcontrol_target = 5.0d-4 ! 1.0d-4 ! 5.0d-5 ! max change between steps
    min_timestep_limit = 1d-12 ! (seconds)

    gradT_function_weight = 40
    omega_function_weight = 50

    ! until he depletion
    dX_nuc_drop_limit = 0.01 ! limits max change in abundance mass fraction

    ! beyond he depletion
    ! dX_nuc_drop_limit = 0.001 ! 0.01

    ! dX_nuc_drop_limit_at_high_T = 5.0d-3
    ! dX_nuc_drop_min_X_limit = 1d-4

    !delta_lg_XC_cntr_limit = 0.01d0
    !delta_lg_XC_cntr_max   = 0.0d0
    !delta_lg_XC_cntr_min   = -6.0d0             ! default: -5
    !delta_lg_XC_cntr_hard_limit = 0.02d0

    !delta_HR_limit = 0.0025d0 ! limits step in HR
    !delta_lgL_He_limit = 0.01 ! adopted by inlists of Jones and Farmer ! default: 0.025


    ! newton-raphson solver controls

    ! Ignore correction to abundance when calculating correctio norm and max if current mass 
    ! fraction is less than this limit; default: 5d-3
    ! correction_xa_limit = 1d-6 ! 1d-8 ! 1d-6

    ! "residual" for equation is the difference between left and right sides; after 
    ! 'iter_for resid_tol2' iterations, losen the acceptance
    ! tol_residual_norm1 = 1d-10
    ! tol_max_residual1 = 1d-9
    ! iter_for_resid_tol2 = 10    ! default: 6
    ! tol_residual_norm2 = 1d-5   ! default: 1d99
    ! tol_max_residual2 = 1d-4	! default: 1d99
    ! iter_for_resid_tol3 = 20	! default: 15
    ! tol_residual_norm3 = 1d0	! default: 1d99
    ! tol_max_residual3 = 1d1	! default: 1d99

      ! debugging controls
      !report_hydro_solver_progress = .true.
      !hydro_inspectB_flag = .true.
      !hydro_dump_call_number = 5421
      ! hydro_check_everything = .true.
      ! hydro_show_correction_info = .true.
      ! hydro_save_numjac_plot_data = .true.
      ! trace_newton_bcyclic_solve_input = .true.
      ! trace_newton_bcyclic_solve_output = .true.
      ! trace_newton_bcyclic_matrix_input = .true.
      ! trace_newton_bcyclic_matrix_output = .true.
      ! report_why_dt_limits = .true.
      ! report_hydro_dt_info = .true.
      ! report_dX_nuc_drop_dt_limits = .true.
      ! report_ierr = .true.
      ! show_mesh_changes = .true.
      ! trace_evolve = .true.


/ ! end of controls namelist
