Split the calculation of the available potential energy budget into two parts
Fixed sign errors in new formulation