  The dynamics of a molecule in a magnetic field is significantly different
form its zero-field counterpart. One important difference in the presence of a
field is the Lorentz force acting on the nuclei, which can be decomposed as the
sum of the bare nuclear Lorentz force and a screening force due to the
electrons. This screening force is calculated from the Berry curvature and can
change the dynamics qualitatively. It is therefore important to include the
contributions from the Berry curvature in molecular dynamics simulations in a
magnetic field. In this work, we present a scheme for calculating the Berry
curvature numerically, by a finite-difference technique, addressing challenges
related to the arbitrary global phase of the wave function. The Berry curvature
is calculated as a function of bond distance for H$_2$ at the restricted and
unrestricted Hartree--Fock levels of theory and for CH$^{+}$ as a function of
the magnetic field strength at the restricted Hartree--Fock level of theory.
The calculations are carried out using basis sets of contracted Gaussian
functions equipped with London phase factors (London orbitals) to ensure
gauge-origin invariance. In the paper, we also interpret the Berry curvature in
terms of atomic charges and discuss its convergence in basis sets with and
without London phase factors. Calculation of the Berry curvature allows for its
inclusion in \textit{ab initio} molecular dynamics simulations in a magnetic
field.
