&star_job

   !   pgstar_flag = .true.  ! we use pgbinary instead; although &pgstar settings are inherited into the Star1 and Star2 plot types of pgbinary!

   change_initial_rotation_flag = .true.
   new_rotation_flag = .true.
   set_initial_surface_rotation_v = .true.
   new_surface_rotation_v = 50  ! tides and wind mass loss will quickly take over

   set_initial_model_number = .true.
   initial_model_number = 0  ! set the PMS model number back to 0

   set_initial_dt = .true.
   years_for_initial_dt = 5d4

   pause_before_terminate = .true.

   new_w_div_wc_flag = .true.
   change_initial_w_div_wc_flag = .true.

/ ! end of star_job namelist

&kap
   Zbase = 1d-3
/

&controls

   ! wind
   cool_wind_RGB_scheme = 'Dutch'
   cool_wind_AGB_scheme = 'Dutch'
   Reimers_scaling_factor = 1d0
   hot_wind_scheme = 'Dutch'
   Dutch_scaling_factor = 1d0

   ! implicit wind, handles rotationally limited accretion
   max_mdot_redo_cnt = 200
   min_years_dt_for_redo_mdot = 0
   surf_omega_div_omega_crit_limit = 0.99d0
   surf_omega_div_omega_crit_tol = 1d0  ! very loose for performance reasons
   mdot_revise_factor = 5d0
   implicit_mdot_boost = 0.2d0

   ! stopping condition
   xa_central_lower_limit_species(1) = 'he4'
   xa_central_lower_limit(1) = 1d-8

   ! non-rotational mixing and convection options
   use_ledoux_criterion = .true.
   mixing_length_alpha = 1.5d0
   alpha_semiconvection = 1d0
   thermohaline_coeff = 1d0
   use_superad_reduction = .true.

   ! we use step overshooting on MS
   overshoot_scheme(1) = 'step'
   overshoot_zone_type(1) = 'burn_H'
   overshoot_zone_loc(1) = 'core'
   overshoot_bdy_loc(1) = 'top'
   overshoot_f(1) = 0.345
   overshoot_f0(1) = 0.01
   ! tiny bit of overshoot everywhere else
   overshoot_scheme(2) = 'exponential'
   overshoot_zone_type(2) = 'any'
   overshoot_zone_loc(2) = 'any'
   overshoot_bdy_loc(2) = 'any'
   overshoot_f(2) = 0.01
   overshoot_f0(2) = 0.005

   ! rotational mixing and angular momentum transport
   premix_omega = .true.
   am_nu_ST_factor = 1d0
   am_nu_DSI_factor = 1d0
   D_GSF_factor = 1d0
   D_ES_factor = 1d0
   D_SSI_factor = 1d0
   D_DSI_factor = 1d0
   am_D_mix_factor = 0.0333333d0
   am_gradmu_factor = 1d-1
!   set_uniform_am_nu_non_rot = .true.
!   uniform_am_nu_non_rot = 1d20
   do_adjust_J_lost = .false.  ! turn this on for science runs with rotation!

   ! spacial resolution
   mesh_delta_coeff = 3d0  ! way less cells for this lab, for science, use mesh_delta_coeff = 1d0 and adapt other meshing parameters!
   max_dq = 5e-2

   ! timestep controls
   time_delta_coeff = 1d0
   varcontrol_target = 1d-1  ! this can artificially stall timestep MT in binaries, rely on the rest of controls
   ! mdot limit
   delta_lg_star_mass_limit = -1  ! control with b_deltam, so fdm
   delta_lg_star_mass_hard_limit = -1
   ! control central abundance changes
   delta_XH_cntr_limit = 2.5d-2  ! lower these for actual science
   delta_XHe_cntr_limit = 5d-2
   delta_XC_cntr_limit = 5d-2
   delta_XO_cntr_limit = 5d-2
   delta_lgL_He_limit = 5d-2
   ! solver timestep limit
   gold_solver_iters_timestep_limit = 25
   ! jdot_adjust limits
   adjust_J_q_limit = 0.95
   adjust_J_q_hard_limit = 0.5
   ! HR diagram limits
   delta_lgTeff_limit = 0.05d0
   ! max increase
   max_timestep_factor = 1.6d0

   ! solver settings, most adjustements are to improve performance and reliability during MT
!   report_solver_progress = .true.
   report_ierr = .true.
   ! tries/redo settings
   redo_limit = -1
   retry_hold = 5
   ! corr coeff settigs
   solver_itermin_until_reduce_min_corr_coeff = 10
   tiny_corr_coeff_limit = 1000
   corr_coeff_limit = 1d-2
   ! gold settings
   use_gold_tolerances = .true.
   use_gold2_tolerances = .false.
   gold_tol_residual_norm1 = 1d-9
   gold_tol_max_residual1 = 1d-6
   gold_iter_for_resid_tol2 = 4
   gold_tol_residual_norm2 = 1d-6
   gold_tol_max_residual2 = 1d-4
   gold_iter_for_resid_tol3 = 7
   gold_tol_residual_norm3 = 1d-4
   gold_tol_max_residual3 = 1d-2
   make_gradr_sticky_in_solver_iters = .true.
   ! correction/tol settings
   tol_max_correction = 2d-2
   tol_correction_norm = 2d-3
   scale_max_correction = 2d-2
   ! ignores
   ignore_species_in_max_correction = .true.
   ignore_too_large_correction = .true.
   convergence_ignore_equL_residuals = .false.
   ! jumps ok
   max_corr_jump_limit = 1d99
   max_resid_jump_limit = 1d99
   ! Fixing the position of the Lagrangian region. of the mesh helps
   ! convergence near the Eddington limit
   max_logT_for_k_below_const_q = 100
   max_q_for_k_below_const_q = 0.95
   min_q_for_k_below_const_q = 0.95
   max_logT_for_k_const_mass = 100
   max_q_for_k_const_mass = 0.95
   min_q_for_k_const_mass = 0.95

   ! output options
   write_profiles_flag = .false.
   history_interval = 1
   terminal_interval = 1
   write_header_frequency = 25
   star_history_dbl_format = '(1pes40.5e3, 1x)'  ! only 5 digits
/
