Re: Save an array to memory for another program to read it



On 2006-06-21 05:45:23 -0300, Catherine Rees Lay <spamtrap@xxxxxxxxxxxxxx> said:

Nektarios - Greece wrote:
I run a program and suppose it creates an array A.
I need the program to store into memory this array, end itself and when immediately runs again to load this array again from the memory.

H O W ?

I am new in Fortran. So, please help me.

Well - I guess you could have a second program running which you sent the data to, and then when the first program starts up again it could request the data back again...

I wouldn't go there, especially since you are new to the language. Over-complicated and not portable. Just write a file and read it back in again.

One question - why is your program ending itself and then immediately starting again, while needing the data to be saved? It sounds more as if you want to go round a loop within a single run of the program.

Catherine.

Or it might be that the OP has used the term "program" where others might
have said "subroutine" so what it required is to read a bit further into
the "Intro to Programming" and find out about subroutines and functions.
The storing and loading again may be nothing more than just passing arguments.

It is the old question of whether the stated problem is the real problem
or just an attempt at describing the real problem that has resulted in a
failure to communicate.



.



Relevant Pages

  • Re: Question of memory management in Perl
    ... > I have question with respect to memory utilization using perl. ... an array. ... into a file at the end of the subroutine. ... Using strict will force proper ...
    (perl.beginners)
  • Re: passing large arrays to functions
    ... functionally identical subroutine will not. ... typically create new memory, they just pass the address and work on ... of an array is passed, ... In some cases the called routine works ...
    (comp.lang.fortran)
  • Re: Compiler creating unnecessary intermediate temporary array
    ... create an unnecessary temporary intermediate array which causes the ... application to run of stack or memory. ... subroutine f ...
    (comp.lang.fortran)
  • Re: Compiler creating unnecessary intermediate temporary array
    ... create an unnecessary temporary intermediate array which causes the ... application to run of stack or memory. ... subroutine f ...
    (comp.lang.fortran)
  • Re: Fast string operations
    ... Looping: I thought looping over arrays in managed code was "slow" ... array handling and such. ... The problem with TrimHelper is that it always returns a new string instance. ... The customer perceives this as a memory leak. ...
    (microsoft.public.dotnet.languages.csharp)

Loading