CMBFAST:
On line documentation.
Last updated 05/10/00.

 



 

Contents:

  • Overview.
  • Version and related matters.
  • Lensing Effect
  • Closed universes
  • Flat and Open codes
  • Files and Compilation
  • Output and COBE normalization
  • Some details

  •  

     
     
     
     
     
     
     
     
     
     
     

    If you have comments or need information not available in this web site please send us an e-mail .
     


    Back to CMBFAST


     

    Overview

    CMBFAST is a code for calculating the linear cosmic microwave background (CMB) anisotropy spectra based on integration over the sources along the photon past light cone. In this approach the temperature anisotropy is written as a time integral over the product of a geometrical term and a source term.

    The geometrical term is given by radial eigenfunctions which do not depend on the particular cosmological model. The source term can be expressed in terms of photon, baryon and metric perturbations, all of which can be calculated using a small number of differential equations.

    This split clearly separates between the dynamical and geometrical effects on the CMB anisotropies. More importantly, it allows to significantly reduce the computational time compared to standard methods. This is achieved because the source term, which depends on the model and is generally the most time consuming part of calculation, is a slowly varying function of wavelength and needs to be evaluated only in a small number of points. The geometrical term, which oscillates much more rapidly than the source term, does not depend on the particular model and can be computed separately. Standard methods that do not separate the two terms and require a much higher number of evaluations.

    This method leads to about two orders of magnitude reduction in CPU time when compared to standard methods and typically requires a few minutes on a workstation for a single model. The method should be especially useful for accurate determinations of cosmological parameters from CMB anisotropy and polarization measurements that will become possible with the next generation of experiments.

    The numerical implementation of integral solution to the photon transport equation differs in flat and non-flat geometries. In the flat case the geometrical term is given by the spherical Bessel function and can be computed in advance. In the non-flat geometries precomputing the ultra-spherical Bessel functions is not convenient as the memory space needed for storage would be very large because these functions depend both on the radial distance and the wavevector. Instead we integrate their differential equation to obtain the ultra-spherical functions.

    The spectra are normalized using Bunn and White fit to the shape and amplitude of the CMB power spectrum. The likelihood of the output spectrum relative to the flat for the COBE 4 year data is also given.

    CMBFAST can also be used to calculate and normalize the transfer functions for different species.

    Back to Contents 



     

    Version and related matters.

    Current Version 4.0  This version has several new features. It implements a k splitting technique that allows to use a flat omega=1 model to compute the high l multipoles of lambda, open and closed models exploiting the natural degeneracy in the CMB data. This technique gives a few percent accuracy and results in large time savings especially when computing a large number of models. The time savings can be up to a factor of 10 for individual models and significantly more for grids of models.   We also include subroutines to write the output as a fits table ready to input to the HEALPIX package.
    Several compile time options have been added to increase the flexibility of CMBFAST. For example, it can be compiled such that the output is not COBE normalized and it allows command line inputs. A directory with examples meant to explain these new features has been added. A bug that affected some models with optical depth different from 0 reported by Andew Liddle has been fixed. The accuracy of the calculation of C(l=2) for gravity waves has been improved, as pointed out in astro-ph/0006392 .

    Version 3.2.
    The code allows for the calculation of spatially closed universes. You can use RECFAST to make a more accurate calculation of recombination. The l sampling and maximum number of spectral indeces can be easily changed using new include files.

    Version 3.0. With this version the code allows for spatially closed universes. Details of the differences with open universes are noted in another section. The package contains several include files that can be used to change the l sampling. This is important because for closed models the Cl spectra is compresed in l space and so additional sampling may be necessary. An instability that developed for low k modes in some models was corrected. A bug in the lensing formula that affected the non-linear calculation was corrected. The required memory has been reduced by a more efficient use of common blocks. The RECFAST package can be used to track recombination more accurately.

    Version 2.1.
    We named the first version 2.1. List of bugs we have fixed in this version:

    Version 2.2. In this version we added isocurvature initial conditions to the open code.

    Version 2.3.1.
    In this version we added tensor modes to the open universe code.

    We fixed some minor problems with the isocurvature initial conditions.

    The accuracy of the transfer functions was revised, the hierarchy for the neutrinos is now solved to a higher l to get a 1% or better accuracy at higher wavevectors, k > 1 h Mpc^(-1). The user is allowed to choose between the higher accuracy mode or the previous one which may result in few percent differences at high k.

    Version 2.3.2.
    A minor bug in the massive neutrino calculation was fixed. It resulted in problems in the CMB spectrum for some extreme models.

    Version 2.4.
    We added the lensing routines and the possibility of using a non-integer number of neutrinos. This is useful to take into account some QED effects and a more accurate calculation of the neutrino distribution function after electron positon anhilition.

    Version 2.4.1.
    We implemented several minor changes:

    Version 2.4.1.
    In the course of the last year we have made several changes to the code, often based on suggestions from the users. To facilitate the trouble shooting we introduced a version number, allowing the users to identify whether they are running the latest version or not. If you find a problem we recommend you first read the changes made after that version and use the latest version to see if the problem persists. If it does send us an email with a description of the problem. Code version is located in the driver.f file.

    Back to Contents 



     

    Lensing Effect

    We have added subroutines needed to include the gravitational lensing effects on the CMB spectra. Bessel functions are needed to calculate the corrections. We tabulate this functions so jlens.f has to be run first to generate the appropriate file. The increase in computational time is negligible.

    Lensing will create B type polarization even for scalar modes so the output of the lensed spectra has an extra column for the B polarization. The format is the same as the output for the tensor modes.

    Back to Contents 



     

    Closed Universes

    CMBFAST can calculate spectra in closed universes. For the user the main worry should be l sampling. When the angular diameter distance to the last scattering surface is reduced, as happens in closed universes, the power spectra become compressed in l. This means that our l sampling of 50 may not be good enough and should be increased. The l values used in the calculation are in the file lvalues.inc. To change the sampling only this file needs to be modified and the code recompiled. Remember that you should also run jlgen and ujlgen again. For convenience we include two sample lvalues.inc files, lvalues_usual.inc and lvalues_fine.inc, which contain the usual choice and a finer sampling every 10 ls, respectively. By copying one of these files into lvalues.inc and recompiling the user can easily switch between l samplings.

    Extreme closed models with a maximum l of 1500 or more need to calculate the acoustic peaks well into the damping tail. In this case the code takes much longer that the open code for the same maximum l. In this case we suggest the user runs the flat model that is degenerate with that closed model and shift the spectra using the different angular diameter distances at high l.

    Back to Contents 



     

    Flat and open codes

    The codes for flat and open geometries only differ in the way the geometrical term is calculated. For flat models the spherical Bessel functions are interpolated from the precomputed tables. In the open code the ultra-spherical Bessel functions are obtained by integrating a differential equation.

    Although the method used in the open case could certainly be applied for flat models we decided to continue using the interpolation in the flat case because it requires less CPU time.

    Scalar perturbations can only have isentropic initial conditions in open geometries.

    For gravity waves we recommend doing the calculation up to l of approximately 300 as their contribution becomes unimportant at higher l. This allows to stop the calculation at smaller wavevectors (ketamax=900 or so) and save a considerable amount of CPU time.

    Back to Contents 



     

    Files and Compilation

    The code is provided as a compressed tar file, which should be unpacked using

    gunzip cmbfast.tar.gz
    tar -xvf cmbfast.tar

    When unpacked the CMBFAST package should be composed of several files including,

    We have several of different ways to use the code in an EXAMPLE directory.

    We now support several compile time options thus many files are preprocessed (.F). Thus we recomend
    that you compile using the provided configure script to generate a Makefile  and then use make. Manual compilation should work as well.

    The default options can be compiled by typing configure and then make.  If you type configure --help you will
    get a list of other options. There is an EXAMPLE directory where you will find more info. Options include:
     


    More than one option can be used at the same time.
    The configure script is provided as an example, we are sure you will be able to improve it.
    We recomend going through the example directory for further explanations and notes.

    The first thing needed is to generate the tables of spherical Bessel functions using jlgen.F (to compile
    manually use for example f77 -o jlgen jlgen.F ). The questions asked by the code should be self explanatory, default values appear between brackets.

    This should be repeated for the ultra-spherical Bessel functions, you should run ujlgen (to compile  manually f77 -o ujlgen ujlgen.F).

    Bessel functions are needed for the lensing calculation, you should run jlens (to compile  f77 -o jlens jlens.F).

    Next you run CMBFAST itself,
    ( f77 -o cmbfast driver.F cmbflat.F cmbopen.F lensing.F subroutines.F params.f recfast.f dverk.f)
    The questions asked by the code should be self explanatory and again default values appear between brackets.

    We recomend compiling with the most aggressive optimization flags your compiler has, for example something like
    f77 -fast -O5 works very well on a dec-alpha.

    Back to Contents 


    Makefile

    This file is a sample makefile. By typeing make  all the necessary compilations steps should be taken.
    Precompile options can be used as explained above.

    Back to Files and Compilation 

     

    driver.F

    This driver is the interface between the user and the various subroutines in the CMBFAST package. It asks for the parameters of the cosmological model to be computed and decides which subroutines to call. If several models need to be calculated a loop can be introduced in this program. Also if the flat or the open codes are needed separately this driver should be changed so that only one of the codes is called.

    We also provide driversub.f which is a subroutine that can be used to call CMBFAST from a program directly. It is a modified version of driver.F.

    Comments inside this driver will help the user either put a loop over models or construct another driver for the open or flat codes alone.

    Back to Files and Compilation 

     

    cmbflat.F

    This file contains the part of the flat geometry code that is not common to the open model code. The rest of the code is included in the subroutines.f file.

    Back to Files and Compilation 

     

    cmbopen.F

    This file contains the part of the open/close geometry code that is not common to the flat model code. The rest of the code is included in the subroutines.f file.

    Back to Files and Compilation 

     

    lensing.F

    This file contains subroutines needed to calculate the lensing effect on the CMB spectra.

    Back to Files and Compilation 

     

    subroutines.F

    This file contains the subroutines common to both flat and open codes. If the flat or open codes need to be compiled separately this file should be included in both codes.

    Back to Files and Compilation 

     

    ksplit.f

    This is a simple wrapper to use the k split method. It will calculate a high k and low k cl spectra and combine them.
    For more info check the README file under the EXAMPLES/KSPLIT directory.

    Back to Files and Compilation 

    jlgen.F

    This program generates the tables of Bessel functions for the flat code so it should be compiled and run before CMBFAST. The values of lmax and ketamax used to generate this table should be consistent to what is the entered to CMBFAST. This means the values of lmax and ketamax entered to CMBFAST should be smaller than those used to generate the tables.

    Back to Files and Compilation 

     

    ujlgen.F

    This program generates the tables of ultra-spherical Bessel functions for the open code so it should be compiled and run before CMBFAST. This tables are used to compute the initial conditions for the ultra-spherical Bessel function integration The values of lmax and ketamax used to generate this table should be consistent to what is the entered to CMBFAST. This means the values of lmax and ketamax entered to CMBFAST should be smaller than those used to generate the tables.

    Back to Files and Compilation 

     

    dverk.f

    This file contains the integrator we are using to evolve the differential equations (from netlib). If you are familiar with other integrators you can try them by substituting the calls to derivs by calls to your favorite integrator. Dverk is responsible for a large part of the CPU time used by the code, so if your favorite integrator turns out to be faster and as accurate as dverk please let us know.

    Back to Files and Compilation



     

    cmbfast.inc

    This file contains several parameters used to dimension arrays. Sometimes in order to increase the maximum l or the k and l sampling the user may want to increase the value of some of the parameters.

    Back to Files and Compilation



     

    lvalues.inc and cmbpar.inc

    cmbpar.inc contains a common block holding all the parameters.
    lvalues.inc contains the list of l values that is actually being calculated, other options
    are available in the directory under similar names.

    Back to Files and Compilation


    params.f

    This file contains subroutines used in the IARGC compilation option.
     

    Back to Files and Compilation


    recfast.f

    Recfast package for improved recombination calculation.
     

    Back to Files and Compilation
     
     
     





     

    Output and COBE normalization

    In this section we describe the output of the code. Back to Contents 




     

    Some details

    In this section we describe details of the code that the user may want to change. The list is by no means complete, we would appreciate any coments or questions which could help us improve it or enlarge it. Back to Contents