def calc_gof(resdf, simvar, datavar):
    """Calculate goodness-of-fit measures for given sim & data vars"""
    resdf.loc['error'] = abs(resdf.loc[simvar] - resdf.loc[datavar])
    maeom = resdf.loc['error'].mean()/resdf.loc[datavar].mean()
    mape = (resdf.loc['error']/resdf.loc[datavar]).mean()
    r2 = (resdf.loc[simvar].corr(resdf.loc[datavar])) ** 2
    return maeom, mape, r2