Page 1 of 1

camb halofit.f90 non-convergence error catch

Posted: January 30 2020
by Angela Chen
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

Re: camb halofit.f90 non-convergence error catch

Posted: January 30 2020
by Antony Lewis
That could work (I assume you are using Takahashi, not HMCode). What's happening to xlogr1 and xlogr2?

Re: camb halofit.f90 non-convergence error catch

Posted: January 31 2020
by Angela Chen
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.

Re: camb halofit.f90 non-convergence error catch

Posted: February 13 2020
by Angela Chen
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.