Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29249 Discussions

Arguments flipping when passed in...

laddikey
Beginner
717 Views
I have a Fortran project that recieves arguments passed in from a VB6 exe, via a C# COM wrapper. I find that afew of the arguments are getting swapped around. I step through the VB and find that they are passed in correctly. I step through the C# and find them correct both comeing in and passing out. And then, the instant that I get inside the Fortran code, 2 of the 11 arguments being passed in have literally 'swapped places'. The numbers are there, they are simply assigned to a different variable.

Can anyone give me some pointers in why this might be happening or where to look for some answers?
Thanks.
0 Kudos
4 Replies
Steven_L_Intel1
Employee
717 Views
I would guess that the arguments are not being passed correctly - that you have some character arguments and you're passing the lengths in the wrong location. By default, Intel Fortran expects the character lengths at the end of the argument list.
0 Kudos
laddikey
Beginner
717 Views
Don't have character arguments but I do have arrays that are real(4)'s declared as (inout). The arguments that are flipping are integer(4)'s declared (in). The following is the argument list:
yraw,kin,spec,wt,au,ntimes,nwaves,nwt,nconc,grflag,err

The 1st 3 arg.'s (yraw,kin,spec)are 2 dimensional arrays, the next 2 args (wt,au,)are 1 dimensional arrays, and the remaining arg's (ntimes,nwaves,nwt,nconc,grflag,err) are integer(4)'s.

nmwaves becomes 0 though I have confirmed that 201 is passed in.
nwt becomes 201 though 6 is passed in.
grflag becomes 6 though 0 is passed in.

Any thoughts?
As for confirming what is passed, I have used breakpoints in the debuggers as well as using message boxs that show the contents of the variables being passed.
0 Kudos
Steven_L_Intel1
Employee
717 Views
I'd need to see the actual code. 2-D arrays are tricky in C and variants. If you can't find a solution, send a test case to Intel Premier Support.
0 Kudos
laddikey
Beginner
717 Views
Thanks Steve,

I will let you know how things pan out.
0 Kudos
Reply