Table of Contents
- 1. Prerequisites
- 2. Setup
- 3. Running MESA
- 4. Analyzing Data
- 5. Resources
The computer you use to run MESA must be a 64-bit system running either Linux or OS X. You should have at least 4GB of RAM.
2.1 Install the MESA SDK
Navigate to the MESA SDK website and carefully follow the instructions there. Read the page closely and watch out not to forget to install the prerequisites appropriate for your system.
2.2 Download MESA
MESA is an open-source code. The following command will download the latest release version into a directory named mesa. The package is large, so make sure you have ~ 10 GB free on your disk and don't worry if it takes a little while to download.
svn co -r 5118 svn://svn.code.sf.net/p/mesa/code/trunk mesa
2.3 Edit your shell start-up files
The easiest way to make sure that your system is always configured appropriately is to add the needed commands to the appropriate shell start-up file. As an example, the following lines are included in my .bashrc. If you use .cshrc the commands are slightly different. Ask us if you have questions.
# set up mesa export MESA_DIR=/Users/jschwab/Research/Software/mesa export MESASDK_ROOT=/Applications/mesasdk # initialize MESA SDK source $MESASDK_ROOT/bin/mesasdk_init.sh # this is a dual core machine export OMP_NUM_THREADS=2
2.4 Compile MESA
Now we are ready to compile the code. This will take a little while, so do something else for a bit or get up and get a cup of coffee.
cd $MESA_DIR ./install
3 Running MESA
3.1 Make a work directory
We will want to perform and store our work somewhere other than the main MESA directory. MESA helps make this easy by providing a template project directory. Each time you want to start a new MESA project, make a new copy of this directory.
cp -r $MESA_DIR/star/work projectname
Now that we have a work directory, we need to compile the code that lives in it.
cd projectname ./mk
3.3 Edit configuration files
We have provided a set of simple configuration files that will evolve a solar mass star to the ZAMS that you should download and put in your work directory. While you don't need to understand every line, you should understand each file's general purpose. Take a look at the files and the corresponding descriptions below.
This is the master configuration file that MESA reads when it stars up. There are three sections: star_job, which has options for the routines that "drive" the code, controls, which has the options for the star program, and pgstar, which has options for on-screen plotting.
The file we've given you tells MESA to go look elsewhere for the configuration info. This makes changing between different inlists easier, by allowing you to change the name of the file that gets read.
These are the options that we'll use to construct a solar-mass star from a pre-main sequence model and then stop the evolution once we reach the zero-age main sequence (ZAMS).
This houses the options for on-screen plotting. Feel free to ignore it for now. As written, it produces a simple HR diagram with a box marking the location of our sun.
The history file records quantities that are defined at each timestep, like the luminosity or the effective temperature. This file lets you choose which quantities will be logged.
A profile file records quantities that are defined over the whole star at single timestep, like the pressure or density. This file lets you choose which quantities are logged.
3.4 Run MESA
Running the code is now as simple as typing
MESA will keep you updated via terminal output and the pgstar on-screen plotting.
4 Analyzing Data
The data files are text-based and can fed into your favorite plotting program. You can write your own routine to read them or visit the MESA Forum and see if someone has contributed code in your language of choice. (There are reasonably mature routines for python, IDL, ruby and Mathematica.)
By default, MESA stores its data in the ./LOGS directory. In there, you'll find the following files.
This is a log of the history quantities that you requested.
MESA doesn't store profiles for every step (that'd take up too much space). This list tells you how to translate between the numbers in the profile filenames and the MESA model numbers. By default, MESA will store a profile at the end of the run.
This is a log of the stellar profile quantities that you requested at a single timestep. For convenience, the top of the file contains some useful global quantities at that step.
Here are links to some other MESA resources you might find interesting. The website and user forum have some support information. The MESA papers are a good way to get a feel for the variety of questions one can use MESA to study.