## 2 Hourly Meteorological Data Analysis Based on Cubic Spline Function Method (FFT)
### The Principle and Implementation of Cubic Spline Function FFT Method  
#### 2.2.1 The Principle of Cubic Spline Function  
The method of three turning angles, the three-moment method and the B-spline basis function are usually employed to calculate the cubic spline function. These methods determine the interpolation function by estimating unknown parameters and minimizing the unknown parameters by using known conditions. The three-moment method is adopted in this paper. Assume \(s^{\prime\prime}\left(x_{i}\right)=M_{i},i=0,1,\cdot\cdot\cdot,n,s\left(x\right)\) is cubic polynomial in each sub interval \(\left[x_{i-1},x_{i}\right]\). Therefore, \(s^{\prime\prime}\left(x\right)\) is linear function in interval \(\left[x_{i-1},x_{i}\right]\), and it can be presented as:  
\[s^{\prime\prime}\left(x\right)=M_{i-1}\frac{x_{i}-x}{h_{i-1}}+M_{i}\frac{x-x_ {i-1}}{h_{i-1}}\ i=1,2,\ldots,n \tag{1}\]where  
\[h_{i-1}=x_{i}-x_{i-1}\]  
Using the condition \(s^{\prime}(x_{i}-0)=s^{\prime}(x_{i}+0)\), \(i=1,2,\cdots,n-1\), and Equation (2) can be obtained:  
\[\mu_{i}M_{i-1}+2M_{i}+\lambda_{i}M_{i+1}=d_{i}\ i=1,2,\ldots,n-1 \tag{2}\]  
where  
\[\mu_{i}=\frac{h_{i-1}}{h_{i-1}+h_{i}},\ \lambda_{i}=1-\mu_{i}\]  
\[d_{i}=\frac{6}{h_{i-1}+h_{i}}(\frac{f_{i+1}-f_{i}}{h_{i}}-\frac{f_{i}-f_{i-1}}{ h_{i-1}})\]  
\[f_{i}=s(x_{i})\ \ i=0,1,\cdots,n\]  
To confirm \(s(x)\), the boundary condition need to be supplemented. Moreover, there are three general types of boundary condition:  
\[S^{\prime}(x_{0})=f^{\prime}_{0},S^{\prime}(x_{n})=f^{\prime}_{n} \tag{3}\]  
\[S^{\prime\prime}(x_{0})=f^{\prime\prime}_{0}\,S^{\prime\prime}(x_{n})=f^{ \prime\prime}_{n} \tag{4}\]  
\[S^{(j)}(x_{0})=S^{(j)}(x_{n}),j=0,1,2 \tag{5}\]  
Equation (3) takes the derivative according to \(s^{\prime}(x_{i}-0)=s^{\prime}(x_{i}+0)\), \(i=1,2,\cdots,n-1\), and two equations are obtained:  
\[\left\{ \begin{array}{c}2M_{0}+M_{1}=\frac{6}{h_{0}}(\frac{f_{1}-f_{0}}{h_{0 }}-f^{\prime}_{0})\\ M_{n-1}+2M_{n}=\frac{6}{h_{n-1}}(f^{\prime}_{n}-\frac{f_{n}-f_{n-1}}{h_{n-1}} )\end{array} \right. \tag{6}\]  
Assume:  
\[\lambda_{0}=1,\ d_{0}=\frac{6}{h_{0}}(\frac{f_{1}-f_{0}}{h_{0}}-f^{\prime}_{0})\]  
\[\mu_{n}=1,\ d_{n}=\frac{6}{h_{n-1}}(f^{\prime}_{n}-\frac{f_{n}-f_{n-1}}{h_{n- 1}})\]  
Equations (2) and (6) can be combined and written as matrix (7):  
\[\left[ \begin{array}{cccc}2&\lambda_{0}&&&\\ \mu_{1}&2&\lambda_{1}&&\\ &\cdot&\cdot&\cdot&\\ &&\mu_{n-1}&2&\lambda_{n-1}\\ &&&\mu_{n}&2\end{array} \right]\left[ \begin{array}{c}M_{0}\\ M_{1}\\ \cdot&\cdot\\ M_{n-1}\\ M_{n}\end{array} \right]=\left[ \begin{array}{c}d_{0}\\ d_{1}\\ \cdot\\ d_{n-1}\\ d_{n}\end{array} \right] \tag{7}\]  
Equation (8), shown below, can be obtained according to Equation (4):  
\[M_{0}=f^{\prime\prime}_{0},M_{n}=f^{\prime\prime}_{n} \tag{8}\]  
Assume \(\lambda_{0}=\mu_{n}=0,d_{0}=2f^{\prime\prime}_{0},d_{n}=2f^{\prime\prime}_{n}\), Equations (2) and (8) can also be combined and written as matrix (7). According to Equation (5), two supplementary conditions can be derived:  
\[M_{0}=M_{n},\lambda_{n}M_{1}+\mu_{n}M_{n-1}+2M_{n}=d_{n} \tag{9}\]  
where  
\[\lambda_{n}=\frac{h_{0}}{h_{n-1}+h_{0}},\ \mu_{n}=1-\lambda_{n}\]  
\[d_{n}=\frac{6}{h_{n-1}+h_{0}}(\frac{f_{1}-f_{0}}{h_{0}}-\frac{f_{n}-f_{n-1}}{h _{n-1}})\]Equations (2) and (9) can be combined, and written as matrix (10):  
\[ \begin{bmatrix}2&\lambda_{1}&&&\mu_{1}\\ \mu_{2}&2&\lambda_{2}&&\\ &.&.&.\\ &&\mu_{n-1}&2&\lambda_{n-1}\\ \lambda_{n}&&&\mu_{n}&2\end{bmatrix}\begin{bmatrix}M_{1}\\ M_{2}\\.\\ M_{n}\end{bmatrix} = \begin{bmatrix}d_{1}\\ d_{2}\\.\\ d_{n-1}\\ d_{n}\end{bmatrix}  \tag{10}\]  
Equations (7) and (10) are the three-moment equations, \(M_{i},i=0,1,\ldots,n\) is the moment of \(s(x)\). The coefficient matrix element of this kind of tridiagonal equation is \(\lambda_{i}+\mu_{i}=1\), and \(\mu_{i}\geq 0\). As the result, these equations are diagonally dominant, and the \(M_{i}(i=0,1,\ldots,n)\) in Equation (7) or Equation (10) can be obtained by using the matrix chase-after method. Then, the results can be obtained.