Length-scale effect due to periodic variation of geometrically necessary dislocation densities