Software Design for Petascale Climate Science