2 |
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
|
|
|
99 |
.B - MEAN
|
|
|
100 |
take the mean over the selected times: e.g.
|
|
|
101 |
.B GT:RH(MEAN):70:ALL
|
|
|
102 |
selects all trajectories for which the mean relative humidity (RH) over all times (ALL) is greater than 70 %.
|
|
|
103 |
.TP 5
|
|
|
104 |
.B - VAR
|
|
|
105 |
take the variance over the selected times: e.g.
|
|
|
106 |
.B GT:lat(VAR):10:ALL
|
|
|
107 |
selects all trajectories for which the variance of latitude (lat) over all times (ALL) is greater than 10.
|
|
|
108 |
.TP 5
|
|
|
109 |
.B - MIN
|
|
|
110 |
take the minimum of the selected times: e.g.
|
|
|
111 |
.B LT:p(MIN):300:ALL
|
|
|
112 |
select all trajectories which have a minium pressure (p) less than 300 hPa over all times (ALL).
|
|
|
113 |
.TP 5
|
|
|
114 |
.B - MAX
|
|
|
115 |
take the maximum of the selected times: e.g.
|
|
|
116 |
.B LT:p(MAX):300:ALL
|
|
|
117 |
select all trajectories which have a maximum pressure (p) less than 300 hPa over all times (ALL).
|
|
|
118 |
.TP 5
|
|
|
119 |
.B - SUM
|
|
|
120 |
take the sum over the selected times: e.g.
|
|
|
121 |
.B GT:LHR(SUM):2:ALL
|
|
|
122 |
selects all trajectories for which the sum over all latent heating rates (LHR) over all times (ALL) is greater than 2 K.
|
|
|
123 |
.TP 5
|
|
|
124 |
.B - CHANGE
|
|
|
125 |
take change between two times: e.g.
|
|
|
126 |
.B GT:p(CHANGE):600:FIRST,LAST
|
|
|
127 |
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.
|
|
|
128 |
.TP 5
|
|
|
129 |
.B - DIFF
|
|
|
130 |
take difference between two times: e.g.
|
|
|
131 |
.B GT:p(DIFF):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 - corresponding to an ascending air stream. Correspondingly
|
|
|
133 |
.B GT:p(DIFF):600:LAST,FIRST
|
|
|
134 |
finds a descending air stream.
|
|
|
135 |
.SH TIME MODE
|
|
|
136 |
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.
|
|
|
137 |
.TP 5
|
|
|
138 |
.B - FIRST
|
|
|
139 |
first time: e.g.
|
|
|
140 |
.B IN:lat:-20,20:FIRST
|
|
|
141 |
selects all trajectories with first latitude between 20 S to 20 N, i.e. wich start in an equatorial band.
|
|
|
142 |
.TP 5
|
|
|
143 |
.B - LAST
|
|
|
144 |
last time: e.g.
|
|
|
145 |
.B IN:lat:-20,20:LAST
|
|
|
146 |
selects all trajectories with last latitude between 20 S to 20 N, i.e. which end in an equatorial band.
|
|
|
147 |
.TP 5
|
|
|
148 |
.B - T1,T2,T3
|
|
|
149 |
an explict list of times: e.g.
|
|
|
150 |
.B IN:lat:-20,20:6,12
|
|
|
151 |
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).
|
|
|
152 |
.TP 5
|
|
|
153 |
.B - T1 to T2
|
|
|
154 |
a time range: e.g.
|
|
|
155 |
.B IN:lat:-20,20:6 to 18
|
|
|
156 |
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).
|
|
|
157 |
.TP 5
|
|
|
158 |
.B - ALL
|
|
|
159 |
all times: e.g.
|
|
|
160 |
.B IN:lat:-20,20:ALL
|
|
|
161 |
selects all trajectories which stay at all times in the equatorial band. This time mode is the same as
|
|
|
162 |
.B ALL(ALL),
|
|
|
163 |
i.e. all times are selected and the criterion must apply to all times. With
|
|
|
164 |
.B IN:lat:-20,20:12-24(ALL)
|
|
|
165 |
the criterion must apply for all times between 12 h and 24 h.
|
|
|
166 |
.TP 5
|
|
|
167 |
.B - ANY
|
|
|
168 |
any times: e.g.
|
|
|
169 |
.B IN:lat:-20,20:ALL(ANY)
|
|
|
170 |
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.
|
|
|
171 |
.TP 5
|
|
|
172 |
.B - NONE
|
|
|
173 |
at no time: e.g.
|
|
|
174 |
.B IN:lat:-20,20:ALL(NONE)
|
|
|
175 |
selects all trajectories which never stay in the equatorial band.
|
|
|
176 |
.B OUT:lat:-20,20:FIRST(NONE)
|
|
|
177 |
selects the trajectories which are not outside the equatorial time at the first time: they must be inside.
|
|
|
178 |
.TP 5
|
|
|
179 |
.B - TRIGGER
|
|
|
180 |
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
|
|
|
181 |
.B GT:p:700:1(TRIGGER)
|
|
|
182 |
would set the trigger 1 for all trajectory times where the pressure (p) is greater than 700 hPa. Similarly,
|
|
|
183 |
.B GT:p:800:1(TRIGGER) & GT:lat:50:2(TRIGGER)
|
|
|
184 |
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...
|
|
|
185 |
.SH LOGICAL OPERATORS
|
|
|
186 |
.TP 5
|
|
|
187 |
.B - &
|
|
|
188 |
logical and: e.g.
|
|
|
189 |
.B GT:lat:34:FIRST & GT:lon:50:FIRST
|
|
|
190 |
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 '&'.
|
|
|
191 |
.TP 5
|
|
|
192 |
.B - |
|
|
|
193 |
logical or: e.g.
|
|
|
194 |
.B GT:lat:34:FIRST | GT:lon:50:FIRST
|
|
|
195 |
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.
|
|
|
196 |
.SH IMPLICIT FIELDS
|
|
|
197 |
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.
|
|
|
198 |
.TP 5
|
|
|
199 |
.B - DIST
|
|
|
200 |
length of the trajectory (in km), integrated along great circle sections between the trajectory vertices: e.g.
|
|
|
201 |
.B GT:DIST:1000:LAST
|
|
|
202 |
tests whether the total path length of the trajectory (DIST) exceeds 1000 km.
|
|
|
203 |
.TP 5
|
|
|
204 |
.B - DIST0
|
|
|
205 |
distance of the trajectory (in km) from its starting position: e.g.
|
|
|
206 |
.B GT:DIST0:1000:18,24(ANY)
|
|
|
207 |
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.
|
|
|
208 |
.TP 5
|
|
|
209 |
.B - INPOLYGON
|
|
|
210 |
specification of a polygon: e.g.
|
|
|
211 |
.B TRUE:INPOLYGON:filename:ALL(ANY)
|
|
|
212 |
selects all trajectories which pass through the polygon specified in "filename". The polygon is specified as described in
|
|
|
213 |
.B create_startf
|
|
|
214 |
(see comments there). With
|
|
|
215 |
.B FALSE:INPOLYGON:filename:ALL(ALL)
|
|
|
216 |
all trajectories are selected which never pass through the polygon. Note that for every call of
|
|
|
217 |
.B select
|
|
|
218 |
only one polygon can be used in the criteria!
|
|
|
219 |
.TP 5
|
|
|
220 |
.B - INBOX
|
|
|
221 |
specification of a longitude/latitude rectangle <lonw,lone,lats,latn>: e.g.
|
|
|
222 |
.B TRUE:INBOX:20,40,30,60:ALL(ANY)
|
|
|
223 |
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
|
|
|
224 |
.B TRUE:INBOX:20,40,30,60:ALL(NONE)
|
|
|
225 |
the trajectories are selected which never pass through the rectangle.
|
|
|
226 |
.TP 5
|
|
|
227 |
.B - INCIRCLE
|
|
|
228 |
specification of circle around a specified point: e.g.
|
|
|
229 |
.B TRUE:INCIRCLE:40,50,500:LAST
|
|
|
230 |
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.
|
|
|
231 |
.TP 5
|
|
|
232 |
.B - INREGION
|
|
|
233 |
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
|
|
|
234 |
.B TRUE:INREGION:1:18
|
|
|
235 |
selects all trejactories which are within region 1 at time 18 h.
|
|
|
236 |
.SH SPECIAL CRITERIA
|
|
|
237 |
Special criteria are and can be implemented into
|
|
|
238 |
.B select.
|
|
|
239 |
The call to the special criteria is of the following form:
|
|
|
240 |
.B SPECIAL:command:parameters,
|
|
|
241 |
where "command" is a command string (e.g. WCB) and "parameters" is a list of parameter values.
|
|
|
242 |
.TP 5
|
|
|
243 |
.B - WCB
|
|
|
244 |
identification of Warm Conveyor Belts (WCB): e.g.
|
|
|
245 |
.B SPECIAL:WCB:300,0,24
|
|
|
246 |
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.
|
|
|
247 |
.SH TRIGGER FIELD
|
|
|
248 |
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 %
|
|
|
249 |
.B at the same times:
|
|
|
250 |
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,
|
|
|
251 |
.TP 5
|
|
|
252 |
.B GT:p:700:1(TRIGGER) & GT:RH:80:2(TRIGGER)
|
|
|
253 |
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).
|
|
|
254 |
.TP 5
|
|
|
255 |
.B ALL:TRIGGER:1,2:ALL(ANY)
|
|
|
256 |
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
|
|
|
257 |
.B ALL:TRIGGER:1,2:6,12(ALL).
|
|
|
258 |
.TP 5
|
|
|
259 |
.B ALL:TRIGGER:1,2:ALL(ANY)
|
|
|
260 |
will only check whether one of the two triggers 1 and 2 is set
|
|
|
261 |
.TP 5
|
|
|
262 |
.B NONE:TRIGGER:1,2:ALL(ANY)
|
|
|
263 |
will check whether none of the two triggers 1 and 2 is set
|
|
|
264 |
.SH IMPLEMENTING COMPLEX CRITERIA
|
|
|
265 |
New special criteria can easily be implemented into the code - to this aim the following steps must be taken:
|
|
|
266 |
.TP 5
|
|
|
267 |
.B [1] <special.f>
|
|
|
268 |
in directory "${LAGRANTO}/select/" must be modified. Take the example "WCB" to see how the Fortran code must be changed.
|
|
|
269 |
.TP 5
|
|
|
270 |
.B [2] <install.sh select>
|
|
|
271 |
must be invoked to recompile the program "select". For successful compilation, the executable "select" will be listed.
|
|
|
272 |
.TP 0
|
|
|
273 |
Type <select -special> to get a list of all special commands and a detailed description.
|
|
|
274 |
.SH EXAMPLES
|
|
|
275 |
.TP 5
|
|
|
276 |
.B [1] select trainp traout 'GT:PV:2:LAST'
|
|
|
277 |
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.
|
|
|
278 |
.TP 5
|
|
|
279 |
.B [2] select trainp traout 'IN:lat:-20,20:6,12'
|
|
|
280 |
selects all trajectories which are in the equatorial band at times 6 h and 12 h. The criterion must apply at both times.
|
|
|
281 |
.TP 5
|
|
|
282 |
.B [3] select trainp traout 'GT:lat:34:FIRST & GT:lon:50:FIRST'
|
|
|
283 |
selects the trajectories to the north of 34 N and to the east of 50 E at first
|
|
|
284 |
time. Several selection criteria can be combined with '&'.
|
|
|
285 |
.TP 5
|
|
|
286 |
.B [4] select trainp traout 'LT:p(MIN):300:ALL'
|
|
|
287 |
select all trajectories which have a minium pressure (p) less than 300 hPa over all times (ALL).
|
|
|
288 |
.SH AUTHOR
|
|
|
289 |
Written by Michael Sprenger and Heini Wernli (January 2011)
|