388 integer,
intent(in) :: q
389 integer,
intent(in) :: local_buff_size, fd_number_in, fd_order_in
390 type(int_bounds_info),
optional,
intent(in) :: offset_s
391 real(wp),
allocatable,
dimension(:,:),
intent(inout) :: fd_coeff_s
392 real(wp),
dimension(-local_buff_size:q + local_buff_size),
intent(in) :: s_cc
400 if (
present(offset_s))
then
401 lb = -max(fd_number_in, offset_s%beg)
402 le = q + max(fd_number_in, offset_s%end)
405 le = q + fd_number_in
415 lb = max(lb, -local_buff_size + fd_number_in)
416 le = min(le, q + local_buff_size - fd_number_in)
419 if (fd_order_in == 1)
then
421 fd_coeff_s(-1, i) = 0._wp
422 fd_coeff_s(0, i) = -1._wp/(s_cc(i + 1) - s_cc(i))
423 fd_coeff_s(1, i) = -fd_coeff_s(0, i)
427 else if (fd_order_in == 2)
then
429 fd_coeff_s(-1, i) = -1._wp/(s_cc(i + 1) - s_cc(i - 1))
430 fd_coeff_s(0, i) = 0._wp
431 fd_coeff_s(1, i) = -fd_coeff_s(-1, i)
437 fd_coeff_s(-2, i) = 1._wp/(s_cc(i - 2) - 8._wp*s_cc(i - 1) - s_cc(i + 2) + 8._wp*s_cc(i + 1))
438 fd_coeff_s(-1, i) = -8._wp*fd_coeff_s(-2, i)
439 fd_coeff_s(0, i) = 0._wp
440 fd_coeff_s(1, i) = -fd_coeff_s(-1, i)
441 fd_coeff_s(2, i) = -fd_coeff_s(-2, i)
subroutine s_compute_finite_difference_coefficients(q, s_cc, fd_coeff_s, local_buff_size, fd_number_in, fd_order_in, offset_s)
Compute the centered finite-difference coefficients for first-order spatial derivatives in the s-coor...