title: Is there locally saved data (like Fortran's) in Julia?
body: <p>I am currently trying to re-write an entire Fortran 77 code into Julia.  Within this Fortran code, there are various local variables with the <code>SAVE</code> attribute (from a <code>SAVE</code> statement or when explicitly initialized in a <code>DATA</code> statement).</p>
  
  <p>The problem is: I haven't been able to reproduce the same outcome that one would expect with these saved variables in Fortran.  For example, the code have many random generator programs extracted from the Numerical Recipies. In particular, <code>ran3.f</code>, called not only from within the main program, but from many different subroutines within it. </p>
  
  <p>The <code>ran3.f</code> states:</p>
  
  <pre><code>FUNCTION ran3(idum)
  
  c Returns a uniform random deviate between 0.0 and 1.0. 
  c Set idum to any negative value to initialize or reinitialize the sequence.
  
  INTEGER idum
  
  INTEGER MBIG,MSEED,MZ
  
  REAL ran3,FAC
  
  PARAMETER (MBIG=1000000000,MSEED=161803398,MZ=0,FAC=1./MBIG)
  
  INTEGER i,iff,ii,inext,inextp,k
  INTEGER mj,mk,ma(55)    
  
  SAVE iff,inext,inextp,ma
  
  DATA iff /0/
  
  if(idum.lt.0.or.iff.eq.0)then
  
  CODE ... Etc, etc...
  
  return
  end
  </code></pre>
  
  <p>I have been able to reproduce the same results (random numbers) given a particular seed, and also to behave across the entire program and subroutines according to what is expected, but it was only by using a lot of returning variables and input variables. </p>
  
  <p>How can the two lines</p>
  
  <pre><code>SAVE iff,inext,inextp,ma
  DATA iff /0/
  </code></pre>
  
  <p>be replaced in Julia in order to acomplish the same behavior?</p>