Compilation instructions on the IBM power 7 platform:
-----------------------------------------------------

First, set the compiler:

. s.ssmuse.dot Xlf13.108
. s.ssmuse.dot netcdf

(the second is optional)

Create a directory mydir
go to mydir
and extract the latest version of the code:

svn checkout svn://mrbsvn/assimilation/rttov/v10/trunk

Please note that a significant amount of free disk space
(55 MB) is necessary to compile the library.

Go to the directory  ./mydir/v10/trunk/build .
You can edit the Makefile.local to set the path to the netcdf library
(the netcdf library is necessary only to read the infrared land
emissivity atlases provided with RTTOV-10 which are not used
operationaly).

When it is done go to the ./mylib/v10/trunk/src directory
It is important to rename the file main/lapack.f
to main/lapack.f.bak if it is not already done
because if you keep this file a subset of the lapack library
will be part of the RTTOV library. It is generaly advised to use 
the lapack library provided with the system and not this one. This file
is necessary only for people who want to try RTTOV without a proper
installation of the lapack library.

Then you can run the perl script
../build/Makefile.PL
to generate the makefiles
Each time you modify the code, you will have to rerun
this script before the compilation
then launch the compilation with:
make lib ARCH=aix-cmc
It may take a while...
At the end, the rttov library files (.a) should appear in the
directory mydir/v10/trunk/lib:
librttov10.2.0_main.a
librttov10.2.0_mw_scatt_coef.a
librttov10.2.0_parallel.a
librttov10.2.0_coef_io.a
librttov10.2.0_other.a
librttov10.2.0_emis_atlas.a
librttov10.2.0_coef_io_789.a
librttov10.2.0_mw_scatt.a
librttov10.2.0_test.a
and the module files (.mod) in the directory mydir/v10/trunk/mod :
mod_cnrm_mw_atlas.mod
mod_iratlas.mod
mod_mie.mod
mod_mwatlas.mod
mod_rttov_emis_atlas.mod
mod_rttov_fastem3_coef.mod
mod_rttov_fastem5_coef.mod
mod_rttovscatt_test.mod
parkind1.mod
rttov_chain.mod
rttov_coef_io_mod.mod
rttov_const.mod
rttov_getoptions.mod
rttov_global.mod
rttov_integrate_mod.mod
rttov_lun.mod
rttov_test_k_mod.mod
rttov_types.mod
rttov_unix_env.mod
rttov_zutility.mod
yomhook.mod

If you want to modify flags and/or compiler
go to the directory mydir/v10/trunk/build/arch
Each small file corresponds to a platform/architecture.
It is straightforward to modify existing
architectures or to add new.
3 architecture files are of interest on the IBM platform:

aix-cmc:
is based on the flags used by r.compile by default
I did most of my tests on the IBM with this.
The "official" library for rttov10.2 is based on that.

aix-debug:
for debug purpose

aix-opt:
optimized version (provided by rttov-10 developpers)
not tried seriously
some subroutines have their own flags
should be evaluated.
could be a good replacement for aix-cmc

if you want to compile only the part of library used
in the operational codes:
you can do:

make main/lib coef_io/lib ARCH=aix-cmc

you will get only the library files

librttov10.2.0_coef_io.a
librttov10.2.0_main.a

and the module files

mod_rttov_fastem3_coef.mod
mod_rttov_fastem5_coef.mod
parkind1.mod
rttov_coef_io_mod.mod
rttov_const.mod
rttov_getoptions.mod
rttov_global.mod
rttov_integrate_mod.mod
rttov_types.mod
rttov_unix_env.mod
yomhook.mod


More technical details are given in the pdf file
docs/rttov-compile.pdf .

If you want to compile on another platform for example Linux,
you will have to change ARCH accordingly.
RTTOV-10 is reported to work with most Linux compilers.
(I tested it personally with success using pgf90 (not all versions work) and
gfortran )

Sylvain Heilliette.
20th December 2012.
