Correct way to call dtauda

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Sunny Vagnozzi
Posts: 55
Joined: August 15 2016
Affiliation: Kavli Institute for Cosmology (KICC), University of Cambridge

Correct way to call dtauda

Post by Sunny Vagnozzi » March 15 2018

Hi Antony et al,

I am writing a likelihood where I need to call H(z) at different redshifts, which from my understanding can be easily done using the function dtauda provided by CAMB.

However, I am getting some problems. Whatever argument I give to dtauda, it always returns the same value, 463506.174001024 . For instance, dtauda(1.0) = 463506.174001024, dtauda(0.5) = 463506.174001024, and so on.

In my likelihood (called CC), I am using the following modules

Code: Select all

  module CC
    use settings
    use CosmologyTypes
    use CosmoTheory
    use Calculator_CAMB
    use Calculator_Cosmology
    use Likelihood_Cosmology
    use CAMB
Then, I create the function CC_LnLike where dtauda is "defined"

Code: Select all

    real(mcp) function CC_LnLike(this, CMB)
    Class(CCLikelihood) :: this
    Class(CMBParams) CMB
    real(mcp):: chisq
    real(dl) :: dtauda
    external dtauda
and in source/Makefile, I have added the following two lines

Code: Select all

DATAMODULES += $(OUTPUT_DIR)/CC.o
[...]
$(OUTPUT_DIR)/CC.o: $(OUTPUT_DIR)/Calculator_CAMB.o $(OUTPUT_DIR)/Calculator_Cosmology.o $(OUTPUT_DIR)/CosmoTheory.o $(OUTPUT_DIR)/CosmologyTypes.o $(OUTPUT_DIR)/Likelihood_Cosmology.o
Does anyone have any idea where the mistake in calling dtauda might be?

Cheers,
Sunny

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

Re: Correct way to call dtauda

Post by Antony Lewis » March 16 2018

If you are using cosmomc, just use the cosmomc calculator wrapper functions, eg.

Calculator%Hofz_Hunit(z)

(see bao.f90 for an example).

Sunny Vagnozzi
Posts: 55
Joined: August 15 2016
Affiliation: Kavli Institute for Cosmology (KICC), University of Cambridge

Correct way to call dtauda

Post by Sunny Vagnozzi » March 16 2018

Thanks Antony! In fact I ended up doing that and it works.

Cheers,
Sunny

Post Reply