Version 12 (modified by pmaugis, 5 years ago) (diff)


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

NOTE : If you have an account on LSCE, IDRIS or TGCC computers, please follow the procedure described here : HowTo/InstallingORCHIDEEBasic
NOTE : This guide is not updated to install with XIOS

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

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  man4      ncdump  nc_test   README
aclocal.m4  cxx4     examples  INSTALL     libsrc4  missing   ncgen   nc_test4  RELEASE_NOTES
compile       config.sub    COPYRIGHT     depcomp  f90       install-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
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. Notice you may need to add --enable-separate-fortran to generate the netcdff library.

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:          |
|                |
|                                                             |
| 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.         |
|                                 |

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 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

Adapt AA_make, recreate makefile and compile without XIOS : (read more about compilation here Documentation/UserGuide/CompileMethods)

   >  cd ../config/ORCHIDEE_OL
   >  vi AA_make # Edit the AA_make file to compile in sequential mode
   >  ../../util/ins_make -t gfortran
   >  gmake without_xios


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 :

./ins_make -t Darwin