bhorn63
Mechanical
- Dec 13, 2010
- 3
thread545-223362
My question is related to the above thread. I am trying to read from an input file a date/time stamp followed by 2000 data values. I can read correctly the date/time stamp and all positive values but if i try to read any negative values the read statement crashes. Below is my read and format statement. So the question is how can I read both positive and negative values without knowing exactly where they are in the array?
READ(Unit=InFileUnit,FMT=30,END=990,ERR=920) Datemm(N),
1 Datedd(N),Dateyyyy(N),Timehh(N),Timemm(N),
2 Timess(N),Timep(N),(Value(N,M),M=1,22)
30 FORMAT(I2,1X,I2,1X,I4, 1X,I2,1X,I2,1X,I2,1X,I1,
1 22(1X,ES7.2E1))
The M=22 is because that happens to be the number of values that are all positive before the first negative value. I have tried just using E7.2 and if i change it to 8.2 to count for the negative sign then the positive values wont even read in. ps. this is not for any homework this is for my own research. Thank you for any and all help!
My question is related to the above thread. I am trying to read from an input file a date/time stamp followed by 2000 data values. I can read correctly the date/time stamp and all positive values but if i try to read any negative values the read statement crashes. Below is my read and format statement. So the question is how can I read both positive and negative values without knowing exactly where they are in the array?
READ(Unit=InFileUnit,FMT=30,END=990,ERR=920) Datemm(N),
1 Datedd(N),Dateyyyy(N),Timehh(N),Timemm(N),
2 Timess(N),Timep(N),(Value(N,M),M=1,22)
30 FORMAT(I2,1X,I2,1X,I4, 1X,I2,1X,I2,1X,I2,1X,I1,
1 22(1X,ES7.2E1))
The M=22 is because that happens to be the number of values that are all positive before the first negative value. I have tried just using E7.2 and if i change it to 8.2 to count for the negative sign then the positive values wont even read in. ps. this is not for any homework this is for my own research. Thank you for any and all help!