Three-dimensional temperature field inversion in the northern South China Sea

A Swin Transformer oceanic three-dimensional temperature field inversion model is established for the northern South China Sea and its surrounding waters based on satellite observation data and ocean reanalysis data from 1993 to 2018. The inversion results are tested using Argo observation data. The root-mean-square errors of the monthly average temperature fields for 2017 and 2018 are 0.10 to 1.98°C and 0.11 to 1.92°C, respectively, with the maximum values mainly located near the mixing layer. The temperature inversion root-mean-square errors are generally less than 1 °C. Additionally, this article analyzes the three-dimensional structural characteristics and evolution process of a typical anticyclone eddy in the study area. The results show that the inversion results can clearly demonstrate the three-dimensional structure of the eddy and continuously and completely reproduce the process of eddy persistence and movement.


Introduction
The mesoscale eddies play a crucial role in the transportation of heat, salt, and energy, as well as in marine biology and chemical processes, becoming a hot topic in the field of oceanography [1].
In recent years, satellite observation data have been widely used in the study of mesoscale eddies, which were limited to the sea surface and difficult to obtain underwater data.Ocean reanalysis products use the data assimilation system to deeply integrate numerical models and observation data, combining their advantages of spatial and temporal continuity and high resolution, which largely compensate for the lack of underwater observation data [2], and have been widely used in diagnosis of ocean dynamic and air-sea interaction research [3], [4], leading a significant role in studying the threedimensional characteristics of mesoscale eddies in the South China Sea.However, limited by the algorisms of ocean numerical models and data assimilation methods, as well as the large demand for computational resources, ocean reanalysis data were still hindered due to errors reasons and can hardly offer timely products in practical applications.
Early in 1980s, Hurlburt established a mapping relationship between the sea surface and underwater data by simulating the height data from numerical models and passing them below the sea surface [5].Subsequently, surface information was coupled with vertical structure information [6], [7], using various statistical methods such as EOF (Empirical Orthogonal Function) analysis, coupled mode algorithm, regression analysis, etc.With the continuous improvement of observation data and high-performance computing platforms, some intelligent algorithms such as artificial neural network algorithms have also been applied to ocean remote sensing data assimilation and three-dimensional temperature and salinity inversion [8], [9], demonstrating that artificial neural networks have broad application prospects in using sea surface information to retrieve three-dimensional temperature and salinity fields.In this article, the deep learning methods were applied to the retrieval of three-

The model
A Swin Transformer ocean 3D temperature field inversion model based on Swin Transformer neural network was built.The model uses an encoder-decoder architecture (figure 1).The encoder part uses Swin Transformer neural network for feature extraction(figure 2).The model input data undergoes 4 stages.Each stage includes pairs of Swin Transformer Blocks.The difference between the two continuous Swin Transformer Blocks lies in the use of different Multi-head Self-Attention layers (MSA), with the former being composed of Window Multi-head Self-Attention (W-MSA) and the latter being composed of Shifted-Window Multi-head Self-Attention (SW-MSA), and the purpose of the latter module being primarily to reduce computational costs in the model.The calculation process can be represented using following equations : where z l and z l denote the output features of (S)W-MSA module and the MLP module for block , respectively.The decoder part uses convolutional layers with kernel size and stride 2 for upsampling.Additionally, to compensate for the information lost during downsampling in the encoding stage, we added skip connections between the encoder and decoder to increase information utilization efficiency.The loss function used in this model is mean squared error (MSE), also known as L2 loss, the formula is as follows: (5) where y presents the true value, while y i presents the model's predicted value.
AdamW optimizer is used in the model, which includes the L2 regularization term.The initial learning rate for the network model was set to 0.001, and the weight decay is set to 0.05.After balancing computational time, efficiency, and training effectiveness, the batch size is set to 15, and the epochs is set to 150.

Validation of Ocean 3D Temperature Field Inversion Results
Based on the above experimental scheme, this article constructed a Swin Transformer ocean 3D temperature field inversion model to invert the oceanic three-dimensional temperature field from 5 to 1500m depth in 2017 and 2018 using SLA and SST data.The results were validated using monthly mean data from ocean reanalysis data, as shown in figure 3. It can be seen that the root-mean-square errors of the experimental scheme for the years 2017 and 2018 are 0.20~1.23℃and 0.25~1.30℃,respectively, with the root-mean-square error generally less than 1℃.The error is only greater than 1℃ within the thermocline (around 100 meters), and the vertical distribution is relatively similar.It first increases with depth and reaches a maximum value within the thermocline, then the root-mean-square error rapidly decreases, slows down at around 200m, and decreases to around 0.2℃~0.3℃with depth increasing to 1500m.

Comparison of Marine 3D Temperature Field Inversion Results with Argo Data
The model inversion results were evaluated using monthly average data from the GDCSM_Argo global oceanic Argo grid dataset from 2017 to 2018.Linear interpolation was used to interpolate the model inversion results onto the Argo grid for evaluation, as shown in figure 5.The root-mean-square errors of the inversion model in 2017 and 2018 are mostly less than 1℃, mainly concentrated near the thermocline, and the errors greater than 1.5℃ are relatively rare (accounting for 1.6% and 5.2% in 2017 and 2018, respectively).The inversion error first increases with pressure and reaches a maximum value of 1.98℃ at 70dbar in January 2017 and 1.92℃ at 70dbar in June 2018, then the root-meansquare error rapidly decreases and slows down near 200dbar, decreasing to around 0.1~0.2℃with depth increasing to 1500dbar, which may be due to the relatively stable temperature of deep seawater.

Example Analysis of the Three-Dimensional Structure of Mesoscale Eddies
A typical anticyclone moving from southwestern Taiwan to the northeastern of Xisha Islands between January 1 and April 16, 2017 was selected and the three-dimensional structure was analyzed using the invertion data by calculating the distribution of temperature anomalies within the eddy.The characteristic variable of sea temperature anomalies caused by an eddy is selected to describe the underwater structure of a mesoscale eddy.The maximum positive temperature anomaly within the observed eddy range is extracted, reanalysed, and inverted in the three-dimensional temperature field, as the "warm core" of the eddy, with its trajectory shown in figure 6.It can be seen that the location of the "warm core" in the inversion results is closer to the core location of the observed eddy compared to the reanalysis results, while the location of the "warm core" in the reanalysis results is closer to the sea surface core location of the reanalysis eddy than to the core location of the observed eddy.The reanalysis results indicate that the abnormal temperature change range of the warm core is 2.42~5.85°C,and its depth ranges from 100~200m.In the inversion results, the temperature anomaly of the "warm core" ranges from 2.27 to 3.20°C, and its depth ranges from 70 to 125m, slightly shallower and more stable compared to the reanalysis results.The temperature anomaly remains basically near 100 m and is relatively small.The largest positive temperature anomaly in the reanalysis results occurred on February 5th, reaching 5.85℃.The vertical temperature structure of the zonal and meridional sections across that eddy core is shown in figure 7.There are distinct eddy structures observed in the reanalysis and inversion results.The eddy has a single-core structure in the vertical direction, and has similar structure in the reanalysis and inversion results.Within the eddy region, positive temperature anomalies increase with increasing depth and emerge in obvious "warm core" at a depth of 150m and 100m respectively.Afterwards, the temperature anomaly decreases with increasing depth and the effect of the eddy generally disappears at depths greater than 1000m.Compared to the reanalysis results, the "warm core" location of the eddy in the retrieved result is shallower, causing less positive temperature anomalies, with faster decrease as water depth increases.

Summary
Based on satellite remote sensing observations from 1993 to 2018, oceanic reanalysis data, and the Swin Transformer neural network, a suitable inversion model for the three-dimensional temperature field is established, and obtained good inversion results, the root-mean-square errors of the monthly average temperature for 2017 and 2018 are generally less than 1℃, respectively, with the maximum errors near the mixing layer.The inversion results can reproduce the entire life process of eddies and clearly show their three-dimensional structures, demonstrating the feasibility of using deep learning methods to invert the three-dimensional temperature field underwater and analyzing the threedimensional structure of mesoscale eddies based on the inversion results.
The current network structure of this study requires considerable computational performance, but in the future further optimization could be performed to reduce the computational parameter amounts (b) (a)

Figure 3 .
Figure 3. Vertical distribution curve of RMSE of monthly average inversion temperature field(a)2017 (b)2018

Figure 5 .
Figure 5. Vertical distribution curve of RMSE of monthly average inversion temperature field(a)2017 (b)2018

Figure 7 .
Figure 7. Vertical temperature structure of the eddy (The left side shows the reanalysis results, and the right side shows the inversion results,(a)zonal section (b)Meridional section)