Log In | Users | Register
Edit | Attach | New | Raw | Diff | Print | | Tools
You are here: Data » DocTools » ToolsVis » VisNCL » VisNCLInstallation

Installation UPDATED

This page contains the very simple procedure of installing NCL on your account at CSCS.

1. Create a ~/.nclrc file and add the following lines

For tcshell

# NCL definitions
setenv NCARG_ROOT /users/olifu/ncl
if ($PATH !~ *${NCARG_ROOT}/bin*) then
    setenv PATH ${NCARG_ROOT}/bin:${PATH}
endif
if ($LD_LIBRARY_PATH !~ *${NCARG_ROOT}/lib*) then
  setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${NCARG_ROOT}/lib
endif
setenv NCL_NO_SYSTEM_PAGER 1

# COSMOLIB definitions
setenv NCL_COSMOLIB /users/olifu/ncl/cosmolib
setenv NCARG_RANGS ${NCL_COSMOLIB}/data/rangs_gshhs
setenv NCL_GRIB_PTABLE_PATH ${NCL_COSMOLIB}/gt
setenv NCL_DEF_SCRIPTS_DIR ${HOME}/ncl/startup
setenv NCL_COSMOLIB_COLORTABLES ${HOME}/ncl/ct

For bash shell

# NCL definitions
export NCARG_ROOT=/users/olifu/ncl
if [ "$PATH" != "*${NCARG_ROOT}/bin*" ] 
then
    export PATH=${NCARG_ROOT}/bin:${PATH}
fi
if [ "$LD_LIBRARY_PATH" != "*${NCARG_ROOT}/lib*" ] 
then
  export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${NCARG_ROOT}/lib
fi
export NCL_NO_SYSTEM_PAGER=1

# COSMOLIB definitions
export NCL_COSMOLIB=/users/olifu/ncl/cosmolib
export NCARG_RANGS=${NCL_COSMOLIB}/data/rangs_gshhs
export NCL_GRIB_PTABLE_PATH=${NCL_COSMOLIB}/gt
export NCL_DEF_SCRIPTS_DIR=${HOME}/ncl/startup
export NCL_COSMOLIB_COLORTABLES=${HOME}/ncl/ct

For CSCS installations of NCL (with modules)

If you want to use CSCS installed NCL modules, your .nclrc file could look like this:

# to change to development version of NCL in this shell
# you have to source this script

# load ncl module
source /opt/modules/default/init/csh
setenv MODULEPATH /apps/modulefiles:$MODULEPATH
module add ncl_ncarg/6.0.0

# set COSMOLIB environment
setenv NCL_COSMOLIB /oprusers/osm/opr/lib/ncl/cosmolib
setenv NCL_NO_SYSTEM_PAGER 1
setenv NCL_GRIB_PTABLE_PATH ${NCL_COSMOLIB}/gt
setenv NCARG_RANGS ${NCL_COSMOLIB}/data/rangs_gshhs
setenv NCL_COSMOLIB_COLORTABLES ${NCL_COSMOLIB}/ct
setenv NCL_DEF_SCRIPTS_DIR ${NCL_COSMOLIB}/startup

rehash
Adapt accordingly for your local cosmolib installation and/or for bash shells.

If you want to use the operational NCL setup of MeteoSwiss, you can source the osm environment with

source ~owm/.nclrc
2. Add the following lines to your ~/.cshrc file

For tcshell

# NCL definitions
if (-e ${HOME}/.nclrc) then
  source ${HOME}/.nclrc
endif

For bash shell

# NCL definitions
if [ -f ${HOME}/.nclrc ]
then
  source ${HOME}/.nclrc
fi

NOTE You must open a new terminal session in order for these changes to take effect. Make sure you do not get an error or warning upon logging in.

3. Make a local NCL directory and install startup scripts

This step needs to be only taken, if you want to use an own NCL and/or cosmolib installation.

> cd
> mkdir ncl ncl/startup ncl/scripts ncl/ct
> cd ncl/startup
> ln -s ${NCL_COSMOLIB}/startup/*.ncl .

The ct directory can contain your own color tables (see VisNCLCosmoLibraryColorTables). The startup directory contains scripts that will be loaded upon starting of NCL. By default, the COSMO Library will be loaded upon startup of NCL. The scripts directory may contain a collection of your own NCL scripts.

4. Setup some decent defaults for plots created by NCL

> cd
> cp ~owm/.hluresfile .

5. Open a new terminal and test your installation

> ng4ex gsun01n

A series of plots should have appeared in a window (click inside the window to make the plots advance).

6. Optionally, you can install NCL editor enhancements for your favorite editor.

Syntax highlighting is available for Emacs, JED, nedit and VIM.

You're ready to rock!

-- OliverFuhrer - 28 Jan 2009 spacer

This site is managed by the Center for Climate Systems Modeling (C2SM).
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors. Ideas, requests, problems? Send feedback!