Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29234 ディスカッション

Why isn't SORTQQ pure?

Karanta__Antti
新規コントリビューター I
1,505件の閲覧回数

In a pure routine I would need to sort a real array. However, I can't call SORTQQ without removing the pure modifier from the calling procedure as SORTQQ is not marked to be pure. 

Is there a reason it is not pure or is it just by accident?

https://www.intel.com/content/www/us/en/develop/documentation/fortran-compiler-oneapi-dev-guide-and-reference/top/language-reference/a-to-z-reference/s-1/sortqq.html

 

Using ifort 2020.4 on Windows

 

     .::Antti::.

 

 

0 件の賞賛
5 返答(返信)
andrew_4619
名誉コントリビューター III
1,499件の閲覧回数

Sortqq is some really old legacy routine. There are many freely available sorting routines that can be downloaded. I would suggest picking one that suits your needs. 

JohnNichols
高評価コントリビューター III
1,442件の閲覧回数

https://www.intel.com/content/www/us/en/develop/documentation/fortran-compiler-oneapi-dev-guide-and-reference/top/language-reference/a-to-z-reference/s-1/sortqq.html 

 

!
 !    Sort a 1-D array
  USE IFPORT
 INTEGER(2) array(10)
 INTEGER(2) i 
 DATA ARRAY /143, 99, 612, 61, 712, 9112, 6, 555, 2223, 67/
 !    Sort the array
 Call SORTQQ (LOC(array), 10, SRT$INTEGER2)
 !    Display the sorted array
 DO i = 1, 10
   WRITE (*, 9000) i, array (i) 
9000 FORMAT(1X, ' Array(',I2, '): ', I5)
 END DO
 END

The sortqq sample does not work as published.  This works ok.   Mainly missing carriage returns in original.   

Karanta__Antti
新規コントリビューター I
1,252件の閲覧回数

Ok, thanks for the info. I was looking at sortqq as something already provided by the compiler / runtime is in my mind preferable to something I need to get from elsewhere. 

Barbara_P_Intel
従業員
1,425件の閲覧回数

@JohnNichols, Good Catch! I filed a bug report, DOC-10880.

Barbara_P_Intel
従業員
1,269件の閲覧回数

The error in the example that John reported is fixed in the next release later this spring.



返信