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
COSMOMC generic mode - read file name from .ini file
-
- Posts: 6
- Joined: January 23 2014
- Affiliation: University of the Western Cape
-
- Posts: 1941
- Joined: September 23 2004
- Affiliation: University of Sussex
- Contact:
Re: COSMOMC generic mode - read file name from .ini file
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.
Or better make a function Myxxx_ReadParams(Ini) in your module, then call it from driver.F90.
-
- Posts: 6
- Joined: January 23 2014
- Affiliation: University of the Western Cape
Re: COSMOMC generic mode - read file name from .ini file
ah ok. thanks for the tip! :)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.
cheers
russ