Background modification for CAMB-1.1.3

Use of Healpix, camb, CLASS, cosmomc, compilers, etc.
Post Reply
srijita sinha
Posts: 21
Joined: April 12 2019
Affiliation: Indian Institute of Science Education and Research Kolkata

Background modification for CAMB-1.1.3

Post by srijita sinha » September 11 2020

Hi,

I want to evolve the background energy density using the background values grhoc, grhob etc.

BackgroundDensityAndPressure in DarkEnergyInterface cannot use these quantities. How do I solve the problem?

Previously I used to write a separate module like LambdaGeneral and call that in Init_background.

How do I keep the module intact and use it as an alternate fluid? Is it possible in the present file structure?

Thanks in advance.

Srijita

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

Re: Background modification for CAMB-1.1.3

Post by Antony Lewis » September 14 2020

Calculate and save what you need in the Init method, which is passed the current State. There's a complete non-trivial quintessence example (for early dark energy) at
https://github.com/cmbant/CAMB/blob/quintessence/fortran/DarkEnergyQuintessence.f90

srijita sinha
Posts: 21
Joined: April 12 2019
Affiliation: Indian Institute of Science Education and Research Kolkata

Re: Background modification for CAMB-1.1.3

Post by srijita sinha » September 14 2020

Thanks a lot.

I missed this update.

srijita sinha
Posts: 21
Joined: April 12 2019
Affiliation: Indian Institute of Science Education and Research Kolkata

Re: Background modification for CAMB-1.1.3

Post by srijita sinha » September 22 2020

Hi

How can I use this CosmoMC May 2020?
  1. changed the default 'ppf' to quintessence in subroutine CAMBCalc_ReadParams in Calculator_CAMB.f90

Code: Select all

this%dark_energy_model = Ini%Read_String_Default('dark_energy_model','quintessence')
  • added use DarkEnergyQuintessence in subroutine CAMBCalc_InitCAMBParams in Calculator_CAMB.f90
  • added

    Code: Select all

        else if (this%dark_energy_model == 'quintessence') then
            if (allocated(P%DarkEnergy)) deallocate(P%DarkEnergy)
            allocate (TQuintessence::P%DarkEnergy)
    
    in Calculator_CAMB.f90
It shows the error

Code: Select all

forrtl: severe (173): A pointer passed to DEALLOCATE points to an object that cannot be deallocated
.

What to do?
I must be very trivial and I must be missing something! Any help is appreciated.

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

Re: Background modification for CAMB-1.1.3

Post by Antony Lewis » September 23 2020

Not sure, but TQuintessence is intended to be an abstract base class - it does not actually implement a specific potential. The TEarlyQuintessence should be a working example, though I've not tested it with CosmoMC.

srijita sinha
Posts: 21
Joined: April 12 2019
Affiliation: Indian Institute of Science Education and Research Kolkata

Re: Background modification for CAMB-1.1.3

Post by srijita sinha » September 24 2020

I added the potential and everything under TQuintessence. That is working fine in CAMB only. But used in CosmoMC, it gives segmentation error after

Code: Select all

27 parameters ( 6 slow ( 0 semi-slow), 21 fast ( 0 semi-fast))
starting Monte-Carlo
I did not add any new parameter, but I did not remove w and wa from params_CMB_defaults and CosmologyParametrizations.f90

I also added

Code: Select all

class is (TDarkEnergyModel)
subroutine CAMBCalc_CMBToCAMB to a/c for TQuintessence.

Cannot think of any other modifications.

Thanks

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

Re: Background modification for CAMB-1.1.3

Post by Antony Lewis » September 28 2020

Build and run cosmomc_debug and try to figure out where the error is coming from.

srijita sinha
Posts: 21
Joined: April 12 2019
Affiliation: Indian Institute of Science Education and Research Kolkata

Re: Background modification for CAMB-1.1.3

Post by srijita sinha » September 29 2020

I did the cosmomc_debug and the errors are as follows:

Code: Select all

[narayan@dirac CosmoMC2]$ ./cosmomc_debug test_planck.ini >new.log 
forrtl: severe (173): A pointer passed to DEALLOCATE points to an object that cannot be deallocated
Image              PC                Routine            Line        Source             
cosmomc_debug      0000000000CC3CEA  Unknown               Unknown  Unknown
cosmomc_debug      000000000045AA94  generaltypes_mp_t         230  GeneralTypes.f90
cosmomc_debug      000000000045B13D  generaltypes_mp_t         249  GeneralTypes.f90
cosmomc_debug      000000000050C34B  montecarlo_mp_tme         303  MCMC.f90
cosmomc_debug      000000000050E733  montecarlo_mp_tfa         365  MCMC.f90
cosmomc_debug      0000000000507744  montecarlo_mp_tch         145  MCMC.f90
cosmomc_debug      0000000000561ED2  generalsetup_mp_t         139  GeneralSetup.f90
cosmomc_debug      000000000082C4C9  MAIN__                    270  driver.F90
cosmomc_debug      000000000041025E  Unknown               Unknown  Unknown
libc-2.17.so       00007F974A8D1505  __libc_start_main     Unknown  Unknown
cosmomc_debug      0000000000410169  Unknown               Unknown  Unknown

Now I am at complete loss! I am attaching the log file as zipped txt.
new.txt.zip
(1.26 KiB) Downloaded 6 times
I removed

Code: Select all

w_lam
and

Code: Select all

w0
from params_CMB_defaults and CosmologyParametrizations.f90

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

Re: Background modification for CAMB-1.1.3

Post by Antony Lewis » September 30 2020

Is this with the latest master Cosmomc from github?

srijita sinha
Posts: 21
Joined: April 12 2019
Affiliation: Indian Institute of Science Education and Research Kolkata

Re: Background modification for CAMB-1.1.3

Post by srijita sinha » September 30 2020

It is cosmomc May 2020, the update that came on 12/05/2020. Made cosmomc_debug in the CosmoMC master from github and the errors increased in number.
log.zip
(3.01 KiB) Downloaded 5 times
contains the error for minimization and MCMC.

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

Re: Background modification for CAMB-1.1.3

Post by Antony Lewis » October 02 2020

Please try the latest master.

Saisandri Saini
Posts: 2
Joined: February 13 2020
Affiliation: MHRD

Re: Background modification for CAMB-1.1.3

Post by Saisandri Saini » October 02 2020

Hi
How can I modify latest the version of CAMB with modechord. how can i write those modules which are not in both camb and modechord.
Last edited by Saisandri Saini on October 04 2020, edited 2 times in total.

srijita sinha
Posts: 21
Joined: April 12 2019
Affiliation: Indian Institute of Science Education and Research Kolkata

Re: Background modification for CAMB-1.1.3

Post by srijita sinha » October 02 2020

Antony Lewis wrote:
October 02 2020
Please try the latest master.
Latest master means
https://github.com/cmbant/CosmoMC? Released in June 29?
I did but did not help. I will try again.

srijita sinha
Posts: 21
Joined: April 12 2019
Affiliation: Indian Institute of Science Education and Research Kolkata

Re: Background modification for CAMB-1.1.3

Post by srijita sinha » October 06 2020

I am not finding any luck here. But I have a general question.

I changed the declaration of w_lam and w from TDarkEnergyEqnOfState to TDarkEnergyModel in DarkEnergyInterface and that

Code: Select all

     select type(DE => P%DarkEnergy)
          class is (TDarkEnergyEqnOfState)
                   DE%w_lam = CMB%w
                   DE%wa = CMB%wa
                   
to

Code: Select all

select type(DE => P%DarkEnergy)
          class is (TDarkEnergyModel)
                   DE%w_lam = CMB%w
                   DE%wa = CMB%wa
in source/Calculator_CAMB.f90 and the same errors came for fluid model (which was working pretty fine previosly). The parameters are read fine the ini file in batch3.

Why did that happen? Any reply would be helpful.

Post Reply