Project

General

Profile

netcdf not containing all parameters after converting

Added by Tobias Posch about 2 years ago

Hi together,

I have grib2 files from DWD which contains several parameters, which I can see with Panoply (Screenshot).
Unfortunately, only one Parameter VMAX_10M is visible with CDO sinfo (Screenshot).
So, converting these grib file to a netcdf file with cdo -f nc copy command only converts the parameter VMAX_10M.

I am a bit confused why the other parameters are not visible with cdo and how I can convert these files to .nc.

Can somebody help me with my problem.

Thanks in advance,
Tobi

Climate Data Operators version 1.9.9rc1 (https://mpimet.mpg.de/cdo)
System: x86_64-pc-linux-gnu
CXX Compiler: g++ -g -O2 -fdebug-prefix-map=/build/cdo-DQ8Dnu/cdo-1.9.9~rc1=. -fstack-protector-strong -Wformat -Werror=format-security -fopenmp
CXX version : g++ (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
C Compiler: gcc -g -O2 -fdebug-prefix-map=/build/cdo-DQ8Dnu/cdo-1.9.9~rc1=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -pedantic -fPIC -fopenmp
C version : gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
F77 Compiler: f77 -g -O2 -fdebug-prefix-map=/build/cdo-DQ8Dnu/cdo-1.9.9~rc1=. -fstack-protector-strong
F77 version : unknown
Features: 15GB 12threads C++14 Fortran DATA PTHREADS OpenMP HDF5 NC4/HDF5/threadsafe OPeNDAP SZ UDUNITS2 PROJ MAGICS CURL FFTW3 SSE2
Libraries: HDF5/1.10.4 proj/8.2.0 curl/7.68.0
Filetypes: srv ext ieg grb1 grb2 nc1 nc2 nc4 nc4c nc5
CDI library version : 1.9.9rc1
ecCodes library version : 2.16.0
NetCDF library version : 4.7.3 of Jan 23 2020 04:18:16 $
hdf5 library version : library undefined
exse library version : 1.4.1
FILE library version : 1.8.3


Replies (2)

RE: netcdf not containing all parameters after converting - Added by Karin Meier-Fleischer about 2 years ago

Hi Thomas,

the problem is that the GRIB2 file contains more than one time coordinate variable. After some search I found the following solution that will split the GRIB2 file into the different variables with eccodes' grib_copy . Than the files can be converted to netCDF with CDO's copy operator. To make it easier I wrote a short script to create the 16 files.

#!/usr/bin/env bash

infile="./WarnMOS202211171500.grb2" 

#-- split input file by variables
grib_copy WarnMOS202211171500.grb2 'out_[shortName].grb2'

#-- convert to netcdf
files=$(ls ./out_*.grb2)

for f in $files
do
    ofile=${f%*.grb2}
    cdo -f nc -copy $f ${ofile}.nc
done

RE: netcdf not containing all parameters after converting - Added by Tobias Posch about 2 years ago

Thank you very much for searching and solving the problem. Works perfectly!

Kind regards,
Tobias

    (1-2/2)