39 public turning_point_parametrization_1d
43 type,
extends ( parametrized_function_1d ) :: turning_point_parametrization_1d
52 procedure :: set_param_number => turningpointparametrized1dsetparamnumber
53 procedure :: init_parameters => turningpointparametrized1dinitparams
54 procedure :: parameter_value => turningpointparametrized1dparametervalues
55 procedure :: feedback => turningpointparametrized1dfeedback
58 procedure ::
value => turningpointparametrized1dvalue
59 procedure :: first_derivative => turningpointparametrized1dfirstderivative
60 procedure :: second_derivative => turningpointparametrized1dsecondderivative
61 procedure :: third_derivative => turningpointparametrized1dthirdderivative
62 procedure :: integral => turningpointparametrized1dintegral
64 end type turning_point_parametrization_1d
74 subroutine turningpointparametrized1dsetparamnumber( self )
78 class(turning_point_parametrization_1d) :: self
81 self%parameter_number = 3
83 end subroutine turningpointparametrized1dsetparamnumber
87 subroutine turningpointparametrized1dinitparams( self, array )
91 class(turning_point_parametrization_1d) :: self
92 real(dl),
dimension(self%parameter_number),
intent(in) :: array
98 end subroutine turningpointparametrized1dinitparams
102 subroutine turningpointparametrized1dparametervalues( self, i, value )
106 class(turning_point_parametrization_1d):: self
107 integer ,
intent(in) :: i
108 real(dl) ,
intent(out) ::
value 118 write(*,*)
'Illegal index for parameter_names.' 119 write(*,*)
'Maximum value is:', self%parameter_number
120 call mpistop(
'EFTCAMB error')
123 end subroutine turningpointparametrized1dparametervalues
127 subroutine turningpointparametrized1dfeedback( self, print_params )
131 class(turning_point_parametrization_1d) :: self
132 logical,
optional :: print_params
136 real(dl) :: param_value
137 character(len=EFT_names_max_length) :: param_name
138 logical :: print_params_temp
140 if (
present(print_params) )
then 141 print_params_temp = print_params
143 print_params_temp = .true.
146 write(*,*)
'Turning Point parametrization: ', self%name
147 if ( print_params_temp )
then 148 do i=1, self%parameter_number
149 call self%parameter_names( i, param_name )
150 call self%parameter_value( i, param_value )
151 write(*,
'(a23,a,F12.6)') param_name,
'=', param_value
155 end subroutine turningpointparametrized1dfeedback
159 function turningpointparametrized1dvalue( self, x, eft_cache )
163 class(turning_point_parametrization_1d) :: self
164 real(dl),
intent(in) :: x
165 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
166 real(dl) :: turningpointparametrized1dvalue
168 turningpointparametrized1dvalue = self%w0 +self%wa*(self%wat - x)**2._dl
170 end function turningpointparametrized1dvalue
174 function turningpointparametrized1dfirstderivative( self, x, eft_cache )
178 class(turning_point_parametrization_1d) :: self
179 real(dl),
intent(in) :: x
180 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
181 real(dl) :: turningpointparametrized1dfirstderivative
183 turningpointparametrized1dfirstderivative = 2._dl*self%wa*(x -self%wat)
185 end function turningpointparametrized1dfirstderivative
189 function turningpointparametrized1dsecondderivative( self, x, eft_cache )
193 class(turning_point_parametrization_1d) :: self
194 real(dl),
intent(in) :: x
195 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
196 real(dl) :: turningpointparametrized1dsecondderivative
198 turningpointparametrized1dsecondderivative = 2._dl*self%wa
200 end function turningpointparametrized1dsecondderivative
204 function turningpointparametrized1dthirdderivative( self, x, eft_cache )
208 class(turning_point_parametrization_1d) :: self
209 real(dl),
intent(in) :: x
210 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
211 real(dl) :: turningpointparametrized1dthirdderivative
213 turningpointparametrized1dthirdderivative = 0._dl
215 end function turningpointparametrized1dthirdderivative
219 function turningpointparametrized1dintegral( self, x, eft_cache )
223 class(turning_point_parametrization_1d) :: self
224 real(dl),
intent(in) :: x
225 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
226 real(dl) :: turningpointparametrized1dintegral
228 turningpointparametrized1dintegral = x**(2._dl -3._dl*(1._dl +self%w0 +self%wa*self%wat**2._dl))*exp(-1.5_dl*(x -1._dl)*self%wa*(1._dl +x -4._dl*self%wat))
230 end function turningpointparametrized1dintegral
This module contains the definition of the EFTCAMB caches. These are used to store parameters that ca...
This module contains the definition of the turning point parametrization, inheriting from parametrize...
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...