Framework stability of nanoporous inorganic structures upon template extraction and calcination: a theoretical study of gallophosphate polymorphs.