has been assumed a discontinuous flow (at the boundary of the loop), except by \cite{Erdelyi_Taroyan_2003a,Erdelyi_Taroyan_2003b} who considered a linear profile to model MHD waves in the Earth's magnetotail.

For the profiles given by Eqs. (11) and (12) it turns out that Eq. (9) is a transcendental equation for the resonant position $r_A$. This equation is solved using standard numerical techniques. Depending on the spatial scales of the density and velocity we distinguish two different regimes, $l^* \gtrsim l$ and the asymptotic case $l^* \ll l$.

The analysis of the first situation is rather simple (see also \cite{Peredo_Tataronis_1990}), since the forward propagating wave has always a single resonant position in the range $R < r_A < R + l/2$, while the resonant position of the backward wave is situated in the range $R - l/2 < r_A < R$. This behaviour is easily understood from Fig.~\ref{fig:figure_2}, where we have plotted the Doppler shifted frequencies and the Alfv\'en frequency as a function of the radial coordinate. The resonant positions are located at the intersections of $\Omega^2$ with $\omega_A^2$ (see arrows). Note that Fig.~\ref{fig:figure_2} also shows that if the Alfv\'en frequency is discontinuous (jump in density, $l = 0$) there are no resonances (implying no damping) since $\Omega^2$ will never intersect the curve corresponding to $\omega_A^2$.

Once the resonant position $r_A$ is determined $|\Delta|_{r_A}$ is evaluated and we finally obtain the value of the damping rate $\gamma$ (using Eq. (8)). A useful quantity that we can calculate is the damping per period, given by

\begin{equation}
\frac{\tau_D}{P} = \frac{|\omega_k|}{|\gamma|} \frac{1}{2\pi}.
\end{equation}

In this expression we use the real part of the frequency given by Eq. (1). In Fig.~\ref{fig:figure_3} (see solid lines) $\tau_D/P$ is represented for two different values of the characteristic widths of the layers $l/R = l^*/R = 0.05, 0.1$, as a function of the internal flow (recall that both the frequency and the damping rate depend on the flow). The curves with positive slope correspond to the forward waves while the ones with the negative slope represent the backward wave. Figure~\ref{fig:figure_3} also shows that increasing the strength of the flow increases the damping per period for the forward wave and decreases it for the backward wave. This is in agreement with the results of \cite{Peredo_Tataronis_1990}, the shifts of the frequency modify the location of the resonant surfaces in such a way that one of the natural modes is closer to the resonance while the other is further away from the resonance relative to the static situation. As a consequence, one mode is damped more efficiently than the other. Nevertheless, the effect of the flow does not significantly change the damping per period for the regime considered here $(0 < v_i/v_{Ai} < 0.1)$. Hence the mechanism of resonant absorption is very robust in the presence of an internal flow. The thicker the layer, the faster the attenuation (cf., the results for $l/R = 0.1$ with the results for $l/R = 0.05$), a result already known for the static case. We also see that the change of $\tau_D/P$ is quite smooth with respect to $v_i$.

In Fig.~4 we have represented the damping per period as a function of $l^*$ in units of loop radius for two different values of $l/R$. In this plot, $l$, the characteristic scale of the density transition, is fixed (recall that we are still in the regime with $l^* \gtrsim l$). For large values of $l^*$ compared to $l$ we see that the dependence is quite weak with the thickness of the flow profile. The forward propagating wave has a larger damping per period than the backward propagating wave. However, when $l^* \lesssim l$ the situation is reversed. The curves cross and the forward propagating wave is attenuated faster than the backward propagating wave, indicating that we are at the threshold of a different regime.

Now let us concentrate on the situation when $l^* \ll l$, i.e., we investigate the case with a very steep profile for the equilibrium flow velocity. This is different to the regime discussed earlier ($l^* \gtrsim l$) in several aspects. In Fig.~5 we have plotted a typical example. It is easy to see that the forward wave can have now three different resonant positions (see arrows). Apart from the resonance inside the inhomogeneous velocity

\begin{figure}
\centering
\includegraphics{figure_2.pdf}
\caption{Forward ($\Omega_+$), backward ($\Omega_-$) and local Alfv\'en frequency (thick line) as a function of the radial position. The arrows indicate the location of the resonances. In this plot $v_i/v_{Ai} = 0.02$, $l/R = 0.1$, $l^*/R = 0.01$, $L = 100R$ and $\rho_i/\rho_e = 3$. The dotted vertical lines mark the limits of the inhomogeneity of the flow.}
\label{fig:figure_2}
\end{figure}

\begin{figure}
\centering
\includegraphics{figure_3.pdf}
\caption{Damping per period as a function of the flow inside the loop for the forward ($+$) and backward ($-$) propagating waves. The solid lines represent the analytical results calculated using Eqs. (1) and (8). The dashed lines are the approximations of the damping per period using Eqs. (17) and (28). The dots represent the full numerical solution of the resistive eigenvalue problem. The horizontal dotted lines are the damping per period in the static situation. For the curves with $l/R = 0.05, 0.1$ we have used $l^*/R = 0.05, 0.1$.}
\label{fig:figure_3}
\end{figure}