# GRIB to NetCDF File | Download as NetCDF File

**URL:** <https://forum.ecmwf.int/t/grib-to-netcdf-file-download-as-netcdf-file/1397>\
**Category:** C3S - Datasets and Usage\
**Tags:** netcdf, c3s, grib, carra, conversion\
**Created:** [7 July 2023 09:44 UTC](https://forum.ecmwf.int/t/grib-to-netcdf-file-download-as-netcdf-file/1397 "2023-07-07T09:44:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kim\_Cholibois](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/k/ec9cab/32.png) [@Kim\_Cholibois](https://forum.ecmwf.int/u/Kim_Cholibois)\
**Post date:** [7 July 2023 09:44 UTC](https://forum.ecmwf.int/t/grib-to-netcdf-file-download-as-netcdf-file/1397/1 "2023-07-07T09:44:04Z")

</div>

Dear all,

I have been trying to download Arctic regional reanalysis on single levels from 1991 to present for the following parameters: 10m wind direction, 10m wind speed, 2m temperature, Albedo, Surface net solar radiation, Total cloud cover. The timeframe is 2022 and 2023 and forecasting.

Unfortunately trying to do the NetCDF experimental download takes over 10 hours in total. If I download it as a grib file, it also takes about 3-4 hours and I have difficulties to convert it to a netcdf file as it says that the grid type is not compatible, see below

grib\_to\_netcdf -o [westdomain.nc](http://westdomain.nc) westdomain.grib  
grib\_to\_netcdf: Version 2.30.2  
grib\_to\_netcdf: Processing input file 'westdomain.grib'.  
grib\_to\_netcdf: Found 23256 GRIB fields in 1 file.  
grib\_to\_netcdf: Ignoring key(s): method, type, stream, refdate, hdate  
grib\_to\_netcdf: Creating netCDF file '[westdomain.nc](http://westdomain.nc)'  
grib\_to\_netcdf: NetCDF library version: 4.9.2 of May 19 2023 11:45:38 $  
grib\_to\_netcdf: Creating large (64 bit) file format.

ECCODES ERROR &nbsp; :&nbsp; Grid type = lambert  
ECCODES ERROR &nbsp; :&nbsp; First GRIB is not on a regular lat/lon grid or on a regular Gaussian grid. Exiting.

See below the gridtype:

gridtype&nbsp; = projection  
gridsize&nbsp; = 1356561  
xsize &nbsp; &nbsp; = 1069  
ysize &nbsp; &nbsp; = 1269  
xname &nbsp; &nbsp; = x  
xunits&nbsp; &nbsp; = "m"  
yname &nbsp; &nbsp; = y  
yunits&nbsp; &nbsp; = "m"  
xfirst&nbsp; &nbsp; = 0  
xinc&nbsp; &nbsp; &nbsp; = 2500  
yfirst&nbsp; &nbsp; = 0  
yinc&nbsp; &nbsp; &nbsp; = 2500  
grid\_mapping = Lambert\_Conformal  
grid\_mapping\_name = lambert\_conformal\_conic  
standard\_parallel = 72.  
longitude\_of\_central\_meridian = 324.  
latitude\_of\_projection\_origin = 72.  
earth\_radius = 6371229.  
false\_easting = 1334998.98470491  
false\_northing = 1584946.01136235  
longitudeOfFirstGridPointInDegrees = 302.903  
latitudeOfFirstGridPointInDegrees = 55.81

If anyone has encountered the same problems, I would appreciate some advice. Thank you very much!

---

<div class="post-metadata">

**Author:** ![Semjon\_Schimanke](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/s/cc9497/32.png) [@Semjon\_Schimanke](https://forum.ecmwf.int/u/Semjon_Schimanke)\
**Post date:** [7 July 2023 10:18 UTC](https://forum.ecmwf.int/t/grib-to-netcdf-file-download-as-netcdf-file/1397/2 "2023-07-07T10:18:17Z")

</div>

Hi Kim,

usually I am happy with grib format but I just tried to convert CARRA T2m from grib to netcdf with the help of CDO and that worked smoothly. More info on CDO: [https://code.mpimet.mpg.de/projects/cdo](https://code.mpimet.mpg.de/projects/cdo)  
 The command that I used: cdo -f nc copy T2m\_an\_202012.grb [T2m\_an\_202012.nc](http://T2m_an_202012.nc)  
 I opened the netcdf-file with ncview and it looks fine. Also the grid description in the netcdf-file seems correct.

So, you might try to convert with CDO.

Best regards,  
 Semjon

---

<div class="post-metadata">

**Author:** ![Kim\_Cholibois](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/k/ec9cab/32.png) [@Kim\_Cholibois](https://forum.ecmwf.int/u/Kim_Cholibois)\
**Post date:** [7 July 2023 10:53 UTC](https://forum.ecmwf.int/t/grib-to-netcdf-file-download-as-netcdf-file/1397/3 "2023-07-07T10:53:04Z")

</div>

Hi Semjon,

thank you for your answer! I have also tried cdo -f nc copy and there I encounter this issue:

**cdi&nbsp; warning (gribapiScanTimestep): Record 45 (name=dsrp id=54.4.0 lev1=0 lev2=0) timestep 9: Parameter not defined at timestep 1!  
cdo&nbsp; &nbsp; copy: Processed 54262440 values from 5 variables over 8 timesteps [1.14s 68MB]**

Hence, the parameter dsrp gets erased .. Have you encountered this problem before?

All the best,

Kim

---

<div class="post-metadata">

**Author:** ![Semjon\_Schimanke](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/s/cc9497/32.png) [@Semjon\_Schimanke](https://forum.ecmwf.int/u/Semjon_Schimanke)\
**Post date:** [7 July 2023 12:32 UTC](https://forum.ecmwf.int/t/grib-to-netcdf-file-download-as-netcdf-file/1397/4 "2023-07-07T12:32:51Z")

</div>

Hi,

no, I am not accounting this problem. There is no warning/error message when I run the command:  
**sm\_semsc@bi3:T2m$ cdo -f nc4 copy T2m\_an\_202012.grb T2m\_an\_202012.nc4**  
**cdo &nbsp; &nbsp;copy: Processed 1 variable over 248 timesteps [7.50s 95MB].**  
**sm\_semsc@bi3:T2m$**

Have you tried with one parameter at a time? In my case, it's T2m only. Perhaps, this issue is related to the wind or another parameter?

Best regards,  
 Semjon

---

<div class="post-metadata">

**Author:** ![Kim\_Cholibois](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/k/ec9cab/32.png) [@Kim\_Cholibois](https://forum.ecmwf.int/u/Kim_Cholibois)\
**Post date:** [7 July 2023 21:06 UTC](https://forum.ecmwf.int/t/grib-to-netcdf-file-download-as-netcdf-file/1397/5 "2023-07-07T21:06:58Z")

</div>

Hi again,

this will be my next attempt yes. I will download a dataset per parameter and then merge them after they are converted to netCDF.

Thank you for your help.

All the best,

Kim

---

<div class="post-metadata">

**Author:** ![Kim\_Cholibois](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/k/ec9cab/32.png) [@Kim\_Cholibois](https://forum.ecmwf.int/u/Kim_Cholibois)\
**Post date:** [8 July 2023 10:11 UTC](https://forum.ecmwf.int/t/grib-to-netcdf-file-download-as-netcdf-file/1397/6 "2023-07-08T10:11:27Z")

</div>

This worked, thank you! I have one question, does your final .nc file have lat and lon parameters? For me it's still the Lambert\_Conformal and I would love to convert the grid to lat and lon. Do you know how this works? I tried with the grib files before without success.

All the best,

Kim

---

<div class="post-metadata">

**Author:** ![Semjon\_Schimanke](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/s/cc9497/32.png) [@Semjon\_Schimanke](https://forum.ecmwf.int/u/Semjon_Schimanke)\
**Post date:** [10 July 2023 06:28 UTC](https://forum.ecmwf.int/t/grib-to-netcdf-file-download-as-netcdf-file/1397/7 "2023-07-10T06:28:25Z")

</div>

The grid remains unchanged when changing from grib to netcdf. If you want the data on a different grid then you would need to perform an interpolation to the new grid. That's at least my understanding.

If you have a grid description of your desired grid you could try the CDOs to do the jobb. For example, you could test a Bilinear interpolation with the command "remapbil".

cdo remapbil,TARGET\_GRID INFILE OUTFILE

Best regards,  
 Semjon

---

<div class="post-metadata">

**Author:** ![Kim\_Cholibois](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/k/ec9cab/32.png) [@Kim\_Cholibois](https://forum.ecmwf.int/u/Kim_Cholibois)\
**Post date:** [10 July 2023 06:59 UTC](https://forum.ecmwf.int/t/grib-to-netcdf-file-download-as-netcdf-file/1397/8 "2023-07-10T06:59:21Z")

</div>

Yes, this way I understood it as well. I am just not very familiar with this interpolation.

I will see how I can do this as I need lat and lon as variables which is not given with the current grid type.

All the best,

Kim
