Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fortran intrinsic keyword in module use statement

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?

like image 785
norio Avatar asked Apr 20 '17 14:04

norio


1 Answers

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".

like image 62
francescalus Avatar answered Sep 30 '22 03:09

francescalus