- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I use Visual C++ 8 (.Net 2005) IDE to invoke Intel Fortran 9.1. 32 bit version builds without any problem, but for 64 bit configuration I have the error:
Error: There is no matching specific subroutine for this generic subroutine call. [QSORT]
Any help would be greatly appreciated.
Thanks,
Andrew
Error: There is no matching specific subroutine for this generic subroutine call. [QSORT]
Any help would be greatly appreciated.
Thanks,
Andrew
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What are the datatypes of the arguments? As supplied, QSORT does not have a signature for INTEGER(8) arguments, but you can extend the generic to add your own signature and supply an appropriate compare routine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for the prompt reply.
Here is the code:
! vars declarations
integer(4) num_run
integer(4) sortElementSize
REAL(8) pointLossDistribution(num_run)
integer(2), external :: compareDescendReal8Function
! invocation
sortElementSize = 8
CALL qsort( pointLossDistribution, num_run, sortElementSize,
& compareDescendReal8Function)
! comp func definition
integer(2) function compareDescendReal8Function(arg1, arg2)
REAL(8) arg1, arg2
if (arg1 > arg2) then
compareDescendReal8Function = -1
elseif (arg1 < arg2) then
compareDescendReal8Function = 1
else
compareDescendReal8Function = 0
endif
Thanks,
Andrew
Here is the code:
! vars declarations
integer(4) num_run
integer(4) sortElementSize
REAL(8) pointLossDistribution(num_run)
integer(2), external :: compareDescendReal8Function
! invocation
sortElementSize = 8
CALL qsort( pointLossDistribution, num_run, sortElementSize,
& compareDescendReal8Function)
! comp func definition
integer(2) function compareDescendReal8Function(arg1, arg2)
REAL(8) arg1, arg2
if (arg1 > arg2) then
compareDescendReal8Function = -1
elseif (arg1 < arg2) then
compareDescendReal8Function = 1
else
compareDescendReal8Function = 0
endif
Thanks,
Andrew
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ah -I was mistaken about the lack of a signaturefor I8, though that's not your problem.
Change::
integer(4) num_run
integer(4) sortElementSize
to
integer(SIZEOF_TIME_T) num_run
integer(SIZEOF_TIME_T) sortElementSize
On Intel 64, the length and size arguments are INTEGER(8). Using the above definitions will be correct on both 32 and 64-bit platforms. If you pass or accept these variables as arguments, make sure the corresponding declarations are also correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Andrew,
can you tell me which options do you use to compile your codes?
Thanks
Thoi.
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