Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!g22g2000prf.googlegroups.com!not-for-mail
From: Nathan <ngreco32@gmail.com>
Newsgroups: comp.lang.fortran,comp.soft-sys.matlab
Subject: Re: Fortran formatted read problem (for matlab MEX file)
Date: Fri, 6 Nov 2009 13:31:54 -0800 (PST)
Organization: http://groups.google.com
Lines: 60
Message-ID: <57826745-9026-4025-a5d2-90b67cd03802@g22g2000prf.googlegroups.com>
References: <7af025a1-6d40-4458-aab0-35bc43418c00@i12g2000prg.googlegroups.com> 
	<hd1sg5$u5k$1@news.eternal-september.org> <d039a82a-256d-411d-a100-2b07c196cb0f@2g2000prl.googlegroups.com> 
	<hd1v00$kib$1@news.eternal-september.org> <dd6e3ab8-fd69-4aba-bfc7-377b2392841d@f1g2000prf.googlegroups.com> 
	<hd21j5$h90$5@naig.caltech.edu> <6fe4953f-7d24-45aa-8bf8-fd86932bf59f@x5g2000prf.googlegroups.com> 
	<hd23lb$iid$1@naig.caltech.edu>
NNTP-Posting-Host: 198.206.219.34
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1257543114 25748 127.0.0.1 (6 Nov 2009 21:31:54 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 6 Nov 2009 21:31:54 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: g22g2000prf.googlegroups.com; posting-host=198.206.219.34; 
	posting-account=_KeVcAoAAAB7j3xn35ujaQ0BoQhuzwJP
User-Agent: G2/1.0
X-HTTP-Via: 1.1 wwwproxy-son-ca-02.ca.sandia.gov:80 (squid/2.5.STABLE14)
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.4) 
	Gecko/20091016 Firefox/3.5.4,gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.lang.fortran:213348 comp.soft-sys.matlab:583129


On Nov 6, 1:15 pm, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote:
> In comp.lang.fortran Nathan <ngrec...@gmail.com> wrote:
> (snip)
>
> > So reading in 9.7160E+02, I can use F rather than E and disregard
> > decimals?
> > I'm a little confused as to what you are trying to tell me.
> > Why are the decimals unimportant? (or rather, not required)?
>
> If you read with F10.4 format and the data field contains 1234567890
> then you get the value of 123456.7890, such that four digits are
> after the decimal point.  If you actually write a decimal point
> then it uses that independent of the d part of the descriptor.
>
> For input with an exponent but without a decimal point, the d
> part indicates the number of digits after the implied decimal point.
> With E10.4 if the input contains 1234E0 you get the value 0.1234,
> so it is probably best to use the form with d of 0.
>
> On input, I believe that D, E, and F all do the same thing.
>
> For output you get different results from D, E, and F.
>
> -- glen

So...
Should I change my format string?
E15.4 seems like it should work fine, as the decimal is there anyways.
Would that mean that
E15 would return the same thing, because I purposefully placed a
decimal in the data file?

Btw: I still receive errors when trying to read in.
Running in fortran error:
forrtl: severe (24): end-of-file during read, unit 10, file C:\...
...\dippr.dat
Image              PC        Routine            Line        Source
LLDebug.exe        00459389  Unknown               Unknown  Unknown
LLDebug.exe        004591E7  Unknown               Unknown  Unknown
LLDebug.exe        004583C4  Unknown               Unknown  Unknown
LLDebug.exe        004587F9  Unknown               Unknown  Unknown
LLDebug.exe        00453225  Unknown               Unknown  Unknown
LLDebug.exe        0043B9D6  FUELSDAT                  340  fuels.f
LLDebug.exe        00444648  RANGES                     43
LiqVapRange.f
LLDebug.exe        004441F9  MAIN$LIQVAPRANGE           10
LiqVapRange.f
LLDebug.exe        00495EE9  Unknown               Unknown  Unknown
LLDebug.exe        0047B349  Unknown               Unknown  Unknown
kernel32.dll       7C816FE7  Unknown               Unknown  Unknown

And, as shown above, this line (304) causes the error:
			READ(10,301) NF, FUELNAME,MW,TBF,TFCF,PC,VC,ZC,ACEN,ZRA,
     +		ACENW,VCH

As I mentioned before, there is no close statement. Would that cause
this error? If so, where would I place the close?
After the loop of reading?

-Nathan