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

Error in the open statement

$
0
0

        do m = 0,15,1
                write(fn,*) m,'.txt'
                print *,fn
                open(unit=m,status='unknown',action='read',file=fn)
                print *,'opened file ',fn
                do k = 1,6
                        read(m,*),array(k,m,:)
                        print *,array(k,m,:)
                enddo
        enddo

 

I have the above code to read in an array from multiple files. It successfully reads from the first file but after that it shows error. I am posting the output.

 

           0.txt    
 opened file            0.txt    
   1437989539.58974        1437989540.91451        1437989540.28583     
   1437989540.40498     
   1437989547.74656        1437989547.79766        1437989547.31648     
   1437989547.31722     
   1437989551.27468        1437989551.35893        1437989550.87781     
   1437989550.87831     
   1437989557.64002        1437989557.66885        1437989557.18768     
   1437989557.18810     
   1437989561.10420        1437989561.17505        1437989560.69326     
   1437989560.69363     
   1437989567.37678        1437989567.46258        1437989566.98124     
   1437989566.98164     
            1.txt      
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image              PC                Routine            Line        Source             
a.out              00000000004785B1  Unknown               Unknown  Unknown
a.out              0000000000476D07  Unknown               Unknown  Unknown
a.out              0000000000434114  Unknown               Unknown  Unknown
a.out              0000000000433F26  Unknown               Unknown  Unknown
a.out              0000000000406C1F  Unknown               Unknown  Unknown
a.out              000000000040A63D  Unknown               Unknown  Unknown
libpthread.so.0    000000328AC0F500  Unknown               Unknown  Unknown
libc.so.6          000000328A46E940  Unknown               Unknown  Unknown
a.out              000000000043C988  Unknown               Unknown  Unknown
a.out              0000000000412052  Unknown               Unknown  Unknown
a.out              0000000000402FAF  Unknown               Unknown  Unknown
a.out              0000000000402C7E  Unknown               Unknown  Unknown
libc.so.6          000000328A41ECDD  Unknown               Unknown  Unknown
a.out              0000000000402B89  Unknown               Unknown  Unknown

 


Viewing all articles
Browse latest Browse all 2746

Latest Images

Trending Articles



Latest Images

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