Giter Site home page Giter Site logo

daniloceano / lorenz-cycle Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 93.53 MB

Program for computing the Lorenz Energy Cycle (LEC) in a closed region of the atmosphere.

License: GNU General Public License v3.0

Python 99.78% Shell 0.22%
atmospheric-science data-analysis-python energetics meteorology scientific-research

lorenz-cycle's Introduction

Lorenz Energy Cycle (LEC)

Overview

The Lorenz Energy Cycle (LEC), introduced by Edward Lorenz in 1965, is an analytical framework used to estimate atmospheric energy. It categorizes energy into zonal and eddy components of Kinetic Energy (Kz and Ke, respectively) and Available Potential Energy (Az and Ae, respectively). The LEC also quantifies conversions between these forms (Ca, Ce, Cz, and Ck), along with generation and dissipation terms (Gz, Ge, Dz, and De). Originally developed for global energetics, the framework has been adapted for regional studies, incorporating calculations for energy transport across boundaries (BAz, BAe, BKz, BKe).

The LEC budget is described by the following equations:

$\frac{\partial A_Z}{\partial t} = -C_Z - C_A + G_Z + B A_Z$

$\frac{\partial K_Z}{\partial t} = -C_Z + C_K - D_Z + B K_Z + B \Phi_Z$

$\frac{\partial A_E}{\partial t} = C_A - C_E + G_E + B A_E$

$\frac{\partial K_E}{\partial t} = C_E - C_K - D_E + B K_E + B \Phi_E$

Due to the difficulty in measuring friction terms for dissipation, both dissipation and generation are often computed as residuals from the budget equations:

$RG_Z = G_Z + \varepsilon_{AZ}$

$RG_E = G_E + \varepsilon_{AE}$

$RK_Z = B \Phi_Z - D_Z + \varepsilon_{KZ}$

$RK_E = B \Phi_E - D_E + \varepsilon_{KE}$

Where ε represents numerical errors. The complete cycle, assuming all terms are positive, is depicted below:

Program Description

The Lorenz-Cycle program calculates the LEC for specific atmospheric regions. It requires a netCDF file containing wind components, air temperature, and geopotential or geopotential height data. The program offers two frameworks:

  1. Fixed Framework: The domain is static, defined by inputs/box_limits.
  2. Moving Framework: The domain moves with an atmospheric perturbation.

Usage

Fixed framework

Prerequisites: Check the Flags section.

  • Ensure you have a netCDF file with necessary variables (u, v, omega, air temperature, geopotential or geopotential height) on pressure-level vertical levels.
  • Define the domain in 'inputs/box_limits' as a CSV:

image

  • Specify variable names and units in 'inputs/fvars':

image

  • Execute from the source code directory:
python lorenz-cycle.py path/to/infile.nc -r -e

Moving freamework

Prerequisites: Check the Flags section.

Pre-defined domain

  • Follow the initial steps for the Fixed Framework.
  • Use a track file to define the system's center over time. Optionally, add length and width columns to adjust the domain size.

image

  • Execute:
python lorenz-cycle.py path/to/infile.nc -r -t

Interactive Domain Selection

  • For interactive map-based domain selection, run:
python lorenz-cycle.py path/to/infile.nc -r -c
  • First, define a slice of global data to enhance visualization and processing speed.
  • Select the computational area for each timestep:

image

  • Each timestep prompts the user to select a computational area:

image

File Naming Convention

It's recommended to use a naming convention like "subject_source.nc" for input files. For compound names, use a hyphen, e.g., "Cyclone-20100101_NCEP-R2.nc".

Flags

  • -r, --residuals: Compute the Dissipation and Generation terms as residuals.
  • -f, --fixed: Compute the energetics for a fixed domain specified by the 'box_limits' file.
  • -t, --track: Define the domain using a track file.
  • -c, --choose: Interactively select the domain for each time step.
  • -o, --outname: Specify an output name for the results.
  • -z, --zeta: Use the vorticity from the track file instead of computing it at 850 hPa.
  • -g, --geopotential: Use geopotential data instead of geopotential height.
  • -m, --mpas: Specify this flag if working with MPAS-A data processed with MPAS-BR routines.
  • -p, --plots: Generate plots.

Ensure that the provided NetCDF file and the fvars configuration align with the selected flags.

Example of 'fvars' file with geopotential:

image

lorenz-cycle's People

Contributors

daniloceano avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

subaohuang

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.