39 public constant_parametrization_1d
43 type,
extends ( parametrized_function_1d ) :: constant_parametrization_1d
45 real(dl) :: constant_value
50 procedure :: set_param_number => constantparametrized1dsetparamnumber
51 procedure :: init_parameters => constantparametrized1dinitparams
52 procedure :: parameter_value => constantparametrized1dparametervalues
53 procedure :: feedback => constantparametrized1dfeedback
56 procedure ::
value => constantparametrized1dvalue
57 procedure :: first_derivative => constantparametrized1dfirstderivative
58 procedure :: second_derivative => constantparametrized1dsecondderivative
59 procedure :: third_derivative => constantparametrized1dthirdderivative
60 procedure :: integral => constantparametrized1dintegral
62 end type constant_parametrization_1d
72 subroutine constantparametrized1dsetparamnumber( self )
76 class(constant_parametrization_1d) :: self
79 self%parameter_number = 1
81 end subroutine constantparametrized1dsetparamnumber
85 subroutine constantparametrized1dinitparams( self, array )
89 class(constant_parametrization_1d) :: self
90 real(dl),
dimension(self%parameter_number),
intent(in) :: array
92 self%constant_value = array(1)
94 end subroutine constantparametrized1dinitparams
98 subroutine constantparametrized1dfeedback( self, print_params )
102 class(constant_parametrization_1d) :: self
103 logical,
optional :: print_params
107 real(dl) :: param_value
108 character(len=EFT_names_max_length) :: param_name
109 logical :: print_params_temp
111 if (
present(print_params) )
then 112 print_params_temp = print_params
114 print_params_temp = .true.
117 write(*,*)
'Constant function: ', self%name
118 if ( print_params_temp )
then 119 do i=1, self%parameter_number
120 call self%parameter_names( i, param_name )
121 call self%parameter_value( i, param_value )
122 write(*,
'(a23,a,F12.6)') param_name,
'=', param_value
126 end subroutine constantparametrized1dfeedback
130 subroutine constantparametrized1dparametervalues( self, i, value )
134 class(constant_parametrization_1d) :: self
135 integer ,
intent(in) :: i
136 real(dl) ,
intent(out) ::
value 140 value = self%constant_value
142 write(*,*)
'In constant_parametrization_1D:', self%name
143 write(*,*)
'Illegal index for parameter_names.' 144 write(*,*)
'Maximum value is:', self%parameter_number
145 call mpistop(
'EFTCAMB error')
148 end subroutine constantparametrized1dparametervalues
152 function constantparametrized1dvalue( self, x, eft_cache )
156 class(constant_parametrization_1d) :: self
157 real(dl),
intent(in) :: x
158 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
159 real(dl) :: constantparametrized1dvalue
161 constantparametrized1dvalue = self%constant_value
163 end function constantparametrized1dvalue
167 function constantparametrized1dfirstderivative( self, x, eft_cache )
171 class(constant_parametrization_1d) :: self
172 real(dl),
intent(in) :: x
173 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
174 real(dl) :: constantparametrized1dfirstderivative
176 constantparametrized1dfirstderivative = 0._dl
178 end function constantparametrized1dfirstderivative
182 function constantparametrized1dsecondderivative( self, x, eft_cache )
186 class(constant_parametrization_1d) :: self
187 real(dl),
intent(in) :: x
188 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
189 real(dl) :: constantparametrized1dsecondderivative
191 constantparametrized1dsecondderivative = 0._dl
193 end function constantparametrized1dsecondderivative
197 function constantparametrized1dthirdderivative( self, x, eft_cache )
201 class(constant_parametrization_1d) :: self
202 real(dl),
intent(in) :: x
203 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
204 real(dl) :: constantparametrized1dthirdderivative
206 constantparametrized1dthirdderivative = 0._dl
208 end function constantparametrized1dthirdderivative
212 function constantparametrized1dintegral( self, x, eft_cache )
216 class(constant_parametrization_1d) :: self
217 real(dl),
intent(in) :: x
218 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
219 real(dl) :: constantparametrized1dintegral
221 constantparametrized1dintegral = x**(-1._dl-3._dl*self%constant_value)
223 end function constantparametrized1dintegral
This module contains the definition of the constant parametrization, inheriting from parametrized_fun...
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...