  We present a semiempirical pseudopotential method based on screened atomic
pseudopotentials and derived from \textit{ab initio} calculations. This
approach is motivated by the demand for pseudopotentials able to address
nanostructures, where \textit{ab initio} methods are both too costly and
insufficiently accurate at the level of the local-density approximation, while
mesoscopic effective-mass approaches are inapplicable due to the small size of
the structures along, at least, one dimension. In this work we improve the
traditional pseudopotential method by a two-step process: First, we invert a
set of self-consistently determined screened {\it ab initio} potentials in
wurtzite GaN for a range of unit cell volumes, thus determining
spherically-symmetric and structurally averaged atomic potentials. Second, we
adjust the potentials to reproduce observed excitation energies. We find that
the adjustment represents a reasonably small perturbation over the potential,
so that the ensuing potential still reproduces the original wave functions,
while the excitation energies are significantly improved. We furthermore deal
with the passivation of the dangling bonds of free surfaces which is relevant
for the study of nanowires and colloidal nanoparticles. We present a
methodology to derive passivant pseudopotentials from {\it ab initio}
calculations. We apply our pseudopotential approach to the exploration of the
confinement effects on the electronic structure of GaN nanowires.
