[netcdf] introduced function that returns variables on a file in a more abstract way