Subversion Repositories lagranto.um

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 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 P :
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 -notimecheck
100
take the first time on the netCDF file - do no explicit test that the requested 
101
time is available on the file. This is particularly helpful if you have no write
102
 permission for the P files.
103
.SH ONLINE CALCULATIONS
104
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:
105
.TP 5
106
.B - TH
107
potential temperature (in K).
108
.TP 5
109
.B - RHO
110
density (in kg/m^-3).
111
.TP 5
112
.B - RH
113
relative humidity (in %).
114
.TP 5
115
.B - THE
116
equivalent-potential temperature (in K).
117
.TP 5
118
.B - LHR
119
latent heating rate (K per input time step, typically K/6h). 
120
.TP 5
121
.B - D[U,V,T,TH]DX
122
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). 
123
.TP 5
124
.B - D[U,V,T,TH]DY
125
horizontal derivative d[U,V,T,TH]/dy in south-north direction along pressure surfaces -meridional distance in m.  
126
.TP 5
127
.B - D[U,V,T,TH]DP
128
vertical derivative d[U,V,T,TH]/dp - pressure p in Pa.
129
.TP 5
130
.B - NSQ
131
squared Brunt-Vaisala frequence (in m^-2).
132
.TP 5
133
.B - RELVORT
134
relative vorticity (in s^-1) - RELVORT = DVDX - DUDY.
135
.TP 5
136
.B - ABSVORT
137
absolute vorticity (in s^-1) - ABSVORT = DVDX - DUDY + F, F being the Coriolis parameter.
138
.TP 5
139
.B - DIV
140
horizontal divergence of the velocity field (in s^-1) - DIV = DUDX + DVDY.
141
.TP 5
142
.B - DEF
143
horizontal deformation of the velocity field (in s^-1) - DEF = SQRT( ( DVDX + DUDY )^2 + (DUDX-DVDY)^2 ).
144
.TP 5
145
.B - PV
146
Ertel potential vorticity (in PVU) - PV = g * ( ABSVORT * DTHDP + DUDP * DTHDY - DVDP * DTHDX ).
147
.TP 5
148
.B - RI
149
Richardson number - RI = NSQ / (DUDP^2 + DVDP^2 ).
150
.TP 5
151
.B - TI
152
tubulence indicator according to Ellrod & Knapp - TI = DEF * SQRT( DUDP^2 + DVDP^2 ) * ( RHO * G).
153
.TP 5
154
.B - DIR
155
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. 
156
.TP 5
157
.B - DIST0
158
spherical distance (in km) from starting position.
159
.TP 5
160
.B - DIST
161
length of the trajectory (in km): integrated along great circle sections between the trajectory vertices.
162
.TP 5
163
.B - HEAD
164
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. 
165
.SH EXAMPLES
166
.TP 5
167
.B [1] /home/sprenger/lagranto/bin/trace TRAJECTORY.1 TRAJECTORY.1 -changet
168
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.
169
.TP 5
170
.B [2] trace INPTRA.1 OUTTRA.1 -f PV 1.
171
Trace PV (with scaling factor 1.) along the trajectories in trajectory file "INPTRA.1" and write a new trajectory file "OUTTRA.1".
172
.TP 5
173
.B [3] trace INPTRA.1 OUTTRA.1 -f PV:-100HPA 1.
174
As in example [2], but the PV is taken at a position 100 hPa higher (lower pressure) than the air parcel's position.
175
.TP 5
176
.B [4] trace INPTRA.1 OUTTRA.1 -f DIST0 1.
177
Get the spherical distance (in km) of the air parcel from its starting position.
178
.SH AUTHOR
179
Written by Michael Sprenger and Heini Wernli (January 2011).