Skip to content

An LPJmL-Python interface for operating LPJmL in a Python environment and coupling it with Python models, programmes or simple programming scripts.

License

Notifications You must be signed in to change notification settings

PIK-LPJmL/pycoupler

Repository files navigation

pycoupler: dynamic model coupling of LPJmL

CI DOI

An LPJmL-Python interface for operating LPJmL in a Python environment and coupling it with Python models, programmes or simple programming scripts. pycoupler was written with the aim of establishing the coupling of copan:CORE with LPJmL. Coupling with LPJmL is possible on an annual basis, i.e. for each year in which LPJmL is in coupling mode, the desired inputs must be passed via pycoupler. LPJmL simulates the corresponding year and returns the desired outputs at the end of the year. The coupled programme can use the output data to generate new inputs for the next year.

Overview

LPJmL Config ⚙ for handling LPJmL configurations

  • Read & write ✍ LPJmL configuration files as LPJmLConfig objects
  • Set options & parameters for spinup, transient and coupled simulations
  • regrid() 🌐 LPJmL output data for country-specific simulations
  • LPJmL can be checked check_lpjml() 🔍 and operated run_lpjml()submit_lpjml() 🚀 with written configuration files

LPJmL Coupler 🔌 to couple LPJmL with other models

  • LPJmLCoupler class to initiate bi-directional, annual coupling to LPJmL
  • 📥 Read output data (annual) from LPJmL
  • 📤 Send input data (annual) to LPJmL

LPJmL Data 💾 for reading and processing LPJmL data

  • xarray-based data classes
  • Read LPJmL netCDF files 🗺 as LPJmLData or LPJmLDataSetobjects
  • LPJmLMetaData for reading and handling LPJmL meta files or header data

Installation

Use the package manager pip to install pycoupler.

pip install .

Please clone and compile LPJmL in advance.
Make sure to also have set the working environment for LPJmL correctly if you are not working on the PIK HPC (with Slurm Workload Manager).

See scripts for examples on how to use the package.

Questions / Problems

In case of questions please contact Jannes Breier [email protected] or open an issue.

Contributing

Merge requests are welcome, see CONTRIBUTING.md. For major changes, please open an issue first to discuss what you would like to change.

About

An LPJmL-Python interface for operating LPJmL in a Python environment and coupling it with Python models, programmes or simple programming scripts.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages