Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Backup assume size arrays in a subroutine

Status
Not open for further replies.

putzcommander

Technical User
Aug 6, 2008
3
CA
Hi

I'm currently modifing a subroutine to a compiled program. I need to backup all the arguments and common blocks of the subroutine for future reference (I'll have to call the subroutine from another program under the same cirumstances). My question is whether there is a simple and efficient way to backup these parameters considering the arrays are assumed size arrays, and everything is of datatype unknown (well the vast majority). I'd like to simply write it to a file and read it at a later date but I need to get the information into the file in the first place. Any ideas on functions or methods or perhaps a link to a quick demo would be fantastic.

The code is in fortran77, I'm compiling with ifort on a 64bit Xeon system running CentOS 5. The subroutine is called well over a million times if it matters.
I'm new to the forum, and far from a computer scientist so I'm apologizing in advance for leaving out any obviously required information or requesting something utterly rediculus.

Thanks in advance.
 
I don't know if you have the manual for your compiler. If you do, have a look at namelist. This isn't standard in Fortran 77 but many implementations have it. Unfortunately, the syntax tends to vary so you have to look for an example specific to your compiler.
 
I found the following in my compiler documentation:

Because the actual size of an assumed-size array is unknown, an assumed-size array cannot be used as any of the following in an I/O statement:

* An array name in the I/O list
* A unit identifier for an internal file
* A run-time format specifier

I'm assuming that this destroys any of my previous ideas of writing the parameters to an external file. (if this isn't correct please tell me ). Is there another way of storing the information? perhaps in memory (or does that get dumped on ending the subroutine?) Any help would be great.
 
Can you give an example of a subroutine with the assumed size array and common block and which items you wish to save. I don't know if I'm thinking what you're thinking.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top