Here is a structure that may do what you want. In words:
You write a procedure that takes the guess, does its calculations and returns the updated value.
You iterate that procedure within a while loop until the process has converged. You wrap that loop in an outer loop to execute once per time slot (e.g. hour).
You have your weather data (which is input to the calculations) in an Array or in an algorithm as function of time. The outer loop picks the appropriate value.
You store the result of the calculation in another Array for later processing.
In high-level pseudo-code:
calc updated value
for time from beginnning to end step one_hour
while abs(newguess-oldguess) > tolerance do
You may need to make sure the while loop terminates even if convergence is not obtained. You may wrap the inner loop into another proc for structure. You can put all the procs in a module for better encapsulation.