Project

General

Profile

lambert_lam grid suport for GRIB

Added by Rostislav Kouznetsov 20 days ago

Hi,

I could not find the place where to include that..
Basically, there is a way to store LCC grid in GRIB2 files as "lambert_lam" (see attached file).

$ cdo griddes GRIBPFDEOD+0000h00m00s-2t.grib 
Warning (gribapiGetGridType): gridDefinitionTemplateNumber 33 unsupported (gridType=lambert_lam)!
...
gridtype  = generic
...

The problem can be fixed by

$ grib_set -s gridType=lambert GRIBPFDEOD+0000h00m00s-2t.grib GRIBPFDEOD+0000h00m00s-2t-lambert.grib
$ cdo griddes GRIBPFDEOD+0000h00m00s-2t-lambert.grib 
#
# gridID 1
#
gridtype  = projection
gridsize  = 978121
xsize     = 989
ysize     = 989
xname     = x
xunits    = "m" 
yname     = y
yunits    = "m" 
xfirst    = 0
xinc      = 750
yfirst    = 0
yinc      = 750
scanningMode = 64
grid_mapping = Lambert_Conformal
grid_mapping_name = lambert_conformal_conic
standard_parallel = 52.5
longitude_of_central_meridian = 4.9
latitude_of_projection_origin = 52.5
earth_radius = 6371229.
false_easting = 370500.002765403
false_northing = 370499.963399391
longitudeOfFirstGridPointInDegrees = 359.820768
latitudeOfFirstGridPointInDegrees = 49.052962

I just could not quickly find a way to make cdo treat "lambert_lam" as "lambert" without extra temporary file. I believe it should be quite safe and straightforward...

PS

```
$ cdo --version
Climate Data Operators version 2.0.4 (https://mpimet.mpg.de/cdo)
System: x86_64-pc-linux-gnu
CXX Compiler: g++ -std=gnu++14 -g -O2 -ffile-prefix-map=/build/cdo-hTyRvi/cdo-2.0.4=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -fopenmp -pthread
CXX version : g++ (Ubuntu 11.2.0-16ubuntu1) 11.2.0
C Compiler: gcc -g -O2 -ffile-prefix-map=/build/cdo-hTyRvi/cdo-2.0.4=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wall -pedantic -fPIC  -fopenmp -pthread -pthread
C version : gcc (Ubuntu 11.2.0-16ubuntu1) 11.2.0
F77 Compiler: f77 -g -O2 -ffile-prefix-map=/build/cdo-hTyRvi/cdo-2.0.4=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong
F77 version : GNU Fortran (Ubuntu 11.2.0-16ubuntu1) 11.2.0
Features: 62GB 24threads C++14 OpenMP45 Fortran PTHREADS HDF5 NC4/HDF5/threadsafe OPeNDAP SZ UDUNITS2 PROJ MAGICS CURL FFTW3 SSE2
Libraries: HDF5/1.10.7 proj/8.2.1 curl/7.81.0 magics/4.10.1
CDI data types: SizeType=size_t  DateType=int64_t
CDI file types: srv ext ieg grb1 grb2 nc1 nc2 nc4 nc4c nc5 
     CDI library version : 2.0.4
 ecCodes library version : 2.24.2
  NetCDF library version : 4.8.1 of Sep 29 2021 09:36:14 $
    hdf5 library version : library undefined
    exse library version : 1.4.2
    FILE library version : 1.9.1