<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">TUE 15NOV11: 1100PST<div><br></div><div>Dear GRDAS users.</div><div><br></div><div>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.&nbsp;</div><div><br></div><div><b>PROBLEM:</b>&nbsp;</div><div><br></div><div>There were two problems:&nbsp;</div><div><br></div><div>1] Unable to create a NETCDF version of the SREF probability &nbsp;GRIB2 data file;</div><div>2] Unable to correctly obtain certain variables like ACPC for the correct forecast period wanted, esp. from the SREF Probability files;</div><div><br></div><div>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.&nbsp;</div><div><br></div><div>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.</div><div><br></div><div><br></div><div><b>SOLUTION:&nbsp;</b></div><div><br></div><div>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.</div><div><br></div><div>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.&nbsp;</div><div><br></div><div>Remember, I was only interested in obtaining the 6-hr probability of precipitation &gt; 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:&nbsp;</div><div><br></div><div>wgrib2 -v 2011111503_sref.t03z.pgrb212.prob.grib2</div><div><br></div><div>So, for forecast hour 6, ACPC is listed many times - here, either probabilities for a 3hour period or a 6 hour period</div><div>....</div><div><span class="Apple-style-span" style="font-family: monospace; white-space: pre; "><pre>242:1800525:d=2011111503:APCP Total Precipitation [prob]:surface:3-6 hour acc fcst:prob &gt;0.25
243:1821138:d=2011111503:APCP Total Precipitation [prob]:surface:3-6 hour acc fcst:prob &gt;1.27
244:1832550:d=2011111503:APCP Total Precipitation [prob]:surface:3-6 hour acc fcst:prob &gt;2.54
<b>245:1840100:d=2011111503:APCP Total Precipitation [prob]:surface:3-6 hour acc fcst:prob &gt;6.35</b>
246:1843358:d=2011111503:APCP Total Precipitation [prob]:surface:3-6 hour acc fcst:prob &gt;12.7
247:1844941:d=2011111503:APCP Total Precipitation [prob]:surface:3-6 hour acc fcst:prob &gt;25.4
248:1845759:d=2011111503:APCP Total Precipitation [prob]:surface:3-6 hour acc fcst:prob &gt;38.1
249:1846340:d=2011111503:APCP Total Precipitation [prob]:surface:3-6 hour acc fcst:prob &gt;50.8
250:1846894:d=2011111503:APCP Total Precipitation [prob]:surface:3-6 hour acc fcst:prob &gt;101.6
251:1847335:d=2011111503:APCP Total Precipitation [prob]:surface:3-6 hour acc fcst:prob &gt;152.4
252:1847562:d=2011111503:APCP Total Precipitation [prob]:surface:0-6 hour acc fcst:prob &gt;0.25
253:1868867:d=2011111503:APCP Total Precipitation [prob]:surface:0-6 hour acc fcst:prob &gt;1.27
254:1883986:d=2011111503:APCP Total Precipitation [prob]:surface:0-6 hour acc fcst:prob &gt;2.54
<b><font class="Apple-style-span" color="#fa007a">255:1895223:d=2011111503:APCP Total Precipitation [prob]:surface:0-6 hour acc fcst:prob &gt;6.35</font></b>
256:1900772:d=2011111503:APCP Total Precipitation [prob]:surface:0-6 hour acc fcst:prob &gt;12.7
257:1903296:d=2011111503:APCP Total Precipitation [prob]:surface:0-6 hour acc fcst:prob &gt;25.4
258:1904447:d=2011111503:APCP Total Precipitation [prob]:surface:0-6 hour acc fcst:prob &gt;38.1
259:1905268:d=2011111503:APCP Total Precipitation [prob]:surface:0-6 hour acc fcst:prob &gt;50.8
260:1905924:d=2011111503:APCP Total Precipitation [prob]:surface:0-6 hour acc fcst:prob &gt;101.6
261:1906365:d=2011111503:APCP Total Precipitation [prob]:surface:0-6 hour acc fcst:prob &gt;152.4</pre></span><div>....</div></div><div><br></div><div>IDS #245 and #255 are <i>named</i> the same, <b>but I am only interested in #255</b> and although the NETCDF file now has the correct variable:&nbsp;</div><div><br><div>ncdump -h&nbsp;2011111503_sref.t03z.pgrb212.prob.nc</div><div><br></div><div>....</div><div>&nbsp;float APCP_GT_6_35_surface(time, y, x) ;</div><div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; APCP_GT_6_35_surface:_FillValue = 9.999e+20f ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; APCP_GT_6_35_surface:short_name = "APCP_GT_6_35_surface" ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; APCP_GT_6_35_surface:long_name = "Total Precipitation" ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; APCP_GT_6_35_surface:level = "surface" ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; APCP_GT_6_35_surface:units = "1" ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; APCP_GT_6_35_surface:coordinates = "longitude latitude" ;</div></div><div>....</div><div><br></div><div><br></div><div>it will <b>only refer to the last ID</b>. So, in the above example, that is fine, but not for forecast hour 87 where the NETCDF variable&nbsp;APCP_GT_6_35_surface will refer to ID #4327 (which is for a 24-hour period)</div><div><br></div><div><pre><pre>4294:25985716:d=2011111503:APCP Total Precipitation [prob]:surface:84-87 hour acc fcst:prob &gt;0.25
4295:26005383:d=2011111503:APCP Total Precipitation [prob]:surface:84-87 hour acc fcst:prob &gt;1.27
4296:26017159:d=2011111503:APCP Total Precipitation [prob]:surface:84-87 hour acc fcst:prob &gt;2.54
<b>4297:26024955:d=2011111503:APCP Total Precipitation [prob]:surface:84-87 hour acc fcst:prob &gt;6.35</b>
4298:26027680:d=2011111503:APCP Total Precipitation [prob]:surface:84-87 hour acc fcst:prob &gt;12.7
4299:26028535:d=2011111503:APCP Total Precipitation [prob]:surface:84-87 hour acc fcst:prob &gt;25.4
4300:26029106:d=2011111503:APCP Total Precipitation [prob]:surface:84-87 hour acc fcst:prob &gt;38.1
4301:26029623:d=2011111503:APCP Total Precipitation [prob]:surface:84-87 hour acc fcst:prob &gt;50.8
4302:26030070:d=2011111503:APCP Total Precipitation [prob]:surface:84-87 hour acc fcst:prob &gt;101.6
4303:26030297:d=2011111503:APCP Total Precipitation [prob]:surface:84-87 hour acc fcst:prob &gt;152.4
4304:26030524:d=2011111503:APCP Total Precipitation [prob]:surface:81-87 hour acc fcst:prob &gt;0.25
4305:26051662:d=2011111503:APCP Total Precipitation [prob]:surface:81-87 hour acc fcst:prob &gt;1.27
4306:26066456:d=2011111503:APCP Total Precipitation [prob]:surface:81-87 hour acc fcst:prob &gt;2.54
<b><font class="Apple-style-span" color="#f60000">4307:26077756:d=2011111503:APCP Total Precipitation [prob]:surface:81-87 hour acc fcst:prob &gt;6.35</font></b>
4308:26083146:d=2011111503:APCP Total Precipitation [prob]:surface:81-87 hour acc fcst:prob &gt;12.7
4309:26085315:d=2011111503:APCP Total Precipitation [prob]:surface:81-87 hour acc fcst:prob &gt;25.4
4310:26086001:d=2011111503:APCP Total Precipitation [prob]:surface:81-87 hour acc fcst:prob &gt;38.1
4311:26086609:d=2011111503:APCP Total Precipitation [prob]:surface:81-87 hour acc fcst:prob &gt;50.8
4312:26087104:d=2011111503:APCP Total Precipitation [prob]:surface:81-87 hour acc fcst:prob &gt;101.6
4313:26087331:d=2011111503:APCP Total Precipitation [prob]:surface:81-87 hour acc fcst:prob &gt;152.4
4314:26087558:d=2011111503:APCP Total Precipitation [prob]:surface:75-87 hour acc fcst:prob &gt;0.25
4315:26108993:d=2011111503:APCP Total Precipitation [prob]:surface:75-87 hour acc fcst:prob &gt;1.27
4316:26126730:d=2011111503:APCP Total Precipitation [prob]:surface:75-87 hour acc fcst:prob &gt;2.54
<b>4317:26141510:d=2011111503:APCP Total Precipitation [prob]:surface:75-87 hour acc fcst:prob &gt;6.35</b>
4318:26150310:d=2011111503:APCP Total Precipitation [prob]:surface:75-87 hour acc fcst:prob &gt;12.7
4319:26154665:d=2011111503:APCP Total Precipitation [prob]:surface:75-87 hour acc fcst:prob &gt;25.4
4320:26156045:d=2011111503:APCP Total Precipitation [prob]:surface:75-87 hour acc fcst:prob &gt;38.1
4321:26156806:d=2011111503:APCP Total Precipitation [prob]:surface:75-87 hour acc fcst:prob &gt;50.8
4322:26157454:d=2011111503:APCP Total Precipitation [prob]:surface:75-87 hour acc fcst:prob &gt;101.6
4323:26157933:d=2011111503:APCP Total Precipitation [prob]:surface:75-87 hour acc fcst:prob &gt;152.4
4324:26158160:d=2011111503:APCP Total Precipitation [prob]:surface:63-87 hour acc fcst:prob &gt;0.25
4325:26179375:d=2011111503:APCP Total Precipitation [prob]:surface:63-87 hour acc fcst:prob &gt;1.27
4326:26199116:d=2011111503:APCP Total Precipitation [prob]:surface:63-87 hour acc fcst:prob &gt;2.54
<b>4327:26217303:d=2011111503:APCP Total Precipitation [prob]:surface:63-87 hour acc fcst:prob &gt;6.35</b>
4328:26230287:d=2011111503:APCP Total Precipitation [prob]:surface:63-87 hour acc fcst:prob &gt;12.7
4329:26237718:d=2011111503:APCP Total Precipitation [prob]:surface:63-87 hour acc fcst:prob &gt;25.4
4330:26241155:d=2011111503:APCP Total Precipitation [prob]:surface:63-87 hour acc fcst:prob &gt;38.1
4331:26242981:d=2011111503:APCP Total Precipitation [prob]:surface:63-87 hour acc fcst:prob &gt;50.8
4332:26244079:d=2011111503:APCP Total Precipitation [prob]:surface:63-87 hour acc fcst:prob &gt;101.6
4333:26244587:d=2011111503:APCP Total Precipitation [prob]:surface:63-87 hour acc fcst:prob &gt;152.4</pre><div><span class="Apple-style-span" style="font-family: Calibri; white-space: normal; ">I am ONLY interested in #</span><span class="Apple-style-span" style="font-family: Calibri; white-space: normal; ">&nbsp;</span><span class="Apple-style-span" style="font-family: Calibri; white-space: normal; "><b><font class="Apple-style-span" color="#e93d00">4307, i.e. the probability of a "6-hr" Total precipitation &gt; 0.25" (6.35mm).&nbsp;</font></b></span></div></pre></div><div>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.</div><div><br></div><div>Jennifer Adam's (COLA) solution was to subset the data which I have done, for example:&nbsp;</div><div><br></div><div><div><div>&nbsp;/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</div><div><br></div><div>The screen output is this:&nbsp;</div><div><br></div><div><div><div>255:1984755:d=2011111109:APCP:surface:0-6 hour acc fcst:prob &gt;6.35</div><div>371:2740813:d=2011111109:APCP:surface:3-9 hour acc fcst:prob &gt;6.35</div><div>487:3484051:d=2011111109:APCP:surface:6-12 hour acc fcst:prob &gt;6.35</div><div>623:4310616:d=2011111109:APCP:surface:9-15 hour acc fcst:prob &gt;6.35</div><div>759:5141073:d=2011111109:APCP:surface:12-18 hour acc fcst:prob &gt;6.35</div><div>895:5974097:d=2011111109:APCP:surface:15-21 hour acc fcst:prob &gt;6.35</div><div>1031:6813382:d=2011111109:APCP:surface:18-24 hour acc fcst:prob &gt;6.35</div><div>1187:7763006:d=2011111109:APCP:surface:21-27 hour acc fcst:prob &gt;6.35</div><div>1343:8709221:d=2011111109:APCP:surface:24-30 hour acc fcst:prob &gt;6.35</div><div>1499:9639125:d=2011111109:APCP:surface:27-33 hour acc fcst:prob &gt;6.35</div><div>1655:10568500:d=2011111109:APCP:surface:30-36 hour acc fcst:prob &gt;6.35</div><div>1811:11506458:d=2011111109:APCP:surface:33-39 hour acc fcst:prob &gt;6.35</div><div>1967:12456726:d=2011111109:APCP:surface:36-42 hour acc fcst:prob &gt;6.35</div><div>2123:13426569:d=2011111109:APCP:surface:39-45 hour acc fcst:prob &gt;6.35</div><div>2279:14405578:d=2011111109:APCP:surface:42-48 hour acc fcst:prob &gt;6.35</div><div>2435:15393706:d=2011111109:APCP:surface:45-51 hour acc fcst:prob &gt;6.35</div><div>2591:16371403:d=2011111109:APCP:surface:48-54 hour acc fcst:prob &gt;6.35</div><div>2747:17333907:d=2011111109:APCP:surface:51-57 hour acc fcst:prob &gt;6.35</div><div>2903:18290987:d=2011111109:APCP:surface:54-60 hour acc fcst:prob &gt;6.35</div><div>3059:19258303:d=2011111109:APCP:surface:57-63 hour acc fcst:prob &gt;6.35</div><div>3215:20238756:d=2011111109:APCP:surface:60-66 hour acc fcst:prob &gt;6.35</div><div>3371:21230116:d=2011111109:APCP:surface:63-69 hour acc fcst:prob &gt;6.35</div><div>3527:22230328:d=2011111109:APCP:surface:66-72 hour acc fcst:prob &gt;6.35</div><div>3683:23241420:d=2011111109:APCP:surface:69-75 hour acc fcst:prob &gt;6.35</div><div>3839:24252356:d=2011111109:APCP:surface:72-78 hour acc fcst:prob &gt;6.35</div><div>3995:25251574:d=2011111109:APCP:surface:75-81 hour acc fcst:prob &gt;6.35</div><div>4151:26252617:d=2011111109:APCP:surface:78-84 hour acc fcst:prob &gt;6.35</div><div>4307:27265782:d=2011111109:APCP:surface:81-87 hour acc fcst:prob &gt;6.35</div></div></div></div></div><div><br></div><div>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).&nbsp;</div><div><br></div><div>&nbsp;wgrib2 2011111109_sref.t09z.acpc06.prob.grib2 -netcdf <b>2011111109_sref.t09z.acpc06.prob.nc</b></div><div><br></div><div>creates output:&nbsp;</div><div><br></div><div><div><div>1:0:d=2011111109:APCP:surface:0-6 hour acc fcst:prob &gt;6.35</div><div>2:6176:d=2011111109:APCP:surface:3-9 hour acc fcst:prob &gt;6.35</div><div>3:12137:d=2011111109:APCP:surface:6-12 hour acc fcst:prob &gt;6.35</div><div>4:17785:d=2011111109:APCP:surface:9-15 hour acc fcst:prob &gt;6.35</div><div>5:23359:d=2011111109:APCP:surface:12-18 hour acc fcst:prob &gt;6.35</div><div>6:28622:d=2011111109:APCP:surface:15-21 hour acc fcst:prob &gt;6.35</div><div>7:34069:d=2011111109:APCP:surface:18-24 hour acc fcst:prob &gt;6.35</div><div>8:39907:d=2011111109:APCP:surface:21-27 hour acc fcst:prob &gt;6.35</div><div>9:45932:d=2011111109:APCP:surface:24-30 hour acc fcst:prob &gt;6.35</div><div>10:51982:d=2011111109:APCP:surface:27-33 hour acc fcst:prob &gt;6.35</div><div>11:57888:d=2011111109:APCP:surface:30-36 hour acc fcst:prob &gt;6.35</div><div>12:63516:d=2011111109:APCP:surface:33-39 hour acc fcst:prob &gt;6.35</div><div>13:69095:d=2011111109:APCP:surface:36-42 hour acc fcst:prob &gt;6.35</div><div>14:74591:d=2011111109:APCP:surface:39-45 hour acc fcst:prob &gt;6.35</div><div>15:80060:d=2011111109:APCP:surface:42-48 hour acc fcst:prob &gt;6.35</div><div>16:85624:d=2011111109:APCP:surface:45-51 hour acc fcst:prob &gt;6.35</div><div>17:91152:d=2011111109:APCP:surface:48-54 hour acc fcst:prob &gt;6.35</div><div>18:96400:d=2011111109:APCP:surface:51-57 hour acc fcst:prob &gt;6.35</div><div>19:101465:d=2011111109:APCP:surface:54-60 hour acc fcst:prob &gt;6.35</div><div>20:106540:d=2011111109:APCP:surface:57-63 hour acc fcst:prob &gt;6.35</div><div>21:112132:d=2011111109:APCP:surface:60-66 hour acc fcst:prob &gt;6.35</div><div>22:118069:d=2011111109:APCP:surface:63-69 hour acc fcst:prob &gt;6.35</div><div>23:124155:d=2011111109:APCP:surface:66-72 hour acc fcst:prob &gt;6.35</div><div>24:130555:d=2011111109:APCP:surface:69-75 hour acc fcst:prob &gt;6.35</div><div>25:137027:d=2011111109:APCP:surface:72-78 hour acc fcst:prob &gt;6.35</div><div>26:143700:d=2011111109:APCP:surface:75-81 hour acc fcst:prob &gt;6.35</div><div>27:150511:d=2011111109:APCP:surface:78-84 hour acc fcst:prob &gt;6.35</div><div>28:157387:d=2011111109:APCP:surface:81-87 hour acc fcst:prob &gt;6.35</div></div></div><div><br></div><div><div><b>&nbsp;ncdump -h 2011111109_sref.t09z.acpc06.prob.nc</b></div><div><br></div><div><div>netcdf 2011111109_sref.t09z.acpc06.prob {</div><div>dimensions:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; y = 129 ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; x = 185 ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; time = UNLIMITED ; // (28 currently)</div><div>variables:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; double y(y) ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; y:long_name = "y coordinate of projection" ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; y:standard_name = "projection_y_coordinate" ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; y:units = "m" ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; y:grid_spacing = 40635. ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; double x(x) ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; x:long_name = "x coordinate of projection" ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; x:standard_name = "projection_x_coordinate" ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; x:units = "m" ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; x:grid_spacing = 40635. ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; double latitude(y, x) ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; latitude:units = "degrees_north" ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; latitude:long_name = "latitude" ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; double longitude(y, x) ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; longitude:units = "degrees_east" ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; longitude:long_name = "longitude" ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; double time(time) ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; time:units = "seconds since 1970-01-01 00:00:00.0 0:00" ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; time:long_name = "verification time generated by wgrib2 function verftime()" ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; time:reference_time = 1321002000. ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; time:reference_time_type = 3 ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; time:reference_date = "2011.11.11 09:00:00 UTC" ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; time:reference_time_description = "forecast or accumulated, reference date is fixed" ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; time:time_step_setting = "auto" ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; time:time_step = 10800. ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; float APCP_GT_6_35_surface(time, y, x) ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; APCP_GT_6_35_surface:_FillValue = 9.999e+20f ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; APCP_GT_6_35_surface:short_name = "APCP_GT_6_35_surface" ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; APCP_GT_6_35_surface:long_name = "Total Precipitation" ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; APCP_GT_6_35_surface:level = "surface" ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; APCP_GT_6_35_surface:units = "1" ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; APCP_GT_6_35_surface:coordinates = "longitude latitude" ;</div><div><br></div><div>// global attributes:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :Conventions = "CF-1.0" ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :History = "created by wgrib2" ;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :GRIB2_grid_template = 30 ;</div><div>}</div></div></div><div><br></div><div>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.&nbsp;</div><div><br></div><div>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:&nbsp;</div><div><br></div><div>g2ctl.pl&nbsp;2011110703_sref.t03z.pgrb212.mean.grib2&nbsp;2011110703_sref.t03z.pgrb212.mean.idx &gt;2011110703_sref.t03z.pgrb212.mean.ctl</div><div><br></div><div>And you get a file that looks like this:&nbsp;</div><div><br></div><div><div><font class="Apple-style-span" size="2">dset /mnt/modeldata/domModel/SREF/archive/03Z/2011110703_sref.t03z.pgrb212.mean.grib2</font></div><div><font class="Apple-style-span" size="2">index /mnt/modeldata/domModel/SREF/archive/grads_ctl/2011110703_sref_03_mean_40km.idx</font></div><div><font class="Apple-style-span" size="2">undef 9.999E+20</font></div><div><font class="Apple-style-span" size="2">title /mnt/modeldata/domModel/SREF/archive/03Z/2011110703_sref.t03z.pgrb212.mean.grib2</font></div><div><font class="Apple-style-span" size="2">* produced by g2ctl v0.0.8.4</font></div><div><font class="Apple-style-span" size="2">* 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</font></div><div><font class="Apple-style-span" size="2">* 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</font></div><div><font class="Apple-style-span" size="2">dtype grib2</font></div><div><font class="Apple-style-span" size="2">pdef 185 129 lccr 12.190000 -133.459 1 1 25.000000 25.000000 -95 40635.000000 40635.000000</font></div><div><font class="Apple-style-span" size="2">xdef 274 linear -152.855107 0.377930376864113</font></div><div><font class="Apple-style-span" size="2">ydef 133 linear 12.289391 0.369409090909091</font></div><div><font class="Apple-style-span" size="2">tdef 30 linear 03Z07nov2011 3hr</font></div><div><font class="Apple-style-span" size="2">* PROFILE hPa</font></div><div><font class="Apple-style-span" size="2">zdef 6 levels 100000 85000 70000 50000 30000 25000</font></div><div><font class="Apple-style-span" size="2">options pascals</font></div><div><font class="Apple-style-span" size="2">vars 44</font></div><div><font class="Apple-style-span" size="2">ABSV850mb &nbsp; 0,100,85000 &nbsp; 0,2,10 ** 850 mb Absolute Vorticity [1/s]</font></div><div><font class="Apple-style-span" size="2">ABSV700mb &nbsp; 0,100,70000 &nbsp; 0,2,10 ** 700 mb Absolute Vorticity [1/s]</font></div><div><font class="Apple-style-span" size="2">ABSV500mb &nbsp; 0,100,50000 &nbsp; 0,2,10 ** 500 mb Absolute Vorticity [1/s]</font></div><div><font class="Apple-style-span" size="2">ABSV250mb &nbsp; 0,100,25000 &nbsp; 0,2,10 ** 250 mb Absolute Vorticity [1/s]</font></div><div><font class="Apple-style-span" size="2">APCPsfc &nbsp; 0,1,0 &nbsp; 0,1,8,1 ** surface Total Precipitation [kg/m^2]</font></div><div><font class="Apple-style-span" size="2">CAPEsfc &nbsp; 0,1,0 &nbsp; 0,7,6 ** surface Convective Available Potential Energy [J/kg]</font></div><div><font class="Apple-style-span" size="2">CFRZRsfc &nbsp; 0,1,0 &nbsp; 0,1,193 ** surface Categorical Freezing Rain (yes=1; no=0) [non-dim]</font></div><div><font class="Apple-style-span" size="2">CICEPsfc &nbsp; 0,1,0 &nbsp; 0,1,194 ** surface Categorical Ice Pellets (yes=1; no=0) [non-dim]</font></div><div><font class="Apple-style-span" size="2">CINsfc &nbsp; 0,1,0 &nbsp; 0,7,7 ** surface Convective Inhibition [J/kg]</font></div><div><font class="Apple-style-span" size="2">CRAINsfc &nbsp; 0,1,0 &nbsp; 0,1,192 ** surface Categorical Rain (yes=1; no=0) [non-dim]</font></div><div><font class="Apple-style-span" size="2">CSNOWsfc &nbsp; 0,1,0 &nbsp; 0,1,195 ** surface Categorical Snow (yes=1; no=0) [non-dim]</font></div><div><font class="Apple-style-span" size="2">DPT850mb &nbsp; 0,100,85000 &nbsp; 0,0,6 ** 850 mb Dew Point Temperature [K]</font></div><div><font class="Apple-style-span" size="2">THICK1000_850 0,100,85000,100000 &nbsp; 0,3,5 ** 850-1000 mb Geopotential Height [gpm]</font></div><div><font class="Apple-style-span" size="2">THICK1000_500 0,100,50000,100000 &nbsp; 0,3,5 ** 500-1000 mb Geopotential Height [gpm]</font></div><div><font class="Apple-style-span" size="2">THICK850_700 0,100,70000,85000 &nbsp; 0,3,5 ** 700-850 mb Geopotential Height [gpm]</font></div><div><font class="Apple-style-span" size="2">DPT2m &nbsp; 0,103,2 &nbsp; 0,0,6 ** 2 m above ground Dew Point Temperature [K]</font></div><div><font class="Apple-style-span" size="2">HGTl100_100 0,100,85000,100000 &nbsp; 0,3,5 ** 850-1000 mb Geopotential Height [gpm]</font></div><div><font class="Apple-style-span" size="2">HGTl100_100 0,100,50000,100000 &nbsp; 0,3,5 ** 500-1000 mb Geopotential Height [gpm]</font></div><div><font class="Apple-style-span" size="2">HGTl100_100 0,100,70000,85000 &nbsp; 0,3,5 ** 700-850 mb Geopotential Height [gpm]</font></div><div><font class="Apple-style-span" size="2">HGTprs &nbsp; &nbsp;6,100 &nbsp;0,3,5 ** (1000 850 700 500 300 250) Geopotential Height [gpm]</font></div><div><font class="Apple-style-span" size="2">HGTceil &nbsp; 0,215,0 &nbsp; 0,3,5 ** cloud ceiling Geopotential Height [gpm]</font></div><div><font class="Apple-style-span" size="2">HGTclt &nbsp; 0,3,0 &nbsp; 0,3,5 ** cloud top Geopotential Height [gpm]</font></div><div><font class="Apple-style-span" size="2">HLCY3000_0m &nbsp;0,103,3000,0 &nbsp; 0,7,8 ** 3000-0 m above ground Storm Relative Helicity [m^2/s^2]</font></div><div><font class="Apple-style-span" size="2">PLI30_0mb &nbsp;0,108,3000,0 &nbsp; 0,7,0 ** 30-0 mb above ground Parcel Lifted Index (to 500 mb) [K]</font></div><div><font class="Apple-style-span" size="2">PRMSLmsl &nbsp; 0,101,0 &nbsp; 0,3,1 ** mean sea level Pressure Reduced to MSL [Pa]</font></div><div><font class="Apple-style-span" size="2">PWATclm &nbsp; 0,200,0 &nbsp; 0,1,3 ** entire atmosphere (considered as a single layer) Precipitable Water [kg/m^2]</font></div><div><font class="Apple-style-span" size="2">RH850mb &nbsp; 0,100,85000 &nbsp; 0,1,1 ** 850 mb Relative Humidity [%]</font></div><div><font class="Apple-style-span" size="2">RH700mb &nbsp; 0,100,70000 &nbsp; 0,1,1 ** 700 mb Relative Humidity [%]</font></div><div><font class="Apple-style-span" size="2">RH500mb &nbsp; 0,100,50000 &nbsp; 0,1,1 ** 500 mb Relative Humidity [%]</font></div><div><font class="Apple-style-span" size="2">RH300mb &nbsp; 0,100,30000 &nbsp; 0,1,1 ** 300 mb Relative Humidity [%]</font></div><div><font class="Apple-style-span" size="2">RH2m &nbsp; 0,103,2 &nbsp; 0,1,1 ** 2 m above ground Relative Humidity [%]</font></div><div><font class="Apple-style-span" size="2">SNOLsfc &nbsp; 0,1,0 &nbsp; 0,1,15,1 ** surface Large-Scale Snow [kg/m^2]</font></div><div><font class="Apple-style-span" size="2">TMP700mb &nbsp; 0,100,70000 &nbsp; 0,0,0 ** 700 mb Temperature [K]</font></div><div><font class="Apple-style-span" size="2">TMP500mb &nbsp; 0,100,50000 &nbsp; 0,0,0 ** 500 mb Temperature [K]</font></div><div><font class="Apple-style-span" size="2">TMP300mb &nbsp; 0,100,30000 &nbsp; 0,0,0 ** 300 mb Temperature [K]</font></div><div><font class="Apple-style-span" size="2">TMP850mb &nbsp; 0,100,85000 &nbsp; 0,0,0 ** 850 mb Temperature [K]</font></div><div><font class="Apple-style-span" size="2">TMP2m &nbsp; 0,103,2 &nbsp; 0,0,0 ** 2 m above ground Temperature [K]</font></div><div><font class="Apple-style-span" size="2">UGRDprs &nbsp; &nbsp;6,100 &nbsp;0,2,2 ** (1000 850 700 500 300 250) U-Component of Wind [m/s]</font></div><div><font class="Apple-style-span" size="2">UGRD10m &nbsp; 0,103,10 &nbsp; 0,2,2 ** 10 m above ground U-Component of Wind [m/s]</font></div><div><font class="Apple-style-span" size="2">VGRDprs &nbsp; &nbsp;6,100 &nbsp;0,2,3 ** (1000 850 700 500 300 250) V-Component of Wind [m/s]</font></div><div><font class="Apple-style-span" size="2">VGRD10m &nbsp; 0,103,10 &nbsp; 0,2,3 ** 10 m above ground V-Component of Wind [m/s]</font></div><div><font class="Apple-style-span" size="2">VISsfc &nbsp; 0,1,0 &nbsp; 0,19,0 ** surface Visibility [m]</font></div><div><font class="Apple-style-span" size="2">WINDprs &nbsp; &nbsp;6,100 &nbsp;0,2,1 ** (1000 850 700 500 300 250) Wind Speed [m/s]</font></div><div><font class="Apple-style-span" size="2">WIND10m &nbsp; 0,103,10 &nbsp; 0,2,1 ** 10 m above ground Wind Speed [m/s]</font></div><div><font class="Apple-style-span" size="2">ENDVARS</font></div><div><font class="Apple-style-span" size="2">EDEF 1</font></div><div><font class="Apple-style-span" size="2">E1 30 &nbsp;03Z07nov2011 1</font></div><div><font class="Apple-style-span" size="2">ENDEDEF</font></div></div><div><br></div><div>Using the above information,&nbsp;I then created a CTL file to describe the data as follows (modified from the file above)</div><div><br></div><div><div><div>dset /mnt/modeldata/domModel/SREF/archive/09Z/2011111109_sref.t09z.acpc06.prob.nc</div><div>TITLE SREF Mean model data</div><div><b>DTYPE netcdf&nbsp;</b></div><div>UNDEF 9.999E+20</div><div>pdef 185 129 lccr 12.190000 -133.459 1 1 25.000000 25.000000 -95 40635.000000 40635.000000</div><div>xdef 274 linear -152.855107 0.377930376864113</div><div>ydef 133 linear 12.289391 0.369409090909091</div><div>tdef 28 linear 15Z11nov2011 3hr</div><div>* PROFILE hPa</div><div>zdef 6 levels 100000 85000 70000 50000 30000 25000</div><div>VARS 1</div><div><b>APCP_GT_6_35_surface=&gt;apcp06sfc &nbsp;1 &nbsp;t,y,x Probability of Total Precipitation &gt;0.25 inches [%]</b></div><div>ENDVARS</div></div></div><div><br></div><div>(I know the zdef levels are not correct, but it makes no difference for the surface variables)</div><div><br></div><div>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.&nbsp;</div><div><br></div><div>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.&nbsp;</div><div><br></div><div>A final note from Jennifer Adams regarding the issue with gribmap error message:</div><div><br></div><div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>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.</div></div></blockquote><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>--Jennifer</div></div></blockquote><br></div><div>Yes, you can also do the following and create a subset NETCDF directly instead of a subset GRIB2 file as follows:&nbsp;</div><div><br></div><div><div>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</div><br><div>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.</div></div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>Thanks to both Jennifer Adams and&nbsp;</div></div><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Calibri; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Calibri; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><div><div><div>Regards,</div><div><br></div><div>Kevin M Levey, MSc in Oceans and Atmospheric Sciences (University of Cape Town)</div><div>Vice President of Operations</div><div>CustomWeather,&nbsp;Inc.</div><div>San Francisco, California, USA</div><div><br></div><div>"Taking the World by Storm!"</div><div><br></div><div><a href="http://www.customweather.com">http://www.customweather.com</a></div><div><a href="http://www.myforecast.com">http://www.myforecast.com</a></div><div><a href="http://www.1stweather.com">http://www.1stweather.com</a></div><div><br></div><div>cell: 415-794-0411</div><div>work: 415-777-3566</div><div>email: <a href="mailto:klevey@customweather.com">klevey@customweather.com</a></div></div></div></div></div></div></span></span>
</div>
<br></body></html>