Skip to content

lime-rt/lime

Repository files navigation

LIME (Line Modeling Engine)

Documentation

The present file is intended to be accessed here: README.md

Note that the main User's Manual for LIME can be built as HTML pages by the command 'make doc'. The start page is then to be found at doc/_html/index.html. This document is also available online at the ReadTheDocs website. The present file is only intended to be a summary.

About LIME

LIME was created by Christian Brinch, but several people have now contributed to it. See the LIME repository on GitHub for further details. See the file COPYRIGHT.md in the base directory for details of intellectual property rights for LIME.

LIME is a 3D molecular excitation and radiation transfer code for far-infrared and (sub-)millimeter wavelength. LIME will calculate spectra of rotational transitions of atoms and molecules, given a user-supplied physical model. Details on the method can be found in C. Brinch and M. R. Hogerheijde, A&A 553, A25 (2010)

Any scientific publication making use of the LIME code should also reference this publication.

Obtaining LIME

LIME is available on GitHub. We recommend that you obtain the latest numbered release rather than the master track version. The latter is development code, i.e. it is not stable, and it is more likely to contain unresolved bugs.

Installation notes

The LIME code needs three library packages in order to compile: qhull, gsl, and cfitsio. If these are not already present on your system, you will need to install them.

Mac OS X

The easiest way is to install MacPorts. After MacPorts has been installed, type in a terminal (as root or sudo)

port install qhull
port install cfitsio
port install gsl

Alternatively, the library packages may be installed with Fink. After Fink has been installed, type:

fink install qhull6.3.1-dev cfitsio gsl

Linux / Unix / Mac OS X (alternative)

If one or more of these packages is not present on your system, you can download the sources from the following locations. Make sure to get the latest versions.

The GNU scientific library (GSL), is present on most modern Unix and Linux systems. Check for availability with gsl-config --libs. If this command returns a library path, there is no need to download and install it.

All three library packages are installed using the following

configure --prefix=<LIME base dir>
make
make install

Here <LIME base dir> is the directory where the lime script is located.

In some cases the qhull library will produce a segmentation fault unless it is compiled with the -fno-strict-aliasing flag. Note that the example here does not require root privileges. Some modifications to the Makefile may be required if another location is set for the installation.

Note for qhull2011.1 and later: This version of qhull will sometimes not compile unless the -Wno-sign-conversion flag is removed from the qhull Makefile. The naming of the qhull library has changed between version 2010.1 and 2011.1. Make sure to edit the qhull flag near the top of the LIME Makefile accordingly. Also, the newest versions of qhull does not include a configure script.

Configuring LIME

We added a configure script with LIME version 1.9 to avoid the necessity to set extra environment variables or hack the Makefile etc in order to deal with different names for cfitsio/qhull headers and libraries on different systems. You should run this script once after you install LIME on your machine, viz:

cd <LIME base dir>
./configure

Doing this generates a file Makefile.defs, without which LIME will not compile.

Compiling and running LIME

There are now four different ways to do this. For detailed instructions on the three new flavours, see the full User's Manual. Here we describe only the original procedure, in which LIME is compiled and run via a script named lime in the base directory.

The path to the lime script needs to be in your PATH environment variable. If you are using bash, do:

export PATH=<LIME base dir>:${PATH}

If you are using csh, do:

setenv PATH <LIME base dir>:${PATH}

To find out whether you use bash or csh, do

echo $SHELL

The code runs simply by typing (for example)

lime [options...] <model file>

There is a template model file, model.c, in the <LIME base dir>/examples directory. You will almost certainly want to construct your own model file rather than using the unmodified template. Your model file can have any name, and be in any place.

The model file need not be written in C. Subroutines can also be written in Fortran (or other languages that can be linked with C, e.g., python) as long as the names comply with the standards of linking C and Fortran. See this page for information on how to link C and Fortran. If Fortran subroutines are used, the linking of LIME needs to be done with the Fortran compiler. Modify the Makefile accordingly.

Note that with version 1.9, a model file can also be written in python. See the full User's Manual for details on how to do this.

Build Status Documentation Status