How download and install STILT

1.) Make a local STILT repository working directory like

    mkdir STILT_svn

2.) Retrieve a working copy of the svn STILT repository

    with svn from

    cd STILT_svn
    svn --username USER checkout 

    if you have no access to the repository please read the
    remarks in the registration part.

3.) Make a STILT Modelling working directory (e.g. STILT_modelling)

    in your home directory or to any directory where you have 
    write permission.

3.) Copy from your working copy of the repository the "stiltR"

    directory including all subdirectories in the
    created modelling working directory. 

    cp -R STILT_svn/trunk/stiltR STILT_modelling

4.) Copy from the "stiltR" subdirectory the file "" in

     the created STILT modelling working directory and set 
     the execution permission. 

     cp STILT_modelling/stiltR/ STILT_modelling
     chmod +x STILT_modelling/

5.) Run the script "". This script will create some

    sub-directories (Output, STILT_Exe) in the STILT modelling 
    working directory and will setup some files 

    The STILT Modelling working directory "must have" now:
     - a "stiltR" subdirectory or link containing the R part of STILT
     - Output subdirectory
     - STILT_Exe  subdirectory
     - "setStiltparam.r" with the STILT run parameters
     - ""
     - "stilt.qsub.csh"
     - 00README_copy.TXT - this contents of this file is not updated

6.) If not yet done, install R, also libraries "foreign" and "fields".

    [ Not required at Jena]
    You can read more about these libraries in the packages description
    in the list at:
    You have to install these libraries using the packages installation
    procedures for R, see at:

7.) Compile an executable "hymodelc" from the sources and Makefile in

    the "trunk/merged_stilt_hysplit/" directory of your working copy of
    the STILT repository. 
    [ At Jena login at galactica and choose the pgf90 compiler ]

    Move the "hymodelc" executable file in your STILT modelling 

8.) set environment variable R_LIBS to the RPackages path

    example in .bashrc : 

    export R_LIBS=/usr/local/apps/R/share/RPackages/

9.) Compile the R extensions in stiltR/shlib.

    For that, you need a compiled netCDF library with Fortran 90
    bindings. See for more info at : 

    Also make sure that your computing environment is set 
    up properly to run shared libraries; probably they refer themselfs
    to runtime libraries of the Fortran compiler and need to find them,
    which is often accomplished by setting some environment variables 
    (see the compiler manual). E.g. at Jena:
    Please source file /usr/local/etc/sources/Intel_fort.(c)sh (bash or
    csh) to set Fortran environment and libraries. 

    [At Jena there are already compiled versions under
    but these can be not the last version]

    [In STILT_svn/trunk/stiltR/shlib there is a shell script,
     which shows how you can compile the shared library with the
     Intel fortran compiler at Jena as an example ]

    Also set netCDF library path, e.g. 

    export LD_LIBRARY_PATH=/usr/local/apps/IntelF/lib:
$LD_LIBRARY_PATH To compile the R extension in stiltR/shlib run R and write within R: help(SHLIB) to see how this works. You have to compile all the f90-Files in stiltR/shlib See the example in help(SHLIB) in R how link the libaries in R. The output of the compiling process will be have the ".so" extension.

10.) Obtain meteorological data in ARL format

    Data sources:
        - some are on under
        - some are on under
          /Net/Groups/BSY/data/STILT_Metdata/ (ask Thomas Koch at Jena,

        - or create from wether forecasting model output 
          (RAMS, BRAMS, WRF, ECMWF) using e.g.
          RAMS2arl.exe (Ask chg or jcl or Thomas Nehrkorn at AER)

11.) set in "setStiltparam.r" in the STILT Modelling working directory

     the variables :
      rundir      (set this to ./STILT_Exe if needed)

12.) Start R, assign the pathname to the r script directory, and source

     all required scripts with sourceall.r
     Example:   sourcepath<-"~/STILT_modelling/stiltR/";

Additional remarks

13.) Only in case of mapping particles to flux grids:

        get boundary condition objects with lateral boundary condition 
        for each desired tracer
        (time dependent latitudinal cross sections) covering desired
         time period A selection of ASCII files are on  in /group/stilt/Boundary/
        Example: use function (from script
                      pathin="/group/stilt/Boundary/",pathout="~/Rdat/") reads
        -- ASCII files with 4 columns: agl lat co2m sasdate,
           i.e. altitude (in m), lat (in DEG N), co2 (in ppm), day
          (since 1/1/1960)
        Details see in "read.bground.r" or below under 'DIRECTORY

14.) Only in case of mapping particles to flux grids AND not running on

        get surface flux grids (dumpfile vegflux.dmp),
        regrid into varying resolution (for dynamic aggregation)
        -- run script gen_veg_mat.r in R, before need to assign vegpath 
           (e.,g. vegpath<-"/group/stilt/Vegetation/")
        -- quit R without saving: q(save="no")

15.) we have now added a directory merged_stilt_hysplit which

     generates the new hymodelc executable proegram 
     (see News from 1. march 2010 and ask Thomas Nehrkorn
      tnehrkorn[at] for more details.

     A makefile is available in the merged_stilt_hysplit directory