Valley Winds at the Local Scale: Correcting Routine Weather Forecast Using Artiﬁcial Neural Networks

: In regions of complex topography, local ﬂows are difﬁcult to forecast on a routine basis, especially in stable conditions, due to the coarse resolution of operational models. The Cadarache valley (southeastern France) features this sort of complex topography. The Weather Research and Forecasting (WRF) model is run daily to forecast the weather in this region with a horizontal resolution of 3 km. Such a resolution cannot resolve all topography details of the small Cadarache valley, and therefore its local wind patterns. Other variables, however, that are less dependent on the subgrid topography, are satisfactorily forecasted, and used as inputs to an artiﬁcial neural network (ANN) designed to reproduce wind observations inside the valley from WRF forecasts. A variable selection procedure identiﬁed 5 key input variables that best drive the ANN. With respect to the WRF output, the ANN signiﬁcantly improves forecasted low-level winds, both for speed and direction. This study demonstrates the potential for the ANN technique to be used as a correcting tool to forecast weather conditions at the local scale when numerical modeling is performed at a resolution too coarse to take into account the effect of local topography.


Introduction
Low-level winds must be well described when studying atmospheric dispersion. Over complex terrain, winds can be deviated or channeled by the topography. Moreover, spatial thermal differences over sloping terrain can generate slope winds. At the local scale, the combination of thermal and mechanical (slopes) forcings generates flows that have horizontal and vertical components, present a diurnal cycle, and can generally be decomposed into along valley and cross valley components. Whiteman and Doran [1] described four mechanisms of low and high level wind interaction in a valley, which are a combination of thermal and topographical effects, showing the complexity of flow over complex terrain.
The paper is organized as follows. In Section 2, the study site and observations used are described. Section 3 is dedicated to the presentation of numerical weather predictions from the WRF model, and the evaluation of their quality compared to observations. Section 4 then introduces ANNs, while Section 5 describes our method for improving WRF outputs with an ANN and the method's subsequent results. These results are discussed in the last part of the paper.

Topography and Land Use
The study area is located in the Alpine foothills of southeastern France, featuring many small valleys and hills (

Routine Local Measurements
This study uses hourly-averaged values of meteorological parameters continuously measured at the GBA and MET01 stations, both installed at the CV bottom ( Figure 1c). The GBA tower is located at 265 m a.s.l. at the lower end of the CV, about 2 km upstream Atmosphere 2021, 12,128 4 of 20 of the DV's main axis. The MET01 location is 1.6 km up-valley of GBA and 286 m a.s.l, approximately at mid-length of the CV. The instruments at the two sites along with the corresponding period of available data are detailed in Table 1   Table 1. Summary of observations made in the Cadarache valley. T indicates temperature; P pressure; Rh relative humidity; WS wind speed; WD wind direction. The height of measurement is above ground level. See Figure 1c for stations locations.

Weather Conditions
The Cadarache site is at the edge of the Mediterranean climate and is influenced by its proximity to the Alps. Synoptic winds that interfere with low-level winds in the CV originate mostly from three main directions as evidenced by the wind rose observed at GBA 110 m above the valley floor (just above the Cadarache valley ridges) (Figure 2a). correspond to the classification used in this paper (see Section 4.2): the blue sector for the Cadarache down-valley (CDV) winds extends from 105°to 165°, the green sector for the Cadarache up-valley winds extends from 245°to 335°, and salmon sectors include all other directions, corresponding to transverse winds. After Dupuy et al. [22]. First, the left lobe of the wind rose results from usual mid-latitude westerly winds and from the "Mistral". The Mistral is normally a strong northern wind, channeled by the Rhone valley located in the west (see Figure 1b), which spreads out when it comes over the Mediterranean coastal plains and consequently takes on a northwesterly orientation when it reaches Cadarache [32]. Second, the "Marin" coming from the Mediterranean Sea blows from the southeast and is often associated with rain. Third, winds coming from the Alps in the northeastern quadrant are more or less channeled by the DV [10].
Additionally, when the sky is clear (which is frequently observed in this region), and synoptic conditions are calm, thermally driven winds take place in the Durance and Cadarache valleys. In daytime, anabatic winds occur as a consequence of horizontal temperature gradients resulting from the complex relief and the penetration of sea breeze from the 50 km distant Mediterranean coast. In contrast, radiative cooling at night promotes stable conditions and katabatic flows that have been extensively documented during the KASCADE 2013 campaign [10]. The reader is referred to Dupuy et al. [22] for a detailed description of these classic weather conditions over Cadarache.

Cadarache Valley Wind
As illustrated in Figure 2b, the SE and NW wind directions dominate inside the CV. Down-valley winds are grouped in the blue sector (39% of observations, between 105°and 165°), and up-valley winds in the green one (also 39% between 245°and 335°). The red sector contains the remaining 22% cross valley winds, almost half of them having speeds lower than 0.5 m s −1 .
The relationship between winds observed above (110 m a.g.l.) and inside (2 m a.g.l.) the CV, represented in Figure 3, highlights coupling/uncoupling conditions (cf. Whiteman and Doran [1] for a definition of those conditions). Coupled winds lie along the main diagonal with a high probability density for SE and W to NW directions. These result from downward momentum transport combined with channeling, according to the classification of Whiteman and Doran [1]. The other high-density spots reveal CV flows uncoupled from the wind aloft, most of them flowing down-valley (direction tagged CDV for Cadarache down-valley). This is particularly visible for calm conditions where the CDV wind coexists with the Durance down-valley (DDV) wind aloft.

WRF Configuration
The tuning of the operational WRF model used by the CEA in Cadarache is the result of various tests [33,34] aiming to improve the ability of the model to simulate crucial parameters, such as the Diurnal Temperature Range (DTR) in the Cadarache valley. The configuration used in the present study (see Table 2) differs in two ways from the operational tuning. The GFS is used instead of the ERA-ECMWF as initial and boundary forcing due to regulatory constraints, and only two nested domains are kept because of computation time constraints.
Domain #1 covers France ( Figure 1a) with a 9 km horizontal resolution. Domain #2 (Figure 1b), with a finer horizontal grid spacing of 3 km, is focused on the southeastern part of France. With a 3 km horizontal resolution, the most important geographical features impacting weather conditions over Cadarache (see Section 2.3) are resolved (e.g., Rhone and Durance valleys, the southern Alps and the Mediterranean coastal region), but the smaller Cadarache valley is not resolved (Figure 4).

Data Extraction
Based on preliminary tests and previous results [43,44], it appears that a good stabilization of the model is obtained after a spin-up time of half a day. For this study, in order to be sure to overpass the spin-up period, the [0, 23 h] lead time period is thus discarded. On the other side, considering that the forecast performance decreases as the lead time increases, we did not consider forecasts for times longer than two days. The lead times from 24 h to 47 h are thus kept from each daily simulation. This extraction process results in a continuous time series over 1 year from daily forecast runs with no overlapping.
In order to compare WRF forecasts to GBA and MET01 observations, WRF variables were extracted at these sites locations using a bilinear interpolation. The WRF profiles were then interpolated along the vertical to the heights of the observations. Only data from the domain #2 were used.

Forecast Evaluation
The goal of the study is to establish a reliable wind forecast in the Cadarache valley. Therefore, our forecast evaluation mainly focuses on wind. Nevertheless, being aware that stability is the main trigger of down-valley winds [31], the atmospheric stratification is evaluated as well.

Atmospheric Stratification
The forecast stratification is compared to GBA permanent measurements. Potential temperature at 110 m in observations was calculated assuming that pressure variation between 2 and 110 m obeys the dry hydrostatic law. A sensitivity study showed that it is a good approximation since the mean resulting uncertainty on potential temperature does not exceed 0.1°C (see Appendix A in Dupuy [45]). Observations show that the daily cycle of ∆θ (the vertical difference of potential temperature between 110 m and 2 m) is usually well marked: the atmosphere is stably stratified during the night and unstable during the day (Figure 5a,b). This cycle is overall well reproduced in the simulations except during morning and evening transitions. The transition to unstable conditions occurs around 3 h earlier in WRF, while transition to stable conditions occurs with a delay of around 1 h. The probability density function graph (Figure 5c) shows the level of agreement between the observations and the simulations. It can be divided into three parts: The first one covers the observed negative ∆θ (unstable stratification), corresponding to daytime periods. In this part, the simulated values are also negative and a large part of the values are grouped close to the 1:1 line which reflects a good agreement. The second part covers the observed values included in the range [0, 2°C], which corresponds to the afternoon and evening transitions. There is a poor agreement in this range, with simulated values spread between −1°C and 4°C. The last part covers the observed values higher than 2°C, which corresponds to stable nighttime periods. The simulated atmosphere is stably stratified too, but there is a large scatter showing the difficulty of accurately simulating the intensity of the stratification during the night.

Winds Methodology
The comparison of wind forecasts is based on the metrics described in Dupuy et al. [22]. Wind direction forecast evaluation is based on (i) the DACC (Direction Accuracy [46]) metric, which represents the proportion of horizontal winds which do not depart by more than 45°from observations, and (ii) the PC (Proportion Correct) metric, which indicates the proportion of values correctly classified in different wind sectors defined from the observed wind rose to represent the main wind regimes. Two forms of PC are used. PC2 [31] considers two wind sectors: the southeast quarter for downvalley winds for the first class and all other directions for the second class. PC4 considers four classes: a first class for light winds (lower than 0.5 m s −1 ) that have no well-defined direction, a class of CDV winds, a class of upvalley winds, and a class of cross-valley winds. The last three classes correspond to the blue, green, and red regions, respectively, in Figure 2b. Wind speed forecasts are assessed using the Pearson correlation coefficient, bias, and mean absolute error (MAE).
Forecasts are compared to observations at the MET01 station, where wind is measured with a Young 05103 anemometer with an accuracy of ±0.3 m s −1 and ±3°for the speed and direction.

Results
At MET01, we used the WRF 10 m wind output. In order to compare the simulated wind to the observations, wind speeds have to be extrapolated down to 2 m. To do that, we took advantage from the 3-month period of KASCADE [10] during which we have wind observations at these two levels. We found that a simple linear regression (U 2m = 0.82 × U 10m − 0.07, where U 2m and U 10m are the wind speeds at 2 m and 10 m expressed in m s −1 ) satisfactorily extrapolates wind speeds from 10 m to 2 m, yielding even better results (mean absolute error of 0.12 m s −1 ) than assuming a logarithmic wind profile (mean absolute error of 0.61 m s −1 ) [45]. We assume that wind directions at 10 m and 2 m are identical.
The influence of above-valley winds on near-surface winds in the Cadarache valley is crucial (see Section 2). The relationship between these two winds in WRF highlights a major discrepancy with observations ( Figure 6). While decoupling (i.e., wind directions considerably different between the two levels) occurs frequently in observations, especially under stable conditions leading to CDV winds at 2 m, it is underpredicted in WRF. This is particularly striking for CDV 2 m winds associated with 110 m winds coming from the West (usually occurring early in the night, before the appearance of the northeasterly DDV 110 m wind). Another significant difference between observations and simulations corresponds to decoupling situations when 110 m winds are blowing down the Durance valley (DDV). In such conditions, the associated observed 2 m winds cluster around the CDV direction, whereas simulated 2 m wind directions are much more scattered. It appears that the lowlevel wind in the model is constrained by the coarse representation of the local topography. We give an illustration of this behavior with the situation on 17 February 2016 at 05UTC (Figure 7). At 960 hPa, a level corresponding approximately to 110 m above the ground (the ground level pressure at MET01 was 973 hPa at this time), the simulated winds are blowing down the Durance valley (which corresponds well to the observations), whereas surface winds are blowing along the resolved slopes, alternatively yielding northeasterly to south-southwesterly winds at the MET01 site.
Simulated surface winds are therefore less channeled than observations. This is illustrated in Figure 8a, especially for the down-valley direction (SE): 39% of the observations lie in the 105°-165°range (corresponding to the blue sector on Figure 2b) versus 23% in the simulations. Simulated wind speed has a positive bias of +1.07 m s −1 (Figure 8b), which is a consequence of the misrepresentation of subgrid topography in WRF. The metrics calculated on the WRF 2 m winds are summarized in Table 3. Only 50% of wind directions are forecasted with an error lower than 45°(DACC), and only 47% are well classified considering 4 classes (PC4).

Artificial Neural Network
An ANN is a statistical tool that is able to correlate complex data inputs. The ANN learns to perform tasks by considering examples, generally without being programmed with any task-specific rules. In this study, the task consists of reproducing the winds observed at the bottom of the Cadarache valley (described in Section 2.4), starting from WRF output variables. In other words, the objective is to find the mathematical function linking coarsely modeled WRF-forecast variables to highly localized near-surface wind observations. An ANN function is composed of neurons (a linear combination of input variables transformed by a so-called activation function) interconnected between each other and arranged in layers. The ANN starts with a pseudo-randomly chosen function (pseudorandom setting of initial linear combinations weights). Then, the training step consists of fitting the function (that is to say the weights) to produce results as close as possible to the ground truth. Weights are iteratively updated, based on results calculated on a subset of the dataset (called training set), until the performance (the loss function), calculated on a second subset of the dataset (called validation set), reaches a given limit and no longer improves. A third subset, called test set, is used to calculate metrics and compare results between different ANNs. The three subsets are totally independent and, in order to calculate unbiased metrics, the test set is not used during the training step.
As ANNs are good interpolators but poor extrapolators [21], the dataset used to train the ANN has to include numerous and heterogeneous examples to encompass the widest range of cases that the ANN is expected to treat.

ANN Configuration
The configuration of the ANN used in this study is similar to that described in [22]. It is a multilayer perceptron (MLP) type [47], which is frequently used in atmospheric sciences [21]. Its specific feature is that each neuron of a layer is connected with all neurons of the previous and next layers. It is composed of an input layer, at least one hidden layer and an output layer. Here, the input layer simply consists of the WRF variables. There is a single hidden layer of 10 neurons. To support this choice, we verified that the performances were not improved by adding a second hidden layer, and we evaluated the evolution of the ANN performance when the number of neurons in the hidden layer varied from 5 to 50. The output layer is composed of two neurons that are expected to reproduce the horizontal wind components at 2 m (i.e., u and v). These components are used to calculate wind speed and direction. The activation function is a hyperbolic tangent function because it offers more favorable results than other tested functions (e.g., logsigmoid or linear functions). The ANN was conducted using MATLAB's Deep Learning Toolbox. The Levenberg-Marquardt algorithm was chosen as the training algorithm because it is described in the MATLAB toolbox user's guide as the fastest training algorithm while offering performances very similar to all other tested algorithms, such as BFGS Quasi-Newton, and Scaled Conjugate Gradient. The pseudo-random generation of the initial weights is also tested by training several ANNs with different seeds. The seed producing the best results is selected.
The dataset was randomly split into 60% training data, 10% validation data, and the remaining 30% was used as the test subset. Random split guarantees that each of the 3 subsets contain data from all the different meteorological seasons. We did not run the ANN on seasonal subset data because we consider that ANN would better work when the training and validation data set encompass the widest possible meteorological conditions. The risk for a subset of data restricted to specific conditions is that the ANN output would possibly fail when an odd situation occurs (for example, a quite warm day in winter, or easterly wind in spring). Input variables and ground truth were normalized between −1 and +1 in order to avoid weight discrepancy problems, which occur when the order of magnitude of variables differs.

Selection of Input Variables
Based on the recommendations of Dreyfus et al. [48], the most pertinent variables to use as input to the ANN are selected following a two-stage process.
First, a selection removes redundant WRF variables. Meteorological variables such as temperature, atmospheric pressure and humidity are interrelated, and therefore they share a part of the information they carry (for example, the diurnal cycle). When the absolute value of the correlation coefficient between two variables is higher than 0.9, they are considered redundant and one of them is removed from the ANN input dataset. This step is called hereafter "filter selection".
Second, an iterative process called sequential forward selection [49] is performed. A reference ANN (called ANN ref ) is launched with all variables still remaining as inputs after the filter selection. For the first iteration, "elementary" ANNs are trained, each one using a single input variable taken among the input variables of ANN ref . The metrics of these elementary ANNs are compared to each other and the variable giving the best results is selected for the next step. The input variable set is thus progressively constructed by adding the best variable to the selected variables at each iteration. The performance of the ANNs is compared to the reference one at the end of each iteration. This process is continued until improvements in the performance metrics are no longer significant.

Significance of Results
A bootstrap method was applied to assess the significance of metrics scores. Ten thousand test subsamples were created from the original test set, using a random draw with replacement. The ANN function is then applied to each subsample, producing 10,000 output datasets. The metrics are calculated for each output dataset leading to a distribution for each metric. This distribution is used to calculate the mean value for each metric with a confidence interval (at 90%) defined as the interval between the 5th and 95th percentiles.

Selection of Input Variables
Output variables from WRF daily weather forecasts are used as inputs for the ANN. An empirical selection among the numerous WRF output variables was performed prior to the selection steps described in Section 4.2. This empirical selection was based on knowledge of the local meteorology in the Cadarache valley (see in [10] and Section 2), and a previous application of ANNs to nowcast local wind in the Cadarache valley [22].
Specific conditions leading to different near-surface/above-valley winds relationships, described in Section 2, depend mostly on wind speed and direction as well as stratification. Thus, wind speeds and components at three heights (10, 110, and 300 m) above the ground were tested as inputs. We chose the 300 m level winds because it is the level of maximum intensity of the nocturnal Durance downvalley jet [10], 110 m because it is the height corresponding to the wind measurements at GBA, and 10 m because it is the lowest level in the model. Moreover, physics-guided neural networks, which provide a framework for combining scientific knowledge of physics-based models with ANN [50,51], suggest adding the modeled variable to be corrected as an input variable (10 m wind components in our case). The profile of the potential temperature θ characterizes the vertical stratification. Previous studies [22,31] have shown that a valley-scale (the valley is around 100 m deep) stratification intensity based on a vertical difference of the potential temperature between 110 m and 2 m (∆θ) was crucial in nowcasting winds in the valley. We thus decided to use the same variable calculated from the simulations. Other stability-related variables were selected: a bulk Richardson number (in the layer 110 m-2 m), the friction velocity and the atmospheric boundary-layer height (defined as the level at which the kinetic turbulent energy becomes lower than 0.01 m 2 s −2 , according to the work in [52]). The net radiation at the surface was also added as it provides information on the thermal forcing.
In addition, even knowing that the CDV wind onsets and disappearances are not exactly reproducible through days, Duine et al. [10] showed that it generally appears around sunset and disappears approximately 2 h after sunrise (consistent with Figure 5). Moreover, Dupuy et al. [22] showed the considerable information brought by the diurnal cycle in order to nowcast the CDV wind. For this reason, we added the time relative to the closest sunrise and sunset time, respectively.
Finally, common meteorological parameters were also added: potential temperature at 2 and 110 m, atmospheric pressure, specific humidity at 2 m, surface temperature and rainfall.
The Dreyfus et al. [48] two-step selection was then applied to the previous list of variables. Strong correlations (R > 0.9) were found for some couples of variables. Potential temperature at 2 m was discarded because it is strongly correlated to both surface temperature and 110-m potential temperature. Surface temperature was also discarded because it has high correlations with several other variables (the atmospheric boundary-layer height, the vertical difference of potential temperature, the friction velocity, and the net radiation at the surface). The 110 m wind (u and v components and speed) is highly correlated with winds at 10 and 300 m, resulting from the smoothed topography in WRF. This is consistent with WRF's overly strong coupling between winds 10 and 110 m, as shown in Section 3.3.2. On the other hand, winds at 10 m and 300 m are less correlated, which justifying retaining these variables (u and v components and horizontal speed magnitude) at both levels. Finally, the friction velocity was discarded because it is highly correlated to the wind speed at 10 m as well as with the boundary-layer height.
After this first selection process, 16 variables were left. Then, the sequential forward selection produced a dataset of five variables: ∆θ, wind components at 10 m, net radiation, and specific humidity at 2 m. These five variables are used as inputs to the ANN, the results of which are presented below. Figure 9 presents a comparison between wind observations at MET01 and the corrected winds resulting from the ANN applied to WRF forecasts. Referring to Figure 8, where a similar comparison was done but for the "raw" WRF forecasts, we note the corrected ANN winds are significantly better. The data (direction and speed) now cluster around the 1:1 line. The improvement is quantified by the metrics given in Table 4. All the metrics improve significantly after the ANN processing. The ANN lowers the WRF positive wind speed bias, from +1.07 m s −1 for WRF to −0.34 m s −1 for the ANN, which is within the overall accuracy of weather station standard anemometers. Likewise, there is an improvement in the direction forecast with a better representation of along-valley oriented winds (higher concentration of data in the blue and green squares with the ANN in Figure 9), which is confirmed by the improvement of DACC (from 0.50 to 0.68) and PC4 (from 0.47 to 0.71) values.      Figure 10 represents another way to visualize the gains achieved with the ANN using the cumulative distributions of errors for wind speed and direction. The gray area represents the gain resulting from the ANN. For example, the percentage of wind direction errors less than 20°represents 27% of the dataset for WRF forecasts versus 46% for the ANN. We note that the percentile values for the 45°error corresponds to the DACC reported in Table 4.  Two regions are identified in the cumulative distribution of direction errors. For errors higher than 135°corresponding to forecast directions quite opposite to the observations, the differences between the two distributions are small. That means that the ANN is not able to significantly improve the worst direction forecasts. Differences occur for errors in wind direction lower than 135°, and particularly for the lowest errors: about half of the WRF forecasts have an error lower than 45°, whereas this amounts close to 70% for ANN data. That means that the ANN corrects a part of intermediate errors. More details on that are given in Section 5.3.2.

ANN-Related Forecasting Improvements
Likewise for the speed, the 75th percentile value corresponds to an error of 2.05 m s −1 for WRF forecasts versus 0.83 m s −1 for the ANN. This means that 75% of ANN outputs have errors lower than 0.83 m s −1 (2.05 m s −1 for WRF forecasts). These results visually confirm the decrease of MAE (0.62 m s −1 for the ANN and 1.32 m s −1 for WRF).

Influence of the Wind Speed
The evolution of ANN performances with wind speed is represented in Figure 11. The performance of WRF's wind direction forecast improves with stronger wind speeds, which is consistent with results of Jiménez and Dudhia [53]. As shown is Section 2, strong above-valley winds are more efficient at forcing low-level winds, leading to relatively small wind direction rotations with the height. Corresponding low-level wind directions are thus less dependent on the valley topography, which explains the good behavior of WRF forecasts. On the contrary, the MAE of WRF wind speed prediction increases with the strengthening of winds (at least until 3 m s −1 ). The ANN improves the forecast of both the speed and direction regardless of the wind speed magnitude. Wind direction improvements are more evident for light winds, which is fortunate because they represent a high proportion of the dataset. This probably results from a smaller progress margin for the strongest winds (DACC higher than 0.8 for winds stronger than 3 m s −1 for WRF). Regardless, ANN performance is better even for strongest winds. Concerning speeds, the ANN diminishes the MAE and the standard deviation irrespective of wind speed.

Light Winds and Channeling
Two weaknesses emerged when applying ANNs to the WRF wind forecasts, similarly to what was already mentioned by Dupuy et al. [22] in their nowcasting approach.
First, as already mentioned above, the ANN encounters some difficulties in correctly reproducing light wind directions. These defects are attributed to the method used to calculate the direction, which is not directly an ANN output, but is derived from the wind components (which was already discussed in Dupuy et al. [22]). For light winds, the wind components are small. A small absolute error made on one of the components produces large errors on the direction. On the other hand, the same small error in one of the components associated with a strong wind has a relatively smaller impact on the direction, producing a smaller error.
Second, there are differences in observed and ANN distributions of direction, since the ANN mainly produces valley-oriented winds, failing to reproduce most of cross-valley winds. Figure 9 clearly shows the strong channeling of winds along the valley axis, with very few northeasterly and southwesterly wind observations. Light speeds, a lack of typical meteorological conditions (unlike up-and down-valley winds) and fewer observations of these winds explain the weakness.

Improvement of Valley Winds Prediction
In order to visualize the improvements/degradations brought about by the ANN with respect to the raw WRF forecasts, we split the data set into two parts, namely, "good" and "bad" ANN results. "Good" means that the ANN-calculated wind direction does not depart by more than 45°from the observed direction, and "bad" is all other cases. The results are presented in Figure 12. Figure 12b shows a comparison between WRF and observed directions for good ANN results. The data located between the two central black tilted lines or in the upper-left and bottom-right corners thus correspond to simultaneous good WRF and ANN direction forecasts, while the other areas correspond to bad WRF-forecasts and good ANN-forecasts (improvement using the ANN). The same comparison for bad ANN forecasts is plotted in Figure 12c, meaning that data located between the two central black tilted lines and in the up-left and bottom-right corners correspond to good WRF forecasts and bad ANN forecasts (degradation brought by the ANN).   For good WRF forecasts (50% of the dataset), the ANN keeps a good forecast for 89% of the cases (Figure 12b). The remaining 11% are mainly cross-valley winds, which are difficult to forecast with the ANN (see Section 5.3.2). Concerning bad WRF forecasts (Figure 12c), 47% are corrected by the ANN. They correspond in particular to southeasterly winds, which present the worst forecast performance in WRF (cf. Section 3). The conditions for which the ANN is not able to correct wind directions mainly correspond to directions opposite to the observations and aligned along the valley. These results are consistent with the cumulative distribution of direction errors (Figure 10a).

Relationship Between Above and Inside Valley Winds
It was demonstrated in Section 3.3.2 that winds inside and above the Cadarache valley experience different relationships (coupled or uncoupled). The ANN is able to improve the representation of the complexity of that relationship in comparison with WRF forecasts alone ( Figure 13). While WRF over predicts coupled situations, the ANN is able to integrate the uncoupled situations. More generally, the ANN reproduces the different observed relationships: CDV wind in the valley can be associated with above valley winds coming from either SE (forcing), WNW or NE (DDV wind), whereas northwesterly winds (i.e., upvalley) in the Cadarache valley can be associated with above valley winds coming from either NE (DDV winds) or NW (forcing). The improvement is particularly striking for CDV winds associated with northwesterly winds above it, often corresponding to early night uncoupled situations, which were never forecasted by WRF, and that the ANN is able to reproduce.

Conclusions
The aim of this study was to complement WRF operational mesoscale simulations (with a 3 km horizontal resolution) in order to predict a local wind mostly forced by subgrid-scale orographic effects.
The area of study is the Cadarache valley, which is 1-2 km wide, 100 m deep, and 6 km long, with a main axis oriented 135°-315°. During stable conditions a decorrelation between above-valley and near-surface winds has been observed that result from thermally driven winds with directions forced by the topography.
Considering one year of continuous observation made at the Cadarache valley site (wind and temperature at 110 m, i.e., just above the depth of the valley, as well as wind and temperature at 2 m on the valley floor), the overall performance of the WRF simulations was first evaluated. Unsurprisingly, the wind at 2 m was not well forecasted due to the smoothing of local topography in the simulations. On the other hand, the wind at 110 m and the temperature difference between 110 m and 2 m are well forecasted, showing that some parameters, poorly related to the local unresolved topography, can be well reproduced even with a coarse horizontal resolution. We thus started from the ideas developed by Dupuy et al. [22], who showed that these parameters could be used to feed an ANN in order to nowcast the wind at the bottom of the valley.
The ANN technique was applied to WRF operational forecasts outputs. For every day of the full year during which the observations were available, the 24-to-47 h forecast period was used to calculate the horizontal wind components observed at the bottom of the valley. One year of data was used, which constitutes a large enough dataset to encompass most of the meteorological conditions that are representative of the Cadarache site.
The selection of the WRF variables used to feed the ANN was performed according to the two-step method of Dreyfus et al. [48]. After the elimination of redundant parameters, as well as parameters whose impact on the results were weak, five of them were retained (the low-level wind components, the difference in potential temperature between 110 m and 2 m, and the net radiation at the surface and the specific humidity at 2 m).
The ANN significantly improved the forecast of the wind in the Cadarache valley, for both speed and direction. The scores obtained for the full year reached 0.68 for DACC, 0.71 for PC4, the bias on wind speed was reduced down to −0.34 m s −1 and the MAE to 0.62 m s −1 . The ANN rectified about half of the situations for which WRF failed in forecasting the low-level wind direction. The ANN has thus addressed the main failure observed in the WRF simulations concerning the valley winds: the wind direction is now satisfactorily forecasted and the wind speed bias is considerably decreased. The ANN performance improves as speed increases. This is probably related to the fact that the ANN output is not the direction itself (against which the performance is evaluated), but the two wind components, from which the direction is computed. A limitation encountered with the ANN method is the excessive forecast of valley-aligned winds, which is explained by the fact that most wind directions away from the valley axis correspond to very light winds whose directions are challenging to measure and for the ANN to reproduce.
A comparison of ANN outputs to very high resolution simulations (horizontal resolution around 100 m in order to have a good representation of the Cadarach valley) on some specific events (operational forecasts at 100 m horizontal resolution remains not possible due to computational time) would certainly help better understand strengths and limitations of the ANN.
In conclusion, bearing in mind the limitations mentioned above, the artificial neural network technique is a valuable tool for improving numerical simulations and forecasting local flows at a scale which is not resolved by the model. A set of observations large enough to encompass the variability of the meteorological conditions observed at a given location is required for the training step of the ANN used. As the ANN is a poor extrapolator, one year of data is a minimum size needed to encompass as many conditions as possible occurring in the different seasons. The ANN technique can therefore be used to estimate local flows from an operational weather forecast model the resolution of which is too coarse to take into account the local influence of the topography or land use. This promising technique might in the future be widely used in routinely forecasted meteorological fields, taking advantage from its high potential for the local improvement of weather forecasts as well as air quality questions. It constitutes a quite inexpensive technique to refine coarse forecasts output at specific location, while coping with the "gray zone" problem arising when refining the horizontal resolution down to (sub) kilometer scales. Funding: This work was funded by the MRISQ project at the CEA.

Conflicts of Interest:
The authors declare no conflicts of interest.