9

What does it mean when the intrinsic keyword is added to the use statement for a module, as in the following example?

  use, intrinsic :: iso_c_binding

(From 7.1 Overview of Fortran interface, FFTW 3.3.6-pl1)

Does it specify that a module of that name provided with the compiler should be used, even if there is another module of the same name written by the user?

norio
  • 3,652
  • 3
  • 25
  • 33

1 Answers1

9

With use, intrinsic :: ... the intrinsic module is indeed chosen.

There is perhaps a slight subtlety in the question worth addressing. With regards to "a module of that name provided with the compiler should be used", this "should" doesn't indicate a preference but a strong requirement. That is, if there's no such intrinsic module then compilation cannot succeed. This shouldn't be a problem with iso_c_binding but compilers often offer their own non-standard intrinsic modules.

There is no way to say "use the intrinsic module if it's available, but the user-provided one if not".

Graham
  • 7,431
  • 18
  • 59
  • 84
francescalus
  • 30,576
  • 16
  • 61
  • 96