From: pcirrus on 22 Jul 2010 16:34 The following code produces segmentation fault when compiled with Intel 11.1 (ifort). It works with gfortran 4.4. I wonder if somebody has any insight why? Thanks module te type av real a1, a2 end type av end module te PROGRAM test2 use te parameter (mxrec=10000) type(av) dat(mxrec) logical mask(mxrec) nrec=6000 print*, ' in prune ', nrec mask(1:nrec) = .false. dat(1:nrec) = pack(dat(1:nrec),mask(1:nrec)) nrec = count(mask(1:nrec)) stop ' here in prune ' END program test2
From: glen herrmannsfeldt on 22 Jul 2010 17:03 pcirrus <pcirrus(a)gmail.com> wrote: > The following code produces segmentation fault when compiled with > Intel 11.1 (ifort). It works with gfortran 4.4. I wonder if somebody > has any insight why? (snip) > logical mask(mxrec) > nrec=6000 > print*, ' in prune ', nrec > mask(1:nrec) = .false. > dat(1:nrec) = pack(dat(1:nrec),mask(1:nrec)) The left side of an array assignment should have the same number of elements as the right side. In this case, 6000 does not equal zero. I do wonder what gfortran did with it! -- glen
|
Pages: 1 Prev: Integrating executable files in fortran code Next: Pointer Comparison |