add check to filter invalid variable attributes as in the sam method in UNS