Skip to content

Repository files navigation

SCALE-Analysis
================

In SCALE (Scalable Computing for Advanced Library and Environment), 
a set of Python scripts useful for data analysis in weather and climate research are provided. 
There are several examples using these scripts. 
For the overview, see https://scale.riken.jp/analysis/ .


Contributing
------------
Analysis working group in Team SCALE


License
------------
- License: The BSD 2-Clause License


Preparation
------------
- Setup Python environment
  Note that we require several Python packages (such as numpy, xarray, dask, matplotlib, mpi4py, openmpi, netcdf4, and cartopy) and Jupyter Notebook. 
  See the User's Guide (TOPDIR)/doc/scale-analysis-users-guide-ja.md.
  For FUGAKU users, see (TOPDIR)/doc/python_setup_on_fugaku.md.

- Build shared libraries to call SCALE library from Python scripts
  Set several environment variables as

  $ export SCALE=(Top directory of SCALE)
  $ export SCALE_SYS=Linux64-gnu-ompi (This is an example. See the sysdef directory of SCALE directory)

  When building the SCALE library for use with SCALE-Analysis, the SCALE library should be built as position-independent code. Add -fPIC to FFLAGS_FAST and CFLAGS_FAST in the corresponding sysdep/Makedef.* file in the SCALE directory for your environment.

  If optional environment variables such as SCALE_ENABLE_OPENMP are set when building SCALE library, same options should be applied.  
  If you need to specify explicitly, set environment variables with NetCDF library as 

  $ export SCALE_NETCDF_INCLUDE="-I/opt/netcdf4-fortran/x.x.x/include"
  $ export SCALE_NETCDF_LIBS="-L/opt/netcdf4-fortran/x.x.x/lib -L/ap/netcdf4/y.y.y/lib -L/ap/HDF5/z.z.z/lib  -lnetcdff -lnetcdf -lhdf5_hl -lhdf5"

  Then, in the top directory, execute 
  $ make

- Download input data used in examples
  To download SCALE-RM output, in the top directory, execute
  $ make prepare
  If it succeeds, you will find a new directory ( (TOPDIR)/sampledata/ ). 

  For data except for SCALE-RM output, please see explanation in each file.


Execution
-------------
There are two classes of analysis framework.

- Analysis framework using scale-analysis.py
  There are two ways to run the analysis framework: quick mode or config mode.
  For the quick mode, execute like,
  $ mpirun -n 1 python scale-analysis.py quick horstats \
    --input ./sampledata/tutorial/real/experiment/run/ \
    --var T2 \
    --parallel dmpar \
    --prc-num-x-anl 1 \
    --prc-num-y-anl 1

  For the config mode, execute like,
  $ mpirun -n 1 python scale-analysis.py anl.yaml
  The file "anl.yaml" is for configuration, and the sample files are located on ./config/sample/

  For more detail, see the tutorial (TOPDIR)/doc/scale-analysis-beginner-tutorial-ja.md and the User's Guide (TOPDIR)/doc/scale-analysis-users-guide-ja.md.

- Stand-alone packages
  The directory (TOPDIR)/gallery has several Jupyter notebook files and Python scripts.
  You can run the former files on the Jupyter Notebook App. 

About

A set of Python scripts useful for analyzing SCALE output

Topics

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages