I am extremely new to Fortran, so forgive any ignorance in this question.
Anyway I am working on optimizing some simulation software.

To be more clear the subroutine I am editing initializes some static variables at the start and they should be the same no matter what the starting conditions are. 

The problem is I have another piece of coding calling this subroutine across each of its time steps reinitializing hundreds of variables, that should have just stayed the same. To fix this I have created a derived type that includes all these variables from other modules in the program, and I am editing the software to initialize the derived type variables instead of the module variables so that I can just refer across different time steps. 

My question is, am i doing uneeded work. If I instead just took all the initialization stuff and put it in a subroutine outside of my main program, and then linked these at compilation, would all the variables retain their values across function calls.