1 Compiling OASIS3-MCT

OASIS3-MCT is a mixed MPI-OpenMP parallel code. Compiling OASIS3-MCT libraries can be done from the oasis3-MCT/util/make_dir directory with the makefile TopMakefileOasis3.

TopMakefileOasis3 includes the header file make.inc which should then point to (include) your own make.your_platform file. That file is specific to the hardware and compiling platform used.

Several header files are distributed with the release and can by used as a template to create a custom file for your machine. The root of the OASIS3-MCT tree can be anywhere, but it must be defined by the variable COUPLE. Similarly, the variable ARCHDIR defines the location of the compilation directory. Finally, the OASIS3-MCT library should be compiled with the same compilers and system software as any coupled model component using it. After successful compilation, resulting libraries are found in the directory in $ARCHDIR/lib while object and module files are found in $ARCHDIR/build-static and $ARCHDIR/build-shared.

OASIS3-MCT has historically created static libraries for use in Fortran source codes. However, C language bindings are now available, and python codes are now fully supported. Therefore, the OASIS3-MCT makefile TopMakefileOasis3 supports compilation of both static and shared libraries.

TopMakefileOasis3 has several targets including:

The names of the libraries produced are mct, mpeu, scrip, psmile.MPI1, and oasis.cbind with standard prefixes (lib) and suffixes (.a or .so).

The following targets have been used historically to compile OASIS3-MCT for Fortran codes and they are all still supported:

Log and error messages from compilation are normally saved in the directory /util/make_dir in the files COMP.log and COMP.err or similar. The TopMakefileOasis3 output will direct users to the compile output files.

To interface a component code with OASIS3-MCT and use the module mod_oasis (see section 2.2.1), it is required to include OASIS3-MCT modules from $ARCHDIR/include and link with appropriate libraries in $ARCHDIR/lib during the compilation and linking.

Exchange of coupling fields in single and double precision is now supported directly through the interface (see section 2.2.5). Single precision fields are converted to double precision fields internally and temporarily. For double precision coupling fields, there is no need to promote REAL variables to DOUBLE PRECISION at compilation; this is done automatically within the OASIS3-MCT library.