[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[TRNSYS-users] Read Write function



Good morning I'm working on making a new component and I have a problem in understanding Read Function, Now I calculate some variables which will be used in the second iteration as inputs, so I make a Read Function
j=100
If  (current_time_step > 1) Then
  open(109, file = 'm_new.dat', status='old')
  Do i = j,0
      start_element=(0.5*(i**2-i))+1
      end_element=start_element+(i-1)
      Read(109,*)  m_pb(start_element:end_element)
end do
the function is working well, what I do not understand is, how does the do loop work from 100 to 0? And when I reverse it from 0 to 100, or from 1 to 100, it doesn't read anything.