title: Are local variables in Fortran 77 static or stack dynamic?
body: <p>For my programming languages class one hw problem asks: </p>
  
  <p>Are local variables in FORTRAN static or stack dynamic?  Are local variables that are INITIALIZED to a default value static or stack dynamic?  Show me some code with an explanation to back up your answer.  Hint: The easiest way to check this is to have your program test the history sensitivity of a subprogram.  Look at what happens when you initialize the local variable to a value and when you don’t. You may need to call more than one subprogram to lock in your answer with confidence.</p>
  
  <p>I wrote a few subroutines:
  - create a variable
  - print the variable
  - initialize the variable to a value
  - print the variable again</p>
  
  <p>Each successive call to the subroutine prints out the same random value for the variable when it is uninitialized and then it prints out the initialized value. </p>
  
  <p>What is this random value when the variable is uninitialized?</p>
  
  <p>Does this mean Fortran uses the same memory location for each call to the subroutine or it dynamically creates space and initializes the variable randomly?</p>
  
  <p>My second subroutine also creates a variable, but then calls the first subroutine. The result is the same except the random number printed of the uninitialized variable is different. I am very confused. Please help!</p>
  
  <p>Thank you so much.</p>