Fixed a minor error when creating pores. Added function for writing out the frozen matrix