alternative to ifort's form='binary'

  • Follow


Hi
I have to migrate a code originally working under ifort to gfortran.
Unfortunately there are many problems. One is that I used
open (.... form='binary')

I have tried to substitude with form='unformatted' access='direct'
recl=?

is this correct? what is the recl if i write an array of 10 integers?
or 10 double precisions?

cheers
ciccio
0
Reply alex.mura (2) 3/7/2012 2:45:13 PM

On 2012-03-07 15:45, Roberto123 wrote:
> Hi
> I have to migrate a code originally working under ifort to gfortran.
> Unfortunately there are many problems. One is that I used
> open (.... form='binary')
> 
> I have tried to substitude with form='unformatted' access='direct'
> recl=?
> 
> is this correct? what is the recl if i write an array of 10 integers?
> or 10 double precisions?
> 
> cheers
> ciccio

You are looking for access="stream" - an F2003 feature that standardises
dealing with a complete lack of any record structure.

Regards,

Arjen
0
Reply arjen.markus895 (634) 3/7/2012 2:55:45 PM


arjenmarkus <arjen.markus895@gmail.com> wrote:

> On 2012-03-07 15:45, Roberto123 wrote:
> > Hi
> > I have to migrate a code originally working under ifort to gfortran.
> > Unfortunately there are many problems. One is that I used
> > open (.... form='binary')
> > 
> > I have tried to substitude with form='unformatted' access='direct'
> > recl=?
> > 
> > is this correct? what is the recl if i write an array of 10 integers?
> > or 10 double precisions?
> > 
> > cheers
> > ciccio
> 
> You are looking for access="stream" - an F2003 feature that standardises
> dealing with a complete lack of any record structure.

And note that ifort now also supports the standard access='stream'.

-- 
Richard Maine                    | Good judgment comes from experience;
email: last name at domain . net | experience comes from bad judgment.
domain: summertriangle           |  -- Mark Twain
0
Reply nospam47 (9742) 3/7/2012 5:12:46 PM

On 7 Mar, 18:12, nos...@see.signature (Richard Maine) wrote:

>
> > You are looking foraccess="stream" - an F2003 feature that standardises
> > dealing with a complete lack of any record structure.
>

Hi,
thanks!!
But i got error when i compile with gfortran:
Error: FORM specifier in OPEN statement at (1) has invalid value
'stream'

mmaybe I have to pass some arguments to gfortran? I tried to guess
from the man page but I could not.
Thank you again

ciccio
0
Reply alex.mura (2) 3/15/2012 3:04:18 PM

Roberto123 <alex.mura@gmail.com> wrote:

> On 7 Mar, 18:12, nos...@see.signature (Richard Maine) wrote:
> >
> > > You are looking foraccess="stream" - an F2003 feature that standardises
> > > dealing with a complete lack of any record structure.
> >
> But i got error when i compile with gfortran:
> Error: FORM specifier in OPEN statement at (1) has invalid value
> 'stream'

Notice I (and Arjen) said access='stream', not form='stream'.

Yes, I know that the nonstandard variant was form='binary', but that was
pretty nonsensical. The form specifier is, as always in standard
Fortran, 'formatted' or 'unformatted'. It specifies whether the data is
in internal form (unformatted) or is converted to character form
(formatted). Both options exist with stream access.

You want the same unformatted data that you normally get with
form='unformated',access='sequential', but you don't want the record
structure of sequential acess. You want acess='stream'.

-- 
Richard Maine                    | Good judgment comes from experience;
email: last name at domain . net | experience comes from bad judgment.
domain: summertriangle           |  -- Mark Twain
0
Reply nospam47 (9742) 3/15/2012 3:29:48 PM

4 Replies
109 Views

(page loaded in 0.132 seconds)

Similiar Articles:













7/13/2012 3:54:59 AM


Reply: