- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Hello all,
I'm trying to call an Entry into aFortran subroutine from C and have managed to get everything to compile and link. But it crashes upon calling the Fortran code. I thought I had everything set up to pass the parameters correctly, but I guess I don't.
The fortran subroutine entry has the following arguments
ENTRY usr_tmblk_init (IINFO,RINFO, U,NU, X,F,NX,Y,NY,RPAR,IPAR)
where the paramaters are
INTEGER IINFO(*), IPAR(*), NU, NX, NY
DOUBLE PRECISION RINFO(*), RPAR(*), U(*), X(*), F(*), Y(*)
I've set up the extern to the functionin the C code as
extern void _stdcall usr_tmblk_init (int*, double*, double*, int *NU, double*, double*,int *NX,double*,int *NY, double*,int*);
and the calling code is
usr_tmblk_init ( finfo2, &T, U, &NU, X, XDOT, &NX, Y, &NY, RP, IP);
where T is a scalar in the C code, but the first element ofthe RINFOarray in the Fortran Code.
Compiler options are /nologo /MT /GNa /Op so I'm not doing anything to change the Fortran argument passing conventions. With this in mind I'm attempting to pass everything by reference. I will admit that my C and Fortran are both a little rusty.
Any help or thoughts would be appreciated.
Marcus
Link kopiert
0 Antworten
Antworten
Themen-Optionen
- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Drucker-Anzeigeseite