39 public constant_parametrization_2d
43 type,
extends ( parametrized_function_2d ) :: constant_parametrization_2d
45 real(dl) :: constant_value
50 procedure :: set_param_number => constantparametrized2dsetparamnumber
51 procedure :: init_parameters => constantparametrized2dinitparams
52 procedure :: parameter_value => constantparametrized2dparametervalues
53 procedure :: feedback => constantparametrized2dfeedback
56 procedure ::
value => constantparametrized2dvalue
57 procedure :: first_derivative_x => constantparametrized2dfirstderivativex
58 procedure :: first_derivative_y => constantparametrized2dfirstderivativey
59 procedure :: second_derivative_x => constantparametrized2dsecondderivativex
60 procedure :: second_derivative_y => constantparametrized2dsecondderivativey
61 procedure :: second_derivative_xy => constantparametrized2dsecondderivativexy
63 end type constant_parametrization_2d
73 subroutine constantparametrized2dsetparamnumber( self )
77 class(constant_parametrization_2d) :: self
80 self%parameter_number = 1
82 end subroutine constantparametrized2dsetparamnumber
86 subroutine constantparametrized2dinitparams( self, array )
90 class(constant_parametrization_2d) :: self
91 real(dl),
dimension(self%parameter_number),
intent(in) :: array
93 self%constant_value = array(1)
95 end subroutine constantparametrized2dinitparams
99 subroutine constantparametrized2dfeedback( self, print_params )
103 class(constant_parametrization_2d) :: self
104 logical,
optional :: print_params
108 real(dl) :: param_value
109 character(len=EFT_names_max_length) :: param_name
110 logical :: print_params_temp
112 if (
present(print_params) )
then 113 print_params_temp = print_params
115 print_params_temp = .true.
118 write(*,*)
'Constant function: ', self%name
119 if ( print_params_temp )
then 120 do i=1, self%parameter_number
121 call self%parameter_names( i, param_name )
122 call self%parameter_value( i, param_value )
123 write(*,
'(a23,a,F12.6)') param_name,
'=', param_value
127 end subroutine constantparametrized2dfeedback
131 subroutine constantparametrized2dparametervalues( self, i, value )
135 class(constant_parametrization_2d) :: self
136 integer ,
intent(in) :: i
137 real(dl) ,
intent(out) ::
value 141 value = self%constant_value
143 write(*,*)
'In constant_parametrization_2D:', self%name
144 write(*,*)
'Illegal index for parameter_names.' 145 write(*,*)
'Maximum value is:', self%parameter_number
146 call mpistop(
'EFTCAMB error')
149 end subroutine constantparametrized2dparametervalues
153 function constantparametrized2dvalue( self, x, y, eft_cache )
157 class(constant_parametrization_2d) :: self
158 real(dl),
intent(in) :: x
159 real(dl),
intent(in) :: y
160 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
161 real(dl) :: constantparametrized2dvalue
163 constantparametrized2dvalue = self%constant_value
165 end function constantparametrized2dvalue
169 function constantparametrized2dfirstderivativex( self, x, y, eft_cache )
173 class(constant_parametrization_2d) :: self
174 real(dl),
intent(in) :: x
175 real(dl),
intent(in) :: y
176 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
177 real(dl) :: constantparametrized2dfirstderivativex
179 constantparametrized2dfirstderivativex = 0._dl
181 end function constantparametrized2dfirstderivativex
185 function constantparametrized2dfirstderivativey( self, x, y, eft_cache )
189 class(constant_parametrization_2d) :: self
190 real(dl),
intent(in) :: x
191 real(dl),
intent(in) :: y
192 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
193 real(dl) :: constantparametrized2dfirstderivativey
195 constantparametrized2dfirstderivativey = 0._dl
197 end function constantparametrized2dfirstderivativey
201 function constantparametrized2dsecondderivativex( self, x, y, eft_cache )
205 class(constant_parametrization_2d) :: self
206 real(dl),
intent(in) :: x
207 real(dl),
intent(in) :: y
208 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
209 real(dl) :: constantparametrized2dsecondderivativex
211 constantparametrized2dsecondderivativex = 0._dl
213 end function constantparametrized2dsecondderivativex
217 function constantparametrized2dsecondderivativey( self, x, y, eft_cache )
221 class(constant_parametrization_2d) :: self
222 real(dl),
intent(in) :: x
223 real(dl),
intent(in) :: y
224 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
225 real(dl) :: constantparametrized2dsecondderivativey
227 constantparametrized2dsecondderivativey = 0._dl
229 end function constantparametrized2dsecondderivativey
233 function constantparametrized2dsecondderivativexy( self, x, y, eft_cache )
237 class(constant_parametrization_2d) :: self
238 real(dl),
intent(in) :: x
239 real(dl),
intent(in) :: y
240 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
241 real(dl) :: constantparametrized2dsecondderivativexy
243 constantparametrized2dsecondderivativexy = 0._dl
245 end function constantparametrized2dsecondderivativexy
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 abstract class for generic parametrizations for 2D functions that are used b...
This module contains the definitions of all the EFTCAMB compile time flags.