davis@MASIG2.OCEAN.FSU.EDU (Alan Davis) (12/11/90)
I am coding up some routines in C that I need to make accessable to the rest of our researchers that only program in the F------ language. There are a couple of things that I would like to do and TFMs say I should be able to do, but unfortunately do not seem to work. First, in Sec. 3.2.1 of the FORTRAN 77 Programmer's guide it states in a Note that mkf2c has an option for letting function names contain an underscore, but not such option appears to exist and mkf2c complains about it when you try to insert one. Second, I am passing some floating point arguments that I want to prevent from being promoted to double. mkf2c has an -f flag to do just that, but TFM says that you should use function prototypes in the C routine. When I do this mkf2c also complains about a syntax error. If I write the C routine in the old style and use mkf2c with the -f flag the type conversion does appear to be prohibited, but this causes the C routine to be written without a prototype which I would like to avoid. My way out was to code a small fortran wrapper routine without the prototype which in turn calls the real C routine which I wrote with prototyping resulting in two function calls from Fortran. Does anybody have any experience with either of these two bugs. I am running a 320 VGX with 3.3.1. ps. Does anyone know the release date of 3.3.2, as I need it to fix a problem in the gl library on the VGX? -- Alan Davis | MS B-174, Love 008A | Mesoscale Air-Sea Interaction Group | INTERNET davis@masig1.ocean.fsu.edu Florida State University | SPAN scri1::davis Tallahassee, FL 32306-3041 | (904) 644-3798 | _______________________________________________________________________________
blbates@AERO4.LARC.NASA.GOV ("Brent L. Bates AAD/TAB MS361 x42854") (12/13/90)
I was told that 3.3.2 should be shipping "any day now". Why do you need to use mkf2c? I always though that created more pain than was necessary. Other machines I have used don't need anything like mkf2c. If you make the C routines correctly, like using pointers for the varables passed to the C routines and other similar precausions, it shouldn't be that difficult. Now I haven't tried any FORTRAN to C on our 4D's, yet, and when I tried it on our 3130, long ago, it never worked to my statisfaction, but then again there weren't a lot of things that worked reasonably on the 3130's any way. -- Brent L. Bates NASA-Langley Research Center M.S. 361 Hampton, Virginia 23665-5225 (804) 864-2854 E-mail: blbates@aero4.larc.nasa.gov or blbates@aero8.larc.nasa.gov