camb halofit.f90 non-convergence error catch

Use of Healpix, camb, CLASS, cosmomc, compilers, etc.
Post Reply
Angela Chen
Posts: 24
Joined: January 11 2019
Affiliation: University of Michigan

camb halofit.f90 non-convergence error catch

Post by Angela Chen » January 30 2020

Hi Antony,

My MCMC chain involving modified camb freezes from time to time when turning halofit nonlinear correction for the lensing potential power on. I looked into the halofit.f90 file, and it seems to me that the problem is that for some extension model predicted non-standard linear matter power spectrum, halofit.f90 could run into non-converging situations and this kind of errors was not captured by the program. My question is, could I use the GlobalError defined in config.f90 followed by return to raise non-converging problem to mpirun? Specifically, I'm thinking about replacing all the "stop" by "GlobalError(message,halofit_error) \n return", and set a maximum iteration cap ~1000 to the do loop in the subroutine NonLinear_GetNonLinRatios.

best,
Angela

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

Re: camb halofit.f90 non-convergence error catch

Post by Antony Lewis » January 30 2020

That could work (I assume you are using Takahashi, not HMCode). What's happening to xlogr1 and xlogr2?

Angela Chen
Posts: 24
Joined: January 11 2019
Affiliation: University of Michigan

Re: camb halofit.f90 non-convergence error catch

Post by Angela Chen » January 31 2020

Antony Lewis wrote:
January 30 2020
That could work (I assume you are using Takahashi, not HMCode). What's happening to xlogr1 and xlogr2?
sorry I'm not sure, didn't out put xlogr2 value when running the chains. If it was stuck in that loop, I guess it never dropped under -2, but I don't know exactly what was happening.

Angela Chen
Posts: 24
Joined: January 11 2019
Affiliation: University of Michigan

Re: camb halofit.f90 non-convergence error catch

Post by Angela Chen » February 13 2020

Antony Lewis wrote:
January 30 2020
That could work (I assume you are using Takahashi, not HMCode). What's happening to xlogr1 and xlogr2?
It seems to me that for some extreme parameters of my extension model, sigma(r) is too large (between 1-2) and xlogr2 never converges.

Post Reply