Add new input par to CAMB

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Sarah Libanore
Posts: 4
Joined: April 19 2021
Affiliation: Università degli studi di Padova

Add new input par to CAMB

Post by Sarah Libanore » July 01 2021

Hi everybody,

I want to add a new input parameter when running CAMB from the python wrapper.
What I did was to add it in the SourceWindow class in sources.py: the code compiles and import the new parameter inside the python libraries.
Now I need to pass it to the SourceWindow.f90 library as well: I initialize Type, extends(TPythonInterfacedClass) :: TSourceWindow , but the parameter in fortran is set = 0. It seems to me that the python wrapper is not updating the input value of this new parameter.

Note: I am working by defining this parameter in complete analogy to the dlog10Ndm parameter.
Do you have any suggestions?
Thank you in advance for your help!

Sarah

Antony Lewis
Posts: 1724
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: Add new input par to CAMB

Post by Antony Lewis » July 02 2021

If you just want to add another parameter to TSourceWindow, just add it in the fortran and python in equivalent places, making sure you keep the parameter ordering consistent (add your new parameter at the bottom of the list). And make sure you rebuild after any fortran changes.

Sarah Libanore
Posts: 4
Joined: April 19 2021
Affiliation: Università degli studi di Padova

Re: Add new input par to CAMB

Post by Sarah Libanore » July 03 2021

Hi Antony,

Thank you for your quick reply.
Indeed, it was a simple mistake in the ordering of the parameters in the fortran initialisation respect to the python one.
Thanks again!


Sarah

Post Reply