pro select_current_grids @common_blocks.inc print, 'start select current grids' if N_elements(all_grid_info) gt 1 then begin ta = all_grid_info.time lh = histogram(all_grid_info.level, reverse_indices=r, OMAX=maxl, OMIN=minl) firstl = 0 runi = 0L if N_elements(grid_info) eq 0 then grid_info = aunit for i=0,maxl-minl DO $ if lh[i] gt 0 then BEGIN tli = [r[r[i]:r[i+1]-1]] ; this level grid indeces data_format = determine_data_format_from_file_name(all_grid_info[0].baryon_file) if data_format ne 6 then $ iin = where(ta[tli] eq times[time_index], count) $ ; time < current else iin = where(ta[tli] le times[time_index], count) ; time < current let = 0 if ((count ne 0)) then let = max(ta[tli[iin]]) $ ; of those the maximum time else begin ; if there is none the first level is not this one firstl += 1 continue endelse add = tli[where(ta[tli] eq let)] ; add the ones whith time eq max time < current nadd = N_elements(add) if i eq firstl then is = add else is = [is, add] print, 'level:', minl+i,' time: ', let, nadd, ' grids. Total:' ,N_elements(is) endif grid_info = all_grid_info[is] grid_info = set_level_info(grid_info) ; grid_info = find_and_set_parent_grids(grid_info) grid_info = order_grids(grid_info) endif else grid_info = all_grid_info if verbose then show_hierarchy_information, grid_info print, N_elements(ngrid_info), ' total current grids' ; if data_format ne 7 then grid_info = fast_find_and_set_parent_grids(grid_info) print, 'end select current grids' END