Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Fortran formatted read problem (for matlab MEX file)
Date: Fri, 6 Nov 2009 19:24:04 +0000 (UTC)
Organization: Boeing
Lines: 27
Message-ID: <hd1t4k$psj$1@fred.mathworks.com>
References: <7af025a1-6d40-4458-aab0-35bc43418c00@i12g2000prg.googlegroups.com> <eba3cdeb-43dd-4805-b9fb-b1a320b41323@13g2000prl.googlegroups.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257535444 26515 172.30.248.37 (6 Nov 2009 19:24:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 6 Nov 2009 19:24:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 756104
Xref: news.mathworks.com comp.soft-sys.matlab:583089


Nathan <ngreco32@gmail.com> wrote in message <eba3cdeb-43dd-4805-b9fb-b1a320b41323@13g2000prl.googlegroups.com>...
> 
> 	  IF (NFUEL .GT. 899) THEN
> 		OPEN (10, FILE = 'dippr.dat', Access = 'sequential',
>      +	Form = 'formatted', STATUS = 'unknown')
> 		NF = -999
> 		DO WHILE (NF .NE. NFUEL .AND. NF .NE. 0)
> 			READ(10,301) NF, FUELNAME,MW,TBF,TFCF,PC,VC,ZC,ACEN,ZRA,
>      +		ACENW,VCH
> 		ENDDO
> 	  ENDIF
>  301		FORMAT(I5,A33,3F10.3,E12.4,6F13.5)
> 
> Example data in dippr.dat (this example data is all one line):
> 1003 	METHYL OLEATE                      	296.494	650.930	915.530
> 1.8565E+02	1.06000	0.21400	1.04940	-1.00000	-1.00000	16.97957

The format statement is as follows:
I5 means read an integer in a 5 character field
A33 means read a 33-character length character string
3F10.3 means read three floating point numbers, each 10 characters in length. (Don't worry about the .3)
E12.4 means read one floating point number from a 12 character field
6F13.5 means read six floating point numbers, each from a 13 character field.

Your input line is hard to examine in this ng post because it apparently has tabs in it. I suspect this may be the cause of the problem. Can you examine the source data file to confirm the existence of tabs in the data? You may have to consult your Fortran compiler doc to see what it does with tabs in an input file.

James Tursa