334 integer,
intent(in) :: q
335 integer,
intent(in) :: local_buff_size, fd_number_in, fd_order_in
336 type(int_bounds_info),
optional,
intent(in) :: offset_s
337 real(wp),
allocatable,
dimension(:,:),
intent(inout) :: fd_coeff_s
338 real(wp),
dimension(-local_buff_size:q + local_buff_size),
intent(in) :: s_cc
341 if (
present(offset_s))
then
343 le = q + offset_s%end
349#ifdef MFC_POST_PROCESS
350 if (
allocated(fd_coeff_s))
deallocate (fd_coeff_s)
351 allocate (fd_coeff_s(-fd_number_in:fd_number_in,lb:le))
355 if (fd_order_in == 1)
then
357 fd_coeff_s(-1, i) = 0._wp
358 fd_coeff_s(0, i) = -1._wp/(s_cc(i + 1) - s_cc(i))
359 fd_coeff_s(1, i) = -fd_coeff_s(0, i)
363 else if (fd_order_in == 2)
then
365 fd_coeff_s(-1, i) = -1._wp/(s_cc(i + 1) - s_cc(i - 1))
366 fd_coeff_s(0, i) = 0._wp
367 fd_coeff_s(1, i) = -fd_coeff_s(-1, i)
373 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))
374 fd_coeff_s(-1, i) = -8._wp*fd_coeff_s(-2, i)
375 fd_coeff_s(0, i) = 0._wp
376 fd_coeff_s(1, i) = -fd_coeff_s(-1, i)
377 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...