deriv_2nd_all
Module
Description
$Id$
This module is a copy of the ‘deriv_2nd’ module, but implements all derivatives, including up to 6th order, with 2nd order accuracy. In ‘deriv_2nd’ the 3rd or higher derivatives are otherwise unavailable. To provide higher derivatives in this module, nghost must be 3.
** AUTOMATIC CPARAM.INC GENERATION ************************ Declare (for generation of cparam.inc) the number of f array variables and auxiliary variables added by this module
CPARAM integer, parameter :: nghost = 3
Quick access
- Variables:
bval_from_3rd,bval_from_3rd_arr,bval_from_3rd_scl,bval_from_4th,bval_from_4th_arr,bval_from_4th_scl,bval_from_neumann,bval_from_neumann_arr,bval_from_neumann_scl,der,der2,der2_coef0,der2_coef1,der2_coef2,der2_coef3,der2_coef4,der2_coef5,der2_main,der2_other,der6,der6_main,der6_other,der_main,der_onesided_4_slice,der_onesided_4_slice_main,der_onesided_4_slice_main_pt,der_onesided_4_slice_other_pt,der_other,deri,deri_2d,deri_3d,derij,derij_main,derij_other,derivative_1,set_ghosts_for_onesided_ders_1d,test- Routines:
calc_coeffs_1(),der2_minmod(),der2_pencil(),der2_x(),der2_z(),der2i2j2k(),der3(),der3i2j1k(),der3i3j(),der4(),der4i1j1k(),der4i2j(),der5(),der5_single(),der5i1j(),der6(),der6_pencil(),der_onesided_4_slice_other(),der_pencil(),der_upwind1st(),der_x(),der_z(),deri_3d_inds(),distr_der(),finalize_deriv(),heatflux_deriv_x(),initialize_deriv(),set_ghosts_for_onesided_ders()
Needed modules
messages: $Id$cdata: $Id$general(keep_compiler_quiet()): $Id$
Variables
- deriv/bval_from_3rd [public]
- deriv/bval_from_3rd_arr [private]
- deriv/bval_from_3rd_scl [private]
- deriv/bval_from_4th [public]
- deriv/bval_from_4th_arr [private]
- deriv/bval_from_4th_scl [private]
- deriv/bval_from_neumann [public]
- deriv/bval_from_neumann_arr [private]
- deriv/bval_from_neumann_scl [private]
- deriv/der [public]
- deriv/der2 [public]
- deriv/der2_main [private]
- deriv/der2_other [private]
- deriv/der6 [public]
- deriv/der6_main [private]
- deriv/der6_other [private]
- deriv/der_main [private]
- deriv/der_onesided_4_slice [public]
- deriv/der_onesided_4_slice_main [private]
- deriv/der_onesided_4_slice_main_pt [private]
- deriv/der_onesided_4_slice_other_pt [private]
- deriv/der_other [private]
- deriv/derij [public]
- deriv/derij_main [private]
- deriv/derij_other [private]
Subroutines and functions
- subroutine deriv/initialize_deriv()
Initialize stencil coefficients (dummy routine)
- Call to:
fatal_error(),not_implemented(),der5_single(),der_z(),heatflux_deriv_x()
- subroutine deriv/calc_coeffs_1(grid, coeffs)
- Parameters:
grid (2) [real,in]
coeffs (3) [real,out]
- Call to:
fatal_error(),not_implemented(),der5_single(),der_z(),heatflux_deriv_x()
- subroutine deriv/der_pencil(j, pencil, df)
Calculate first derivative of any x, y or z pencil.
01-nov-07/anders: adapted from der 25-aug-09/axel: added fatal_error, because it is not adapted yet
- Parameters:
j [integer,in]
pencil (*) [real,in]
df (*) [real,out]
- Call to:
fatal_error(),not_implemented(),der5_single(),der_z(),heatflux_deriv_x()
- subroutine deriv/distr_der(arr, idir, der[, order])
Dummy
- Parameters:
arr (,) [real,in]
idir [integer,in]
der (,) [real,out]
order [integer,in,]
- Call to:
not_implemented(),fatal_error(),der5_single(),der_z(),heatflux_deriv_x()
- subroutine deriv/der2_pencil(j, pencil, df2)
Calculate 2nd derivative of any x, y or z pencil.
01-nov-07/anders: adapted from der2 25-aug-09/axel: added fatal_error, because it is not adapted yet
- Parameters:
j [integer,in]
pencil (*) [real,in]
df2 (*) [real,out]
- Call to:
fatal_error(),der5_single(),not_implemented(),der_z(),heatflux_deriv_x()
- subroutine deriv/der3(f, k, df, j[, ignoredx])
Calculate 3rd derivative of a scalar, get scalar
16-Oct-2024/PABourdin: adapted from deriv module
- Parameters:
- Call to:
fatal_error(),der5_single(),not_implemented(),der_z(),heatflux_deriv_x()
- subroutine deriv/der4(f, k, df, j[, ignoredx[, upwind]])
- Calculate 4th derivative of a scalar, get scalar
Used for hyperdiffusion that affects small wave numbers as little as
- possible (useful for density).
The optional flag IGNOREDX is useful for numerical purposes, where
you want to affect the Nyquist scale in each direction, independent of the ratios dx:dy:dz.
16-Oct-2024/PABourdin: adapted from deriv module
- Parameters:
- Call to:
fatal_error(),der5_single(),not_implemented(),der_z(),heatflux_deriv_x()
- subroutine deriv/der5(f, k, df, j[, ignoredx])
- Calculate 5th derivative of a scalar, get scalar
Used for hyperdiffusion that affects small wave numbers as little as
- possible (useful for density).
The optional flag IGNOREDX is useful for numerical purposes, where
you want to affect the Nyquist scale in each direction, independent of the ratios dx:dy:dz.
16-Oct-2024/PABourdin: adapted from deriv module
- Parameters:
- Use :
- Call to:
fatal_error(),der5_single(),not_implemented(),der_z(),heatflux_deriv_x()
- subroutine deriv/der6_pencil(j, pencil, df6[, ignoredx[, upwind]])
Calculate 6th derivative of any x, y or z pencil.
16-Oct-2024/PABourdin: adapted from deriv module
- Parameters:
j [integer,in]
pencil (*) [real,in]
df6 (*) [real,out]
ignoredx [logical,in,]
upwind [logical,in,]
- Use :
- Call to:
fatal_error(),der5_single(),not_implemented(),der_z(),heatflux_deriv_x()
- function deriv/der5_single(f, j, dc1)
computes 5th order derivative of function given by f at position j
3-oct-12/MR: coded
- Parameters:
f (*) [real,in]
j [integer,in]
dc1 (*) [real,in]
- Return:
der5_single [real]
- Call to:
fatal_error(),not_implemented(),der_z(),heatflux_deriv_x()
- subroutine deriv/der5i1j(f, k, df, i, j)
Calculate 6th derivative with respect to two different directions.
05-dec-06/anders: adapted from derij 25-aug-09/axel: added fatal_error, because it is not adapted yet
- Parameters:
- Call to:
fatal_error(),not_implemented(),der_z(),heatflux_deriv_x()
- subroutine deriv/der4i2j(f, k, df, i, j)
Calculate 6th derivative with respect to two different directions.
02-apr-17/wlyra: adapted from der5i1j
- Parameters:
- Call to:
fatal_error(),not_implemented(),der_z(),heatflux_deriv_x()
- subroutine deriv/der2i2j2k(f, k, df)
Mixed 6th derivative of der2x(der2y(der2z(f))). Worked out symbolically in python. Result as spit from the python routine.
02-apr-17/wlyra: coded
- Parameters:
- Call to:
fatal_error(),not_implemented(),der_z(),heatflux_deriv_x()
- subroutine deriv/der3i3j(f, k, df, i, j)
- Parameters:
- Call to:
fatal_error(),not_implemented(),der_z(),heatflux_deriv_x()
- subroutine deriv/der3i2j1k(f, ik, df, i, j, k)
- Parameters:
- Call to:
fatal_error(),not_implemented(),der_z(),heatflux_deriv_x()
- subroutine deriv/der4i1j1k(f, ik, df, i, j, k)
- Parameters:
- Call to:
fatal_error(),not_implemented(),der_z(),heatflux_deriv_x()
- subroutine deriv/der_upwind1st(f, uu, k, df, j)
First order upwind derivative of variable Useful for advecting non-logarithmic variables
25-aug-09/axel: added fatal_error, because it is not adapted yet
- Parameters:
- Call to:
fatal_error(),not_implemented(),der_z(),heatflux_deriv_x()
- subroutine deriv/der_onesided_4_slice_other(f, sgn, df, pos, j)
Calculate x/y/z-derivative on a yz/xz/xy-slice at gridpoint pos. Uses a one-sided 4th order stencil. sgn = +1 for forward difference, sgn = -1 for backwards difference.
Because of its original intended use in relation to solving characteristic equations on boundaries (NSCBC), this sub should return only PARTIAL derivatives, NOT COVARIANT. Applying the right scaling factors and connection terms should instead be done when solving the characteristic equations.
7-jul-08/arne: coded.
- Parameters:
- Call to:
fatal_error(),not_implemented(),der_z(),heatflux_deriv_x()
- subroutine deriv/der_z(f, df)
z derivative operating on a z-dependent 1-D array
19-may-11/bing: adapted from der_main; note that f is not the f array!
- Parameters:
- Call to:
fatal_error(),der_z(),not_implemented(),heatflux_deriv_x()
- subroutine deriv/der2_z(f, df2)
z derivative operating on a z-dependent 1-D array
19-may-11/bing: adapted from der_z and der_main
- Parameters:
- Call to:
der_z(),fatal_error(),not_implemented(),heatflux_deriv_x()
- subroutine deriv/der_x(f, df)
dummy routine
- Parameters:
- Use :
- Call to:
- subroutine deriv/der2_x(f, df2)
dummy routine
- Parameters:
- Use :
- Call to:
- subroutine deriv/der2_minmod(f, j, delfk, delfkp1, delfkm1, k)
Dummy routine
09-Sep-2024/PABourdin: not yet implemented
- Parameters:
- Call to:
- subroutine deriv/finalize_deriv()
Dummy
- Call to:
- subroutine deriv/deri_3d_inds(f, df, inds, j[, lignored[, lnometric]])
dummy routine for compatibility
26-mar-12/MR: coded
- Parameters:
- Call to:
- function deriv/heatflux_deriv_x(f, inh, fac, topbot)
dummy routine
17-apr-12/MR: coded
- Parameters:
- Return:
heatflux_deriv_x [logical]
- Call to:
- subroutine deriv/set_ghosts_for_onesided_ders(f, topbot, j, idir[, l2nd_])
Dummy.
- Parameters:
- Call to: