title: This message always refers to index problems? IndexError: index out of bounds
body: <p>Why do I get this message? </p>
  
  <pre><code> Traceback (most recent call last):
    File "C:\EclipseWorkspaces\csse120\Lake2\Mainloop2.py", line 46, in &lt;module&gt;
  
  Q[i+1]=Qn(HSR[i],TD[i],FW[i],TempLake[i][0])
  
  IndexError: index out of bounds
  
  
  
  Nlayers=23
  N=365
  
  HSR=Hsr(rad)
  TD=Td(air,neb)
  FW=Fw(wind)
  
  def main_loop(Z,z,Areat0,Areat1,TempLake,wind,Q0,Q1):
      n=TempLake.size
      var00=Imp_scheme(Q0,Q1,z,Areat0,Areat1,Z,TempLake,wind)
      var01=fix_profile(n,var00,Areat0)
      return var01
  
  TempLake=np.zeros((N,Nlayers))
  TempLake[0]=T0
  
  Q=np.zeros(N)
  Q[0]=0.0
  for i in xrange(N):
      Q[i+1]=Qn(HSR[i],TD[i],FW[i],TempLake[i][0])
      TempLake[i+1]=main_loop(Z,z,Areat0,Areat1,TempLake[i],wind[i],Q[i],Q[i+1])
  </code></pre>