Hello,
I have just made a new topic by Intel Developer Zone concerning reading Serafin files with codes compiled with optimised Intel Fortran Compiler 15 and 16. Shortly: we have read errors everywhere we try to skip some Serafin file records to get to a place where we want to read (classical examples skipgeo, find_in_sel). There is a workaround, but it is rather all too simple. Improving things "for the compiler" would require providing work space to the read routines of BIEF, probably a lot of changes in interfaces.
Has anyone been confronted with this problem? Any other workarounds?
Best regards,
jaj
Post by Intel Developer Zone
For your convenience I repeat the text here and include the test file.
Hello,
I have troubles deploying code Telemac opentelemac.org with Intel Fortran Compiler 16. All routines applying an old trick to skip lengthy records in an unformatted sequential file in order to get to some place in which one wants to read, deliver read error when compiled with optimisation higher than O0. The trick is instead of reading thousands of numbers, just read one number from this record and skip to the next record with next READ, and so on until you get where you want. This trick (a typical old Fortran way of doing things...) stopped working with optimised Intel 16.
I have written a short program containing the original Telemac routines (skipgeo) and a routine being a simple workaround with allocating large enough buffers (skipgeo_improved). The code works well with Intel Fortran 14 and with gfortran (gcc 4.8.4) and yields a read error with optimised Intel 16, catched by a wrapper routine (lit) for the Fortran READ. If you use -warn all -catch all and/or -O0, everything goes well.
I wonder if this is not an optimisation bug. I have not found in the documentation anything about changes in unformatted sequential file treatment.
Please find included code and the file to be read (big endian).
Looking forward for your reactions, best regards,
jaj