NWP SAFAAPP Installation Guide |
Document ID: NWPSAF-MO-UD-005 Version: 7.3 Date: 01 June 2015 |
1. | Download the required AAPP files to your workstation |
2. |
Install any external
libraries that you may need |
3. | Configure the installation to suit your workstation |
4. | Build AAPP by runing "make" |
The "core" AAPP package can be installed without external
libraries; this will allow you to process NOAA and Metop HRPT data
through to level 1d (see Chapter 4). The simple steps to achieve
this core AAPP installation and to get started are described in
steps 3.1, 3.2
and 3.3. However, to obtain the full
functionality of AAPP it is necessary to install external
libraries and specify additional settings at the configuration
step. These installation details are described in section 3.4
onwards.
AAPP_7.x.tgz where x is a version identifier (e.g. AAPP_7.1.tgz)If you wish to run the test cases, or view any of the documentation then you should copy the relevant .tgz files (see list in Chapter 2). Each .tgz file creates its own subdirectory when unpacked.
Library |
Uses in AAPP |
Available from |
Install scripts |
Notes |
BUFRDC |
Encoding and decoding of AMSU, MHS, HIRS, IASI, ATMS and
CrIS datasets |
ECMWF |
./build_library ./install |
Fortran77 and C code. The build_library interactive script offers you a choice of compilers and installation location. Use the same compiler for AAPP. Environment variable BUFR_TABLES is needed at run time. EMOSLIB may be used as an alternative to BUFRDC. |
GRIB_API |
For reading NWP model fields. For the AVHRR cloud mask
(MAIA2.1 and MAIA3) the library is optional: if model
fields are not available then climatology will be used.
For the VIIRS cloud mask (MAIA4) the library is required. |
ECMWF |
./configure
[options] ./make |
Fortran77, Fortran90 and C code. Requires JasPer or OpenJPEG (see below). Specify Fortran compiler via environment variables, to be compatible with AAPP e.g. cd grib_api-1.9.9 export F77=ifort export FC=ifort ./configure --prefix=xxx \ --with-jasper=PATH_TO_JASPER [ or --with-openjpeg=PATH_TO_OPENJPEG ] |
JasPer |
jpeg2000 packing/unpacking. Used
by GRIB_API. |
University
of Victoria |
./configure
--prefix=yyy make make install |
|
OpenJPEG |
Alternative to JasPer. Used by GRIB_API. | Google
Code |
./configure
--prefix=yyy |
Note: if OpenJPEG is
installed on your system then GRIB_API will use it in
preference to JasPer. |
HDF5 |
Reading Sensor Data Record files for ATMS, CrIS, VIIRS,
MWHS, MWTS, IRAS. Reading IASI eigenvector files. |
The HDF group |
#For AIX: FCFLAGS="-qextname" export FCFLAGS ./configure [options] make make install |
Typical configure: ./configure --prefix=yyy \ --enable-fortran The Fortran interface is required if you wish to use MAIA4. It is not required for the other applications. You may also need (see below): Note for AIX xlf: By default, AAPP is built with the "-qextname" compiler flag; in which case you should use it for the hdf5 library also. |
SZIP and ZLIB |
May be used by HDF5. |
The
HDF group |
./configure
--prefix=zzz |
These libraries are not explicitly used by AAPP, but
they may be needed for your installation. |
To build the complete package you just need to do one of the following:
make
Two formats are available for the forecast file: ASCII and the standard meteorological format GRIB. To run AAPP with a GRIB forecast file, the ECMWF GRIB API library is needed - see section 3.4. You should also note that there is an environment variable FORECAST_FORMAT in ATOVS_ENV7: its default is "grib" in AAPP v7. You do not need to change any of the code or makefiles (unlike in versions of AAPP prior to v6). For MAIA3, the variable is called MAIA3_FORECAST_FORMAT. The format for the ASCII forecast files can be found in the AAPP data formats document.
Note that the GRIB API library handles both GRIB1 and GRIB2 files. The older GRIBEX library is no longer supported in AAPP.The location of the forecast files is determined by variables in ATOVS_ENV7. You may change them if needed:
3.8.3 Atlas and threshold
files for MAIA
3.9 HDF5
libraries
3.10 ECMWF
libraries
To install the ECMWF libraries, you should visit ECMWF
Software Services and download either BUFRDC or EMOSLIB. You may also need GRIB-API.
As a general rule, it is recommended to use the latest
release. Then install the required package(s) following the
ECMWF documentation. Please check that the compiler used when
building the ECMWF library is compatible with the compiler you
wish to use for AAPP. Note that the EMOS library requires a
Fortran 90 compiler whereas the BUFR library can be
compiled under Fortran 77. If
the default compiler is not suitable for your system you may be
able to use a different one by editing the appropriate file in
the config directory;
e.g. for Linux the file to edit is config/config.linux.in.
For example, typical commands to build and install the BUFR
library would be:
You should define an environment variable BUFR_TABLES pointing to the directory where the BUFR tables are installed. For other optional run-time environment variables applicable to the encoding program (e.g. originating centre and version numbers), please see the comments in the aapp_encodebufr_1c script.
The way that the ECMWF libraries handle BUFR tables has changed over the years. Prior to BUFR version 000320 the BUFR files were supplied as ASCII files but needed to be converted to binary before they could be used. In later versions of the software this conversion is unnecessary, it uses the ASCII files directly. EUMETSAT currently distribute MetOp BUFR data using Master Table 13; you will require tables B0000000000000013000.txt and D0000000000000013000.txt. Master Table 16 is used for NPP data. If the tables that you need are not already in the $BUFR_TABLES directory then you can create them as a link to existing files. BUFR tables are supplied with the AAPP test cases.
Some 64-bit machines may require additional compiler flags. If you are using a 64-bit HP machine, and version 000387 or earlier of the BUFR library, you should check whether the preprocessor flag JPBW_64 is being used:
It is possible to install the core AAPP and metop-tools on a PC running a Unix emulator. Note that the speed will in general not be as good as it would be on a native Linux operating system. Some notes on two commonly available emulators are given below. Some of these points may apply to other emulators also.
1. Microsoft Windows Services for Unix (SFU)
SFU can be installed as an add-on package for PCs running Windows 2000 or XP Professional. The current version is 3.5, available from http://www.microsoft.com/download/en/details.aspx?id=274. The advice in this section is based on the testing of AAPP v6 with SFU during 2006.
SFU includes a korn shell. It is recommended that you install all the SFU components. By default, SFU creates a HOME directory at "/dev/fs/C/Documents and Settings/username" - type "echo $HOME" to see this. The spaces in the directory name cause problems for some Unix scripts, so you should change it, e.g. by typing,
cd /dev/fs/C
mkdir aapp
export HOME=/dev/fs/C/aapp
The g77 compiler is included as part of SFU, so you may wish to configure AAPP for g77. (However, note that on one Met Office PC there was a problem with g77 - any compilation attempt failed with a segmentation fault in cc1; the reason for this is not clear).
2. Microsoft Subsystem for UNIX-based Applications (SUA)
SUA is part of the Windows operating system for Windows 7, Windows Server 2008 and Vista - see, for example, http://suacommunity.com/sua.aspx. AAPP v7 has not yet been tested on SUA.
3. Cygwin
Cygwin is available from http://www.cygwin.com/. As well as standard utilities, you need to install perl, a korn shell (pdksh.exe) and a suitable Fortran compiler. The following changes are needed:
AAPP_7/
ATOVS_ENV7
ATOVS_CONF
Makefile.ARCH
config/
AAPP/
bin/
man/
man1/
man3/
man5/
lib/
include/
src/
decommutation/
bin/
libdecom/
calibration/
libavhrcl/
libcal/
libhirscl_algoV4/
bin/
libmsucl/
libhirscl/
libamsuacl/
libamsubcl/
libmhscl/
navigation/
libsgp/
libbrolyd/
libtbus/
bin/
libephtrack/
libnavtool/
libnavnoaa/
libtle/
libspm/
libMSLIB77_V3.1/
preproc/
libatov
libatovpp
/libavh2hirs_maia_2.1
libatovin
/bin
libmappiasi
libmaia_2.1
tools/
libf7nl1b/
libf7cp/
libf7tp/
bin/
libf7gp/
libsatid/
libf7ml/
libaappbufr/
libaapphdf5/
libauxdeliverables/aapp/
libgribexdummy/
libbufrdummy/
maia3/
[from AAPP v6.12]
libmaia3
libmaia3_tools
bin
maia4/
[from AAPP v7.5]
libmaia4
libaapp_viirs
libmaia4_IO
bin
data/
calibration/
coef/
amsua/
amsub/
hirs/
msu/
avhcl/
mhs/
navigation/
preproc/
gmt/
metop-tools/
bin/
man/
lib/
include/
src/
bin/
libaapp_avhrrl1b/
libccsds/
libeps_common/
libeps_metopl0/
libmetop_amsua/
libmetop_avhrr/
libmetop_common/
libmetop_hirs/
libmetop_intex/
libmetop_mhs/
libobtutc/
libeps_avhrrl1b_6.5/
libmetop_admin/
iasi-tools/
bin/
man/
lib/
include/
src/
bin/
libcnes_iasi_brd_1.6/
libcnes_iasi_brd_1.7/
[from AAPP v6.12]
libcnes_iasi_odb_1.4/
libcnes_iasi_grd_1.6/
libcnes_iasi_grd_1.7/
[from AAPP v6.12]
libeps_iasil1c_6.6/
libeps_iasil1c_9.0/
[from AAPP v6.12]
libcnes_iasi_ctx_1.2/
In the run-time directory (if applicable) you will find:
${AAPP_PREFIX}/
ATOVS_ENV7
ATOVS_CONF
AAPP/
bin/
lib/
include/
data/
metop-tools/
bin/
lib/
include/
iasi-tools/
bin/
lib/
include/
${DIR_NAVIGATION}/tbus_db and/or ${DIR_NAVIGATION}/tle_db
(where DIR_NAVIGATION is defined in ATOVS_ENV7) and place your TBUS or TLE files in monthly subdirectories. In the case of TLE, the "get_tle" script does all this automatically, creating directories as required.
i) Check whether your installation was successful. Note that the error messages from the Fortran compilations might differ depending on the compiler you are using. Some compilation warnings are to be expected, but you should not see any actual errors. The "make" process will terminate early if there is an error.
ii) If you have customised the configuration file (e.g. are using a different compiler from those that are supported), it is advisable to run the tools det_ftnfort and det_reclen (both installed into AAPP/bin) to check that you have used the correct convention for Fortran file names and record length specifiers. These scripts will tell you what to do if the values need changing.
iii) For AAPP versions 1 to 4.3 it was necessary
to byte swap certain input files when running on a little-endian
machine. For version 4.4 onwards this is performed
automatically, but you should be aware that output files will
always be in the native byte order of the machine you are
running on (except BUFR output, which is character-oriented). If
you're not sure whether your machine is big or little endian,
type a command such as echo
01 | od -x . The result will be 3130
on a little-endian system and 3031
on a big-endian system.
iv) If your UNIX system does not have a Korn shell then you will need to adapt the various scripts (e.g. in directory AAPP/bin) to your shell type. Modify also accordingly the *.ksh scripts contained in subdirectories of AAPP/src in order not to lose the modifications when you rebuild AAPP in order to implement e.g. code modifications.
v) Add directory (destination directory)/AAPP/man/ to your MANPATH list to get access to the AAPP manual pages by e.g. adding to your .profile
MANPATH=(destination directory)/AAPP/man:$MANPATHThe man pages are contained in the subdirectories man1/, man3/ and man5/ of directory (dest.-dir.)/AAPP/man. You can display the man pages in the usual way by typing at your shell prompt
man filename (without .suffix).However, the definitive descriptions of the AAPP commands are given in the software description document, rather than the man pages. And not all commands have a man page.
vi) To allow you to call AAPP scripts and binaries directly, it is recommended that you source the ATOVS_CONF file as part of your own setup, as described in section 3.7.
vii) Orbital prediction:Three orbital prediction methods are implemented in AAPP v6:
TBUS, Two-Line-Element (TLE) and a method referred to as the
"SPOT model". The SPOT model is applicable to Metop-A only;
it is being phased out and will not be used for Metop-B or C.
TLE is recommended as an alternative to TBUS since the accuracy
is usually better. The data may be downloaded from the Space-Track web site using
AAPP script get_tle, or alternatively from Celestrak.
You will need to obtain a user name and password for the
Space-Track site, which should be entered in ATOVS_ENV7
under parameters PAR_NAVIGATION_TLE_USER and
PAR_NAVIGATION_TLE_PASSWD. This assumes that the computer on
which you run AAPP has internet access; if it does not then you
will need to download the files using a different computer and
transfer them.
To choose which method to use for a given satellite, just
modify the ATOVS_ENV7 variable PAR_NAVIGATION_LISTEBUL. In AAPP
v6.12 and v7.1 the default is set to:
PAR_NAVIGATION_DEFAULT_LISTESAT='noaa19 noaa18 noaa17 noaa16 noaa15 M04 M02 M01'AAPP will use TBUS bulletins for satellites for which "tbus" is specified, TLE for satellites with "tle" and SPOT for satellites with "spm". These parameters are used by commands AAPP_RUN_NOAA, AAPP_RUN_METOP, alleph, amsuacl, amsubcl, hirscl, mhscl and avhrcl. These programs are not applicable to the NPP satellite, and therefore NPP is not included in the PAR_NAVIGATION_DEFAULT_LISTESAT list. But you can generate satpos files for NPP in the usual way, by running tleing -s NPP and satpost -s NPP.
PAR_NAVIGATION_DEFAULT_LISTEBUL='tle tle tle tle tle tle tle tle'
export DIR_DATA_TLE=${DIR_NAVIGATION}/tle_db #directory to store data
export PAR_NAVIGATION_TLE_TIMEOUT=60 #connection timeout in seconds
export PAR_NAVIGATION_TLE_URL_DOWNLOAD='https://www.space-track.org'
export PAR_NAVIGATION_TLE_CATALOGUE='25338,26536,27453,28654,33591,37849,29499,38771,27431,32958,37214,25994,27424' #Catalogue numbers
export PAR_NAVIGATION_TLE_URL_LOGIN='https://www.space-track.org/perl/login.pl'; #URL for login (not used with new space-track site)
viii) Choice of HIRS calibration algorithm:
The HIRS calibration algorithm is selected by means of
environment variable HIRSCL_VERSION in ATOVS_ENV7. To
select the old algorithm, as used in AAPP v4 and earlier, set
the value to 0. To select the newer algorithm set it to 1. The
new algorithm accumulates data on calibrations runs from
previous passes, and is designed to give better consistency with
global data, especially for partial super-swaths. There are
various other parameters available for the new algorithm - see
comment lines in ATOVS_ENV7. If in doubt, use the default for
these.
ix) Locale
On some systems the unix "sort" command (which is used by several AAPP scripts) may give unexpected answers. You should check your locale settings (type locale): you should see LC_ALL=C or LANG=C (with LC_ALL undefined). If this is not the case, add LC_ALL=C to your shell startup script (or add it to ATOVS_ENV7).