Project

General

Profile

Does CDO support opening a GrADs .ctl file?

Added by Layla Smith almost 2 years ago

Hello CDO community,

I have been trying to figure out how to use CDO to convert a GrADs .ctl file with GRIB data to a NetCDF format. I used the following line of code to try and convert it:


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

But I receive the following error that my .ctl file is an unsupported file type?

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

Does anyone know of a way to fix this error or does cdo really not support opening GrADs .ctl files? Any help is appreciated, thank you!


Replies (6)

RE: Does CDO support opening a GrADs .ctl file? - Added by Layla Smith almost 2 years ago

Here is the .ctl and .idx file if you would like to try yourself.

RE: Does CDO support opening a GrADs .ctl file? - Added by Layla Smith almost 2 years ago

I should have said this above, but I know that cdo supports opening a GrADs .ctl file with binary data. I am wondering if it supports opening a GrADs .ctl file with GRIB data.

RE: Does CDO support opening a GrADs .ctl file? - Added by Karin Meier-Fleischer almost 2 years ago

See 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

We cannot do a test if CDO can read the data because the data file itself is not uploaded (see in the .ctl file DSET). And again, CDO

RE: Does CDO support opening a GrADs .ctl file? - Added by Layla Smith almost 2 years ago

The answers for both of those forums do not work in solving my issue. import_binary does not support the INDEX component of the .ctl file needed for the GRIB data. Additionally, I tried using ecCodes (as shown above) suggested by the other forum and was told the .ctl file could not be opened and is unsupported by CDO. I attached the data file you would need to test it.

RE: Does CDO support opening a GrADs .ctl file? - Added by Karin Meier-Fleischer almost 2 years ago

Thanks for the data file but there is still a file missing. I got the following error message from grads that TL319.pdef is missing.

Scanning description file:  anl_surf.ctl
  Error opening pdef file:  TL319.pdef
Open Error: Invalid pdef record.
  --> The invalid description file record is: 
  --> pdef 157792 1 file 1 stream binary-big ^TL319.pdef
  The data file was not opened.

We are not experts in GrADS. Maybe it would be better to ask in the GrADS forum how to convert the file into a netCDF file because it is the only way if you want to use it with CDO.

    (1-6/6)