STEP 7: Changing the model [OPTIONAL]
Default vs. Modified model
Input files (i.e. the .par files) are provided for the Default Model (DM) and Modified Model (MM) versions of L-Galaxies 2020 (see Yates+21a for details).
In brief, the Default Model allows the majority of material released by supernovae and stellar winds to mix with the ambient ColdGas before some is blown out as galactic winds.
The Modified Model allows the majority of this newly-released material to be directly ejected into the surrounding HotGas, without first mixing with the ColdGas.
Depending on which model you want to use, the corresponding input file is one of the following:
- input_MR_W1_PLANCK_LGals2020_DM.par
- input_MR_W1_PLANCK_LGals2020_MM.par
Note that these input files are for runs on the Millenium-I merger trees. If you want to run on Millennium-II instead, see below.
Millennium-I vs. Millennium-II
By default, L-Galaxies 2020 will try to run on Millennium-I merger trees. To switch to Millennium-II, make sure you've downloaded some Millennium-II treefiles (see STEP 2), and then do the following:
- Open the My_Makefile_options file in the project root directory
- Uncomment the MRII switch
- Save and close My_Makefile_options
- Use the default model (DM) or modified model (MM) Millennium-II input files as the argument when running the code (see STEP 5 above):
- input_MRII_W1_PLANCK_LGals2020_DM.par
- input_MRII_W1_PLANCK_LGals2020_MM.par
Snapshot vs. Galaxytree mode
Snapshot mode (the default for L-Galaxies 2020) will only output data for a user-defined set of redshifts (i.e. snapshots).
Galaxytree mode will instead output data from all snapshots, along with the IDs needed to link a given galaxy to its progenitors and descendents (note that this generates much larger output files).
To use/modify snapshot mode:
- Open desired_output_redshifts.txt in the /inputs folder
- Add the redshifts you wish to be outputted to the top of this file, one on each line, with an empty line at the end of your list (L-Galaxies will match these to their nearest snapshots automatically)
- Open the My_Makefile_options file in the project root directory
- Set the NOUT parameter to equal the number of redshifts you set to be outputted in desired_output_redshifts.txt
- Make sure that the GALAXYTREE switch is commented-out
- Save and close My_Makefile_options
- Compile and run L-Galaxies 2020 as described in STEP 5
To use galaxytree mode:
- Open the My_Makefile_options file in the project root directory
- Uncomment the GALAXYTREE switch
- Save and close My_Makefile_options
- Compile and run L-Galaxies 2020 as described in STEP 5
Changing the output file name
- Open the input file you wish to use (see above) in the /inputs folder
- Change FileNameGalaxies to an appropriate name. This will be the prefix in the name of the output file(s) that L-Galaxies generates.
- Save and close the input file
- Compile and run L-Galaxies 2020 as described in STEP 5
Changing the treefiles used
- Open the input file you wish to use (see above) in the /inputs folder
- Set FirstFile to the first treefile you wish to use
- Set LastFile to the last treefile you wish to use
- Save and close the input file
- Compile and run L-Galaxies 2020 as described in STEP 5
To run L-Galaxies 2020 on the full set of Millennium-I or II trees, set FirstFile to 0 and LastFile to 511.
For testing purposes on Millennium-I, treefile 5 alone is normally sufficient.
For quick but statistically-significant runs on Millennium-I, treefiles 0-9 are normally sufficient.
For quick but statistically-significant runs on Millennium-II, treefiles 40-79 are normally sufficient.
Model switches
L-Galaxies 2020 comes with a series of pre-defined model options (or "switches") that change e.g. the physics models used, the treefiles used, which properties are tracked/outputted, etc.
These switches are defined in the My_Makefile_options file in the project root directory.
There meanings should be quite self explanatory, but if you are unsure, feel free to ask!
You are also able to add your own switches to your version of the code.
These should be defined in My_Makefile_options and then utilised in the necessary code files via "ifdef statements" (or equivalent).
For example, to create a switch which prevents the property BulgeMassRings from being outputted:
- Open My_Makefile_options in the project root directory
- Add the following line:
- OPT += -DNO_BULGEMASSRINGS_OUTPUT
- Save and close My_Makefile_options
- Put the following ifdef statement around the instances of BulgeMassRings in h_galaxy_output.h and save.c (see below for more details):
- #ifndef NO_BULGEMASSRINGS_OUTPUT
- ...
- #endif //NO_BULGEMASSRINGS_OUTPUT
- Save and close the code files
- Open the output structure you are using (e.g. LGalaxy_snapshots.py, LGalaxy_galtree.py, or one you have created yourself)
- Remove BulgeMassRings by either setting it to "False" in the properties_used dictionary (at the bottom of the .py file), or directly commenting it out:
- # ('BulgeMassRings',numpy.float32,12),
Changing which properties are outputted
By default (i.e. when in snapshot mode), L-Galaxies 2020 will output the properties listed in the Python-based "output structure" called LGalaxy_snapshots.py, which is in the /AuxCode/awk/output/python directory.
The galaxytree equivalent of this, called LGalaxy_galtree.py, is also provided in the same directory.
However, you are free to change which properties are actually outputted by L-Galaxies 2020.
This is done as follows:
- Open h_galaxy_output.h in the /code folder
- In the GALAXY_OUTPUT structure, add/comment-out the property you wish to be outputted/not outputted
For example, to remove BulgeMassRings, either put it in a newly-defined #ifndef (see above) or directly comment it out:
- // float BulgeMassRings[RNUM];
- Save and close h_galaxy_output.h
- Open save.c in the /code folder
- In the prepare_galaxy_for_output() function, add/comment-out the property you wish to be outputted/not outputted
For example, to remove BulgeMassRings, either put it in a newly-defined #ifndef (see above) or directly comment it out:
- // o->BulgeMassRings[ll] = g->BulgeMassRings[ll];
- Save and close save.c
- Open the output structure you are using (e.g. LGalaxy_snapshots.py, LGalaxy_galtree.py, or one you have created yourself)
- In the LGalaxiesStruct structure, add/comment-out the property you wish to be outputted/not outputted
For example, to remove BulgeMassRings, set it to "False" in the properties_used dictionary (at the bottom of the .py file), or directly comment it out:
- # ('BulgeMassRings',numpy.float32,12),
The property in question will now be included/removed from the output file generated by L-Galaxies 2020.
Note: The majority of errors occurring when trying to read-in L-Galaxies output binaries into a python script come from a mis-match between the actual output and the output structure.
Therefore, make sure you keep your output structure up-to-date with your code!