[gradsusr] SREF Model: Processing and plotting solutions. (which can also be applied to other models with problem variables)

Kevin M Levey klevey at customweather.com
Tue Nov 15 15:03:16 EST 2011


TUE 15NOV11: 1100PST

Dear GRDAS users.

A month or so back I posted to the group looking for a solution regarding processing the Short Range Ensemble Forecast (SREF) model for plotting in GRADS. SREF puts out three files for each forecast hour, a mean forecast, a spread of the forecast (forecast deviation) and a probability forecast of certain variables. 

PROBLEM: 

There were two problems: 

1] Unable to create a NETCDF version of the SREF probability  GRIB2 data file;
2] Unable to correctly obtain certain variables like ACPC for the correct forecast period wanted, esp. from the SREF Probability files;

The usual methodology in processing GRIB2 files is to use g2ctl.pl to create the needed GRADS CTL file and then gribmap which creates the IDX file. You then open the CTL file and plot whatever variable you want. Sometimes this method does not always work, but creating a NETCDF version of the GRIB2 file and then creating a CTL file from scratch will often solve any issues when you are not able to plot whatever variable you want using the usual method described above. 

Using wgrib2 version 0.1.9.4 I was able to create NETCDF versions of both the spread and mean SREF GRIB2 files, but NOT the probability file. The reason for this, is that the probability file has NETCDF "illegal" characters in the variable descriptions, and hence the netcdf conversion will not work for SREF probability files. You may ask why I was trying to create NETCDF versions of the SREF GRIB2 files in the first place. Simply, g2ctl.pl and then gribmap produces an error when processing the probability file with a "Product Definition Template 9 not handled" error message. Secondly, when trying to obtain the 6-hr probability of precipitation exceeding 0.25", the incorrect APCP variable was being processed by wgrib2.


SOLUTION: 

The solution to problem #1 was for an update of Wesley Ebisuzaki's wgrib2 binary to version 0.1.9.5 (he kindly provided me with a beta version, and the final version should be out shortly). Using wgrib2 version 0.1.9.5 (beta). I was able to create a NETCDF version of the probability file.

However, the solution to problem #2 was a lot more complicated. The methodology employed here can be used on any GRIB2 file where you run into the issue I had with the accumulation variable, APCP. 

Remember, I was only interested in obtaining the 6-hr probability of precipitation > 0.25", the mean and spread of every 6hr accumulation (ACPC). IF we do a wgrib2 inventory of the probability file, for example) this is what you will see the following using the command: 

wgrib2 -v 2011111503_sref.t03z.pgrb212.prob.grib2

So, for forecast hour 6, ACPC is listed many times - here, either probabilities for a 3hour period or a 6 hour period
....
242:1800525:d=2011111503:APCP Total Precipitation [prob]:surface:3-6 hour acc fcst:prob >0.25
243:1821138:d=2011111503:APCP Total Precipitation [prob]:surface:3-6 hour acc fcst:prob >1.27
244:1832550:d=2011111503:APCP Total Precipitation [prob]:surface:3-6 hour acc fcst:prob >2.54
245:1840100:d=2011111503:APCP Total Precipitation [prob]:surface:3-6 hour acc fcst:prob >6.35
246:1843358:d=2011111503:APCP Total Precipitation [prob]:surface:3-6 hour acc fcst:prob >12.7
247:1844941:d=2011111503:APCP Total Precipitation [prob]:surface:3-6 hour acc fcst:prob >25.4
248:1845759:d=2011111503:APCP Total Precipitation [prob]:surface:3-6 hour acc fcst:prob >38.1
249:1846340:d=2011111503:APCP Total Precipitation [prob]:surface:3-6 hour acc fcst:prob >50.8
250:1846894:d=2011111503:APCP Total Precipitation [prob]:surface:3-6 hour acc fcst:prob >101.6
251:1847335:d=2011111503:APCP Total Precipitation [prob]:surface:3-6 hour acc fcst:prob >152.4
252:1847562:d=2011111503:APCP Total Precipitation [prob]:surface:0-6 hour acc fcst:prob >0.25
253:1868867:d=2011111503:APCP Total Precipitation [prob]:surface:0-6 hour acc fcst:prob >1.27
254:1883986:d=2011111503:APCP Total Precipitation [prob]:surface:0-6 hour acc fcst:prob >2.54
255:1895223:d=2011111503:APCP Total Precipitation [prob]:surface:0-6 hour acc fcst:prob >6.35
256:1900772:d=2011111503:APCP Total Precipitation [prob]:surface:0-6 hour acc fcst:prob >12.7
257:1903296:d=2011111503:APCP Total Precipitation [prob]:surface:0-6 hour acc fcst:prob >25.4
258:1904447:d=2011111503:APCP Total Precipitation [prob]:surface:0-6 hour acc fcst:prob >38.1
259:1905268:d=2011111503:APCP Total Precipitation [prob]:surface:0-6 hour acc fcst:prob >50.8
260:1905924:d=2011111503:APCP Total Precipitation [prob]:surface:0-6 hour acc fcst:prob >101.6
261:1906365:d=2011111503:APCP Total Precipitation [prob]:surface:0-6 hour acc fcst:prob >152.4
....

IDS #245 and #255 are named the same, but I am only interested in #255 and although the NETCDF file now has the correct variable: 

ncdump -h 2011111503_sref.t03z.pgrb212.prob.nc

....
 float APCP_GT_6_35_surface(time, y, x) ;
                APCP_GT_6_35_surface:_FillValue = 9.999e+20f ;
                APCP_GT_6_35_surface:short_name = "APCP_GT_6_35_surface" ;
                APCP_GT_6_35_surface:long_name = "Total Precipitation" ;
                APCP_GT_6_35_surface:level = "surface" ;
                APCP_GT_6_35_surface:units = "1" ;
                APCP_GT_6_35_surface:coordinates = "longitude latitude" ;
....


it will only refer to the last ID. So, in the above example, that is fine, but not for forecast hour 87 where the NETCDF variable APCP_GT_6_35_surface will refer to ID #4327 (which is for a 24-hour period)

4294:25985716:d=2011111503:APCP Total Precipitation [prob]:surface:84-87 hour acc fcst:prob >0.25
4295:26005383:d=2011111503:APCP Total Precipitation [prob]:surface:84-87 hour acc fcst:prob >1.27
4296:26017159:d=2011111503:APCP Total Precipitation [prob]:surface:84-87 hour acc fcst:prob >2.54
4297:26024955:d=2011111503:APCP Total Precipitation [prob]:surface:84-87 hour acc fcst:prob >6.35
4298:26027680:d=2011111503:APCP Total Precipitation [prob]:surface:84-87 hour acc fcst:prob >12.7
4299:26028535:d=2011111503:APCP Total Precipitation [prob]:surface:84-87 hour acc fcst:prob >25.4
4300:26029106:d=2011111503:APCP Total Precipitation [prob]:surface:84-87 hour acc fcst:prob >38.1
4301:26029623:d=2011111503:APCP Total Precipitation [prob]:surface:84-87 hour acc fcst:prob >50.8
4302:26030070:d=2011111503:APCP Total Precipitation [prob]:surface:84-87 hour acc fcst:prob >101.6
4303:26030297:d=2011111503:APCP Total Precipitation [prob]:surface:84-87 hour acc fcst:prob >152.4
4304:26030524:d=2011111503:APCP Total Precipitation [prob]:surface:81-87 hour acc fcst:prob >0.25
4305:26051662:d=2011111503:APCP Total Precipitation [prob]:surface:81-87 hour acc fcst:prob >1.27
4306:26066456:d=2011111503:APCP Total Precipitation [prob]:surface:81-87 hour acc fcst:prob >2.54
4307:26077756:d=2011111503:APCP Total Precipitation [prob]:surface:81-87 hour acc fcst:prob >6.35
4308:26083146:d=2011111503:APCP Total Precipitation [prob]:surface:81-87 hour acc fcst:prob >12.7
4309:26085315:d=2011111503:APCP Total Precipitation [prob]:surface:81-87 hour acc fcst:prob >25.4
4310:26086001:d=2011111503:APCP Total Precipitation [prob]:surface:81-87 hour acc fcst:prob >38.1
4311:26086609:d=2011111503:APCP Total Precipitation [prob]:surface:81-87 hour acc fcst:prob >50.8
4312:26087104:d=2011111503:APCP Total Precipitation [prob]:surface:81-87 hour acc fcst:prob >101.6
4313:26087331:d=2011111503:APCP Total Precipitation [prob]:surface:81-87 hour acc fcst:prob >152.4
4314:26087558:d=2011111503:APCP Total Precipitation [prob]:surface:75-87 hour acc fcst:prob >0.25
4315:26108993:d=2011111503:APCP Total Precipitation [prob]:surface:75-87 hour acc fcst:prob >1.27
4316:26126730:d=2011111503:APCP Total Precipitation [prob]:surface:75-87 hour acc fcst:prob >2.54
4317:26141510:d=2011111503:APCP Total Precipitation [prob]:surface:75-87 hour acc fcst:prob >6.35
4318:26150310:d=2011111503:APCP Total Precipitation [prob]:surface:75-87 hour acc fcst:prob >12.7
4319:26154665:d=2011111503:APCP Total Precipitation [prob]:surface:75-87 hour acc fcst:prob >25.4
4320:26156045:d=2011111503:APCP Total Precipitation [prob]:surface:75-87 hour acc fcst:prob >38.1
4321:26156806:d=2011111503:APCP Total Precipitation [prob]:surface:75-87 hour acc fcst:prob >50.8
4322:26157454:d=2011111503:APCP Total Precipitation [prob]:surface:75-87 hour acc fcst:prob >101.6
4323:26157933:d=2011111503:APCP Total Precipitation [prob]:surface:75-87 hour acc fcst:prob >152.4
4324:26158160:d=2011111503:APCP Total Precipitation [prob]:surface:63-87 hour acc fcst:prob >0.25
4325:26179375:d=2011111503:APCP Total Precipitation [prob]:surface:63-87 hour acc fcst:prob >1.27
4326:26199116:d=2011111503:APCP Total Precipitation [prob]:surface:63-87 hour acc fcst:prob >2.54
4327:26217303:d=2011111503:APCP Total Precipitation [prob]:surface:63-87 hour acc fcst:prob >6.35
4328:26230287:d=2011111503:APCP Total Precipitation [prob]:surface:63-87 hour acc fcst:prob >12.7
4329:26237718:d=2011111503:APCP Total Precipitation [prob]:surface:63-87 hour acc fcst:prob >25.4
4330:26241155:d=2011111503:APCP Total Precipitation [prob]:surface:63-87 hour acc fcst:prob >38.1
4331:26242981:d=2011111503:APCP Total Precipitation [prob]:surface:63-87 hour acc fcst:prob >50.8
4332:26244079:d=2011111503:APCP Total Precipitation [prob]:surface:63-87 hour acc fcst:prob >101.6
4333:26244587:d=2011111503:APCP Total Precipitation [prob]:surface:63-87 hour acc fcst:prob >152.4
I am ONLY interested in # 4307, i.e. the probability of a "6-hr" Total precipitation > 0.25" (6.35mm). 
This is simply how wgrib2 works - it will always produce the last occurrence of the variable when it is listed more than once as in the case here with ACPC. So, it makes no difference whether you use g2ctl and gribmap on the mean or spread GRIB2 files or if you convert the mean, spread and probability GRIB2 files to NETCDF versions, you will not be able to plot the correct ACPC variable.

Jennifer Adam's (COLA) solution was to subset the data which I have done, for example: 

 /usr/local/grads/bin/wgrib2 /mnt/modeldata/domModel/SREF/archive/09Z/2011111109_sref.t09z.pgrb212.prob.grib2 -match ^(255|371|487|623|759|895|1031|1187|1343|1499|1655|1811|1967|2123|2279|2435|2591|2747|2903|3059|3215|3371|3527|3683|3839|3995|4151|4307): -grib /mnt/modeldata/domModel/SREF/archive/09Z/2011111109_sref.t09z.acpc06.prob.grib2

The screen output is this: 

255:1984755:d=2011111109:APCP:surface:0-6 hour acc fcst:prob >6.35
371:2740813:d=2011111109:APCP:surface:3-9 hour acc fcst:prob >6.35
487:3484051:d=2011111109:APCP:surface:6-12 hour acc fcst:prob >6.35
623:4310616:d=2011111109:APCP:surface:9-15 hour acc fcst:prob >6.35
759:5141073:d=2011111109:APCP:surface:12-18 hour acc fcst:prob >6.35
895:5974097:d=2011111109:APCP:surface:15-21 hour acc fcst:prob >6.35
1031:6813382:d=2011111109:APCP:surface:18-24 hour acc fcst:prob >6.35
1187:7763006:d=2011111109:APCP:surface:21-27 hour acc fcst:prob >6.35
1343:8709221:d=2011111109:APCP:surface:24-30 hour acc fcst:prob >6.35
1499:9639125:d=2011111109:APCP:surface:27-33 hour acc fcst:prob >6.35
1655:10568500:d=2011111109:APCP:surface:30-36 hour acc fcst:prob >6.35
1811:11506458:d=2011111109:APCP:surface:33-39 hour acc fcst:prob >6.35
1967:12456726:d=2011111109:APCP:surface:36-42 hour acc fcst:prob >6.35
2123:13426569:d=2011111109:APCP:surface:39-45 hour acc fcst:prob >6.35
2279:14405578:d=2011111109:APCP:surface:42-48 hour acc fcst:prob >6.35
2435:15393706:d=2011111109:APCP:surface:45-51 hour acc fcst:prob >6.35
2591:16371403:d=2011111109:APCP:surface:48-54 hour acc fcst:prob >6.35
2747:17333907:d=2011111109:APCP:surface:51-57 hour acc fcst:prob >6.35
2903:18290987:d=2011111109:APCP:surface:54-60 hour acc fcst:prob >6.35
3059:19258303:d=2011111109:APCP:surface:57-63 hour acc fcst:prob >6.35
3215:20238756:d=2011111109:APCP:surface:60-66 hour acc fcst:prob >6.35
3371:21230116:d=2011111109:APCP:surface:63-69 hour acc fcst:prob >6.35
3527:22230328:d=2011111109:APCP:surface:66-72 hour acc fcst:prob >6.35
3683:23241420:d=2011111109:APCP:surface:69-75 hour acc fcst:prob >6.35
3839:24252356:d=2011111109:APCP:surface:72-78 hour acc fcst:prob >6.35
3995:25251574:d=2011111109:APCP:surface:75-81 hour acc fcst:prob >6.35
4151:26252617:d=2011111109:APCP:surface:78-84 hour acc fcst:prob >6.35
4307:27265782:d=2011111109:APCP:surface:81-87 hour acc fcst:prob >6.35

The next step is to convert the subset GRIB2 file containing the exact variable I want into a NETCDF version using the upgraded version of WGRIB2 (0.1.9.5) - the reason for this, is that the SREF probability GRIB2 file will not be able to be processed using g2ctl and gribmap owing to the "Product Definition Template 9 not handled" problem described above. (However, you CAN use the g2ctl and gribmap method on the SPREAD and MEAN SREF subset GRIB2 files to create the necessary CTL and IDX files). 

 wgrib2 2011111109_sref.t09z.acpc06.prob.grib2 -netcdf 2011111109_sref.t09z.acpc06.prob.nc

creates output: 

1:0:d=2011111109:APCP:surface:0-6 hour acc fcst:prob >6.35
2:6176:d=2011111109:APCP:surface:3-9 hour acc fcst:prob >6.35
3:12137:d=2011111109:APCP:surface:6-12 hour acc fcst:prob >6.35
4:17785:d=2011111109:APCP:surface:9-15 hour acc fcst:prob >6.35
5:23359:d=2011111109:APCP:surface:12-18 hour acc fcst:prob >6.35
6:28622:d=2011111109:APCP:surface:15-21 hour acc fcst:prob >6.35
7:34069:d=2011111109:APCP:surface:18-24 hour acc fcst:prob >6.35
8:39907:d=2011111109:APCP:surface:21-27 hour acc fcst:prob >6.35
9:45932:d=2011111109:APCP:surface:24-30 hour acc fcst:prob >6.35
10:51982:d=2011111109:APCP:surface:27-33 hour acc fcst:prob >6.35
11:57888:d=2011111109:APCP:surface:30-36 hour acc fcst:prob >6.35
12:63516:d=2011111109:APCP:surface:33-39 hour acc fcst:prob >6.35
13:69095:d=2011111109:APCP:surface:36-42 hour acc fcst:prob >6.35
14:74591:d=2011111109:APCP:surface:39-45 hour acc fcst:prob >6.35
15:80060:d=2011111109:APCP:surface:42-48 hour acc fcst:prob >6.35
16:85624:d=2011111109:APCP:surface:45-51 hour acc fcst:prob >6.35
17:91152:d=2011111109:APCP:surface:48-54 hour acc fcst:prob >6.35
18:96400:d=2011111109:APCP:surface:51-57 hour acc fcst:prob >6.35
19:101465:d=2011111109:APCP:surface:54-60 hour acc fcst:prob >6.35
20:106540:d=2011111109:APCP:surface:57-63 hour acc fcst:prob >6.35
21:112132:d=2011111109:APCP:surface:60-66 hour acc fcst:prob >6.35
22:118069:d=2011111109:APCP:surface:63-69 hour acc fcst:prob >6.35
23:124155:d=2011111109:APCP:surface:66-72 hour acc fcst:prob >6.35
24:130555:d=2011111109:APCP:surface:69-75 hour acc fcst:prob >6.35
25:137027:d=2011111109:APCP:surface:72-78 hour acc fcst:prob >6.35
26:143700:d=2011111109:APCP:surface:75-81 hour acc fcst:prob >6.35
27:150511:d=2011111109:APCP:surface:78-84 hour acc fcst:prob >6.35
28:157387:d=2011111109:APCP:surface:81-87 hour acc fcst:prob >6.35

 ncdump -h 2011111109_sref.t09z.acpc06.prob.nc

netcdf 2011111109_sref.t09z.acpc06.prob {
dimensions:
        y = 129 ;
        x = 185 ;
        time = UNLIMITED ; // (28 currently)
variables:
        double y(y) ;
                y:long_name = "y coordinate of projection" ;
                y:standard_name = "projection_y_coordinate" ;
                y:units = "m" ;
                y:grid_spacing = 40635. ;
        double x(x) ;
                x:long_name = "x coordinate of projection" ;
                x:standard_name = "projection_x_coordinate" ;
                x:units = "m" ;
                x:grid_spacing = 40635. ;
        double latitude(y, x) ;
                latitude:units = "degrees_north" ;
                latitude:long_name = "latitude" ;
        double longitude(y, x) ;
                longitude:units = "degrees_east" ;
                longitude:long_name = "longitude" ;
        double time(time) ;
                time:units = "seconds since 1970-01-01 00:00:00.0 0:00" ;
                time:long_name = "verification time generated by wgrib2 function verftime()" ;
                time:reference_time = 1321002000. ;
                time:reference_time_type = 3 ;
                time:reference_date = "2011.11.11 09:00:00 UTC" ;
                time:reference_time_description = "forecast or accumulated, reference date is fixed" ;
                time:time_step_setting = "auto" ;
                time:time_step = 10800. ;
        float APCP_GT_6_35_surface(time, y, x) ;
                APCP_GT_6_35_surface:_FillValue = 9.999e+20f ;
                APCP_GT_6_35_surface:short_name = "APCP_GT_6_35_surface" ;
                APCP_GT_6_35_surface:long_name = "Total Precipitation" ;
                APCP_GT_6_35_surface:level = "surface" ;
                APCP_GT_6_35_surface:units = "1" ;
                APCP_GT_6_35_surface:coordinates = "longitude latitude" ;

// global attributes:
                :Conventions = "CF-1.0" ;
                :History = "created by wgrib2" ;
                :GRIB2_grid_template = 30 ;
}

However, you can't simply read in this NETCDF file into GRADS using sdfopen, so you MUST create a CTL file to describe the NETCDF file you just created above. Since setting up a CTL file to describe a NETCDF file can be rather tricky and you may end up spending days doing so, here is a quick and sneaky method to do so. 

Since I know that I am able to create CTL and IDX files of hte MEAN and SPREAD SREF files, I merely created a CTL file of the MEAN SREF as follows: 

g2ctl.pl 2011110703_sref.t03z.pgrb212.mean.grib2 2011110703_sref.t03z.pgrb212.mean.idx >2011110703_sref.t03z.pgrb212.mean.ctl

And you get a file that looks like this: 

dset /mnt/modeldata/domModel/SREF/archive/03Z/2011110703_sref.t03z.pgrb212.mean.grib2
index /mnt/modeldata/domModel/SREF/archive/grads_ctl/2011110703_sref_03_mean_40km.idx
undef 9.999E+20
title /mnt/modeldata/domModel/SREF/archive/03Z/2011110703_sref.t03z.pgrb212.mean.grib2
* produced by g2ctl v0.0.8.4
* command line options: /mnt/modeldata/domModel/SREF/archive/03Z/2011110703_sref.t03z.pgrb212.mean.grib2 /mnt/modeldata/domModel/SREF/archive/grads_ctl/2011110703_sref_03_mean_40km.idx
* griddef=1:0:(185 x 129):grid_template=30:winds(grid): Lambert Conformal: (185 x 129) input WE:SN output WE:SN res 8 Lat1 12.190000 Lon1 226.541000 LoV 265.000000 LatD 25.000000 Latin1 25.000000 Latin2 25.000000 LatSP 0.000000 LonSP 0.000000 North P
dtype grib2
pdef 185 129 lccr 12.190000 -133.459 1 1 25.000000 25.000000 -95 40635.000000 40635.000000
xdef 274 linear -152.855107 0.377930376864113
ydef 133 linear 12.289391 0.369409090909091
tdef 30 linear 03Z07nov2011 3hr
* PROFILE hPa
zdef 6 levels 100000 85000 70000 50000 30000 25000
options pascals
vars 44
ABSV850mb   0,100,85000   0,2,10 ** 850 mb Absolute Vorticity [1/s]
ABSV700mb   0,100,70000   0,2,10 ** 700 mb Absolute Vorticity [1/s]
ABSV500mb   0,100,50000   0,2,10 ** 500 mb Absolute Vorticity [1/s]
ABSV250mb   0,100,25000   0,2,10 ** 250 mb Absolute Vorticity [1/s]
APCPsfc   0,1,0   0,1,8,1 ** surface Total Precipitation [kg/m^2]
CAPEsfc   0,1,0   0,7,6 ** surface Convective Available Potential Energy [J/kg]
CFRZRsfc   0,1,0   0,1,193 ** surface Categorical Freezing Rain (yes=1; no=0) [non-dim]
CICEPsfc   0,1,0   0,1,194 ** surface Categorical Ice Pellets (yes=1; no=0) [non-dim]
CINsfc   0,1,0   0,7,7 ** surface Convective Inhibition [J/kg]
CRAINsfc   0,1,0   0,1,192 ** surface Categorical Rain (yes=1; no=0) [non-dim]
CSNOWsfc   0,1,0   0,1,195 ** surface Categorical Snow (yes=1; no=0) [non-dim]
DPT850mb   0,100,85000   0,0,6 ** 850 mb Dew Point Temperature [K]
THICK1000_850 0,100,85000,100000   0,3,5 ** 850-1000 mb Geopotential Height [gpm]
THICK1000_500 0,100,50000,100000   0,3,5 ** 500-1000 mb Geopotential Height [gpm]
THICK850_700 0,100,70000,85000   0,3,5 ** 700-850 mb Geopotential Height [gpm]
DPT2m   0,103,2   0,0,6 ** 2 m above ground Dew Point Temperature [K]
HGTl100_100 0,100,85000,100000   0,3,5 ** 850-1000 mb Geopotential Height [gpm]
HGTl100_100 0,100,50000,100000   0,3,5 ** 500-1000 mb Geopotential Height [gpm]
HGTl100_100 0,100,70000,85000   0,3,5 ** 700-850 mb Geopotential Height [gpm]
HGTprs    6,100  0,3,5 ** (1000 850 700 500 300 250) Geopotential Height [gpm]
HGTceil   0,215,0   0,3,5 ** cloud ceiling Geopotential Height [gpm]
HGTclt   0,3,0   0,3,5 ** cloud top Geopotential Height [gpm]
HLCY3000_0m  0,103,3000,0   0,7,8 ** 3000-0 m above ground Storm Relative Helicity [m^2/s^2]
PLI30_0mb  0,108,3000,0   0,7,0 ** 30-0 mb above ground Parcel Lifted Index (to 500 mb) [K]
PRMSLmsl   0,101,0   0,3,1 ** mean sea level Pressure Reduced to MSL [Pa]
PWATclm   0,200,0   0,1,3 ** entire atmosphere (considered as a single layer) Precipitable Water [kg/m^2]
RH850mb   0,100,85000   0,1,1 ** 850 mb Relative Humidity [%]
RH700mb   0,100,70000   0,1,1 ** 700 mb Relative Humidity [%]
RH500mb   0,100,50000   0,1,1 ** 500 mb Relative Humidity [%]
RH300mb   0,100,30000   0,1,1 ** 300 mb Relative Humidity [%]
RH2m   0,103,2   0,1,1 ** 2 m above ground Relative Humidity [%]
SNOLsfc   0,1,0   0,1,15,1 ** surface Large-Scale Snow [kg/m^2]
TMP700mb   0,100,70000   0,0,0 ** 700 mb Temperature [K]
TMP500mb   0,100,50000   0,0,0 ** 500 mb Temperature [K]
TMP300mb   0,100,30000   0,0,0 ** 300 mb Temperature [K]
TMP850mb   0,100,85000   0,0,0 ** 850 mb Temperature [K]
TMP2m   0,103,2   0,0,0 ** 2 m above ground Temperature [K]
UGRDprs    6,100  0,2,2 ** (1000 850 700 500 300 250) U-Component of Wind [m/s]
UGRD10m   0,103,10   0,2,2 ** 10 m above ground U-Component of Wind [m/s]
VGRDprs    6,100  0,2,3 ** (1000 850 700 500 300 250) V-Component of Wind [m/s]
VGRD10m   0,103,10   0,2,3 ** 10 m above ground V-Component of Wind [m/s]
VISsfc   0,1,0   0,19,0 ** surface Visibility [m]
WINDprs    6,100  0,2,1 ** (1000 850 700 500 300 250) Wind Speed [m/s]
WIND10m   0,103,10   0,2,1 ** 10 m above ground Wind Speed [m/s]
ENDVARS
EDEF 1
E1 30  03Z07nov2011 1
ENDEDEF

Using the above information, I then created a CTL file to describe the data as follows (modified from the file above)

dset /mnt/modeldata/domModel/SREF/archive/09Z/2011111109_sref.t09z.acpc06.prob.nc
TITLE SREF Mean model data
DTYPE netcdf 
UNDEF 9.999E+20
pdef 185 129 lccr 12.190000 -133.459 1 1 25.000000 25.000000 -95 40635.000000 40635.000000
xdef 274 linear -152.855107 0.377930376864113
ydef 133 linear 12.289391 0.369409090909091
tdef 28 linear 15Z11nov2011 3hr
* PROFILE hPa
zdef 6 levels 100000 85000 70000 50000 30000 25000
VARS 1
APCP_GT_6_35_surface=>apcp06sfc  1  t,y,x Probability of Total Precipitation >0.25 inches [%]
ENDVARS

(I know the zdef levels are not correct, but it makes no difference for the surface variables)

I then have success plotting out the 28 plots for each 6-hr period starting at forecast hour 6, every three hours through forecast hour 87. 

This methodology worked for all my other variables I needed to plot. You can employ the exact same methodology to plot the correct 6-hr ACPC MEAN and SPREAD variables. 

A final note from Jennifer Adams regarding the issue with gribmap error message:

> The best case is being able to read all that output in its native format, but that is not quite possible with GrADS. The error message you get from gribmap ("Product Definition Template 9 not handled") is not going to go away by recompiling -- it is a feature of GrADS 2.0.1. We have not implemented an interface for keeping track of all the grib codes required to uniquely describe those probability forecasts. Those fields will need to be converted to netcdf before you can read them with GrADS.
> --Jennifer

Yes, you can also do the following and create a subset NETCDF directly instead of a subset GRIB2 file as follows: 

wgrib2 2011111109_sref.t09z.pgrb212.prob.grib2 -match '^(255|371|487|623|759|895|1031|1187|1343|1499|1655|1811|1967|2123|2279|2435|2591|2747|2903|3059|3215|3371|3527|3683|3839|3995|4151|4307):' -netcdf 2011111109_sref.t09z.pgrb212.apcp06.prob.nc

However, as previously mentioned, unless you are an expert at creating CTL files from scratch, setting up a correct CTL file for the netcdf file can be tricky, hence my extra step to create the ctl file for the GRIB2 and then modify it slightly to read in the netcdf version.

So the quick and easy of it is to subset whatever variable it is you want and first try doing a simple g2ctl and gribmap and if that does not work, convert the subset GRIB2 files to NETCDF and create a CTL file to describe the NETCDF.

I hope this helps anyone in future working with SREF or any model where you may encounter the APCP "issue" as described in this example.

Thanks to both Jennifer Adams and 
Regards,

Kevin M Levey, MSc in Oceans and Atmospheric Sciences (University of Cape Town)
Vice President of Operations
CustomWeather, Inc.
San Francisco, California, USA

"Taking the World by Storm!"

http://www.customweather.com
http://www.myforecast.com
http://www.1stweather.com

cell: 415-794-0411
work: 415-777-3566
email: klevey at customweather.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20111115/d0b19cfb/attachment-0003.html 


More information about the gradsusr mailing list