19 #define EMU_TOLERANCE 3.0E-2 51 char fname[256],str[1024];
57 sigma8=malloc(4*
sizeof(
double));
58 Omega_c=malloc(4*
sizeof(
double));
59 Omega_b=malloc(4*
sizeof(
double));
60 n_s=malloc(4*
sizeof(
double));
61 h=malloc(4*
sizeof(
double));
62 w_0=malloc(4*
sizeof(
double));
63 w_a=malloc(4*
sizeof(
double));
64 Omega_nu=malloc(4*
sizeof(
double));
67 Mnu_out=malloc(3*
sizeof(
double));
72 sprintf(fname,
"./tests/benchmark/emu_nu_cosmologies.txt");
75 fprintf(stderr,
"Error opening file %s\n",fname);
81 for(
int i=0;i<4;i++) {
83 status=fscanf(f,
"%le %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],&Omega_nu[i]);
85 fprintf(stderr,
"Error reading file %s, line %d\n",fname,i);
88 data->w_0[i] = w_0[i];
89 data->w_a[i] = w_a[i];
91 data->sigma8[i] = sigma8[i];
92 data->Omega_c[i] = Omega_c[i];
93 data->Omega_b[i] = Omega_b[i];
94 data->n_s[i] = n_s[i];
101 data->mnu[i]=Mnu_out;
112 while((fgets(ch,
sizeof(ch),f))!=NULL) {
122 char fname[256],str[1024];
125 int i_model_vec[4]={38,39,40,42};
132 ccl_parameters params =
ccl_parameters_create(data->
Omega_c[i_model-1],data->
Omega_b[i_model-1],0.0,data->
Neff, data->
mnu[i_model-1], 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);
147 sprintf(fname,
"./tests/benchmark/emu_nu_smooth_pk_M%d.txt",i_model_vec[i_model-1]);
150 fprintf(stderr,
"Error opening file %s\n",fname);
155 double k=0.,pk_bench=0.,pk_ccl,err;
160 stat=fscanf(f,
"%le %le\n",&k, &pk_bench);
162 fprintf(stderr,
"Error reading file %s, line %d\n",fname,i);
167 err=fabs(pk_ccl/pk_bench-1);
double * ccl_nu_masses(double OmNuh2, ccl_neutrino_mass_splits mass_split, double T_CMB, int *status)
matter_power_spectrum_t matter_power_spectrum_method
double ccl_nonlin_matter_power(ccl_cosmology *cosmo, double k, double a, int *status)
ccl_mnu_convention mnu_type
#define CTEST_SETUP(sname)
#define CTEST_DATA(sname)
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)
static void compare_emu_nu(int i_model, struct emu_nu_data *data)
const ccl_configuration default_config
#define ASSERT_NOT_NULL(real)
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)