A pointer problem when add a new parameter

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Jiafeng Ding
Posts: 2
Joined: November 22 2019
Affiliation: Institute of theoretical physics,Chinese Academy of sciences

A pointer problem when add a new parameter

Post by Jiafeng Ding » July 22 2020

Dear all:
Hello, I am a beginner to use Cosmomc. I met some problems when I used Cosmomc. When I tried to add a new parameter ITP in Cosmomc, there was a error. I successfully compiled and run Camb, and Cosmomc was also compiled successfully. Then I used Cosmomc_debug to look for this error, result is shown as follow

Code: Select all

 forrtl: severe (173): A pointer passed to DEALLOCATE points to an object that cannot be deallocated 
  Image             PC         Routine             Line        Source             
cosmomc_debug      0000000000C9B19A  Unknown             Unknown        Unknown
cosmomc_debug      000000000045C514  generaltypes_mp_t       230         GeneralTypes.f90
cosmomc_debug      000000000045CBBD  generaltypes_mp_t       249         GeneralTypes.f90
cosmomc_debug      000000000050E469  montecarlo_mp_tme       291          MCMC.f90
cosmomc_debug      0000000000510851  montecarlo_mp_tfa       353          MCMC.f90
cosmomc_debug      000000000050999C  montecarlo_mp_tch       144          MCMC.f90
cosmomc_debug      0000000000563FD6  generalsetup_mp_t       139         GeneralSetup.f90
cosmomc_debug      00000000008214C5  MAIN__                         263          driver.F90
cosmomc_debug      0000000000411CDE  Unknown             Unknown        Unknown
libc-2.12.so        00000033F3E1ED5D  __libc_start_main     Unknown        Unknown
cosmomc_debug      0000000000411B69  Unknown             Unknown        Unknown
The files I changed were included
1.params_CMB.paramnames, where I add the new parameter ITP between fdm and logA,
2.CosmologyParameterization.f90, where I changed

Code: Select all

call this%SetTheoryParameterNumber(16,last_power_index)
to

Code: Select all

call this%SetTheoryParameterNumber(17,last_power_index)
and

Code: Select all

CMB%ITP=Params(17)
,
3.CosmologyType.f90, where I added

Code: Select all

real(mcp)::ITP

4.Calculator.f90, where I added

Code: Select all

P%ITP=CMB%ITP

I run CMAB well even though I added a new module in CAMB and I don't mention the change in CAMB, so the problem may be in Cosmomc. Through my effort, I think the problem is in driver.f90's 270 rank:

Code: Select all

call Setup%DoSampling(Params)

​There is a problem in "Params",but I don't know how to change. Thank you for any ways

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

Re: A pointer problem when add a new parameter

Post by Antony Lewis » July 22 2020

Are you using the master branch from github? (sounds a bit like fixed https://github.com/cmbant/CosmoMC/pull/31)

Jiafeng Ding
Posts: 2
Joined: November 22 2019
Affiliation: Institute of theoretical physics,Chinese Academy of sciences

Re: A pointer problem when add a new parameter

Post by Jiafeng Ding » July 22 2020

Thank you for your kind help. I find the problem is about the Makefile which I modified. Perhaps my understanding of the Makefile is not very well or the Makefile maybe need to be adjusted. With others' help,I use make clean before I used make to solve this problem. Thank you and best wishes.

Post Reply