3 |
michaesp |
1 |
.TH select
|
|
|
2 |
.SH NAME
|
|
|
3 |
.B select -
|
|
|
4 |
select trajectories
|
|
|
5 |
.SH SYNOPSIS
|
|
|
6 |
.B select
|
|
|
7 |
.I inptra
|
|
|
8 |
.I outtra
|
|
|
9 |
.I criterion
|
|
|
10 |
.SH DESCRIPTION
|
|
|
11 |
Select trajectories from the input trajectories in "inptra" based upon meteorological conditions specified in "criterion" (to be described below). The selected trajectories are then written to a new trajectory file "outtra".
|
|
|
12 |
.SH PARAMETERS
|
|
|
13 |
.TP 15
|
|
|
14 |
.I inptra
|
|
|
15 |
input trajectory file
|
|
|
16 |
.TP 15
|
|
|
17 |
.I outtra
|
|
|
18 |
output trajectory file
|
|
|
19 |
.TP 15
|
|
|
20 |
.I criterion
|
|
|
21 |
specification of the selection criterion; the specification is either an explicit criterion or a file containing the specification. Each selection criterion has the following form:
|
|
|
22 |
.br
|
|
|
23 |
.B COMMAND
|
|
|
24 |
:
|
|
|
25 |
.B FIELD
|
|
|
26 |
:
|
|
|
27 |
.B ARGUMENTS
|
|
|
28 |
:
|
|
|
29 |
.B [ TIME ].
|
|
|
30 |
.br
|
|
|
31 |
Several selection criteria can be combined with logical operator & (AND) and | (OR), the AND having higher priority than the OR.
|
|
|
32 |
.SH OPTIONAL ARGUMENTS
|
|
|
33 |
.TP 5
|
|
|
34 |
.I -noclean
|
|
|
35 |
keep temporary files for debugging.
|
|
|
36 |
.TP 5
|
|
|
37 |
.I -boolean
|
|
|
38 |
Write a boolean list (0/1) instead of a trajectory file; the file has #trajectories entries, each line corresponding to an input trajectory /1=trajectory selected, 0=not selected).
|
|
|
39 |
.TP 5
|
|
|
40 |
.I -index
|
|
|
41 |
Write an index list instead of a trajectory file: the index of all selected trajectories is written to the output file - the index ranges from 1 to #trajectories.
|
|
|
42 |
.TP 5
|
|
|
43 |
.I -count
|
|
|
44 |
Write only the number of selected trajectories to the output file.
|
|
|
45 |
.TP 5
|
|
|
46 |
.I -startf
|
|
|
47 |
Write only the starting positions of selected trajectories to the output file.
|
|
|
48 |
.TP 5
|
|
|
49 |
.I -regionf filename
|
|
|
50 |
change the region file from its default value "regionf" to a new file name: the syntax is "-regionf filename".
|
|
|
51 |
.SH COMMAND
|
|
|
52 |
.TP 5
|
|
|
53 |
.B - GT
|
|
|
54 |
greater than: e.g.
|
|
|
55 |
.B GT:PV:2
|
|
|
56 |
selects trajectories with first potential vorticity (PV) larger than 2 PVU.
|
|
|
57 |
.TP 5
|
|
|
58 |
.B - LT
|
|
|
59 |
less than: e.g.
|
|
|
60 |
.B LT:RH:70
|
|
|
61 |
selects trajectories with first relative humidity (RH) below 70 %.
|
|
|
62 |
.TP 5
|
|
|
63 |
.B - IN
|
|
|
64 |
within: e.g.
|
|
|
65 |
.B IN:lon:30,40
|
|
|
66 |
selects trajectories with first longitude between 30 and 40 deg.
|
|
|
67 |
.TP 5
|
|
|
68 |
.B - OUT
|
|
|
69 |
outside: e.g.
|
|
|
70 |
.B OUT:lat:-30,30
|
|
|
71 |
selects trajectories with first latitude outside -30 and 30 deg - neglecting an equatoriual/subtropical band.
|
|
|
72 |
.TP 5
|
|
|
73 |
.B - EQ
|
|
|
74 |
equal: e.g.
|
|
|
75 |
.B EQ:p:460
|
|
|
76 |
selects trajectories with first pressure equal to 460 hPa.
|
|
|
77 |
.TP 5
|
|
|
78 |
.B - TRUE
|
|
|
79 |
check whether value is different from zero (logical TRUE): e.g.
|
|
|
80 |
.B TRUE:CYCL::ALL(ANY)
|
|
|
81 |
checks whether the trajectory passes through a cycclone, which is marked as 0/1 field, at any time. Note that the command 'TRUE' has no arguments of its own!
|
|
|
82 |
.TP 5
|
|
|
83 |
.B - FALSE
|
|
|
84 |
check whether value is equal to zero (logical FALSE): e.g.
|
|
|
85 |
.B FALSE:CYCL::ALL(ALL)
|
|
|
86 |
checks whether the trajectory never passes through a cycclone, which is marked as 0/1 field. Note that the command 'TRUE' has no arguments of its own!
|
|
|
87 |
.TP 5
|
|
|
88 |
.B - ALL, ANY, NONE
|
|
|
89 |
these are special commands which only apply for the TRIGGER field. Further explanations are given below in section TRIGGER.
|
|
|
90 |
.SH FIELD
|
|
|
91 |
.TP 5
|
|
|
92 |
.B - VALUE
|
|
|
93 |
take value of the field: e.g.
|
|
|
94 |
.B GT:PV(VALUE):2
|
|
|
95 |
selects the trajectories with first potential vorticity (PV) value greater than 2 PVU. This selection criterion is equivalent to
|
|
|
96 |
.B GT:PV:2,
|
|
|
97 |
i.e. the VALUE argument is taken as default.
|
|
|
98 |
.TP 5
|
15 |
michaesp |
99 |
.B - ABS
|
|
|
100 |
take absolute value of the field: e.g.
|
|
|
101 |
.B GT:PV(ABS):2
|
|
|
102 |
selects the trajectories with absolute value of potential vorticity (PV) value greater than 2 PVU.
|
|
|
103 |
.TP 5
|
3 |
michaesp |
104 |
.B - MEAN
|
|
|
105 |
take the mean over the selected times: e.g.
|
|
|
106 |
.B GT:RH(MEAN):70:ALL
|
|
|
107 |
selects all trajectories for which the mean relative humidity (RH) over all times (ALL) is greater than 70 %.
|
|
|
108 |
.TP 5
|
|
|
109 |
.B - VAR
|
|
|
110 |
take the variance over the selected times: e.g.
|
|
|
111 |
.B GT:lat(VAR):10:ALL
|
|
|
112 |
selects all trajectories for which the variance of latitude (lat) over all times (ALL) is greater than 10.
|
|
|
113 |
.TP 5
|
|
|
114 |
.B - MIN
|
|
|
115 |
take the minimum of the selected times: e.g.
|
|
|
116 |
.B LT:p(MIN):300:ALL
|
|
|
117 |
select all trajectories which have a minium pressure (p) less than 300 hPa over all times (ALL).
|
|
|
118 |
.TP 5
|
|
|
119 |
.B - MAX
|
|
|
120 |
take the maximum of the selected times: e.g.
|
|
|
121 |
.B LT:p(MAX):300:ALL
|
|
|
122 |
select all trajectories which have a maximum pressure (p) less than 300 hPa over all times (ALL).
|
|
|
123 |
.TP 5
|
|
|
124 |
.B - SUM
|
|
|
125 |
take the sum over the selected times: e.g.
|
|
|
126 |
.B GT:LHR(SUM):2:ALL
|
|
|
127 |
selects all trajectories for which the sum over all latent heating rates (LHR) over all times (ALL) is greater than 2 K.
|
|
|
128 |
.TP 5
|
|
|
129 |
.B - CHANGE
|
|
|
130 |
take change between two times: e.g.
|
|
|
131 |
.B GT:p(CHANGE):600:FIRST,LAST
|
|
|
132 |
selects all trajectories wich have a pressure difference |p(FIRST)-p(LAST)| greater than 600 hPa between the first and last time or vice versa. Note that the change can be positive or negative, i.e. it is not clear whether it is ascent or descent.
|
|
|
133 |
.TP 5
|
|
|
134 |
.B - DIFF
|
|
|
135 |
take difference between two times: e.g.
|
|
|
136 |
.B GT:p(DIFF):600:FIRST,LAST
|
|
|
137 |
selects all trajectories wich have a pressure difference p(FIRST)-p(LAST) greater than 600 hPa between the first and last time - corresponding to an ascending air stream. Correspondingly
|
|
|
138 |
.B GT:p(DIFF):600:LAST,FIRST
|
|
|
139 |
finds a descending air stream.
|
|
|
140 |
.SH TIME MODE
|
|
|
141 |
The command are applied to a set of trajectory times; if no time is specified, the the command is only applied to the first time. Most generally, the time mode consists of two parts: time list( time mode), where the first specifies a list of times and the second how to apply the criterion to the selected times.
|
|
|
142 |
.TP 5
|
|
|
143 |
.B - FIRST
|
|
|
144 |
first time: e.g.
|
|
|
145 |
.B IN:lat:-20,20:FIRST
|
|
|
146 |
selects all trajectories with first latitude between 20 S to 20 N, i.e. wich start in an equatorial band.
|
|
|
147 |
.TP 5
|
|
|
148 |
.B - LAST
|
|
|
149 |
last time: e.g.
|
|
|
150 |
.B IN:lat:-20,20:LAST
|
|
|
151 |
selects all trajectories with last latitude between 20 S to 20 N, i.e. which end in an equatorial band.
|
|
|
152 |
.TP 5
|
|
|
153 |
.B - T1,T2,T3
|
|
|
154 |
an explict list of times: e.g.
|
|
|
155 |
.B IN:lat:-20,20:6,12
|
|
|
156 |
selects all trajectories which are in the equatorial band at times 6 h and 12 h. The criterion must apply at both times (see below ALL, ANY, NONE).
|
|
|
157 |
.TP 5
|
|
|
158 |
.B - T1 to T2
|
|
|
159 |
a time range: e.g.
|
|
|
160 |
.B IN:lat:-20,20:6 to 18
|
|
|
161 |
selects all trajectories which are in the equatorial band from 6 h to 18 h. The criterion must apply at all times between 6 h and 18 h (see below ALL, ANY, NONE).
|
|
|
162 |
.TP 5
|
|
|
163 |
.B - ALL
|
|
|
164 |
all times: e.g.
|
|
|
165 |
.B IN:lat:-20,20:ALL
|
|
|
166 |
selects all trajectories which stay at all times in the equatorial band. This time mode is the same as
|
|
|
167 |
.B ALL(ALL),
|
|
|
168 |
i.e. all times are selected and the criterion must apply to all times. With
|
|
|
169 |
.B IN:lat:-20,20:12-24(ALL)
|
|
|
170 |
the criterion must apply for all times between 12 h and 24 h.
|
|
|
171 |
.TP 5
|
|
|
172 |
.B - ANY
|
|
|
173 |
any times: e.g.
|
|
|
174 |
.B IN:lat:-20,20:ALL(ANY)
|
|
|
175 |
selects all trajectories which stay at any times in the equatorial band. Note that with the first "ALL" the times are selected, i.e. all times in this case, and with the second "ANY" it is specified that the criterion must only apply to at least one of the selected times.
|
|
|
176 |
.TP 5
|
|
|
177 |
.B - NONE
|
|
|
178 |
at no time: e.g.
|
|
|
179 |
.B IN:lat:-20,20:ALL(NONE)
|
|
|
180 |
selects all trajectories which never stay in the equatorial band.
|
|
|
181 |
.B OUT:lat:-20,20:FIRST(NONE)
|
|
|
182 |
selects the trajectories which are not outside the equatorial time at the first time: they must be inside.
|
|
|
183 |
.TP 5
|
|
|
184 |
.B - TRIGGER
|
|
|
185 |
the trajectory is automatically selected, but the trigger column is updated. A selection of trajectories might then e accomplished based on this trigger column: e.g
|
|
|
186 |
.B GT:p:700:1(TRIGGER)
|
|
|
187 |
would set the trigger 1 for all trajectory times where the pressure (p) is greater than 700 hPa. Similarly,
|
|
|
188 |
.B GT:p:800:1(TRIGGER) & GT:lat:50:2(TRIGGER)
|
|
|
189 |
would set the trigger 1 for all times where the pressure (p) is larger than 800 hPa and set the trigger 2 for all times where the latitude (lat) is larger than 50 degrees north. Note, that both eents might apply: then the rsulting trigger is 3. The triggers are internally saved as the bits of an integer variable, i.e. trigger 1 corresponds to value 1=2^0, trigger 2 to 2=2^1, trigger 3 to 4=2^2...
|
|
|
190 |
.SH LOGICAL OPERATORS
|
|
|
191 |
.TP 5
|
|
|
192 |
.B - &
|
|
|
193 |
logical and: e.g.
|
|
|
194 |
.B GT:lat:34:FIRST & GT:lon:50:FIRST
|
|
|
195 |
selects the trajectories to the north of 34 N and to the east of 50 E at first time. Several selection criteria can be combined with '&'.
|
|
|
196 |
.TP 5
|
|
|
197 |
.B - |
|
|
|
198 |
logical or: e.g.
|
|
|
199 |
.B GT:lat:34:FIRST | GT:lon:50:FIRST
|
|
|
200 |
selects the trajectories to the north of 34 N or to the east of 50 E at first time. Several selection criteria can be combined with '|'. Note that locical OR has a lower priority than logical AND, i.e. in an expression like T1 | T2 & T3 first the expression T2 & T3 is evaluated and only then logically OR-combined with T1.
|
|
|
201 |
.SH IMPLICIT FIELDS
|
|
|
202 |
Implicit variables can be used in the selection criteria, although they do not explicitely appear as a column in the trajectory file. They are calculated on-the-fly during the selection.
|
|
|
203 |
.TP 5
|
|
|
204 |
.B - DIST
|
|
|
205 |
length of the trajectory (in km), integrated along great circle sections between the trajectory vertices: e.g.
|
|
|
206 |
.B GT:DIST:1000:LAST
|
|
|
207 |
tests whether the total path length of the trajectory (DIST) exceeds 1000 km.
|
|
|
208 |
.TP 5
|
|
|
209 |
.B - DIST0
|
|
|
210 |
distance of the trajectory (in km) from its starting position: e.g.
|
|
|
211 |
.B GT:DIST0:1000:18,24(ANY)
|
|
|
212 |
tests whether the air parcel is more than 1000 km away from its starting position, either at time 18 h or at time 24 h.
|
|
|
213 |
.TP 5
|
|
|
214 |
.B - INPOLYGON
|
|
|
215 |
specification of a polygon: e.g.
|
|
|
216 |
.B TRUE:INPOLYGON:filename:ALL(ANY)
|
|
|
217 |
selects all trajectories which pass through the polygon specified in "filename". The polygon is specified as described in
|
|
|
218 |
.B create_startf
|
|
|
219 |
(see comments there). With
|
|
|
220 |
.B FALSE:INPOLYGON:filename:ALL(ALL)
|
|
|
221 |
all trajectories are selected which never pass through the polygon. Note that for every call of
|
|
|
222 |
.B select
|
|
|
223 |
only one polygon can be used in the criteria!
|
|
|
224 |
.TP 5
|
|
|
225 |
.B - INBOX
|
|
|
226 |
specification of a longitude/latitude rectangle <lonw,lone,lats,latn>: e.g.
|
|
|
227 |
.B TRUE:INBOX:20,40,30,60:ALL(ANY)
|
|
|
228 |
selects all trajectories which pass through the longitude/latitude rectangle with lower-left corner at 20 E / 30 N and the upper-right corner at 40 E / 60 N. Correspondingly, with
|
|
|
229 |
.B TRUE:INBOX:20,40,30,60:ALL(NONE)
|
|
|
230 |
the trajectories are selected which never pass through the rectangle.
|
|
|
231 |
.TP 5
|
|
|
232 |
.B - INCIRCLE
|
|
|
233 |
specification of circle around a specified point: e.g.
|
|
|
234 |
.B TRUE:INCIRCLE:40,50,500:LAST
|
|
|
235 |
select all trajectories which have their final position (LAST) in the circle centred at 40 E / 50 N and with a radius of 500 km.
|
|
|
236 |
.TP 5
|
|
|
237 |
.B - INREGION
|
|
|
238 |
specification of target regions in a region file (default "regionf") - please consider the documentation of "create_startf" for details concerning the format of the region file. As an example, if a region 1 is defined on the region file, the criterion
|
|
|
239 |
.B TRUE:INREGION:1:18
|
|
|
240 |
selects all trejactories which are within region 1 at time 18 h.
|
|
|
241 |
.SH SPECIAL CRITERIA
|
|
|
242 |
Special criteria are and can be implemented into
|
|
|
243 |
.B select.
|
|
|
244 |
The call to the special criteria is of the following form:
|
|
|
245 |
.B SPECIAL:command:parameters,
|
|
|
246 |
where "command" is a command string (e.g. WCB) and "parameters" is a list of parameter values.
|
|
|
247 |
.TP 5
|
|
|
248 |
.B - WCB
|
|
|
249 |
identification of Warm Conveyor Belts (WCB): e.g.
|
|
|
250 |
.B SPECIAL:WCB:300,0,24
|
|
|
251 |
selects trajectories which ascend more than 300 hPa between time 0 and 24 h. Note, the ascent is determined as min{p(0...24)}-p(0), i.e. the first pressure p(0) is fixed whereas the lowest pressure can occur at any time between 0...24 h.
|
|
|
252 |
.SH TRIGGER FIELD
|
|
|
253 |
A trigger (or flag) field can be defined in select. This special column of the trajectory file allows to mark specified events for each trajectory and its times. As an example, you would like to select all trajectories which are below 700 hPa at a certain time and have relative humidity above 80 %
|
|
|
254 |
.B at the same times:
|
|
|
255 |
Then you could set a first trigger for the pressure criterion and a second one for the relative humidity, and then you would check for the simultaneous occurence of the two triggers. More specifically,
|
|
|
256 |
.TP 5
|
|
|
257 |
.B GT:p:700:1(TRIGGER) & GT:RH:80:2(TRIGGER)
|
|
|
258 |
this will define the triggers for the two events. Note that both events might be fulfilled, in which case both triggers are set. The value of the trigger is: 1 if only the first criterion is fulfilled (binary 01); 2 if only the second is fulfilled (binary 10) and 3 if both are fulfilled (binary 11).
|
|
|
259 |
.TP 5
|
|
|
260 |
.B ALL:TRIGGER:1,2:ALL(ANY)
|
|
|
261 |
this will select all trajectories for which both triggers 1 and 2 are set - they can be set at any time of all the trajectory times; if, for instance, you would like to test whether the two triggers are set at the two times 6 and 12, the command would be
|
|
|
262 |
.B ALL:TRIGGER:1,2:6,12(ALL).
|
|
|
263 |
.TP 5
|
|
|
264 |
.B ALL:TRIGGER:1,2:ALL(ANY)
|
|
|
265 |
will only check whether one of the two triggers 1 and 2 is set
|
|
|
266 |
.TP 5
|
|
|
267 |
.B NONE:TRIGGER:1,2:ALL(ANY)
|
|
|
268 |
will check whether none of the two triggers 1 and 2 is set
|
|
|
269 |
.SH IMPLEMENTING COMPLEX CRITERIA
|
|
|
270 |
New special criteria can easily be implemented into the code - to this aim the following steps must be taken:
|
|
|
271 |
.TP 5
|
|
|
272 |
.B [1] <special.f>
|
|
|
273 |
in directory "${LAGRANTO}/select/" must be modified. Take the example "WCB" to see how the Fortran code must be changed.
|
|
|
274 |
.TP 5
|
|
|
275 |
.B [2] <install.sh select>
|
|
|
276 |
must be invoked to recompile the program "select". For successful compilation, the executable "select" will be listed.
|
|
|
277 |
.TP 0
|
|
|
278 |
Type <select -special> to get a list of all special commands and a detailed description.
|
|
|
279 |
.SH EXAMPLES
|
|
|
280 |
.TP 5
|
|
|
281 |
.B [1] select trainp traout 'GT:PV:2:LAST'
|
|
|
282 |
selects all trajectories with PV>2 PVU for the last time step. The input trajectories are given in trainp, the selected ones are written to traout. If the two filenames are the same, the input file is overwritten.
|
|
|
283 |
.TP 5
|
|
|
284 |
.B [2] select trainp traout 'IN:lat:-20,20:6,12'
|
|
|
285 |
selects all trajectories which are in the equatorial band at times 6 h and 12 h. The criterion must apply at both times.
|
|
|
286 |
.TP 5
|
|
|
287 |
.B [3] select trainp traout 'GT:lat:34:FIRST & GT:lon:50:FIRST'
|
|
|
288 |
selects the trajectories to the north of 34 N and to the east of 50 E at first
|
|
|
289 |
time. Several selection criteria can be combined with '&'.
|
|
|
290 |
.TP 5
|
|
|
291 |
.B [4] select trainp traout 'LT:p(MIN):300:ALL'
|
|
|
292 |
select all trajectories which have a minium pressure (p) less than 300 hPa over all times (ALL).
|
|
|
293 |
.SH AUTHOR
|
|
|
294 |
Written by Michael Sprenger and Heini Wernli (January 2011)
|