cosmomc: adding an extra parameter

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Olga Mena
Posts: 9
Joined: April 03 2008
Affiliation: IEEC Bellaterra Spain

cosmomc: adding an extra parameter

Post by Olga Mena » May 31 2008

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!

Brian Powell
Posts: 18
Joined: August 08 2006
Affiliation: IPMU, U. of Tokyo

cosmomc: adding an extra parameter

Post by Brian Powell » June 06 2008

Olga --

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

Brian

Olga Mena
Posts: 9
Joined: April 03 2008
Affiliation: IEEC Bellaterra Spain

Re: cosmomc: adding an extra parameter

Post by Olga Mena » June 06 2008

Hi Brian!

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

Thanks a lot again!

Olga

Akhilesh Nautiyal(akhi)
Posts: 71
Joined: June 13 2007
Affiliation: Malaviya National Institute of Technology Jaipur

cosmomc: adding an extra parameter

Post by Akhilesh Nautiyal(akhi) » June 18 2008

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

Olga Mena
Posts: 9
Joined: April 03 2008
Affiliation: IEEC Bellaterra Spain

Re: cosmomc: adding an extra parameter

Post by Olga Mena » June 18 2008

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

moslem zarei
Posts: 28
Joined: March 11 2008
Affiliation: Isfahan University of Technology
Contact:

cosmomc: adding an extra parameter

Post by moslem zarei » June 20 2008

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

Pascal Vaudrevange
Posts: 50
Joined: March 26 2006
Affiliation: DESY
Contact:

cosmomc: adding an extra parameter

Post by Pascal Vaudrevange » June 20 2008

Hi Moslem,

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

Pascal

moslem zarei
Posts: 28
Joined: March 11 2008
Affiliation: Isfahan University of Technology
Contact:

cosmomc: adding an extra parameter

Post by moslem zarei » June 21 2008

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.

Akhilesh Nautiyal(akhi)
Posts: 71
Joined: June 13 2007
Affiliation: Malaviya National Institute of Technology Jaipur

cosmomc: adding an extra parameter

Post by Akhilesh Nautiyal(akhi) » June 23 2008

Hi Olga,
Thanks a lot for your help. I successful added a parameter in power spectrum by reinterpreting w.

Regards,
Akhilesh

marc vonlanthen
Posts: 11
Joined: May 29 2009
Affiliation: university of geneva

cosmomc: adding an extra parameter

Post by marc vonlanthen » June 08 2009

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

Abir Sarkar
Posts: 16
Joined: July 07 2014
Affiliation: Raman Research Institute

cosmomc: adding an extra parameter

Post by Abir Sarkar » February 19 2016

Can't find CMBParamsToParams in the new version of CosmoMC. Has it been renamed or put somewhere else?

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

Re: cosmomc: adding an extra parameter

Post by Antony Lewis » February 19 2016

Yes, see CosmologyParameterizations.f90 for the new equivalent.

Abir Sarkar
Posts: 16
Joined: July 07 2014
Affiliation: Raman Research Institute

cosmomc: adding an extra parameter

Post by Abir Sarkar » March 04 2016

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?

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

Re: cosmomc: adding an extra parameter

Post by Antony Lewis » March 04 2016

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).

Suresh Kumar India
Posts: 14
Joined: May 29 2015
Affiliation: BITS-Pilani, India

cosmomc: adding an extra parameter

Post by Suresh Kumar India » August 18 2016

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.

Post Reply