These MESA source files can be used to make the MESA models presented 
in Oomen et al. (2019). For more information about the models, please read the
article (in particular Sect. 4.2).

--> https://arxiv.org/abs/1908.01788

The inlists were prepared using MESA version r10398. If you have any questions
or problems using these inlists, you can email me at
glennmichael.oomen@kuleuven.be. 

The main purpose of the inlists is to evolve a star towards the post-AGB phase
and subsequently turning on accretion of metal-poor gas. The accretion of gas
causes a chemical peculiarity called depletion, which is observed in many
post-AGB stars with a circumbinary disc. 

To achieve this purpose, we needed to modify two files within the main code of MESA.
In order to use the inlists, one first needs to replace the following files:

$MESA_DIR/star/private/adjust_mass.f90 --> adjust_mass_MODIFIED.f90
$MESA_DIR/star/private/mlt_info.f90 --> mlt_info_MODIFIED.f90
$MESA_DIR/star/public/star_data.inc --> star_data_MODIFIED.inc

Change the names of the files to the original names. Next, reinstall code by going
to $MESA_DIR and write ./install. 

The file adjust_mass_MODIFIED.f90 includes minor changes to the code in order to 
allow for simultaneous mass loss by stellar winds and accretion of gas with a 
specified chemical composition. In mlt_info_MODIFIED.f90, only one line is changed
in order to reduce the gradT excess in the more massive post-AGB models. Finally,
star_data_MODIFIED.inc just includes several extra definitions of variables in the
code.

In order to use the code, first evolve the star towards the RGB/AGB phase, depending
on the core mass of the post-RGB or post-AGB star you want. Just include as a
stopping condition the he_core_mass_limit of your choice. In run_star_extras.f,
point s% other_adjust_mdot => evolve_to_PAGB, such that only a stellar wind is
activated. When the model is finished, continue the evolution from the last photo
and change in line 126 of run_star_extras the subroutine evolve_to_PAGB to

s% mass_change = -1d-4 

such that the remaining envelope is lost in a timescale of ~10000 yrs. Use as
stopping condition in inlist_project envelope_mass_limit = 0.02. Now the star
enters the post-AGB phase and we can continue evolution with accretion. Change the
stopping condition to Teff_upper_limit = 5d4, since we are not interested in the 
evolution in the hotter planetary nebula phase. To include accretion, change 
s% other_adjust_mdot => do_PAGB_evolution in run_star_extras. You can give a 
starting accretion rate, an initial disc mass, and a temperature at which you want
to start the accretion. More information about these parameters, as well as the
disc model, can be found in Oomen et al. (2019).

On a final note, in order to evolve massive post-AGB stars of around 0.65 Msun, 
you can set okay_to_reduce_gradT_excess to .true. in order to avoid convergence 
issues. I was unsuccessful in evolving post-AGB stars with core mass of 0.70 Msun
or higher.
