Running the Model Makefile & Inputs MCMC Data from Plots

Files needed to run the model

Download the source code for the model from the L-Galaxies GitHub Repository: LGalaxies_Repository

Download the dark matter merger trees into ./MergerTrees/ contained in the source code folder (choose from: 1st line (only a few trees), 2nd line (all trees in the millennium) or 3rd line (all trees in the millennium in 5 separate files); the 4th is needed if you plan to run MCMC):

Untar files: "tar -xvf MR_MergerTrees.tar". A folder, MR (or MCMC), should be created.

Download the Stellar Population Synthesis tables, needed for photometry, into the root of the directory containing the source code:

Untar the file: "tar -xvf SpecPhotTables.tar". A folder, SpecPhotTables, should be created.

The source code for the model also contains various scripts to analyse its output. ./AuxCode/Python/ for Python and ./AuxCode/Idl/ for IDL (the python plots are done using a jupyter notebook). These compare model predictions with a number of observational datasets:

which should be extracted into the corresponding Python or IDL directory.

MergerTrees for MRII and MR-WMAP7:

Compiling the code

To compile the code simply run make on the command line. This will follow compiling instructions from 3 Makefiles:

Installing gsl and openmpi libraries on a mac:

By default, SYSTYPE = "MyMachine" in Makefile. Under "ifeq ($(SYSTYPE),"MyMachine")", in Makefile_compilers, the paths to the necessary libraries are specified. Installing these libraries on a mac is straightforward if you have Homebrew installed (a software to manage the installation of others). This is installed by default on new macs and you just need to follow these steps:

Running the code

After the code has been compiled, an executable called L-Galaxies will be created. To run the code simply execute the file in the command line giving it an input.par file (see Input files below) as a runtime argument:

./L-Galaxies ./input/input_Henriques2015_MR_W1_PLANCK.par

With this input file, as downloaded from the online repository, you will be running exactly the Henriques2015 version of L-Galaxies.

The variables FirstFile and LastFile, in the input file, define the first and last dark matter merger tree files in which the galaxy formation model will be run. These correspond to sub-volumes of the dark matter simulation. As default, only file 5 is computed (a subvolume roughly representative of the full simulation) but you have files 0-9 in the download package (the full Millennium simulation ocrresponds to files 0-511).

(later, to run the code in parallel, you might want to us thee bash scripts available in ./AuxCode/Run/, e.g. cosma.bash.)


Check list for errors while reading the inputs:

The first task done by the galaxy formation model is to read the inputs. If some inputs are missing or the specified paths are incorrect, you will get an error. Here is a check list on what to look for:


Input files for different models:

After you are familiar with running the Henriques2015 version of L-Galaxies you can try other versions by using a pre-defined selection of input files and MAKEFILE options. A number of input files for different models are available in /input/, with the following naming convection:

input_"ModelName_Simulation"_"OriginalCosmology"_"TargetCosmology".par

Inputs for previous versions of the model:

A range of files without a model name are available for new model development: ./input/input_MR_W1_PLANCK.par and ./input/input_MRII_W1_PLANCK.par (PLANCK year1 cosmology), ./input/input_MR_W1_W7.par and ./input/input_MRII_W1_W7.par (WMAP7 cosmology), ./input/input_MR_W1_W1.par and ./input/input_MRII_W1_W1.par (WMAP1 cosmology).

Running different models will likely change the output structure. Always make sure you are trying to read the correct LGalaxies_struct in your plotting routines. If the new models have different cosmologies you will also need to adjust the Volume and Hubble_h used in plots.

Analysing the Output

After the galaxy formation model has finished, output galaxy catalogues will be created in the output directory (./output/ is the default). One file will be created for each of the dark matter simulation sub volumes (just file number 5 as default, 0-9 available in the download package, a total of 512 for the full Millennium simulation). In normal mode, one file will be created for each output snapshot (1 file per subvolume and 1 file per snapshot):

SA_z56.42_0, SA_z56.42_1, ..., SA_z56.42_511
...
SA_z0.05_0, SA_z0.05_1, ..., SA_z0.05_511
SA_z0.03_0, SA_z0.03_1, ..., SA_z0.03_511
SA_z0.00_0, SA_z0.00_1, ..., SA_z0.00_511

If +OPT = -DGALAXYTREE, all snapshots, for a given sub-volume, will be in a single file:

SA_galtree_0, SA_galtree_1, ..., SA_galtree_511

Python and Idl scripts to read the model output and produce a few simple plots can be downloaded on the top of the page. Critically you will need to know the galaxy structure written into the output files. If you run make metadata, in the root directory, the output structue will be written into ./AuxCode/awk/idl/LGalaxy.pro. This will likely change if you change the Makefile options.

Credits & Copyright

The source code for the Munich model of galaxy formation and evolution, L-Galaxies, is published under the GNU General Public License. If you make use of the code in a scientific paper, please include the following line in the acknowledgements:

"This work used the 2015 public version of the Munich model of galaxy formation and evolution: L-Galaxies. The source code and a full description of the model are available at https://lgalaxiespublicrelease.github.io/"

Different parts of the code were developed and published in works y different authors. The current version of the model was presented in Henriques et al. 2015 and additional references can be found in its supplementary material. Included in the public release are a new module for the detailed chemical enrichment, presented in Yates et al. 2013, and the possibility to use clustering as a constraint for MCMC, introduced in van Daalen et al. 2015. The sampling of large parameter spaces using MCMC was introduced in the model in Henriques et al. 2009.>

Significant previous contributions to the current version of the model include: White & Rees 1978; White & Frenk 1991; Kauffmann, White & Guiderdoni 1993; Kauffmann, Nusser & Steinmetz 1996; Kauffmann et al. 1999; Springel et al. 2001, 2005; De Lucia et al. 2004; Croton et al. 2006; De Lucia & Blaizot 2007; Guo et al. 2011, 2013.; Henriques et al. 2013.