&star_job

	read_extra_star_job_inlist(1) = .true.
	extra_star_job_inlist_name(1) = 'inlist_common'

	load_saved_model = .true.
	load_model_filename = '1TP.mod'
	save_model_when_terminate = .true.
	save_model_filename = 'post_AGB.mod'

	history_columns_file = ''
	profile_columns_file = ''

    ! Comment to have 1 master history file; Uncomment these if we want to look at stages seperately
    ! set_initial_age = .true.
    ! initial_age = 0
    set_initial_model_number = .true.
    initial_model_number = 0

/ !end of star_job namelist

&eos

	read_extra_eos_inlist(1) = .true.
	extra_eos_inlist_name(1) = 'inlist_common'

/ !end of eos namelist

&kap

	read_extra_kap_inlist(1) = .true.
	extra_kap_inlist_name(1) = 'inlist_common'

/ !end of kap namelist

&controls

    ! Stop when any of these criteria are met
    max_model_number = 154000
    envelope_mass_limit = 0.005

	read_extra_controls_inlist(1) = .true.
	extra_controls_inlist_name(1) = 'inlist_common'

	log_directory = 'LOGS_TPAGB'
	photo_directory = 'photos_TPAGB'

	x_integer_ctrl(1) = 5 ! evolutionary stage:TP-AGB
	x_ctrl(1) = 2d-5 ! varcontrol target for resolving TDU (VCT from Rees et al. 2024)
	x_ctrl(2) = 1.0 ! mesh_dlogX_dlogP_extra for resolving TDU (MXP from Rees et al. 2024)

	use_other_eps_grav = .true. ! prevent HRI (Rees & Izzard 2024)
	use_other_alpha_mlt = .true. ! prevent FeI (Rees & Izzard 2024)
	use_other_timestep_limit = .false. ! alternative resolve TDU method (Rees & Izzard 2024) not recommended

	use_dPrad_dm_form_of_T_gradient_eqn = .true.

	convergence_ignore_equL_residuals = .true.

	energy_eqn_option = 'eps_grav'

	use_time_centered_eps_grav = .true.
	include_composition_in_eps_grav = .true.

	use_Ledoux_criterion = .false.

	mesh_logX_species(1) = 'he4'
	mesh_logX_min_for_extra(1) = -2
	mesh_dlogX_dlogP_extra(1) = 1.0   ! changed in run star extras to resolve TDU
	mesh_dlogX_dlogP_full_on(1) = 0
	mesh_dlogX_dlogP_full_off(1) = -1

	delta_lgL_He_limit = 0.01
	lgL_He_burn_min = 2.0
	lgL_He_drop_factor = 2.0

	dX_limit_species(2) = 'he4'
	dX_limit_min_X(2) = 1d-4
	dX_div_X_limit(2) = 0.5d0

	x_logical_ctrl(2) = .false. ! save hdf5 files for post processing

	num_trace_history_values = 7
	trace_history_value_name(1) = 'TP_count'
	trace_history_value_name(2) = 'alpha_mlt_max'
	trace_history_value_name(3) = 'alpha_mlt_surface'
	trace_history_value_name(4) = 'min_beta'
	trace_history_value_name(5) = 'lambda_DUP'
    trace_history_value_name(6) = 'surface_c12'
    trace_history_value_name(7) = 'envelope_mass'

	overshoot_scheme(1) = 'exponential' ! IPCZ overshooting controls
	overshoot_zone_type(1) = 'burn_He'
	overshoot_zone_loc(1) = 'shell'
	overshoot_bdy_loc(1) = 'bottom'
	overshoot_f(1) = 0.008 ! Herwig 2008
	overshoot_f0(1) = 0.0008
	overshoot_scheme(2) = 'exponential' ! convective envelope overshooting controls
	overshoot_zone_type(2) = 'any'
	overshoot_zone_loc(2) = 'shell'
	overshoot_bdy_loc(2) = 'bottom'
	overshoot_f(2) = 0.016 ! Herwig 2000
	overshoot_f0(2) = 0.0016

    ! Mass loss
      ! use_other_wind = .true. ! Vassilliadis & Wood 1993, using for <3M models only 

      ! If use_other_wind is not true, then uncomment these for Blocker:
      cool_wind_full_on_T = 9.99d9
      hot_wind_full_on_T = 1d10
      cool_wind_RGB_scheme = 'Reimers'
      cool_wind_AGB_scheme = 'Blocker'
      RGB_to_AGB_wind_switch = 1d-4

      ! RGB: keep the RGB at 0.5 for all models
      Reimers_scaling_factor = 0.5
      ! AGB: simple scaling with initial mass and metallicity, spanning 0.021 to 0.326 (set dynamically in src/agb/agb_run_star_extras.f90)
      ! Blocker_scaling_factor = (initial_mass / 12.0) * (initial_z) ** 0.3
    
    ! Output
      photo_interval = 1000
      profile_interval = 20000
      history_interval = 3
      terminal_interval = 30
      write_header_frequency = 10

/ !end of controls namelist

