> On Apr 26, 2018, at 7:57 AM, Jaromir Jakacki <[log in to unmask]> wrote:
> Thank you for replay,
> the main point is that my colleague made mistake and have calculated wrong record length (calculated record length correctly, but did not use '-assume byterecl' flag). Then wrote data without the flag. I would like to fix it using record length based on bytes. For example for real*8 array with 10 elements:
> 1) his record length (SRL) is 10*8*4 = 320
This just seems wrong. The I/O data are 80 bytes long. I’ve not heard of an implementation that uses a length unit of just 2 bits.
> 2) based on bytes record length (DRL) should be 10*8=80
> How can i read data based on SRL and write is based on DRL.
> I tried to read it using recl=320 but it does not work (it saves data, but i am not able to read it using different sofware).
You can open the file for STEAM access and manually position the file at the right locations that have the data you are trying to read.
> On 26/04/2018 13:56, arrl wrote:
>> On 4/26/2018 4:56 AM, Jaromir Jakacki wrote:
>>> I have data that has been written using one record length and would like to read them and then write using another record length (fortran direct access). I use Intel compiler that use default length unit is 4 bytes word. But i am able to use compiler flat '-assume byterecl' and in this case the record length will be 4bytes*2 (for double precision). Is it possible to use both record lengths in one fortran script?
>>> Thank you in advance for your help
>>> with best regards,
>> As you pointed out, -assume byterecl is one of the options ifort
>> requires for Fortran standard compliance. I'm not certain whether this
>> is the primary point of your question.
>> If you are copying a direct access file, OPENing separate UNITs should
>> permit you to specify RECL individually. If you are changing all data
>> items to double their width, and you wish the new file to contain the
>> same number of records, the new RECL would be twice the old one.
>> I don't know why you bring up the number of bytes of storage of an
>> individual datum. Unless the old file was written with, for example,
>> RECL=4, the normal situation would be a RECL of at least 132.
>> I'm not certain that Intel specifies a default value of RECL. In
>> general, the old file would require reading by the same compiler with
>> the same RECL used when it was written.
Bill Long [log in to unmask]
Principal Engineer, Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9143
Cray Inc./ 2131 Lindau Lane/ Suite 1000/ Bloomington, MN 55425