Let $S$ be the spectrum of $\mathbf{Z}$ or the spectrum of an algebraically closed field. (Actually, one can take $S$ to be any noetherian integral regular scheme.)
Let $f:X\longrightarrow Y$ be a finite morphism of integral normal projective flat $S$-schemes which is etale above the complement of $B$, where $B\subset Y$ is a closed subscheme of codimension $1$. Suppose that $Y$ is regular.
Example. You could take $f$ to be a finite surjective morphism of normal surfaces such that $Y$ is nonsingular.
Since $Y$ is regular, we have a canonical sheaf $\omega_{Y/S}$. Let $s$ be a nonzero rational section of $\omega_{Y/S}$.
Define the cycle $K_{X/S} := \mathrm{div}(s)$. Note that $K_{X/S}$ is a canonical divisor.
Let $f^\ast s$ be the induced nonzero rational section of the line bundle $f^\ast \omega_{Y/S}$ on $X$ and consider the Weil divisor $\mathrm{div}(f^\ast s)$ on $Y$.
Outside $f^{-1}(B_)$, we have that $\mathrm{div}(f^\ast s)$ is the pull-back of $K_{Y/S}$. Therefore, there is a Weil divisor $R_f$, supported on $f^{-1}(B)$, such that $\mathrm{div}(f^\ast s) = f^\ast K_{Y/S} + R_f$.
Question 1. How are the coefficients of $R_f$ defined?
Question 2. Is the Weil divisor $\mathrm{div}(f^\ast s)$ a canonical divisor outside the singular locus of $X$?
Question 3. Is $R_f$ independent of $s$?
Note that I work with cycles and not with classes up to linear equivalence.

