20 #include "sll_assert.h"
21 #include "sll_working_precision.h"
56 sll_real64,
intent(in) :: x
57 sll_int32,
intent(in) :: degree
58 sll_real64,
intent(in),
dimension(:) :: xi
59 sll_real64,
intent(in),
dimension(:) :: yi
61 sll_real64,
dimension(1:degree + 1) :: p
66 sll_assert(
size(xi) >= degree + 1)
67 sll_assert(
size(yi) >= degree + 1)
68 sll_assert(degree >= 0)
70 if ((x < xi(1)) .or. (x > xi(degree + 1)))
then
86 do deg = degree, 1, -1
88 p(i) = (1.0_f64/(xi(i) - xi(i + m)))*((x - xi(i + m))*p(i) + (xi(i) - x)*p(i + 1))
102 integer,
intent(in)::r, s
103 sll_real64,
intent(out)::w(r:s)
123 tmp = tmp*real(i - j, f64)
126 tmp = tmp*real(i - j, f64)
130 tmp = tmp*real(-j, f64)
133 tmp = tmp*real(-j, f64)
136 tmp = tmp*real(-j, f64)
144 tmp = tmp*real(i - j, f64)
147 tmp = tmp*real(i - j, f64)
151 tmp = tmp*real(-j, f64)
154 tmp = tmp*real(-j, f64)
157 tmp = tmp*real(-j, f64)
173 sll_int32,
intent(in) :: p
174 sll_int32,
intent(out) :: r, s
180 sll_int32,
intent(in) :: p
181 sll_int32,
intent(out) :: r, s
191 sll_real64,
dimension(:),
intent(in) :: fin
192 sll_real64,
dimension(:),
intent(out) :: fout
193 sll_int32,
intent(in) :: n
194 sll_int32,
intent(in) :: r
195 sll_int32,
intent(in) :: s
196 sll_real64,
intent(in) :: w(r:s)
206 if ((i1 > n) .or. (i1 < 1))
then
207 i1 = modulo(i1 - 1, n) + 1
209 tmp = tmp + w(j)*fin(i1)
213 fout(n + 1) = fout(1)
222 sll_real64,
dimension(:),
intent(in) :: fin
223 sll_real64,
dimension(:),
intent(out) :: fout
224 sll_int32,
intent(in) :: n
225 sll_int32,
intent(in) :: r
226 sll_int32,
intent(in) :: s
227 sll_real64,
intent(in) :: w(r:s)
237 if (i1 >= n + 1)
then
243 tmp = tmp + w(j)*fin(i1)
251 sll_real64,
dimension(:),
intent(in) :: fin
252 sll_real64,
dimension(:),
intent(out) :: fout
253 sll_int32,
intent(in) :: n
254 sll_int32,
intent(in) :: r
255 sll_int32,
intent(in) :: s
256 sll_real64,
intent(in) :: w(r:s)
257 sll_int32,
intent(in) :: bc_type
259 select case (bc_type)
260 case (sll_p_periodic)
262 case (sll_p_dirichlet)
265 print *,
'#bad type in weight_product1d'
273 sll_real64,
dimension(:, :),
intent(in) :: fin
274 sll_real64,
dimension(:, :),
intent(out) :: fout
275 sll_int32,
intent(in) :: n(2)
276 sll_int32,
intent(in) :: r
277 sll_int32,
intent(in) :: s
278 sll_real64,
intent(in) :: w(r:s)
279 sll_int32,
intent(in) :: bc_type
288 sll_real64,
dimension(:, :),
intent(in) :: fin
289 sll_real64,
dimension(:, :),
intent(out) :: fout
290 sll_int32,
intent(in) :: n(2)
291 sll_int32,
intent(in) :: r
292 sll_int32,
intent(in) :: s
293 sll_real64,
intent(in) :: w(r:s)
294 sll_int32,
intent(in) :: bc_type
296 sll_real64,
dimension(:),
allocatable :: bufin
297 sll_real64,
dimension(:),
allocatable :: bufout
298 allocate (bufin(n(2) + 1))
299 allocate (bufout(n(2) + 1))
302 bufin(1:n(2) + 1) = fin(i, 1:n(2) + 1)
304 fout(i, 1:n(2) + 1) = bufout(1:n(2) + 1)
313 sll_int32,
intent(in) :: n
314 sll_int32,
intent(in) :: p
315 sll_int32,
intent(out) :: n_size
316 sll_int32,
intent(out) :: dim_size
320 if (modulo(p, 2) == 0)
then
330 sll_int32,
intent(in) :: n
331 sll_int32,
intent(in) :: p
333 sll_int32 :: dim_size
342 sll_int32,
intent(in) :: n(2)
343 sll_int32,
intent(in) :: p(2)
344 sll_int32 :: dim_size(2), n_size(2)
358 sll_real64,
dimension(:),
intent(in) :: fin
359 sll_real64,
dimension(:, :),
pointer :: coef
360 sll_int32,
intent(in) :: n
361 sll_int32,
intent(in) :: p
362 sll_int32,
intent(in) :: bc_type
366 coef(1, 1:n + 1) = fin(1:n + 1)
370 if (modulo(p, 2) == 1)
then
379 sll_real64,
dimension(:, :),
intent(in) :: fin
380 sll_real64,
dimension(:, :, :, :),
pointer :: coef
381 sll_int32,
intent(in) :: n(2)
382 sll_int32,
intent(in) :: p(2)
383 sll_int32,
intent(in) :: bc_type(2)
387 sll_real64,
dimension(:),
pointer :: bufin_x1, bufin_x2
388 sll_real64,
dimension(:, :),
pointer :: bufout_x1, bufout_x2
390 sll_int32 :: n_size(2)
391 sll_int32 :: dim_size(2)
397 allocate (bufin_x1(n(1) + 1))
398 allocate (bufout_x1(dim_size(1), n_size(1)))
399 allocate (bufin_x2(n(2) + 1))
400 allocate (bufout_x2(dim_size(2), n_size(2)))
404 bufin_x2(1:n(2) + 1) = fin(i, 1:n(2) + 1)
406 do j = 1, dim_size(2)
407 coef(1, j, i, 1:n_size(2)) = bufout_x2(j, 1:n_size(2))
413 do j = 1, dim_size(2)
414 bufin_x1(1:n(1) + 1) = coef(1, j, 1:n(1) + 1, i)
416 do k = 1, dim_size(1)
417 coef(k, j, 1:n_size(1), i) = bufout_x1(k, 1:n_size(1))
422 deallocate (bufin_x1)
423 deallocate (bufout_x1)
424 deallocate (bufin_x2)
425 deallocate (bufout_x2)
Describe different boundary conditions.
subroutine, public sll_s_compact_derivative_weight(w, r, s)
subroutine compute_interpolants_hermite1d(fin, coef, N, p, bc_type)
integer, parameter sll_size_stencil_max
integer, parameter sll_size_stencil_min
subroutine weight_product1d_nat(fin, fout, N, w, r, s)
real(kind=f64) function, public sll_f_lagrange_interpolate(x, degree, xi, yi)
subroutine weight_product1d(fin, fout, N, w, r, s, bc_type)
subroutine weight_product2d_x2(fin, fout, N, w, r, s, bc_type)
real(kind=f64) function, dimension(:, :), pointer initialize_interpolants_hermite1d(N, p)
subroutine compute_size_hermite1d(N, p, N_size, dim_size)
real(kind=f64) function, dimension(:, :, :, :), pointer initialize_interpolants_hermite2d(N, p)
subroutine compute_stencil_minus(p, r, s)
subroutine weight_product2d_x1(fin, fout, N, w, r, s, bc_type)
subroutine, public sll_s_compute_stencil_plus(p, r, s)
subroutine compute_interpolants_hermite2d(fin, coef, N, p, bc_type)
subroutine weight_product1d_per(fin, fout, N, w, r, s)