Project

General

Profile

I want to convert my .nc (tas_Amon_HadGEM2-ES_historical_r1i1p1_185912-188411) into grib data

Added by jyoti lodha over 6 years ago

Hi
I am getting a error while converting .nc file to grib file. :
I have issued the following command :
jyoti@jyoti-HP-Pavilion-Notebook:/usr/share/doc/cdo/jyo$ *cdo -b 16 -f grb copy india.nc file.grb
*my error is
__
!!! grib_set_string( grib_handle* h, "cfName", "air_temperature") !!!
Warning (gribapiDefParam) : grib_api: No match for cfName=air_temperature
GRIB_API ERROR : concept: no match for shortName=tas
!!! grib_set_string( grib_handle* h, "shortName", "tas") !!!
Warning (gribapiDefParam) : grib_api: No match for shortName=tas
cdo copy: Processed 255000 values from 1 variable over 600 timesteps ( 0.19s )

Kindly please help me to solve it. I have attached my file india.nc

error_netcdf_grib.png (416 KB) error_netcdf_grib.png error screenshot
india.nc (1010 KB) india.nc netcdf file

Replies (31)

RE: I want to convert my .nc (tas_Amon_HadGEM2-ES_historical_r1i1p1_185912-188411) into grib data - Added by Ralf Mueller over 6 years ago

Hi!

I can try to translate the error msg: The grib_api library (responsable for reading/writing) tells you, that the netcdf shortname "tas" and the standard_name "air_temperature" (used in india.nc) cannot be matched to anything known within the grib standard. GRIB is unlike netcdf not self-describing. The procedure of file conversion depends on the grib_api installation on your system, which I have no knowledge about.

To solve the issue, you should use a GRIB-compiliant varable name instead of tas. have a look here: http://apps.ecmwf.int/codes/grib/param-db

this works on my system:

  • grib1:
    cdo -b 16 -f grb copy -chname,tas,t india.nc file.grb
  • grib2:
    cdo -b 16 -f grb2 copy -chname,tas,t india.nc file.grb2

my CDO version is like this

% cdo -V                                                                                                                                                                                  [Wed 2018-03-21|09:44:39]
Climate Data Operators version 1.9.3 (http://mpimet.mpg.de/cdo)
Compiled: by ram on melian (x86_64-unknown-linux-gnu) Feb  8 2018 14:16:01
CXX Compiler: g++ -g -O3 -std=c++11 -Wall -fopenmp -march=native   
CXX version : g++ (GCC) 7.3.0
C Compiler: gcc -g -O3 -std=gnu99 -Wall -fopenmp -march=native   
C version : gcc (GCC) 7.3.0
F77 Compiler: gfortran -g -O2
F77 version : GNU Fortran (GCC) 7.3.0
Features: 15GB C++11 Fortran DATA PTHREADS OpenMP45 HDF5 NC4/HDF5 OPeNDAP SZ UDUNITS2 PROJ.4 XML2 MAGICS CURL FFTW3 AVX2
Libraries: HDF5/1.10.1 proj/4.93 xml2/2.9.7 curl/7.59.0(h7.58.0)
Filetypes: srv ext ieg grb1 grb2 nc1 nc2 nc4 nc4c nc5 
     CDI library version : 1.9.3 of Feb  8 2018 14:15:17
 CGRIBEX library version : 1.9.0 of Jan 22 2018 09:24:03
GRIB_API library version : 2.4.1
  NetCDF library version : 4.5.0 of Oct 28 2017 00:21:44 $
    HDF5 library version : 1.10.1
    EXSE library version : 1.4.0 of Feb  8 2018 14:15:12
    FILE library version : 1.8.3 of Feb  8 2018 14:15:12

RE: I want to convert my .nc (tas_Amon_HadGEM2-ES_historical_r1i1p1_185912-188411) into grib data - Added by Ralf Mueller over 6 years ago

btw, you only got a warning, not an error. so I guess something has been written to file.grb

RE: I want to convert my .nc (tas_Amon_HadGEM2-ES_historical_r1i1p1_185912-188411) into grib data - Added by jyoti lodha over 6 years ago

Thanks for the reply, I used the following command and it also converted to grib file, but the file was corrupted, no proper details are found as according to netcdf file. So I want to ask that I have to write a code for this in cdo for converting it into grib file, or something else has to be done as I have to use this file as a input of (ungrib.exe) file in wrf model .
I have attached my grib files below,

cdo -b 16 -f grb copy -chname,tas,t india.nc file.grb__

output--
cdo copy: Started child process "chname,tas,t india.nc (pipe1.1)".
!!! grib_set_string( grib_handle
h, "cfName", "air_temperature") !!!
Warning (gribapiDefParam) : grib_api: No match for cfName=air_temperature
cdo(2) chname: Processed 255000 values from 1 variable over 600 timesteps ( 0.24s )
cdo copy: Processed 255000 values from 1 variable over 600 timesteps ( 0.25s )*

jyoti@jyoti-HP-Pavilion-Notebook:/usr/share/doc/cdo/jyo$ cdo -V
Climate Data Operators version 1.7.0 (http://mpimet.mpg.de/cdo)
Compiler: gcc -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wall -pedantic -fPIC -fopenmp
version: gcc (Ubuntu 5.3.1-9ubuntu2) 5.3.1 20160220
Features: DATA PTHREADS OpenMP4 HDF5 NC4/HDF5/threadsafe OPeNDAP SZ Z UDUNITS2 PROJ.4 MAGICS CURL FFTW3 SSE2
Libraries: HDF5/1.8.16 proj/4.92 curl/7.47.0
Filetypes: srv ext ieg grb grb2 nc nc2 nc4 nc4c
CDI library version : 1.7.0
GRIB_API library version : 1.14.4
netCDF library version : 4.4.0 of Mar 29 2016 11:41:40 $
HDF5 library version : 1.8.16
SERVICE library version : 1.4.0
EXTRA library version : 1.4.0
IEG library version : 1.4.0
FILE library version : 1.
Waiting for a positive response.

file.grb2 (603 KB) file.grb2 grib files
file.grb (561 KB) file.grb

RE: I want to convert my .nc (tas_Amon_HadGEM2-ES_historical_r1i1p1_185912-188411) into grib data - Added by Ralf Mueller over 6 years ago

grib_api version 1.14 and cdo-1.7.0 is VERY old. please consider using more recent versions.

RE: I want to convert my .nc (tas_Amon_HadGEM2-ES_historical_r1i1p1_185912-188411) into grib data - Added by jyoti lodha over 6 years ago

How I can update these version of cdo on my linux platform. Can u suggest me any command in linux to upgrade these.

RE: I want to convert my .nc (tas_Amon_HadGEM2-ES_historical_r1i1p1_185912-188411) into grib data - Added by Ralf Mueller over 6 years ago

You might have a look at https://code.mpimet.mpg.de/projects/cdo/wiki#Installation-and-Supported-Platforms

For Linux you can use precompiles debian packages, ArchLinux packages, conda or a docker-based solution

hth
ralf

RE: I want to convert my .nc (tas_Amon_HadGEM2-ES_historical_r1i1p1_185912-188411) into grib data - Added by jyoti lodha over 6 years ago

Hi
When I am have installed new veriosn(9.1) of CDO I am getting the following things, as a error, I am not able to accees .nc(netcdf) file in this.

cdo b 16 -f grb2 copy -chname,tas,t india.nc file.grb2-- When I executed this command

cdo copy: Started child process "chname,tas,t india.nc (pipe1.1)".

cdo(2) chname: Open failed on >india.nc<
Unsupported file type (library support not compiled in)
To create a CDO application with NetCDF support use: ./configure --with-netcdf=<NetCDF root directory> ...

cdo -v
OpenMP: num_procs=4 max_threads=1
libgomp: while loading libgomp-plugin-host_nonshm.so.1: libgomp-plugin-host_nonshm.so.1: cannot open shared object file: No such file or directory
num_devices=0

No operator given!

usage : cdo [Options] Operator1 [-Operator2 [-OperatorN]]

Options:
-a Generate an absolute time axis
-b &lt;nbits&gt; Set the number of bits for the output precision
(I8/I16/I32/F32/F64 for nc1/nc2/nc4/nc4c/nc5; F32/F64 for grb2/srv/ext/ieg; P1 - P24 for grb1/grb2)
Add L or B to set the byteorder to Little or Big endian
--cmor CMOR conform NetCDF output
-C, --color Colorized output messages
--enableexcept &lt;except&gt;
Set individual floating-point traps (DIVBYZERO, INEXACT, INVALID, OVERFLOW, UNDERFLOW, ALL_EXCEPT)
-f, --format &lt;format&gt;
Format of the output file. (grb1/grb2/nc1/nc2/nc4/nc4c/nc5/srv/ext/ieg)
-g &lt;grid&gt; Set default grid name or file. Available grids:
n&lt;N&gt;, t&lt;RES&gt;, tl&lt;RES&gt;, global_&lt;DXY&gt;, r&lt;NX&gt;x&lt;NY&gt;, g&lt;NX&gt;x&lt;NY&gt;, gme&lt;NI&gt;, lon=&lt;LON&gt;/lat=&lt;LAT&gt;
-h, --help Help information for the operators
--history Do not append to NetCDF "history" global attribute
--netcdf_hdr_pad, --hdr_pad, --header_pad &lt;nbr&gt;
Pad NetCDF output header with nbr bytes
-k &lt;chunktype&gt; NetCDF4 chunk type: auto, grid or lines
-L Lock IO (sequential access)
-M Switch to indicate that the I/O streams have missing values
-m &lt;missval&gt; Set the missing value of non NetCDF files (default: -9e+33)
--no_warnings Inhibit warning messages
-O Overwrite existing output file, if checked
--operators List of all operators
-P &lt;nthreads&gt; Set number of OpenMP threads
--percentile &lt;method&gt;
Percentile method: nrank, nist, numpy, numpy_lower, numpy_higher, numpy_nearest
--precision &lt;float_digits[,double_digits]&gt;
Precision to use in displaying floating-point data (default: 7,15)
--reduce_dim Reduce NetCDF dimensions
-R, --regular Convert GRIB1 data from reduced to regular grid (cgribex only)
-r Generate a relative time axis
-S Create an extra output stream for the module TIMSTAT. This stream
contains the number of non missing values for each output period.
-s, --silent Silent mode
--sortname Alphanumeric sorting of NetCDF parameter names
-t &lt;codetab&gt; Set GRIB1 default parameter code table name or file (cgribex only)
Predefined tables: echam4 echam5 echam6 mpiom1 ecmwf remo cosmo002 cosmo201 cosmo202 cosmo203 cosmo205 cosmo250
--timestat_date &lt;srcdate&gt;
Target timestamp (time statistics): first, middle, midhigh or last source timestep.
-V, --version Print the version number
-v, --verbose Print extra details for some operators
-W Print extra warning messages
-z szip SZIP compression of GRIB1 records
aec AEC compression of GRIB2 records
jpeg JPEG compression of GRIB2 records
zip[_1-9] Deflate compression of NetCDF4 variables
Operators:
Use option --operators for a list of all operators.
CDO version 1.9.3, Copyright (C) 2003-2018 Uwe Schulzweida
This is free software and comes with ABSOLUTELY NO WARRANTY
Report bugs to &lt;http://mpimet.mpg.de/cdo&gt;

RE: I want to convert my .nc (tas_Amon_HadGEM2-ES_historical_r1i1p1_185912-188411) into grib data - Added by jyoti lodha over 6 years ago

jyoti@jyoti-HP-Pavilion-Notebook:~$ cdo -v
OpenMP: num_procs=4 max_threads=1
libgomp: while loading libgomp-plugin-host_nonshm.so.1: libgomp-plugin-host_nonshm.so.1: cannot open shared object file: No such file or directory
num_devices=0

No operator given!

usage : cdo [Options] Operator1 [-Operator2 [-OperatorN]]

Options:
-a Generate an absolute time axis
-b &lt;nbits&gt; Set the number of bits for the output precision
(I8/I16/I32/F32/F64 for nc1/nc2/nc4/nc4c/nc5; F32/F64 for grb2/srv/ext/ieg; P1 - P24 for grb1/grb2)
Add L or B to set the byteorder to Little or Big endian
--cmor CMOR conform NetCDF output
-C, --color Colorized output messages
--enableexcept &lt;except&gt;
Set individual floating-point traps (DIVBYZERO, INEXACT, INVALID, OVERFLOW, UNDERFLOW, ALL_EXCEPT)
-f, --format &lt;format&gt;
Format of the output file. (grb1/grb2/nc1/nc2/nc4/nc4c/nc5/srv/ext/ieg)
-g &lt;grid&gt; Set default grid name or file. Available grids:
n&lt;N&gt;, t&lt;RES&gt;, tl&lt;RES&gt;, global_&lt;DXY&gt;, r&lt;NX&gt;x&lt;NY&gt;, g&lt;NX&gt;x&lt;NY&gt;, gme&lt;NI&gt;, lon=&lt;LON&gt;/lat=&lt;LAT&gt;
-h, --help Help information for the operators
--history Do not append to NetCDF "history" global attribute
--netcdf_hdr_pad, --hdr_pad, --header_pad &lt;nbr&gt;
Pad NetCDF output header with nbr bytes
-k &lt;chunktype&gt; NetCDF4 chunk type: auto, grid or lines
-L Lock IO (sequential access)
-M Switch to indicate that the I/O streams have missing values
-m &lt;missval&gt; Set the missing value of non NetCDF files (default: -9e+33)
--no_warnings Inhibit warning messages
-O Overwrite existing output file, if checked
--operators List of all operators
-P &lt;nthreads&gt; Set number of OpenMP threads
--percentile &lt;method&gt;
Percentile method: nrank, nist, numpy, numpy_lower, numpy_higher, numpy_nearest
--precision &lt;float_digits[,double_digits]&gt;
Precision to use in displaying floating-point data (default: 7,15)
--reduce_dim Reduce NetCDF dimensions
-R, --regular Convert GRIB1 data from reduced to regular grid (cgribex only)
-r Generate a relative time axis
-S Create an extra output stream for the module TIMSTAT. This stream
contains the number of non missing values for each output period.
-s, --silent Silent mode
--sortname Alphanumeric sorting of NetCDF parameter names
-t &lt;codetab&gt; Set GRIB1 default parameter code table name or file (cgribex only)
Predefined tables: echam4 echam5 echam6 mpiom1 ecmwf remo cosmo002 cosmo201 cosmo202 cosmo203 cosmo205 cosmo250
--timestat_date &lt;srcdate&gt;
Target timestamp (time statistics): first, middle, midhigh or last source timestep.
-V, --version Print the version number
-v, --verbose Print extra details for some operators
-W Print extra warning messages
-z szip SZIP compression of GRIB1 records
aec AEC compression of GRIB2 records
jpeg JPEG compression of GRIB2 records
zip[_1-9] Deflate compression of NetCDF4 variables
Operators:
Use option --operators for a list of all operators.
CDO version 1.9.3, Copyright (C) 2003-2018 Uwe Schulzweida
This is free software and comes with ABSOLUTELY NO WARRANTY
Report bugs to &lt;http://mpimet.mpg.de/cdo&gt;

RE: I want to convert my .nc (tas_Amon_HadGEM2-ES_historical_r1i1p1_185912-188411) into grib data - Added by jyoti lodha over 6 years ago

I tried to solve the above problem, but now I am not able to convert .nc(netcdf file) to grib file. I an using CDO version 1.9.3.

cdo -b 16 -f grb2 copy -chname,tas,t india.nc file.grb2
cdo copy: Started child process "chname,tas,t india.nc (pipe1.1)".

cdo copy: Open failed on >file.grb2<
Unsupported file type (library support not compiled in)

waiting for a positive response.

RE: I want to convert my .nc (tas_Amon_HadGEM2-ES_historical_r1i1p1_185912-188411) into grib data - Added by jyoti lodha over 6 years ago

Thanks for the reply

Climate Data Operators version 1.9.3 (http://mpimet.mpg.de/cdo)
Compiled: by jyoti on jyoti-HP-Pavilion-Notebook (x86_64-unknown-linux-gnu) Apr 2 2018 11:41:35
CXX Compiler: g++ -std=gnu++11 -g -O2 -fopenmp
CXX version : g++ (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
C Compiler: gcc -g -O2 -fopenmp
C version : gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
F77 Compiler: f77 -g -O2
F77 version : unknown
Features: 6GB C++11 Fortran DATA PTHREADS OpenMP4 SSE2
Libraries:
Filetypes: srv ext ieg grb1 nc1 nc5
CDI library version : 1.9.3 of Apr 2 2018 11:37:31
CGRIBEX library version : 1.9.0 of Jan 22 2018 09:24:03
NetCDF library version : 4.4.0 of Mar 29 2016 11:41:40 $
EXSE library version : 1.4.0 of Apr 2 2018 11:37:01
FILE library version : 1.8.3 of Apr 2 2018 11:36:51

RE: I want to convert my .nc (tas_Amon_HadGEM2-ES_historical_r1i1p1_185912-188411) into grib data - Added by Ralf Mueller over 6 years ago

for IO with grib2 format, you have to

  1. install grib_api or eccodes(recommended) from ecmwf.int
  2. build CDO with additional configure option --with-grib_api or --with-eccodes

afaik there is a debian package for CDO, it might have all the featires, you need.

hth
ralf

RE: I want to convert my .nc (tas_Amon_HadGEM2-ES_historical_r1i1p1_185912-188411) into grib data - Added by jyoti lodha over 6 years ago

Thanks for the reply.

I have download the debian package, and extracted the file of debain(cdo_1.9.3+dfsg.1-1.debian.tar.xz) but how to configure the CDO debain package. I have unzip the file of debain afte, what command I have to give, to install it in linux platform.

RE: I want to convert my .nc (tas_Amon_HadGEM2-ES_historical_r1i1p1_185912-188411) into grib data - Added by Ralf Mueller over 6 years ago

ubuntu IS a dabian-based system, hence all debian pkgs are ubuntu packages. To install a package, just use

apt-get install cdo

of cause, root-privileges are needed

RE: I want to convert my .nc (tas_Amon_HadGEM2-ES_historical_r1i1p1_185912-188411) into grib data - Added by jyoti lodha over 6 years ago

Thanks for the reply, Still I am getting the error in installtion cdo
sudo apt-get install cdo
Reading package lists... Done
Building dependency tree
Reading state information... Done
cdo is already the newest version (1.7.0+dfsg.1-2build2).
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
cdo : Depends: libcdi0 (= 1.7.0+dfsg.1-2build2) but it is not going to be installed
Depends: libmagplus3v5 but it is not going to be installed
Depends: libproj9 (>= 4.8.0) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

RE: I want to convert my .nc (tas_Amon_HadGEM2-ES_historical_r1i1p1_185912-188411) into grib data - Added by Ralf Mueller over 6 years ago

ok, then I recommend using Miniconda from the Anaconda page. it's very easy to install and does support grib2 out of the box.

RE: I want to convert my .nc (tas_Amon_HadGEM2-ES_historical_r1i1p1_185912-188411) into grib data - Added by jyoti lodha over 6 years ago

Thanks for the reply.

I succeed in converting it to grib file, but it doesn't contain projection and not support(Curvilinear grids) how to resolve it. And lat and lon are also not correct exactly.

*cdo -b 16 -f grb2 copy -chname,tas,t tasmax_WAS-44_MPI-M-MPI-ESM-LR_historical_r1i1p1_MPI-CSC-REMO2009_v1_day_19610101-19651231.nc file.grb2

cdo copy: Started child process "chname,tas,t tasmax_WAS-44_MPI-M-MPI-ESM-LR_historical_r1i1p1_MPI-CSC-REMO2009_v1_day_19610101-19651231.nc (pipe1.1)".
Warning (gribapiDefGrid) : Curvilinear grids are unsupported in GRIB format! Created wrong GDS!
cdo(2) chname: Processed 45814340 values from 1 variable over 1826 timesteps ( 6.58s )
cdo copy: Processed 45814340 values from 1 variable over 1826 timesteps ( 6.58s )*

cdo- V --yoti@jyoti-HP-Pavilion-Notebook:~/Documents$ cdo -V
Climate Data Operators version 1.7.0 (http://mpimet.mpg.de/cdo)
Compiler: gcc -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wall -pedantic -fPIC -fopenmp
version: gcc (Ubuntu 5.3.1-9ubuntu2) 5.3.1 20160220
Features: DATA PTHREADS OpenMP4 HDF5 NC4/HDF5/threadsafe OPeNDAP SZ Z UDUNITS2 PROJ.4 MAGICS CURL FFTW3 SSE2
Libraries: HDF5/1.8.16 proj/4.92 curl/7.47.0
Filetypes: srv ext ieg grb grb2 nc nc2 nc4 nc4c
CDI library version : 1.7.0
GRIB_API library version : 1.14.4
netCDF library version : 4.4.0 of Mar 29 2016 11:41:40 $
HDF5 library version : 1.8.16
SERVICE library version : 1.4.0
EXTRA library version : 1.4.0
IEG library version : 1.4.0
FILE library version : 1.8.2

RE: I want to convert my .nc (tas_Amon_HadGEM2-ES_historical_r1i1p1_185912-188411) into grib data - Added by Ralf Mueller over 6 years ago

you should interpolate the data onto a grid supported by GRIB, e.g. a regular lonlat grid - and to the grib2 conversion afterwards.

RE: I want to convert my .nc (tas_Amon_HadGEM2-ES_historical_r1i1p1_185912-188411) into grib data - Added by jyoti lodha over 6 years ago

Thanks for the reply, It worked to some extent. But how to know about the projection of .nc file and grib file. Because it only give the infomation about lon and lat as the data has projection, so how to check the projection of .nc and grib file. Eg- Lambert conformal projection or Mercator.

yoti@jyoti-HP-Pavilion-Notebook:~/Documents/MOHC-HadGEM2-ES_historical_r1i1p1_185912-190911$ cdo griddes india.grb2 #
  1. gridID 1 #
    gridtype = lonlat
    gridsize = 425
    xname = lon
    xlongname = longitude
    xunits = degrees_east
    yname = lat
    ylongname = latitude
    yunits = degrees_north
    xsize = 17
    ysize = 25
    xfirst = 67.5
    xinc = 1.875
    yfirst = 7.5
    yinc = 1.25
    cdo griddes: Processed 1 variable ( 0.30s )
    jyoti@jyoti-HP-Pavilion-Notebook:~/Documents/MOHC-HadGEM2-ES_historical_r1i1p1_185912-190911$ cdo griddes India_tas_Amon_HadGEM2-ES_historical_r1i1p1_185912-190911.nc #
  2. gridID 1 #
    gridtype = lonlat
    gridsize = 425
    xname = lon
    xlongname = longitude
    xunits = degrees_east
    yname = lat
    ylongname = latitude
    yunits = degrees_north
    xsize = 17
    ysize = 25
    xfirst = 67.5
    xinc = 1.875
    yfirst = 7.5
    yinc = 1.25
    cdo griddes: Processed 1 variable ( 0.00s )

RE: I want to convert my .nc (tas_Amon_HadGEM2-ES_historical_r1i1p1_185912-188411) into grib data - Added by Ralf Mueller over 6 years ago

since you interpolated your data onto a regular lonlat grid, the projection in no longer part of the (new) coordinates. You should check the data location manually to make sure everything is as you need it, like land-sea-mask is where it's supposed to be.

you might also upload some sample data, maybe a single timestep of your source file.

RE: I want to convert my .nc (tas_Amon_HadGEM2-ES_historical_r1i1p1_185912-188411) into grib data - Added by jyoti lodha over 6 years ago

Thanks for taking so much pain for my problem, thanks a lot. Actually I want to use this grib file in WRF model in running ungrib.exe file, which takes only grib format not the .nc file. so I have to convert it into grib file, so I have attached both .nc and grib file . Please check and let me know if they are correct, so that I can further use them. Because I have read at various places that:

Link: http://www.meteo.unican.es/wiki/cordexwrf/SoftwareTools/CmorPreprocessor

When CDO converts netcdf files to grib files, it does not copy the projection information related to the increment in latitude/longitude of the corresponding grid if it cannot be stored correctly. For example, the iDirectionIncrement for T85 is 1.40625, but due to limitations in resolution, only the 1406 millidegree is stored. This could give slightly wrong grid coordinates. To solve this problem with older versions of CDO, we can modify ungrib or we can use the grib tools. For example, for a gaussian grid with a longitude grid spacing of 1.406 deg., the following instruction could be used (keep in mind that the small error in longitude is still present)..

  1. grib_set -s iDirectionIncrement=1406 miroc_input.grb miroc_input_fixed.grb .

So I want to clear this problem in grib data.

Thanks

RE: I want to convert my .nc (tas_Amon_HadGEM2-ES_historical_r1i1p1_185912-188411) into grib data - Added by Ralf Mueller over 6 years ago

Hi!
I could convert your uploaded nc file to grb and grb2 with my CDO installation

cdo -V% cdo -V                                                                                                                                                                                  
Climate Data Operators version 1.9.3 (http://mpimet.mpg.de/cdo)
Compiled: by ram on melian (x86_64-unknown-linux-gnu) Feb  8 2018 14:16:01
CXX Compiler: g++ -g -O3 -std=c++11 -Wall -fopenmp -march=native   
CXX version : g++ (GCC) 7.3.0
C Compiler: gcc -g -O3 -std=gnu99 -Wall -fopenmp -march=native   
C version : gcc (GCC) 7.3.0
F77 Compiler: gfortran -g -O2
F77 version : GNU Fortran (GCC) 7.3.0
Features: 15GB C++11 Fortran DATA PTHREADS OpenMP45 HDF5 NC4/HDF5 OPeNDAP SZ UDUNITS2 PROJ.4 XML2 MAGICS CURL FFTW3 AVX2
Libraries: HDF5/1.10.1 proj/4.93 xml2/2.9.7 curl/7.59.0(h7.58.0)
Filetypes: srv ext ieg grb1 grb2 nc1 nc2 nc4 nc4c nc5 
     CDI library version : 1.9.3 of Feb  8 2018 14:15:17
 CGRIBEX library version : 1.9.0 of Jan 22 2018 09:24:03
GRIB_API library version : 2.4.1
  NetCDF library version : 4.5.0 of Oct 28 2017 00:21:44 $
    HDF5 library version : 1.10.1
    EXSE library version : 1.4.0 of Feb  8 2018 14:15:12
    FILE library version : 1.8.3 of Feb  8 2018 14:15:12
without problems
cdo -f grb copy -chname,tas,t India_tas_Amon_HadGEM2-ES_historical_r1i1p1_185912-190911.nc i.grb
cdo -f grb2 copy -chname,tas,t India_tas_Amon_HadGEM2-ES_historical_r1i1p1_185912-190911.nc i.grb2

but your nc files is pure lonlat, no projection. So I could not check your projection issues

so long,
ralf

RE: I want to convert my .nc (tas_Amon_HadGEM2-ES_historical_r1i1p1_185912-188411) into grib data - Added by jyoti lodha over 6 years ago

Thanks for converting it, But still failed to open it.

As we get an error of opening of i.grb2 plot.
Error: There was an error while preparing the plot. Failed to create the data handler because:Unsupported DRS type=4

(1-25/31)