CosmoCoffee Forum Index CosmoCoffee

 
 FAQFAQ   SearchSearch  MemberlistSmartFeed   MemberlistMemberlist    RegisterRegister 
   ProfileProfile   Log inLog in 
Arxiv New Filter | Bookmarks & clubs | Arxiv ref/author:

Correct way to call dtauda
 
Post new topic   Reply to topic    CosmoCoffee Forum Index -> Computers and software
View previous topic :: View next topic  
Author Message
Sunny Vagnozzi



Joined: 15 Aug 2016
Posts: 43
Affiliation: Oskar Klein Centre, Stockholm University

PostPosted: March 15 2018  Reply with quote

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:
  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:

    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:
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
Back to top
View user's profile  
Antony Lewis



Joined: 23 Sep 2004
Posts: 1332
Affiliation: University of Sussex

PostPosted: March 16 2018  Reply with quote

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

Calculator%Hofz_Hunit(z)

(see bao.f90 for an example).
Back to top
View user's profile [ Hidden ] Visit poster's website
Sunny Vagnozzi



Joined: 15 Aug 2016
Posts: 43
Affiliation: Oskar Klein Centre, Stockholm University

PostPosted: March 16 2018  Reply with quote

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

Cheers,
Sunny
Back to top
View user's profile  
Display posts from previous:   
Post new topic   Reply to topic    CosmoCoffee Forum Index -> Computers and software All times are GMT + 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group. Sponsored by WordWeb online dictionary and dictionary software.