Development of a High-Resolution Wind Forecast System Based on the WRF Model and a Hybrid Kalman-Bayesian Filter

: Regional microscale meteorological models have become a critical tool for wind farm production forecasting due to their capacity for resolving local ﬂow dynamics. The high demand for reliable forecasting tools in the energy industry is the motivation for the development of an integrated system that combines the Weather Research and Forecasting (WRF) atmospheric model with an optimization obtained by the conjunction of a Kalman ﬁlter and a Bayesian model. This study focuses on the development and validation of this combined system in a very dense wind farm cluster located in Galicia (Northwest of Spain). A period of one year is simulated at 333 m horizontal resolution, with a daily operational forecasting set-up. The Kalman-Bayesian ﬁlter was tested both directly on wind speed and on the U-V (zonal and meridional) components for nowcasting periods from 10 min to 6 h periods, all of them with important applications in the wind industry. The results are quite promising, as the main statistical error indices are signiﬁcantly improved in a 6 h forecasting horizon and even more in shorter horizon cases. The Mean Annual Error (MAE) for 1 h nowcasting horizon is 1.03 m/s for wind speed and 12.16 ◦ for wind direction. Moreover, the successful utilization of the integrated system in test cases with different characteristics demonstrates the potential utility that this tool may have for a variety of applications in wind farm operations and energy markets.


Introduction
The global expansion of wind energy is a well-known reality, especially in recent years. In fact, in 2017 52.5 GW of new wind power installations were added across the globe, bringing the total worldwide capacity up to 539 GW [1]. This was a record year for Europe as well, reaching record numbers with 15.6 GW of new wind power capacity installed [2]. Part of this success has derived from offshore wind farms and their new 3.1 GW in 2017. The market forecast predicts a continuation of this tendency for the next few years [1,3], establishing wind energy as one of the main ingredients of the worldwide energy mix, which translates into an increasing number of operational wind farms, composed of more powerful wind turbines.
Considering the aforementioned scenarios, an improvement of wind energy exploitation seems necessary, employing new strategies in future wind farm projections and better daily management of current installations. The latter is where high-resolution meteorological modeling becomes increasingly prominent. Local short-term forecasts can supply valuable information in an operational wind farm, as wind speed and direction predictions can lead to a better running of the installation [4,5] or even provide alert for any extreme weather situation such as a downslope windstorm [6] or a severe frost [7].
The Weather Research and Forecasting (WRF) meso and microscale model has been used extensively during the last few years in the wind energy field for a variety of applications [8][9][10]. It includes a wind turbine parameterization [11] enabling the study of the wake effect from wind turbines [5,12]. However, Numerical Weather Prediction (NWP) simulations by themselves, present some limitations regarding subgrid scale phenomena forecasting. Onshore farms can be affected by local climatology and microscale events with significant wind direction and intensity changes in short periods of time. It is well known that such variations cannot be well reproduced by NWP simulations with resolution lower than that of the small-scale events commented above. To address this problem, WRF Large Eddy Simulations (LES) have been shown to be useful modeling techniques within this field. Their high resolution (<100 m) allows obtaining a good characterization of the turbulent intensity and an accurate representation of the wind fields [13][14][15]. Despite these capabilities, the computational demands of this modeling methodology and its numerical instability over complex terrain [14,16] make it unfeasible for operational forecasting at the present time.
The combination of NWP and statistical post-processes, like Model Output Statistics (MOS) or dynamically adjustable filters, can be an effective technique to minimize errors induced by sub-grid phenomena and local effects. In this direction, several strategies have been developed. Kariniotakis and Pinson [17], Kariniotakis et al. [18] proposed a neural network approach while Vanem [19], Giebel [20], Resconi [21] and others introduce methodologies based on heavy statistical models. Another method adopted for the reduction of systematic biases that numerical weather prediction models face, is Kalman filtering based algorithms (Resconi [21], Pelland et al. [22], Galanis et al. [23,24], Crochet [25], Galanis and Anadranistakis [26], Kalnay [27], Kalman and Bucy [28], Kalman [29]). Stathopoulos et al. [30] used the combination of an ETA-coordinate weather prediction model (running at a resolution of 0.05 • ) and a Kalman Filtering postprocess for wind power prediction. This showed an improved performance and favorable results. Hua et al. [31] use 3 km × 3 km WRF model simulations and a Kalman Filter to obtain more skillful wind speed forecasts. Che et al. [32], Che and Xiao [33] developed a similar forecasting system employing 0.5 km resolution WRF simulations with a Kalman filter for a wind farm in Japan. Despite the overall good performance, in many cases, such filters only reduce the systematic mean bias [34], especially in wind speed, due to the nature and variability of the parameter. A proposed solution for this drawback is described analytically in Galanis et al. [35]. The suggested optimization technique is emerging from the conjunction of a non-linear Kalman filter and a Bayesian model (K-B model). This new hybrid model led to promising results eliminating systematic biases in the model outputs and reducing the variability of the remaining white noise.
In this study, we develop and validate a combined system of WRF high-resolution simulations and the aforementioned K-B filter. The main novelty proposed is the application of the hybrid filter to the two-dimensional field of horizontal wind speed components instead of the 1-dimensional filter in Galanis et al. [35]. In this way, an improved prediction of wind speed and direction is produced for a very dense wind farm cluster located in Galicia (NW Spain). A period of one year, broken into 365 daily integrations, is simulated with the WRF atmospheric model at high resolution (333 m), and results are post-processed with the K-B filter. The obtained integrated system is validated for different short-term forecast periods employing in-situ data from meteorological stations on the top of the wind turbines provided by the farm's operator. In addition, the new wind direction nowcasting tool is applied to the wind energy field as a backup for the current yaw orientation systems, which are based on Supervisory Control And Data Acquisition (SCADA) data obtained from each wind turbine [36]. These sensors are sometimes affected by short temporal errors due to technical problems or severe meteorological situations. Apart from the wind farm operational issue, this kind of tool can be used by electric grid operators to prevent ramp event effects. These extreme short-term situations produce significant increases or drops in the power production [37], delivering a major impact on the grid.
The article is structured as follows: In Section 2 the methodology is explained in detail, with particular attention to the WRF model configuration and the K-B filter description. Section 3 discusses the results obtained for wind speed and wind direction nowcasting as well as applications on wind energy forecasting. Finally, in Section 4 conclusions are presented.

Wind Farm Location and WRF Configuration
Coruxeiras wind farm is located in Serra do Xistral mountains in Galicia, in northwest Spain (Figure 1a). The prevailing winds in this area are in the southwest/northeast direction (Figure 1c). In winter, frequent passing by cyclones along the North Atlantic storm track often produce strong southwest flows, whereas in summer, the poleward displacement of the subtropical Azores high, results in winds with a northeast component. Southeast/northeast flows are further accelerated due to the packing of the isobars by interaction with the high terrain of the northwestern Iberian Peninsula; hence the position of Serra do Xistral, exposed to the ocean in both prevailing directions, results in a very high wind energy potential. Numerous wind farms exist in the area, which is one of the most productive in Europe [38,39]. The developer and current operator of Coruxerias wind farm is Norvento S.L.U. company. It was installed in 2006 and is composed of 31 turbines with 60 m hub height and 74 m rotor diameter. They are separated by a mean distance of 300 m and placed along smooth hill tops of around 800 m elevation above sea level (Figure 1b). For the atmospheric simulations, we use the Advanced Research WRF (ARW) model version 3.6 [40] (WRFV3.6), designed for operational forecasting, as well as research. WRFV3.6 is a limited-area mesoscale and microscale model based on a fully compressible and non-hydrostatic dynamic core [41] that uses a terrain-following hydrostatic-pressure vertical coordinate. Figure 1a shows the domain's configuration where D01 is centered at 43.29 N and 7.75 W (Figure 1a) with 121 × 121 grid points of 9 km of horizontal resolution. The horizontal resolutions of D02, D03, and D04 are 3 km (121 × 121 grid points), 1 km (91 × 91 grid points) and 333 m (91 × 91 grid points) respectively. As demonstrated in Prósper et al. [5], the high horizontal resolution used over this complex terrain increases the accuracy of the wind forecast. The innermost domain has 67 vertical levels, 7 of which lie within the first 200 m above ground, at about 14, 41, 70, 99, 127, 156 and 184 m, a distribution that better captures wind and temperature variations in the surface layer [42] and improves the performance of the wind turbine parameterization [11]. Terrain elevation data is obtained from the ASTER Global Digital Elevation Map (GDEM) from USGS (United States Geological Survey) [43] with a resolution of 30 m, and land use information from the Corine (Coordination of Information on the Environment) database [44] with 250 m resolution.
A thorough validation of this model configuration for Coruxeiras wind farm and more information about the model physics options can be found in [5]. In the next table (Table 1), we present the main physics parameterizations used. One year (2015/02/01-2016/02/01) of GFS forecast data from the National Centers for Environmental Prediction (NCEP) are used as initial and boundary conditions for the WRF model, with a 3-h update interval. The horizontal resolution of this dataset for all variables is 0.25 × 0.25 deg, with 32 levels ranging from 1000 to 10 hPa. The use of forecast data as boundary conditions should be particularly highlighted, as this study is performed employing a daily operational forecasting set-up, therefore including all the potential drawbacks of such an application.
Moreover, the A.C. Fitch wind turbine parameterization [11,52] is used in order to account for the wake effects of the turbines. Given the wind turbine dimensions, power curve, and their positions, the Fitch scheme represents them as momentum sinks, transferring the flow's kinetic energy into turbulent kinetic energy and electricity.

Hybrid Bayesian Kalman Filter
In this subsection, the statistical optimization postprocess adopted is presented. Beginning with the polynomial Kalman filtering local adaptation model, the main goal is the estimation of the atmospheric model bias y t as a function of the model output m t .
where x i,t (i = 0, 1) are the parameters to be estimated and v t is the Gaussian nonsystematic error.
The above equation can be expressed as y t = H t · x t + v t where x t = x 0,t x 1,t is the state vector and H t = 1 m t the observation matrix. As a result, it can be written in a more analytical way as follows: Similarly, the evolution in time of x t is described by the equation where x t−1 is the parameter in t − 1 and w t is the Gaussian nonsystematic error.
In the present study, a linear approach is followed, since it was found to be sufficient both in terms of reliability and computer resource needs. The estimation of the variables v t and w t is based on a training period. For this case and after multiple sensitivity tests, the training period was set to 140 include the last 12 values of the sample for each forecast. We note, however, that options such as the order of the polynomial in Equation (1) used or the training period, are case sensitive and depend on local features and time period characteristics.
In particular, the covariance matrices V t and W t of the error terms v t and w t are calculated as follows: The main steps of the Kalman algorithm for the estimation of the state vector x t are summarized as follows: The corresponding covariance matrix P t is calculated by With a new observation y t available the calculation of x at time t takes the form: a parameter that controls the flexibility of the filter.
More details on the Kalman filtering theory can be found in [27][28][29]. The filter has been tested successfully in wind speed and wind gust prediction Stathopoulos et al. [30], Louka et al. [34], Patlakas et al. [53], Galanis et al. [35] with results that ensure the reduction of the systematic errors induced by numerical weather models.
However, in most of the previous studies, the variation of the remaining nonsystematic part of the error is not reduced. For a further improvement of the Kalman filter output, we incorporate the following linear Bayesian model: where, k t represents the Kalman filtered output at time t (estimated by the Kalman filter as the model initial forecast corrected by y t ), o t is the corresponding observation value, and n t the remaining Gaussian nonsystematic white noise. For the application of the Bayesian model, an approach based on Normal distribution is utilized based on the assumption that the probability density functions of the filter parameters have as follows: . The final estimation of the parameter o t takes advantage of the posteriori estimator given by Further details concerning Bayesian theory and models can be found in the studies of Box [54] and Bernardo and Smith [55], while the combination of the two approaches is fully described by Galanis et al. [35].
The new approach proposed in this work consists in the application of the K-B model for both wind speed and U-V components for different forecasting horizons, covering in this way both wind speed and direction with quite satisfactory results as presented in the following sections.

Observational Data and Nowcasting Experiments
The observational data used in this work is provided by Norvento S.L.U., collected from anemometers located on top of each turbine's nacelle. Specifically, we use wind speed and wind direction (WS and WD hereafter) observations from six wind turbines, two in the north of the farm (WT2 and WT7), two in the center (WT13 and WT16) and two in the south (WT24 and WT26) (Figure 1b). In this way, the WRF K-B nowcasting tool is tested all over the wind farm, with each turbine differently affected by wake effects and local topography. One year of 10-min wind data for each turbine is available. We note that a priori quality control on the raw observational data is performed, filtering out discontinuities such as automatic starts after stops or preventive maintenance. This leads to three different applications of the integrated forecasting model. More precisely, in the first scenario, the forecasting bias in WRF wind speed prediction is minimized by the Kalman filter described in the previous section based on the polynomial Equation (1). In a second step, the Bayesian component of the optimization procedure reduces the variability of the error, and therefore the forecasting uncertainty. Following the same concept, two different K-B filters are utilized separately for the U, V wind speed components. This scenario aims at the improvement of both the wind speed and direction simultaneously.
The period chosen for the present study is one year (1 February 2015-1 February 2016), divided into 365 daily simulations. Each run starts at 18 UTC the day before the one considered, and the initial 6 h are excluded from the forecast data series used in the analysis of the results, thus, only outputs after this spin-up time are taken into account.
By definition, nowcasting refers to short lead time weather forecasts. Some organizations like the U.S. National Weather Service stipulate that it pertains to lead times from zero to three hours. However, forecasts up to six hours are also considered nowcasts by different agencies [56]. To analyze the capabilities of our methodology, we evaluate the K-B filter with different nowcasting horizon periods, from 6 h to 10 min (Table 2) for each one of the daily simulations. For example, the wind speed nowcasting obtained in K-B 1 h is the result of correcting RAW data every 10 min by using model output and real data from one hour before. Results are compared with both observations and original non-post-processed WRF outputs.

Results and Discussion
The next section is divided into three parts; the first one analyzes the results obtained with the nowcasting wind speed postprocess at different time horizons, from 6 h to 10 min in advance. The analysis is developed for different temporal periods, from annual mean results to the performance of the experiments at individual simulation timesteps. The second subsection shows the results of the K-B filter used to measure wind direction correction, same as with wind speed, with different nowcasting horizons and mean errors for several periods. Finally, Section 3.3 shows an example of the improvement that K-B 1 h applied in wind direction could induce in the daily management of the studied wind farm.

Wind Speed Nowcasting
This subsection employs several error measures at different temporal scales to provide a general view of the skill of all the experiments. The next equations show the statistical measures used in different temporal scales throughout the chapter.
Equation (7) gives the Mean Absolute Error (MAE) between forecasts ( f i ) and observations (ob i ), (8) the Mean Error (ME) estimating possible systematic biases, (9) the Root Mean Square Error (RMSE), where n is the sample size, and (10) the standard deviation (σ), where x i is the value, x the mean value of a study period.
Annual mean results are firstly shown in Figure 2, and Table 3 for each wind turbine studied. Figure 2 displays a bar chart with the annual WS MAE and standard deviation for each turbine and experiment performed. Table 3a,b present the annual WS ME and RMSE, again, for each turbine and experiment.  The behavior of the WS ME is different as compared with MAE. All of the RAW WS MEs for the six wind turbines are negative, ranging from −0.33 m/s in WT13 to −1.40 in WT26. Unlike in WS MAEs, there is a clear difference between RAW and K-B 6 h MEs. In K-B 6 h cases, the ME practically disappears, with a value of 0.046 m/s. In the rest of the experiments, the ME is reduced even more; reaching a total ME of 0.005 m/s for the K-B 10 min case. WS RMSEs show a similar tendency to that of WS MAEs, with close mean values of the RAW and K-B 6 h experiments (2.54 and 2.36 m/s respectively) and a definite improvement between the three shorter nowcasting periods (K-B 1 h-30 min-10 min) and K-B 6 h. Figure 3 analyzes the relationship between the observed and simulated wind field in terms of module and direction. As also discussed previously, there are similar error values and patterns in all of the wind turbines, which allows us to group them by areas while maintaining the rigor of the validation. In Figure 3a,c,e the wind speed distribution is displayed for the observations and the RAW, K-B 1 h and K-B 6 h experiments, for the North, Center and South areas respectively. Radar charts in Figure 3b,d,e depict the WS MAE as a function of direction for all experiments and areas.
The distribution plots in Figure 3a,c,e show a significant improvement from the K-B filter in the three areas. K-B 6 h mitigates the main wind speed deviations in all the range of the distributions. In the north area ( Figure 3a) K-B filter cases correct a general overestimation from 6 to 10 m/s and an underestimation from 11 to 22 m/s. This behavior is repeated in the Central and South areas. K-B experiments (even K-B 6 h) obtain an important amelioration of the entire distribution shape, which is in agreement with the low ME errors shown in Table 3a. This demonstrates the reliability of the K-B filter in different wind situations, correcting under-and over-estimations indistinctively, which is vital for wind energy applications. Charts in Figure 3b,d,f show the skill of the K-B tool depending on wind direction. In RAW cases, the three areas present variations, as the general orientation of each zone and their position relative to the rest of the farm change forecast performance. K-B 6 h decreases mainly the higher directional errors as, for example, with southerly winds in the South area (Figure 3f). However, the K-B tool for 1 h, 30 min, and 10 min tends to smooth out errors from all sources, improving results in all the prevailing wind directions. Apart from the low MAE values observed, the symmetry in the figures in the shorter K-B time ranges leads to the conclusion that the tool is robust, rectifying wind errors in any regime. It presents the same good accuracy correcting northeast flows, principally produced in summer, as it does with southwesterly situations, characteristic of winter months. The seasonal cycle of errors averaged for all the turbines is shown in Figure 4, comparing wind speed monthly MAE from RAW results with the same calculation from K-B experiments. Observed monthly mean wind speeds are also shown for reference in the table below (Table 4).  RAW MAEs are relatively constant throughout the year, with values around 2 m/s in all months. Slightly larger errors are observed in the winter period, when mean wind speeds are higher, and lower biases occur in summer months, when mean wind speeds are also lower. K-B 6 h obtains the biggest improvements in the months when the RAW error is largest, such as December or February and minor improvements in the summertime. This tendency to better improve bigger RAW MAE is also reflected in previous comparisons such as for WT26 in Figure 2 or the south radar chart in Figure 3f. In K-B experiments for shorter lead times, the pattern shown in Figure 3 is repeated, with a significant error decrease relative to K-B 6 h results and very similar outcomes in all K-B cases and months. After investigating the intra-annual behavior and monthly error patterns of the experiments, we examine their accuracy on a finer timescale. Figure 5 displays the mean hourly wind speed MAE during the simulated year for all the wind turbines analyzed in each experiment. RAW error results present a daily cycle, with values of the MAE around noon lower than during the night. These differences among the hourly WS MAEs are, however, not very significant, and the lower absolute errors at noon seem to be related with the better representation of turbulent fluxes during that part of the day [5]. In contrast, K-B 6 h errors do not follow a daily cycle, attaining values below 1.75 m/s mostly during daytime, but obtaining a worse result than RAW at 01 and 13 UTC. K-B 1 h, 30 min, and 10 min present a very flat error pattern all day long. There are practically no differences among hourly results in these experiments. The situation is very similar to that in the monthly error plot ( Figure 4); shorter term K-B cases represent a significant improvement with respect to K-B 6 h and RAW, and there is homogeneity in the entire error series in K-B 1 h, 30 min, and 10 min.
The skill limit for the shorter term cases corresponds to a non-systematic part of the error, which is unavoidable for the filter The general conclusion reached from the different time scale and wind regime comparisons presented above is that the K-B filter at short-term erases any source of error. It achieves lower errors in all conditions, regardless of the intensity and direction of the wind or the time of day or season of the year. This uniformity in the corrections toward the elimination of the ME (Table 1) from short-term K-B cases, highlights the utility of this optimization module for wind energy purposes.
To illustrate the day-to-day results of the K-B nowcasting tool regarding wind speed at hub height, we show next comparisons between RAW, K-B 1 h, and observations for the Center area (WT13 and WT16 mean values) during the entire months of May and December. These months have the lowest and highest K-B 1 h MAE in this area respectively.
Disregarding some occasional large errors, the original WRF output (RAW) generally yields a good performance during the months shown, achieving MAEs below 2 m/s in both cases and PBIAS [57] of −10.82% in May and −6.62% in December (−6.59% for the whole year). Even considering these low RAW errors, which are extensive to all the yearly series, the K-B 1 h results represent an important improvement nonetheless. This is clearly apparent in these December and May plots (Figure 6  The nowcasting tool is able to produce better results at different time ranges regardless of the origin of the error, eliminating the most substantial deviations in any situation. Overall, the K-B filter exhibits a useful short-term operational forecasting performance, offering a stable improvement of the original WRF outputs during the whole year and for all the wind turbines.

Wind Direction Nowcasting
Following the discussion on the capabilities of the K-B filter regarding WS (wind speed) nowcasting, we review the statistical tool predicting wind direction (WD) following a similar structure to Section 3.1. To perform the WD nowcasting post-process we obtain the zonal and meridional wind components (U and V) from WS and WD observations, and we use them to correct, with the K-B filter, RAW U and V variables directly extracted from the model output. With the corrected U and V, we recalculate the post-processed WD. Using the same process as in the WS analysis, we test the WD nowcasting for different short-term forecast time periods (Table 2). Figure 7 displays the annual WD MAE and standard deviation for each turbine and experiment. The bar chart depicts in red the results of WD MAE for each RAW wind turbine. All of them are above 20 • ; WT7 with the lowest value, 20.69 • and WT24 with the highest, 28.51 • . The mean value of the MAEs for all the wind turbines in the RAW case is 25.10 • . Comparing K-B 6 h with the unfiltered WRF results, we can see an important amelioration in most of the wind turbines; all of them are now below or practically at 20 • MAE, reducing the mean total K-B 6 h MAE to 19.67 • . This value translates into a 22% improvement with respect to RAW results, a correction impact that doubles that obtained in wind speed nowcasting for this same comparison (WS RAW vs. K-B 6 h). This difference can be attributed to the origin of the observational data used. In WS nowcasting we correct one output data series, with another single data series (observed wind speed). However, in WD nowcasting we use WS and WD data from sonic anemometers to obtain the U and V wind components and calculate the post-processed WD. We are thus introducing more sources of error in this last step that the K-B filter seems nevertheless capable of offsetting.
In the shorter lead times of wind direction nowcasting (K-B 1 h, 30 min, and 10 min) the behavior presents a similarity to that of wind speed nowcasting ( Figure 2). All the turbines attain analogous error values in each experiment, with a total mean WD MAE of 12.16 • , 10.69 • and 9.37 • for K-B 1 h, K-B 30 min and K-B 10 min respectively. Aside from these low errors, there is also a corresponding reduction of the standard deviation. The K-B filter at short-term nowcasting increases prediction accuracy significantly and eliminates more substantial punctual errors from the original WRF forecasting, which is quite important for the use of these kinds of combined nowcasting systems in wind farm applications. The reason lies in the fact that during daily operations of these installations, wind turbines are continually being orientated depending on wind direction, and potential errors in this manoeuvre lead to machine overstress and production decrease. As in Section 3.1 for wind speed, the monthly errors for wind direction are shown in Figure 8a, and on a finer timescale, Figure 8b displays the mean hourly wind direction MAE, averaged for all the turbines in the farm. In both cases, RAW WRF outputs are compared with the results of the K-B experiments. Monthly results in Figure 8a provide insights on the origin of the 22% improvement in forecast skill of K-B 6 h with respect to RAW, commented in Figure 7. From 15 February to 15 March and from 15 July to 16 January, the effect of the K-B 6 h is noticeable, with a decrease in errors of around 7.5 • during those periods. Nevertheless, the scenario is entirely different in spring, when K-B 6 h practically does not refine the original RAW result. This lack of improvement can be partially explained by the fact that, during spring months, the original WRF outputs register the lowest U and V errors of all the year, and, similarly to previous results, the K-B filter has more difficulties correcting RAW forecast results with low errors.
K-B 1 h, 30 min, and 10 min follow the general tendency of the rest of the comparisons, presenting a substantial error decrease throughout the year. K-B 30 min skill score is always below K-B 1 h and the same for K-B 10 min with respect to K-B 30 min, with all three time series showing a parallel behavior throughout the whole period. As opposed to the case of wind speed (Figure 4), winter months, particularly December and January, have the lowest errors of the series in all wind direction K-B results. For example, K-B 30 min error is around 6.6 • during these winter months, but over 12 • in springtime. The lower WD MAE in winter months, on the one hand, seems to be related with the higher mean wind speed registered during that part of the year (Table 3). This means that there are fewer periods of weak winds, which are associated with increased variability in wind direction, presenting, therefore, more difficulties for the K-B filter to handle. On the other hand, these good results during that period can also be related to the clear unimodal wind regime which affects the region during that period.
Changing the timescale of the analysis, Figure 8b shows the evolution of the WD MAE throughout the day. The RAW series (red line) does not present significant hourly changes; all the values are close to 25 • with a slight increase in the late hours of the day. K-B 6 h differs from this homogeneity, displaying a slight daily cycle with more accurate predictions from 04 to 12 UTC, with a minimum MAE = 16.64 • at 09 UTC increasing to a maximum of 21.76 • at 13 UTC. Same as in the daily analysis of wind speed ( Figure 5), in the shortest nowcasting periods (1 h, 30 min, and 10 min), the variability is practically eliminated. The K-B filter decreases errors and smooths out the series, with rather constant MAEs around 10 • throughout the day. The comparisons at different time scales among all the cases confirm that the K-B filter yields a valuable improvement in wind direction prediction. The shortest term nowcasting cases, starting from K-B 1 h, lead to a significant correction of WRF outputs independently of the meteorological situation of the moment.
To conclude this section, in Figure 9 we exemplify the capabilities of wind direction nowcasting with K-B filter. Specifically, a two-day WD MAE comparison is displayed for WT13 between RAW (red) and K-B 1 h (blue). The arrows inside the circles show the instantaneous observed wind direction every four hours (black) and its respective RAW (red) and K-B 1 h (blue) prediction. In the next hours, RAW maintains a more constant higher error (around 25 • ) for 3-4 h, which K-B 1 h drastically corrects. During the second day, this difference between the time series increases in magnitude; RAW predictions go over MAE = 30 • for 12 h, reaching up to 40 • in different moments. Throughout this entire time period, the K-B correction sharply eliminates these big MAEs to values below 10 • .
Given these results, we can affirm that K-B 1 h provides a good skill improvement in all the situations where the original RAW forecast presents large errors. As in the case of wind speed nowcasting, the correction of big WRF wind direction biases is crucial for wind farm operation applications.

Application of the K-B Filter for Wind Power Forecasting
In this last section, we test the capabilities of K-B 1 h wind direction nowcasting tool on a real scenario of Coruxeiras wind farm in the studied year, with special attention to critical issues in power prediction, such as wind ramps. For this purpose, we focus on the results corresponding to the wind turbine power ramp, which is the ascending part of the wind power curve before nominal power ( Figure 10). Wind speeds within this curve (in this case from 4 to 13 m/s) have the most significant effect in the forecast skill of any nowcasting tool in the wind energy field. In Figure 10, we present the relation between the wind power curve of the wind farm's turbines (ECOTECNIA74 with 1.670 MW of nominal power [58]) and the WD MAE associated with each wind speed bin, both for RAW and K-B 1 h cases. Table 5 displays the WD MAE in power ramp wind ranges for all the experiments and for each area of the wind farm. It also compares these results with persistence at 10 min, 30 min, and 1 h.
The persistence forecast is the assumption that the next timestep value in a prediction is going to be the same as the last measured value [59].  The error bar chart in Figure 10 clearly illustrates the significant improvement of K-B 1 h over RAW results in power ramp winds. At the beginning of the ramp, K-B 1 h obtains a 50% of improvement over RAW. This percentage increases with wind speed, reaching practically a 75% error reduction in the last part of the ramp (12-13 m/s). This is a desirable characteristic of the nowcasting tool because it results in more accurate direction predictions in wind speed situations where energy production values are higher. Table 5 shows no significant differences among farm areas in power ramp wind direction MAEs. In general, all the experiments achieve better results for power ramp winds than in general for all cases (Figure 7). This is mainly because power ramp situations exclude lower wind occurrences, associated with more variability. Moreover, K-B 1 h and K-B 30 min lead to better results than 1 h and 30 min persistence, respectively. K-B 1 h also reaches lower WD MAE than 30 min persistence.
A K-B nowcasting tool can be useful in the daily management of a wind farm. For instance, an operational K-B 1 h can back up current orientation methods, which are based on SCADA systems [36]. There are also new wind farm control techniques such as yaw-misalignment [60,61], in which upstream wind turbines redirect wakes to increase the production of downstream turbines, that could also benefit from the WRF K-B filter and its capacity to nowcast wind direction with MAEs below 10 • with a 1 h time horizon.

Summary and Conclusions
In the present work, we studied the ability of a new Kalman-Bayesian postprocessing technique to improve the wind speed and wind direction forecasts derived from high-resolution simulations for an operational wind farm over complex terrain. For the needs of the study, a period of one year is simulated utilizing the WRF atmospheric model at a 333 m horizontal resolution, and its outputs post-processed with the K-B filter. We validate the method for different short-term forecast periods, from 6 h to 10 min, with in-situ real data from meteorological stations on the hub of wind turbines.
The results show that the K-B filter in the very short-term (from 1 h to 10 min) is capable of improving the initial wind speed forecasts of the atmospheric model significantly, although the latter are already considerably good (RAW annual WS MAE = 1.87 m/s). The K-B filter achieves a decrease in the WS MAE to 1 m/s for 1 h horizon nowcasting and to 0.72 m/s for the 10 min case. The ME practically disappears when using the K-B 6 h. Analyzing all the experiments in different period ranges (months, hours, instants), we demonstrated that for shorter-term cases, K-B postprocessing eliminates any source of error, improving the prediction in all conditions regardless of the intensity and direction of the wind or the moment of the day and the season of the year.
The effectiveness of the hybrid filter in correcting forecasted wind directions was also a key point of the present study. This was achieved by applying the hybrid post process system to the two-dimensional field of horizontal wind speed components (U and V). The results were quite satisfactory as the K-B 6 h presents a 22% of amelioration with respect to RAW forecasts. Shorter-term cases decrease their WD MAEs even below 10 • , with an important degree of efficiency in any meteorological situation throughout the year.
It should be noted at this point that several methodologies have been proposed in the literature for the reduction of atmospheric or wave model errors (see for example Landberg and Watson [62] and Joensen et al. [63] for MOS applications, Galanis et al. [23,24]; Kalman [29]; Kalman and Bucy [28]; Kalnay [27]; Louka et al. [34] and Pelland et al. [22] for Kalman filter optimization tools. The proposed methodology in this work that combines Kalman-Bayesin filter applied to single or multiple dimension arrays provides additional advantages and better results in the improvement of wind speed and direction forecasts.
Emphasis was also given to the behavior of wind direction K-B 1 h in power ramp wind cases. The mean results for these are better than for general cases due to the filtering of low winds. K-B 1 h WD improves the persistence forecast for 1 h and 30 min.
In general, the combination of high-resolution WRF simulations and the K-B hybrid filter has shown effectivity and reliability obtaining accurate short-term wind speed and direction predictions, which are of critical importance for an operational wind farm.