48 REAL(wp),
INTENT(IN):: w,z
50 REAL(wp):: gamln_z , gamln_w , gamln_zw
82 REAL(wp) :: ser , tmp , x , y , cof(14)
84 cof(1) = 57.1562356658629235
85 cof(2) = -59.5979603554754912
86 cof(3) = 14.1360979747417471
87 cof(4) = -0.491913816097620199
88 cof(5) = 0.339946499848118887e-4_wp
89 cof(6) = 0.465236289270485756e-4_wp
90 cof(7) = -0.983744753048795646e-4_wp
91 cof(8) = 0.158088703224912494e-3_wp
92 cof(9) = -0.210264441724104883e-3_wp
93 cof(10) = 0.217439618115212643e-3_wp
94 cof(11) = -0.164318106536763890e-3_wp
95 cof(12) = 0.844182239838527433e-4_wp
96 cof(13) = -0.261908384015814087e-4_wp
97 cof(14) = .368991826595316234e-5_wp
101 WRITE(*,*)
"bad arg in gammln" 109 tmp = x + 5.2421875_wp
110 tmp = ( x + 0.5_wp ) * log(tmp) - tmp
112 ser = 0.999999999999997092
121 gammln = tmp + log(2.5066282746310005*ser/x)
136 subroutine gaulegf(x1, x2, x, w, n)
139 integer,
intent(in) :: n
140 REAL(wp),
intent(in) :: x1, x2
141 REAL(wp),
dimension(n),
intent(out) :: x, w
143 REAL(wp) :: p1, p2, p3, pp, xl, xm, z, z1
144 REAL(wp),
parameter :: eps=3.0e-14_wp
150 z = cos(3.141592654_wp*(i-0.25_wp)/(n+0.5_wp))
152 do while(abs(z-z1) .gt. eps)
158 p1 = ((2.0_wp*j-1.0_wp)*z*p2-(j-1.0_wp)*p3)/j
160 pp = n*(z*p1-p2)/(z*z-1.0_wp)
166 w(i) = (2.0_wp*xl)/((1.0_wp-z*z)*pp*pp)
181 REAL(wp),
INTENT(IN) :: Ml
182 REAL(wp),
INTENT(IN) :: Mr
183 REAL(wp),
INTENT(IN) :: mom(0:1)
184 REAL(wp),
INTENT(OUT) :: Ma
185 REAL(wp),
INTENT(OUT) :: Mb
186 REAL(wp),
INTENT(OUT) :: alfa
187 REAL(wp),
INTENT(OUT) :: beta
188 REAL(wp),
INTENT(OUT) :: gamma1
189 REAL(wp),
INTENT(OUT) :: gamma2
191 REAL(wp) :: M , N , Mmax , Mmin
196 mmin = ( mr + 2.0_wp*ml ) / 3.0_wp
197 mmax = ( 2.0_wp*mr + ml ) / 3.0_wp
207 ELSEIF ( m/n .LT. mmin)
THEN 209 alfa = (n*(m - n*mr))/((ml - mr)*(m - n*ml))
211 gamma1 = (n*ml - 2*m + n*mr)/(m - n*ml)
214 ELSEIF ( m/n .GT. mmax )
THEN 217 beta = (n*(m - n*ml))/((ml - mr)*(m - n*mr))
219 gamma2 = (n*ml - 2*m + n*mr)/(m - n*mr)
223 alfa = (2.0_wp*(n*ml - 3.0_wp*m + 2.0_wp*n*mr))/(ml - mr)**2
224 beta = -(2.0_wp*(2.0_wp*n*ml - 3.0_wp*m + n*mr))/(ml - mr)**2
integer n_mom
Number of moments.
integer, parameter max_nmom
Maximum number of moments.
subroutine linear_reconstruction(Ml, Mr, mom, Ma, Mb, alfa, beta, gamma1, gamma2)
real(wp) function gammln(xx)
Gamma function logarithm.
integer n_nodes
Number of nodes for the quadrature.
subroutine gaulegf(x1, x2, x, w, n)
Method of Moments module.
integer, parameter wp
working precision
real(wp) function beta_function(z, w)
Beta function.