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.
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
recursive function go(ipattern,ints)result(ival)integer(ip),dimension(:),intent(in)::ipatterninteger(ip),dimension(:),intent(in)::intsinteger(ip)::ivalinteger(ip),dimension(:),allocatable::ival_vecinteger(ip)::idxlogical::found! first check the cache:call cache%get([ipattern,ints],idx,ival_vec,found)if(found)thenival=ival_vec(1)else if(size(ints)==0)then! no more intsival=merge(0,1,any(ipattern==NUMBER))! if any more numbers, invalidelse if(size(ipattern)==0)thenival=0! too many intselse! process next element in patternselect case(ipattern(1))case(NUMBER);ival=ipound(ipattern,ints)case(POINT);ival=ipoint(ipattern,ints)case(QUESTION);ival=ipoint(ipattern,ints)+ipound(ipattern,ints)end select end if! cache this function call:ival_vec=[ival]call cache%put(idx,[ipattern,ints],ival_vec)end if end function go