Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In this part of the exercise we will create the plot shown below:

Image Modified

In this plot each map contains the forecasts for the maximum 10 m wind gust in a 6-hour period from various model runs:

  • top left: the closest forecast to the event
  • top right: the forecast run 4 days before the event
  • bottom left: the ensemble mean for the ENS (Ensemble Prediction System)  ENS  forecast run 4 days before the event
  • bottom right: the ensemble spread for the ENS forecasts run 4 days before the event

...

The GRIB file fc_ens.grib contains the control forecast and the 50 perturbed and 1 control forecast member members of the ENS run at 7 August 00 TC (four days before the event). We will compute and visualise the mean of the ensemble members.

...

Our GRIB contains three time steps (84, 90 and 96 hours, respectively) and we would like to compute the ensemble mean for each one separately. To achieve this goal we will write a loop going through the time steps. First, define the fieldset that will contain the results:

Code Block
e_mean=nil

Next, add this piece of code to define the loop (we store the time steps in a list).:

Code Block
tsLst=[84,90,96]

loop step in tsLst

    ...your code will go here ...

end loop

Within the loop, first, read all the 51 ENS members for the given time step:

Code Block
f=read(data: g,
		step: step
	)	

Next, compute their mean with the mean() macro function:

Code Block
f = mean(f)

and Last, add it this field to the resulting fieldset:

...

The ensemble spread is the standard deviation of the ENS members. You can compute it in a very similar way to the ensemble mean. The only difference is that this time you need to use the stdev() function instead of mean(). Now it is your task to write a Macro for it. Once you finished your Macro drag it into the bottom right map and customise it with the wgust_spread_shade Contouring icon and with a custom Text Plotting icon. You will see that the ensemble spread is fairly high in the investigated area indicating that ...

Part 2: Checking the probabilities

In this part we will estimate the risk of the wind gust being higher than a certain thresholdsthreshold. We will compute the probability of the wind gust exceeding 22 m/s (that is really stormy weather≈ 80 k/m) and generate the plot shown below:

Image Modified

You can compute the probabilities with a Macro very similar Macro to the ones you wrote for the ensemble mean or and standard deviation. Basically you need to loop through time steps and for each time steps you need to derive a new field. The difference is that this time you need to compute a probability . Supposing that all the ENS members are stored in fieldset f and the threshold value in variable threshold the for each time step. Now it is your task to write a Macro and compute the probabilities. The computation should go like this:

Code Block
f=f > threshold	
f=100*mean(f)

Here we supposed that all the ENS members are stored in fieldset f and the threshold value in variable threshold. The first line performed performs a logical operation on the fieldset and resulted results in a new fieldset having 1s in each gridpoint where condition met meets (i.e. the value is larger than the threshold) and 0s in all other gridpoints. The Then the probability is simply the mean of these fields. We multiplied multiply the result by 100 to scale it into the 0-100 range for an easier interpretation.

Now it is your task to write a Macro and compute the probabilities. Once you finished your Macro drag it into the bottom right map and customise it with the wgustprob_spread_shade Contouring icon and with a custom Text Plotting icon. You will see that the ensemble spread is fairly high in the investigated area indicating that ...there is indeed a reasonable probability hinting for a wind storm.

Part 3: Creating a stamp plot

In this part we will look into investigate the individual ENS members and create a plot showing them all the ENS members for a given time step on the same page like this:

Image Modified

These plotsThis plot, for an obvious reason, are is called a stamp plotsplot. This a complex plot so we will write a Macro for to generate it.

Create a new Macro and edit it. Drop your Geographical View and the Coastlines icons into the Macro editor. Once the code is generated and tidied up define a 6x9 layout so that each plot should contain your view:

...

Next, drop your wgust_shade Contouring icon into the Macro editor and tidy up the generated code. We will apply this icon to all the fields in the stamp plot.

Continue with reading in the GRIB file with of the ENS forecasts in:

Code Block
g=read("fc_ens.grib")

...

Code Block
step = 90

The stamp plot spaghetti will be generated by plotting each perturbed forecasts forecast member into a separate map. So , so we need to write a loop like this:

...

Within the loop, simply read the current perturbed forecast members member for the given time step:

Code Block
f=read(data: g,
		number: number,
		type: "pf",
		step: step
	  )	

...

Next, define a title. The available space for the title in the plot will be is confined (we need to squeeze more than 50 maps into a page!) so the title should be short:

Code Block
title = mtext(text_line_1	 : "PF: " & number)

We finish Finish the loop by plotting the field into the right map in our layout:

Code Block
plot(dw[i],title,f,wgust_shade)

Run Having done so run your Macro (this will take a minute or so) and find try identify the ENS members forecasting predicting high wind speeds in our area of interest.

Part 4: Creating a spaghetti plot

We finish the exercise case study by looking into the predictability of the large scale flow pattern by generating spaghetti plots for 500 hPa geopotential from the same ENS run as we investigated before.  A In a spaghetti plot is composed by plotting each ENS member is rendered into the same map using a single contouring isoline value. The plot we want to generate is shown below (it contains the spaghetti plot for 500 hPa geopotential using the 560 gpm contouring isoline value):

Image Modified

This is a fairly complex plot and we will write a Macro to produce it.

...

Code Block
[40,-40,70,20]

so that our map could show a larger (North Atlantic) area).

Next, define the contouring used for the "spaghetti":

Code Block
cont = mcont(
	contour_label: "off",
	contour_level_selection_type	:	"level_list",
	contour_level_list	:	560,
	contour_line_colour: "blue",
	contour_highlight: "off"
 )

We In this mcont() we turned contour labels off so that keep the plot uncluttered and defined only a single contour value. 

The "spaghetti" will be generated by plotting each perturbed forecasts member as a separate layer into the plot. So same map. To achieve this goal we need to write a loop like this:

Code Block
for number=1 to 50 do 

    ...your code will go here ...

end loop

Within the loop, simply read all the perturbed forecast members for the all the time steps:

Code Block
f=read(data: g,
	type: "pf", 
	number: number
 )	

then Next, plot it into your view with your contour settings:

...

If you run this macro you will see that the "spaghetti" was properly generated but you have too many titles (one for each layer i.e. 50). To get rid of the extra titles you need to define a custom Text Plotting inside the loop and add it to your plot() command:

Code Block
title=mtext(text_line_1: "your custom title ....")

plot(your_view,f,cont,title)

The As for the custom title's text, the idea is that you should use the where statement inside the grib_info tag (as described here)  to have make the title appear for one member only.

Once you sorted the the title out visualise your plot again and animate through the steps to see how the little spaghetti is dispersing spreading out over time.

Extra Work

Try the following if you have time.

Add more fields to the stamp plot

The stamp plot only shows the perturbed ENS members but there is still space left to display additional fields, as well. Try to add the control forecast (from ENS) and the operational forecast to it.

...

Info

While setting up these extra plots it is a good idea to temporarily comment out the whole loop processing the perturbed forecasts forecast members.

Add more fields to the spaghetti plot

The spaghetti plot only shows the perturbed ENS members. Try to add the control forecast (from ENS) and the operational forecast to it using as well. You should use different isoline colours .for it

Hints:

  • plot the control forecast with a thick green isoline. The control forecast is stored in the same file as the perturbed forecast members: spag_ens.grib. To access it (via the read() function) you need to omit the number parameter and set type to "cf".
  • plot the operational  forecast with thick red isoline. The operational forecast is stored in spag_oper.grib. You just need to simply read it in with the read() command. 
Info

While setting up these extra layers it is a good idea to temporarily comment out the whole loop processing the perturbed forecasts members.