         Udunits install How-To for CHIMERE under GNU/Linux systems.

                          $$$$$$$$$$$$$$$$



2005-06-09


Background
==========

Since version V200510 of CHIMERE a new analysis tool, exachim, has been
included in the package. Exachim is optional, but requires the 
"udunits" package to work.


Installation
============

A - download Udunits (source package) from the URL :

     ftp://ftp.unidata.ucar.edu/pub/udunits/udunits.tar.Z

    and save it in /tmp


B - Decompress and detar

$ cd /tmp
$ tar xvfz udunits.tar.Z


C - Configure udunits

At the time of writing of this How-To, the current version of udunits
is 1.12.4. If you downloaded a newer version, replace 1.12.4 by the
new version number in the following text.

$ cd udunits-1.12.4/src

The configuration process depends on several environment variables
that you shall set according to your compiler.

We suppose you want to install udunits somewhere under /opt.
If you choose to install under /usr/local, or under you home directory,
replace /opt by your installation path in the following text.

We also suppose your shell is like bash or ksh. If you use csh, modify the
"export" statements according to your shell syntax.


C1 - gcc on a 32 bit machine
============================

As root :
# mkdir /opt/udunits-1.12.4

As an ordinary user :
export CFLAGS=-O
export LDFLAGS="-lm"
export CPPFLAGS="-DNDEBUG -DpgiFortran  -D_GNU_SOURCE"
./configure --prefix=/opt/udunits-1.12.4
make
make test

As root :
# make install


C2 - gcc on a 64 bit machine
============================

As root :
# mkdir /opt/udunits-1.12.4-64

As an ordinary user :
export CFLAGS="-O -m64 -fPIC"
export LDFLAGS="-lm"
export CPPFLAGS="-DNDEBUG -DpgiFortran  -D_GNU_SOURCE"
./configure --prefix=/opt/udunits-1.12.4-64
make
make test

As root :
# make install


CHIMERE configuration
=====================

At the top level of CHIMERE tree, you will find 5 files :

   Makefile.hdr.ifort
   Makefile.hdr.ifort-64
   Makefile.hdr.g95
   Makefile.hdr.g95-64
   Makefile.hdr.pgf90

In the file corresponding to your compiler,
modify the line "UDUNITS = " to point to your udunits directory. 
For instance :

UDUNITS =       /opt/udunits-1.12.4

