Skip to content

Commit

Permalink
v3.2.5, negative m_ncdm forbidden
Browse files Browse the repository at this point in the history
  • Loading branch information
lesgourg authored Oct 7, 2024
1 parent b15e761 commit 2febfbe
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion external/RealSpaceInterface/README
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CLASS real space interface
07.2015: started by Max Beutelspacher
09.2018: improved by Georgios Samaras and released in class v2.7.0
10.2025: for v3.2.5: made compatible with python 3, credits Thimothy Morton and Mowen Zhao
10.2025: for v3.2.5: made compatible with python 3, credits Timothy Morton and Mowen Zhao


For installation of python packages, run
Expand Down
2 changes: 1 addition & 1 deletion include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef __COMMON__
#define __COMMON__

#define _VERSION_ "v3.2.4"
#define _VERSION_ "v3.2.5"

/* @cond INCLUDE_WITH_DOXYGEN */

Expand Down
14 changes: 12 additions & 2 deletions source/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -2560,18 +2560,28 @@ int input_read_parameters_species(struct file_content * pfc,
errmsg,
errmsg);

/** 5.d) Mass or Omega of each ncdm species */
/** 5.d) Mass and/or Omega of each ncdm species */
/* Read */
class_read_list_of_doubles_or_default("m_ncdm",pba->m_ncdm_in_eV,0.0,N_ncdm);
for (n=0; n<N_ncdm; n++){
class_test(pba->m_ncdm_in_eV[n]<0,
errmsg,
"You entered a negative non-CDM mass m_ncdm[%d], which makes no sense. This error was not caught in previous CLASS versions because the mass is always squared in the code, so CLASS returned the exact same results form +m_ncdm and -m_ncdm. If you want to define an 'effective negative neutrino mass' in the sense of e.g. 2405.00836 or 2407.10965, you can implement it in a python script following e.g. eq.(3) of 2407.10965",n);
}

class_read_list_of_doubles_or_default("Omega_ncdm",pba->Omega0_ncdm,0.0,N_ncdm);
// the name M_ncdm is borrowed temporarily to store omega_ncdm
class_read_list_of_doubles_or_default("omega_ncdm",pba->M_ncdm,0.0,N_ncdm);
for (n=0; n<N_ncdm; n++){
if (pba->M_ncdm[n]!=0.0){
/* Test */
class_test(pba->Omega0_ncdm[n]!=0,errmsg,
"You can only enter one of 'Omega_ncdm' or 'omega_ncdm' for ncdm species %d.",n);
/* Complete set of parameters */
/* Complete set of parameters: if the user passed either
Omega_ncdm or omega_ncdm, now it's stored anyway as
Omega_0_ncdm */
pba->Omega0_ncdm[n] = pba->M_ncdm[n]/pba->h/pba->h;
// the name M_ncdm is now available for its real destination
}
/* Set default value
this is the right place for passing the default value of the mass
Expand Down

0 comments on commit 2febfbe

Please sign in to comment.