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.
Source Code
subroutine interpolate(x,y,x_out,y_out)! TODO this should be a function not subroutinereal(dp),intent(in)::x(:),y(:),x_outreal(dp),intent(out)::y_outinteger::i! Check if x_out is outside the range of xif(x_out<=x(1))theny_out=y(1)elseif(x_out>=x(size(x)))theny_out=y(size(y))else! Find the interval [x(i), x(i+1)] that contains x_outdo i=1,size(x)-1if(x_out>=x(i).and.x_out<=x(i+1))then! Perform linear interpolationy_out=y(i)+(y(i+1)-y(i))*(x_out-x(i))/(x(i+1)-x(i))exit endif enddo endifend subroutine interpolate