Hello, I am looking for the building a wrapper class for fortran function or subroutine. is there any way to get a proper implementation of c# wrapper class? As per my research, Microsoft's system runtime interopservices provides a wrapper interface for fortran function. so is there anyone who did similar ? regards!
I have several messages regarding this received. but there is no proper implementation. cause, as per documentation we need to pack it up in dll and then we can use it as a service in .net platform. so is it possible to call without packing fortran function in dll. any replies to this thread would be appriciated. regards !
hi, The Fortran main program uses the C attribute to call the C functions. The C attribute causes Fortran to generate all-lowercase names, so the ALIAS attribute must be used to preserve mixed case. C File FORMAIN.FOR C INTERFACE TO INTEGER*4 FUNCTION Fact [C,ALIAS:'_Fact'] (n) INTEGER*4 n [VALUE] END INTERFACE TO SUBROUTINE Pythagoras [C,ALIAS:'_Pythagoras'] (a,b,c) REAL*4 a [VALUE] REAL*4 b [VALUE] REAL*4 c [REFERENCE] END INTEGER*4 Fact REAL*4 c WRITE (*,*) 'Factorial of 7 is ', Fact (7) CALL Pythagoras (30, 40, c) WRITE (*,*) 'Hypotenuse if sides 30, 40 is ', c END /* File CSUBS.C */ #include <math.h> int Fact( int n ) { if (n > 1) return( n * Fact( n - 1 )); return 1; } void Pythagoras( float a, float b, float *c) { *c = sqrt( a * a + b * b ); }