Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Sub program help

Andrew_Cunningham
696 Views
Hi

I am new to the fortran programming language and wondered if anybody could point me in the direction of a possible numerical recipe which could do the following.

I have a code which runs many iterations of a system lifetime using an iterative counting loop. During each iteration the program moves randomly through 32 system states. The current system state is reflected by the value of a system state vector B.

I need a subprogram which when called on the first time stores the value of vector B at that instant in an array (B1). On the next iterationI need it to move the original B1 to a new location in the array and store the current value of B in the array (B2). The next time i need it to move B1 and B2 to new locations in the array, and store the current value of B (B3).

In this way I need to be able to call on the subprogram to write out the contents of the array so that i can find out the previous three system states.

Can anybody suggest anything?

Cheers for taking the time to read this.
0 Kudos
2 Replies
anthonyrichards
New Contributor III
696 Views
Hi

I am new to the fortran programming language and wondered if anybody could point me in the direction of a possible numerical recipe which could do the following.

I have a code which runs many iterations of a system lifetime using an iterative counting loop. During each iteration the program moves randomly through 32 system states. The current system state is reflected by the value of a system state vector B.

I need a subprogram which when called on the first time stores the value of vector B at that instant in an array (B1). On the next iterationI need it to move the original B1 to a new location in the array and store the current value of B in the array (B2). The next time i need it to move B1 and B2 to new locations in the array, and store the current value of B (B3).

In this way I need to be able to call on the subprogram to write out the contents of the array so that i can find out the previous three system states.

Can anybody suggest anything?

Cheers for taking the time to read this.

Sounds like homework to me! Moving data like that seems to me a waste of computing time.
I wouldn't move any data, just keep track of the iteration number and put the present set of data in the next column of a previously-defined 2 -D array.
0 Kudos
Andrew_Cunningham
696 Views

I considered this option however the program runs iterations in the region of 10^(12) or more in some cases. This seems like a really large data which is why im now considering only storing the previous three.

0 Kudos
Reply