diff --git a/.travis.yml b/.travis.yml index 96f6f73b..ae6d8279 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,12 +37,6 @@ jobs: - PYDIST="ANACONDA" - FORTRAN="test" python: "3.9" - - name: "Ubuntu 18.04 + Python 3.6" - addons: - apt: - packages: - - gfortran - python: "3.6" - name: "Ubuntu 20.04 + Python 3.8" dist: focal addons: diff --git a/camb/cambdll.dll b/camb/cambdll.dll index 44e03d56..42cbe24d 100644 Binary files a/camb/cambdll.dll and b/camb/cambdll.dll differ diff --git a/camb/dark_energy.py b/camb/dark_energy.py index 6da78622..d3ef5036 100644 --- a/camb/dark_energy.py +++ b/camb/dark_energy.py @@ -51,6 +51,10 @@ def set_params(self, w=-1.0, wa=0, cs2=1.0): self.cs2 = cs2 self.validate_params() + def validate_params(self): + if not self.use_tabulated_w and self.wa + self.w > 0: + raise CAMBError('dark energy model has w + wa > 0, giving w>0 at high redshift') + def set_w_a_table(self, a, w): """ Set w(a) from numerical values (used as cublic spline). Note this is quite slow. @@ -80,8 +84,10 @@ class DarkEnergyFluid(DarkEnergyEqnOfState): _fortran_class_name_ = 'TDarkEnergyFluid' def validate_params(self): - if not self.use_tabulated_w and self.wa and (self.w < -1 - 1e-6 or 1 + self.w + self.wa < - 1e-6): - raise CAMBError('fluid dark energy model does not support w crossing -1') + super().validate_params() + if not self.use_tabulated_w: + if self.wa and (self.w < -1 - 1e-6 or 1 + self.w + self.wa < - 1e-6): + raise CAMBError('fluid dark energy model does not support w crossing -1') @fortran_class diff --git a/fortran/DarkEnergyInterface.f90 b/fortran/DarkEnergyInterface.f90 index d7b6742e..671176aa 100644 --- a/fortran/DarkEnergyInterface.f90 +++ b/fortran/DarkEnergyInterface.f90 @@ -260,6 +260,10 @@ subroutine TDarkEnergyEqnOfState_ReadParams(this, Ini) if(.not. this%use_tabulated_w)then this%w_lam = Ini%Read_Double('w', -1.d0) this%wa = Ini%Read_Double('wa', 0.d0) + ! trap dark energy becoming important at high redshift + ! (will still work if this test is removed in some cases) + if (this%w_lam + this%wa > 0) & + error stop 'w + wa > 0, giving w>0 at high redshift' else call File%LoadTxt(Ini%Read_String('wafile'), table) call this%SetwTable(table(:,1),table(:,2), size(table(:,1))) diff --git a/fortran/cmbmain.f90 b/fortran/cmbmain.f90 index 8939ac0a..9ddba817 100644 --- a/fortran/cmbmain.f90 +++ b/fortran/cmbmain.f90 @@ -100,7 +100,7 @@ module CAMBmain integer maximum_l !Max value of l to compute real(dl) :: maximum_qeta = 3000._dl - integer :: l_smooth_sample = 3000 !assume transfer functions effectively small for k>2*l_smooth_sample + integer :: l_smooth_sample = 3000 !assume transfer functions effectively small for k*chi0>2*l_smooth_sample integer :: max_bessels_l_index = 1000000 real(dl) :: max_bessels_etak = 1000000*2 @@ -874,6 +874,7 @@ subroutine SetkValuesForSources q_cmb = 2*l_smooth_sample/State%chi0*SourceAccuracyBoost !assume everything is smooth at l > l_smooth_sample if (CP%Want_CMB .and. maximum_l > 5000 .and. CP%Accuracy%AccuratePolarization) q_cmb = q_cmb*1.4 + q_cmb = max(q_switch*2, q_cmb) !prevent EE going wild in tail dksmooth = q_cmb/2/(SourceAccuracyBoost)**2 if (CP%Want_CMB) dksmooth = dksmooth/6 @@ -881,7 +882,8 @@ subroutine SetkValuesForSources associate(Evolve_q => ThisSources%Evolve_q) call Evolve_q%Init() call Evolve_q%Add_delta(qmin, qmax_log, dlnk0, IsLog = .true.) - call Evolve_q%Add_delta(qmax_log, min(qmax,q_switch), dkn1) + if (qmax > qmax_log) & + call Evolve_q%Add_delta(qmax_log, min(qmax,q_switch), dkn1) if (qmax > q_switch) then call Evolve_q%Add_delta(q_switch, min(q_cmb,qmax), dkn2) if (qmax > q_cmb) then diff --git a/setup.py b/setup.py index 5d4b8895..174c7fec 100644 --- a/setup.py +++ b/setup.py @@ -299,12 +299,11 @@ def run(self): 'Intended Audience :: Science/Research', 'Topic :: Scientific/Engineering :: Astronomy', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9' ], keywords=['cosmology', 'CAMB', 'CMB'], install_requires=['scipy>=1.0', 'sympy>=1.0'], - python_requires='>=3.6' + python_requires='>=3.7' )