COSMOMC generic mode - read file name from .ini file

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Russell W Johnston
Posts: 6
Joined: January 23 2014
Affiliation: University of the Western Cape

COSMOMC generic mode - read file name from .ini file

Post by Russell W Johnston » September 29 2014

Hey there

I am running the latest version of cosmomc using the generic sampler. I have a module that contains the likelihood and a subroutine to read in the data file.
This all works fine. However, what I would like to do now is be able to read the input data file name from my .ini file such that within the .ini file I would have e.g.

----
myinfile=pathtofile/data.dat
----

this is what I want to read from my module

this would allow me to run multiple instances of cosmomc mc for N-number of datasets without having to recompile each time.

within my module I'd like to use something like:
---
myinfile = ReadIniFileName(Ini,'myinfile')
---
however, this approach doesn't seem to work as it doesn't seem to connect with 'myinfile' in the .ini file. Is there a way to make this work?

cheers
russ

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

Re: COSMOMC generic mode - read file name from .ini file

Post by Antony Lewis » September 30 2014

With generic sampler your on your own for reading parameters etc. E.g. read your myinifile name in driver.F90 (using Ini%ReadFileName('myinifile')).

Or better make a function Myxxx_ReadParams(Ini) in your module, then call it from driver.F90.

Russell W Johnston
Posts: 6
Joined: January 23 2014
Affiliation: University of the Western Cape

Re: COSMOMC generic mode - read file name from .ini file

Post by Russell W Johnston » September 30 2014

Antony Lewis wrote:With generic sampler your on your own for reading parameters etc. E.g. read your myinifile name in driver.F90 (using Ini%ReadFileName('myinifile')).

Or better make a function Myxxx_ReadParams(Ini) in your module, then call it from driver.F90.
ah ok. thanks for the tip! :)

cheers
russ

Post Reply