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

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 5763793 was 5763793, checked in by Anne Fouilloux <annefou@…>, 9 years ago

Add pre-processing programs and examples. This is still under development!

  • 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`
23Usage: getEIdata.py --start_date=YYYYMMDD [--end_date=YYYYMMDD] [--times=tt1/tt2/tt3] [--levels=nlevels]
24                                                  [--area=north/west/south/east]  [--outputdir=output_directory]
25
26Options:
27  -h, --help            show this help message and exit
28  --start_date=start_date
29                        start date YYYYMMDD
30  --end_date=end_date   end_date YYYYMMDD
31  --times=times         times such as 00/12
32  --levels=levels       number of vertical levels
33  --area=area           area defined as north/west/south/east with default
34                        90.0/-179.0/-90.0/180.0
35  --outputdir=outputdir
36                        root directory for storing output files
37`
38
39* `prepareFLEXPART.py`
40
41This 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).
42
43`
44Usage: prepareFLEXPART.py --start_date=YYYYMMDD [--end_date=YYYYMMDD] [--namelist=namelist_for_convert] [--inputdir=input_root_directory] [--outputdir=output_directory]
45
46Options:
47  -h, --help            show this help message and exit
48  --start_date=start_date
49                        start date YYYYMMDD
50  --end_date=end_date   end_date YYYYMMDD
51  --namelist=namelist   namelist used for converting
52  --inputdir=inputdir   root directory for reading input files
53  --outputdir=outputdir
54                        root directory for storing output files
55
56`
57### Requirements ###
58
59| Python Support        |
60|----------------------:|
61| python                | [http://www.python.org](http://www.python.org)  | We have use [python Anaconda](https://store.continuum.io/cshop/anaconda/) for our testings
62| python-numpy          | [http://www.numpy.org/](http://www.numpy.org/)  | Not necessary if you have installed python Anaconda
63| 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)
64| Utilities             |
65|----------------------:|
66|  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.
67|----------------------:|
68| 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.
69|----------------------:|
70
71
72### Installation ###
73
74*  Environment
75
76At 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.
77
78* Getting the source code
79In the directory of your choice:
80
81`
82git clone git@bitbucket.org:flexpart/flexpart.git
83`
84This command will create a subdirectory called flexpart: it contains the latest FLEXPART version.
85
86Set then environment variable `FLEXPART_HOME`:
87
88** Korn-shell or Bash users:
89`
90cd flexpart
91export FLEXPART_HOME=$PWD
92`
93
94** C-shell users:
95
96`
97cd flexpart
98setenv FLEXPART_HOME=$PWD
99`
100
101* Installation
102
103Make sure your first generate `CONVERT2` program (see separate instructions in `preproc/src`).
104
105Users need to be able to execute prepareFLEXPART.py and getEIdata.py so make sure they have the correct unix permissions:
106
107`
108cd preproc/python
109chmod uog+rx getEIdata.py prepareFLEXPART.py
110`
111
112These 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:
113
114** Korn-shell or Bash users:
115`
116export PATH=$FLEXPART_HOME/preproc/python:$PATH
117`
118
119** C-shell users:
120
121`
122setenv PATH $FLEXPART_HOME/preproc/python:$PATH
123`
124
125Where `$FLEXPART_HOME` is the directory where FLEXPART
126
127* Testing your installation
128
129First check that grib-api python interface is correctly installed on your platform:
130`
131python
132>>> from gribapi import *
133>>>
134`
135Use `CTRL-D` to quit python.
136
137Then check that `ecmwfapi` is properly installed:
138`
139python
140>>> from ecmwfapi import *
141>>>
142`
143
144If the two previous tests were successful, you can run `tests/preproc` (See separate instructions in `tests/preproc`).
145
146If any of these two tests fail, this probably means that either `ecmwfapi` or `grib-api` have not been installed properly.
147
148Please report any problems.
149
150###  Installation FAQ ###
151
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG