cmbant / CAMB

Code for Anisotropies in the Microwave Background
https://camb.info/
Other
201 stars 148 forks source link

Chains with Cobaya are stopping due to omega de<0 #119

Closed diogohf closed 2 years ago

diogohf commented 2 years ago

Hi A. Lewis I'm a Ph.D. student at the Institute For Theoretical Physics at the University of State of São Paulo. I'm working in collaboration with Vivian Miranda, Rogério Rosenfeld, and others. 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:

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.

cmbant commented 2 years ago

You may need to also "return" at that point? Closing as this is not a bug in the main camb code. (probably better asked on CosmoCoffee)