forked from cmbant/CAMB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
readme.html
896 lines (819 loc) · 57.5 KB
/
readme.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
<HTML>
<HEAD>
<TITLE>CAMB ReadMe</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#800080">
<BODY>
<CENTER>
<A HREF="#compiling">Compiling</A> | <A HREF="#inputs">Inputs</A> | <A HREF="#outputs">Outputs</A>| <A HREF="#coding">Customization</A> | <A HREF="#version">History</A> | <A HREF="#COMPARE">Comparison</A> | <A HREF="#FILES">Source files</A> | <A HREF="#ACCURACY">Accuracy</A> |
<A HREF="#adds">Add-ons</A> | <A HREF="#refs">References</A>
</CENTER>
<FONT FACE="Arial,Helvetica" SIZE=2>
<H2>CAMB ReadMe</H2>
Code for Anisotropies in the Microwave Background by <A
HREF="http://cosmologist.info/">Antony Lewis</A> and Anthony
Challinor. <P>
This version November 2015.
<P>
<FONT SIZE=-1>
Originally based on CMBFAST developed by Uros Seljak and Matias
Zaldarriaga, itself based on Boltzmann code written by
Edmund Bertschinger, Chung-Pei Ma and Paul Bode.
For latest information on this program see <A HREF="http://camb.info">camb.info</A>.
</FONT>
<P>
CAMB is also supplied as part of the <A HREF="http://cosmologist.info/cosmomc/">CosmoMC</A> parameter estimation package. For an extension including perturbed recombination, 21cm, lensing and number count sources see <A HREF="http://camb.info/sources">CAMB sources</A>.
<P>
<A NAME="compiling">
<B>Compiling and running</B>
</P>
To install and compile yourself you will need a Fortran 90 (or higher) compiler - you can get the free <A HREF="http://gcc.gnu.org/wiki/GFortran">GFortran</A> compiler, or the optimized Intel compiler <em>ifort</em> is installed on many academic clusters and also supports integrated development and debugging in Visual Studio under Windows.
Alternatively you can use CAMB in the pre-configured <A HREF="http://cosmologist.info/CosmoBox">CosmoBox</A> virtual machine. <P>
To install yourself from the command line:
<UL>
<LI><A HREF="http://camb.info/CAMBsubmit.html">Download</A> CAMB
<LI>Unzip and untar the file (<B>tar xfv CAMB.tar.gz</B>). All files will be extracted to a
directory called "CAMB".
<LI>Run <B>make</B> to compile everything you will need. (you may need to
edit the supplied Makefile, see below)
<LI>Run <B>./camb params.ini</B>, where params.ini is a file
of parameter values (sample supplied). The params.ini file should be
fairly self-explanatory.
<LI>To install and use the Python CAMB wrapper see the <A HREF="https://camb.readthedocs.org/en/latest">Python CAMB</A> documentation.
</UL>
</P>
<P>
The Makefile comes set up for gfortran and ifort compilers. Edit the relevant parts of the Makefile to compile on other systems. If you have Intel's Visual Fortran you can use the projects in the VisualStudio folder, no need to use the Makefile. To run on multi-processor machines add the -openmp (or equivalent) option to the Makefile's FFLAGS parameter to compile a parallelized (OPENMP) version. The code is also available from GitHub.
</P>
<P>
Martina Schwind has kindly contributed some <A hREF="Work_with_CAMB_V13_for_AL.pdf">introductory slides</A> with details of program running and internal structure. For some further technical details about the algorithms, equations and code see the <A HREF="http://cosmologist.info/notes/CAMB.pdf">CAMB notes</A>. For a demo of how to use CAMB with the python wrapper see the <A HREF="http://camb.readthedocs.org/en/latest/CAMBdemo.html">demo notebook</A>.
</P>
<A NAME="inputs">
<H3>Input parameters</H3>
<P>
The params.ini file specifies the parameters used to run the program. Comments in params.ini should make this fairly self-explanatory,
more complicated cases, for example to run with multiple neutrino mass eigenstates and sterile neutrinos at different temperatures
see the documentation and examples in the <A HREF="http://cosmologist.info/notes/CAMB.pdf">CAMB notes</A>. To produce the matter power spectrum in addition to CMB C<sub>l</sub> set <b>get_transfer = T</b>; the <b>do_nonlinear</b> input parameter determines whether this is output as the linear power spectrum or includes non-linear corrections from the Halofit model.
<P>
The default params.ini file produces results in μK<sup>2</sup> from the given primordial curvature perturbation power (<B>scalar_amp</B>) on 0.05 MPc<sup>-1</sup> scales. To get unnormalized dimensionless results set <B>scalar_amp(1)=1</B> and <B>CMB_outputscale=1</B>. To compute lensed C<sub>l</sub>s you must set the normalization to some realistic value (the calculation is non-linear, so normalization matters).
<P>
<A NAME="outputs">
<H3>Outputs</H3>
Unlensed scalar angular power spectra are output to <b>output_root</b>_scalCls.dat. The columns are
<BLOCKQUOTE>
l C<sub>TT</sub> C<sub>EE</sub> C<sub>TE</sub> [C<sub>Φ</sub> C<sub>ΦT</sub>]
</BLOCKQUOTE>
Here all C<sub>X</sub> are l(l+1)C_l/2pi except for C<sub>Φ</sub> and C<sub>ΦT</sub> which are C<sub>Φ</sub>= l<sup>4</sup> C<sub>l</sub><sup>Φ</sup>, where C<sub>l</sub><sup>Φ</sup> is the (CMB) lensing potential power spectrum, and C<sub>ΦT</sub> = l<sup>3</sup> C<sub>l</sub><sup>ΦT</sup>. The lensing terms in square brackets are only produced if <b>do_lensing = T</b>. If <b>CMB_outputscale = 7.4311e12</B> ([T<sub>CMB</sub>10<sup>6</sup>]<sup>2</sup>, the default), the units are μK<sup>2</sup>. Note that lensing spectra are also multiplied by CMB_outputscale, so you may want to divide this out of the answer to get a sensible dimensionless spectrum or use the <b>lens_potential_output_file</b> file mentioned below. If requested the lensed power spectrum is output to <b>output_root</b>_lensedCls.dat
<P>
Tensor angular power spectra are output to <b>output_root</b>_tensCls.dat if requested.
The columns are
<BLOCKQUOTE>
l C<sub>TT</sub> C<sub>EE</sub> C<sub>BB</sub> C<sub>TE</sub>
</BLOCKQUOTE>
If scalars and tensors are generated, the total spectrum is in <b>output_root</b>_totCls.dat, in the same format as the tensor output file.
<P>
If <b>do_lensing=T</b> and <b>lens_potential_output_file</b> is specified a file is output containing unlensed scalar (+tensor if calculated) spectra along with the lensing potentials in this format:
<BLOCKQUOTE>
l C<sub>TT</sub> C<sub>EE</sub> C<sub>BB</sub> C<sub>TE</sub> C<sub>dd</sub> C<sub>dT</sub> C<sub>dE</sub>
</BLOCKQUOTE>
where as before C<sub>X</sub> are l(l+1)C<sub>l</sub>/2π, and d is the deflection angle, so C<sub>dd</sub>=[l(l+1)]<sup>2</sup>C<sub>l</sub><sup>Φ</sup>/2π, C<sub>dT</sub>=[l(l+1)]<sup>3/2</sup>C<sub>l</sub><sup>ΦT</sup>/2π,
C<sub>dE</sub>=[l(l+1)]<sup>3/2</sup>C<sub>l</sub><sup>ΦE</sup>/2π. These are the spectra required for simulating lensed skies using <A HREF="http://cosmologist.info/lenspix">LensPix</A>.
<P>
<A NAME="transfer"></A>
If transfer functions are requested the columns in the <b>output_root</b>_transfer.dat output file are:
<p>
<table border="1" cellpadding="2" style="font-size:12px">
<tr><td>1 </td><td> k/h </td><td> wavenumber in h Mpc<sup>-1</sup> </td></tr>
<tr><td>2 </td><td> Delta_CDM/k<sup>2</sup> </td><td> CDM </td></tr>
<tr><td>3 </td><td> Delta_b/k<sup>2</sup> </td><td> baryons </td></tr>
<tr><td>4 </td><td> Delta_g/k<sup>2</sup> </td><td> photons </td></tr>
<tr><td>5 </td><td> Delta_r/k<sup>2</sup> </td><td> massless neutrinos </td></tr>
<tr><td>6 </td><td> Delta_nu/k<sup>2</sup> </td><td> massive neutrinos </td></tr>
<tr><td>7 </td><td> Delta_tot/k<sup>2</sup> </td><td> CDM+baryons+massive neutrinos </td></tr>
<tr><td>8 </td><td> Delta_nonu/k<sup>2</sup> </td><td> CDM+baryons </td></tr>
<tr><td>9 </td><td> Delta_totde/k<sup>2</sup> </td><td> CDM+baryons+massive neutrinos+ dark energy(numerator only)</td></tr>
<tr><td>10 </td><td> Φ </td><td> The Weyl potential (φ+ψ)/2 </td></tr>
<tr><td>11 </td><td> vel_Newt_cdm/k<sup>2</sup> </td><td>vel_Newt_cdm is -v<sub>cdm</sub> k/H (Newtonian-gauge CDM velocity v<sub>cdm</sub>) </td></tr>
<tr><td>12 </td><td> vel_Newt_b/k<sup>2</sup> </td><td> vel_Newt_b is -v<sub>b</sub> k/H (Newtonian-gauge baryon velocity v<sub>b</sub>) </td></tr>
<tr><td>13 </td><td> vel_baryon_cdm/k<sup>2</sup> </td><td> relative baryon-CDM velocity (v<sub>b</sub>-v<sub>cdm</sub>) </td></tr>
</table>
<br>
where Delta_X is defined as (delta rho_X)/rho_X in the synchronous gauge and evaluated at the requested redshift, given a unit primordial curvature perturbation on superhorizon scales (for adiabatic modes, chi_0=-1).
The column numbers correspond to the Transfer_xx integer constants defined in the Transfer module (modules.f90).
<p>
<b>output_root</b>_matterpower.dat contains the conventionally normalized matter power spectrum (for baryons+cdm+massive neutrinos), in h/Mpc units.
<P>
<A NAME="coding">
<H3>Compilation options and code modifications</H3>
<P>
You can edit the Makefile's EQUATIONS, POWERSPECTRUM, RECOMBINATION and REIONIZATION
variables , which determine which module is used to implement and model various parts of the calculation. The POWERSPECTRUM.f90 file7 contains a module giving the initial
power spectrum, the EQUATIONS.f90 file contains the background evolution
equations and sets of gauge-dependent perturbation
equations (the alternative equations_ppf.f90 is provided to implement the common <i>w</i>, <i>w<sub>a</sub></i> varying dark energy parameterization). RECOMBINATION.f90 gives the background recombination history: recfast by default, but you can also compile to use <A HREF="http://www.cita.utoronto.ca/~jchluba/Science_Jens/Recombination/CosmoRec.html">CosmoRec</A> and <A HREF="http://www.sns.ias.edu/~yacine/hyrec/hyrec.html">HyRec</A>. REIONIZATION is by default a simple relatively fast single-step reionization model (following <A HREF="http://arxiv.org/abs/0804.3865">arXiv:0804.3865</A>).
Various other modules can also be changed at compile time if desired.
To avoid problems run <B>make clean</B> after changing the
Makefile before recompiling. You can also use e.g. <B>make RECOMBINATION=cosmorec</b> to override the default and compile with a different module.
</P>
<P>
You can produce files in <A
HREF="http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html">FITS</A>
format - to do this you will need to have <A
HREF="http://www.eso.org/science/healpix/">HEALPIX</A> installed and make
some edits to the Makefile - see the Makefile for details. After compiling with <B>make camb_fits</B>,
you can then use <B>camb_fits</B> instead of <B>camb</B> - the FITS file
produced is given the name specified in params.ini. Note that the FITS file format for polarization changed with HEALPIX 1.2, CAMB uses the new format.
</P>
<P>
All the equations that need to be modified for
simple non-standard models are in the equations.f90 file. It should be possible to produce other files
for extended models (see the sample <A
HREF="http://camb.info/extra.html">quintessence</A> module). (Note that varying
constant - e.g. alpha - models are not quite so simple to plug in; a sample equations_ppf.f90 file provided to implement a varying <i>w</i> dark energy equation of state in the <A HREF="http://arxiv.org/abs/0808.3125">PPF</A> model).
<P>
After modifying any of the source code run <B>make clean</B> before running <B>make</B> to recompile (Visual Fortran will re-compile dependent code automatically).
Run <B>make all</B> to build a library libcamb.a that you can use when
linking to other programs. (You will also need to include the module files using -I/cambfolder).
<P>
You can <A HREF="http://camb.info/test_suite.tar.gz">download</A> a test suite for comparing accuracy with different parameters and code versions. Just extract the file to your CAMB directory and read the readme.
<P>
Some details about what different source code files do are given <A HREF="#FILES">below</A>, see also the <A HREF="http://cosmologist.info/notes/CAMB.pdf">CAMB notes</A>.
<P>
<A NAME="version">
<H3>Version history</H3>
<B>November 2015</B><BR>
<UL>
<LI>New <A HREF="https://camb.readthedocs.org/en/latest">Python CAMB wrapper</A>
<LI>Option to add comment headers to output files giving column names (output_file_headers = T)
<LI>New input parameters to change the default second helium reionization redshift and duration
<LI>Output of transfer functions will now also work at very early times
</UL>
<B>February 2015</B><BR>
<UL>
<LI>Tidied up Makefile (auto-detect gfortran/ifort, release/debug builds)
<LI>Small tweak for accuracy with higher neutrino masses
<LI>A CodeBlocks project file is provided (camb.cbp), which can also be used to run and debug from the cross-platform <A hREF="http://darmar.vgtu.lt/">CodeBlocks IDE</A>
</UL>
<B>January 2015</B><BR>
<UL>
<LI>Transfer function output now includes more variables, including different total densities and velocities (see <A HREF="#transfer">list</A>)
<LI>Generalized matter power and sigma8 functions; output of "growth" (from CDM velocity correlation sigma8_vd^2/sigma8)
<LI>Output of additional derived parameters (k<sub>eq</sub>, D<sub>A</sub>, θ<sub>s,eq</sub> - the angular scale of the sound horizon at matter-radiation equality)
<LI>Add <b>halofit_version</b> (=1,2,3,4) to set halofit version (see params.ini)
<LI>Halofit tweak to prevent negative values in neutrino models for high Ω<sub>m</sub> (thanks Simeon Bird)
<LI>Add tensors when calculating bispectrum Fisher values
<LI>Add AngularDiameterDistance2 utility function
<LI>Added internal ALens_Fiducial as alternative to Alens
</UL>
<B>April 2014</B><BR>
<UL>
<LI>Added two alternative tensor power spectrum parameterizations (see <A HREF="http://cosmologist.info/notes/CAMB.pdf">CAMB notes</A> section on initial power spectra), allowing easy specification of r or tensor amplitude with different scalar/tensor pivot scales
<LI>Added optional parameters <b>scalar_nrunrun</b> (for running of running of scalar power), and <b>tensor_nrun</b> for running of tensors
<LI>Start lensing potential integration at tau_maxvis (gets T-phi slightly closer to result from using visibility, very small change to anything else) and added negligible anisotropic stress correction for consistency in extended models.
</UL>
<B>March 2014</B><BR>
<UL>
<LI>Fixed problem with tensor modes having DoTensorNeutrinos=T and massive neutrinos
<LI>Set DoTensorNeutrinos=T by default when called from code (e.g. for use with CosmoMC)
<LI>Modified massive neutrino halofit parameters to be more accurate with the new halofit from Takahashi 2012 (thanks to Simeon Bird).
</UL>
<B>December 2013</B><BR>
<UL>
<LI>Minor fix so to set NLL_num_redshifts=0 by default so transfer functions don't have to always be integrated down to z=0
<LI>Added ./python folder with some sample plotting scripts and utilities
</UL>
<B>November 2013</B><BR>
<UL>
<LI>Fixed issue calling CAMB programmatically, e.g. with tensors and lensing
<LI>CAMB_GetCls function in camb.f90 now returns total lensed C<sub>l</sub> if DoLensing is true (rather than always unlensed)
<LI>Code fixes that do not affect results unless code is modified
</UL>
<B>October 2013</B><BR>
<UL>
<LI>Fix to equations_ppf for w/=-1 models; corrected source output fixes C<sub>L</sub> error at very low L (<2% for w>-0.8, more for w<-0.8). (thanks David Rapetti and Matteo Cataneo)
<LI>Updated writefits.f90 consistently
</UL>
<B>September 2013</B><BR>
<UL>
<LI>Modified more general neutrino mass input specification: <B>share_delta_neff</B> and <B>massive_neutrinos</b> now integer array. See section the <A HREF="http://cosmologist.info/notes/CAMB.pdf">CAMB notes</A> for detailed documentation and examples.
<LI>Changes to support non-linear CMB lensing and non-linear matter power (<B>do_nonlinear = 3</B>); (thanks Jason Dossett)
<LI>Replaced numerical recipes functions with internal fortran or new versions (thanks Martin Reinecke)
<LI>Fixed memory issue for CosmoMC compatibility
</UL>
<B>July 2013</B><BR>
<UL>
<LI>[31 July] fixed compatibility with gfortran
<LI>Improved speed and accuracy of lensed CMB calculation at L>5000 (tweaks to correlation function apodization, etc.)
<LI>More accurate Limber approximation for lensing potential (<A HREF="http://arxiv.org/abs/0809.5112">arXiv:0809.5112</A>); result much more stable around Limber switch scale
<LI>A few internal changes for greater consistency with CAMB sources
<LI>Updated high-L template file for Planck parameters, non-linear lensing and higher L
</UL>
<B>March 2013</B><BR>
<UL>
<LI>Fix numerical accuracy for larger neutrino masses and bug in and non-linear lensing calculation in very closed models
<LI>Read in AccuracyBoost parameters earlier so they are reflected e.g. in e.g. Transfer_SetForNonlinearLensing.
<LI>Temperatures of massive neutrinos set from the degeneracy, e.g. 3.046, unless same_neutrino_Neff set (no degeneracies specific in .ini)
<LI>Updated default T_CMB=2.7255 (does not change results for same input parameters)
<LI>Derived sound horizon output parameter now uses more accurate sound speed using correct CMB temperature (power spectrum results and CosmoMC theta unchanged)
<LI>Fixed bug calculating zstar with Feedback=0 and accurate_reionization (gave wrong results)
<LI>Utility functions Hofz, DeltaPhysicalTimeGyr, and dsound_da_exact for getting H(z), age and the accurate sound speed
</UL>
<B>October 2012</B><BR>
<UL>
<LI>Updated Recfast to 1.5.2 (~0.15% change in C<sub>l</sub> from small tweaks to fudge parameters to match <A HREF="http://www.cita.utoronto.ca/~jchluba/Science_Jens/Recombination/CosmoRec.html">CosmoRec</A> and <A HREF="http://www.sns.ias.edu/~yacine/hyrec/hyrec.html">HyRec</A>)
<LI>Updated Halofit model from <A HREF="http://arxiv.org/abs/1208.2701">arXiv:1208.2701</A> (thanks Ryuichi Takahashi)
<LI>Calculation of various potentially useful derived parameters (if <b>derived_parameters=T</b>)
<LI>Change to allow N<sub>eff</sub><1 to work (thanks Zhen Hou)
<LI>Typo in approximation result in equations.f90 corrected (thanks Alex Hall; no effect on numerics)
<LI>Switch off use_spline_template for non-adiabatic models (thanks Jo Dunkley)
<LI>Support for compiling with and linking to <A HREF="http://www.cita.utoronto.ca/~jchluba/Science_Jens/Recombination/CosmoRec.html">CosmoRec</A> for recombination model (make RECOMBINATION=cosmorec) and HyRec <A HREF="http://www.sns.ias.edu/~yacine/hyrec/hyrec.html">HyRec</A> (make RECOMBINATION=hyrec)
<LI>IniFile module updated [supports overridden and common parameters via DEFAULT(name.ini) and INCLUDE(name.ini)].
</UL>
<B>January 2012</B><BR>
<UL>
<LI>Interpolation accuracy and speed improved by using fiducial template (set <b>use_spline_template=F</b> to recover previous behaviour). For summary of current accuracy performance see <A HREF="http://arxiv.org/abs/1201.3654">arXiv:1201.3654</A>.
</UL>
<B>December 2011</B><BR>
<UL>
<LI>Halofit changes from <A HREF="http://arxiv.org/abs/1109.4416">arXiv:1109.4416</A> for better accuracy on small scales (thanks to Simeon Bird)
<LI>Added <b>version_check</b> to output .ini files to track CAMB version being used
<LI>Option to export curvature alpha_l(r) and beta_l(r) [useful for local non-Gaussianity]
<LI>Minor bug fixes that don't affect numerical results
<LI>Example params.ini parameters changed to be consistent with CosmoMC's defaults (CMB temperature, effective number of neutrinos)
</UL>
<B>October 2011</B><BR>
<UL>
<LI>Fixed array bounds issue for closed-model tensor calculation
<LI>Tweaks for high_accuracy_default stability in closed models
<LI>L sampling slightly increased (1.2 factor) at high L for high_accuracy_default
<LI>Added global_error_flag and Errors module for handling bailout from various modules
<LI>Updated Makefile
</UL>
<B>July 2011</B><BR>
<UL>
<LI>Added <b>high_accuracy_default</b> parameter, to give target accuracy of 0.1% for 500<L<2000 rather than default of 0.3%. This is much faster than increasing the accuracy boost parameters.
<LI>Added improved high kτ approximations from <A HREF="http://arxiv.org/abs/1104.2933">arXiv:1104.2933</A>.
<LI>Optimized very accurate massive neutrino evolution and perturbatively relativistic expansion (much faster, see the <A HREF="http://cosmologist.info/notes/CAMB.pdf">notes</A>)
<LI>Fractional numbers of neutrinos now used to increase neutrino temperature equally for all neutrinos, giving consistency for number densities of massive neutrinos
<LI>
Merged flat and non-flat derivative routines in equations.f90, time evolution restructuring and some higher-order tight coupling terms from <A HREF="http://arxiv.org/abs/1012.0569">arXiv:1012.0569</A>.
<LI>Various tweaks to fixed internal accuracy parameters for consistency with <b>high_accuracy_default</b> (very small decrease in speed)
<LI>Added apodization in lensing.f90 so that slow full integration is now only used for lmax>=5000 rather than lmax>=3000 (or if AccurateBB is set).
<LI>Added quick calculation of the high-L tails of the lensing convolution by rescaling a template (speeds up high-accuracy lensedCl calculation with minimal loss of accuracy).
<LI>Removed a couple of options relating to unlensed or temperature-only calculations that are now rarely relevant
</UL>
<B>January 2011</B><BR>
<UL>
<LI>(14 Jan) updated Makefile for gfortran compatibility and easier compilation for bispectrum fisher calculations
<LI>Added Bispectrum module to calculate CMB lensing and local primordial non-Gaussianity bispectra for temperature and polarization (see <A HREF="http://arxiv.org/abs/1101.2234">arXiv:1101.2234</A>). Define FISHER in the makefile to also calculate Fisher elements for the bispectra, including lensing signal variance effects (you make need to edit makefile to link to LAPACK). Corresponding new parameters in the .ini file.
<LI><b>lens_potential_output_file</b> format changed to included temperature and polarization spectra (scalar+tensor), and extra column giving [l(l+1)]<sup>3/2</sup>C<sub>ψE</sub>/2π - the correlation of the lensing potential with the E polarization.
<LI>
Updates for BAO calculations were in CosmoMC May 2010.
</UL>
<P>
<B>January 2010</B><BR>
Recfast updated to version 1.5 (rising to 2% change at l=2000; added rate fudge to match <A HREF="http://arxiv.org/abs/0910.4383">0910.4383</A>; use <b>RECFAST_Hswitch = F</b> to recover old result). Added <b>lens_potential_output_file</b> parameter to get sensibly normalized lensing potential ([l(l+1)]<sup>2</sup>C<sub>l</sub>/2π and temperature correlation). Added code parameter do_bispectrum to modules.f90 for parameter tweaks to get accurate transfer functions for f<sub>NL</sub> calculations.
<P>
<B>February 2009</B><BR>
Fixed serious bug in the calculation of lensed non-flat models (introduced in the Feb 2008 version).
<P>
<B>November 2008</B><BR>
Fixed proton mass error (and hence incorrect baryon evolution on pressure-damping scales; note CAMB is not as accurate as <A HREF="http://camb.info/sources/">CAMB sources</A> anyway due to use of adiabatic pressure).
<P>
<B>September 2008</B><BR>
Restructured recombination module to allow use of different models. RECFAST default implementation updated to version 1.4.2 (+fixes, tiny change to results). Misc minor changes.
</P>
<B>June 2008</B><BR>
Fixed significant bug affecting very closed models (introduced Feb 2008; slightly closed models were fine).
<P>
<B>March 2008</B><BR>
<I>(26th March, fixed pivot parameters in sample .ini)</I><BR>
New reionization history model: new input parameter <B>re_delta_redshift</B> (does not change optical depth), and option to set <B>re_ionization_frac=-1</B> to automatically set the reionization fraction from input Y<sub>He</sub> assuming Helium is singly reionized at the same time as hydrogen (hence mapping of redshift to optical depth different to before at 10% level; see the <A HREF="http://cosmologist.info/notes/CAMB.pdf">notes</A>). Reionization history now specified in (replaceable) module in reionization.f90; default includes tiny effect of He double reionization at z~3.5. Some internal reorganization.
Added <B>pivot_scalar</B> and <B>pivot_tensor</B> input parameters for initial power spectrum. <b>output</b> subroutine (equations.f90) re-arranged to separated ISW source terms.
<P>
<B>February 2008</B><BR>
Updated RECFAST to version 1.4 (~0.5% effect at high <I>l</I>; new RECFAST_fudge_He,RECFAST_Heswitch parameters, removed Dubrovich modifications). <B>lensed_total_output_file</b> parameter to get lensed scalar plus tensor power spectrum. Calculates CosmoMC's theta parameter for each model (code in modules.f90). Modules routine <B>MatterPowerData_Load</B> to read in matter power (for splining from pre-computed file); <B>MatterPowerData_k</B> function now extrapolates low-k out of range. <B>transfer_interp_matterpower</B> parameter to switch between interpolated regular grid in log k or array at actual computed values (better for later re-interpolation). Added camb.vfproj Intel Visual Fortran project file. Simplifying internal changes from <A HREF="http://camb.info/sources">CAMB sources</A>, e.g. use of Ranges module for setting time steps and k sampling values; also now switches to log k source spacing at very high l to speed up calculation where spectra smooth. More diagnostics and options in the <A HREF="http://camb.info/test_suite.tar.gz">test suite</A>.
<P>
<B>November 2006</B><BR>
Updated RECFAST to version 1.3 (0.1% effect on C<sub>l</sub>). Tweak to get <0.3% error in matter power spectrum around the peak when <B>transfer_high_precision = T</B>.
<P>
<B>September 2006</B><BR>
Fixed problem generating combinations of scalars and tensors in camb.f90 (since August version).
<P>
<B>August 2006</B><BR>
Speeded calculation of lensed spectra and lensing power spectrum by using Limber approximation on small scales (no loss of accuracy). Fixed missing f_K in source term for non-flat lensing potential. Minor changes to default parameters and compatibility tweaks. Can <A HREF="http://camb.info/test_suite.tar.gz">download</A> test suite for comparing accuracy and code versions.
<P>
<B>July 2006</B><BR>
Fixed bug setting default neutrino degeneracy if none specified and initialization of nu_mass_eigenstates for programmatic access. Other minor fixes.
<P>
<B>June 2006</B><BR>
Added support for arbitrary neutrino mass splittings. New option to set <B>transfer_k_per_logint=0</B> to get automatic accurate k-sampling of the matter power spectrum. Fixed Transfer_GetMatterPower at large scales for non-flat models. New setting value <B>massive_nu_approx=3</B> to use whatever method is good to get fast accurate results. Other internal changes.
<P>
<B>March 2006</B><BR>
Fixed bug lensing scalar spectrum when generated at the same time as tensors. New (hard coded) parameter <B>lmin</B> in modules.f90 - set to 1 if you want to generate temperature and lensing potential l=1 (Newtonian Gauge) C<sub>l</sub>.
<P>
<B>April 2005</B><BR>
Added <B>do_nonlinear</B> option to apply non-linear corrections from HALOFIT (<A HREF="http://arxiv.org/abs/astro-ph/0207664">astro-ph/0207664</A>). <B>do_nonlinear = 1</B> applies just to the matter power spectra, <B>do_nonlinear=2</B> applies corrections to the lensed CMB power spectra (important for BB). HALOFIT should only be used for standard adiabatic ΛCDM models with power law initial power spectra.
New <B>recombination</B> option (1 does RECFAST as before, 2 uses modified version from <a href="http://arxiv.org/abs/astro-ph/0501672">astro-ph/0501672</a>). New option <B>do_late_rad_trunction</B> to turn off the small scale radiation hierarchies after matter domination (see <A HREF="http://cosmocoffee.info/discuss/astro-ph/0503277">astro-ph/0503277</A> and the <A HREF="http://cosmologist.info/notes/CAMB.pdf">notes</A>) - saves some time. New <B>output_root</B> option to prefix output file names and generate output_root_params.ini file of input parameters for the run.
<P>
<B>November 2004</B><BR>
Default lensing routine (<B>lensing_method=1</B>) changed to use new full-sky correlation function method (<A HREF="http://arxiv.org/abs/astro-ph/0502425">astro-ph/0502425</A>) in preference to the harmonic method of <A HREF="http://arxiv.org/abs/astro-ph/0001303">astro-ph/0001303</A> (<B>lensing_method=3</B>; inaccurate at l>1000 at ~1.5% level by l=2000). The lensed result is now significantly faster and more accurate.
Also added flat-sky method (<B>lensing_method=2</B>) of <A HREF="http://arxiv.org/abs/astro-ph/9505109">astro-ph/9505109</A> and <A HREF="http://arxiv.org/abs/astro-ph/9803150">astro-ph/9803150</A> as in CMBFAST (accurate to 0.4%). New <B>accurate_BB</B> parameter to get lensed BB accurately (within assumptions of linearity and given k_max, l_max, etc.). Note lensed_output_file no longer contains any tensor contribution. Various changes for better accuracy and compiler compatibility, including same accuracy with massive neutrinos as with massless.
<P>
<B>August 2004</B><BR>
Fixed effect of reionization on the lensed C<sub>l</sub> (0.5% on small scale TT).
</P>
<B>June 2004</B><BR>
<P>
Fixed serious problem with tensor mode polarized C<sub>l</sub> from reionization (significantly underestimated power).
Changed default tensor pivot scale to 0.05 Mpc<sup>-1</sup> (same as for scalars). Flat Bessel functions no longer cached to disk (faster to compute than read in many cases; prevents problems in uses with MPI). New <B>accurate_reionization</B> flag for accurate calculation of large scale scalar EE around the first dip (also outputs computed optical depth due to reionization). Option to output vector mode spectra from regular vorticity mode (<A HREF="http://arxiv.org/abs/astro-ph/0403583">astro-ph/0403583</A>) or magnetic field (<A HREF="http://arxiv.org/abs/astro-ph/0406096">astro-ph/0406096</A>).
</P>
<B>December 2003</B><BR>
<I>Fix - 17 Dec:</I> corrected problem with significantly non-flat models (e.g. Ω<sub>K</sub>=-0.1, H<sub>0</sub>=40)
<P>
Improved accuracy of non-flat calculation, and allowed for very nearly flat models (Ω<sub>K</sub> ~ 1e-5). Non-flat code should be as accurate as the flat (0.5%) on most scales. Added run-time parameters <B>do_tensor_neutrinos</B> (to include the neutrino evolution in the tensor equations) and <B>cs2_lam</B> (constant sound speed of the dark energy) instead of having to modify the code. Fixed fatal bug in tensor neutrino setup introduced some time this year. Added parameter <B>CMB_outputscale</B> to scale output Cls by a constant (see comments in params.ini for getting microK^2 output).
</P>
<B>July 2003</B><BR>
<P>
Fixed instability in bessels.f90 which gave problem for very nearly flat closed models with abnormal Helium fractions (and possibly other models). Dark energy equations in equations.f90 changed to use simpler general fluid equations for the perturbations (see <A HREF="http://arxiv.org/abs/astro-ph/0307104">astro-ph/0307104</A>). inidriver.F90 now reads in scalar amplitude even if computing tensors only (so combination with the initial ratio sets correct tensor amplitude).
</P>
<B>May 2003</B><BR>
<P>
Fixed bug in equations.f90 giving errors with non-flat models. Fixed bug in inidriver.F90 setting H<sub>0</sub> with <B>use_physical=F</B>. Fixed camb.f90 file in download - missing routines for getting C<sub>l</sub> transfer functions.
</P>
<B>April 2003</B><BR>
<P>
Some major restructuring, including new functions to return the CMB transfer functions (see camb.f90). The tight coupling code has been re-written, adding quadrupole terms and accounting for the time variation of the opacity numerically. The code should be more accurate and faster, especially on small scales. Minor fixes to RECFAST to match version in CMBFAST (0.01% effect on C<sub>l</sub>s), and bug fix in output routine (0.3%). Includes constant w dark energy and running spectral index parameters by default (rather than with an add-on). New <B>use_physical</B> parameter to allow alternative model specification by Om_b h^2, Om_b h^2 and Om_k. Polarization .fits files now compatible with HEALPIX 1.2.
</P>
<B>November 2002</B>
<P>
Minor changes for greater compiler compatibility, in particular with Visual Fortran. Makefile includes suggested options for a variety of compilers.
</P>
<B>September 2002</B>
<P>
Added support for neutrino isocurvature initial conditions, and
totally correlated mixed initial conditions (assuming the same power
spectrum for each mode) - new <B>initial_vector</B> parameter in
params.ini. Partially correlated mixed initial conditions can be
computed by combining results from different runs with totally
correlated initial conditions.
</P>
<B>July 2002</B>
<P>
Changes for compatibility with <A
HREF="http://cosmologist.info/cosmomc/">CosmoMC</A>. New option to output matter power spectrum.
Changed default pivot point for tensor initial power spectrum to
0.002 MPc<sup>-1</sup> (power_tilt.f90), added pivot point and normalization to
initial power parameters. Minor enhancements to inifile.f90. Utility
routines Re_OpticalDepthAtZ and Transfer_GetMatterPower added to
modules.f90.
</P>
<B>March 2002</B>
<P>
Massive neutrino support improved. Background evolution is much
faster, and only ever needs to be computed once for all neutrino
masses. Output transfer function files now include columns for the
massive neutrino and total perturbations. Sigma_8 is now computed
including CDM, baryons and massive neutrinos. Fixed problem computing matter
power spectrum in massive neutrino models. New parameter
<B>massive_nu_approx</B> to control
how the massive neutrinos are evolved - option for new approximate fast scheme
that is quite accurate for the CMB. New <B>feedback_level</B> parameter
that can be used to get useful information about the model being
calculated.
<BR>
Fixed rare problem computing closed models, and bug in computation of
closed transfer functions. The names of the massive neutrino
subroutines have been changed because the argument that is passed has changed.
</P>
<B>February 2002</B>
<P>
Fixed FITS file output to start at l=0 rather than l=2 to be consistent
with HEALPIX.
</P>
<B>January 2002</B>
<P>
The code is now fully internally parallelized and lensing is
supported. Can now use about 16 processors with good efficiency -
just compile with the OpenMP -mp compiler flag. The lensing power
spectrum is computed explicitly and then used to computed the lensed
CMB power spectra using the full-sky results of <A
HREF="http://arxiv.org/abs/astro-ph/0001303">astro-ph/0001303</A> (many
thanks for Gayoung Chon for work on the lensed power spectrum
code). To generate the lensed power spectra set do_lensing=T in
params.ini and the output will be in the lensed_output_file. The lensing power spectrum l<sup>4</sup> C<sub>l</sub><sup>φφ</sup> is also output as the 5th
column of the scalar_output_file, followed by the cross-correlation
with the temperature l<sup>3</sup> C<sub>l</sub><sup>φT</sup>.
</P>
<B>October 2001</B><P>
Fixed bug in RECFAST - corrects C_l errors at 1-2% level. Background
evolution is now determined from routines in gauge_inv.f90 (and
gauge_sync.f90) - you now only need to edit these files to add
additional matter components, use extended theories, etc. RECFAST now
consistent with massive neutrinos.
Added Makefile for better compilation, and added option to create FITS
format power spectrum files. Changed driver.f90 to driver.F90, and new
file writefits.f90. Some minor changes to ease use with a
wider range of compilers (e.g. NaG F95 for Linux).
<P>
<B>May 2001</B><P>
Fixed the neutrino ratio factor in the normalization of the scalar
power spectrum to be consistent with the power spectrum as defined
since the January 2001 version. Changes to gauge_inv.f90 and gauge_sync.f90.
<P>
<B>April 2001</B><P>
New <A
HREF="http://camb.info/examples.html">example
code</A>. These samples show how you can call CAMB from other programs
via a subroutine. There are also improved InitialPower
modules for parameterizing the initial power spectrum to obtain
meaningful tensor/scalar ratios for general models and for
parameterizing in terms of slow-roll inflation parameters.<P>
Fixed a floating error arising when both tensor and scalar spectra are generated but
with ratio zero.
<P>
<B>February 2001</B><P>
Fixed bug in recfast.f90 introduced in August 2000 update (caused
erroneous blip in ionization history).<P>
<B>January 2001</B><P>
New file power.f90 added to separate out the InitialPower module for
easily modifying the initial power spectrum. The InitialPower module now has
additional parameters to control the normalization of the output Cls,
allowing absolute computations using correctly normalized initial
power spectra (set the UseScalTensRatio parameter to false to compute the
tensor/scalar ratio correctly from the initial power spectra in
general models). The InitialPower module is now commented to fully
explain the definition of the power spectra that should be returned by the TensorPower and
ScalarPower routines. <P>
The transfer functions are now output in terms of k rather than beta
(nu*K) in non-flat models,
and the way to compute the matter power spectrum from the transfer
functions via d2norm is documented. The variables used to propagate
the tensor modes in gauge_inv.f90 have been changed to be equivalent
to the metric variables, improving stability when DoTensorNeutrinos=true.
<P>
<B>September 2000</B><P>
Now uses an accurate approximation to propagate massive neutrino
perturbations once no longer highly relativistic, speeding up
computation by about a factor of two (gauge_inv routine only). All massive
neutrino code is now
re-organized into a module called MassiveNu in modules.f90. The massive
neutrino equations are described in <A
HREF="http://arxiv.org/abs/astro-ph/0203507">astro-ph/0203507</A>
<P>
<B>August 2000</B><P>
Minor changes to recfast.f90 and modules.f90 to prevent floating
point errors on some systems. (Thanks for Louise Griffiths)<P>
<B>July 2000</B><P>
Fixes inaccurate computation of the tensor quadrupole in flat
models, pointed out in <A
HREF="http://arxiv.org/abs/astro-ph/0006392">astro-ph/0006392</A> . The only code change is to subroutine TensSourceSumIntJl in cmbmain.f90.<P>
<B>February 2000</B><P>
Massive neutrinos are now supported. The treatment is essentially the
same as CMBFAST. However gauge_inv now includes neutrino anisotropic
stress in the tensor computation by default, accounting for massive neutrinos
when appropriate. You can revert to the old default by changing the
"DoTensorNeutrinos" parameter in gauge_inv. <P>
This version also fixes the tight coupling switch over to give
accurate results with gauge_sync. This fixes errors introduced in
CMBFAST 3.0/CAMB Nov 99.
<P>
<B>November 1999</B><P>
Adds support for RECFAST recombination
and fixes various bugs that were in CMBFAST 2.4.1 but fixed in CMBFAST
3.0. RECFAST is an option via the fifth line in the input file as in
CMBFAST. Using it does not slow things down significantly and corrects
errors at around the 2% level.
<A NAME="COMPARE">
<H3>Comparison with CLASS</H3>
The <A href="http://class-code.net">CLASS</A> CMB code is written independently of CAMB and CMBFAST and is in pure C (not C++, despite the name). The basic equations and algorithm are substantially the same as CMBFAST in both cases, with CLASS having a C implementation of CAMB's lensed power spectrum method, and CAMB implementing in F90 some of the new very-sub-horizon approximations introduced in CLASS (which make little difference at WMAP precision, but significantly increase speed for small-scales and high accuracy). The codes use different combinations of approximation schemes and sampling for massive neutrinos. For standard models at CAMB's default accuracy settings speeds should be similar depending on compilers used, with CAMB's <b>high_accuracy_default</b> option being similar to CLASS's <b>cl_permille.pre</b>.
<H3>Comparison with CMBFAST</H3>
This code was originally developed from CMBFAST 2.4.1 to support closed models
and gauge invariant variables. After releasing this code CMBFAST 3.2
was released which also supports closed models. These codes were
developed independently and so are somewhat different, and both codes
have developed independently since then.
<P>
The main differences in the non-flat computation lie in how we perform the integral of the source
functions with the hyperspherical Bessel functions. We use
Kosowsky's WKB approximation or the recursion relation to evaluate the Bessel
functions at the starting point of ranges of integration, and then
integrate the differential equation. CMBFAST
integrates up the differential equation from a pre-calculated starting point. Unlike
CMBFAST 3.2 our ranges of integration continue into the Chi > pi/2
region for closed models. We avoid problems with stability of the
integration (contamination with the irregular solution) by cutting off
the integration when the errors become important (where the values in the
dissipative tail are becoming small). This leads to very small errors,
and allows for a much simpler scheme than that used in CMBFAST 3.2 where
the symmetry of the Bessel functions is used to extend to the Chi> Pi/2 region.
<P>
From the user's point of view the main point is that this code is
rather faster than CMBFAST in many cases. Assuming same recombination history CAMB agrees with the CMBFAST 4.5 high precision TT calculation to < 1% at low l, and about 0.3% at l>100 in concordance flat models. If CAMB is run with high precision options the agreement is nearly 0.1% at high l. The polarized spectra also agree well except around the first dip in the EE spectrum with reionization (see CAMB's accurate_reionization parameter).
<P>
Note that as of March 2008 CAMB's reionization parameterization is slightly different to CMBFAST. CMBFAST 4.5.1 also uses an old version of RECFAST.
<P>
CMBFAST 3.2 introduced an include file for adjusting the
l-sampling. In CAMB this is done automatically depending on the model,
so there is no need to modify the l-sampling by hand.
<P>
CMBFAST uses the flat sky and Limber approximation and works from the transfer
functions to work out the lensing potential, CAMB uses the full result (agreement is excellent). CAMB uses a full-sky correlation function method rather than the flat sky approx (about max 0.4% effect on EE).
<P>
CMBFAST 4 uses a "k-splitting" to allow rapid computation of grids of
models to reasonable accuracy. If you need to generate a large number
of models and accuracy is not vital using CMBFAST 4 would probably
save you some time and effort. CMBFAST 4 also supports some extended models not supported by CAMB, e.g. 5-D models.
<P>
CAMB is in Fortran 90 and is more modularized, so using different initial power spectra, modified equations, etc. is often just a case of modifying one or two files and re-compiling.
<P>
Note that the conventions for the polarization power spectra output by CAMB agree with those of CMBFAST. This sign convention for the cross-correlation C_l^TE spectrum differs from the definitions in <A
HREF="http://arxiv.org/abs/astro-ph/9911481">astro-ph/9911481</A>. As from CMBFAST 4.2 the initial power spectrum normalization conventions also agree.
<P>
<A NAME="FILES">
<H3>The source files</H3>
<P>
<BLOCKQUOTE>
<B>camb.f90</B>
<P>
Main wrapper routines for running CAMB in your programs. Add "use
camb" to your programs and call CAMB_GetResults to generate output
from a set of model parameters (specified in the CAMBparams type -
defined at the top of modules.f90). You can call
CAMB_ValidateParams(P) to check that the parameter set is valid, use
CAMB_GetAge to compute the age of a model in gigayears, and
CAMB_GetCls to retrieve the computed Cls. The results can also be
accessed directly using the arrays in the ModelData module (defined in modules.f90).<P>
Sample programs tester.f90 and sigma8.f90 are supplied showing how to
use CAMB from your own programs. You can also use CAMB_GetTransfers to access the C_l transfer functions directly without incorporating the initial power spectrum.
</P>
<B>cmbmain.f90</B>
<P>
The main subroutine that does integrations, etc. Encompasses CMBFAST's
cmbflat and cmbopen.
<P>
<B>equations.f90</B>
<P>
Files containing background and perturbation evolution equations. The
perturbations equations used are derived in the covariant approach,
fixing to the CDM (zero acceleration) frame, which are essentially
equivalent to the synchronous gauge equations.
<P>
The file defines a module called "GaugeInterface" which provides
the necessary perturbation calculation routines for
"cmbmain".
<P>
The subroutine dtauda(a) returns dt/da and is used wherever the
background evolution is needed. It
can be modified for different backgrounds. You may
also need to change the GetOmegak routine if you add additional
components, and can edit the init_background routine to do
additional initialization.
<P>
outtransf writes out the matter transfer functions.
<P>
The "output" subroutine computes the scalar sources at a given time for a
given wavenumber. These are the temperature, E polarization and (if
doing lensing) the lensing source. By editing the equation for the
lensing source it should be straightforward to compute power
spectra for other matter tracers, e.g. for cross-correlation with
the CMB. The lensing power spectrum is automatically computed if
<B>DoLensing=T</B>.
<P><i>equations_ppf.f90</i> is an alternative module that allows evolving dark energy crossing w=-1.
<P>
<B> power_tilt.f90</B>
<P>
This file defines a module called InitialPower that returns the
initial power spectra. Change this file to use your own initial power
spectrum, change how the spectra are parameterized, or to change how
the Cls are normalized. Comments in the code explain this further.
<P>
<P>
<B> reionization.f90</B>
<P>
This file defines a module called Reionization that parameterizes the reionization history and supplies a function <B>Reionization_xe</B> that gives x<sub>e</sub> as a function of redshift. Optical depth input parameters are mapped into z<sub>re</sub> (defined as where x<sub>e</sub> is half its maximum (ex second He reionization)) using a binary search. See the CAMB <A HREF="http://cosmologist.info/notes/CAMB.pdf">notes</A> for discussion. This module should be easily modifiable for alternative reionization models.
<P>
<B>halofit.f90</B><P>
Implements the NonLinear module, to calculate non linear scalings of the matter power spectrum as a function of redshift. Uses HALOFIT (<A HREF="http://arxiv.org/abs/astro-ph/0207664">astro-ph/0207664</A>, code thanks to <A HREF="http://www.astro.upenn.edu/~res">Robert Smith</A>, with tweaks
from <A HREF="http://arxiv.org/abs/1208.2701">arXiv:1208.2701</A> (thanks Ryuichi Takahashi) - see that paper for discussion of numerical accuracy. This module can be replaced to use a different non-linear fitting method if desired.
<P>
<B> inidriver.F90</B>
<P>
Reads in parameters from a file of name/value pairs and calls CAMB. Modify
this file to generate grids of models, change the parameterization, etc.
<P>
<B> modules.f90</B>
<P>
Various modules used by the other parts of the program, Module
"ModelParams" contains most of the model parameters. Boolean vars
flat, open and closed determine the model type.
<P>
<B>bessels.f90</B>
<P>
Module to calculate spherical and hyper-spherical Bessel
functions. Hyper-spherical functions generated by use of
either the recursion relation or Kosowsky's WKB approximation. Based on
Arthur Kosowsky's "hyperjl.c".
<P>
<B>lensing.f90</B>
<P>
Lensing module for computing the lensed CMB power spectra from the
unlensed spectra and a lensing power spectrum. See <A HREF="http://arxiv.org/abs/astro-ph/0502425">astro-ph/0502425</A>.
</P>
<B> subroutines.f90</B>
<P>
Various subroutines for interpolation, and modified Runge-Kutta
dverk for parallelized evolution.
<P>
<B> writefits.f90</B>
<P>
Subroutine WriteFitsCls that uses HEALPIX routines to output power spectrum
in FITS format.
<P>
<B>recfast.f90</B>
<P>
RECFAST integrator for Cosmic Recombination of Hydrogen and Helium
by Douglas Scott (with minor modifications for CMBFAST and the
CAMB). See <A
HREF="http://www.astro.ubc.ca/people/scott/recfast.html">RECFAST</A>
for the original code. This module implements the RECOMBINATION module required by CAMB, and could be replaced by more detailed codes. Sample wrappers are also provided for <A HREF="http://www.cita.utoronto.ca/~jchluba/Science_Jens/Recombination/CosmoRec.html">CosmoRec</A> and <A HREF="http://www.sns.ias.edu/~yacine/hyrec/hyrec.html">HyRec</A>, but the libraries for these must be installed separately.
<P>
<B>SeparableBispectrum.f90</B>
<P>
Implements calculation of simple separable primordial bispectra, specifically the local constant f<sub>NL</sub> model, and the CMB lensing bispectrum due to the linear temperature and polarization cross-correlation with the lensing potential. Compile with FISHER defined in the makefile to also calculate Fisher elements, including the effects of lensing signal variance (edit Makefile to link to LAPACK if necessary). Note that the primordial bispectra here are unlensed (see <A HREF="http://arxiv.org/abs/0905.4732">arXiv:0905.4732</a> for a calculation), but the lensed bispectra are calculated non-perturbatively (but approximately) using the lensed small-scale CMB power spectra. Note that calculating primordial bispectra is significantly slower than doing standard power spectrum calculations, however it parallelizes well.
</BLOCKQUOTE>
<P>
<A NAME="ACCURACY">
<H3>Accuracy</H3>
<P>
<BLOCKQUOTE>
Scalar numerical errors should rarely exceed 0.3% for min(2500, L well into the damping tail) at default accuracy setting, and 0.1% for 500<L<2000 with <b>high_accuracy_default=T</b>. Matter power spectrum errors are usually dominated by interpolation in the acoustic oscillations, with about 0.2% accuracy with high_accuracy_default (but much better rms accuracy). For a detailed study of numerical accuracy as of January 2012 see <A HREF="http://arxiv.org/abs/1201.3654">arXiv:1201.3654</A>.
See also <A HREF="#COMPARE">comparison</A> with CMBFAST. Accuracy of course assumes the model is correct, and is dependent on RECFAST being the correct ionization history. Lensed C_l TT, TE and EE are accurate at the same level (to within the approximation that the lensing potential is linear, or the accuracy of the HALOFIT non-linear model).
<P>
Extreme models (e.g. scale > 4, h>1) may give errors of 5% or more.
<P>
Tensor errors around 2% or more on small scales (e.g. due to l-interpolation). Low l accuracy somewhat worse than scalars (typically < 1%). Turn on neutrinos in the input file for accurate results (automatic on high accuracy setting).
<P>
Hierarchy truncation errors up to 5% at high l (>1500) in some
closed models
<P>
You can improve or check accuracy (or increase speed) by changing
global accuracy parameters at the bottom of the params.ini input file. Convergence and stability can be checked using the <A HREF="http://camb.info/test_suite.tar.gz">test suite</A>.
<P>
</BLOCKQUOTE>
<A NAME="adds">
<H3>Add-ons, extensions, external sites</H3>
<UL>
<LI><A HREF="http://background.uchicago.edu/camb_rpc/">Reionization principal components</a>
<LI><A HREF="http://camb.info/ppf/">Parameterized Post-Friedmann Dark Energy</A>
<LI><A HREF="http://camb.info/sources">CAMB sources</A> get linear 21cm, lensing and number counts; 3rd order perturbation theory P(k); perturbed recombination
<LI><A HREF="http://camb.info/extra.html">Quintessence</A> module
<LI><A HREF="http://lambda.gsfc.nasa.gov/toolbox/tb_camb_form.cfm">CAMB online</A> (note may not be latest version)
<LI><A HREF="http://people.sissa.it/~leach/inflation/camb_inflation.html">Inflationary parameterization</A> of initial power by Samuel Leach.
</UL>
<A NAME="refs">
<H3>REFERENCES</H3>
<P>
Some notes and relevant Maple derivations are given <A HREF="http://camb.info/theory.html">here</A> (see also the Appendix of <A HREF="http://arxiv.org/abs/astro-ph/0406096">astro-ph/0406096</A>). The <A HREF="http://cosmologist.info/notes/CAMB.pdf">CAMB notes</A> outline the equations and approximations used, and relation to standard synchronous-gauge and Newtonian-gauge variables; see also <A
HREF="http://arxiv.org/abs/1201.3654">arXiv:1201.3654</A>.
There is a <A HREF="http://cosmologist.info/cosmomc/cosmomc.bib">BibTex</A> file of references (including <A HREF="http://cosmologist.info/cosmomc">CosmoMC</A>).
</P>
<P>
CMB power spectrum parameter degeneracies in the era of precision cosmology<BR>
Cullan Howlett, Antony Lewis, Alex Hall, Anthony Challinor <A
HREF="http://arxiv.org/abs/1201.3654">arXiv:1201.3654</A>.
<P>
Efficient computation of CMB anisotropies in closed FRW Models<BR>
Antony Lewis, Anthony Challinor and Anthony Lasenby <A
HREF="http://arxiv.org/abs/astro-ph/9911177">astro-ph/9911177</A> Ap. J. 538:473-476, 2000.
<P>
Geometric Algebra and
Covariant Methods in Physics and Cosmology, Chapters 6&7<BR>
PhD thesis, Antony Lewis 2000. <A
HREF="http://cosmologist.info/thesis.ps.gz">PostScript</A>.
</P>
<P>
<B>Covariant theory</B>
<P>
Cosmic Microwave Background Anisotropies in the CDM model: A
Covariant and Gauge-Invariant Approach<BR>
Anthony Challinor and Anthony Lasenby, <A HREF="http://arxiv.org/abs/astro-ph/9804301">astro-ph/9804301</A>
Ap. J. 513:1 1-22, 1999
<P>Evolution of cosmological dark matter perturbations<BR>
Antony Lewis and Anthony Challinor <A
HREF="http://arxiv.org/abs/astro-ph/0203507">astro-ph/0203507</A>
Phys. Rev. D66, 023531 (2002)
<P>
Microwave background anisotropies from gravitational waves: the 1+3
covariant approach <BR>
Anthony Challinor, <A HREF="http://arxiv.org/abs/astro-ph/9906474">astro-ph/9906474</A>
<P>
Microwave background polarization in cosmological models<BR>
Anthony Challinor, <A
HREF="http://arxiv.org/abs/astro-ph/9911481">astro-ph/9911481</A>
<P>
CMB anisotropies from primordial inhomogeneous magnetic fields<BR>
Antony Lewis, <A
HREF="http://arxiv.org/abs/astro-ph/0406096">astro-ph/0406096</A><BR>
(The appendix contains general derivations of the multipole equations and C<SUB>l</SUB> as used in CAMB)
<P>
<B>Initial conditions</B>
<P>
The General Primordial Cosmic Perturbation <BR>
Martin Bucher, Kavilan Moodley and Neil Turok, <A HREF="http://arxiv.org/abs/astro-ph/9904231">astro-ph/9904231</A>
(These results extended to the non-flat case; see the <A HREF="http://camb.info/theory.html">theory page</A>)
<P>
Observable primordial vector modes<BR>
Antony Lewis, <A HREF="http://arxiv.org/abs/astro-ph/0403583">astro-ph/0403583</A>
<P>
<B>HALOFIT</B>
<P>
Stable clustering, the halo model and nonlinear cosmological power spectra<BR>
Smith, R. E. and others, <A HREF="http://arxiv.org/abs/astro-ph/0207664">astro-ph/0207664</A>.
<P>
Revising the Halofit Model for the Nonlinear Matter Power Spectrum<BR>
Ryuichi Takahashi and others, <A HREF="http://arxiv.org/abs/1208.2701">arXiv:1208.2701</A>.
<P>
<B>RECOMBINATION</B>
<P>
A new calculation of the recombination epoch.<BR>
Seager, S., Sasselov, D. & Scott, D., 1999, ApJ, 523, L1, <A HREF="http://arxiv.org/abs/astro-ph/9909275">astro-ph/9909275</A>.
<P>
How well do we understand cosmological recombination?<BR>
Wong, Wan Yan and Moss, Adam and Scott, Douglas, <A HREF="http://cosmocoffee.info/discuss/0711.1357">arXiv:0711.1357</A>.
<P>
<B>Weak lensing of the CMB</B>
<P>
<BLOCKQUOTE>
<B>lensing_method=1</B><BR>
Lensed CMB power spectra from all-sky correlation functions<BR>
A. Challinor and A. Lewis. <A HREF="http://arxiv.org/abs/astro-ph/0502425">astro-ph/0502425</A>. (For Maple derivations see the <A HREF="http://camb.info/theory.html">theory page</A>.)<BR>
Also: Weak Lensing of the CMB, <A HREF="http://arxiv.org/abs/astro-ph/0601594">astro-ph/0601594</A>.
<P>
<B>lensing_method=2</B><BR>
Gravitational lensing effect on cosmic microwave background
anisotropies: A Power spectrum approach<BR>
Uros Seljak. <A HREF="http://arxiv.org/abs/astro-ph/9505109">astro-ph/9505109</A>
<P>
Gravitational Lensing Effect on Cosmic Microwave Background
Polarization<BR>
Uros Seljak and Matias Zaldarriaga. <A HREF="http://arxiv.org/abs/astro-ph/9803150">astro-ph/9803150</A>
<P>
<B>lensing_method=3</B><BR>
Weak Lensing of the CMB: A Harmonic Approach<BR>
Wayne Hu. <A HREF="http://arxiv.org/abs/astro-ph/0001303">astro-ph/0001303</A><BR>
See also <A HREF="http://arxiv.org/abs/astro-ph/0301064">astro-ph/0301064</A>, <A HREF="http://arxiv.org/abs/astro-ph/0301031">astro-ph/0301031</A>
</P>
</BLOCKQUOTE>
<B>Bispectra</B>
<P>
The shape of the CMB lensing bispectrum<BR>
Antony Lewis, Anthony Challinor and Duncan Hanson <A HREF="http://arxiv.org/abs/1101.2234">arXiv:1101.2234</A>
</P>
<B>Sub-horizon radiation approximations</B>
<P>
The Cosmic Linear Anisotropy Solving System (CLASS) II:
Approximation schemes<BR>
Blas, Diego and Lesgourgues, Julien and Tram, Thomas. <A HREF="http://arxiv.org/abs/1104.2933">arXiv:1104.2933</A>
</P>
<B>Massive Neutrinos</B>
<P>
CMB power spectrum parameter degeneracies in the era of precision cosmology
<BR>
Cullan Howlett, Antony Lewis, Alex Hall, Anthony Challinor.
<A HREF="http://arxiv.org/abs/1201.3654">arXiv:1201.3654</A>
JCAP 04(2012)027
<P>
<P>Evolution of cosmological dark matter perturbations<BR>
Antony Lewis and Anthony Challinor <A
HREF="http://arxiv.org/abs/astro-ph/0203507">astro-ph/0203507</A>
Phys. Rev. D66, 023531 (2002)
<P>
<B>Synchronous gauge theory and non-flat models</B>
<P>
Complete treatment of CMB anisotropies in a FRW universe<BR>
Wayne Hu, Uros Seljak and Matias Zaldarriaga.
Phys. Rev. D57:6, 3290-3301, 1998. <A HREF="http://arxiv.org/abs/astro-ph/9709066">astro-ph/9709066</A>.
<P>
<B>WKB approx to hyperspherical Bessel functions</B>
<P>
Efficient Computation of Hyperspherical Bessel Functions<BR>
Arthur Kosowsky, <A HREF="http://arxiv.org/abs/astro-ph/9805173">astro-ph/9805173</A>
<P>
<B>CMBFAST and the line of sight approach</B>
<P>
A line of sight integration approach to Cosmic Microwave Background
Anisotropies<BR>
Uros Seljak and Matias Zaldarriaga, <A HREF="http://arxiv.org/abs/astro-ph/9603033">astro-ph/9603033</A>
Ap.J. 469:2 437-444, 1996
<P>
Integral solution for the microwave background
anisotropies in nonflat universes<BR>
Matias Zaldarriaga, Uros Seljak, Edmund Bertschinger.
ApJ. 494:491-501, 1998. <A HREF="http://arxiv.org/abs/astro-ph/97042656">astro-ph/9704265</A>.
<P>
CMBFAST for spatially closed universes<BR>
Uros Seljak and Matias Zaldariaga, <A HREF="http://arxiv.org/abs/astro-ph/9911219">astro-ph/9911219</A>
</FONT>
</BODY>
</HTML>