Algorithms for porosity and subsidence history