Re: Structure of large link libraries in f95



On 2006-03-31 15:33:53 -0400, Charles Russell <SPAMworFREEwor@xxxxxxxxxxxxx> said:

Charles Russell wrote:
Richard E Maine wrote:


Compile your code and put it in a library the same way you do now. Then
make a module with nothing but interface blocks.


Things could be
automated, but I'm not a makefile guru.

On second thought, this might be pretty simple. List the subroutines in one makefile macro and the functions in another, cat each set, change all end statements in each set using sed, cat the two together and INCLUDE the resulting file. Make all library files prerequisites.

Having done that, am I likely to hit other problems related to f77 syntax or format? As you can tell, I am not ready to cross this bridge, only to reconnoitre.

Another gotcha concerns passing functions as arguements. Only an issue
if you are using things like ODE integrators and integral evaluators.
Other than that an arguement that is a subroutine or function is
pretty rare. Sometime one needs call-back functions to deal with
some sorts of operatinng system interfaces.

An external, or even just a type statement, will make the unit into
and external unit rather than a module procedure. Solution is to
delete the good style declarations.

I heartily endorse making up a structure of

program All_my_stuff
implicit none
call main
contains
subroutine main ! used to be program main
include "subby 1" ! with its brand new end subroutine ;-)
include "subby 2"

... into so on the night ...

end program

and letting the F90 tight checking do its job on matching
calls to actual units, etc, etc.

Be prepared to find a few blunders in what was believed to be well
functioning error free code.


.