source: flexpart.git/preproc/python/README.md @ ec9d8da

10.4.1_peseiFPv9.3.1FPv9.3.1b_testingFPv9.3.2GFS_025bugfixes+enhancementsdevfp9.3.1-20161214-nc4grib2nc4_repairrelease-10release-10.4.1scaling-bugunivie
Last change on this file since ec9d8da was ec9d8da, checked in by Anne Fouilloux <annefou@…>, 9 years ago

Add README.md for preproc directory

  • Property mode set to 100644
File size: 5.2 KB
Line 
1# README #
2
3This documentation shows how to use these python scripts to extract ECMWF ERA-Interim data and generate WINDFIELDS for running FLEXPART.
4
5### Overview ###
6
7To run FLEXPART with ECMWF ERA-Interim data, you first need to retrieve ECMWF ERA-Interim GRIB fields and generate FLEXPART WINDFIELDS to run FLEXPART.
8
9The two main programs are called respectively `getEIdata.py` and `prepareFLEXPART.py`.
10
11To get the usage of these programs, use `-h` option:
12
13`getEIdata.py -h`
14
15Optional arguments are mentionned in squared brackets.
16
17* `getEIdata.py`
18
19This program allows you to download ECMWF ERA-Interim data from ECMWF using [ecmwfapi](https://software.ecmwf.int/wiki/display/WEBAPI/ECMWF+Web+API+Home).
20It requires `ecmwfapi` python library (see Requirements below). Check with your local IT group as it may be already available.
21
22
23{{{
24Usage: getEIdata.py --start_date=YYYYMMDD [--end_date=YYYYMMDD] [--times=tt1/tt2/tt3] [--levels=nlevels]
25                                                  [--area=north/west/south/east]  [--outputdir=output_directory]
26
27Options:
28  -h, --help            show this help message and exit
29  --start_date=start_date
30                        start date YYYYMMDD
31  --end_date=end_date   end_date YYYYMMDD
32  --times=times         times such as 00/12
33  --levels=levels       number of vertical levels
34  --area=area           area defined as north/west/south/east with default
35                        90.0/-179.0/-90.0/180.0
36  --outputdir=outputdir
37                        root directory for storing output files
38}}}
39
40* `prepareFLEXPART.py`
41
42This program allow you to generate FLEXPART WINDFIELDS (inputs for FLEXPART). It requires python interface to grib_api and `CONVERT2` program (located in `src` directory with instruction on how to compile it). You also need to provide a namelist for CONVERT2 (see test_1).
43
44`
45Usage: prepareFLEXPART.py --start_date=YYYYMMDD [--end_date=YYYYMMDD] [--namelist=namelist_for_convert] [--inputdir=input_root_directory] [--outputdir=output_directory]
46
47Options:
48  -h, --help            show this help message and exit
49  --start_date=start_date
50                        start date YYYYMMDD
51  --end_date=end_date   end_date YYYYMMDD
52  --namelist=namelist   namelist used for converting
53  --inputdir=inputdir   root directory for reading input files
54  --outputdir=outputdir
55                        root directory for storing output files
56
57`
58### Requirements ###
59
60| Python Support        |
61|----------------------:|
62| python                | [http://www.python.org](http://www.python.org)  | We have use [python Anaconda](https://store.continuum.io/cshop/anaconda/) for our testings
63| python-numpy          | [http://www.numpy.org/](http://www.numpy.org/)  | Not necessary if you have installed python Anaconda
64| ecmwfapi              | [https://software.ecmwf.int/wiki/display/WEBAPI/ECMWF+Web+API+Home](https://software.ecmwf.int/wiki/display/WEBAPI/ECMWF+Web+API+Home) | You also need to install your API key (as explained in the documentation)
65| Utilities             |
66|----------------------:|
67|  grib-api             | [https://software.ecmwf.int/wiki/display/GRIB/Home](https://software.ecmwf.int/wiki/display/GRIB/Home) | Make sure you install GRIB-API with JPEG support and python GRIB-API.
68|----------------------:|
69| FLEXPART programs     | to run these programs (prepareFLEXPART.py), you need to compile CONVERT2 program (located in preproc/src). See separate README file to get instructions on how to compile this code.
70|----------------------:|
71
72
73### Installation ###
74
75*  Environment
76
77At UIO, Red Hat 6 Linux systems (64 bits) were used for testing. We use the [Module package](http://modules.sourceforge.net/) to set-up user environment.
78
79* Getting the source code
80In the directory of your choice:
81
82`
83git clone git@bitbucket.org:flexpart/flexpart.git
84`
85This command will create a subdirectory called flexpart: it contains the latest FLEXPART version.
86
87Set then environment variable `FLEXPART_HOME`:
88
89** Korn-shell or Bash users:
90`
91cd flexpart
92export FLEXPART_HOME=$PWD
93`
94
95** C-shell users:
96
97`
98cd flexpart
99setenv FLEXPART_HOME=$PWD
100`
101
102* Installation
103
104Make sure your first generate `CONVERT2` program (see separate instructions in `preproc/src`).
105
106Users need to be able to execute prepareFLEXPART.py and getEIdata.py so make sure they have the correct unix permissions:
107
108`
109cd preproc/python
110chmod uog+rx getEIdata.py prepareFLEXPART.py
111`
112
113These two programs must be in the user PATH. At UIO this is done automatically when loading flexpart. If not, you would need to do the following:
114
115** Korn-shell or Bash users:
116`
117export PATH=$FLEXPART_HOME/preproc/python:$PATH
118`
119
120** C-shell users:
121
122`
123setenv PATH $FLEXPART_HOME/preproc/python:$PATH
124`
125
126Where `$FLEXPART_HOME` is the directory where FLEXPART
127
128* Testing your installation
129
130First check that grib-api python interface is correctly installed on your platform:
131`
132python
133>>> from gribapi import *
134>>>
135`
136Use `CTRL-D` to quit python.
137
138Then check that `ecmwfapi` is properly installed:
139`
140python
141>>> from ecmwfapi import *
142>>>
143`
144
145If the two previous tests were successful, you can run `tests/preproc` (See separate instructions in `tests/preproc`).
146
147If any of these two tests fail, this probably means that either `ecmwfapi` or `grib-api` have not been installed properly.
148
149Please report any problems.
150
151###  Installation FAQ ###
152
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG