From 786da254acb46a444dbb78e0a61933286a14d0be Mon Sep 17 00:00:00 2001 From: Matteo Martinelli Date: Thu, 15 Jun 2017 13:25:13 +0200 Subject: [PATCH] code works, results to be checked and validated --- .../experiments/WeakLensing/Euclid_like.ini | 118 ++++++++++++++++++ .../parameters/3_varying_alpha.eftcamb.ini | 8 +- examples/parameters/4_Euclid_WL.eftcamb.ini | 101 +++++++++++++++ .../parameters_analysis/3_varying_alpha.ini | 50 ++++++++ examples/parameters_analysis/4_Euclid_WL.ini | 54 ++++++++ .../{ => old}/1_Planck_Pre_Launch.ini | 0 .../{ => old}/2_DESGC_Planck.ini | 0 sources/013_Fisher_calculator_varalpha.f90 | 36 +++++- 8 files changed, 357 insertions(+), 10 deletions(-) create mode 100755 examples/experiments/WeakLensing/Euclid_like.ini create mode 100755 examples/parameters/4_Euclid_WL.eftcamb.ini create mode 100644 examples/parameters_analysis/3_varying_alpha.ini create mode 100644 examples/parameters_analysis/4_Euclid_WL.ini rename examples/parameters_analysis/{ => old}/1_Planck_Pre_Launch.ini (100%) rename examples/parameters_analysis/{ => old}/2_DESGC_Planck.ini (100%) diff --git a/examples/experiments/WeakLensing/Euclid_like.ini b/examples/experiments/WeakLensing/Euclid_like.ini new file mode 100755 index 0000000..37b323e --- /dev/null +++ b/examples/experiments/WeakLensing/Euclid_like.ini @@ -0,0 +1,118 @@ +#---------------------------------------------------------------------------------------- +# +# This file is part of CosmicFish. +# +# Copyright (C) 2015-2016 by the CosmicFish authors +# +# The CosmicFish code is free software; +# You can use it, redistribute it, and/or modify it under the terms +# of the GNU General Public License as published by the Free Software Foundation; +# either version 3 of the License, or (at your option) any later version. +# The full text of the license can be found in the file LICENSE at +# the top level of the CosmicFish distribution. +# +#---------------------------------------------------------------------------------------- + +# parameters for Dark Energy Task Force Stage-IV mission (arXiv:0609591). +# Specification taken for Weak Lensing paper corresponding to WL-IVS-p + +window_type = 2 +window_alpha = 2.0 +window_beta = 1.5 +redshift_zero = 0.636396 +photoz_error = 0.0 + +LSS_number_windows = 10 +num_redshiftwindows = 10 + +redshift_kind(1) = lensing +redshift_kind(2) = lensing +redshift_kind(3) = lensing +redshift_kind(4) = lensing +redshift_kind(5) = lensing +redshift_kind(6) = lensing +redshift_kind(7) = lensing +redshift_kind(8) = lensing +redshift_kind(9) = lensing +redshift_kind(10) = lensing + + + +redshift(1) = 0.001 +redshift(2) = 0.496 +redshift(3) = 0.654 +redshift(4) = 0.784 +redshift(5) = 0.907 +redshift(6) = 1.031 +redshift(7) = 1.163 +redshift(8) = 1.311 +redshift(9) = 1.502 +redshift(10) = 1.782 + + +redshift_sigma(1) = 0.495 +redshift_sigma(2) = 0.158 +redshift_sigma(3) = 0.130 +redshift_sigma(4) = 0.123 +redshift_sigma(5) = 0.124 +redshift_sigma(6) = 0.132 +redshift_sigma(7) = 0.148 +redshift_sigma(8) = 0.191 +redshift_sigma(9) = 0.280 +redshift_sigma(10)= 3.218 + + +LSS_fsky(1) = 0.36361 +LSS_fsky(2) = 0.36361 +LSS_fsky(3) = 0.36361 +LSS_fsky(4) = 0.36361 +LSS_fsky(5) = 0.36361 +LSS_fsky(6) = 0.36361 +LSS_fsky(7) = 0.36361 +LSS_fsky(8) = 0.36361 +LSS_fsky(9) = 0.36361 +LSS_fsky(10)= 0.36361 + + + +LSS_lmax(1) = 1500 +LSS_lmax(2) = 1500 +LSS_lmax(3) = 1500 +LSS_lmax(4) = 1500 +LSS_lmax(5) = 1500 +LSS_lmax(6) = 1500 +LSS_lmax(7) = 1500 +LSS_lmax(8) = 1500 +LSS_lmax(9) = 1500 +LSS_lmax(10)= 1500 + + + + +LSS_intrinsic_ellipticity(1) = 0.22 +LSS_intrinsic_ellipticity(2) = 0.22 +LSS_intrinsic_ellipticity(3) = 0.22 +LSS_intrinsic_ellipticity(4) = 0.22 +LSS_intrinsic_ellipticity(5) = 0.22 +LSS_intrinsic_ellipticity(6) = 0.22 +LSS_intrinsic_ellipticity(7) = 0.22 +LSS_intrinsic_ellipticity(8) = 0.22 +LSS_intrinsic_ellipticity(9) = 0.22 +LSS_intrinsic_ellipticity(10) = 0.22 + + + +LSS_num_galaxies(1) = 35454300 +LSS_num_galaxies(2) = 35454300 +LSS_num_galaxies(3) = 35454300 +LSS_num_galaxies(4) = 35454300 +LSS_num_galaxies(5) = 35454300 +LSS_num_galaxies(6) = 35454300 +LSS_num_galaxies(7) = 35454300 +LSS_num_galaxies(8) = 35454300 +LSS_num_galaxies(9) = 35454300 +LSS_num_galaxies(10)= 35454300 + + + + diff --git a/examples/parameters/3_varying_alpha.eftcamb.ini b/examples/parameters/3_varying_alpha.eftcamb.ini index 528c1f1..144a461 100755 --- a/examples/parameters/3_varying_alpha.eftcamb.ini +++ b/examples/parameters/3_varying_alpha.eftcamb.ini @@ -42,12 +42,12 @@ param[omnuh2] = F param[hubble] = T param[Ye] = F param[nom_nu] = F -param[w0_ppf] = T -param[wa_ppf] = T +param[w0_ppf] = F +param[wa_ppf] = F param[cs_ppf] = F param[cT] = F -param[As] = T -param[ns] = T +param[As] = F +param[ns] = F param[nsrun] = F param[nt] = F param[r] = F diff --git a/examples/parameters/4_Euclid_WL.eftcamb.ini b/examples/parameters/4_Euclid_WL.eftcamb.ini new file mode 100755 index 0000000..8dc7440 --- /dev/null +++ b/examples/parameters/4_Euclid_WL.eftcamb.ini @@ -0,0 +1,101 @@ +#---------------------------------------------------------------------------------------- +# +# This file is part of CosmicFish. +# +# Copyright (C) 2015-2016 by the CosmicFish authors +# +# The CosmicFish code is free software; +# You can use it, redistribute it, and/or modify it under the terms +# of the GNU General Public License as published by the Free Software Foundation; +# either version 3 of the License, or (at your option) any later version. +# The full text of the license can be found in the file LICENSE at +# the top level of the CosmicFish distribution. +# +#---------------------------------------------------------------------------------------- + +# output_root is prefixed to output file names +output_root = raw_results/4_Euclid_WL + +# common run parameters: +DEFAULT(./parameters/common/common_params_fisher.ini) +DEFAULT(./parameters/common/common_params_camb.ini) +DEFAULT(./parameters/common/common_params_eft.ini) + +EFTflag = 1 +EFTwDE = 2 +EFTw0 = -0.95 +EFTwa = 0 + +external_input = F + +do_nonlinear = 0 + +l_max_scalar = 2500 +adaptivity = F +window_kmax_boost = 1 +#this flag reduces boost on k to decrease runtime. + +# DES 09 specifications +DEFAULT(./experiments/WeakLensing/Euclid_like.ini) + + +#feedback_level = 2 +# CosmicFish parameters to run: + +param[ombh2] = T +param[omch2] = T +param[omnuh2] = F +param[hubble] = T +param[Ye] = F +param[nom_nu] = F +param[w0_ppf] = F +param[wa_ppf] = F +param[cs_ppf] = F +param[cT] = F +param[As] = T +param[ns] = T +param[nsrun] = F +param[nt] = F +param[r] = F +param[tau] = F +param[bias] = F +param[alpha_SN] = F +param[beta_SN] = F +param[M0_SN] = F + +param[alpha_coupling] = F + + +###################### Parameters for CosmicFish derived ###################### + +param[omegab] = F +param[omegac] = F +param[omegan] = F +param[omegav] = F +param[omegak] = F +param[omegam] = T +param[theta] = F +param[mnu] = F +param[zre] = F +param[neff] = F + +param[sigma8] = T +param[loghubble] = F +param[logDA] = F +param[S8] = F + +FD_num_redshift = 1 +FD_redshift(1) = 0.0 + +# what to do: +cosmicfish_want_cls = T +cosmicfish_want_derived = T + +#with these settings CosmicFish is running both CMB spectra (T,E,B) and Galaxy Clustering +Fisher_want_CMB_T = F +Fisher_want_CMB_E = F +Fisher_want_CMB_B = F +Fisher_want_CMB_lensing = F +Fisher_want_LSS_lensing = T +Fisher_want_LSS_counts = F +Fisher_want_XC = T diff --git a/examples/parameters_analysis/3_varying_alpha.ini b/examples/parameters_analysis/3_varying_alpha.ini new file mode 100644 index 0000000..5af3737 --- /dev/null +++ b/examples/parameters_analysis/3_varying_alpha.ini @@ -0,0 +1,50 @@ +[General Options] +outroot : results/3_varying_alpha + +# Path and filename of Fisher matrices to be used +fishers : raw_results/3_varying_alpha_fisher_matrix_varalpha.dat + + +sum_fish : + +names : QSO + + + + +# include derived parameters +derived : False + + +# if set True, eliminate parameters not of interest +# rather than marginalizing over them +eliminate : False + +[1Dplot] +# 1D plot list. The app will produce one plot for +# each parameter list provided +#params1: omegam,h,sigma8_1 + +[2Dplot] +# 2D plot list. The app will produce one plot for +# each parameter list provided +params1: alpha_coupling,EFTw0,EFTwa + + +[triplot] +# triangular plot list. The app will produce one plot for +# each parameter list provided +#params1 : omegab,w0_ppf,wa_ppf,h,ns,sigma8_1 +params1 : omegabh2,omegach2,h,ns,logA,alpha_coupling,EFTw0,EFTwa + +[bounds] +# parameter bounds list. The app will produce the bounds for +# each parameter list provided +params1 : omegabh2,omegach2,h,ns,logA,alpha_coupling,EFTw0,EFTwa +#params1 : omegabh2,omegach2,w0_ppf,wa_ppf,h,ns,logA + +# wether you want the LaTeX table or not: +use_latex : False + +# number of columns in the LaTeX table: +latex_num_col : 4 diff --git a/examples/parameters_analysis/4_Euclid_WL.ini b/examples/parameters_analysis/4_Euclid_WL.ini new file mode 100644 index 0000000..ffc1077 --- /dev/null +++ b/examples/parameters_analysis/4_Euclid_WL.ini @@ -0,0 +1,54 @@ +[General Options] +outroot : results/Euclid_QSO + +# Path and filename of Fisher matrices to be used +fishers : raw_results/4_Euclid_WL_fisher_matrix_cls.dat + raw_results/3_varying_alpha_fisher_matrix_varalpha.dat + + +sum_fish : raw_results/4_Euclid_WL_fisher_matrix_cls.dat + raw_results/3_varying_alpha_fisher_matrix_varalpha.dat + +names : Euclid WL + QSO + Euclid+QSO + + + + +# include derived parameters +derived : False + + +# if set True, eliminate parameters not of interest +# rather than marginalizing over them +eliminate : False + +[1Dplot] +# 1D plot list. The app will produce one plot for +# each parameter list provided +#params1: omegam,h,sigma8_1 + +[2Dplot] +# 2D plot list. The app will produce one plot for +# each parameter list provided +params1: alpha_coupling,EFTw0,EFTwa + + +[triplot] +# triangular plot list. The app will produce one plot for +# each parameter list provided +#params1 : omegab,w0_ppf,wa_ppf,h,ns,sigma8_1 +params1 : omegabh2,omegach2,h,alpha_coupling,EFTw0,EFTwa + +[bounds] +# parameter bounds list. The app will produce the bounds for +# each parameter list provided +params1 : EFTw0,EFTwa +#params1 : omegabh2,omegach2,w0_ppf,wa_ppf,h,ns,logA + +# wether you want the LaTeX table or not: +use_latex : False + +# number of columns in the LaTeX table: +latex_num_col : 4 diff --git a/examples/parameters_analysis/1_Planck_Pre_Launch.ini b/examples/parameters_analysis/old/1_Planck_Pre_Launch.ini similarity index 100% rename from examples/parameters_analysis/1_Planck_Pre_Launch.ini rename to examples/parameters_analysis/old/1_Planck_Pre_Launch.ini diff --git a/examples/parameters_analysis/2_DESGC_Planck.ini b/examples/parameters_analysis/old/2_DESGC_Planck.ini similarity index 100% rename from examples/parameters_analysis/2_DESGC_Planck.ini rename to examples/parameters_analysis/old/2_DESGC_Planck.ini diff --git a/sources/013_Fisher_calculator_varalpha.f90 b/sources/013_Fisher_calculator_varalpha.f90 index 5b42260..38304da 100644 --- a/sources/013_Fisher_calculator_varalpha.f90 +++ b/sources/013_Fisher_calculator_varalpha.f90 @@ -61,8 +61,6 @@ subroutine alpha_theo_Calc( P, FP, varalpha, err ) Type(cosmicfish_params), intent(in) :: FP !< Input Cosmicfish params real(dl), dimension(FP%fisher_alpha%number_alpha_redshifts), intent(out) :: varalpha !< Output array with the !< theoretical alpha variation - real(dl), dimension(FP%fisher_alpha%number_alpha_redshifts) :: wde !< DE EoS obtained from EFTCAMB - real(dl), dimension(FP%fisher_alpha%number_alpha_redshifts) :: rhode !< DE rho obtained from EFTCAMB integer, intent(out) :: err !< Output error code: !< 0 = all fine @@ -74,6 +72,13 @@ subroutine alpha_theo_Calc( P, FP, varalpha, err ) ! other definitions: integer :: i logical :: EFTsuccess + + !Integration variables + integer, parameter :: numint = 1000 + integer :: ii, jj, kk + real(dl), dimension(numint) :: wde, ode, func, redint + real(dl) :: zstep, zend, integrand + ! real(dl), parameter :: conv_time=3.15e7, conv_mpc=1/(3.09e19) !years to seconds and 1/Mpc to 1/km ! real(dl) ::deltaT ! initialization: @@ -102,12 +107,31 @@ subroutine alpha_theo_Calc( P, FP, varalpha, err ) !For wDE use EFT function EFTw(1/(1+FP%fisher_alpha%alpha_redshift(i)),0) !For OmegaDE vedi foglio + ! compute the delta alpha array: + redint(1) = 0.d0 + wde(1) = EFTw(1/(1+redint(1)),0) + ode(1) = (1+redint(1))*P%H0**2.*P%omegav*EFTw(1/(1+redint(1)),3)/(Hofz(redint(1))*c/1000)**2. + func(1) = sqrt(3*ode(1)*(1+wde(1)))/(1+redint(1)) + !Temporary checks------------------ + write(0,*) 'wde=',EFTw(1/(1+redint(1)),0) + write(0,*) 'H0=',P%H0,Hofz(redint(1))*c/1000 + write(0,*) 'omega=',ode(1),P%omegav + write(0,*) 'func=',func(1), sqrt(3*P%omegav*(1-0.95)) +! stop + !---------------------------------- do i=1, FP%fisher_alpha%number_alpha_redshifts - !need to call function for integration here, it's simpler. - !or maybe a nested loop to compute integral - varalpha(i) = FP%fisher_alpha%alpha_coupling !put equation 9 (generalized) here - write(*,*) FP%fisher_alpha%alpha_redshift(i), varalpha(i), FP%fisher_alpha%alpha_error(i) + zend = FP%fisher_alpha%alpha_redshift(i) + zstep = (zend-redint(1))/numint + integrand=0.d0 + do ii=2,numint + redint(ii) = redint(ii-1)+zstep + wde(ii) = EFTw(1/(1+redint(ii)),0) + ode(ii) = (1+redint(ii))**2.*P%H0**2.*P%omegav*EFTw(1/(1+redint(ii)),3)/(Hofz(redint(ii))*c/1000)**2. + func(ii) = sqrt(3*ode(ii)*(1+wde(ii)))/(1+redint(ii)) + integrand = integrand + 0.5*(func(ii)+func(ii-1))*zstep + end do + varalpha(i) = FP%fisher_alpha%alpha_coupling*integrand end do #else write(*,*) 'ALPHA VARIATION IMPLEMENTED ONLY WITH EFTCAMB...'