- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've looked everywhere on the internet for accessing Fortran common block variables in C#, can't really find anything. Does anyone have any idea how to do this? I can get access to Fortran subroutines, functions, etc. but cant seem to get to common blocks. I've got over 500 Fortran variables I need to get access to and writing get or set subroutines in Fortran would be very time consuming.
Any ideas?
Any ideas?
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there a need to continue to use common blocks? (do you require some form of linear arrangement of the data?)
You should simply move the common block data in tomodules which can be easily shared with c#.
You should simply move the common block data in tomodules which can be easily shared with c#.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem is that C# is a .NET language and does not link into the same address space as non-managed code, so there is no sharing of vartiables. Writing access routines is perhaps the best way. You could reduce the work by getting the address of the first variable in each COMMON block and using that as a pointer to a struct of the appropriate layout.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - bmchenry
Is there a need to continue to use common blocks? (do you require some form of linear arrangement of the data?)
You should simply move the common block data in tomodules which can be easily shared with c#.
You should simply move the common block data in tomodules which can be easily shared with c#.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you mean module variables? The same issue would arise as with a COMMON.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My apologies. I use several Fortran compilers and was referrring to a .NET fortran compiler (Salford) for linking data. The process requires use of an Assembly Middle man for real time sharing of data.
I prefer to use the Intel fortran compiler for most of my problem solutions because i believe the .NET framework is primed for piracy. No security of code nor data!
So again, i apologize for responding as if you were using a different compiler.
I prefer to use the Intel fortran compiler for most of my problem solutions because i believe the .NET framework is primed for piracy. No security of code nor data!
So again, i apologize for responding as if you were using a different compiler.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
The problem is that C# is a .NET language and does not link into the same address space as non-managed code, so there is no sharing of vartiables. Writing access routines is perhaps the best way. You could reduce the work by getting the address of the first variable in each COMMON block and using that as a pointer to a struct of the appropriate layout.

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