wiki:DevelopmentActivities/Branches/ORCHIDEE-MICT-IMBALANCE-P/Compile

Version 10 (modified by ajornet, 8 years ago) (diff)

--

How to compile MICT

Be aware there other ways to compile Orchidee. All of them are valid. But the use of makeorchidee_fcm should make things easier:

  • It enables the compilation with multiple cores at the same time.
  • No need to modify any file to change the compilation mode (prod/dev/debug).
  • Automatically manages all dependencies between files.

Libraries

Since MICT V7.2, XIOS 2 is enabled on MICT. This is a new library to manage the output for history files. It is recommended to use over the old one: IOIPSL. For several reason:

Compilation

There is an implicit step which depends in your architecture (computer). You need to make sure you have chosen the proper libraries (module load ...) to compile Orchidee.

IOIPSL

Go to IOIPSL source code folder

cd YOURPATH/modipsl/modeles/IOIPSL/src

Install all makefiles

../../util/ins_make

Go to the IOIPSL folder

cd ../IOIPSL/src

Modify the files shown below:

Index: histcom.f90
===================================================================
--- histcom.f90	(revision 2705)
+++ histcom.f90	(working copy)
@@ -73,7 +73,7 @@
 !-
 ! Fixed parameter
 !-
-  INTEGER,PARAMETER :: nb_files_max=20,nb_var_max=600, &
+  INTEGER,PARAMETER :: nb_files_max=20,nb_var_max=1400, &
  &                     nb_hax_max=5,nb_zax_max=10,nbopp_max=10
   REAL,PARAMETER :: missing_val=nf90_fill_real
   INTEGER,PARAMETER,PUBLIC :: &
Index: restcom.f90
===================================================================
--- restcom.f90	(revision 2705)
+++ restcom.f90	(working copy)
@@ -39,7 +39,7 @@
 ! the out file.
 !-
   INTEGER,PARAMETER :: &
- &  max_var=500, max_file=50, max_dim=NF90_MAX_VAR_DIMS
+ &  max_var=1000, max_file=50, max_dim=NF90_MAX_VAR_DIMS
 !-
   CHARACTER(LEN=9),SAVE :: calend_str='unknown'
 !-

Orchidee-MICT is using lots of variables. So it is necessary to tell IOIPSL increase the maximum allowed.

Compile IOIPSL

gmake 

At this point, chose

MICT + XIOS 2 (preferred since MICT v7.2)

More implicit steps: if you are moving for the first time XIOS. Make sure you update modipsl and libIGCM to the latest. Download XIOS again to make sure you are using the proper version.

In order to compile Orchidee MICT + XIOS2 + IOPSL, go to the model source code:

cd YOURPATH/modipsl/modeles/ORCHIDEE

Go to XIOS 2 folder

cd ../../XIOS

Compile XIOS 2

./make_xios --prod --arch SUPPORTED_MACHINE --full --j 8

Go to the models source code folder again

cd ../ORCHIDEE

Compile Orchidee

./makeorchidee_fcm  -parallel mpi -arch SUPPORTED_MACHINE -xios2 -driver -prod -full -otherexec -j 8

Replace -arch MACHINE with the machine you are working with. Find more information in makeorchidee_fcm -h command.

After that, when you do a modification you can simply run the command line below. So you avoid the whole recompilation from the code:

./makeorchidee_fcm  -parallel mpi -arch SUPPORTED_MACHINE -xios2 -driver -prod -otherexec -j 8

In some cases it might be necessary to recompile from zero.

MICT (before MICT v7.2)

In order to compile Orchidee MICT + IOIPSL:

Go to the models source code folder

cd ../../ORCHIDEE

Compile Orchidee

./makeorchidee_fcm  -parallel mpi -arch SUPPORTED_MACHINE -driver -prod -full -j 8

Replace -arch MACHINE with the machine you are working with. Find more information in makeorchidee_fcm -h command.

After that, when you do a modification you can simply run the command line below. So you avoid the whole recompilation from the code:

./makeorchidee_fcm  -parallel mpi -arch SUPPORTED_MACHINE -driver -prod -j 8

In some cases it might be necessary to recompile from zero.

Debug

If you need to debug use:

./makeorchidee_fcm  -parallel mpi -arch SUPPORTED_MACHINE (-xios2) -driver -debug -full -j (-otherexec) 8

Notes

  • the use of gmake produces an error due to dependencies. For this reason, it is only required to compile orchidee libraries (ioipsl, ...).
  • This guide expects you have selected the proper module libraries in the HPC you are working with.
  • There is a new option for makeorchidee_fcm called otherexec. It creates forcesoil.exe