39 public cpl_parametrization_1d
43 type,
extends ( parametrized_function_1d ) :: cpl_parametrization_1d
51 procedure :: set_param_number => cplparametrized1dsetparamnumber
52 procedure :: init_parameters => cplparametrized1dinitparams
53 procedure :: parameter_value => cplparametrized1dparametervalues
54 procedure :: feedback => cplparametrized1dfeedback
57 procedure ::
value => cplparametrized1dvalue
58 procedure :: first_derivative => cplparametrized1dfirstderivative
59 procedure :: second_derivative => cplparametrized1dsecondderivative
60 procedure :: third_derivative => cplparametrized1dthirdderivative
61 procedure :: integral => cplparametrized1dintegral
63 end type cpl_parametrization_1d
73 subroutine cplparametrized1dsetparamnumber( self )
77 class(cpl_parametrization_1d) :: self
80 self%parameter_number = 2
82 end subroutine cplparametrized1dsetparamnumber
86 subroutine cplparametrized1dinitparams( self, array )
90 class(cpl_parametrization_1d) :: self
91 real(dl),
dimension(self%parameter_number),
intent(in) :: array
96 end subroutine cplparametrized1dinitparams
100 subroutine cplparametrized1dparametervalues( self, i, value )
104 class(cpl_parametrization_1d) :: self
105 integer ,
intent(in) :: i
106 real(dl) ,
intent(out) ::
value 114 write(*,*)
'Illegal index for parameter_names.' 115 write(*,*)
'Maximum value is:', self%parameter_number
116 call mpistop(
'EFTCAMB error')
119 end subroutine cplparametrized1dparametervalues
123 subroutine cplparametrized1dfeedback( self, print_params )
127 class(cpl_parametrization_1d) :: self
128 logical,
optional :: print_params
132 real(dl) :: param_value
133 character(len=EFT_names_max_length) :: param_name
134 logical :: print_params_temp
136 if (
present(print_params) )
then 137 print_params_temp = print_params
139 print_params_temp = .true.
142 write(*,*)
'CPL parametrization: ', self%name
143 if ( print_params_temp )
then 144 do i=1, self%parameter_number
145 call self%parameter_names( i, param_name )
146 call self%parameter_value( i, param_value )
147 write(*,
'(a23,a,F12.6)') param_name,
'=', param_value
151 end subroutine cplparametrized1dfeedback
155 function cplparametrized1dvalue( self, x, eft_cache )
159 class(cpl_parametrization_1d) :: self
160 real(dl),
intent(in) :: x
161 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
162 real(dl) :: cplparametrized1dvalue
164 cplparametrized1dvalue = self%w0 +(1._dl - x)*self%wa
165 end function cplparametrized1dvalue
169 function cplparametrized1dfirstderivative( self, x, eft_cache )
173 class(cpl_parametrization_1d) :: self
174 real(dl),
intent(in) :: x
175 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
176 real(dl) :: cplparametrized1dfirstderivative
178 cplparametrized1dfirstderivative = -self%wa
180 end function cplparametrized1dfirstderivative
184 function cplparametrized1dsecondderivative( self, x, eft_cache )
188 class(cpl_parametrization_1d) :: self
189 real(dl),
intent(in) :: x
190 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
191 real(dl) :: cplparametrized1dsecondderivative
193 cplparametrized1dsecondderivative = 0._dl
195 end function cplparametrized1dsecondderivative
199 function cplparametrized1dthirdderivative( self, x, eft_cache )
203 class(cpl_parametrization_1d) :: self
204 real(dl),
intent(in) :: x
205 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
206 real(dl) :: cplparametrized1dthirdderivative
208 cplparametrized1dthirdderivative = 0._dl
210 end function cplparametrized1dthirdderivative
214 function cplparametrized1dintegral( self, x, eft_cache )
218 class(cpl_parametrization_1d) :: self
219 real(dl),
intent(in) :: x
220 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
221 real(dl) :: cplparametrized1dintegral
223 cplparametrized1dintegral = x**(2._dl -3._dl*(1._dl +self%w0 +self%wa))*exp(3._dl*(x-1._dl)*self%wa)
225 end function cplparametrized1dintegral
This module contains the definition of the EFTCAMB caches. These are used to store parameters that ca...
This module contains the definition of the CPL parametrization, inheriting from parametrized_function...
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...