wiki:Documentation/UserGuide/InstallingORCHIDEE

Version 6 (modified by jgipsl, 11 years ago) (diff)

--

How to install ORCHIDEE on an linux pc (Ubuntu or Fedora distribution)

WARNING : If you have an account on LSCE, IDRIS or TGCC computers, please follow the procedure described here : HowTo/InstallingORCHIDEEBasic

This installation guide has been tested on a laptop computer using Ubuntu 12.04 version. Softwares used : gcc (C compiler), gfortran (Fortran 90 compiler), subversion (version control system), netcdf 3.6.3
Follow the steps and you will be able to compile and launch ORCHIDEE in sequential on a point to test it !

1.a Installing netcdf library (package installation) (not tested)

Now, netcdf is available as a package for linux distribution. For Ubuntu, a package exists. Make sure that the netcdf is compiled with the same compiler as you'll compile ORCHIDEE (here gfotran compiler). This installation was not tested, but it is OK, go to step 2 !

1.b Installing netcdf library (manual installation)

The most difficult part consists to install the netcdf library. The version chosen is netcdf 3.6.3 ; it is entirely sufficient for your laptop.

Download netcdf : Open a terminal and type the following command (> represents the prompt) to download netcdf 3.6.3 :

    >   wget http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-3.6.3.tar.gz

Extract the archive :

    >    tar -xvzf netcdf-3.6.3.tar.gz

A directory called netcdf-3.6.3 will be created. Go inside it :

    >    cd  netcdf-3.6.3

If you type ls, you will find :

    > ls
acinclude.m4  config.guess  configure     cxx      dods.m4   fortran     libsrc     Makefile.am  man4      ncdump  nc_test   README
aclocal.m4    config.h.in   configure.ac  cxx4     examples  INSTALL     libsrc4    Makefile.in  missing   ncgen   nc_test4  RELEASE_NOTES
compile       config.sub    COPYRIGHT     depcomp  f90       install-sh  ltmain.sh  man          ncdap.m4  nctest  nf_test   win32

Now focus on the script called configure. To know more about this script and the different options available, look at http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-install/Configure.html#Configure.
I execute this script like this :

      >  ./configure  --disable-largefile --disable-cxx

In my case, I deactivate the creation of large netcdf files (larger than 2 GB) with the option --disable-largefile. I also deactivate the creation of netcdf libraries for C++ because I don't need it. But to create netcdf libraries for FORTRAN, you have to create netcdf libraries for C. If you have a C compiler and a FORTRAN compiler, you will have no problems. Now you need to be root user. If you are on Ubuntu system (or Debian), type :

      >  sudo su

On Fedora :

      >  su

Enter your password then execute in the following order :

      > make

( compile netcdf on your computer.) Then

      > make check

( Test the buiding ) and finally the installation :

      > make install

If your installation was successful, the following message will appears :

+-------------------------------------------------------------+
| Congratulations! You have successfully installed netCDF!    |
|                                                             |
| CAUTION:                                                    |
|                                                             |
| If you have not already run "make check", then we strongly  |
| recommend you do so. It does not take very long.            |
|                                                             |
| Before using netCDF to store important data, test your      |
| build with "make check".                                    |
|                                                             |
| NetCDF is tested nightly on many platforms at Unidata       |
| but your platform is probably different in some ways.       |
|                                                             |
| If any tests fail, please see the netCDF web site:          |
| http://www.unidata.ucar.edu/software/netcdf/                |
|                                                             |
| NetCDF is developed and maintained at the Unidata Program   |
| Center. Unidata provides a broad array of data and software |
| tools for use in geoscience education and research.         |
| http://www.unidata.ucar.edu                                 |
+-------------------------------------------------------------+

After, you can delete the directory netcdf-3.6.3 (still in root) :

     >  rm -rf netcdf-3.6.3.tar.gz netcdf-3.6.3

2. Installing ORCHIDEE

After this hard task, you need to install the modipsl environment into MY_ORCHIDEE (you can change the name of this directory) :

      >  svn co http://forge.ipsl.jussieu.fr/igcmg/svn/modipsl/trunk MY_ORCHIDEE

You can install a public or a private version of ORCHIDEE. Read more about installing different versions of ORCHIDEE. To install the latest tagged version :

      > cd MY_ORCHIDEE/util
      > ./model ORCHIDEE_TAG

Create makefiles with the specific target for compiler gfortran, first modify if necessary the path to netcdf :

    > vi AA_make.gdef   # modify eventually following lines
            #-Q- gfortran  NCDF_INC = /usr/local/include
            #-Q- gfortran  NCDF_LIB = -L/usr/local/lib -lnetcdf
    > ./ins_make -t gfortran

Then compile the modele :

   >  cd ../modeles/ORCHIDEE_OL
   >  make; make teststomate; make forcesoil

If you extracted the trunk version of ORCHIDEE and all versions containing ORCHIDEE/src_driver directory, then compile as follow :

   >  cd ../modeles/ORCHIDEE
   >  make driver

CONGRATULATIONS, it's done !

3. Installing ORCHIDEE on a MAC (thanks to Matthew McGrath?)

You can install ORCHIDEE on a Mac if you modify AA_make.gdef file in the following way :

#-Q- Darwin   NCDF_INC = /Users/mcgrathlib/netcdf-3.6.3/f90
#-Q- Darwin   NCDF_LIB = -L/Users/mcgrath/lib/netcdf-3.6.3/libsrc/.libs/ -lnetcdf 

You have to indicate the correct path to your netcdf library like Matthew did. Then execute the script ins_make like that :

./inst_make -t Darwin