How to prevent a text file being read over and over again in FORTRAN?
-
I have written a code in which a text file is to be read to store quite a few values in various arrays. This is being done in a certain subroutine which is being called multiple times from another program. As the call is made multiple times, the text file is read again and again which makes the execution very slow. Is there a way of avoiding multiple reading of the same data from the text file. I have tried to use SAVE attribute, but I see an error that the arrays are automatic objects and they can't be declared with a SAVE attribute. I can't read the file in a separate subroutine and use COMMON block to make the data available because I get a similar error. I have also tried to use a logical switch which would allow the file to be read once but on second call I lose the previously read values. Can anyone advise on this matter. Thanks.
-
Answer:
d
mnafk at Yahoo! Answers Visit the source
Related Q & A:
- How to convert a HTML file to XML file?Best solution by Stack Overflow
- Is there a limit on the size of a new file or a text file?Best solution by Stack Overflow
- How do send a text message by verizon to my yahoo email?Best solution by Yahoo! Answers
- How to search for a particular string in a text file using java?Best solution by Stack Overflow
- How to prevent a burn from scarring?Best solution by eHow old
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.