CLASS MANUAL
input.c File Reference
#include "input.h"
#include "quadrature.h"
#include "background.h"
#include "thermodynamics.h"
#include "perturbations.h"
#include "transfer.h"
#include "primordial.h"
#include "harmonic.h"
#include "fourier.h"
#include "lensing.h"
#include "distortions.h"
#include "output.h"
#include "precisions.h"
+ Include dependency graph for input.c:

Functions

int input_init (int argc, char **argv, struct precision *ppr, struct background *pba, struct thermodynamics *pth, struct perturbations *ppt, struct transfer *ptr, struct primordial *ppm, struct harmonic *phr, struct fourier *pfo, struct lensing *ple, struct distortions *psd, struct output *pop, ErrorMsg errmsg)
 
int input_find_file (int argc, char **argv, struct file_content *fc, ErrorMsg errmsg)
 
int input_set_root (char *input_file, struct file_content **ppfc_input, struct file_content *pfc_setroot, ErrorMsg errmsg)
 
int input_read_from_file (struct file_content *pfc, struct precision *ppr, struct background *pba, struct thermodynamics *pth, struct perturbations *ppt, struct transfer *ptr, struct primordial *ppm, struct harmonic *phr, struct fourier *pfo, struct lensing *ple, struct distortions *psd, struct output *pop, ErrorMsg errmsg)
 
int input_shooting (struct file_content *pfc, struct precision *ppr, struct background *pba, struct thermodynamics *pth, struct perturbations *ppt, struct transfer *ptr, struct primordial *ppm, struct harmonic *phr, struct fourier *pfo, struct lensing *ple, struct distortions *psd, struct output *pop, int input_verbose, int *has_shooting, ErrorMsg errmsg)
 
int input_needs_shooting_for_target (struct file_content *pfc, enum target_names target_name, double target_value, int *needs_shooting, ErrorMsg errmsg)
 
int input_find_root (double *xzero, int *fevals, double tol_x_rel, struct fzerofun_workspace *pfzw, ErrorMsg errmsg)
 
int input_fzerofun_1d (double input, void *pfzw, double *output, ErrorMsg error_message)
 
int input_fzero_ridder (int(*func)(double x, void *param, double *y, ErrorMsg error_message), double x1, double x2, double xtol, void *param, double *Fx1, double *Fx2, double *xzero, int *fevals, ErrorMsg error_message)
 
int input_get_guess (double *xguess, double *dxdy, struct fzerofun_workspace *pfzw, ErrorMsg errmsg)
 
int input_try_unknown_parameters (double *unknown_parameter, int unknown_parameters_size, void *voidpfzw, double *output, ErrorMsg errmsg)
 
int input_read_precisions (struct file_content *pfc, struct precision *ppr, struct background *pba, struct thermodynamics *pth, struct perturbations *ppt, struct transfer *ptr, struct primordial *ppm, struct harmonic *phr, struct fourier *pfo, struct lensing *ple, struct distortions *psd, struct output *pop, ErrorMsg errmsg)
 
int input_read_parameters (struct file_content *pfc, struct precision *ppr, struct background *pba, struct thermodynamics *pth, struct perturbations *ppt, struct transfer *ptr, struct primordial *ppm, struct harmonic *phr, struct fourier *pfo, struct lensing *ple, struct distortions *psd, struct output *pop, ErrorMsg errmsg)
 
int input_read_parameters_general (struct file_content *pfc, struct background *pba, struct thermodynamics *pth, struct perturbations *ppt, struct distortions *psd, ErrorMsg errmsg)
 
int input_read_parameters_species (struct file_content *pfc, struct precision *ppr, struct background *pba, struct thermodynamics *pth, struct perturbations *ppt, int input_verbose, ErrorMsg errmsg)
 
int input_read_parameters_injection (struct file_content *pfc, struct precision *ppr, struct thermodynamics *pth, ErrorMsg errmsg)
 
int input_read_parameters_nonlinear (struct file_content *pfc, struct precision *ppr, struct background *pba, struct thermodynamics *pth, struct perturbations *ppt, struct fourier *pfo, int input_verbose, ErrorMsg errmsg)
 
int input_prepare_pk_eq (struct precision *ppr, struct background *pba, struct thermodynamics *pth, struct fourier *pfo, int input_verbose, ErrorMsg errmsg)
 
int input_read_parameters_primordial (struct file_content *pfc, struct perturbations *ppt, struct primordial *ppm, ErrorMsg errmsg)
 
int input_read_parameters_spectra (struct file_content *pfc, struct precision *ppr, struct background *pba, struct primordial *ppm, struct perturbations *ppt, struct transfer *ptr, struct harmonic *phr, struct output *pop, ErrorMsg errmsg)
 
int input_read_parameters_lensing (struct file_content *pfc, struct precision *ppr, struct perturbations *ppt, struct transfer *ptr, struct lensing *ple, ErrorMsg errmsg)
 
int input_read_parameters_distortions (struct file_content *pfc, struct precision *ppr, struct distortions *psd, ErrorMsg errmsg)
 
int input_read_parameters_additional (struct file_content *pfc, struct precision *ppr, struct background *pba, struct thermodynamics *pth, ErrorMsg errmsg)
 
int input_read_parameters_output (struct file_content *pfc, struct background *pba, struct thermodynamics *pth, struct perturbations *ppt, struct transfer *ptr, struct primordial *ppm, struct harmonic *phr, struct fourier *pfo, struct lensing *ple, struct distortions *psd, struct output *pop, ErrorMsg errmsg)
 
int input_write_info (struct file_content *pfc, struct output *pop, ErrorMsg errmsg)
 
int input_default_params (struct background *pba, struct thermodynamics *pth, struct perturbations *ppt, struct transfer *ptr, struct primordial *ppm, struct harmonic *phr, struct fourier *pfo, struct lensing *ple, struct distortions *psd, struct output *pop)
 

Detailed Description

Documented input module.

Julien Lesgourgues, 27.08.2010

  • internal organization of the module structured and improved by Nils Schoeneberg and Matteo Lucca, 07.03.2019

Function Documentation

◆ input_init()

int input_init ( int  argc,
char **  argv,
struct precision ppr,
struct background pba,
struct thermodynamics pth,
struct perturbations ppt,
struct transfer ptr,
struct primordial ppm,
struct harmonic phr,
struct fourier pfo,
struct lensing ple,
struct distortions psd,
struct output pop,
ErrorMsg  errmsg 
)

Initialize input parameters from external file.

Parameters
argcInput: Number of command line arguments
argvInput: Command line argument strings
pprInput: pointer to precision structure
pbaInput: pointer to background structure
pthInput: pointer to thermodynamics structure
pptInput: pointer to perturbation structure
ptrInput: pointer to transfer structure
ppmInput: pointer to primordial structure
phrInput: pointer to harmonic structure
pfoInput: pointer to fourier structure
pleInput: pointer to lensing structure
psdInput: pointer to distorsion structure
popInput: pointer to output structure
errmsgInput/Output: Error message
Returns
the error status

Summary:

Define local variables

Find and read input file

Initialize all parameters given the input 'file_content' structure. If its size is null, all parameters take their default values.

Free local struture

◆ input_find_file()

int input_find_file ( int  argc,
char **  argv,
struct file_content *  fc,
ErrorMsg  errmsg 
)

Find and read external file (xxx.ini or xxx.pre) containing the input parameters. All data is stored in the local structure 'file_content'.

Parameters
argcInput: Number of command line arguments
argvInput: Command line argument strings
fcOutput: file_content structure
errmsgInput/Output: Error message
Returns
the error status

Summary:

Define local variables

Initialize the two file_content structures (for input parameters and precision parameters) to some null content. If no arguments are passed, they will remain null and inform input_init that all parameters take default values.

If some arguments are passed, identify eventually some 'xxx.ini' and 'xxx.pre' files, and store their name.

If there is an 'xxx.ini' file, read it and store its content.

If there is an 'xxx.pre' file, read it and store its content.

If one or two files were read, merge their contents in a single 'file_content' structure.

Free local strutures

◆ input_set_root()

int input_set_root ( char *  input_file,
struct file_content **  ppfc_input,
struct file_content *  pfc_setroot,
ErrorMsg  errmsg 
)

Sets the 'root' variable in the input file content (this will be the beginning of the name of all output files for the current CLASS run)

Parameters
input_fileInput: filename of the input file
ppfc_inputInput/Output: pointer to (pointer to input file structure)
pfc_setrootInput: pointer to an allocated temporary file content that will be used here
errmsgInput/Output: the error message
Returns
the error status

Define local variables

Check whether a root name has been set, and wether overwrite_root is true

If root has not been set, use the default of 'output/<this-filename>'

If we don't want to overwrite the root name, check now for the existence of output for the given root name + N

For each 'filenum', test if it exists. Only stop if it has not been found.

If we do want to overwrite, just take the given root name

◆ input_read_from_file()

int input_read_from_file ( struct file_content *  pfc,
struct precision ppr,
struct background pba,
struct thermodynamics pth,
struct perturbations ppt,
struct transfer ptr,
struct primordial ppm,
struct harmonic phr,
struct fourier pfo,
struct lensing ple,
struct distortions psd,
struct output pop,
ErrorMsg  errmsg 
)

Initialize each parameter, first to its default values, and then from what can be interpreted from the values passed in the input 'file_content' structure. If its size is null, all parameters keep their default values.

Parameters
pfcInput: pointer to local structure
pprInput: pointer to precision structure
pbaInput: pointer to background structure
pthInput: pointer to thermodynamics structure
pptInput: pointer to perturbation structure
ptrInput: pointer to transfer structure
ppmInput: pointer to primordial structure
phrInput: pointer to harmonic structure
pfoInput: pointer to fourier structure
pleInput: pointer to lensing structure
psdInput: pointer to distorsion structure
popInput: pointer to output structure
errmsgInput/Output: Error message
Returns
the error status

Summary:

  • Define local variables

Set default values Before getting into the assignment of parameters and the shooting, we want to already fix our precision parameters. No precision parameter should depend on any input parameter

Find out if shooting necessary and, eventually, shoot and initialize read parameters

If no shooting is necessary, initialize read parameters without it

Write info on the read/unread parameters. This is the correct place to do it, since we want it to happen after all the shooting business, and after the final reading of all parameters

◆ input_shooting()

int input_shooting ( struct file_content *  pfc,
struct precision ppr,
struct background pba,
struct thermodynamics pth,
struct perturbations ppt,
struct transfer ptr,
struct primordial ppm,
struct harmonic phr,
struct fourier pfo,
struct lensing ple,
struct distortions psd,
struct output pop,
int  input_verbose,
int *  has_shooting,
ErrorMsg  errmsg 
)

In CLASS, we call 'shooting' the process of doing preliminary runs of parts of the code in order to find numerically the value of an input variable which cannot be inferred analytically from other input variables passed by the user.

A typical example is when the user passes theta_s, the angular scale of the sound horizon at decoupling. This quantity be passed instead of the hubble parameter h, but only if we run CLASS until the thermodynamics module to figure out how h and theta_s relate numerically. The code starts from a guess for h, and runs to find the corresponding theta_s. It adjusts h, shoots again, and repeats this process until it finds some h giving the correct theta_s within some tolerance.

This function contains the overall structure to handle these steps.

Parameters
pfcInput/Output: pointer to file content, with input parameters before/after the shooting
pprInput: pointer to precision structure
pbaInput: pointer to background structure
pthInput: pointer to thermodynamics structure
pptInput: pointer to perturbation structure
ptrInput: pointer to transfer structure
ppmInput: pointer to primordial structure
phrInput: pointer to harmonic structure
pfoInput: pointer to fourier structure
pleInput: pointer to lensing structure
psdInput: pointer to distorsion structure
popInput: pointer to output structure
input_verboseInput: Verbosity of input
has_shootingOutput: do we need shooting?
errmsgInput/Output: Error message
Returns
the error status

Summary:

Define local variables

Do we need to fix unknown parameters?

In the case of unknown parameters, start shooting...

Go through all cases with unknown parameters

If there is only one parameter, we use a more efficient Newton method for 1D cases

Otherwise we do multidimensional shooting

Read all parameters from the fc obtained through shooting

Set status of shooting

Free arrays allocated

After the 'normal' shooting is done, do special shooting just for sigma8 if needed

Free arrays allocated

◆ input_needs_shooting_for_target()

int input_needs_shooting_for_target ( struct file_content *  pfc,
enum target_names  target_name,
double  target_value,
int *  needs_shooting,
ErrorMsg  errmsg 
)

Related to 'shooting': for each target, check whether it is sufficient to stick to the default value of the unkown parameter (for instance: if the target parameter is a density and the target value is zero, the unkown parameter should remain zero like in the default)

Parameters
pfcInput: pointer to local structure
target_nameInput: list of possible target names
target_valueInput: list of possible target values
needs_shootingOutput: needs shooting?
errmsgInput/Output: Error message
Returns
the error status

◆ input_find_root()

int input_find_root ( double *  xzero,
int *  fevals,
double  tol_x_rel,
struct fzerofun_workspace pfzw,
ErrorMsg  errmsg 
)

Related to 'shooting': Find the root of a one-dimensional function. This function starts from a first guess, then uses a few steps to bracket the root, and then calls another function to actually get the root.

Parameters
xzeroOutput: root x such that f(x)=0 up to tolerance (f(x) = input_fzerofun_1d)
fevalsOutput: number of iterations (that is, of CLASS runs) needed to find the root
tol_x_relInput : Relative tolerance compared to bracket of root that is used to find root.
pfzwInput : pointer to workspace containing targets, unkown parameters and other relevant information
errmsgInput/Output: Error message
Returns
the error status

Summary:

Define local variables

Fisrt we do our guess

Then we do a linear hunt for the boundaries

Find root using Ridders method (Exchange for bisection if you are old-school)

◆ input_fzerofun_1d()

int input_fzerofun_1d ( double  input,
void *  pfzw,
double *  output,
ErrorMsg  error_message 
)

Related to 'shooting': defines 1d function of which we want to find the root during the shooting. The function is simply: "prediction of CLASS for a target parameter y given a parameter x - targeted value of y"

Parameters
inputInput: value of x
pfzwInput: pointer to workspace containing targets, unkown parameters and other relevant information
outputOuput: f(x) = y - y_targeted
error_messageInput/Output: Error message
Returns
the error status

◆ input_fzero_ridder()

int input_fzero_ridder ( int(*)(double x, void *param, double *y, ErrorMsg error_message)  func,
double  x1,
double  x2,
double  xtol,
void *  param,
double *  Fx1,
double *  Fx2,
double *  xzero,
int *  fevals,
ErrorMsg  error_message 
)

Related to 'shooting': using Ridders' method, return the root x of a function f(x) known to lie between x1 and x2, up to some tolerance. Note that this function is very generic and could easily be moved to the tools (and be used in other modules).

Parameters
funcInput: function y=f(x), with arguments: x, pointer to y, and another pointer containing several fixed parameters
x1Input: lower boundary x1<x
x2Input: upper boundary x<x2
xtolInput: tolerance: |x- true root|<xtol
paramInput: fixed parameters passed to f(x)
Fx1Input: f(x1)
Fx2Input: f(x2)
xzeroOutput: root x
fevalsOutput: number of iterations (that is, of CLASS runs) needed to find the root
error_messageInput/Output: Error message
Returns
the error status

Summary:

Define local variables

◆ input_get_guess()

int input_get_guess ( double *  xguess,
double *  dxdy,
struct fzerofun_workspace pfzw,
ErrorMsg  errmsg 
)

Related to 'shooting': we define here a reasonable analytic guess for each unknown parameter as a function of its target parameter. We must also estimate dxdy, i.e. how the unknown parameter responds to the target parameter. This can simply be estimated as the derivative of the guess formula.

Parameters
xguessOutput: guess for unkown parameter x given target parameter y
dxdyOutput: guess for derivative dx/dy
pfzwInput : pointer to workspace containing targets, unkown parameters and other relevant information
errmsgInput/Output: Error message
Returns
the error status

Summary:

Define local variables

Estimate dxdy

Update pb to reflect guess

  • Deallocate everything allocated by input_read_parameters

◆ input_try_unknown_parameters()

int input_try_unknown_parameters ( double *  unknown_parameter,
int  unknown_parameters_size,
void *  voidpfzw,
double *  output,
ErrorMsg  errmsg 
)

Related to 'shooting': when there is one or more targets, call CLASS up to the highest needed computation stage, for a given set of unknown parameters; obtain the corresponding target parameters; and return the vector of each [target - targeted_value].

Parameters
unknown_parameterInput: vector of unkownn parameters x
unknown_parameters_sizeInput: size of this vector
voidpfzwInput: pointer to workspace containing targets, unkown parameters and other relevant information
outputOutput: vector of target parameters y
errmsgInput/Output: Error message
Returns
the error status

Summary

Define local variables

Read input parameters

Optimise flags for sigma8 calculation.

Shoot forward into class up to required stage

Get the corresponding shoot variable and put into output

In case scalar field is used to fill, pba->Omega0_scf is not equal to pfzw->target_value[i].

Free structures

Set filecontent to unread

Free pointers allocated on input if neccessary

Some pointers in ppt may not be allocated if has_perturbations is FALSE, but this is handled in perturbations_free_input as neccessary.

◆ input_read_precisions()

int input_read_precisions ( struct file_content *  pfc,
struct precision ppr,
struct background pba,
struct thermodynamics pth,
struct perturbations ppt,
struct transfer ptr,
struct primordial ppm,
struct harmonic phr,
struct fourier pfo,
struct lensing ple,
struct distortions psd,
struct output pop,
ErrorMsg  errmsg 
)

Initialize the precision parameter structure.

All precision parameters used in the other modules are listed here and assigned here a default value.

Parameters
pfcInput: pointer to local structure
pprInput: pointer to precision structure
pbaInput: pointer to background structure
pthInput: pointer to thermodynamics structure
pptInput: pointer to perturbations structure
ptrInput: pointer to transfer structure
ppmInput: pointer to primordial structure
phrInput: pointer to harmonic structure
pfoInput: pointer to non-linear structure
pleInput: pointer to lensing structure
popInput: pointer to output structure
psdInput: pointer to distorsion structure
errmsgInput: Error message
Returns
the error status

Summary:

  • Define local variables
  • Automatic estimate of machine precision

Read all precision parameters from input (these very concise lines parse all precision parameters thanks to the macros defined in macros_precision.h)

◆ input_read_parameters()

int input_read_parameters ( struct file_content *  pfc,
struct precision ppr,
struct background pba,
struct thermodynamics pth,
struct perturbations ppt,
struct transfer ptr,
struct primordial ppm,
struct harmonic phr,
struct fourier pfo,
struct lensing ple,
struct distortions psd,
struct output pop,
ErrorMsg  errmsg 
)

If entries are passed in file_content structure, carefully read and interpret each of them, and tune the relevant input parameters accordingly

Parameters
pfcInput: pointer to local structure
pprInput: pointer to precision structure
pbaInput: pointer to background structure
pthInput: pointer to thermodynamics structure
pptInput: pointer to perturbation structure
ptrInput: pointer to transfer structure
ppmInput: pointer to primordial structure
phrInput: pointer to harmonic structure
pfoInput: pointer to fourier structure
pleInput: pointer to lensing structure
psdInput: pointer to distorsion structure
popInput: pointer to output structure
errmsgInput: Error message
Returns
the error status

Summary:

Define local variables

Set all input parameters to default values

Read verbose for input structure

Read the general parameters of the background, thermodynamics, and perturbation structures This function is exclusively for those parameters, NOT related to any physical species

Read the parameters for each physical species (has to be called after the general read)

Read parameters for exotic energy injection quantities

Read parameters for nonlinear quantities

Read parameters for primordial quantities

Read parameters for spectra quantities

Read parameters for lensing quantities

Read parameters for distortions quantities

Read obsolete parameters

Read parameters for output quantities

◆ input_read_parameters_general()

int input_read_parameters_general ( struct file_content *  pfc,
struct background pba,
struct thermodynamics pth,
struct perturbations ppt,
struct distortions psd,
ErrorMsg  errmsg 
)

Read general parameters related to class, including

  • background, thermo, and perturbation quantities NOT associated to any particular species
  • calculationary quantities like the gauge/recombination code
  • output options
Parameters
pfcInput: pointer to local structure
pbaInput: pointer to background structure
pthInput: pointer to thermodynamics structure
pptInput: pointer to perturbation structure
psdInput: pointer to distorsion structure
errmsgInput: Error message
Returns
the error status

Summary:

  • Define local variables

1) List of output spectra requested

1.a) Terms contributing to the temperature spectrum

1.a.1) Split value of redshift z at which the isw is considered as late or early

1.b) Obsevable number count fluctuation spectrum

1.c) Transfer function of additional metric fluctuations

2) Perturbed recombination

3) Modes

3.a) List of initial conditions for scalars

3.b) List of initial conditions for scalars

4) Gauge

4.a) Set gauge

4.b) Do we want density and velocity transfer functions in Nbody gauge?

5) h in [-] and H_0/c in [1/Mpc = h/2997.9 = h*10^5/c]

6) Primordial helium fraction

7) Recombination parameters

7.a) Photo-ionization dependence for recfast

8) Reionization parametrization

8.a) Reionization parameters if reio_parametrization=reio_camb

8.b) Reionization parameters if reio_parametrization=reio_bins_tanh

8.c) reionization parameters if reio_parametrization=reio_many_tanh

8.d) reionization parameters if reio_parametrization=reio_many_tanh

9) Damping scale

10) Varying fundamental constants

◆ input_read_parameters_species()

int input_read_parameters_species ( struct file_content *  pfc,
struct precision ppr,
struct background pba,
struct thermodynamics pth,
struct perturbations ppt,
int  input_verbose,
ErrorMsg  errmsg 
)

Read the parameters for each physical species

Parameters
pfcInput: pointer to local structure
pprInput: pointer to precision structure
pbaInput: pointer to background structure
pthInput: pointer to thermodynamics structure
pptInput: pointer to perturbation structure
input_verboseInput: verbosity of input
errmsgInput: Error message
Returns
the error status

Summary:

  • Define local variables

1) Omega_0_g (photons) and T_cmb

2) Omega_0_b (baryons)

3) Omega_0_ur (ultra-relativistic species / massless neutrino)

We want to keep compatibility with old input files, and as such 'N_eff' is still an allowed parameter name, although it is deprecated and its use is discouraged.

3.a) Case of non-standard properties

4) Omega_0_cdm (CDM)

4) (Second part) Omega_0_m (total non-relativistic)

5) Non-cold relics (ncdm)

5.a) Number of non-cold relics

5.b) Check if filenames for interpolation tables are given

5.b.1) Check if filenames for interpolation tables are given

5.c) (optional) p.s.d.-parameters

5.d) Mass or Omega of each ncdm species

5.e) Temperatures

5.f) Chemical potentials

5.g) Degeneracy of each ncdm species

5.h) Quadrature modes, 0 is qm_auto

5.h.1) qmax, if relevant

5.h.2) Number of momentum bins

Last step of 5) (i.e. NCDM) – Calculate the masses and momenta

6) Omega_0_k (effective fractional density of curvature)

7.1) Decaying DM into DR

7.1.a) Omega_0_dcdmdr (DCDM, i.e. decaying CDM)

7.1.b) Omega_ini_dcdm or omega_ini_dcdm

7.1.c) Gamma in same units as H0, i.e. km/(s Mpc)

7.2) Multi-interacting dark matter (idm)

7.2.1) Global parameters for all interacting Dark Matter components

7.2.1.a) Amount of interacting dark matter

7.2.1.b) Mass of interacting dark matter

7.2.2) Dark Matter interacting with Dark Radiation, ETHOS-parametrization/NADM parametrization, see explanatory.ini

7.2.2.a) Amount of idr

7.2.2.b) stat_f_idr

7.2.2.c) idm_dr coupling

7.2.2.d) n_index_idm_dr

7.2.2.e) idr_nature

7.2.2.f) Strength of self interactions

7.2.2.g) Read alpha_idm_dr or alpha_dark

7.2.2.h) beta_idr

7.2.3) Dark Matter interacting with baryons

7.2.3.a) idm_b coupling stregth

7.2.3.b) idm_b temperature dependence

7.2.4) Dark Matter interacting with photons

7.2.4.a) idm_g coupling stregth

7.2.4.b) idm_g temperature dependence

7.3) Final consistency checks for dark matter species

8) Dark energy Omega_0_lambda (cosmological constant), Omega0_fld (dark energy fluid), Omega0_scf (scalar field)

8.a) If Omega fluid is different from 0

8.a.1) PPF approximation

8.a.2) Equation of state

8.a.2.2) Equation of state of the fluid in 'CLP' case

8.a.2.3) Equation of state of the fluid in 'EDE' case

8.b) If Omega scalar field (SCF) is different from 0

8.b.1) Additional SCF parameters

8.b.2) SCF initial conditions from attractor solution

8.b.3) SCF tuning parameter

8.b.4) Shooting parameter

◆ input_read_parameters_injection()

int input_read_parameters_injection ( struct file_content *  pfc,
struct precision ppr,
struct thermodynamics pth,
ErrorMsg  errmsg 
)

Read the parameters of injection structure (These are all exotic processes of energy injection)

Parameters
pfcInput: pointer to local structure
pprInput: pointer to precision structure
pthInput: pointer to thermodynamics structure
errmsgInput: Error message
Returns
the error status

Summary:

  • Define local variables

1) DM annihilation

1.a) Annihilation efficiency

1.a.1) Model energy fraction absorbed by the gas as a function of redhsift

2) DM decay

2.a) Fraction

2.b) Decay width

3) PBH evaporation

3.a) Fraction

3.b) Mass

4) PBH matter accretion

4.a) Fraction

4.b) Mass

4.c) Recipe

4.c.1) Additional parameters specific for spherical accretion

4.c.2) Additional parameters specific for disk accretion

5) Injection efficiency

6) deposition function

6.a) External file

◆ input_read_parameters_nonlinear()

int input_read_parameters_nonlinear ( struct file_content *  pfc,
struct precision ppr,
struct background pba,
struct thermodynamics pth,
struct perturbations ppt,
struct fourier pfo,
int  input_verbose,
ErrorMsg  errmsg 
)

Read the parameters of fourier structure.

Parameters
pfcInput: pointer to local structure
pprInput: pointer to precision structure
pbaInput: pointer to background structure
pthInput: pointer to thermodynamics structure
pptInput: pointer to perturbations structure
pfoInput: pointer to fourier structure
input_verboseInput: verbosity of input
errmsgInput: Error message
Returns
the error status

Define local variables

1) Non-linearity

  • special steps if we want Halofit with wa_fld non-zero: so-called "Pk_equal method" of 0810.0190 and 1601.07230

◆ input_prepare_pk_eq()

int input_prepare_pk_eq ( struct precision ppr,
struct background pba,
struct thermodynamics pth,
struct fourier pfo,
int  input_verbose,
ErrorMsg  errmsg 
)

Perform preliminary steps fur using the method called Pk_equal, described in 0810.0190 and 1601.07230, extending the range of validity of HALOFIT from constant w to (w0,wa) models. In that case, one must compute here some effective values of w0_eff(z_i) and Omega_m_eff(z_i), that will be interpolated later at arbitrary redshift in the non-linear module.

Returns table of values [z_i, tau_i, w0_eff_i, Omega_m_eff_i] stored in fourier structure.

Parameters
pprInput: pointer to precision structure
pbaInput: pointer to background structure
pthInput: pointer to thermodynamics structure
pfoInput/Output: pointer to fourier structure
input_verboseInput: verbosity of this input module
errmsgInput/Ouput: error message
Returns
the error status

Summary:

Define local variables

Store the true cosmological parameters (w0, wa) somwhere before using temporarily some fake ones in this function

The fake calls of the background and thermodynamics module will be done in non-verbose mode

Allocate indices and arrays for storing the results

Call the background module in order to fill a table of tau_i[z_i]

Loop over z_i values. For each of them, we will call the background and thermodynamics module for fake models. The goal is to find, for each z_i, and effective w0_eff[z_i] and Omega_m_eff{z_i], such that: the true model with (w0,wa) and the equivalent model with (w0_eff[z_i],0) have the same conformal distance between z_i and z_recombination, namely chi = tau[z_i] - tau_rec. It is thus necessary to call both the background and thermodynamics module for each fake model and to re-compute tau_rec for each of them. Once the eqauivalent model is found we compute and store Omega_m_effa(z_i) of the equivalent model

Restore cosmological parameters (w0, wa) to their true values before main call to CLASS modules

Spline the table for later interpolation

◆ input_read_parameters_primordial()

int input_read_parameters_primordial ( struct file_content *  pfc,
struct perturbations ppt,
struct primordial ppm,
ErrorMsg  errmsg 
)

Read the parameters of primordial structure.

Parameters
pfcInput: pointer to local structure
pptInput: pointer to perturbations structure
ppmInput: pointer to primordial structure
errmsgInput: Error message
Returns
the error status

Summary:

Define local variables

1) Primordial spectrum type

1.a) Pivot scale in Mpc-1

1.b) For type 'analytic_Pk'

1.b.1) For scalar perturbations

1.b.1.1) Adiabatic perturbations

1.b.1.2) Isocurvature/entropy perturbations

1.b.1.3) Cross-correlation between different adiabatic/entropy mode

1.b.2) For tensor perturbations

1.c) For type 'inflation_V'

1.c.1) Type of potential

1.c.2) Coefficients of the Taylor expansion

1.d) For type 'inflation_H'

1.e) For type 'inflation_V_end'

1.e.1) Value of the field at the minimum of the potential

1.e.2) Shape of the potential

1.e.3) Parameters of the potential

1.e.4) How much the scale factor a or the product (aH) increases between Hubble crossing for the pivot scale (during inflation) and the end of inflation

1.e.5) Should the inflation module do its nomral job of numerical integration ('numerical') or use analytical slow-roll formulas to infer the primordial spectrum from the potential ('analytical')?

1.f) For type 'two_scales'

1.f.1) Wavenumbers

1.f.2) Amplitudes for the adiabatic primordial spectrum

1.f.3) Isocurvature amplitudes

1.f.4) Uncorrelated or anti-correlated?

1.g) For type 'external_Pk'

1.g.1) Command generating the table

1.g.2) Command generating the table

◆ input_read_parameters_spectra()

int input_read_parameters_spectra ( struct file_content *  pfc,
struct precision ppr,
struct background pba,
struct primordial ppm,
struct perturbations ppt,
struct transfer ptr,
struct harmonic phr,
struct output pop,
ErrorMsg  errmsg 
)

Read the parameters of harmonic structure.

Parameters
pfcInput: pointer to local structure
pprInput: pointer to precision structure
pbaInput: pointer to background structure
ppmInput: pointer to primordial structure
pptInput: pointer to perturbations structure
ptrInput: pointer to transfer structure
phrInput: pointer to harmonic structure
popInput: pointer to output structure
errmsgInput: Error message
Returns
the error status

Summary:

Define local variables

1) Maximum l for CLs

2) Parameters for the the matter density number count

2.a) Selection functions W(z) of each redshift bin

2.b) Selection function

2.c) Source number counts evolution

3) Power spectrum P(k)

3.a) Maximum k in P(k)

3.a.1) Maximum k in primordial P(k)

3.b) Redshift values

3.c) Maximum redshift

◆ input_read_parameters_lensing()

int input_read_parameters_lensing ( struct file_content *  pfc,
struct precision ppr,
struct perturbations ppt,
struct transfer ptr,
struct lensing ple,
ErrorMsg  errmsg 
)

Read the parameters of lensing structure.

Parameters
pfcInput: pointer to local structure
pprInput: pointer to precision structure
pptInput: pointer to perturbations structure
ptrInput: pointer to transfer structure
pleInput: pointer to lensing structure
errmsgInput: Error message
Returns
the error status

Summary:

Define local variables

1) Lensed spectra?

2) Should the lensed spectra be rescaled (either with just A_L, or otherwise with amplitude, and tilt and pivot scale in k space)

◆ input_read_parameters_distortions()

int input_read_parameters_distortions ( struct file_content *  pfc,
struct precision ppr,
struct distortions psd,
ErrorMsg  errmsg 
)

Read free parameters of distortions structure.

Parameters
pfcInput: pointer to local structure
pprInput: pointer to precision structure
psdInput: pointer to distortions structure
errmsgInput: Error message
Returns
the error status

Summary:

Define local variables

1) Branching ratio approximation

1.a.1) Number of multipoles in PCA expansion

1.a.2) Detector name

1.a.3) Detector specifics

1.a.3.1) From file

1.a.3.2) User defined

2) Only calculate exotic energy injections and no LCDM processes for spectral distortions ?

3) Include g distortions?

4) Set g-distortions to zero?

5) Include SZ effect from reionization?

5.a) Type of calculation

◆ input_read_parameters_additional()

int input_read_parameters_additional ( struct file_content *  pfc,
struct precision ppr,
struct background pba,
struct thermodynamics pth,
ErrorMsg  errmsg 
)

Read obsolete/additional parameters that are not assigned to a specific structure

Parameters
pfcInput: pointer to local structure
pprInput: pointer to precision structure
pbaInput: pointer to background structure
pthInput: pointer to thermodynamics structure
errmsgInput: Error message
Returns
the error status

Summary:

Define local variables

Here we can place all obsolete (deprecated) names for the precision parameters that will still be read as of the current version. There is however, no guarantee that this will be true for future versions as well. The new parameter names should be used preferrably.

Here are slgihtly more obsolete parameters, these will not even be read, only give an error message

Test additional input parameters related to precision parameters

◆ input_read_parameters_output()

int input_read_parameters_output ( struct file_content *  pfc,
struct background pba,
struct thermodynamics pth,
struct perturbations ppt,
struct transfer ptr,
struct primordial ppm,
struct harmonic phr,
struct fourier pfo,
struct lensing ple,
struct distortions psd,
struct output pop,
ErrorMsg  errmsg 
)

Read the parameters of output structure.

Parameters
pfcInput: pointer to local structure
pbaInput: pointer to background structure
pthInput: pointer to thermodynamics structure
pptInput: pointer to perturbations structure
ptrInput: pointer to transfer structure
ppmInput: pointer to primordial structure
phrInput: pointer to harmonic structure
pfoInput: pointer to non-linear structure
pleInput: pointer to lensing structure
psdInput: pointer to distorsion structure
popInput: pointer to output structure
errmsgInput: Error message
Returns
the error status

Summary:

Define local variables

1) Output for external files

1.a) File name

1.b) Headers

1.c) Format

1.d) Background quantities

1.e) Thermodynamics quantities

1.f) Table of perturbations for certain wavenumbers k

1.g) Primordial spectra

1.h) Exotic energy injection output

1.i) Non-injected photon injection

1.k) Spectral Distortions

2) Verbosity

◆ input_write_info()

int input_write_info ( struct file_content *  pfc,
struct output pop,
ErrorMsg  errmsg 
)

Write the info related to the used and unused parameters Additionally, write the warnings for unused parameters

Parameters
pfcInput: pointer to local structure
popInput: pointer to output structure
errmsgInput: Error message
Returns
the error status

Summary:

Define local variables

◆ input_default_params()

int input_default_params ( struct background pba,
struct thermodynamics pth,
struct perturbations ppt,
struct transfer ptr,
struct primordial ppm,
struct harmonic phr,
struct fourier pfo,
struct lensing ple,
struct distortions psd,
struct output pop 
)

All default parameter values (for input parameters)

Parameters
pbaInput: pointer to background structure
pthInput: pointer to thermodynamics structure
pptInput: pointer to perturbation structure
ptrInput: pointer to transfer structure
ppmInput: pointer to primordial structure
phrInput: pointer to harmonic structure
pfoInput: pointer to fourier structure
pleInput: pointer to lensing structure
psdInput: pointer to distorsion structure
popInput: pointer to output structure
Returns
the error status
the error status

Summary:

  • Define local variables

Default to input_read_parameters_general

1) Output spectra

1.a) 'tCl' case

1.a.1) Split value of redshift z at which the isw is considered as late or early

1.b) 'nCl' (or 'dCl') case

1.c) 'dTk' (or 'mTk') case

2) Perturbed recombination

3) Modes

3.a) Initial conditions for scalars

3.b) Initial conditions for tensors

4.a) Gauge

4.b) N-body gauge

5) Hubble parameter

6) Primordial Helium fraction

7) Recombination algorithm

8) Parametrization of reionization

8.a) 'reio_camb' or 'reio_half_tanh' case

8.b) 'reio_bins_tanh' case

8.c) 'reio_many_tanh' case

8.d) 'reio_inter' case

9) Damping scale

10) Varying fundamental constants

Default to input_read_parameters_species

1) Photon density

2) Baryon density

3) Ultra-relativistic species / massless neutrino density, assuming as default value N_eff=3.044 (see 2008.01074 and 2012.02726. This value is more accurate than the previous default value of 3.046)

3.a) Effective squared sound speed and viscosity parameter

4) CDM density

5) ncdm sector

5.a) Number of distinct species

5.b) List of names of psd files

5.c) Analytic distribution function

5.d) --> See read_parameters_background

5.e) ncdm temperature

5.f) ncdm chemical potential

5.g) ncdm degeneracy parameter

5.h) --> See read_parameters_background

6) Curvature density

7.1) Decaying CDM into Dark Radiation = dcdm+dr

7.1.a) Current fractional density of dcdm+dr

7.1.b) Initial fractional density of dcdm+dr

7.1.c) Decay constant

7.2) Interacting Dark Matter

7.2.1.a) Current factional density of idm

7.2.1.a) Mass of idm in eV

7.2.2) Current fractional density of idr

7.2.2.c) Coupling idm_dr

7.2.2.d) temperature scaling idm_dr

7.2.2.e) Approximation mode of idr

7.2.2.f) idr self-interactions

7.2.2.g, 7.2.2.h) angular coefficients

7.2.3.a) idm_b coupling

7.2.3.b) temperature scaling idm_b

7.2.4.a) idm_g coupling

7.2.4.b) temperature scaling idm_g

9) Dark energy contributions

8.a) Omega fluid

8.a.1) PPF approximation

9.a.2) Equation of state

9.a.2.1) 'CLP' case

9.a.2.2) 'EDE' case

9.b) Omega scalar field

9.b.1) Potential parameters and initial conditions

9.b.2) Initial conditions from attractor solution

9.b.3) Tuning parameter

9.b.4) Shooting parameter

Deafult to input_read_parameters_heating

1) DM annihilation

1.a) Energy fraction absorbed by the gas

1.a.1) Redshift dependence

2) DM decay

2.a) Fraction

2.b) Decay width

3) PBH evaporation

3.a) Fraction

3.b) Mass

4) PBH accretion

4.a) Fraction

4.b) Mass

4.c) Recipe

4.c.1) Additional parameters for spherical accretion

4.c.1) Additional parameters for disk accretion

5) Injection efficiency

6) Deposition function

6.1) External file

Default to input_read_parameters_nonlinear

1) Non-linearity

Default to input_read_parameters_primordial

1) Primordial spectrum type

1.a) Pivot scale in Mpc-1

1.b) For type 'analytic_Pk'

1.b.1) For scalar perturbations

1.b.1.1) Adiabatic perturbations

1.b.1.2) Isocurvature/entropy perturbations

1.b.1.3) Cross-correlation between different adiabatic/entropy mode

1.b.2) For tensor perturbations

1.c) For type 'inflation_V'

1.c.2) Coefficients of the Taylor expansion

1.d) For type 'inflation_H'

1.e) For type 'inflation_V_end'

1.e.1) Value of the field at the minimum of the potential

1.e.2) Shape of the potential

1.e.4) Increase of scale factor or (aH) between Hubble crossing at pivot scale and end of inflation

1.e.5) Nomral numerical integration or analytical slow-roll formulas?

1.g) For type 'external_Pk'

1.g.1) Command generating the table

1.g.2) Parameters to be passed to the command

Default to input_read_parameters_spectra

1) Maximum l for CLs

2) Parameters for the the matter density number count

2.a) Selection functions W(z) of each redshift bin

2.b) Selection function

2.c) Source number counts evolution

3) Power spectrum P(k)

3.a) Maximum k in P(k)

3.a) Maximum k in P(k) primordial

3.b) Redshift values

3.c) Maximum redshift

Default to input_read_parameters_lensing

1) Lensing

2) Should the lensed spectra be rescaled?

Default to input_read_parameters_distortions

1) Branching ratio approximation

1.a.1) Number of multipoles in PCA expansion

1.a.2) Detector noise file name

1.a.3) Detector name

1.3.a.1) Detector nu min

1.3.a.2) Detector nu max

1.3.a.3) Detector nu delta/bin number

1.3.a.1) Detector noise

2) Only exotic species?

3) Include g distortion in total calculation?

4) Additional y or mu parameters?

5) Include SZ effect from reionization?

5.a) What type of approximation you want to use for the SZ effect?

Default to input_read_additional

Default to input_read_parameters_output

1) Output for external files

1.a) File name

1.b) Headers

1.c) Format

1.d) Background quantities

1.e) Thermodynamics quantities

1.f) Table of perturbations for certain wavenumbers k

1.g) Primordial spectra

1.h) Exotic energy injection function

1.i) Spectral distortions

2) Verbosity