Project

General

Profile

Problem converting JRA55 grib to netcdf

Added by Lyndon Mark Olaguera over 3 years ago

I am using CDO version 1.9.8 and trying to convert a JRA55 6-hourly grib data to netcdf thru the following steps:

1. I created a ctl file using cdo gradsdes

2. I then used cdo -v -f nc import_binary ifile.ctl ofile.nc
I encountered the following error:

Open Error:  Unknown keyword in description file
  --> The invalid description file record is: 
  --> DTYPE GRIB
  The data file was not opened.

Attached are the ctl file and the resulting index file.

The DTYPE and INDEX cannot be recognized by CDO. If I remove them, the import_binary command works fine but stops at time step 47 and the output netcdf file is incorrect.

Any ideas on how to do this correctly in CDO?

I'll appreciate any help.:)

Sincerely,
Lyndz


Replies (9)

RE: Problem converting JRA55 grib to netcdf - Added by Ralf Mueller over 3 years ago

hi!

what you upload is not GRIB data I think.

there must be an official documentation on how to work with the data. I cannot access JRA-55, so I cannot comment on it.

cheers
ralf

RE: Problem converting JRA55 grib to netcdf - Added by Ralf Mueller over 3 years ago

hi Lyndz!

I can convert your upload to netcdf like this

cdo -f nc --eccodes copy anl_p125.033_ugrd.2004010100_2004013118.olaguera442881 ~/out.nc
I use cdo-1.9.8
Climate Data Operators version 1.9.8 (https://mpimet.mpg.de/cdo)
System: x86_64-pc-linux-gnu
CXX Compiler: g++ -g -O3 -std=c++11 -Wall -fopenmp -march=native  -ftree-vectorize -mavx2  
CXX version : g++ (Arch Linux 9.3.0-1) 9.3.0
C Compiler: gcc -g -O3 -std=gnu99 -Wall -fopenmp -march=native -ftree-vectorize -mavx2   
C version : gcc (Arch Linux 9.3.0-1) 9.3.0
F77 Compiler: gfortran -g -O2
F77 version : GNU Fortran (Arch Linux 9.3.0-1) 9.3.0
Features: 15GB 8threads C++11 Fortran DATA PTHREADS OpenMP HDF5 NC4/HDF5 OPeNDAP SZ UDUNITS2 PROJ XML2 MAGICS CURL FFTW3 AVX2
Libraries: HDF5/1.12.0 proj/6.3.1 xml2/2.9.10 curl/7.71.1(h7.69.1)
Filetypes: srv ext ieg grb1 grb2 nc1 nc2 nc4 nc4c nc5 
     CDI library version : 1.9.8
 cgribex library version : 1.9.4
 ecCodes library version : 2.14.1
  NetCDF library version : 4.7.4 of Apr 10 2020 23:29:06 $
    hdf5 library version : 1.12.0
    exse library version : 1.4.1
    FILE library version : 1.8.3

RE: Problem converting JRA55 grib to netcdf - Added by Lyndon Mark Olaguera over 3 years ago

Hi Ralf,

OMG! This is awesome!:)

Didn't know this aside from the import_binary.

Thank you!

Sincerely,
Lyndz

RE: Problem converting JRA55 grib to netcdf - Added by Layla Smith almost 2 years ago

Hello! I have been having the same issue. I tried Ralf's answer to see if it would work with the ctl file I am using (anl_surf.ctl, attached to this message) and I am receiving this error:

Warning (cdiSetEccodesGrib1): ecCodes support not compiled in, used CGRIBEX to decode/encode GRIB1 records!
cdo copy: Open failed on >/scratch/gwarne/testA8/20180101/anl_surf.ctl<
Unsupported file type

RE: Problem converting JRA55 grib to netcdf - Added by Estanislao Gavilan almost 2 years ago

Hi

Did you build the cdo library with eccodes? By default with-eccodes=False

Warning (cdiSetEccodesGrib1): * ecCodes support not compiled in* , used CGRIBEX to decode/encode GRIB1 records!
cdo copy: Open failed on >/scratch/gwarne/testA8/20180101/anl_surf.ctl<
Unsupported file type

RE: Problem converting JRA55 grib to netcdf - Added by Layla Smith almost 2 years ago

Estanislao you are right, I didn't build the cdo library with eccodes. I ended up building cdo with eccodes and I tried using

cdo -f nc copy anl_surf.ctl anl_surf.nc

but I was given the error:

cdo copy: Open failed on >/scratch/gwarne/testA5/20180101/anl_surf.ctl<
Unsupported file type

RE: Problem converting JRA55 grib to netcdf - Added by Layla Smith almost 2 years ago

Sorry, I meant to say I tried using the line:

cdo -f nc --eccodes copy anl_surf.ctl anl_surf.nc

I attached the .ctl file I used.

RE: Problem converting JRA55 grib to netcdf - Added by Karin Meier-Fleischer almost 2 years ago

Hi Grace,

you can't use a ctl file like a netCDF or GRIB file. https://code.mpimet.mpg.de/projects/cdo/wiki/FAQ#How-can-I-convert-a-GrADS-binary-file-to-netCDF

cdo -f nc import_binary infile.ctl outfile
    (1-9/9)