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),
dimension(:,:), allocatable
::
dfdx
real(kind=rk),
dimension(:,:), allocatable
::
expected_dfdx
integer
::
i
type(unit_test)
::
ut
Source Code
program test3use kindsuse mod_func3use fordiffuse forunittestimplicit nonereal(rk),dimension(:,:),allocatable::dfdx,expected_dfdxinteger::itype(unit_test)::ut! compute derivativedfdx=derivative(f=func3,x=[1.0_rk,-1.0_rk],h=tiny(0.0_rk))! reference derivativeallocate(expected_dfdx(size(dfdx,1),size(dfdx,2)))expected_dfdx(1,1)=2.0_rk*(1.0_rk)expected_dfdx(1,2)=(-1.0_rk)expected_dfdx(2,1)=3.0_rk*(1.0_rk)**2expected_dfdx(2,2)=1.5_rk*(-1.0_rk)**2expected_dfdx(3,1)=4.0_rk*(1.0_rk)**3expected_dfdx(3,2)=2.0_rk*(-1.0_rk)**3! check if derivative is correctcall ut%check(dfdx,expected_dfdx,1.0e-6_rk,'test3')deallocate(dfdx,expected_dfdx)end program test3