- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I upgraded to 8.0 and now my interface to qsort with a derived type no longer works. I have NO more ideas. Can any one help? Thanks.
module mytypes
type census_block
integer*4 latsec
integer*4 lonsec
integer*4 ipop
end type
type census_block
integer*4 latsec
integer*4 lonsec
integer*4 ipop
end type
type(census_block)::census_block_array(750000)
end module mytypes
subroutine sort_pop_data
use iflport
use cell_data
use globaldata
use mytypes
interface
subroutine qsort_typecensus( array, len, isize, compar )
use mytypes
!DEC$ATTRIBUTES alias:'qsort_':: qsort_typecensus
type(census_block) array(*)
integer*4 len, isize
integer*2, external :: compar
end subroutine
integer*4 len, isize
integer*2, external :: compar
end subroutine
end interface
integer len,isize
external compare_struct
integer*2 compare_struct
integer*2 compare_struct
isize = 12
len = num_blocks
len = num_blocks
call qsort_typecensus(census_block_array, len, isize, &
compare_struct)
return
end
compare_struct)
return
end
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you get a compile error, run-time error, or just wrong results? What's the error message/code?
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I get a linking error. It 's not finding qsort_typecensus.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try changing 'qsort_' in the ALIAS to '_QSORT'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found it!
You have to use "qsort" not "qsort_" in the interface.
It was in ifport.f90
Thanks
![](/skins/images/2E08A100FB92911314A240D1EAFB2828/responsive_peak/images/icon_anonymous_message.png)
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