Suppose $d$ is a positive integer that is not a perfect square such that the negative Pell equation, $x^{2}-dy^{2}=-1$ has no solution. Then we know the minimal period of the continued fraction expansion of $\sqrt{d}$ has even length, $2\ell$, and that the partial denominators, $a_{1},\dotsc,a_{2\ell-1}$, are symmetric about the $\ell$-th partial denominator, $a_{\ell}$. I.e., $a_{\ell-j}=a_{\ell+j}$ for $j=1,\dotsc,\ell-1$. It is this partial denominator, $a_{\ell}$, that I am referring to here as the middle partial denominator.
It is a classical result that $a_{2\ell}=2a_{0}$, but my question is what is known about the middle partial denominator, $a_{\ell}$, under the above conditions on $d$.
Of course, if $d=a_{0}^{2}+2$, where $a_{0}$ is a positive integer, for example, then we know that the continued fraction expansion of $\sqrt{d}$ takes the form $[a_{0}; \overline{a_{0},2a_{0}}]$, so the middle partial denominator is $a_{0}$ here. But are there more general results known that do not depend on $d$ satisfying such quadratic expressions that have “nice” continued fraction expansions?
Any known results with references, ideas,… would be greatly appreciated.