Skip to main content

Exoplanet GCM

Project description

Created by Adiv Paradise

Copyright 2020, Distributed under the General Public License

This API was written with Python 3 in mind, but should work with Python 2 and outdated versions of NumPy.

Read the full documentation at http://exoplasim.readthedocs.io.

Requirements

  • numpy

  • scipy

  • matplotlib (only needed for additional utilities)

  • GNU C (gcc/g++) and Fortran (gfortran) compilers (for Python utilities)

  • (optionally) Other compilers whose use you prefer for the model itself

  • (optionally) MPI libraries for those compilers

  • netCDF4 (optional)

  • h5py (optional)

Compatibility

  • Linux (tested on Ubuntu 18.04, CentOS 6.10): Yes

  • Google Colaboratory: Yes (note that OpenMPI support on Colaboratory is limited due to automatic root privileges; look up how to run OpenMPI executables with root permissions and note that this is not recommended)

  • Windows 10: Yes, via Windows Subsystem for Linux

  • Mac OS X: Yes, requires Xcode and developer tools, and OpenMPI support requires that Fortran-compatible libraries be built. Tested on Mac OS X Catalina and Big Sur (with MacPorts, GCC10, OpenMPI, and Anaconda3), Apple M1 compatibility has not been tested.

New in 3.0:

  • ExoPlaSim no longer depends on X11 libraries for installation and compilation!

  • Revamped postprocessor no longer depends on NetCDF-C libraries, and supports additional output formats (including netCDF, HDF5, NumPy archives, and archives of CSV files).

  • GCC and gfortran support through GCC 10.

  • Improved cross-platform compatibility

  • Numerous bugfixes

Installation

pip install exoplasim

OR:

python setup.py install

The first time you import the module and try to create a model after either installing or updating, ExoPlaSim will run a configuration script.

Multiple output formats are supported by the built-in pyburn postprocessor. If you wish to use HDF5 or NetCDF output formats, you will need the netCDF4-python and h5py libraries, respectively. You can ensure these are included at install-time by specifying them:

::

pip install exoplasim[netCDF4]

OR::

pip install exoplasim[HDF5]

OR::

pip install exoplasim[netCDF4,HDF5]

You may also configure and compile the model manually if you wish to not use the Python API, by entering the exoplasim/ directory and running first configure.sh, then compile.sh (compilation flags are shown by running ./compile.sh -h).

PlaSim Documentation

Original PlaSim documentation is available in the exoplasim/docs/ folder.

Usage

To use the ExoPlaSim Python API, you must import the module, create a Model or one of its subclasses, call its configure method and/or modify method, and then run it.

An IPython notebook is included with ExoPlaSim; which demonstrates basic usage. It can be found in the ExoPlaSim installation directory, or downloaded directly here.

Basic example::

import exoplasim as exo
mymodel = exo.Model(workdir="mymodel_testrun",modelname="mymodel",resolution="T21",layers=10,ncpus=8)
mymodel.configure()
mymodel.exportcfg()
mymodel.run(years=100,crashifbroken=True)
mymodel.finalize("mymodel_output")

In this example, we initialize a model that will run in the directory “mymodel_testrun”, and has the name “mymodel”, which will be used to label output and error logs. The model has T21 resolution, or 32x64, 10 layers, and will run on 8 CPUs. By default, the compiler will use 8-byte precision. 4-byte may run slightly faster, but possibly at the cost of reduced stability. If there are machine-specific optimization flags you would like to use when compiling, you may specify them as a string to the optimization argument, e.g. optimization='mavx'. ExoPlaSim will check to see if an appropriate executable has already been created, and if not (or if flags indicating special compiler behavior such as debug=True or an optimization flag are set) it will compile one. We then configure the model with all the default parameter choices, which means we will get a model of Earth. We then export the model configurations to a .cfg file (named automatically after the model), which will allow the model configuration to be recreated exactly by other users. We run the model for 100 years, with error-handling enabled. Finally, we tell the model to clean up after itself. It will take the most recent output files and rename them after the model name we chose, and delete all the intermediate output and configuration files.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

exoplasim-3.4.2.tar.gz (20.4 MB view details)

Uploaded Source

Built Distribution

exoplasim-3.4.2-py3-none-any.whl (20.5 MB view details)

Uploaded Python 3

File details

Details for the file exoplasim-3.4.2.tar.gz.

File metadata

  • Download URL: exoplasim-3.4.2.tar.gz
  • Upload date:
  • Size: 20.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for exoplasim-3.4.2.tar.gz
Algorithm Hash digest
SHA256 fae502a92f5997ffd18b0bb85b9f0f0677857c62c5d1293f605c9799026f64c2
MD5 a02daf5a841bdf43fe6e39f86270cd59
BLAKE2b-256 691e14c6e39a821ca31e7484b8971ceff1e3a698cde8619436cdaa03c59962a1

See more details on using hashes here.

File details

Details for the file exoplasim-3.4.2-py3-none-any.whl.

File metadata

  • Download URL: exoplasim-3.4.2-py3-none-any.whl
  • Upload date:
  • Size: 20.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for exoplasim-3.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2296ae66af15a6e16db07c67d30bb28af6f9d3a251fa418ebf78ff5a36087934
MD5 52cc96941717221e44e75d884cd272a6
BLAKE2b-256 1e2b13e91598eff47e8139445de5fe57a2e523262ff8ef0d03e1f557e0e3219f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page