39 public taylor_parametrization_1d
43 type,
extends ( parametrized_function_1d ) :: taylor_parametrization_1d
53 procedure :: set_param_number => taylorparametrized1dsetparamnumber
54 procedure :: init_parameters => taylorparametrized1dinitparams
55 procedure :: parameter_value => taylorparametrized1dparametervalues
56 procedure :: feedback => taylorparametrized1dfeedback
59 procedure ::
value => taylorparametrized1dvalue
60 procedure :: first_derivative => taylorparametrized1dfirstderivative
61 procedure :: second_derivative => taylorparametrized1dsecondderivative
62 procedure :: third_derivative => taylorparametrized1dthirdderivative
63 procedure :: integral => taylorparametrized1dintegral
65 end type taylor_parametrization_1d
75 subroutine taylorparametrized1dsetparamnumber( self )
79 class(taylor_parametrization_1d) :: self
82 self%parameter_number = 4
84 end subroutine taylorparametrized1dsetparamnumber
88 subroutine taylorparametrized1dinitparams( self, array )
92 class(taylor_parametrization_1d) :: self
93 real(dl),
dimension(self%parameter_number),
intent(in) :: array
100 end subroutine taylorparametrized1dinitparams
104 subroutine taylorparametrized1dparametervalues( self, i, value )
108 class(taylor_parametrization_1d) :: self
109 integer ,
intent(in) :: i
110 real(dl) ,
intent(out) ::
value 122 write(*,*)
'Illegal index for parameter_names.' 123 write(*,*)
'Maximum value is:', self%parameter_number
124 call mpistop(
'EFTCAMB error')
127 end subroutine taylorparametrized1dparametervalues
131 subroutine taylorparametrized1dfeedback( self, print_params )
135 class(taylor_parametrization_1d) :: self
136 logical,
optional :: print_params
140 real(dl) :: param_value
141 character(len=EFT_names_max_length) :: param_name
142 logical :: print_params_temp
144 if (
present(print_params) )
then 145 print_params_temp = print_params
147 print_params_temp = .true.
150 write(*,*)
'Taylor expansion parametrization: ', self%name
151 if ( print_params_temp )
then 152 do i=1, self%parameter_number
153 call self%parameter_names( i, param_name )
154 call self%parameter_value( i, param_value )
155 write(*,
'(a23,a,F12.6)') param_name,
'=', param_value
159 end subroutine taylorparametrized1dfeedback
163 function taylorparametrized1dvalue( self, x, eft_cache )
167 class(taylor_parametrization_1d) :: self
168 real(dl),
intent(in) :: x
169 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
170 real(dl) :: taylorparametrized1dvalue
172 taylorparametrized1dvalue = self%w0 +self%wa*x +0.5_dl*self%w2*x**2 +self%w3/6._dl*x**3
174 end function taylorparametrized1dvalue
178 function taylorparametrized1dfirstderivative( self, x, eft_cache )
182 class(taylor_parametrization_1d) :: self
183 real(dl),
intent(in) :: x
184 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
185 real(dl) :: taylorparametrized1dfirstderivative
187 taylorparametrized1dfirstderivative = self%wa +self%w2*x +0.5_dl*self%w3*x**2
190 end function taylorparametrized1dfirstderivative
194 function taylorparametrized1dsecondderivative( self, x, eft_cache )
198 class(taylor_parametrization_1d) :: self
199 real(dl),
intent(in) :: x
200 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
201 real(dl) :: taylorparametrized1dsecondderivative
203 taylorparametrized1dsecondderivative = self%w2 +self%w3*x
205 end function taylorparametrized1dsecondderivative
209 function taylorparametrized1dthirdderivative( self, x, eft_cache )
213 class(taylor_parametrization_1d) :: self
214 real(dl),
intent(in) :: x
215 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
216 real(dl) :: taylorparametrized1dthirdderivative
218 taylorparametrized1dthirdderivative = self%w3
220 end function taylorparametrized1dthirdderivative
224 function taylorparametrized1dintegral( self, x, eft_cache )
228 class(taylor_parametrization_1d) :: self
229 real(dl),
intent(in) :: x
230 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
231 real(dl) :: taylorparametrized1dintegral
233 taylorparametrized1dintegral = x**(-1._dl -3._dl*self%w0)*exp(-1._dl/12._dl*(x -1._dl)*(9._dl*(1._dl+x)*self%w2 +2._dl*(1._dl +x +x**2)*self%w3 +36._dl*self%wa))
235 end function taylorparametrized1dintegral
This module contains the definition of the Taylor expansion parametrization, around a=0...
This module contains the definition of the EFTCAMB caches. These are used to store parameters that ca...
This module contains the definitions of all the EFTCAMB compile time flags.
This module contains the abstract class for generic parametrizations for 1D functions that are used b...