Code Monkey home page Code Monkey logo

climlab-emanuel-convection's Introduction

climlab-emanuel-convection

build-and-test workflow

Brian Rose, University at Albany

About

This is a stand-alone Python wrapper for the Emanuel convection scheme.

The primary use-case is to serve as the under-the-hood moist convection driver for climlab, but it can be used as a stand-alone model if you are familiar with Fortran source code. This is a lightweight wrapper that emulates the Fortran interface as closely as possible. The original convect43c code is bundled here, courtesy of Kerry Emanuel.

Installation

Pre-built binaries for many platforms are available from conda-forge.

To install in the current environment:

conda install climlab-emanuel-convection --channel conda-forge

or create a self-contained environment:

conda create --name my_env python=3.10 climlab-emanuel-convection --channel conda-forge
conda activate my_env

See below for instructions on how to build from source.

Example usage

You can import the Fortran driver into a Python session with

from climlab_emanuel_convection import emanuel_convection

Please see the directory climlab_emanuel_convection/tests/ directory in this repository for working examples that set up all the necessary input arrays and call the driver.

Building from source

Here are instructions to create a build environment (including Fortran compiler) with conda/mamba and build using f2py. It should be possible to build using other Fortran compilers, but I haven't tested this.

To build (example for Apple M1 machine, see ./ci/ for other environment files):

mamba create --name convect_build_env python=3.10 --channel conda-forge
mamba env update --file ./ci/requirements-macos-arm64.yml
conda activate convect_build_env
python -m pip install . --no-deps -vv

To run tests, do this from any directory other than the climlab-emanuel-convection repo:

pytest -v --pyargs climlab_emanuel_convection

Version history

Version 0.2 is the first public release (April 2022). The Python wrapper code has been extracted from climlab v0.7.13.

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.