https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79313
--- Comment #3 from Steve Kargl <sgk at troutmask dot apl.washington.edu> --- On Wed, Feb 01, 2017 at 04:37:52AM +0000, kargl at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79313 > > --- Comment #2 from kargl at gcc dot gnu.org --- > Your code looks bogus. If you add > > use omp_lib > > to the code. It compiles and works. > An alternative is to add the line include 'omp_lib.h' after the 'implicit none' statement in lieu of the module. A 3rd alternative is change your declaration in the subroutine to integer, external :: omp_get_thread_num, omp_get_num_threads