...
Info |
---|
In this exercise we will perform a backward simulation to compute the residence time of the particles reaching Inverness in Scotland. |
Running a backward simulation
The simulation itself is defined by the 'bwd_time' FLEXPART Run icon and the 'rel_inv' FLEXPART Release icon, respectively. Both these are encompassed in a single macro called 'bwd_time.mv'. For simplicity will use this macro to examine the settings in detail.
...
Code Block | ||
---|---|---|
| ||
rel_inv = flexpart_release( name : "INVERNESS", starting_date : 1, starting_time : 12, ending_date : 2, ending_time : 12, area : [57.44/-4.23/57.46/-4.21], top_level : 500, bottom_level : 0, particle_count : 10000, masses : 1 ) |
...
Here we defined both the input and output path paths and specified the simulation period, the output grid and levels as well. We also told FLEXPART to generate residence time fields on output.
If we run this macro (or alternatively right-click execute
the FLEXPART Run icon) the results (after a minute or so) will be available in folder 'result_bwd'. The computations actually took place in a temporary folder then Metview copied the results to the output folder. If we open this folder we will see one file heretwo files:
- time_s001.grib is a GRIB file containing the gridded residence time field
- log.txt is the logfile generated by FLEXPART
Plotting residence times
Step 1 - Residence time
In this step we will plot the residence time for a given level.
Inspecting the FLEXPART GRIB file
Before seeing the macro code to generate the plot we inspect the file itself we want to plot. Double-click on the 'time_s001.grib' GRIB icon' in folder 'result_bwd' to start up the Grib Examiner. We can see that this file contains the "fprt" (=Residence time) fields we want to visualise. We can find out further details about this parameter by setting the Dump mode to Namespace and Namespace to Parameter:
Generating the plot
The macro to visualise the residence time on a given level is 'plot_time_step1.mv'.
In the macro first we define the level (700 m) and the parameter ("fprt") we want to plot. Then we call the flexpart_filter() to extract the data for all the timesteps:
Code Block | ||
---|---|---|
| ||
dIn="result_fwd/" inFile=dIn & "conctime_s001.grib" lev=700 par="fprt" #Read fields on the given height level g=flexpart_filter(source: inFile, param: par, levType: "hl", level: lev) |
...
Having run the macro we will get a plot like this (after navigating to step -27h):
Step 2 - Total residence time in a layer
In this step we will plot the total residence time summed up for the bottom 500m layer.
The macro to use is 'plot_time_layerstep2.mv'. This macro is basically the same as the one in Step 1, but the data access and processing go like this:
...
Having run the macro we will get a plot like this (after navigating to step -27h):
Step 3 - Total residence time in the whole atmospheric column
Macro 'plot_time_totalstep3.mv' shows how to plot the total residence time for the whole atmospheric column. It goes exactly like Step 2 but we need to omit top_level
and bottom_level
in the flexpart_total_column() call:
...
Having run the macro we will get a plot like this (after navigating to step -27h):
Step 4 - Total residence time in a layer for the whole period
In this step we will plot the total residence time summed up for the whole period for the bottom 500m layer.
The macro to use is 'plot_time_layer_periodstep4.mv'. This macro is basically the same as the one in Step 2, but after calling flexpart_total_column() we call sum()
to sum up the fields over time:
...
Having run the macro we will get a plot like this:
Step 5 - Total residence time in the whole atmospheric column for the whole period
In this step we will plot the total residence time summed up for the whole period for the whole atmospheric column.
The macro to use is 'plot_time_total_periodstep5.mv'. This macro is basically the same as the one in Step 3, but after calling flexpart_total_column() we call sum()
to sum up the fields over time:
...