Skip to content

Commit

Permalink
fixed cl_ref, but problem when using it in closed case
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Lesgourgues committed Dec 4, 2013
1 parent b9a6441 commit 7cee90a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 14 deletions.
2 changes: 0 additions & 2 deletions cl_permille.pre
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# precision file to be passed as input in order to achieve at least percent precision on scalar Cls
q_linstep_trans=0.45
q_logstep_trans=1.001
hyper_flat_approximation_nu = 7000.
transfer_neglect_delta_k_S_t0 = 0.17
transfer_neglect_delta_k_S_t1 = 0.05
Expand Down
16 changes: 9 additions & 7 deletions cl_ref.pre
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ recfast_x_H0_trigger_delta = 0.01

evolver=0

k_scalar_min_tau0=0.002
k_scalar_max_tau0_over_l_max=3.
k_scalar_step_sub=0.015
k_scalar_step_super=0.0001
k_min_tau0=0.002
k_max_tau0_over_l_max=3.
k_step_sub=0.015
k_step_super=0.0001
k_step_super_reduction=0.1

start_small_k_at_tau_c_over_tau_h = 0.0004
start_large_k_at_tau_h_over_tau_k = 0.05
Expand Down Expand Up @@ -52,9 +53,10 @@ hyper_phi_min_abs = 1.e-10
hyper_x_tol = 1.e-4
hyper_flat_approximation_nu = 1.e6

k_step_trans=0.2
q_linstep_trans=0.2
q_logstep_trans=1.001
q_linstep=0.20
q_logstep_spline= 20.
q_logstep_trapzd = 20.
q_numstep_transition = 250

transfer_neglect_delta_k_S_t0 = 100.
transfer_neglect_delta_k_S_t1 = 100.
Expand Down
9 changes: 8 additions & 1 deletion include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,13 @@ struct precision
(comoving angular diameter distance to
recombination) */

double q_logstep_open; /**< in open models, the value of
q_logstep_spline must be decreased
according to curvature. Increasing
this number will make the calculation
more accurate for large positive
Omega_k */

double q_logstep_trapzd; /**< initial logarithmic sampling step in q
space, in units of 2pi/r_a(tau_rec)
(comoving angular diameter distance to
Expand All @@ -570,7 +577,7 @@ struct precision
with curvature and vanishes in the
flat limit) */

int q_numstep_transition; /**< number of steps for the transition
double q_numstep_transition; /**< number of steps for the transition
from q_logstep_trapzd steps to
q_logstep_spline steps (transition
must be smooth for spline) */
Expand Down
2 changes: 2 additions & 0 deletions source/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -1642,6 +1642,7 @@ int input_init(

class_read_double("q_linstep",ppr->q_linstep);
class_read_double("q_logstep_spline",ppr->q_logstep_spline);
class_read_double("q_logstep_open",ppr->q_logstep_open);
class_read_double("q_logstep_trapzd",ppr->q_logstep_trapzd);
class_read_double("q_numstep_transition",ppr->q_numstep_transition);

Expand Down Expand Up @@ -2201,6 +2202,7 @@ int input_default_precision ( struct precision * ppr ) {

ppr->q_linstep=0.45;
ppr->q_logstep_spline=170.;
ppr->q_logstep_open=6.;
ppr->q_logstep_trapzd=20.;
ppr->q_numstep_transition=250.;

Expand Down
8 changes: 4 additions & 4 deletions source/transfer.c
Original file line number Diff line number Diff line change
Expand Up @@ -912,18 +912,18 @@ int transfer_get_q_list(

/* adjust the parameter governing the log step size to curvature */

q_logstep_spline = ppr->q_logstep_spline/pow(ptr->angular_rescaling,6);
q_logstep_spline = ppr->q_logstep_spline/pow(ptr->angular_rescaling,ppr->q_logstep_open);
q_logstep_trapzd = ppr->q_logstep_trapzd;

/* very conservative estimate of number of values */

q_step = 1.+q_period*ppr->q_logstep_spline;

q_size_max = (int)(log(q_max/q_min)/log(q_step));
q_size_max = 2*(int)(log(q_max/q_min)/log(q_step));

q_step += 1.+q_period*ppr->q_logstep_trapzd;

q_size_max = (int)(log(q_max/q_min)/log(q_step));
q_size_max = 2*(int)(log(q_max/q_min)/log(q_step));

q_step = q_period*ppr->q_linstep;

Expand Down Expand Up @@ -981,7 +981,7 @@ int transfer_get_q_list(

else {

if (nu<(int)ppr->hyper_flat_approximation_nu) {
if (nu < (int)ppr->hyper_flat_approximation_nu) {

q = ptr->q[index_q-1]
+ q_period * ppr->q_linstep * ptr->q[index_q-1]
Expand Down

0 comments on commit 7cee90a

Please sign in to comment.