Begin the code from where it had stopped

I have written a code which takes 5-6 days to run completely (it is a time loop). I am writing the output data in a file, but due to power cuts the code gets stopped in between(before it is actually completed) and i have to rerun the code. Is there any way in which the code can be rerun from the same instant where it stopped?
it depends on what it's doing.

You'll need to save state so you can
continue from one of these check
points rather than the beginning.
But how do we implement this in the code?
The code is actually calculating the pressure and velocity at various nodes in the domain at different time instants, which are then written in a file. Now how do we start the code from when it has stopped in between.
Topic archived. No new replies allowed.