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

Qsort derived types

bsully
Beginner
410 Views
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)::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

end interface

integer len,isize
external compare_struct
integer*2 compare_struct
isize = 12
len = num_blocks
call qsort_typecensus(census_block_array, len, isize, &
compare_struct)
return
end
0 Kudos
4 Replies
Jugoslav_Dujic
Valued Contributor II
410 Views
Do you get a compile error, run-time error, or just wrong results? What's the error message/code?
Jugoslav
0 Kudos
bsully
Beginner
410 Views

I get a linking error. It 's not finding qsort_typecensus.

Thanks.

0 Kudos
Steven_L_Intel1
Employee
410 Views
Try changing 'qsort_' in the ALIAS to '_QSORT'.
0 Kudos
bsully
Beginner
410 Views
I found it!
You have to use "qsort" not "qsort_" in the interface.
It was in ifport.f90
Thanks
0 Kudos
Reply