Versions Compared

Key

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

...

The GRIB file fc_pf.grib contains the 50 perturbed forecast member 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 to see how the ENS predicted the event. The computations will be done in Macro.

...

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

Since this Our GRIB contains several time steps we need to write a loop to (84, 90 and 96 hours, respectively)and we would like to compute the ensemble mean for each time step individuallyone separately. To achieve this we will write a loop going through the time steps. First, define the fieldset that will contain the resulting means:

Code Block
e_mean=nil

We will process the fields in a loop going through Next, add this piece of code for 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 50 members for the given timesteptime step

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

then compute their mean with the mean() macro function

Code Block
f = mean(f)

and add it to the resulting fieldset:

Code Block
e_mean = e_mean & f

We finish the macro by returning the resulting fieldset:

Code Block
return e_mean

By using the return statement our Macro behaves as if it were a fieldset (GRIB file). Drag it into the bottom left map and customise it with the wgust_shade Contouring icon and the title_mean Text Plotting icon. You will see that the ensemble mean hints that high wind speed can happen.

Filedset f now contains 50 fields. Next, compute the probability in as follows:

...

Next, we define the threshold for wind gust (in m/s units). We will store it in a variable:

...

Code Block
tsLst=[84,90,96]

loop step in tsLst

    ...your code will go here ...

end loop

Within the loop, simply read all the members for the given timestepNext, compute the probability in as follows:

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

then compute their mean with the mean() macro function

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

Here the first line turned set ech gridpoint hiegher value than val 1 and all the others zero, Last, add it to the resulting fieldset:

Code Block
e_meanprob = e_meanprob & f

We finish the macro by returning the resulting fieldset:

Code Block
return e_meanprob

By using the return statement our Macro behaves as if it were a fieldset (GRIB file). Drag it into the bottom left map and customise it with the wgustprob_shade Contouring icon and the title_mean prob Text Plotting icon. You will see that the ensemble mean hints that high wind speed can happen.

...