marthinius:
I'm trying to run the above code, but unsuccessfully.
You will note that this thread is pretty old, and I suspect rather pointless even when it was current. Inaccuracies in the DS1307 were down to lack of temperature compensation as much as hardware drift. If your fix does not provide temperature compensation, you are probably on a futile venture, which may explain why the original code is hard to find. In the meantime the price of the DS3231 has come down to much the same as the DS1307, and doesn't need all this stuff. If you need to be serious about clock accuracy, you might look at that.