You could consider using both modules and add the logic elsewhere provided that you can solve the problem in pure Fortran without preprocessing.
However, if you are addressing a portability issue preprocessing might might be your best shot. For example, if you want to be able to compile a code that uses GNU extensions with both the GNU Fortran Compiler and the the Intel Fortran Compiler you would use a preprocessing directive such as this one to address that:
#if defined(__INTEL_COMPILER)
use :: ifport
#endif
The Intel Fortran Portability module is used only when the __INTEL_COMPILER
macro is defined and that happens when you are compiling the source with the Intel Fortran Compiler.
I am sharing a link to one of my GitHub repositories where I use preprocessing for anyone interested in looking at more examples.