Nodes of different colours represent the following:
Solid arrows point from a submodule to the (sub)module which it is
descended from. Dashed arrows point from a module or program unit to
modules which it uses.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
Variables
Type
Attributes
Name
Initial
real(kind=rk)
::
dfdx_f
real(kind=rk)
::
dfdx_b
real(kind=rk)
::
dfdx_c
real(kind=rk)
::
expected_dfdx
type(unit_test)
::
ut
Source Code
program test4use fordiffuse mod_func4use forunittestimplicit nonereal(rk)::dfdx_f,dfdx_b,dfdx_c,expected_dfdxtype(unit_test)::ut! compute derivative using forward modedfdx_f=derivative(f=func4,x=1.0_rk,h=1e-5_rk,method='forward')! compute derivative using backward modedfdx_b=derivative(f=func4,x=1.0_rk,h=1e-5_rk,method='backward')! compute derivative using central modedfdx_c=derivative(f=func4,x=1.0_rk,h=1e-5_rk,method='central')! compute derivative analyticallyexpected_dfdx=2.0_rk*(1.0_rk)+2.0_rk! check if derivative is correctcall ut%check(dfdx_f,expected_dfdx,1.0e-2_rk,'test4.1')call ut%check(dfdx_b,expected_dfdx,1.0e-2_rk,'test4.2')call ut%check(dfdx_c,expected_dfdx,1.0e-2_rk,'test4.3')end program test4