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.
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.
Source Code
elemental pure subroutine find_nearest(this,nearest_color)class(color),intent(inout)::thistype(color),intent(out)::nearest_colorinteger(ik)::i,closestColorIndex,ri,gi,bireal(rk)::dist,min_disttype(color),dimension(:),allocatable::colorscall initialize_colors(colors)min_dist=huge(min_dist)closestColorIndex=0doconcurrent(i=1:size(colors))call colors(i)%get_rgb(ri,gi,bi)dist=sqrt(&(real((ri-this%r),kind=rk)/255.0_rk)**2&+(real((gi-this%g),kind=rk)/255.0_rk)**2&+(real((bi-this%b),kind=rk)/255.0_rk)**2&)if(dist<min_dist)thenmin_dist=distclosestColorIndex=iend if end do if(closestColorIndex==0)then error stop'error: no color found'elsenearest_color=colors(closestColorIndex)end if end subroutine find_nearest