I'm trying to find out why my code for writing complex arrays into a file and then reading from file into a complex array gives me wrong results. My code is divided into 2 programs: first program calculates values for the array cust_no and writes them into a file.cust_no.dat, the second program reads the data from file into array and processes the data further.
Piece of code for writing data into file:
open(222, FILE="cust_no.dat", ACTION="WRITE", Status='unknown', FORM="FORMATTED")
Piece of code for reading data from file:
open(222, FILE="cust_no.dat", ACTION="READ", Status='unknown', FORM="FORMATTED")
Surprisingly, this code works perfectly fine for small number of values in the array, however for large array cust_no values written into the file differ from the values read from the file.
I'd be grateful for ideas on why this method of writing/reading complex arrays does not work correctly for large arrays, or how to better write/read complex data.
Impossible to tell from these snippets. Please come up with a small (if possible) but complete test case that demonstrates the problem, and I'm sure we'll be able to help you.