Can you say more about what you intend to do with these matrices?
I have seen a few cases where the programmer thinks he needs to do. But in most cases, the program only requires one matrix at a time. If that i the case for your application, create the matrix, M, inside the loop, use it, and then use the same name for the next iteration.
I've also seen applications where the program requires M_new and M_old. If that is the case, set M_old=M_new at the bottom of the DO loop, and reassign M_new at the top of the loop.
... View more