- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've read the CVF documentation about Modules, including the advantages section. However, I'm still not sure about when to use them. Why use them over a .lib file for instance...? Am I missing something?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Modules and .lib files are sort of apples and oranges. It's easier to think of modules as an improvement on INCLUDE files. A module allows you to have a self-consistent set of declarations, including constants, types, variables and routines, that is compiled separately. A USE statement makes the public declarations from the module available to your routine, and if you call module routines, the interfaces are checked (something you wouldn't get with just a .LIB file) You can restrict which names are visible from a module, select the names you want to import, and rename others. Modules can USE other modules, so you have nested inheritance.
There are many other advantages of modules - I suggest reading a good book on Fortran 90 to learn more.
Oh, by the way, .LIB files are a great place to put the object files created when you compile a module.
Steve
There are many other advantages of modules - I suggest reading a good book on Fortran 90 to learn more.
Oh, by the way, .LIB files are a great place to put the object files created when you compile a module.
Steve

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page