I learned Fortran the Elbonian way in 1962, and have not used it since, so I can't help with questions that are specific to your toolchain.
However, macros are a powerful construct available in many languages, which allow you to do many interesting things. In this instance, you would define the subroutine as a sequence of instructions in the macro definition, and replace every instance of a call to that subroutine with an invocation of the macro, which is expanded by the preprocessor into the defined sequence of instructions, all compiled as inline code, with no call or return instructions needed because the runtime binary just runs through the sequence from top to bottom with no delay.
It's a common technique for speeding up program execution.
... which I'm not sure is your problem,
because you haven't told us what you are trying to do,
you haven't told us what you tried that didn't work,
and you haven't included even a single line of code.
Mike Halloran
Pembroke Pines, FL, USA