Arjen Markus (5 march 2003) It has taken me some (calendar) time to get Critcl to understand Fortran, and have it work on various platforms, but it is (almost) ready.
The current state:
If you are interested, then just send me an email
AM (14 august 2007) The major obstacle in developing something like Critclf is not so much the chain of tools one needs to use (C and Fortran compilers that understand each other, linker), but the bare fact that the interface of a Fortran routine can not easily be understood from the declaration only. For instance:
subroutine xyz( x, y, z, n ) real x real y(n) integer z(n,n) integer n end
would be callable from C like this:
float x, y[10], z[10][10] ; xyz( &x, y, z, &n ) ;
but does that indicate that x will be changed within the routine? Or what about the two arrays?
For a proper interface with Tcl, one needs to know the role of the variables:
Having to specify the length of arrays as a separate argument is slightly odd, as that information would be the length of the list that holds the values. In other words: you want a Tclish interface:
xyz $x $list_of_ys $list_of_zs
So, after a long hiatus, I started to think about the issue again. My solution is to generate a wrapper function on the basis of slightly more information than just the syntax of interface:
Wrapfort::fproc xyz xyz { real x input real-array y input integer-matrix z input integer n {local size(y)} code {Inevitable, I am afraid} { xyz( &x, y, z, &n ); } }
would do the trick (I am writing this from memory, after a holiday, so the details may differ ;)).
Okay, you need to know a few bits and pieces about C-Fortran interfacing (unlike Critclf), but most tedious details are taken care of and you can get very Tclish interfaces.