Giter Site home page Giter Site logo

jihenghu / canoe Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chengcli/canoe

0.0 0.0 0.0 4.24 MB

Comprehensive Atmosphere N' Ocean Engine

Shell 0.28% Ruby 0.01% C++ 92.98% Python 0.76% C 1.35% Fortran 3.01% Makefile 0.01% CMake 1.34% Roff 0.27%

canoe's Introduction

Canoe: Comprehensive Atmosphere N' Ocean Engine

build build DocStatus License codecov

Install system libraries and toolchain

Canoe can be installed on either a Linux distribution or on MacOS. Open a Linux or Mac terminal, you can clone this repo using the following command:

git clone https://github.com/chengcli/canoe

This will copy all source files into your local computer. You will need to install a few system libraries before installing canoe. All following instructions are executed under the canoe/ directory, which is referred to as the root.

MacOS Installation Guide

We assume that homebrew is already installed on your Mac and we will use brew to install required system libraries. The system libraries are listed in Brewfile at the root. To install them all, execute

brew bundle

Ubuntu Linux Installation Guide

On a Ubuntu linux system, use apt to install

sudo apt install $(cat packages_debian.txt)

Redhat Linux Installation Guide

On a Redhat linux system, use yum to install

sudo yum -y install $(cat packages_centos.txt)

Multi-core execution

If multi-core parallelization is needed, these extra pacakges should be install

  • mpich parallel library

Ubuntu linux:

sudo apt install libmpich-dev

Redhat linux:

sudo yum install mpich-devel
source ~/.bash_profile
  • pnetcdf output

Redhat linux does not support pnetcdf natively. So it should be downloaded and install. The default installation directory is $HOME/opt/

cd external
./fetch_pnetcdf.sh
./install_pnetcdf.sh
cd ..

Install python libraries

The minimum python version is 3.8. All needed python libraries are collected in requirements.txt. We suggest using a python virtual environment to install these packages. If you are already using a virtual enviroment, install python packages by

pip3 install -r requirements.txt

Otherwise, to create a python virtual environment:

python -m venv pyenv

This command will create an environment named pyenv in your current directory. Then, you can use the previous command to install the python packages.

Install pre-commit

Register your pre-commit hooks using

pre-commit install

The contributor's guide explains the meaning of pre-commit.

How to build and test

After you completed the installation steps, you can build the canoe library. The easiest way is to build it in-place, meaning that the build (binary files) are located under root. To do so, make a new directory named build

mkdir build

All build files will be generated and placed under this directory. It is completely safe to delete the whole directory if you want another build. cd to build and cmake

cd build
cmake ..

This command tells the cmake command to look for CMakeFiles.txt in the parent directory, and start configuring the compile environment. Then compile the code by

make -j4

This comman will use 4 cores to compile the code in parallel. Once complete, all executable files will be placed in build/bin.

Optional packages

  • The Reference Forward Model (RFM) is provided optionally as a tool to generate opacity tables. The source code of this package is not publically available. Please contact Anu Dudhia ar Cheng Li to obtain access. The build process turns off RFM by default. To turn on building RFM, use
cmake .. -DRFM=ON
  • The DIScrete Ordinate Radiative Transfer (DISORT) is provided optionally as a plane-parallel radiative transfer solver. The original source code was in Fortran77. Tim Downling translated it to C in 2011. The C-source code, version 2.1.3, is hosted at libradtran.org. The build process turns off DISORT by default. To turn on building DISORT, use
cmake .. -DDISORT=ON
cmake .. -DPVFMM=ON

canoe's People

Contributors

chengcli avatar luminoctum avatar cshsgy avatar gitlinffff avatar jeffyujianfu avatar

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.