The default CAMB distribution is designed to be as compatible as possible with CMBFAST - it uses the same driver routine for reading in parameters and the same parameterization of the initial power spectrum. Here we give some sample interface routines for calling CAMB from your own code, sample programs using the routines, and a modules for parameterizing the initial power spectrum in a better way.
This is a simple routine to get a set of Cls from your own programs. The code can easily be modified to generate Cls with various initial spectral indices. To build change the DRIVER entry in the Makefile to
DRIVER = CAMB_cls.f90 CAMB_cls_test.f90and then run "make camb". You need to run jlgen to generate "spherbes.dat" before running the test program.
This subroutine uses the same parameterization as CMBFAST, but in general fixing the tensor/scalar quadrupole ratio is not useful.
The CMB power spectra computed using this module will not be
COBEnormalized. The absolute normalization is arbitary, but the
relative normalization of tensor and scalar spectra generated with
this module will be correct (based on the value of rat()).
DRIVER = CAMB_slowroll.f90 CAMB_slowroll_test.f90and set "POWERSPECTRUM = power_slowroll". The test program prints out the scalar, tensor and total temperature CMB power spectrum for a particular choice of slow roll parameters. It demonstrates how to generate the scalar and tensor Cls separately in the correct ratio in an efficient way, and to COBEnormalize the result. You need to run jlgen to generate "spherbes.dat" before running the test program. This slow-roll parameterization only really makes sense for flat models.