Skip to content

Commit

Permalink
Added possibility to use total matter as a source of density perturba…
Browse files Browse the repository at this point in the history
…tions
  • Loading branch information
mraveri committed Aug 24, 2017
1 parent 777d362 commit 3d9b416
Show file tree
Hide file tree
Showing 12 changed files with 2,736 additions and 2,647 deletions.
5,296 changes: 2,655 additions & 2,641 deletions camb/camb/equations.f90

Large diffs are not rendered by default.

18 changes: 15 additions & 3 deletions camb/camb/equations_ppf.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1548,6 +1548,9 @@ subroutine output(EV,y, j,tau,sources)
real(dl), dimension(:),pointer :: ypol,ypolprime

real(dl) dgq,grhob_t,grhor_t,grhoc_t,grhog_t,grhov_t,sigma,polter
! COSMICFISH MOD START: total matter density for compatibility with other codes
real(dl) :: grho_matter, dgrho_matter
! COSMICFISH MOD END.
real(dl) qgdot,pigdot,pirdot,vbdot,dgrho
real(dl) a,a2,dz,z,clxc,clxb,vb,clxg,qg,pig,clxr,qr,pir

Expand Down Expand Up @@ -1859,8 +1862,19 @@ subroutine output(EV,y, j,tau,sources)

!Main density source
if (counts_density) then
! 1- Newtonian gauge count density; bias assumed to be on synchronous gauge CDM density
counts_density_source= W%wing(j)*(clxc*W%bias + (W%comoving_density_ev(j) - 3*adotoa)*sigma/k)
!Newtonian gauge count density; bias assumed to be on synchronous gauge CDM density
! COSMICFISH MOD START: total matter density for compatibility with other codes
if (counts_density_total_matter) then
! 2- Count density for total matter density, to compare to other codes:
grho_matter = grhob_t +grhoc_t
dgrho_matter = grhob_t*clxb +grhoc_t*clxc
if (CP%Num_Nu_Massive /= 0) then
call MassiveNuVarsOut(EV,y,yprime,a,grho=grho_matter,dgrho=dgrho_matter)
end if
counts_density_source= W%wing(j)*W%bias*( dgrho_matter/grho_matter )
end if
! COSMICFISH MOD END.
else
counts_density_source= 0
endif
Expand Down Expand Up @@ -2808,8 +2822,6 @@ subroutine derivs(EV,n,tau,ay,ayprime)
!end if
!



! CDM equation of motion
clxcdot=-k*z
ayprime(3)=clxcdot
Expand Down
3 changes: 3 additions & 0 deletions camb/camb/inidriver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ program driver

if (DoCounts) then
counts_density = Ini_read_Logical('counts_density')
! COSMICFISH MOD START: total matter density for compatibility with other codes
counts_density_total_matter = Ini_read_Logical( 'counts_density_total_matter', .false. )
! COSMICFISH MOD END.
counts_redshift = Ini_read_Logical('counts_redshift')
counts_radial = Ini_read_Logical('counts_radial')
counts_evolve = Ini_read_Logical('counts_evolve')
Expand Down
3 changes: 3 additions & 0 deletions camb/camb/modules.f90
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ module RedshiftSpaceData
logical :: counts_radial = .false. !does not include time delay;
! subset of counts_velocity, just 1/(chi*H) term
logical :: counts_density = .true.
! COSMICFISH MOD START: total matter density for compatibility with other codes
logical :: counts_density_total_matter = .false.
! COSMICFISH MOD END.
logical :: counts_redshift = .true.
logical :: counts_timedelay = .true. !time delay terms * 1/(H*chi)
logical :: counts_ISW = .true.
Expand Down
16 changes: 15 additions & 1 deletion camb/eftcamb/equations.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1391,6 +1391,9 @@ subroutine output(EV,y, j,tau,sources)
real(dl), dimension(:),pointer :: ypol,ypolprime

real(dl) dgq,grhob_t,grhor_t,grhoc_t,grhog_t,grhov_t,sigma,polter
! COSMICFISH MOD START: total matter density for compatibility with other codes
real(dl) :: grho_matter, dgrho_matter
! COSMICFISH MOD END.
real(dl) qgdot,pigdot,pirdot,vbdot,dgrho
real(dl) a,a2,dz,z,clxc,clxb,vb,clxg,qg,pig,clxr,qr,pir

Expand Down Expand Up @@ -1686,8 +1689,19 @@ subroutine output(EV,y, j,tau,sources)

!Main density source
if (counts_density) then
! 1- Newtonian gauge count density; bias assumed to be on synchronous gauge CDM density
counts_density_source= W%wing(j)*(clxc*W%bias + (W%comoving_density_ev(j) - 3*adotoa)*sigma/k)
!Newtonian gauge count density; bias assumed to be on synchronous gauge CDM density
! COSMICFISH MOD START: total matter density for compatibility with other codes
if (counts_density_total_matter) then
! 2- Count density for total matter density, to compare to other codes:
grho_matter = grhob_t +grhoc_t
dgrho_matter = grhob_t*clxb +grhoc_t*clxc
if (CP%Num_Nu_Massive /= 0) then
call MassiveNuVarsOut(EV,y,yprime,a,grho=grho_matter,dgrho=dgrho_matter)
end if
counts_density_source= W%wing(j)*W%bias*( dgrho_matter/grho_matter )
end if
! COSMICFISH MOD END.
else
counts_density_source= 0
endif
Expand Down
16 changes: 15 additions & 1 deletion camb/eftcamb/equations_EFT.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1512,6 +1512,9 @@ subroutine output(EV,y, j,tau,sources)
real(dl), dimension(:),pointer :: ypol,ypolprime

real(dl) dgq,grhob_t,grhor_t,grhoc_t,grhog_t,grhov_t,sigma,polter
! COSMICFISH MOD START: total matter density for compatibility with other codes
real(dl) :: grho_matter, dgrho_matter
! COSMICFISH MOD END.
real(dl) qgdot,pigdot,pirdot,vbdot,dgrho
real(dl) a,a2,dz,z,clxc,clxb,vb,clxg,qg,pig,clxr,qr,pir

Expand Down Expand Up @@ -2196,8 +2199,19 @@ subroutine output(EV,y, j,tau,sources)

!Main density source
if (counts_density) then
! 1- Newtonian gauge count density; bias assumed to be on synchronous gauge CDM density
counts_density_source= W%wing(j)*(clxc*W%bias + (W%comoving_density_ev(j) - 3*adotoa)*sigma/k)
!Newtonian gauge count density; bias assumed to be on synchronous gauge CDM density
! COSMICFISH MOD START: total matter density for compatibility with other codes
if (counts_density_total_matter) then
! 2- Count density for total matter density, to compare to other codes:
grho_matter = grhob_t +grhoc_t
dgrho_matter = grhob_t*clxb +grhoc_t*clxc
if (CP%Num_Nu_Massive /= 0) then
call MassiveNuVarsOut(EV,y,yprime,a,grho=grho_matter,dgrho=dgrho_matter)
end if
counts_density_source= W%wing(j)*W%bias*( dgrho_matter/grho_matter )
end if
! COSMICFISH MOD END.
else
counts_density_source= 0
endif
Expand Down
3 changes: 3 additions & 0 deletions camb/eftcamb/inidriver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ program driver

if (DoCounts) then
counts_density = Ini_read_Logical('counts_density')
! COSMICFISH MOD START: total matter density for compatibility with other codes
counts_density_total_matter = Ini_read_Logical( 'counts_density_total_matter', .false. )
! COSMICFISH MOD END.
counts_redshift = Ini_read_Logical('counts_redshift')
counts_radial = Ini_read_Logical('counts_radial')
counts_evolve = Ini_read_Logical('counts_evolve')
Expand Down
3 changes: 3 additions & 0 deletions camb/eftcamb/modules.f90
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ module RedshiftSpaceData
logical :: counts_radial = .false. !does not include time delay;
! subset of counts_velocity, just 1/(chi*H) term
logical :: counts_density = .true.
! COSMICFISH MOD START: total matter density for compatibility with other codes
logical :: counts_density_total_matter = .false.
! COSMICFISH MOD END.
logical :: counts_redshift = .true.
logical :: counts_timedelay = .true. !time delay terms * 1/(H*chi)
logical :: counts_ISW = .true.
Expand Down
16 changes: 15 additions & 1 deletion camb/mgcamb/equations.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1923,6 +1923,9 @@ subroutine output(EV,y, j,tau,sources)
real(dl), dimension(:),pointer :: ypol,ypolprime

real(dl) dgq,grhob_t,grhor_t,grhoc_t,grhog_t,grhov_t,sigma,polter
! COSMICFISH MOD START: total matter density for compatibility with other codes
real(dl) :: grho_matter, dgrho_matter
! COSMICFISH MOD END.
real(dl) qgdot,pigdot,pirdot,vbdot,dgrho
real(dl) a,a2,dz,z,clxc,clxb,vb,clxg,qg,pig,clxr,qr,pir

Expand Down Expand Up @@ -2422,8 +2425,19 @@ subroutine output(EV,y, j,tau,sources)
end if
!Main density source
if (counts_density) then
! 1- Newtonian gauge count density; bias assumed to be on synchronous gauge CDM density
counts_density_source= W%wing(j)*(clxc*W%bias + (W%comoving_density_ev(j) - 3*adotoa)*sigma/k)
!Newtonian gauge count density; bias assumed to be on synchronous gauge CDM density
! COSMICFISH MOD START: total matter density for compatibility with other codes
if (counts_density_total_matter) then
! 2- Count density for total matter density, to compare to other codes:
grho_matter = grhob_t +grhoc_t
dgrho_matter = grhob_t*clxb +grhoc_t*clxc
if (CP%Num_Nu_Massive /= 0) then
call MassiveNuVarsOut(EV,y,yprime,a,grho=grho_matter,dgrho=dgrho_matter)
end if
counts_density_source= W%wing(j)*W%bias*( dgrho_matter/grho_matter )
end if
! COSMICFISH MOD END.
else
counts_density_source= 0
endif
Expand Down
3 changes: 3 additions & 0 deletions camb/mgcamb/inidriver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ program driver

if (DoCounts) then
counts_density = Ini_read_Logical('counts_density')
! COSMICFISH MOD START: total matter density for compatibility with other codes
counts_density_total_matter = Ini_read_Logical( 'counts_density_total_matter', .false. )
! COSMICFISH MOD END.
counts_redshift = Ini_read_Logical('counts_redshift')
counts_radial = Ini_read_Logical('counts_radial')
counts_evolve = Ini_read_Logical('counts_evolve')
Expand Down
3 changes: 3 additions & 0 deletions camb/mgcamb/modules.f90
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ module RedshiftSpaceData
logical :: counts_radial = .false. !does not include time delay;
! subset of counts_velocity, just 1/(chi*H) term
logical :: counts_density = .true.
! COSMICFISH MOD START: total matter density for compatibility with other codes
logical :: counts_density_total_matter = .false.
! COSMICFISH MOD END.
logical :: counts_redshift = .true.
logical :: counts_timedelay = .true. !time delay terms * 1/(H*chi)
logical :: counts_ISW = .true.
Expand Down
3 changes: 3 additions & 0 deletions sources/005_init_from_file.f90
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ subroutine init_cosmicfish_from_file( P, FP, filename, param_out_name )

if (DoCounts) then
counts_density = Ini_read_Logical('counts_density')
! COSMICFISH MOD START: total matter density for compatibility with other codes
counts_density_total_matter = Ini_read_Logical( 'counts_density_total_matter', .false. )
! COSMICFISH MOD END.
counts_redshift = Ini_read_Logical('counts_redshift')
counts_radial = Ini_read_Logical('counts_radial')
counts_evolve = Ini_read_Logical('counts_evolve')
Expand Down

0 comments on commit 3d9b416

Please sign in to comment.