EFTCAMB  Reference documentation for version 3.0
04p0_neutral_parametrizations_1D.f90
Go to the documentation of this file.
1 !----------------------------------------------------------------------------------------
2 !
3 ! This file is part of EFTCAMB.
4 !
5 ! Copyright (C) 2013-2016 by the EFTCAMB authors
6 !
7 ! The EFTCAMB code is free software;
8 ! You can use it, redistribute it, and/or modify it under the terms
9 ! of the GNU General Public License as published by the Free Software Foundation;
10 ! either version 3 of the License, or (at your option) any later version.
11 ! The full text of the license can be found in the file eftcamb/LICENSE at
12 ! the top level of the EFTCAMB distribution.
13 !
14 !----------------------------------------------------------------------------------------
15 
19 
20 
21 !----------------------------------------------------------------------------------------
24 
26 
28 
29  use precision
30  use eftcamb_cache
32 
33  implicit none
34 
35  private
36 
37  public zero_parametrization_1d, wde_lcdm_parametrization_1d
38 
39  ! ---------------------------------------------------------------------------------------------
42  type, extends ( parametrized_function_1d ) :: zero_parametrization_1d
43 
44  contains
45 
46  ! initialization:
47  procedure :: set_param_number => zeroparametrized1dsetparamnumber
48  procedure :: init_parameters => zeroparametrized1dinitparams
49  procedure :: parameter_value => zeroparametrized1dparametervalues
50 
51  ! evaluation procedures:
52  procedure :: value => zeroparametrized1dvalue
53  procedure :: first_derivative => zeroparametrized1dfirstderivative
54  procedure :: second_derivative => zeroparametrized1dsecondderivative
55  procedure :: third_derivative => zeroparametrized1dthirdderivative
56  procedure :: integral => zeroparametrized1dintegral
57 
58  end type zero_parametrization_1d
59 
60  ! ---------------------------------------------------------------------------------------------
63  type, extends ( parametrized_function_1d ) :: wde_lcdm_parametrization_1d
64 
65  contains
66 
67  ! initialization:
68  procedure :: set_param_number => wdelcdmparametrized1dsetparamnumber
69  procedure :: init_parameters => wdelcdmparametrized1dinitparams
70  procedure :: parameter_value => wdelcdmparametrized1dparametervalues
71 
72  ! evaluation procedures:
73  procedure :: value => wdelcdmparametrized1dvalue
74  procedure :: first_derivative => wdelcdmparametrized1dfirstderivative
75  procedure :: second_derivative => wdelcdmparametrized1dsecondderivative
76  procedure :: third_derivative => wdelcdmparametrized1dthirdderivative
77  procedure :: integral => wdelcdmparametrized1dintegral
78 
79  end type wde_lcdm_parametrization_1d
80 
81 contains
82 
83  ! ---------------------------------------------------------------------------------------------
84  ! Implementation of the constant zero function.
85  ! ---------------------------------------------------------------------------------------------
86 
87  ! ---------------------------------------------------------------------------------------------
89  subroutine zeroparametrized1dsetparamnumber( self )
90 
91  implicit none
92 
93  class(zero_parametrization_1d) :: self
94 
95  self%parameter_number = 0
96 
97  end subroutine zeroparametrized1dsetparamnumber
98 
99  ! ---------------------------------------------------------------------------------------------
101  subroutine zeroparametrized1dinitparams( self, array )
102 
103  implicit none
104 
105  class(zero_parametrization_1d) :: self
106  real(dl), dimension(self%parameter_number), intent(in) :: array
107 
108  end subroutine zeroparametrized1dinitparams
109 
110  ! ---------------------------------------------------------------------------------------------
112  subroutine zeroparametrized1dparametervalues( self, i, value )
113 
114  implicit none
115 
116  class(zero_parametrization_1d) :: self
117  integer , intent(in) :: i
118  real(dl), intent(out) :: value
119 
120  value = 0._dl
121 
122  end subroutine zeroparametrized1dparametervalues
123 
124  ! ---------------------------------------------------------------------------------------------
126  function zeroparametrized1dvalue( self, x, eft_cache )
127 
128  implicit none
129 
130  class(zero_parametrization_1d) :: self
131  real(dl), intent(in) :: x
132  type(eftcamb_timestep_cache), intent(in), optional :: eft_cache
133  real(dl) :: zeroparametrized1dvalue
134 
135  zeroparametrized1dvalue = 0._dl
136 
137  end function zeroparametrized1dvalue
138 
139  ! ---------------------------------------------------------------------------------------------
141  function zeroparametrized1dfirstderivative( self, x, eft_cache )
142 
143  implicit none
144 
145  class(zero_parametrization_1d) :: self
146  real(dl), intent(in) :: x
147  type(eftcamb_timestep_cache), intent(in), optional :: eft_cache
148  real(dl) :: zeroparametrized1dfirstderivative
149 
150  zeroparametrized1dfirstderivative = 0._dl
151 
152  end function zeroparametrized1dfirstderivative
153 
154  ! ---------------------------------------------------------------------------------------------
156  function zeroparametrized1dsecondderivative( self, x, eft_cache )
157 
158  implicit none
159 
160  class(zero_parametrization_1d) :: self
161  real(dl), intent(in) :: x
162  type(eftcamb_timestep_cache), intent(in), optional :: eft_cache
163  real(dl) :: zeroparametrized1dsecondderivative
164 
165  zeroparametrized1dsecondderivative = 0._dl
166 
167  end function zeroparametrized1dsecondderivative
168 
169  ! ---------------------------------------------------------------------------------------------
171  function zeroparametrized1dthirdderivative( self, x, eft_cache )
172 
173  implicit none
174 
175  class(zero_parametrization_1d) :: self
176  real(dl), intent(in) :: x
177  type(eftcamb_timestep_cache), intent(in), optional :: eft_cache
178  real(dl) :: zeroparametrized1dthirdderivative
179 
180  zeroparametrized1dthirdderivative = 0._dl
181 
182  end function zeroparametrized1dthirdderivative
183 
184  ! ---------------------------------------------------------------------------------------------
186  function zeroparametrized1dintegral( self, x, eft_cache )
187 
188  implicit none
189 
190  class(zero_parametrization_1d) :: self
191  real(dl), intent(in) :: x
192  type(eftcamb_timestep_cache), intent(in), optional :: eft_cache
193  real(dl) :: zeroparametrized1dintegral
194 
195  zeroparametrized1dintegral = 1._dl/x
196 
197  end function zeroparametrized1dintegral
198 
199  ! ---------------------------------------------------------------------------------------------
200 
201  ! ---------------------------------------------------------------------------------------------
202  ! Implementation of the LCDM w_DE.
203  ! ---------------------------------------------------------------------------------------------
204 
205  ! ---------------------------------------------------------------------------------------------
207  subroutine wdelcdmparametrized1dsetparamnumber( self )
208 
209  implicit none
210 
211  class(wde_lcdm_parametrization_1d) :: self
212 
213  self%parameter_number = 0
214 
215  end subroutine wdelcdmparametrized1dsetparamnumber
216 
217  ! ---------------------------------------------------------------------------------------------
219  subroutine wdelcdmparametrized1dinitparams( self, array )
220 
221  implicit none
222 
223  class(wde_lcdm_parametrization_1d) :: self
224  real(dl), dimension(self%parameter_number), intent(in) :: array
225 
226  end subroutine wdelcdmparametrized1dinitparams
227 
228  ! ---------------------------------------------------------------------------------------------
230  subroutine wdelcdmparametrized1dparametervalues( self, i, value )
231 
232  implicit none
233 
234  class(wde_lcdm_parametrization_1d) :: self
235  integer , intent(in) :: i
236  real(dl), intent(out) :: value
237 
238  value = -1._dl
239 
240  end subroutine wdelcdmparametrized1dparametervalues
241 
242  ! ---------------------------------------------------------------------------------------------
244  function wdelcdmparametrized1dvalue( self, x, eft_cache )
245 
246  implicit none
247 
248  class(wde_lcdm_parametrization_1d) :: self
249  real(dl), intent(in) :: x
250  type(eftcamb_timestep_cache), intent(in), optional :: eft_cache
251  real(dl) :: wdelcdmparametrized1dvalue
252 
253  wdelcdmparametrized1dvalue = -1._dl
254 
255  end function wdelcdmparametrized1dvalue
256 
257  ! ---------------------------------------------------------------------------------------------
259  function wdelcdmparametrized1dfirstderivative( self, x, eft_cache )
260 
261  implicit none
262 
263  class(wde_lcdm_parametrization_1d) :: self
264  real(dl), intent(in) :: x
265  type(eftcamb_timestep_cache), intent(in), optional :: eft_cache
266  real(dl) :: wdelcdmparametrized1dfirstderivative
267 
268  wdelcdmparametrized1dfirstderivative = 0._dl
269 
270  end function wdelcdmparametrized1dfirstderivative
271 
272  ! ---------------------------------------------------------------------------------------------
274  function wdelcdmparametrized1dsecondderivative( self, x, eft_cache )
275 
276  implicit none
277 
278  class(wde_lcdm_parametrization_1d) :: self
279  real(dl), intent(in) :: x
280  type(eftcamb_timestep_cache), intent(in), optional :: eft_cache
281  real(dl) :: wdelcdmparametrized1dsecondderivative
282 
283  wdelcdmparametrized1dsecondderivative = 0._dl
284 
285  end function wdelcdmparametrized1dsecondderivative
286 
287  ! ---------------------------------------------------------------------------------------------
289  function wdelcdmparametrized1dthirdderivative( self, x, eft_cache )
290 
291  implicit none
292 
293  class(wde_lcdm_parametrization_1d) :: self
294  real(dl), intent(in) :: x
295  type(eftcamb_timestep_cache), intent(in), optional :: eft_cache
296  real(dl) :: wdelcdmparametrized1dthirdderivative
297 
298  wdelcdmparametrized1dthirdderivative = 0._dl
299 
300  end function wdelcdmparametrized1dthirdderivative
301 
302  ! ---------------------------------------------------------------------------------------------
304  function wdelcdmparametrized1dintegral( self, x, eft_cache )
305 
306  implicit none
307 
308  class(wde_lcdm_parametrization_1d) :: self
309  real(dl), intent(in) :: x
310  type(eftcamb_timestep_cache), intent(in), optional :: eft_cache
311  real(dl) :: wdelcdmparametrized1dintegral
312 
313  wdelcdmparametrized1dintegral = x**2
314 
315  end function wdelcdmparametrized1dintegral
316 
317  ! ---------------------------------------------------------------------------------------------
318 
320 
321 !----------------------------------------------------------------------------------------
This module contains the definition of the EFTCAMB caches. These are used to store parameters that ca...
This module contains the definition of neutral parametrizations that can be used when parametrized fu...
This module contains the abstract class for generic parametrizations for 1D functions that are used b...