19 #define EMU_TOLERANCE 3.0E-2 54 char fname[256],str[1024];
58 sigma8=malloc(6*
sizeof(
double));
59 Omega_c=malloc(6*
sizeof(
double));
60 Omega_b=malloc(6*
sizeof(
double));
61 n_s=malloc(6*
sizeof(
double));
62 h=malloc(6*
sizeof(
double));
63 w_0=malloc(6*
sizeof(
double));
64 w_a=malloc(6*
sizeof(
double));
69 sprintf(fname,
"./tests/benchmark/emu_cosmologies.txt");
72 fprintf(stderr,
"Error opening file %s\n",fname);
77 for(
int i=0;i<6;i++) {
79 status=fscanf(f,
"%le %le %le %le %le %le %le\n",&Omega_c[i],&Omega_b[i],&h[i],&sigma8[i],&n_s[i],&w_0[i],&w_a[i]);
81 fprintf(stderr,
"Error reading file %s, line %d\n",fname,i);
84 data->w_0[i] = w_0[i];
85 data->w_a[i] = w_a[i];
87 data->sigma8[i] = sigma8[i];
88 data->Omega_c[i] = Omega_c[i];
89 data->Omega_b[i] = Omega_b[i];
90 data->n_s[i] = n_s[i];
101 while((fgets(ch,
sizeof(ch),f))!=NULL) {
111 char fname[256],str[1024];
114 int i_model_vec[6]={1,3,5,6,8,10};
123 ccl_parameters params =
ccl_parameters_create(data->
Omega_c[i_model-1],data->
Omega_b[i_model-1],0.0,data->
Neff, data->
mnu, data->
mnu_type, data->
w_0[i_model-1],data->
w_a[i_model-1],data->
h[i_model-1],data->
sigma8[i_model-1],data->
n_s[i_model-1],-1,-1,-1,-1,NULL,NULL, &status);
130 sprintf(fname,
"./tests/benchmark/emu_smooth_pk_M%d.txt",i_model_vec[i_model-1]);
133 fprintf(stderr,
"Error opening file %s\n",fname);
138 double k=0.,pk_bench=0.,pk_ccl,err;
143 stat=fscanf(f,
"%le %le\n",&k, &pk_bench);
145 fprintf(stderr,
"Error reading file %s, line %d\n",fname,i);
150 err=fabs(pk_ccl/pk_bench-1);
matter_power_spectrum_t matter_power_spectrum_method
double ccl_nonlin_matter_power(ccl_cosmology *cosmo, double k, double a, int *status)
#define CTEST_SETUP(sname)
#define CTEST_DATA(sname)
static void compare_emu(int i_model, struct emu_data *data)
transfer_function_t transfer_function_method
static int linecount(FILE *f)
ccl_cosmology * ccl_cosmology_create(ccl_parameters params, ccl_configuration config)
void ccl_cosmology_free(ccl_cosmology *cosmo)
#define ASSERT_DBL_NEAR_TOL(exp, real, tol)
const ccl_configuration default_config
#define ASSERT_NOT_NULL(real)
ccl_mnu_convention mnu_type
ccl_parameters ccl_parameters_create(double Omega_c, double Omega_b, double Omega_k, double Neff, double *mnu, ccl_mnu_convention mnu_type, double w0, double wa, double h, double norm_pk, double n_s, double bcm_log10Mc, double bcm_etab, double bcm_ks, int nz_mgrowth, double *zarr_mgrowth, double *dfarr_mgrowth, int *status)
#define CTEST2(sname, tname)