Code for simple models of the atmosphere (and ocean)
This is a repository for code I have used to make class examples -- some graphics using the output of the codes are shown further below. Unfortunately, several of the programs need to be completely re-coded for clarity and none of them have been carefully tested, so please use with caution. My goal is to eventually produce well-tested Python versions of all the programs here but I haven't figured out a way to get funding for that, so it remains a very slowly moving hobby project. If you find any errors, please contact me at [email protected] .
For a list of other freely-available code, see: https://storm.uml.edu/~metweb/newBlog/wordpress/2020/05/11/simple-atmospheric-models-resources/.
baro_1d_1.0.f
Solves the linearized barotropic vorticity equation in one spatial dimension (longitude). No external libraries, should run with gfortran. Produces a binary output file, no plotting included (a GrADS control file is included in the 'grads' folder).
lbve_sbr_1.0.f
Solves the linearized barotropic vorticity equation on a sphere, for idealized El Nino forcing with a basic state of solid body rotation. No external libraries, should run with gfortran. Produces a binary output file, no plotting included (a GrADS control file is included in the 'grads' folder).
two_layer.f
Solves the two-layer baroclinic model from Holton (4th ed), should run with gfortran. Coded by a student as a very impressive project but needs to be recoded for clarity. Produces a binary output file, no plotting included (a GrADS control file is included in the 'grads' folder).
inertial_oscillations_1.1.py
Calculates trajectories for inertial oscillations and plots the results.
More Information
The following animation was made from the output of baro_1d_1.0.f, using a separate plotting routine (which was also used to add the envelope):
The following graphic was made from the output of lbve_sbr_1.0.f, using a separate plotting routine:
The following animation was made from the output of two_layer.f, using a separate plotting routine:
inertial_oscillations_1.1.py numerically calculates trajectories for inertial oscillations, given a starting location and wind, and makes the plot shown below. The analytic solution for constant f is included for comparison and validation. The code solves the equation set:
du/dt = fv
dv/dt = -fu
inertial_oscillations_anim_1.1.py does the same calculation, but makes an animated gif of the trajectory