fixed variable reading bug in format_nc_files