Well, you did it in this example, though you have declared the function as integer(2) in one place and integer(4) in the other. If the QSORT you are using wants an INTEGER(2) function make sure that you write the function that way.
This has been a standard feature of Fortran since Fortran 77. (In Fortran 66 the syntax was a bit different.)
I'll fix it. Thank you.
But, how can I create my on procedure that receive a function which is defined outside of the same?
If it is hard to put here, where do I found it?