Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

module public access

jaeger0
Beginner
514 Views
I want to make accessible a including module of a module.

if i define

module my_module
use my_module_def
integer, private param1
integer, public param2

then in a subroutine/module where I use my_module, also my_module_def is accessible

but if I define
module my_module
use my_module_def
private
integer param1
integer, public param2
...

then it's not.

Is there an other way to make the module my_module_def accessible ? "public :: use FILE_IO_DEF" is not possible

0 Kudos
1 Reply
Steven_L_Intel1
Employee
514 Views

Modules are not public or private. What the private statement does is change the "default accessibility" for symbols in that scope. You can add PUBLIC for specific symbols you want to be visible from my_module_def in my_modile and that will work. Otherwise, for users of my_modules, all symbols are inaccessible other than the ones you explicitly make public.
0 Kudos
Reply