Varieties of elementary subalgebras of maximal dimension for modular Lie algebras