I still have not fully understood how these loops work.
Look at a simplified version of your code:
dtime := 1;
while (dtime <= 3600) do begin
something;
dtime := dtime;
end;
code_after_loop;
This is the loop. It starts with dtime = 1 - you had set this value immediately before the program reaches the "while " instruction. This value is smaller than 3600. Therefore the program enters the code block after "while" and "end" - the condition after "while" must be true, otherwise the program jumps to the end of the loop ("end") -
http://wiki.freepascal.org/WHILE..DOThen "something" is calculated using this dtime value. At the end of the calculation dtime is incremented by 1, and the calculation is repeated.
With every pass through the loop dtime is incremented. Eventually dtime will have the value 3601. In this case, the logical condition specified after "while" is no longer true, and the program does not longer enter the "while" part, but executes code after the loop.
Please be aware that the code that you posted does not lead to a correct solution of the differential equation. Please read my posting above.