- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 Copied
0 Replies

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page