Added if clause to protect against an array reference to an empty array.
Added facility for reading/writing coarse mesh.