Skip to content

Latest commit

 

History

History
107 lines (65 loc) · 3.26 KB

Ex1-ThermalWind.rst

File metadata and controls

107 lines (65 loc) · 3.26 KB

Exercise 1 - Thermal Wind

The goal is to explore the solution of the thermal wind equation between 2 WOCE stations in the Florida Straits. The thermal wind equation (in dimensional form) is

where

  • v is the horizontal velocity component across the line between the 2 stations in m / s
  • g is the acceleration due to gravity in m / s^2
  • f_o is the Coriolis parameter in s^{-1}
  • \rho_o is the reference density in kg / m^3
  • \rho is the varying density in kg / m^3
  • x is the horizontal distance between the 2 stations in m

There are 2 choices of boundary conditions that can be used to solve the equation:

  1. A depth at which there is no motion
  2. A surface height difference between the 2 stations

The code provided integrates 2 density profiles and uses the chosen boundary condition to calculate the velocity component profile on the line connecting the profiles.

Also provided are a pair of density profiles at stations in the Gulf Stream where it passes through the Florida Straits. These data were collected under the world project "WOCE" and are part of a large collection of data that is freely available on the web. The stations are at 26ºN and are 36.89 km apart.

Your assignment:

thermal_wind/aims_allen_exercise_1.png

Explore the velocity profiles that result with various choices for the no motion depth and for various surface height differences between the two stations. The actual surface level at station 105 is probably about 40 cm higher than that at station 109.

Get the Python Code

Open up a terminal window and an editor. If you don't have favourites that you use all the time, the :guilabel:`Text Editor` icon on the AIMS computers will bring up :program:`gedit` for you with terminal, editor, and file navigator panes.

In the terminal, clone the Git repository that contains the code and data (as well as a PDF of this morning's slides), change to the :file:`thermal_wind` directory, and start :program:`ipython` with plotting enabled:

$ git clone [email protected]:UBC-MOAD/AIMS-Workshop.git
$ cd AIMS-Workshop
$ ipython --pylab

The Python functions we're going to use in this exercise are in :mod:`thermal_wind.py`. You can explore the code by opening it in the editor pane.

The :func:`thermal_wind` function has the following docstring that tells us about what it does, its inputs, its outputs, and the exceptions that it may raise:

.. autofunction:: thermal_wind.thermal_wind


The docstring from the :func:`plot_velocity_profile` is:

.. autofunction:: thermal_wind.plot_velocity_profile


An Example

In []: import thermal_wind

In []: depth, v = thermal_wind.thermal_wind('s109.dens', 's105.dens', surface_delta=0)

In []: thermal_wind.plot_velocity_profile(depth, v)

Now, it's your turn...