Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transform numbers into REAL*8 1

Status
Not open for further replies.

Widukin

Programmer
Feb 8, 2003
11
FR
Another part of my current program requires me to load another list from file (example as follows)

283 5.40319 0 7.19701
284 2.85188 8.13944 6.15848
285 8.875 0.866025 2.85714
286 0.90817 8.72831 3.05784
287 2.25385 9.11571 5.74259
288 7.03606 5.88346 8.3403
289 2.40222 5.42258 4.07663
290 5.46067 4.49936 10

also in fixed format.

I am disregarding the first column of integers with 10X in FMT. But I need to read the following numbers and record them into a list as REAL*8. The problem is self evident, since I have various types of numbers from Integers to reals.

I also have the folowing program to read from the file. However I assume there is some sort of conflict due to the types presented.

run-time error F6206: READ(d:\test\points.txt)

module comm2

INTEGER J
REAL*8 ARR_PTO(646,3)

end module comm2

program see2

use comm2

OPEN(50,FILE='d:\test\points.txt')

J = 0
10 CONTINUE
J = J + 1
IF (J.GT.647) GOTO 20
READ(50,FMT='(10X,I10,5X,I10,5X,I10)',END=20) ARR_PTO(J,1), ARR_PTO(J,2), ARR_PTO(J,3)
GOTO 10
20 CONTINUE
IF (J.GT.647) WRITE(6,*) ' *** OVERFLOW ***'

CLOSE(50)

print*, 'Array'

do i=1, 3

print*, ARR_PTO(1,i)

end do

end program see2

Could I ask for you help again?

Best regards,

Widukin
 
Also I have been unable to apply the DFLOAT function. Since I have to apply it, if possible, to the read statement just before the values are applied to the ARR_PTO array.
 
C USING FREE FORMAT AND READING COL. 1-10
C AS DUMMY NUMBER INSTEAD OF SKIPPING IT :
DO 20 J=1,647
20 READ(50,*)IDUMMY,(ARR_PTO(J,I),I=1,3)
 
Thank you very much. It's working fine now...

One question, just out of curiosity, what are all the fmt allowed values, besides I, X?

Best regards,

Widukin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top