check for unsupported matter power spectrum
@@ -676,12 +676,11 @@ TASK: compute the nonlinear power spectrum at a given redshift
double ccl_nonlin_matter_power(ccl_cosmology * cosmo, double a, double k, int *status){
+ switch(cosmo->config.matter_power_spectrum_method){
//If the matter PS specified was linear, then do the linear compuation
- if(cosmo->config.matter_power_spectrum_method==ccl_linear){
-
+ case: ccl_linear
return ccl_linear_matter_power(cosmo,a,k,status);
-
- } else { //if not, do the nonlin computation
+ case: ccl_halofit
ccl_cosmology_compute_power(cosmo,status);
@@ -748,6 +747,10 @@ double ccl_nonlin_matter_power(ccl_cosmology * cosmo, double a, double k, int *s
return p_1;
+ default:
+ printf("WARNING: config.matter_power_spectrum_method = %d not yet supported\n continuing with linear power spectrum\n",cosmo->config.matter_power_spectrum_method);
+ cosmo->config.matter_power_spectrum_method=ccl_linear;
+ return ccl_linear_matter_power(cosmo,a,k,status);
}
}
