From a58c8b732aaa197f5613cf45b88b12bb0f5d456f Mon Sep 17 00:00:00 2001 From: Alexander Mead Date: Tue, 10 Jan 2023 18:05:27 +0000 Subject: [PATCH] fix for HMcode-2020 feedback at low k (#136) * fix for HMcode-2020 feedback at low j * comment documenting the fix --- .gitignore | 1 + fortran/halofit.f90 | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 64cc4355..7c066c5c 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ Advisor/ Inspector/ .ipynb_checkpoints camb/HighLExtrapTemplate_lenspotentialCls.dat +.vscode/ diff --git a/fortran/halofit.f90 b/fortran/halofit.f90 index 6aa2c340..94cf85b2 100644 --- a/fortran/halofit.f90 +++ b/fortran/halofit.f90 @@ -42,6 +42,7 @@ !AL Jul 19: Speedups, use linear interpolation for pk; find index using fixed spacing; precompute growth(z) !AL Sep 19: Propagate errors rather than stop, decrease jmax for integration time out (prevent very slow error) !AM Sep 20: Added HMcode-2020 model + !AM Jan 23: Fixed HMcode-2020 feedback low-k predictions !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% module NonLinear @@ -734,14 +735,14 @@ FUNCTION kstar(this,lut) REAL(dl) :: kstar TYPE(HM_tables), INTENT(IN) :: lut - IF(this%imead==0 .OR. this%imead==4 .OR. this%imead==5) THEN + IF(this%imead==0) THEN !Set to zero for the standard Poisson one-halo term kstar=0. ELSE IF(this%imead==1 .or. this%imead==2) THEN !One-halo cut-off wavenumber !Mead et al. (2015; arXiv 1505.07833) value kstar=0.584*(lut%sigv)**(-1.) - ELSE IF(this%imead==3) THEN + ELSE IF(this%imead==3 .OR. this%imead==4 .OR. this%imead==5) THEN kstar=0.05618*lut%sig8z_cold**(-1.013) END IF @@ -1759,7 +1760,7 @@ FUNCTION p_1h(this,k,lut,cosm) END IF !Damping of the one-halo term at very large scales p_1h=p_1h*(1.-fac) - ELSE IF(this%imead==3) THEN + ELSE IF(this%imead==3 .OR. this%imead==4 .OR. this%imead==5) THEN ks=this%kstar(lut) x=(k/ks)**4 p_1h=p_1h*x/(1.+x)