- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This may be a feature request (or it may work now - haven't tried it).
Often in converting a legacy program from using COMMON blocks to using MODULES, it is often desirable to add flexability by using user defined types, pointers and allocatable arrays. The new data layout is contained within Modules. The legacy code, formerly using COMMONs now needs to deal with something like
YourObject%Position(1)
Where formerly in the code you may have POSX
My current work around is to use FPP with
#define POSX YourObject%Position(1)
The problem with using #define is it makes debugging difficult (macros are not expanded by the debugger).
With permitting ASSOCIATE inside the data portion of a module, you could then have an analog of:
EQUIVILANCE
and
C++-like member functions that return references and/or values
---------------------------
The documentation of ASSOCIATE describes it as using as having a paired block:
[name:] ASSOCIATE asso-entity[, asso-entity]...
block
END ASSOCIATE [name]
What would be nice to permit is for a FORTRAN include file to contain open ended ASSOCIATEs without the corisponding END ASSOCIATE, and then have an implicit end ASSOCIATE at the end of scope of the subroutine/function, or as an alternative, requiring "END ASSOCIATE" to indicate end of all ASSOCIATE blocks.
Jim Dempsey
Often in converting a legacy program from using COMMON blocks to using MODULES, it is often desirable to add flexability by using user defined types, pointers and allocatable arrays. The new data layout is contained within Modules. The legacy code, formerly using COMMONs now needs to deal with something like
YourObject%Position(1)
Where formerly in the code you may have POSX
My current work around is to use FPP with
#define POSX YourObject%Position(1)
The problem with using #define is it makes debugging difficult (macros are not expanded by the debugger).
With permitting ASSOCIATE inside the data portion of a module, you could then have an analog of:
EQUIVILANCE
and
C++-like member functions that return references and/or values
---------------------------
The documentation of ASSOCIATE describes it as using as having a paired block:
[name:] ASSOCIATE asso-entity[, asso-entity]...
block
END ASSOCIATE [name]
What would be nice to permit is for a FORTRAN include file to contain open ended ASSOCIATEs without the corisponding END ASSOCIATE, and then have an implicit end ASSOCIATE at the end of scope of the subroutine/function, or as an alternative, requiring "END ASSOCIATE
Jim Dempsey
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, there is no such feature like that.

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