This section introduces the vertical mode expansion using the temperature and salinity data output by the OFES (Oceanic General Circulation Reanalysis Model).
The general flow is as follows:
1. download the water temperature and salinity data and obtain their domain and time averages
2. create a vertical profile of density from water temperature and salinity data
3. convert the vertical profile of density into a vertical profile of buoyancy frequency and
decompose it into eigenvalues
4. obtain eigenvalues and eigenvectors from eigenvalue decomposition
The first step is to download the temperature and salinity data. Here, we used GrADS (Grid Analysis and Display System), which is widely used for analysis in the field of atmosphere and ocean, to download the data from the OPeNDAP server of APDRC (Asia-Pacific Data-Research Center). Various data on the atmosphere and ocean can be downloaded from the APDRC server.
Link: APDRC's website
The details of the water temperature and salinity data to be downloaded this time can be seen from the following links.
http://apdrc.soest.hawaii.edu:80/dods/public_ofes/OfES/ncep_0.5_global_mmean/temp
http://apdrc.soest.hawaii.edu:80/dods/public_ofes/OfES/ncep_0.5_global_mmean/sln
By writing the following on the GrADS command prompt, you can use data in NetCDF format and also write (download) it to a file. It is easy to use because there is no need to create a control file, and the area and time of the data to be used can be specified.
ga-> sdfopen http://apdrc.soest.hawaii.edu:80/dods/public_ofes/OfES/ncep_0.5_global_mmean/sln
A script file (download and average calculation) has been uploaded to the following link (file name: gofes-pacific.gex) for your reference. You may use it as is. Save the resulting data file under an appropriate name.
(In the reference script, the water temperature and salt data are saved as dofes-ts-pacific.dta.)
Link: Script for downloading and averaging water temperature and salinity data
Since we will be using data from the tropical Pacific Ocean, we have set a range of 125 degrees east to 75 degrees west longitude and 30 degrees south to 30 degrees north latitude, but you can change this as you wish.
This completes the creation of the data for the vertical profiles of temperature and salinity.
From the resulting water temperature and salinity data, we will proceed to the vertical profile of density, then the conversion to buoyancy frequency, and then the vertical mode expansion. As usual, I have uploaded a reference program at the following link.
(File name: fvmode_decompose-ofes.F90)
Link: Vertical mode decomposition program (fortran)
The reference program outputs the real and imaginary parts of the eigenvalues for the forward and tilting pressure modes up to the third mode, as well as the gravity wave velocities for the tilting pressure modes (first through third modes).
Performing a vertical mode expansion is equivalent to solving the Strum-Liouville eigenvalue problem.
The figure below is a conceptual diagram of vertical mode expansion in the ocean.
For eigenvalue decomposition, we use the dgeev routine from LAPACK (in this case, Intel Math Kernel Library). This routine can compute the eigenvalues and eigenvectors of large matrices (including asymmetric matrices).
Link: How to use dgeev
In the dynamics of the atmosphere and ocean, vertical mode expansion has advantages such as making it easier to understand the phenomena. In this study, we focused on gravity wave velocities in the vertical mode expansion. The figure below shows the results of the eigenvector calculation as plotted by Gnuplot.
The above program for calculating vertical modes was written in FORTRAN, but I have also added a reference script created in Python below. Please use it as a reference (modification required).
Link: Vertical mode expansion program (Python)
The two files below are the bathymetry data. Both files are used for calculations, based on the grid features in which the data is stored.
Link: OFES Bathymetry Data 1
Link: OFES Bathymetry Data 2
The eigenvectors you have created are shown in the figure below (drawn in Gnuplot).
I just started using Python, but it has a good library, and this program (vertical mode expansion) was made almost exclusively with the numpy library. It's very convenient.
As I get more familiar with Python, I would like to update the program I created this time into a more sophisticated program.