The objective of the project is to develop a multiscale model and algorithm for the failure and localization analysis of granular materials based on the micropolar theories in modern mechanics. The macro-contitutive model in which the intrenal length will be included is investigated on the micro level and then used to simulate the problems on macro level to avoid the sensitivity problems in the numerical computations. Furthermore, a self-consistent algorithm from micro level to macro level for nonlinear analysis of materials is established and a high efficient tool for the multilevel analysis of granular materials is performed. It can be found that the present research will be very significant for the multiscale computing and the study of the constitutive model in geomaterials.