  Shell structure in the neutron-rich Ca and Ni nuclei is investigated by the
spherical Hartree-Fock calculations with the semi-realistic $NN$ interactions.
Specific ingredients of the effective interaction, particularly the tensor
force, often play a key role in the $Z$ dependence of the neutron shell
structure. Such examples are found in N=32 and N=40; N=32 becomes magic or
submagic in $^{52}$Ca while its magicity is broken in $^{60}$Ni, and N=40 is
submagic (though not magic) in $^{68}$Ni but not in $^{60}$Ca. Comments are
given on the doubly magic nature of $^{78}$Ni. We point out that the loose
binding can lead to a submagic number N=58 in $^{86}$Ni, assisted by the weak
pair coupling.
