nakib / elphbolt

A solver for the coupled and decoupled electron and phonon Boltzmann transport equations.
GNU General Public License v3.0
39 stars 26 forks source link

Natively handle line break issue in .fmt file #52

Closed nakib closed 3 years ago

licfbc commented 3 years ago

You can make a dummy array of the appropriate size and then replace read(1,*) with read(1,*) dummy_array(:)

nakib commented 3 years ago

Thanks! Indeed.

My initial plan was to read into a dummy array, as you just suggested, (initialized to something remarkably crazy like -99999.99999) which has a maximum size equal to the size of the line-break free data of the 3rd line of the .fmt file. Then check whether the whole dummy array or just six elements has been filled by the read statement. This check will tell us whether a line-break exists in the file or not and then we can proceed accordingly.

nakib commented 3 years ago

Indeed your method is the simplest solution to the problem. Closing the issue. Thanks!