Page 1 of 1

Background modification for CAMB-1.1.3

Posted: September 11 2020
by srijita sinha
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

Re: Background modification for CAMB-1.1.3

Posted: September 14 2020
by Antony Lewis
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

Re: Background modification for CAMB-1.1.3

Posted: September 14 2020
by srijita sinha
Thanks a lot.

I missed this update.

Re: Background modification for CAMB-1.1.3

Posted: September 22 2020
by srijita sinha
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.

Re: Background modification for CAMB-1.1.3

Posted: September 23 2020
by Antony Lewis
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.

Re: Background modification for CAMB-1.1.3

Posted: September 24 2020
by srijita sinha
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

Re: Background modification for CAMB-1.1.3

Posted: September 28 2020
by Antony Lewis
Build and run cosmomc_debug and try to figure out where the error is coming from.

Re: Background modification for CAMB-1.1.3

Posted: September 29 2020
by srijita sinha
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 201 times
I removed

Code: Select all

w_lam
and

Code: Select all

w0
from params_CMB_defaults and CosmologyParametrizations.f90

Re: Background modification for CAMB-1.1.3

Posted: September 30 2020
by Antony Lewis
Is this with the latest master Cosmomc from github?

Re: Background modification for CAMB-1.1.3

Posted: September 30 2020
by srijita sinha
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 213 times
contains the error for minimization and MCMC.

Re: Background modification for CAMB-1.1.3

Posted: October 02 2020
by Antony Lewis
Please try the latest master.

Re: Background modification for CAMB-1.1.3

Posted: October 02 2020
by Saisandri Saini
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.

Re: Background modification for CAMB-1.1.3

Posted: October 02 2020
by srijita sinha
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.

Re: Background modification for CAMB-1.1.3

Posted: October 06 2020
by srijita sinha
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.