Chains with Cobaya are stopping due to omega_de<0

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Diogo Souza
Posts: 3
Joined: July 01 2022
Affiliation: IFT UNESP

Chains with Cobaya are stopping due to omega_de<0

Post by Diogo Souza » July 01 2022

Hello,
I modified CAMB to model the Dark Energy as a scalar field, and then I included some specific potentials in the module DarkEnergyQuintessence.f90. However, I hit on a problem that I can't solve and I'm wondering if you have some hints about this.

When running some chains with Cobaya, after some steps in the MCMC computation, the chains are frequently stopping because the code obtains a small but a negative value for omega_de. For example, the last I obtained was omega_de = -6.9014583878874115E-003.
To try to overcome this problem, I used the GlobalError after the lines where omega_de is computed, which are the lines 457 and 458 of https://github.com/cmbant/CAMB/blob/master/fortran/results.f90. Then, below the line 458 I inserted the following exception:

Code: Select all

if (this%Omega_de<0) then 
    call GlobalError('Exception: Omega_de < 0')
end if
However, when running the chain again with this new modification does not solve this problem, and the chain crashed again due to the same problem. How to solve this issue? Is there a way to catch and ignore the cases where omega_de<0 without stopping the MCMC process? Thanks in advance.
Edit: I also used the flag stop_at_error: False on my .yaml, but the problem persists. Probably I incorrectly raised the above exception, if so how can I correctly raise the exception to be catched by the flag stop_at_error: False?

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

Re: Chains with Cobaya are stopping due to omega_de<0

Post by Antony Lewis » July 02 2022

GlobalError does not raise an exception (you can't do exceptions in Fortran) - you need to then exit the subroutine as cleanly as you can after setting it.

Post Reply