Quantcast
Channel: Intel® Software - Intel® Fortran Compiler for Linux* and macOS*
Viewing all articles
Browse latest Browse all 2746

Problems with pack intrinsic function: catastrophic error and bad results

$
0
0

I noticed that the subroutine sprsin in numerical recipes produces catastrophic error if compiled with ifort 15.
The problem seems due to the line

sa%jcol=pack(spread(arth(1,1,n),1,n),mask)

It is possible to reproduce the error by compiling the code test_err1.f90

ifort test_err1.f90

./a.out

At the same time I found that this line

sa%irow = pack(spread(arth(1,1,NDIM),2,NDIM),mask(:,:))

in test_err2.f90 produce bad results.
gfortran compiler and old version of ifort produce correct results.

I use Ubuntu 14.04.2 LTS 64bit

AttachmentSize
Downloadpack_err1.f901.42 KB
Downloadpack_err2.f901.42 KB

Viewing all articles
Browse latest Browse all 2746

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>