Linking scales of flow variability to lotic ecosystem structure and function