I have a f90 code containing a loop. I need to set a relatively large array to zero at the start of the loop. I found that this takes a surprisingly long time (~3 seconds per call and I have ~100000 iterations). I found that it is quicker to de-allocate the memory (coming up as 0 ms in profile) and then reallocate it but the arrays are only intialised to zero on the first allocation.
Is there a way to force allocated memory to have an assigned value? I tried the -zero compiler flag but this doesn't work
I know that, in a perfect world, is should assign a value to each declared variable/array but I am looking for a rough and ready way to save myself 300000 seconds...
Thanks in advance