<div dir="ltr">John,<br>even if in a narrow way I was successful in converting my NetCDF files to GRIB1 format...in the followings lines <br>the commands I'm using in the terminal:<br><br>cdo selcode,-2 my_netcdf_file tmp1<br>
cdo expr,'tmpk=ta2m+273.15;' ftmp1 ftmp2<br>cdo -f grb setcode,011 ftmp2 my_grib1_file<br><br>some of the previous operations are redundant but since I'm mostly interested in 2 meters <br>temperature the method with cdo is quite fast even with large amount of data.<br>
I wish I was able to use a GRIB user defined table for converting all the parameters in my NetCDF file<br>and with just this command:<br><br>cdo -t my_user_defined_table -f grb copy <a href="http://aaa.meteosalute_2007123100-2008010223_d01.nc/" target="_blank"></a> my_netcdf_file my_grib1_file<br>
<br>but, unfortunately, it was not possible and none change was performed.<br>Anyway I'm shyly suggesting the use of cdo operators for this task until the introduction of NetCDF files as input file<br>for MET tool.<br>
Thanks for your help, Valerio<br>
<br><div class="gmail_quote"><br><br><br>2008/9/25 John Halley Gotway <span dir="ltr"><<a href="mailto:johnhg@rap.ucar.edu" target="_blank">johnhg@rap.ucar.edu</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Valerio,<br>
<br>
Sorry, no. I don't have any experience using "cdo". I'll be interested to hear if you're successful using it.<br>
<br>
John<br>
<div><div></div><div><br>
capecchi wrote:<br>
> John,<br>
> thanks very much for your help, I decided to convert my NetCDF file to GRIB1<br>
> file<br>
> using `cdo -f grb copy ...` command...do you have any (...) about known<br>
> problems with this<br>
> procedure?<br>
> Anyway I hope version 2.0 of MET will accept general format of NetCDF files.<br>
> Thanks again, bye, Valerio<br>
><br>
> 2008/9/23 John Halley Gotway <<a href="mailto:johnhg@rap.ucar.edu" target="_blank">johnhg@rap.ucar.edu</a>><br>
><br>
>> Valerio,<br>
>><br>
>> I do think that it would be reasonable to massage your NetCDF files into a<br>
>> format that METv1.1 would read. However, METv1.1 is only compatible with a<br>
>> rather rigid format of NetCDF at this point. For<br>
>> the next release of MET, version 2.0, we're planning to support a more<br>
>> general format of NetCDF.<br>
>><br>
>> Currently, MET expects gridded NetCDF data to abide by the following<br>
>> conventions:<br>
>><br>
>> (1) dimensions named "lat" and "lon" define the dimension of the data.<br>
>> (2) variables have only two dimensions, "lat" and "lon".<br>
>> (3) variables are named using the GRIB code abbreviation for the GRIB field<br>
>> they represent and are in the units prescribed by that GRIB code. For<br>
>> example, a variable containing accumulated<br>
>> precipitation would be named "APCP" (GRIB code abbreviation) and its units<br>
>> would be millimeters.<br>
>> (4) several variable attributes are required to define the initialization,<br>
>> valid, and accumulation (if applicable) times.<br>
>> (5) global attributes defining the grid on which the data resides must be<br>
>> defined.<br>
>><br>
>> The definition of the grid in (5) is necessary to perform conversions<br>
>> between lat/lon and grid x/y.<br>
>><br>
>> I've attached a sample output file from PCP-Combine. This example contains<br>
>> data on a lat/lon grid - which I'm guessing is the projection your data is<br>
>> on. The attached file that ends in ".dump" is<br>
>> just a dump of the NetCDF header. In that file, please note the following:<br>
>><br>
>> (1) The "lat" and "lon" dimensions are defined.<br>
>> (2) The variable named APCP contains accumulated precipitation in mm. The<br>
>> GRIB codes and corresponding abbreviations are defined here:<br>
>> <a href="http://www.nco.ncep.noaa.gov/pmb/docs/on388/table2.html" target="_blank">http://www.nco.ncep.noaa.gov/pmb/docs/on388/table2.html</a><br>
>> (3) The APCP variable contains the several attributes, but only the<br>
>> following are actually read by the code: level, init_time_ut, valid_time_ut,<br>
>> and accum_time (if not applicable, just set to 0).<br>
>> The "_ut" is for unixtime, or seconds since January 1, 1970.<br>
>> (4) Global attributes defining the projectsion:<br>
>> :Projection = "LatLon" ;<br>
>> :lat_ll_deg = "25.063000 degrees_north" ;<br>
>> :lon_ll_deg = "-124.938000 degrees_east" ;<br>
>> :delta_lat_deg = "0.125000 degrees" ;<br>
>> :delta_lon_deg = "0.125000 degrees" ;<br>
>> :Nlat = "224 grid_points" ;<br>
>> :Nlon = "464 grid_points" ;<br>
>> Here you'll just insert your grid definition info.<br>
>><br>
>> Hope that helps, and feel free to write with more questions about this.<br>
>><br>
>> John Halley-Gotway<br>
>> <a href="mailto:johnhg@ucar.edu" target="_blank">johnhg@ucar.edu</a><br>
>><br>
>><br>
>> capecchi wrote:<br>
>>> Dear met_help,<br>
>>> I'm currently involved in WRF verification issues for a biometeorological<br>
>>> service in Italy.<br>
>>> I'm interested in point-stat tools but I have, as input forecast data,<br>
>>> NetCDF files derived and post-elaborated from WRF GRIB1 output.<br>
>>> I read from MET User Guide that I'm supposed to provide as input data<br>
>> only<br>
>>> GRIB1 files or NetCDF format<br>
>>> that is output from the Pcp-Combine tool; I'm wondering if my NetCDF file<br>
>>> format are like the Pcp-Combine tool's format<br>
>>> (I'm attaching one as sample) or if you can suggest me some NetCDF to<br>
>> GRIB1<br>
>>> converter tools (like cdo, nco, or...)<br>
>>> Thanks in advance for any help you can give me, regards, Valerio Capecchi<br>
>>><br>
>>><br>
>> **************************************************************************<br>
>>> Valerio Capecchi<br>
>>><br>
>>><br>
>> --------------------------------------------------------------------------<br>
>>> Interdepartemental Centre of Bioclimatology - University of Florence<br>
>>> Piazzale delle Cascine 18<br>
>>> 50144 Firenze. Italia<br>
>>> Tel: +39 0553288257<br>
>>> Fax: +39 055332472<br>
>>><br>
>>> WEB <a href="http://www.unifi.it/cib" target="_blank">http://www.unifi.it/cib</a><br>
>>><br>
>> ---------------------------------------------------------------------------<br>
>>> CNR IBIMET - LaMMA (Laboratory for Meteorology and Environmental<br>
>> Modelling)<br>
>>> EDIFICIO D<br>
>>> VIA MADONNA DEL PIANO 50019 SESTO FIORENTINO (FI)<br>
>>> tel +39 055 5226041/2<br>
>>> fax +39 055 444083<br>
>>><br>
>>> <a href="http://www.lamma.rete.toscana.it/bioclima" target="_blank">http://www.lamma.rete.toscana.it/bioclima</a><br>
>>><br>
>> ---------------------------------------------------------------------------<br>
>>><br>
>> ***************************************************************************<br>
>>><br>
>>><br>
>>> ------------------------------------------------------------------------<br>
>>><br>
>>> _______________________________________________<br>
>>> Met_help mailing list<br>
>>> <a href="mailto:Met_help@mailman.ucar.edu" target="_blank">Met_help@mailman.ucar.edu</a><br>
>>> <a href="http://mailman.ucar.edu/mailman/listinfo/met_help" target="_blank">http://mailman.ucar.edu/mailman/listinfo/met_help</a><br>
>> netcdf nam.20070330.ncep110 {<br>
>> dimensions:<br>
>> lat = 224 ;<br>
>> lon = 464 ;<br>
>> variables:<br>
>> float lat(lat, lon) ;<br>
>> lat:units = "degrees_north" ;<br>
>> lat:long_name = "Latitude" ;<br>
>> lat:_FillValue = -9999.f ;<br>
>> float lon(lat, lon) ;<br>
>> lon:units = "degrees_east" ;<br>
>> lon:long_name = "Longitude" ;<br>
>> lon:_FillValue = -9999.f ;<br>
>> float APCP(lat, lon) ;<br>
>> APCP:grib_code = 61 ;<br>
>> APCP:units = "kg/m^2" ;<br>
>> APCP:long_name = "Total precipitation" ;<br>
>> APCP:level = "SFC" ;<br>
>> APCP:_FillValue = -9999.f ;<br>
>> APCP:init_time = "20070330_000000" ;<br>
>> APCP:init_time_ut = 1175212800 ;<br>
>> APCP:valid_time = "20070331_120000" ;<br>
>> APCP:valid_time_ut = 1175342400 ;<br>
>> APCP:accum_time = "6 hours" ;<br>
>><br>
>> // global attributes:<br>
</div></div>>> :FileOrigins = "File /home/johnhg/nam.20070330.ncep110.ncgenerated 20080923_163157 UTC on host billiken by the PCP-Combine tool" ;<br>
<div>>> :RunCommand = "Addition:<br>
>> /home/johnhg/nam.20070330.ncep110.grb with accumulation of 3 hours plus<br>
>> /home/johnhg/nam.20070330.ncep110.grb with accumulation of 3 hours." ;<br>
>> :Projection = "LatLon" ;<br>
>> :lat_ll_deg = "25.063000 degrees_north" ;<br>
>> :lon_ll_deg = "-124.938000 degrees_east" ;<br>
>> :delta_lat_deg = "0.125000 degrees" ;<br>
>> :delta_lon_deg = "0.125000 degrees" ;<br>
>> :Nlat = "224 grid_points" ;<br>
>> :Nlon = "464 grid_points" ;<br>
>> }<br>
>><br>
>><br>
><br>
><br>
</div><div><div></div><div>> ------------------------------------------------------------------------<br>
><br>
> _______________________________________________<br>
> Met_help mailing list<br>
> <a href="mailto:Met_help@mailman.ucar.edu" target="_blank">Met_help@mailman.ucar.edu</a><br>
> <a href="http://mailman.ucar.edu/mailman/listinfo/met_help" target="_blank">http://mailman.ucar.edu/mailman/listinfo/met_help</a><br>
</div></div></blockquote></div><br></div>