Skip to content

DataWaveProject/qbo1d

 
 

Repository files navigation

Description

A PyTorch 1D QBO model.

The essential components of the code include:

  • adsolver.ADSolver: a class for solving a forced advection-diffusion equation in one space dimension.
  • utils.load_model: a utility for loading a Pytorch model, defined by a ModelClass and a state_dict, and containing the source term.

Features:

  • Can be forced using a spectrum of waves.
  • Can use backpropagation to optimize model parameters to a desired outcome.

(back to top)

"Installation"

The code requires (imports) PyTorch, NumPy, Matplotlib, and SciPy. To enjoy the example notebook you will also need Jupyter Notebook. A tested environment is provided in qbo1d-environment-spec-file.txt and can be replicated as follows:

conda create --name qbo1d --file qbo1d-environment-spec-file.txt
conda activate qbo1d

(back to top)

Documentation

Please refer to the Documentation.

(back to top)

Working example

A working example is provided in the example.ipynb notebook. Here is a figure. The forcing in the figure consists of two waves of equal and opposite amplitudes ± 6 mPa, opposite phase speeds ± 32 m s-1, and equal wavenumbers 1. The vertical advection in this case equals 10-5 m s-1. Note, the figure shows the last 12 years of a 96 year long integration. The amplitudes and period estimates were estimated after 12 years of spinup.

QBO

(back to top)

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 91.9%
  • Python 8.1%