Skip to content

Commit

Permalink
fixed new precision settings for halofit
Browse files Browse the repository at this point in the history
  • Loading branch information
lesgourg committed Sep 21, 2017
1 parent 13637b1 commit 8092db3
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 36 deletions.
7 changes: 5 additions & 2 deletions cl_ref.pre
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ ur_fluid_trigger_tau_over_tau_k = 50.
ncdm_fluid_approximation = 3
ncdm_fluid_trigger_tau_over_tau_k = 51.

tol_ncdm = 1.e-10
tol_ncdm_synchronous = 1.e-10
tol_ncdm_newtonian = 1.e-10

l_logstep=1.026
l_linstep=25
Expand All @@ -54,7 +55,7 @@ hyper_x_tol = 1.e-4
hyper_flat_approximation_nu = 1.e6

q_linstep=0.20
q_logstep_spline= 20.
q_logstep_spline= 20.
q_logstep_trapzd = 0.5
q_numstep_transition = 250

Expand All @@ -73,6 +74,8 @@ transfer_neglect_delta_k_T_b = 100.
neglect_CMB_sources_below_visibility = 1.e-30
transfer_neglect_late_source = 3000.

halofit_k_per_decade = 3000.

l_switch_limber = 40.
accurate_lensing=1
num_mu_minus_lmax = 1000.
Expand Down
36 changes: 16 additions & 20 deletions include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -744,16 +744,22 @@ struct precision

/** parameters relevant for HALOFIT computation */

double halofit_dz; /**< spacing in redshift space defining values of z
at which HALOFIT will be used. Intermediate
values will be obtained by
interpolation. Decrease for more precise
interpolations, at the expense of increasing
time spent in nonlinear_init() */
double halofit_min_k_nonlinear; /**< value of k in 1/Mpc below which
non-linear corrections will be neglected */

double halofit_min_k_nonlinear; /**< value of k in 1/Mpc above
which non-linear corrections will
be computed */
double halofit_min_k_max; /**< when halofit is used, k_max must be
at least equal to this value (otherwise
halofit could not find the scale of
non-linearity). Calculations are done
internally until this k_max, but the
output is still controlled by
P_k_max_1/Mpc or P_k_max_h/Mpc even if
they are smaller */

double halofit_k_per_decade; /**< halofit needs to evalute integrals
(linear power spectrum times some
kernels). They are sampled using
this logarithmic step size. */

double halofit_sigma_precision; /**< a smaller value will lead to a
more precise halofit result at the *highest*
Expand All @@ -763,19 +769,9 @@ struct precision
precision on P_nl(k,z) at other redshifts, so
there is normally no need to change it */

double halofit_min_k_max; /**< when halofit is used, k_max must be at
least equal to this value (otherwise
halofit could not find the scale of
non-linearity) */

double halofit_k_per_decade; /**< halofit needs to evalute integrals
(linear power spectrum times some
kernels). They are sampled using
this logarithmic step size. */

double halofit_tol_sigma; /**< tolerance required on sigma(R) when
matching the condition sigma(R_nl)=1,
yielding the wavenumber of
whcih defines the wavenumber of
non-linearity, k_nl=1./R_nl */

//@}
Expand Down
5 changes: 4 additions & 1 deletion pk_ref.pre
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ ur_fluid_trigger_tau_over_tau_k = 50.
ncdm_fluid_approximation = 3
ncdm_fluid_trigger_tau_over_tau_k = 51.

tol_ncdm = 1.e-10
tol_ncdm_synchronous = 1.e-10
tol_ncdm_newtonian = 1.e-10

l_logstep=1.026
l_linstep=25
Expand Down Expand Up @@ -73,6 +74,8 @@ transfer_neglect_delta_k_T_b = 100.
neglect_CMB_sources_below_visibility = 1.e-30
transfer_neglect_late_source = 3000.

halofit_k_per_decade = 3000.

l_switch_limber = 40.
accurate_lensing=1
num_mu_minus_lmax = 1000.
Expand Down
18 changes: 5 additions & 13 deletions source/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -2725,8 +2725,8 @@ int input_read_parameters(

/** - (h.6.) parameters related to nonlinear calculations */

class_read_double("halofit_dz",ppr->halofit_dz);
class_read_double("halofit_min_k_nonlinear",ppr->halofit_min_k_nonlinear);
class_read_double("halofit_min_k_max",ppr->halofit_min_k_max);
class_read_double("halofit_k_per_decade",ppr->halofit_k_per_decade);
class_read_double("halofit_sigma_precision",ppr->halofit_sigma_precision);
class_read_double("halofit_tol_sigma",ppr->halofit_tol_sigma);
Expand Down Expand Up @@ -3379,19 +3379,11 @@ int input_default_precision ( struct precision * ppr ) {
* - parameters related to nonlinear module
*/

ppr->halofit_dz=0.1;
ppr->halofit_min_k_nonlinear=0.0035;
ppr->halofit_min_k_nonlinear = 1.e-4;
ppr->halofit_min_k_max = 5.;
ppr->halofit_k_per_decade = 80.;
ppr->halofit_sigma_precision=0.05; /**< a smaller value will lead to a
more precise halofit result at the *highest*
redshift at which halofit can make computations,
at the expense of requiring a larger k_max; but
this parameter is not relevant for the
precision on P_nl(k,z) at other redshifts, so
there is normally no need to change it */

ppr->halofit_min_k_max=5.; // this one is actually used in the perturbation module
ppr->halofit_tol_sigma = 0.001;
ppr->halofit_sigma_precision = 0.05;
ppr->halofit_tol_sigma = 1.e-6;

/**
* - parameter related to lensing
Expand Down

0 comments on commit 8092db3

Please sign in to comment.