Wind farm dynamics and power optimization in realistic atmospheric boundary layer conditions