0

Is it possible to create an array in one programme and then use it in other programmes? The array I am looking to create is very large and its creation will take a while so I don't want to make it anew every time I run the main programme but instead just use it after creating it once in the other programme. Because of its size I'm not sure if printing it to file and then reading it back in would not also be quite inefficient?

It is an integer array of dimensions 1:300 000 and 100.

1

1 Answer 1

0

Long comment:

There are many formats in which you can save data: Fortran unformatted sequential, Fortran unformatted direct, Fortran unformatted stream, NetCDF, HDF5, VTK, ... Really difficult to answer this with any definite answer. We really don't know how time consuming it is to compute it, so we cannot judge whether saving would be more time consuming or not.

Definitely you should be looking for unformatted or binary formats.

Edit: your array is actually not that big. The saving and reading will ne quick. Just use an unformatted file form.

Sign up to request clarification or add additional context in comments.

3 Comments

This and other details should be in the question, not here.
When I include this OPEN(UNIT=10,FILE='all_paths.direct',FORM='UNFORMATTED', ACCESS='sequential', STATUS='unknown') in the code, I get a Segmentation fault?
This and other details (this is not enough to diagnose a problem!) should be in the question, not here. And possibly in a completely new question with this particular problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.