From c154571cea890a20d1d29ff3ee73fc180677544b Mon Sep 17 00:00:00 2001 From: Antony Lewis Date: Fri, 14 Jun 2024 15:38:46 +0100 Subject: [PATCH] change PPF switch parameter to give closer to fluid model in extreme modes; changes results, but very similar near LCDM --- camb/__init__.py | 2 +- camb/dark_energy.py | 4 ++-- fortran/DarkEnergyPPF.f90 | 4 +++- fortran/config.f90 | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/camb/__init__.py b/camb/__init__.py index 54450a67..a248a773 100644 --- a/camb/__init__.py +++ b/camb/__init__.py @@ -7,7 +7,7 @@ __author__ = "Antony Lewis" __contact__ = "antony at cosmologist dot info" __url__ = "https://camb.readthedocs.io" -__version__ = "1.5.5" +__version__ = "1.5.6" from . import baseconfig diff --git a/camb/dark_energy.py b/camb/dark_energy.py index ebd1c4de..d632252b 100644 --- a/camb/dark_energy.py +++ b/camb/dark_energy.py @@ -113,8 +113,8 @@ class DarkEnergyPPF(DarkEnergyEqnOfState): (`arXiv:0808.3125 `_) Use inherited methods to set parameters or interpolation table. - Note PPF is not a physical model and just designed to allow crossing -1 in an ad hoc way. For models - with w>-1 but far from cosmological constant, it can give quite different answers to the well-defined fluid model. + Note PPF is not a physical model and just designed to allow crossing -1 in an ad hoc smooth way. For models + with w>-1 but far from cosmological constant, it can give quite different answers to the fluid model with c_s^2=1. """ # cannot declare c_Gamma_ppf directly here as have not defined all fields in DarkEnergyEqnOfState (TCubicSpline) diff --git a/fortran/DarkEnergyPPF.f90 b/fortran/DarkEnergyPPF.f90 index 53b0511e..febe568c 100644 --- a/fortran/DarkEnergyPPF.f90 +++ b/fortran/DarkEnergyPPF.f90 @@ -129,7 +129,9 @@ subroutine TDarkEnergyPPF_PerturbedStressEnergy(this, dgrhoe, dgqe, & S_Gamma = grhov_t * (1 + w) * (vT + sigma) * k / adotoa / 2._dl / k2 ckH = this%c_Gamma_ppf * k / adotoa - if (ckH * ckH .gt. 3.d1) then ! ckH^2 > 30 ????????? + if (ckH * ckH > 1000) then + ! Was ckH^2 > 30 originally, but this is better behaved (closer to fluid) + ! for some extreme models (thanks Yanhui Yang, Simeon Bird 2024) Gamma = 0 Gammadot = 0.d0 else diff --git a/fortran/config.f90 b/fortran/config.f90 index 7f56d42e..c6016348 100644 --- a/fortran/config.f90 +++ b/fortran/config.f90 @@ -3,7 +3,7 @@ module config use constants, only: const_twopi implicit none - character(LEN=*), parameter :: version = '1.5.5' + character(LEN=*), parameter :: version = '1.5.6' integer :: FeedbackLevel = 0 !if >0 print out useful information about the model