def mask_output(dataarray, mitgcm_grid, point='T'):
    """ mask the output from the regridding with mask from the model """
    if point == 'T':
        fac = 'hFacC'
    elif point == 'U':
        fac = 'hFacW'
    elif point == 'V':
        fac = 'hFacS'
    if 'k' in dataarray.dims:
        out = dataarray.where(mitgcm_grid[fac] != 0)
    else:
        out = dataarray.where(mitgcm_grid[fac].sel(k=0) != 0)
    return out
