File output format problem

by (no login)

Hello Qbguy,

Thanks for your answer. I am using the G77 compiler. I want stress the following points:

1. There are no compile or runtime error.
2. I open four output files, all formatted with the same syntax and close them properly.
3. Three of the four output formatted files and only one (UNIT=21) gives me a binary file.
4. The code is over 4 thousand lines so I will only post a fragment.

Could the syntax of my write statements cause a binary output ??

Here is the fragment:

OPEN(UNIT=18, FILE='TAMSrc.out', STATUS='NEW', FORM='FORMATTED')
OPEN(UNIT=19, FILE='Diurnal.out', STATUS='NEW', FORM='FORMATTED')
OPEN(UNIT=20, FILE='SLink.out', STATUS='NEW', FORM='FORMATTED')
OPEN(UNIT=21, FILE='check.out', STATUS='NEW', FORM='FORMATTED')

many lines of code

WRITE(UNIT=21, FMT=1001) 'Number of links = ',NLINK
WRITE(UNIT=21, FMT=1001) 'Link Number = ',LN
1001 FORMAT (A, I10)
WRITE(UNIT=21, FMT=1001) 'Location = ',AR
WRITE(UNIT=21, FMT=1002) 'Link length in km = ',LENKM
1002 FORMAT (A, F10.3)
WRITE(UNIT=21, FMT=1003) 'Car flow (7-8) = ',TCF
1003 FORMAT (A, F10.3)
WRITE(UNIT=21, FMT=1003) 'Bus flow (7-8) = ',TBF
WRITE(UNIT=21, FMT=1003) 'SPEED speed in km/hr (7-8) = ',SPEED
WRITE(UNIT=21, FMT=1003) 'TSPEED speed in km/hr (7-8) = ',TSPEED
WRITE(UNIT=21, FMT=1003) 'Final speed in km/hr = ',NSPEED
WRITE(UNIT=21, FMT=1001) 'Total number of lanes = ',TLANES
WRITE(UNIT=21, FMT=1001) 'Number of segments = ',INS
WRITE(UNIT=21, FMT=1003) 'Initial segment length in meters= ',DL
WRITE(UNIT=21, FMT=1003) 'Final Segment length in meters = ',SEG
WRITE(UNIT=21, FMT=1003) 'Sigma Z in meters = ',VSIGZI
WRITE(UNIT=21, FMT=1003) 'Sigma Y in meters = ',VSIGYI
WRITE(UNIT=21, FMT=1003) 'Lane width in meters = ',LANEW
WRITE(UNIT=21, FMT=1003) 'Base Elevation in meters = ',BELEV
WRITE(UNIT=21, FMT=1003) 'Source height in meters = ',VEFFHT
WRITE(UNIT=21, FMT=1003) 'Total emissions for link = ',TE
WRITE(UNIT=21, FMT=1003) 'Total emissions for segment = ',STE
WRITE(UNIT=21, FMT=1004) 'Coordinates = ',XA,YA,XB,YB 1004 FORMAT (A, 4(F15.3))
1005 FORMAT (A, 2(F15.3))

WRITE(UNIT=21, FMT=527) ' R10R Matrix '
527 FORMAT (A)
DO 540 J=1,24
WRITE(UNIT=21, FMT=528) (R10R(I,J),I=1,6)
540 CONTINUE

WRITE(UNIT=21, FMT=527) ' R10F Matrix '
DO 550 J=1,24
WRITE(UNIT=21, FMT=528) (R10F(I,J),I=1,6)
550 CONTINUE

CLOSE(UNIT=18)
CLOSE(UNIT=19)
CLOSE(UNIT=20)
CLOSE(UNIT=21)
END


Hope you can find a reason for the binary output.

Regards,

Chaim

Posted on Dec 1, 2008, 9:02 AM

Respond to this message   

Return to Index


Response TitleAuthor and Date
You reference a format statement on line 528qbguy on Dec 1
 problem resolved on Dec 2