Example of Picard number in family of smooth variety jumping For a scheme or formal scheme $X$, let
$\mathrm{Pic} X$ be its Picard group. If $X$ is a smooth proper variety over an algebraically closed field, let $\mathrm{Pic}^{0}(X)$ be the subgroup consisting of isomorphism classes of line bundles algebraically
equivalent to $\mathscr{O}_{X}$, and define the Neron-Severi group $\mathrm{NS}X :=\mathrm{Pic} X/\mathrm{Pic}^{0}(X) $. By Neron-Severi theorem, $\mathrm{NS}X$ is finitely generated and its rank call the Picard number of X, denote as $\rho(X)$
Now suppose $X$ and $S$ are two varieties, $f: X\to S$ is a smooth proper morphism, let $X_{b}$ be the fiber of $X$ over $b$. My question is following:

Could you show me one example that the function $h: S\to \mathbb{Z}: h(b)=\rho({X_{b}})$ is not locally constant?

I use google to search this question. But I can only find that this conclusion is true and can not find a specific example. So could you give me one specific example? Thank you very much!
 A: To give such an example, we need to use two facts.

Noether-Lefschetz theorem: If $S_{d}\subseteq \mathbb{P}^{3}$ is a very general surface, then $\mathrm{Pic}(S_{d})\cong \mathbb{Z}$.

Hence we could choose a quartic surface $S_{0}$ in $\mathbb{P}^{3}$, such that $\rho(S_{0})\leq 1$.

The Picard number of Fermat's surface $S_{F}: x^4+y^4+z^4+w^4=0 $ is 20.

Construction:  Let $Y$ be the open set of a projective space
parametrizing degree $d = 4$ smooth hypersurfaces in $\mathbb{P}^{3}$ , $X$ be the
universal hypersurface over $Y$. Then $\rho$ is not locally constant, since $\rho(S_{0})\leq 1, \rho(S_{F})=20$.
A: For an elliptic curve $E$ over $\mathbb{Z}$, the Picard number of $E \times E$ is $3$ if $E$ has no complex multiplication (generated by horizontal, vertical, diagonal classes) and 4 if it does (also take the class of the graph of a non-integer endomorphism).
So you can take any family of elliptic curves which includes all isomorphism classes, e.g. the Legendre family
$$
y^2 = x(x-1)(x-\lambda),
$$
and consider the fiber product of this family with itself over the base to get a family of elliptic surfaces where the Picard number jumps at special points.
