
! inlist_accretion_with_diffusion



&star_job
      show_log_description_at_start = .false.

      load_saved_model = .true.
      saved_model_name = 'DAZ_cool.mod'
      
      save_model_when_terminate = .true.
      save_model_filename = 'final.mod'
      
      write_profile_when_terminate = .true.
      filename_for_profile_when_terminate = 'final_profile.data'

      kappa_file_prefix = 'gs98' 

      set_tau_factor = .true. ! change tau_factor without reconverging.
      set_to_this_tau_factor = 0.001

      set_initial_age = .true.
      initial_age = 0.

      set_initial_dt = .true.
      years_for_initial_dt = 0.001 ! in years

      !pause_before_terminate = .true.
      !pgstar_flag = .true.

/ ! end of star_job namelist



&controls
      
      ! check for retries and backups as part of test_suite
      ! you can/should delete this for use outside of test_suite
         max_number_backups = 10
         max_number_retries = 40
         max_model_number = 4000


      surface_avg_abundance_dq = 1d-12
      
      num_trace_history_values = 1
      trace_history_value_name(1) = 'surface o16'      


      mixing_D_limit_for_log = 0.d4

      max_years_for_timestep = 0.10

      min_dq = 1d-20

      eps_nuc_factor = 0.0

      max_age = 5d0 ! in years

      surface_avg_abundance_dq = 1d-15

      split_mixing_choice = 0 ! 

      use_Ledoux_criterion = .true.
      thermohaline_coeff = 0.

      prune_bad_cz_min_Hp_height = 0 ! lower limit on radial extent of cz
      remove_mixing_glitches = .true. ! if true, then okay to remove gaps and singletons
      
               ! the following controls are for different kinds of "glitches" that can be removed
            
               clip_D_limit = 0 ! zero mixing diffusion coeffs that are smaller than this         

               okay_to_remove_mixing_singleton = .false.
         
               min_convective_gap = 1.0 ! 0.1 
                  ! close gap between convective regions if smaller than this (< 0 means skip this)
                  ! gap measured radially in units of pressure scale height
         
               min_thermohaline_gap = 1.0
                  ! close gap between thermohaline mixing regions if smaller than this (< 0 means skip this)
                  ! gap measured radially in units of pressure scale height
               
               min_thermohaline_dropout = 1.0
               max_dropout_gradL_sub_grada = 1d-3
                  ! if find radiative region embedded in thermohaline,
                  ! and max(gradL - grada) in region is everywhere < max_dropout_gradL_sub_grada
                  ! and region height is < min_thermohaline_dropout
                  ! then convert the region to thermohaline
         
               min_semiconvection_gap = 1.0 
                  ! close gap between semiconvective mixing regions if smaller than this (< 0 means skip this)
                  ! gap measured radially in units of pressure scale height
         
               remove_embedded_semiconvection = .true.
                  ! if have a semiconvection region bounded on each side by convection,
                  ! convert it to be convective too.

      initial_mass =  0.60
      initial_z = 0.01d0
      
      use_Type2_opacities = .true.
      Zbase = 0.00d0

      mesh_delta_coeff = 1.00
      !mesh_delta_coeff = 0.5
      !mesh_delta_coeff = 0.33
      !mesh_delta_coeff = 0.25


      xtra_coef_b_l_nb_czb = 0.25 ! below lower nonburn convective boundary
      xtra_coef_a_l_nb_czb = 0.25 ! above lower nonburn convective boundary
      xtra_dist_a_l_nb_czb = 1.0 ! above lower nonburn convective boundary
      xtra_dist_b_l_nb_czb = 1.0 ! below lower nonburn convective boundary

      mass_change = 1.d-18

      report_all_dt_limits = .true.

      which_atm_option = 'grey_and_kap' ! use this for getting pulsation data including atmosphere
      which_atm_off_table_option = 'grey_and_kap'
      
      
      when_to_stop_rtol = 1d-3
      when_to_stop_atol = 1d-3

      photostep = 10
      profile_interval = 10
      history_interval = 10
      terminal_interval = 10
      write_header_frequency = 10
      
      MLT_option = 'ML2'
      
      smooth_convective_bdy = .true.

      mixing_length_alpha = 0.0

      overshoot_f_above_nonburn_core = 5.5
      overshoot_f_above_nonburn_shell = 5.5
      overshoot_f_below_nonburn_shell = 0.1

      overshoot_f0_above_nonburn_core = 5.0
      overshoot_f0_above_nonburn_shell = 5.0
      overshoot_f0_below_nonburn_shell = 0.05

      diffusion_dt_limit = 0.

      do_element_diffusion = .true.

      diffusion_num_classes = 8 ! number of classes of species for diffusion calculations
      diffusion_class_representative(1) = 'h1'
      diffusion_class_representative(2) = 'he3'
      diffusion_class_representative(3) = 'he4'
      diffusion_class_representative(4) = 'c12'
      diffusion_class_representative(5) = 'n14'
      diffusion_class_representative(6) = 'o16'
      diffusion_class_representative(7) = 'ne20'
      diffusion_class_representative(8) = 'fe56'
   
      ! in ascending order.  species goes into 1st class with A_max >= species A
      diffusion_class_A_max(1) = 2
      diffusion_class_A_max(2) = 3
      diffusion_class_A_max(3) = 4
      diffusion_class_A_max(4) = 12
      diffusion_class_A_max(5) = 14
      diffusion_class_A_max(6) = 16
      diffusion_class_A_max(7) = 20
      diffusion_class_A_max(8) = 10000
         
      diffusion_use_isolve = .true.
      diffusion_rtol_for_isolve = 1d-9
      diffusion_atol_for_isolve = 1d-10
      diffusion_maxsteps_for_isolve = 1000
      diffusion_isolve_solver = 'rodasp_solver'

      accrete_same_as_surface = .false.
      ! if true, composition of accreted material is identical to the current surface composition.

      accrete_given_mass_fractions = .false.
      ! if true, use the following mass fractions -- they must add to 1.0
      num_accretion_species = 0 ! up to max_num_accretion_species
      accretion_species_id(1) = '' ! isotope name as defined in chem_def
      accretion_species_xa(1) = 0 ! mass fraction

      ! otherwise, use the following parameters
      accretion_h1 = 0 ! mass fraction
      accretion_h2 = 0 ! if no h2 in current net, then this is automatically added to h1
      accretion_he3 = 0
      accretion_he4 = 0
      !accretion_zfracs = -1 ! one of the identifiers for different Z fractions from chem_def
      accretion_zfracs = 5 ! one of the identifiers for different Z fractions from chem_def
         ! AG89_zfracs = 1, Anders & Grevesse 1989
         ! GN93_zfracs = 2, Grevesse & Noels 1993
         ! GS98_zfracs = 3, Grevesse & Sauval 1998
         ! L03_zfracs = 4, Lodders 2003
         ! AGS05_zfracs = 5, Asplund, Grevesse & Sauval 2005
         ! or set accretion_zfracs = 0 to use the following list of z fractions
         
      
      ! convergence controls
         varcontrol_target = 1d-5
         
         tol_residual_norm1 = 1d-5
         tol_max_residual1 = 1d-2
         iter_for_resid_tol2 = 3
         tol_residual_norm2 = 1d99
         tol_max_residual2 = 1d99
         iter_for_resid_tol3 = 99 

/ ! end of controls namelist


&pgstar

         Mixing_win_flag = .false.
	 Mixing_xaxis_name = 'logxq'
	 Mixing_xmin = -16 ! only used if /= -101d0
         Mixing_xmax = -10 ! only used if /= -101d0
	 Mixing_xaxis_reversed = .true.

	 Mode_Prop_win_flag = .false.
	 Mode_Prop_xaxis_name = 'logxq'
         Mode_Prop_xaxis_reversed = .true.
	 Mode_Prop_xmin = -16 ! only used if /= -101d0
         Mode_Prop_xmax = 0   ! only used if /= -101d0
	 Mode_Prop_ymin = 2 ! only used if /= -101d0
         Mode_Prop_ymax = 8 ! only used if /= -101d0

         !History_Track9_win_flag = .true.
         History_Track9_win_width = 9
	 !History_Track9_xname = 'model_number'
	 History_Track9_xname = 'star_age'
         History_Track9_yname = 'log_surface_o16'
	 !History_Track9_ymin = -8
         History_Track9_xaxis_label = ''
         History_Track9_yaxis_label = ''


         Summary_History_win_flag = .false.
	 Summary_History_xmax = -1 ! step number.  negative means use default.
         Summary_History_xmin = 18400 ! step number.  negative means use default.
	 Summary_History_win_width = 9
	 Summary_History_scaled_value(:) = .false.

	 Summary_History_num_lines = 1
	 Summary_History_name(1) = 'log_surface_o16'
         Summary_History_legend(1) = 'log O16 surface'
	 Summary_History_scaled_value(1) = .false.
         
         !TRho_Profile_win_flag = .true.
         TRho_Profile_win_width = 9
         show_TRho_Profile_kap_regions = .false.
         show_TRho_Profile_eos_regions = .true.
         show_TRho_Profile_degeneracy_line = .true.
         show_TRho_Profile_Pgas_Prad_line = .true.
         show_TRho_Profile_burn_lines = .true.
         show_TRho_Profile_burn_labels = .true.
         show_TRho_Profile_logQ_limit = .true.

	 show_TRho_Profile_annotation1 = .true.
         show_TRho_Profile_annotation2 = .true.
         show_TRho_Profile_annotation3 = .true.

         Grid2_win_flag = .true.
         Grid2_win_width =13 
	 !Abundance_xaxis_name = 'mass'
	 !Abundance_xaxis_name = 'logxq'
	 Abundance_xaxis_name = 'zone'
	 Abundance_xmin = 1 ! -18
    Abundance_xmax = 1600 ! -8 ! only used if /= -101d0
	 Abundance_xaxis_reversed = .true.
	 Abundance_log_mass_frac_min = -20
	 !Abundance_log_mass_frac_min = -11
	 !Abundance_log_mass_frac_max = 0.7


/ ! end of pgstar namelist
