Page 1 of 2

cosmomc: adding an extra parameter

Posted: May 31 2008
by Olga Mena
Hi!

I am trying to change cosmomc adding an extra, new parameter.
I have changed settings.f90 (changing num_hard) as well as params_CMB.f90.

The problem is that the new parameter does not show up in the final
.txt file because I am not sure what file should I change for that...I guess
something in the Getdist.f90 file??

Any ideas?

Thanks a lot in advance&sorry for the naive question!

cosmomc: adding an extra parameter

Posted: June 06 2008
by Brian Powell
Olga --

It's easiest to simply reassign an already present parameter in params.ini. Is this what you are doing?

Brian

Re: cosmomc: adding an extra parameter

Posted: June 06 2008
by Olga Mena
Hi Brian!

Thanks a lot! Is what at the end I decided to do...
now it works perfectly!

Thanks a lot again!

Olga

cosmomc: adding an extra parameter

Posted: June 18 2008
by Akhilesh Nautiyal(akhi)
HI Olga,

Would you please let me know, what did you do to add the new parameter.
I tried all the way but couldn't get.
I request you to tell me the full procedure.


Regards,
Akhilesh

Re: cosmomc: adding an extra parameter

Posted: June 18 2008
by Olga Mena
Hi Akhilesh!

Sure!
Just pick up one of the parameters in the params.ini file that you might not want to use. In my case I chose w by fixing it to -1 in CMB_Cls_simple.f90,
setting the logical variable "w_is_w" to true.

You must first define the new parameter in "Type CMBParams" of cmbtypes.f90

Then you should change CAMB properly, including the new parameter wherever required. You should change as well the subroutine CMBtoCAMB in CMB_Cls_simple.f90, adding the new parameter there

newparam=CMB%newparam

and, in case you decide to fix w to -1 you can change:

if (w_is_w) then
w_lam = -1

You should change as well the subroutine SetForH(Params,CMB,H0) and the subroutine CMBParamsToParams in params_CMB.f90.

I think that's all I did...there might be easier and faster ways, but this works!

Cheers!

Olga

cosmomc: adding an extra parameter

Posted: June 20 2008
by moslem zarei
Dear Olga
I have a new parameter and I have changed files as you told. But after make all in the source subdirectry I give the following error:

ifort -DMATRIX_SINGLE -O2 -ip -W0 -WB -fpp -vec_report0 -I/home/zareie/Desktop/cfitsio/include -I/home/zareie/Desktop/likelihood_v3 -I../camb -c params_CMB.f90
fortcom: Error: params_CMB.f90, line 96: This is not a field name that is defined in the encompassing structure. [SIGGMA]
P%InitPower%siggma(in) = CMB%InitPower%sigmma
-------------------^
fortcom: Error: params_CMB.f90, line 96: This is not a field name that is defined in the encompassing structure. [SIGMMA]
P%InitPower%siggma(in) = CMB%InitPower%sigmma
----------------------------------------------^
compilation aborted for params_CMB.f90 (code 1)
make: *** [params_CMB.o] Error 1

sigmma is my new parameter.
could you please tell me more about this error.
Bests

cosmomc: adding an extra parameter

Posted: June 20 2008
by Pascal Vaudrevange
Hi Moslem,

Check the spelling of the siggma vs. sigmma vs. sigma.

Pascal

cosmomc: adding an extra parameter

Posted: June 21 2008
by moslem zarei
Hi
Thanks for your reply
I corrected the "sigmma" and now the error disappeared but when I run
./cosmomc params.ini
in the chain, the outpot file "test.log" is empty also I can not see the computed likelihood on the terminal.

I would be thankfull if you help me about this.

cosmomc: adding an extra parameter

Posted: June 23 2008
by Akhilesh Nautiyal(akhi)
Hi Olga,
Thanks a lot for your help. I successful added a parameter in power spectrum by reinterpreting w.

Regards,
Akhilesh

cosmomc: adding an extra parameter

Posted: June 08 2009
by marc vonlanthen
Hi all,

I saw the discussion about "how to add a new parameter in Cosmomc", and this is exactly what I need to do now. But I do not properly undersand what is meant by reinterpreting w as my new parameter. It would be very nice if someone could answer these questions :

Let's call my new parameter S.

1. define the new parameter in "Type CMBParams" of cmbtypes.f90, does it mean I have to add "real S" to the other parameters ?

2. Which are the files I need to change in CAMB ?

3. For changing the subroutine SetForH(Params,CMB,H0) and the subroutine CMBParamsToParams in params_CMB.f90, do I have to replace w by S or add a similar line with S instead of w.

Thank you for being very explicit in the answers, I am not used to fortran...

Thanks,

marc

cosmomc: adding an extra parameter

Posted: February 19 2016
by Abir Sarkar
Can't find CMBParamsToParams in the new version of CosmoMC. Has it been renamed or put somewhere else?

Re: cosmomc: adding an extra parameter

Posted: February 19 2016
by Antony Lewis
Yes, see CosmologyParameterizations.f90 for the new equivalent.

cosmomc: adding an extra parameter

Posted: March 04 2016
by Abir Sarkar
Hi Antony,

Thanks for the suggestion. I am currently using the October 2013 version of camb and cosmomc. In the params_CMB.f90 file there is a subroutine named "SetForH "which contains 15 slow parameters and the range of those parameters are given in params_CMB_defaults.ini file.

The .f90 file also contains a subroutine called "BK_ParamArrayToTheoryParams" where there are 7 background parameters. Where are the ranges of these 7 parameters defined?

Re: cosmomc: adding an extra parameter

Posted: March 04 2016
by Antony Lewis
I haven't used the background-only parameterization for while, so don't think an example .ini file is supplied. Just define the ranges for the parameters as you wish in a new .ini file (as in params_CMB_defaults.ini).

cosmomc: adding an extra parameter

Posted: August 18 2016
by Suresh Kumar India
Hi Antony,

I have modified CAMB by including a new parameter say myparam1 in the July 2015 version where it is doing fine. How can I make COSMOMC to read this new parameter correctly? Please write the file names and the changes to be made for the inclusion of the new parameter. I think this information should be included in the read me of COSMOMC. It would be of great help to the new users of COSMOMC.

Thanks.