|
subroutine, public | dl_mg_defco_fd_initialise () |
| Initialises the finite differences by completing the computation of the finite difference coefficients that have been half-prepared by the DATA statements. There is no need to call this subroutine explicitly – it will be called upon first use of any computational FD subroutine. You can call it explicitly if you like, and any number of times. More...
|
|
subroutine | dl_mg_defco_fd_derivative (fcn_der, fcn, n, d, order, square_result) |
|
subroutine, public | dl_mg_defco_fd_gradient (grad_fcn, fcn, order) |
|
subroutine, public | dl_mg_defco_fd_laplacian (lap_fcn, fcn, order) |
|
subroutine, public | dl_mg_defco_fd_mod_grad_sqd (mod_grad_sqd_fcn, fcn, order) |
|
subroutine | parallel_prepare_fd_halos (fcn, axis) |
|
subroutine | parallel_destroy_fd_halos |
|
|
integer, parameter, public | max_order = 12 |
|
logical | dl_mg_defco_fd_initialised = .false. |
|
real(kind=wp), dimension(:,:,:), allocatable | halo_left |
|
real(kind=wp), dimension(:,:,:), allocatable | halo_right |
|
integer, parameter | max_order_half = max_order/2 |
|
integer, parameter | ndata1 = (2*max_order+1) |
|
integer, parameter | ndata = (max_order+1)*ndata1 |
|
real(kind=wp), dimension(-max_order:max_order, -max_order_half:max_order_half, max_order, 2) | coeff |
|
real(kind=wp), dimension(max_order, 2), parameter | norms = reshape( source = (/0D0, 1D0/2D0, 0D0, 1D0/12D0, 0D0, 1D0/60D0, 0D0, 1D0/840D0, 0D0, 1D0/2520D0, 0D0, 1D0/27720D0, 0D0, 1D0, 0D0, 1D0/12D0,0D0,1D0/180D0,0D0,1D0/5040D0,0D0,1D0/25200D0, 0D0,1D0/831600D0 /), shape = (/max_order, 2/) ) |
|
computes higher order finite differences in parallel
Adapted from ONETEP's finite_differences module.
Written by Jacek Dziedzic in 08/2010.
Modified for use within DL_MG by J. C. Womack, 2016
Optimised by Lucian Anton, 2017
This module defines the subroutines for finite-difference calculations of the gradient, squared-modulus-of-gradient and the laplacian for a quantity on a GRID_INFO grid.
Finite differences of orders {2,4,6,8,10,12} can be used. Where 2nd order formulas are unavailable, 12th order is used instead. Slab-parallelism is automatically taken care of by internally using halos. Grid boundaries are taken care of by using progressively more forward- or backward-FD's.