2. Installation

Next / Return

Compatibility

MCARaTS v0.10 works in UNIX or Linux-like environment. Source codes conform to the Fortran 90/95 standards. So they can be compiled with virtually any compiler that comforms to the standards.

Tested sets for v0.10.3 are as follows:

  • GFortran on Mac OS X with Quad-Core Intel Xeon

  • Intel Fortran compiler version 11 on Mac OS X

Older versions also worked under the following conditions, but not tested for MCARaTS v0.10:

  • GCC (GNU Compiler Collection) version 2.95 or higher

  • G95 (Fortran compiler), Cygwin, Windows

  • Intel Fortran Compiler version 9, Redhat Linux WS3 with Intel Xeon

  • Intel Fortran compiler version 10.1, SuSE Linux, SGI Altix4700

  • Fujitsu Fortran compiler version 3.0

  • UNIX on the HP (Compaq) AlphaServerSC with HP (Compaq) Fortran compiler

  • Mac OS X on an Apple PPC Macintosh with GCC version 3.2 or higher

  • SUN Solaris on a UltraSPARC workstation with SUN Fortran 77 version 4.2.1.

  • UNIX on SGI Origin2000 with SGI Fortran compiler.

Your reports about porting to the other type of computer system are welcome. Reports of computational speed are also welcome.

Unpacking

The softwares are archived to a tar-gzipped file. To unpack it at your local directory (e.g., $HOME/local/),

$ tar xzvf hparx-*.tar.gz

$ tar xzvf mcarats-*.tar.gz

then you will find a directories, hparx and mcarats-*, that include the source codes

Configuration

Several system-dependent variables for compiling with "make" tool should be configured before installation. Edit first a file:

hparx/Common.mk

mcarats-*/Common.mk

Compiler command and options and several system-dependent variables can be set in the above file. Particularly, install directory path and HPARX directory path should be properly set in "mcarats-*/Common.mk", which contains lines as the followings:

# - Install path

BINDIR = ${HOME}/local/bin

# - Library directory

LIB_DIR = ${HOME}/local/hparx

MCARaTS codes are linked to the HPARX static library (libhparx.a). Therefore, the HPARX directory path should be properly set.

Important note: Executable files will be installed (copied) in the install path, which should be correctly included in the user's command path ($PATH in the "~/.bashrc or ~/.bash_profile"). After install, executables can be run from any place.

Power users: Encapsulated real types

For power users, there are some advanced options for configuration before compiling. MCARaTS codes uses real types encapsulated in two global constants, R_ and RD_, defined in hparx/globals.f90, for ALL floating point variables and values. The precision of the types can be easily configured by editing two source files,

hparx/globals.f90

mcarats-*/src/globals_MPI.F90

It is very easy to modify real kinds, R_ and RD_. This affects ALL floating point variables and values used in ALL codes. Note that high precision real kinds requires more memory and could require more CPU time, depending on CPU architecture (e.g., for 32-bits architechture).

Parallelization

If you are building MPI-parallelized codes, you might need to edit the following files

mcarats-*/src/Common.mk

mcarats-*/src/Makefile

mcarats-*/src/inc_mpi.f90

for system-specific configuration of MPI libraries.

How to install

After the configuration as above, execute the following commands to build the executable files:

$ cd hparx

$ make

$ cd ../mcarats-0.10.3/src

$ make

$ make install

The last command install everything in the user's install path. The user should find executable files in the install directory if the installation is successful.

To build the parallelization codes, for example,

$ cd ../mcarats-0.10.3/src

$ make clean

$ make USE_MPI=1

$ make install USE_MPI=1 MPI_SFX=-mpi

$ cd ..

The mcarats code is parallelized with MPI. See corresponding Makefile for details.

Tests

It is highly recommended for users to test the codes for the example cases. The example data package is also distributed. In the package, a useful shell script is provided.

$ cd ./mcarats-examples-0.10.3

$ vi job_test

$ csh job_test

The results will be found with filenames, test_*. They can be compared with reference files, out_*. Using larger number of photons for simulation, you may get more accurate result that might be closer to the reference files. The number of photons are defined in the shell script. Note that the result will differ second by second, because the random number generator for Monte Carlo simulation is initialized with a time the user starts the simulation. Usages and functions of the codes are easily learned from the tests.

Also, recommended is a statistics comparison: Reference results in out_rs0067:

SZA(deg.)

0

60

Domain-mean radiance

4.8122E-01

3.6292E-01

Big endian?

Before running the above shell script for tests, you might have to check the default kind of endian. There are two types of endian, little and big endians. The binary data in examples in the mcarats package is encoded in little endian, which is compatible with Intel architechture. If your computer system assumes big endian, you might convert the binary data first. Fortunately, there are many useful tools to convert endian. They would be easily found on the web.

There is an easier method to test mcarats, which provides an option to convert the endian of input binary data within the code on the fly. See here (in Chapter 4) for that option.

Next / Return