39 public jbp_parametrization_1d
43 type,
extends ( parametrized_function_1d ) :: jbp_parametrization_1d
52 procedure :: set_param_number => jbpparametrized1dsetparamnumber
53 procedure :: init_parameters => jbpparametrized1dinitparams
54 procedure :: parameter_value => jbpparametrized1dparametervalues
55 procedure :: feedback => jbpparametrized1dfeedback
58 procedure ::
value => jbpparametrized1dvalue
59 procedure :: first_derivative => jbpparametrized1dfirstderivative
60 procedure :: second_derivative => jbpparametrized1dsecondderivative
61 procedure :: third_derivative => jbpparametrized1dthirdderivative
62 procedure :: integral => jbpparametrized1dintegral
64 end type jbp_parametrization_1d
74 subroutine jbpparametrized1dsetparamnumber( self )
78 class(jbp_parametrization_1d) :: self
81 self%parameter_number = 3
83 end subroutine jbpparametrized1dsetparamnumber
87 subroutine jbpparametrized1dinitparams( self, array )
91 class(jbp_parametrization_1d) :: self
92 real(dl),
dimension(self%parameter_number),
intent(in) :: array
98 end subroutine jbpparametrized1dinitparams
102 subroutine jbpparametrized1dparametervalues( self, i, value )
106 class(jbp_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 jbpparametrized1dparametervalues
127 subroutine jbpparametrized1dfeedback( self, print_params )
131 class(jbp_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(*,*)
'Generalized JBP 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 jbpparametrized1dfeedback
159 function jbpparametrized1dvalue( self, x, eft_cache )
163 class(jbp_parametrization_1d) :: self
164 real(dl),
intent(in) :: x
165 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
166 real(dl) :: jbpparametrized1dvalue
168 jbpparametrized1dvalue = self%w0 +(1._dl - x)*self%wa*x**(self%wn -1._dl)
169 end function jbpparametrized1dvalue
173 function jbpparametrized1dfirstderivative( self, x, eft_cache )
177 class(jbp_parametrization_1d) :: self
178 real(dl),
intent(in) :: x
179 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
180 real(dl) :: jbpparametrized1dfirstderivative
182 jbpparametrized1dfirstderivative = x**(-2.0_dl +self%wn)*(-1._dl +self%wn -x*self%wn)*self%wa
184 end function jbpparametrized1dfirstderivative
188 function jbpparametrized1dsecondderivative( self, x, eft_cache )
192 class(jbp_parametrization_1d) :: self
193 real(dl),
intent(in) :: x
194 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
195 real(dl) :: jbpparametrized1dsecondderivative
197 jbpparametrized1dsecondderivative = -x**(-3._dl +self%wn)*(-1.0_dl +self%wn)*(2._dl +self%wn*(-1._dl +x))*self%wa
199 end function jbpparametrized1dsecondderivative
203 function jbpparametrized1dthirdderivative( self, x, eft_cache )
207 class(jbp_parametrization_1d) :: self
208 real(dl),
intent(in) :: x
209 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
210 real(dl) :: jbpparametrized1dthirdderivative
212 jbpparametrized1dthirdderivative = -x**(-4._dl +self%wn)*(-2.0_dl +self%wn)*(-1._dl +self%wn)*(3._dl +self%wn*(-1._dl +x))*self%wa
214 end function jbpparametrized1dthirdderivative
218 function jbpparametrized1dintegral( self, x, eft_cache )
222 class(jbp_parametrization_1d) :: self
223 real(dl),
intent(in) :: x
224 type(eftcamb_timestep_cache),
intent(in),
optional :: eft_cache
225 real(dl) :: jbpparametrized1dintegral
227 jbpparametrized1dintegral = x**(-1._dl -3._dl*self%w0)*exp(3._dl*(x +x**self%wn*(x*(self%wn -1._dl) -self%wn))*self%wa/(x*self%wn*(self%wn -1._dl)))
229 end function jbpparametrized1dintegral
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 definition of the generalized Jassal-Bagla-Padmanabhan (JBP) parametrization...
This module contains the abstract class for generic parametrizations for 1D functions that are used b...