Page 1 of 1

Add new input par to CAMB

Posted: July 01 2021
by Sarah Libanore
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

Re: Add new input par to CAMB

Posted: July 02 2021
by Antony Lewis
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.

Re: Add new input par to CAMB

Posted: July 03 2021
by Sarah Libanore
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