-
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:
-
In subroutine foutputt in file cmbflat.f the formula
for dte had a typo, the correct formula is now in place. This affected
the first few l multipoles of the E polarization.
-
There was an inconsistency between the power spectrum used in subroutine
COBEnormalize in file subroutines.f and that used
in the calculation of the Cls for open models with n different from one.
This gave wrong power spectrum normalization for these models.
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:
-
cmbfast.inc can be used to set the maximum multipole
moment l that can be calculated. It is used internally to dimension arrays.
The make command will automatically recompile all the files that need this
input if the file is changed.
-
The definition of matter power spectrum normalization from COBE d2norm
was changed to make it easier to modify the initial power spectrum, when
it is not a power law. User only needs to change powersflat and powersopen
subroutines.
-
delta.f serves as an example of how to COBE normalize
the linear matter power spectrum and obtain sigma8. It illustrates how
to use d2norm.
-
We fixed a bug in the lensing subroutine and one in the routine that calculates
the parameters of reionization that affected massive neutrino models.
-
The memory requirements were reduced by about 1/3 using some simple modifications.
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:
-
UNNORM : this option outputs the results without COBE normalization. See
README files in the EXAMPLES directory for a more detailed explanation
of the internal CMBFAST normalization . To use this option compile using
configure --with-cobe=no or add -DUNNORM manually to each compilation (eg.
f77 -c -DUNNORM driver.F). This option MUST be used if the K splitting
technique is to be used.
-
FITS : This option also outputs the results in fits format so they can
be used with the HEALPIX package. You must have the fits library installed
in your computer. See the README file in the EXAMPLE directory for more
details. To use this options use configure --with-fits=yes or add
-DFITS manually to each compilation step.
-
IARGC : this option allows for input directly from the command line for
jlgen, ujlgen, jlens and from a file for cmb. Compile with configure
-- with-iargc=yes or add -DIARGC in the manual compilation.
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.
-
CMB results:
CMB temperature and polarization can be characterized by three variables,
T,E,B. Only four power spectra are needed to describe the statistics, those
for T, E, B and the cross correlation between E and T. The cross correlations
between B and E or T vanishes as these quantities have opposite parities.
We refer to the related publications
listed
in the CMBFAST webpage for a detailed discussion on the relation of these
quantities with the Stokes parameters. For scalar modes B vanishes identically
and so the code outputs T, E and TE cross-correlation. For tensor modes
B is no longer zero and power spectra for T, E, B and TE are given. The
output is done by subroutine output in file subroutines.f.
-
Transfer functions:
If requested the code will calculate and output matter transfer functions.
The output can be for specified redshifts, which is particularly useful
in models with massive neutrinos. If there are no massive neutrinos the
output file gives wavector k/h, CDM, baryons, photons and massless neutrinos;
the wavevector is in units of Mpc/h where h stands for the Hubble constant
in units of 100 km/sec/Mpc. A sixth column for massive neutrinos is added
if necessary. Note that these are "raw" transfer functions, their
normalization is arbitrary and just reflects our choices in the initial
conditions. The output is done by subroutine outtransf in file
subroutines.f.
-
COBE normalization:
COBE normalization is done by subroutine COBEnormalize in
file
subroutines.f. It uses Bunn
and White fit to the shape and amplitude of the CMB power spectra.
The output is l(l+1)Cl/2pi. We also output the likelihood of the spectra
relative to the flat one calculated in the same approximation. When the
transfer functions are requested sigma_8 and a normalization factor (d2norm)
for the matter power spectra are also given. The transfer functions are
written to a file while the equations are integrated so the above normalization
factor should be used get the correct normalization. You should look in
file EXAMPLES/TF/README for a discussion that illustrates how to obtain
a normalized delta^2(k) and sigma8.
-
Initial power spectrum:
The initial power spectrum is only used at the end of the calculation
when Cls are being computed. Thus a loop over different power spactra is
simple and no additional time is added to the calculation. The power spectra
are calculated in subroutines subroutine powersflat
and subroutine
powersopen in files cmbflat.f and cmbopen.f
for scalar modes and subroutine powertflat
in file cmbflat.f
for tensor modes.
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.
-
l-sampling:
The Cl spectra are calculated for only some values of l and the rest
is computed by interpolation. The list of values of l being calculated
is in subroutine initlval in the file subroutines.f.
This list must be equal to the one in jlgen.f that
computes the tables of spherical Bessel functions.
-
source k-sampling:
The values of k where the sources are computed are stored in the ak0
array set in subroutine cmbflat and
subroutine cmbopen
in files cmbflat.f and
cmbopen.f.
-
geometric term k-sampling:
The values of k where the spherical \ ultraspherical Bessel functions
are computed are stored in the ak1 array set in subroutine
cmbflat and
subroutine cmbopen in files cmbflat.f
and cmbopen.f.
-
time sampling:
The values of the conformal time used in the line of sight integration
are fixed in subroutines subroutine finithermo and
subroutine
oinithermo in files cmbflat.f and cmbopen.f
and stored in the array atau0. During decouping the spacing is linear and
given by the minimum between the inverse of the maximun wavevector and
some fraction of the conformal time at decoupling. After decoupling the
timesteps are increased, and in the flat code they are spaced logarithmically.
If an early reionization is requested there is another refinement in the
timesteps during the second peak of the visibility function with linear
steps in time. All changes in the time sampling should be done in these
two subroutines.
-
number of photon moments in the hierarchy:
The Boltzmann hierarchy for the photons is truncated at l=8. This is
set by parameter lmax0 in subroutine cmbflat and
subroutine
finitial in file cmbflat.f and subroutine
cmbopen and
subroutine oinitial in file cmbopen.f.
-
number of massless neutrino moments in the hierarchy:
The Boltzmann hierarchy for the massless neutrinos is truncated at
l=7 or at l=25 depending on the accuracy required in the transfer functions
at high k , k > 1 (h Mpc)^(-1), (this has no effect on the CMB spectrum).
The number of moments in highest accuracy mode is set by parameter
lmaxnr0 in subroutine cmbflat and
subroutine finitial
in file cmbflat.f and subroutine cmbopen and
subroutine
oinitial in file cmbopen.f. In the l=7 mode the
number of moments is set by lm2.
-
number of massive neutrino moments in the hierarchy:
The Boltzmann hierarchy for the massive neutrinos is truncated at l=4
or at l=25 depending on the accuracy required in the transfer functions
at high k, k > 1 (h Mpc)^(-1) (this has no effect on the CMB spectrum).
The number of moments in highest accuracy mode is set by parameter
lmaxnu0 in subroutine cmbflat, subroutine fderivs
and
subroutine finitial in file cmbflat.f.
In the l=4 mode the number of moments is set by lm3. Massive neutrinos
have not been implemented in the open universe code yet.
-
number of momentum modes in massive neutrino calculation:
The Boltzmann hierarchy for the massive neutrinos depends also on the
neutrino momentum. A grid in momentum is used, the number of momenta is
set by nqmax0 in subroutine cmbflat, subroutine fderivs
,
subroutine
fderivst and
subroutine finitial in file cmbflat.f.
Massive neutrinos have not been implemented in the open universe code yet.
Back to Contents