...
With these settings we specified the trajectory type to be three-dimensional (see below for the list of IDs for trajectory types) and set the starting point to volcano Katla (on Iceland) with the height of 1512m.
Remarks
Tip | ||
---|---|---|
| ||
The format of parameters holding dates is yyyymmdd. Any dates having less than 8 digits are interpreted as relative dates. E.g, -1 = yesterday, 0 = today, 1 = tomorrow etc. The format of parameters holdings times is hh:mm:ss with the following rules:
Parameters Flextra Trajectory Length, Flextra Starting Time Interval and Flextra Output Interval Value have the format of hhh:mm:ss. The following rules apply:
|
Info |
---|
We set the trajectory type by its ID. The possible values are as follows:
The level units were also given by an ID. The possible values are as follows:
|
Parameter Flextra Output Interval Mode controls how the trajectory points are written out into the output file. It can have three values:
...
We only specified one starting point but in Part 11 in the chapter on multiple_outputs we will see how to work with multiple starting points for a NORMAL run.
...
Key | Description | Return value |
---|---|---|
date | Date. | list of dates |
eta | Model level. | vector |
lat | Latitude. | vector |
lon | Longitude. | vector |
pres | Pressure. | vector |
pv | Potential vorticity. | vector |
startDate | Date of starting point. | string |
startEta | Model level of starting point. | string |
startLat | Latitude of starting point. | string |
startLon | Longitude of starting point. | string |
startPres | Pressure of starting point. | string |
startPv | Potential vorticity of starting point. | string |
startTheta | Potential temperature of starting point. | string |
startTime | Time of starting point. | string |
startZ | Height (above sea) of starting point | string |
startZAboveGround | Height (above ground) of starting point | string |
stopIndex | Stop index of computations. | string |
theta | Potential temperature. | vector |
z | Height above sea level. | vector |
zAboveGroundLevel | Height above ground level. | vector |
Anchor | ||||
---|---|---|---|---|
|
In this exercise we will see how to deal with multiple output files generated in a single FLEXTRA run. Please open folder 'multi' in folder 'flextra_tutorial' to start the work.
...
With these settings we specified the trajectory type to be three-dimensional (see below for the list of IDs for trajectory types) and set the starting point to volcano Katla (on Iceland) with the height of 1512m.
Remarks
The format of parameters holding dates is yyyymmdd. Any dates having less than 8 digits are interpreted as relative dates. E.g, -1 = yesterday, 0 = today, 1 = tomorrow etc.
...
Key | Description | Return value |
---|---|---|
date | Date. | list of dates |
eta | Model level. | vector |
lat | Latitude. | vector |
lon | Longitude. | vector |
pres | Pressure. | vector |
pv | Potential vorticity. | vector |
startDate | Date of starting point. | string |
startEta | Model level of starting point. | string |
startLat | Latitude of starting point. | string |
startLon | Longitude of starting point. | string |
startPres | Pressure of starting point. | string |
startPv | Potential vorticity of starting point. | string |
startTheta | Potential temperature of starting point. | string |
startTime | Time of starting point. | string |
startZ | Height (above sea) of starting point | string |
startZAboveGround | Height (above ground) of starting point | string |
stopIndex | Stop index of computations. | string |
theta | Potential temperature. | vector |
z | Height above sea level. | vector |
zAboveGroundLevel | Height above ground level. | vector |
Multiple Outputs
In this exercise we will see how to deal with multiple output files generated in a single FLEXTRA run. Please open folder 'multi' in folder 'flextra_tutorial' to start the work.
...
Code Block |
---|
#Metview Macro flx=read("res_multi.txt") |
Now variable flx
holds all the data in our FLEXTRA output containing two groups of trajectories. We can use the []
operator to access a particular group in it. Keeping this in mind we will create two visualiser objects: one for the first group and another one for the second group.
...
We simply pass these objects to the plot() command:
Code Block |
---|
plot(plot_Katla, plot_Stromboli) |
...
Tip | ||
---|---|---|
When we worked with the FLEXTRA Visualiser icon we specified the index of the trajectory group to be visualised. This approach is working in macro as well. E.g. in our macro we could have written the code for volcano Stromboli as:
|
Data Access in Macro
In this example we will see how to access metadata and data from a FLEXTRA output file containing multiple trajectory groups.
...
Code Block |
---|
#Metview Macro flx=read("res_multi.txt") |
Now variable flx
holds all the data in our FLEXTRA output. First, we will find out the number of trajectory groups we have by using the count() function.
Code Block |
---|
num=count(flx) |
Now we will create a for
loop to go though all the trajectory groups and extract and print some data out of them:
...
Here we used the flextra_group_get() function to read the value for a list of metadata keys from the i-th trajectory group. Please note that just as in the previous step we specified the trajectory group by the []
operator.
In the next step we will read some data from the first trajectory of the second trajectory group (volcano Stromboli). It goes like this:
...
All the required fields, with one exception, can be retrieved from ECMWF's MARS archive. The only exception is the vertical velocity because FLEXTRA needs the following field for its computations:
Mathinline |
---|
\dot \eta \frac{\partial \eta}{\partial p} |
The problem with this product is that only is archived in MARS and the full product needs to be computed during the data preparation process.
...