Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: fortran mex file and common blocs
Date: Tue, 3 Nov 2009 14:30:05 +0000 (UTC)
Organization: Boeing
Lines: 14
Message-ID: <hcpepd$rfs$1@fred.mathworks.com>
References: <hcpatj$lf1$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257258605 28156 172.30.248.38 (3 Nov 2009 14:30:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 3 Nov 2009 14:30:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 756104
Xref: news.mathworks.com comp.soft-sys.matlab:582054


"abdelmoumen " <bmoumen27@yahoo.fr> wrote in message <hcpatj$lf1$1@fred.mathworks.com>...
> hi everybody
> 
> i have split the source code of the 4nec2dx into many .f files containing each one a subroutine or a function
> 
> the problem is that there are many "COMMON" blocs that in some tutorials i have to delete them
> but what i make in the place????????????????????
> please if you can give me an example it will be better because i dont know programming in fortran
> 
> thank's 

Post one of your short functions and we can offer specif advice. Basically, you can make a module with the common block stuff in the module. Add a flag to the module that remembers if the data in the common block is initialized or not. Add a function to the module that initializes the data if the flag is not set. Then have your function call that module function first thing upon entry. *However*, this will not work if the individual functions you are creating have to communicate amongst themselves. i.e., is it your intention that changes in common block variables in one function affect the common block variables of another function?

James Tursa