= How to install ORCHIDEE on an linux pc (Ubuntu or Fedora distribution) = 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 [[BR]] 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. 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].[[BR]] 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 }}} Then go to : {{{ > cd MY_ORCHIDEE/util }}} You can install a public version on your laptop. Execute : {{{ > ./model ORCHIDEE_TAG }}} If you are a developer of ORCHIDEE, you can download your own version with the script recup_my_ORCHIDEE (see SVN course for that). Nearly the end ! Edit AA_make.gdef and replace the following line by : {{{ #-Q- gfortran F_C = gfortran -c }}} by {{{ #-Q- gfortran F_C = gfortran -c -cpp }}} and execute the script called ins_make : {{{ > ./ins_make -t gfortran }}} Then go to modeles/ORCHIDEE_OL : {{{ > cd ../modeles/ORCHIDEE_OL }}} and finally compile : {{{ > make; make teststomate; make forcesoil }}} 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 }}}