  We calculate finite-size effects of the Gaussian model in a L\times \tilde
L^{d-1} box geometry with free boundary conditions in one direction and
periodic boundary conditions in d-1 directions for 2<d<4. We also consider film
geometry (\tilde L \to \infty). Finite-size scaling is found to be valid for
d<3 and d>3 but logarithmic deviations from finite-size scaling are found for
the free energy and energy density at the Gaussian upper borderline dimension
d* =3. The logarithms are related to the vanishing critical exponent
1-\alpha-\nu=(d-3)/2 of the Gaussian surface energy density. The latter has a
cusp-like singularity in d>3 dimensions. We show that these properties are the
origin of nonscaling finite-size effects in the mean spherical model with free
boundary conditions in d>=3 dimensions. At bulk T_c in d=3 dimensions we find
an unexpected non-logarithmic violation of finite-size scaling for the
susceptibility \chi \sim L^3 of the mean spherical model in film geometry
whereas only a logarithmic deviation \chi\sim L^2 \ln L exists for box
geometry. The result for film geometry is explained by the existence of the
lower borderline dimension d_l = 3, as implied by the Mermin-Wagner theorem,
that coincides with the Gaussian upper borderline dimension d*=3. For 3<d<4 we
find a power-law violation of scaling \chi \sim L^{d-1} at bulk T_c for box
geometry and a nonscaling temperature dependence \chi_{surface} \sim \xi^d of
the surface susceptibility above T_c. For 2<d<3 dimensions we show the validity
of universal finite-size scaling for the susceptibility of the mean spherical
model with free boundary conditions for both box and film geometry and
calculate the corresponding universal scaling functions for T>=T_c.
