https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61628
--- Comment #13 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> --- Well I have been playing around a little. I wanted to see if the problem was in pack, so I did this: read( 10 ) matrix write(*,*) nx, ny, size(matrix) test = pack( matrix, matrix /= 1 ) write (*,*) test(1:5227) The array 'test' is declared and allocated exactly as 'matrix'. What I found is that if I set the range of test as shown, the write will give all the values up to that size. Greater then 5227 and things quit working and the write gives nothing. I still have no idea what's wrong. But it acts like either the allocation is not working correctly or a pointer is getting clobbered. If I was going to bet, it would be memory allocation problem. I will be doing some more tinkering as I have time.