39 public bilinear_parametrization_2d
43 type,
extends ( parametrized_function_2d ) :: bilinear_parametrization_2d
45 real(dl) :: linear_value_1
46 real(dl) :: linear_value_2
51 procedure :: set_param_number => bilinearparametrized2dsetparamnumber
52 procedure :: init_parameters => bilinearparametrized2dinitparams
53 procedure :: parameter_value => bilinearparametrized2dparametervalues
54 procedure :: feedback => bilinearparametrized2dfeedback
57 procedure ::
value => bilinearparametrized2dvalue
58 procedure :: first_derivative_x => bilinearparametrized2dfirstderivativex
59 procedure :: first_derivative_y => bilinearparametrized2dfirstderivativey
60 procedure :: second_derivative_x => bilinearparametrized2dsecondderivativex
61 procedure :: second_derivative_y => bilinearparametrized2dsecondderivativey
62 procedure :: second_derivative_xy => bilinearparametrized2dsecondderivativexy
64 end type bilinear_parametrization_2d
74 subroutine bilinearparametrized2dsetparamnumber( self )
78 class(bilinear_parametrization_2d) :: self
81 self%parameter_number = 2
83 end subroutine bilinearparametrized2dsetparamnumber
87 subroutine bilinearparametrized2dinitparams( self, array )
91 class(bilinear_parametrization_2d) :: self
92 real(dl),
dimension(self%parameter_number),
intent(in) :: array
94 self%linear_value_1 = array(1)
95 self%linear_value_2 = array(2)
97 end subroutine bilinearparametrized2dinitparams
101 subroutine bilinearparametrized2dparametervalues( self, i, value )
105 class(bilinear_parametrization_2d) :: self
106 integer ,
intent(in) :: i
107 real(dl) ,
intent(out) ::
value 111 value = self%linear_value_1
113 value = self%linear_value_2
115 write(*,*)
'Illegal index for parameter_names.' 116 write(*,*)
'Maximum value is:', self%parameter_number
117 call mpistop(
'EFTCAMB error')
120 end subroutine bilinearparametrized2dparametervalues
124 subroutine bilinearparametrized2dfeedback( self, print_params )
128 class(bilinear_parametrization_2d) :: self
129 logical,
optional :: print_params
133 real(dl) :: param_value
134 character(len=EFT_names_max_length) :: param_name
135 logical :: print_params_temp
137 if (
present(print_params) )
then 138 print_params_temp = print_params
140 print_params_temp = .true.
143 write(*,*)
'Bilinear function: ', self%name
144 if ( print_params_temp )
then 145 do i=1, self%parameter_number
146 call self%parameter_names( i, param_name )
147 call self%parameter_value( i, param_value )
148 write(*,
'(a23,a,F12.6)') param_name,
'=', param_value
152 end subroutine bilinearparametrized2dfeedback
157 function bilinearparametrized2dvalue( self, x, y, eft_cache )
161 class(bilinear_parametrization_2d) :: self
162 real(dl),
intent(in) :: x
163 real(dl),
intent(in) :: y
164 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
165 real(dl) :: bilinearparametrized2dvalue
167 bilinearparametrized2dvalue = self%linear_value_1*x + self%linear_value_2*y
169 end function bilinearparametrized2dvalue
175 function bilinearparametrized2dfirstderivativex( self, x, y, eft_cache )
179 class(bilinear_parametrization_2d) :: self
180 real(dl),
intent(in) :: x
181 real(dl),
intent(in) :: y
182 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
183 real(dl) :: bilinearparametrized2dfirstderivativex
185 bilinearparametrized2dfirstderivativex = self%linear_value_1
187 end function bilinearparametrized2dfirstderivativex
193 function bilinearparametrized2dfirstderivativey( self, x, y, eft_cache )
197 class(bilinear_parametrization_2d) :: self
198 real(dl),
intent(in) :: x
199 real(dl),
intent(in) :: y
200 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
201 real(dl) :: bilinearparametrized2dfirstderivativey
203 bilinearparametrized2dfirstderivativey = self%linear_value_2
205 end function bilinearparametrized2dfirstderivativey
209 function bilinearparametrized2dsecondderivativex( self, x, y, eft_cache )
213 class(bilinear_parametrization_2d) :: self
214 real(dl),
intent(in) :: x
215 real(dl),
intent(in) :: y
216 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
217 real(dl) :: bilinearparametrized2dsecondderivativex
219 bilinearparametrized2dsecondderivativex = 0._dl
221 end function bilinearparametrized2dsecondderivativex
225 function bilinearparametrized2dsecondderivativey( self, x, y, eft_cache )
229 class(bilinear_parametrization_2d) :: self
230 real(dl),
intent(in) :: x
231 real(dl),
intent(in) :: y
232 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
233 real(dl) :: bilinearparametrized2dsecondderivativey
235 bilinearparametrized2dsecondderivativey = 0._dl
237 end function bilinearparametrized2dsecondderivativey
241 function bilinearparametrized2dsecondderivativexy( self, x, y, eft_cache )
245 class(bilinear_parametrization_2d) :: self
246 real(dl),
intent(in) :: x
247 real(dl),
intent(in) :: y
248 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
249 real(dl) :: bilinearparametrized2dsecondderivativexy
251 bilinearparametrized2dsecondderivativexy = 0._dl
253 end function bilinearparametrized2dsecondderivativexy
This module contains the definition of the EFTCAMB caches. These are used to store parameters that ca...
This module contains the definition of the bilinear parametrization, inheriting from parametrized_fun...
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.