Development and verification of a numerical library for solving global terrestrial multi-physics problems