12.07.2015 Views

Intel® Fortran Libraries Reference

Intel® Fortran Libraries Reference

Intel® Fortran Libraries Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2 Intel <strong>Fortran</strong> <strong>Libraries</strong> <strong>Reference</strong>NOTE. If you use QSORT with different data types, your program must have aUSE IFPORT statement so that all the calls work correctly. In addition, if youwish to use QSORT with a derived type or a type that is not in the predefinedinterfaces, you must include an overload for the generic subroutine QSORT.Examples of how to do this are in the portability module’s source file,IFPORT.F90.CompatibilityCONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIBExampleRAISEQQPROGRAM SORTQUSE IFPORTinteger(2), external :: cmp_functioninteger(2) insort(26), iinteger (SIZEOF_SIZE_T) array_len, array_sizearray_len = 26array_size = 2do i=90,65,-1insort(i-64)=91 - iend doprint *, "Before: "print *,insortCALL qsort(insort,array_len,array_size,cmp_function)print *, 'After: 'print *, insortEND!integer(2) function cmp_function(a1, a2)integer(2) a1, a2cmp_function=a1-a2end functionPortability Function: Sends a signal to the executing program.2-364

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!