Getting Started

This page has information to help you get started using MESA. It includes a sketch of the overall organization of the modules, then gives steps for downloading, installing, and using them.


Which Fortran 95 Compiler?
MESA organization
Downloading MESA (4083 is current as of June 8, 2012)
Installing MESA
Using MESA modules in your project
Previous releases





MESA is under construction—and probably will be for the indefinite future.

Before you use MESA, you should read the “instrument paper” that describes MESA as an instrument for doing science (arXiv:1009.1622). Beyond that paper, the “how-to” documentation is largely embedded in the experience of the community of users. If you have requests for help, you should join the mailing list and post your questions to mesa-users. And once you begin to know how to use mesa, please help by responding to posts on the list.

MESA is written using advanced features of modern Fortran which make it very different from Fortran 77 codes you might have previously seen (or written!). If you are not already familiar with the new and wonderful things that have been added, there are good resources available on the web—here’s one: Fortran 95 language features.

Which Fortran 95 Compiler?

Which compiler for mesa?—an up-to-date version of ifort or gfortran.

For good OpenMP support and superior code optimization, use ifort. If you’re looking for a free Fortran 95 compiler, go with gfortran. There are also academic licenses available for ifort.

Whether you use ifort or gfortran, you’ll need to have an up-to-date version since mesa is picky about that. Check the file mesa/utils/makefile_header for up-to-date information about compiler requirements.

BTW: I’ve recently seen severe performance degradation for very large mesa/star jobs using gfortran on my mac. This seems to happen only for gfortran on the mac however; the linux gfortran is only 25% or so slower than ifort as expected. And with ifort, the large jobs run fine on my mac. It looks as if gfortran is somehow being limited to 1GB of real memory on the mac, and for large jobs that results in horrible overhead. Let me know if you find a way to solve this; there is plenty of memory available, so we just need to configure the gfortran version of star to be able to use it.

MESA organization

When you download MESA, you’ll get a directory with lots of subdirectories. You can name the top level directory whatever you’d like and put it anyplace that’s convenient. But don’t mess with the names of the subdirectories or their contents. In the following, I’ll refer to this top level directory as “the MESA directory”.

Each MESA module has its own directory with a standard set of subdirectories and scripts. The standard subdirectories for each module are “make”, “private”, “public”, and “test”. The test directory has “make” and “src” directories for the program that tests the module when it is created. The make directory has the makefile for the library and will hold the object files and “mod” files that are created by the compiler. The public directory has the sources for the interface to the library, while the private directory has sources for the parts of the implementation that are meant for internal use only. For example, if you want to see what’s available in the eos module, look in eos/public/eos_lib.f for the routines and eos/public/eos_def.f for the data.

In addition to the directories for the various modules, the MESA directory also has several directories that hold shared information. The “data” directory holds tables for eos and opacities in both text and cached binary formats. The “include” directory holds interface information needed by the compiler, and the “lib” directory holds the library files for the modules.

Finally, the MESA directory contains several useful scripts that will be discussed below.

Downloading MESA

Before you download MESA, join the MESA-users mailing list.

After you have joined mesa-users, the next step is to “checkout” the MESA project using the svn version control system. (Binaries for svn are available from the downloads page of the subversion website. The first two chapters of the on-line Subversion Book will tell you all you need to know to use svn for MESA.)

The following command line will install the most recent officially released version. Note that there might be newer versions out there, but they are probably untested, unstable, and generally not at all what you want, so stick to the officially released ones.

svn co -r 4083 http://mesa.svn.sourceforge.net/svnroot/mesa/trunk mesa

Similarly, if you’ve previously done a checkout, and now you want to update to the most recent released version, do

svn update -r 4083

After you do an svn update, you should do ./clean before redoing ./install for the new stuff. That will force it to recompile everything just to be safe.

Whether you’re doing a checkout or an update, always use “-r” to get an officially released version.

NOTE: beware of incomplete svn operations! You might find the transfer has been terminated with a message like the following:

svn: GET of ’/svnroot/mesa/!svn/bc/2021/trunk/star/test/data/neutrino-data’: Could not read response body: Connection reset by peer (http://mesa.svn.sourceforge.net)

That means you’ve been cut off and must restart svn to complete the transfer. On particularly bad days, I’ve had to do several restarts of the svn transfer in order to get a complete update. It seems to be okay to do updates—i.e., you don’t need to start over with a complete checkout (thank goodness!).

Installing MESA

Before you can do an install for mesa, you need to get the prerequisites. Unless you are a masochist, you’ll probably want to use the mesasdk provided by Rich Townsend. It provides a prebuilt set of compilers and run-time libraries that should make your MESA install go smoothly. You can find a tar.gz of the mesasdk in the mesa/utils directory. You should visit the mesasdk website for details of setting it up.

After you have setup the mesasdk, copy the makefile_header that goes with the sdk to your makefile_header in utils by the following:

cd mesa/utils ; cp makefile_header.mesasdk makefile_header

If for some reason you don’t want to use the mesasdk, then edit your utils/makefile_header to give the relevant information about your system.

Once you have finished with your makefile_header, start the installation of the mesa code. In the top-level mesa directory, do to following:

./clean ; ./install

Using MESA modules in your project

The use of the stellar evolution package is covered in How to use MESA star. Here, we consider the case in which you want to use a module such as MESA eos in your project. The easiest way to get the idea is to look at a sample, and in the MESA directory you will find a subdirectory called “sample”. Make a copy of the sample directory anywhere you’d like and give it whatever name you want. Follow the instructions in the README file to make and test the sample.

Hopefully this little example will be enough to show you how to modify your own project makefile in order to use MESA. If not, consult the MESA-users mailing list for help. Please sign up before sending mail!

MESA-news—news from the developers; for interested non-users
MESA-users—questions, comments, and discussion; for users

Previous releases

4028 (Apr 28, 2012)
3918 (Feb 28, 2012)
3851 (Jan 11, 2012)
3794 (Dec 14, 2011)
3723 (Nov 7, 2011)
3709 (Oct 31, 2011)
3635 (Sept 23, 2011)
3372 (June 15, 2011)
3290 (May 21, 2011)
3251 (April 30, 2011)
3107 (March 20, 2011)
3075 (March 3, 2011)
2987 (2011-02-05)
2941 (2011-01-21)
2891 (2011-01-02)
2871 (2010-12-24)
2808 (2010-11-20)
2790 (2010-11-10)
2745 (2010-10-24)
2699 (2010-10-04)
2664 (2010-09-16)
2637 (2010-08-27)
2618 (2010-08-19)
2602 (2010-08-07)
2578 (2010-07-31)
2557 (2010-07-26)
2533 (2010-07-20)
2404 (2010-06-21)
2341 (2010-05-15)
2258 (2010-04-13)
2208 (2010-03-13)
2078 (2010-01-27)
1943 (2009-11-26)
1822 (2009-10-10)
1728 (2009-09-21)
1691 (2009-09-11)
1585 (2009-08-09)
1489 (2009-07-18)
1396 (2009-06-28)
1296 (2009-06-07)
1249 (2009-05-12)
1145 (2009-03-16)
1118 (2009-02-27)
971 (2009-01-25)
776 (2008-11-11)



web traffic stats SourceForge.net Logo Generated by webgen website design by
Andreas Viklund