  Let $A=kQ/I$ be a finite dimensional basic algebra over an algebraically
closed field $k$ which is a gentle algebra with the marked ribbon surface
$(\mathcal{S}_A,\mathcal{M}_A,\Gamma_A)$. It is known that $\mathcal{S}_A$ can
be divided into some elementary polygons $\{\Delta_i\mid 1\le i\le d\}$ by
$\Gamma_A$ which has exactly one side in the boundary of $\mathcal{S}_A$. Let
$\mathfrak{C}(\Delta_i)$ be the number of sides of $\Delta_i$ belonging to
$\Gamma_A$ if the unmarked boundary component of $\mathcal{S}_A$ is not a side
of $\Delta_i$; otherwise, $\mathfrak{C}(\Delta_i)=\infty$, and let
$\mathsf{f}\text{-}\Delta$ be the set of all non-$\infty$-elementary polygons
and $\mathcal{F}_A$ (respectively, ${\mathsf{f}\text{-}\mathcal{F}}_A$) the set
of all forbidden threads (respectively, of finite length). Then we have
\begin{enumerate} \item[{\rm (1)}] The global dimension of
$A=\max\limits_{1\leq i\leq d}{\mathfrak{C}(\Delta_i)}-1
=\max\limits_{\mathit{\Pi}\in\mathcal{F}_A} l(\mathit{\Pi})$, where
$l(\mathit{\Pi})$ is the length of $\mathit{\Pi}$. \item[{\rm (2)}] The left
and right self-injective dimensions of $A=$ \begin{center} $\begin{cases} 0,\
\mbox{\text{if {\it Q} is either a point or an oriented cycle with full
relations};}\\ \max\limits_{\Delta_i\in{\mathsf{f}\text{-}\Delta}}\big\{1,
{\mathfrak{C}(\Delta_i)}-1 \big\}=
\max\limits_{\mathit{\Pi}\in{\mathsf{f}\text{-}\mathcal{F}}_A}
l(\mathit{\Pi}),\ \mbox{\text{otherwise}.} \end{cases}$ \end{center}
\end{enumerate} As a consequence, we get that the finiteness of the global
dimension of gentle algebras is invariant under AG-equivalence. In addition, we
get that the number of indecomposable non-projective Gorenstein projective
modules over gentle algebras is also invariant under AG-equivalence.
