Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Reading integers as reals (double precision)?

Received: by 10.224.183.13 with SMTP id ce13mr2256032qab.4.1350028896761;
        Fri, 12 Oct 2012 01:01:36 -0700 (PDT)
Received: by 10.236.149.66 with SMTP id w42mr555872yhj.18.1350028896737; Fri,
 12 Oct 2012 01:01:36 -0700 (PDT)
Path: r17ni19491880qap.0!nntp.google.com!l8no46074066qao.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Fri, 12 Oct 2012 01:01:36 -0700 (PDT)
In-Reply-To: <k58hhm$6uv$1@dont-email.me>
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=97.104.37.48; posting-account=vqCYcQoAAAC8PtUrH4O0uoPF3ID_IZ51
NNTP-Posting-Host: 97.104.37.48
References: <2c24f01d-60d2-44f2-883d-11f36d902ff1@googlegroups.com> <k58hhm$6uv$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <14e5e4e8-076a-4cbd-a509-b42708aa2af5@googlegroups.com>
Subject: Re: Reading integers as reals (double precision)?
From: john.chludzin...@gmail.com
Injection-Date: Fri, 12 Oct 2012 08:01:36 +0000
Content-Type: text/plain; charset=ISO-8859-1

On Friday, October 12, 2012 3:40:39 AM UTC-4, Dieter Britz wrote:
> On Thu, 11 Oct 2012 23:17:10 -0700, john.chludzinski wrote:
> 
> 
> 
> > I have a data file that includes many real values without a decimal
> 
> > point, E.g.: 705201
> 
> > 
> 
> > I'm trying to read the file lines using (there's only one value per file
> 
> > line):
> 
> > 
> 
> >        read(unit=funit, fmt="(a)", iostat=stat) line ...
> 
> >        read(line, "(f10.0)") Eng_GimRatio(6)
> 
> >        ...
> 
> > 
> 
> > Of course f10.0 doesn't work.  Is there some format that will?
> 
> > 
> 
> > I could read the values as integers and then convert them to double
> 
> > precision? Would that be best?
> 
> > 
> 
> > ---John
> 
> 
> 
> What about reading with free format, e.g.
> 
> read(unit=funit, *, iostat=stat) var...
> 
> 
> 
> You can read them straight into double precision variables, they
> 
> will be converted.
> 
> 
> 
> -- 
> 
> Dieter Britz

Works for me!  Thanks!