Subversion Repositories lagranto.20cr

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 michaesp 1
.TH trace
2
.SH NAME
3
.B trace - trace meteorological fields along trajectories
4
.SH SYNOPSIS
5
.B trace
6
.I inpfile
7
.I outfile
8
[
9
.I optional arguments
10
]
11
.SH DESCRIPTION
12
Trace meteorological fields along the trajectories given in the input file 
13
.I inpfile
14
and write a new trajectory file
15
.I outfile
16
. The meteorological fields to trace are listed in a 
17
.I
18
tracing file 
19
(default: tracevars). Partly they can be computed "online" (see ONLINE CALCULATIONS below), normally they are availbale on the primary and secondary P and S files.
20
.SH PARAMETERS
21
.TP 15
22
.I inpfile
23
input trajectory file; the appendix determines the format (see
24
.B reformat 
25
for details).
26
.TP 15
27
.I  outfile
28
output trajectory file; the appendix determines the format (see
29
.B reformat 
30
for details).
31
.SH TRACING FILE
32
Normally the meteorological fields for tracing are listed in a file with name 
33
.B "tracevars". 
34
The name of the tracing file can be changed with the optional argument "-v" (see below). The format of the tracing file is as follows:
35
.br
36
.TP 5
37
Format
38
.I field[:shift]
39
.I scale
40
.I computation 
41
.I prefix  
42
.TP 5
43
Shifts (optional)
44
.B - field:+100km[lat] 
45
- get field at trajectory position + 100 km shifted to north. A shift to south is obtained with field:-100km[lat].
46
.br
47
.B - field:+100km[lon] 
48
- get field at trajectory position + 100 km shifted to east. A shift to west is obtained with field:-100km[lon].
49
.br
50
.B - field:+2[dlat] 
51
- get field at trajectory position + 2 grid spacings dlat shifted to north. A shift to south is obtained with field:-2[dlat].
52
.br 
53
.B - field:+2[dlon] 
54
- get field at trajectory position + 2 grid spacings dlon shifted to east. A shift to west is obtained with field:-2[dlon].
55
.br 
56
.B - field:+50hPa 
57
- get field at trajectory position + 50 hPa shifted in vertical. A shift to lower pressures is obtained with field:-50hPa.
58
.br 
59
.B - field:+1dp 
60
- get field at trajectory position + 1 grid spacing DP shifted in vertical. A shift to lower pressures is obtained with field:-1dp. Note that DP is not fixed but varies with height.
61
.br 
62
.B - field:+6h 
63
- get field at trajectory position, but 6 h in the future. Shifts to the past are poeeible with field:-6h. In addition to hours (h), the time shift can be specified in minutes (min).
64
.TP 5 
65
Examples
66
.B - TH 1. 0 S : 
67
trace potential temperature (TH), scale it with 1 (no scaling); it is available on the S file (no computation is needed: 0).
68
.br
69
.B - Q 1000. 0 P :
70
trace specific humidity (Q), scale it with 1000 to have g/kg; it is available on the P file (no computation is needed: 0).
71
.br
72
.B - RH 1. 1 * :
73
trace relative humidity (RH), no scaling is needed (1.); relative humidity is not available on either P or S file and must be computed (1). 
74
.br
75
.B - TH:100hPa 1. 0 S :
76
As in the first example, but now the potential temperature is taken 100 hPa below the air parcel position.
77
.SH OPTIONAL ARGUMENTS
78
.TP 15
79
.TP 15
80
.I -i hours
81
time increments (in hours) for input P and  S files. If not explicitely specified, this is determined from the P and S files i
82
n the current directory.
83
.TP 15
84
.I -v varfile
85
Change the name of the tracing file from its default value "tracevars" to "varfile".
86
.TP 15
87
.I -f field scale
88
Trace field (with scaling scale) along the trajectories; the computation flag and the prefix for the data file is automatically set. This options allows the quick tracing of a field, without specifying a tracing file.
89
.TP 15
90
.I -changet
91
flag whether the times of the P and S files should be changed or not before a calculation; the default is that the
92
times are 
93
.B not 
94
changed. 
95
.TP 15
96
.I -noclean
97
flag whether parameter and criterion files should be kept; this is particularly helpful for debugging.
98
.TP 15
99
.I -timecheck
100
enforce a time check for the data file  
101
.SH SPECIAL INTERPOLATION MODES
102
.TP 15
103
.I -nearest
104
Do no interpolation between grid points; just take the nearest neighbor! This option is useful, if a discrete input field is given (e.g. labels), where interpolated values are meaningless.
105
.TP 15
106
.I -circle_avg radius
107
calculate area-weighted average over all grid points within a circle of the specified radius [km]. e.g. -circle_avg 200; note that the tracing of fields within a circle is quite slow.
108
.TP 15
109
.I -circle_max radius
110
calculate maximum within a circle of a radius [km]. e.g. -circle_max 200
111
.TP 15
112
.I -circle_min radius
113
calculate minimum within a circle of a radius [km]. e.g. -circle_min 200
114
.TP 15
115
.I -clustering
116
special mode to trace strat/trop label; the labels are attributed according to the program (tropopause), which clusters the atmosphere into five distinct classes according to the definition of the tropopause: PV (2 PVU) and potential temperature (380 K). The clustering mode is a refined version of the nearest mode, where all surrounding eight grid points vote for the final value.
117
.SH ONLINE CALCULATIONS
118
If the computation flag in the tracing file is set to 1, a meteorological field is calculated based upon the already traced fields and/or based on the fields on the primary and secondary P and S files. The following fields are implemented for online calculations:
119
.TP 5
120
.B - TH
121
potential temperature (in K).
122
.TP 5
123
.B - RHO
124
density (in kg/m^-3).
125
.TP 5
126
.B - RH
127
relative humidity (in %).
128
.TP 5
129
.B - THE
130
equivalent-potential temperature (in K).
131
.TP 5
132
.B - LHR
133
latent heating rate (K per input time step, typically K/6h). 
134
.TP 5
135
.B - D[U,V,T,TH]DX
136
horizontal derivative d[U,V,T,TH]/dx in west-east direction along pressure surfaces - zonal distance in m. U=zonal wind component (m/s), V=meridional wind component (m/s), T=temperature (deg C or K), TH=potential temperature (K). 
137
.TP 5
138
.B - D[U,V,T,TH]DY
139
horizontal derivative d[U,V,T,TH]/dy in south-north direction along pressure surfaces -meridional distance in m.  
140
.TP 5
141
.B - D[U,V,T,TH]DP
142
vertical derivative d[U,V,T,TH]/dp - pressure p in Pa.
143
.TP 5
144
.B - NSQ
145
squared Brunt-Vaisala frequence (in m^-2).
146
.TP 5
147
.B - RELVORT
148
relative vorticity (in s^-1) - RELVORT = DVDX - DUDY.
149
.TP 5
150
.B - ABSVORT
151
absolute vorticity (in s^-1) - ABSVORT = DVDX - DUDY + F, F being the Coriolis parameter.
152
.TP 5
153
.B - DIV
154
horizontal divergence of the velocity field (in s^-1) - DIV = DUDX + DVDY.
155
.TP 5
156
.B - DEF
157
horizontal deformation of the velocity field (in s^-1) - DEF = SQRT( ( DVDX + DUDY )^2 + (DUDX-DVDY)^2 ).
158
.TP 5
159
.B - PV
160
Ertel potential vorticity (in PVU) - PV = g * ( ABSVORT * DTHDP + DUDP * DTHDY - DVDP * DTHDX ).
161
.TP 5
162
.B - RI
163
Richardson number - RI = NSQ / (DUDP^2 + DVDP^2 ).
164
.TP 5
165
.B - TI
166
tubulence indicator according to Ellrod & Knapp - TI = DEF * SQRT( DUDP^2 + DVDP^2 ) * ( RHO * G).
167
.TP 5
168
.B - DIR
169
wind direction relative to zonal flow: (U,V)=(1,1) -> 45 deg; (U,V)=(1,-1) -> -45 deg; (U,V)=(-1,-1) -> -135 deg; (U,V)=(-1,1) -> 135 deg. A westerly flow has 0 deg, a southerly flow 90 deg, and a northerly one -90 deg. 
170
.TP 5
171
.B - DIST0
172
spherical distance (in km) from starting position.
173
.TP 5
174
.B - DIST
175
length of the trajectory (in km): integrated along great circle sections between the trajectory vertices.
176
.TP 5
177
.B - HEAD
178
heading of the trajectory: (DX,DY)=(1,1) -> 45 deg; (DX,DY)=(1,-1) -> -45 deg; (DX,DY)=(-1,-1) -> -135 deg; (DX,DY)=(-1,1) -> 135 deg. A path increment to east has heading of 0 deg; to the north 90 deg; to the south -90 deg; and to the west -180 deg. 
179
.SH EXAMPLES
180
.TP 5
181
.B [1] trace TRAJECTORY.1 TRAJECTORY.1 -changet
182
Read the trajectory file TRAJECTORY.1, trace all fields in the file "tracevars" along the trajectories and overwrite the existing trajectory file. In preparation, all times on the P and S files are changed prior to the tracing.
183
.TP 5
184
.B [2] trace INPTRA.1 OUTTRA.1 -f PV 1.
185
Trace PV (with scaling factor 1.) along the trajectories in trajectory file "INPTRA.1" and write a new trajectory file "OUTTRA.1".
186
.TP 5
187
.B [3] trace INPTRA.1 OUTTRA.1 -f PV:-100HPA 1.
188
As in example [2], but the PV is taken at a position 100 hPa higher (lower pressure) than the air parcel's position.
189
.TP 5
190
.B [4] trace INPTRA.1 OUTTRA.1 -f DIST0 1.
191
Get the spherical distance (in km) of the air parcel from its starting position.
192
.SH AUTHOR
193
Written by Michael Sprenger and Heini Wernli (January 2011).