- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm writing a small postproccesing script. I used to do some calculations with a compiled FORTRAN-program. The guy who wrote this program used for the output a format 'G8.2E1'. The problem is that sometimes I have an output with eight stars (********). This is probably a representation of FORTRAN that it can't write the value with the given format.
Is there a possibility to tell FORTRAN that it can understand the stars during a reading process?
Of course, I can edit everytime my output and change the values to 0.0 by my own, but I don't like this idea. I only know that the values are really small and close to zero. I would like just to start my program and then take a look on the things which are more important ;)
EDIT
How I would load a file (see attachment) with stars as a string array? My idea is to load this as a string array and transform it into an array of REALs.
I'm writing a small postproccesing script. I used to do some calculations with a compiled FORTRAN-program. The guy who wrote this program used for the output a format 'G8.2E1'. The problem is that sometimes I have an output with eight stars (********). This is probably a representation of FORTRAN that it can't write the value with the given format.
Is there a possibility to tell FORTRAN that it can understand the stars during a reading process?
Of course, I can edit everytime my output and change the values to 0.0 by my own, but I don't like this idea. I only know that the values are really small and close to zero. I would like just to start my program and then take a look on the things which are more important ;)
EDIT
How I would load a file (see attachment) with stars as a string array? My idea is to load this as a string array and transform it into an array of REALs.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No - if the output has stars, that means the value is unrepresentable in the given format. Once the stars are there, you have completely lost any knowledge of the value.
You could read each line as a character string and write code that replaces strings of stars with '0.0' or some such, then do an internal READ from the string.
You could read each line as a character string and write code that replaces strings of stars with '0.0' or some such, then do an internal READ from the string.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page