set global vars subroutine
The current structure of the 'evolve' subroutine includes several components that are inefficient. We should introduce a new subroutine, "set_global_vars", specifically designed to handle all initializations before the main loop begins.