Project

General

Profile

Problem for converting netCDF to grib2 forTotal Precipitaion

Added by Jianyu Liu over 7 years ago

Hi,

I'm on a Linux box and using CDO 1.7.2. The netcdf file could be successfully convert into grib2 by using 'cdo -f grb2 selvar,rain_total file.nc file.grb2'. But for 'Total precipitation', the 'name' key and 'shortName' key were set to MISSING. No matter how hard I try, still failed to get 'name' key and 'shortName' key set proprerly.

My question is how to get 'name' key and 'shortName' key set proprerly for 'Total precipitation' when convert it from netcdf to grib2.

Here are the output of ncdump.


ncdump -h 201612290300_003_003.nc

netcdf \201612290300_003_003 {
dimensions:
        grid_latitude = 341 ;
        grid_longitude = 360 ;
        time = UNLIMITED ; // (1 currently)
        tbnds = 2 ;
variables:
        double grid_latitude(grid_latitude) ;
                grid_latitude:long_name = "latitude" ;
                grid_latitude:standard_name = "grid_latitude" ;
                grid_latitude:units = "degrees_north" ;
                grid_latitude:axis = "Y" ;
        double grid_longitude(grid_longitude) ;
                grid_longitude:long_name = "longitude" ;
                grid_longitude:standard_name = "grid_longitude" ;
                grid_longitude:units = "degrees_east" ;
                grid_longitude:axis = "X" ;
        float rain_total(time, grid_latitude, grid_longitude) ;
                rain_total:standard_name = "precipitation_amount" ;
                rain_total:units = "kg m-2" ;
                rain_total:um_stash_source = "m01s05i226" ;
                rain_total:STASH = "m01s05i226" ;
                rain_total:_FillValue = 9.96920996838687e+36 ;
                rain_total:coordinates = "time grid_latitude grid_longitude" ;
        double time(time) ;
                time:units = "minutes since 2016-12-29 00:00:00" ;
                time:calendar = "standard" ;
                time:_FillValue = 9.96920996838687e+36 ;
        double time_bnds(time, tbnds) ;
                time_bnds:units = "minutes since 2016-12-29 00:00:00" ;
}

Here are the output of grib_dupm.


grib_dump -O 201612290300_003_003.grb2

***** FILE: 201612290300_003_003.grb2
#==============   MESSAGE 1 ( length=491215 )              ==============
1-4       identifier = GRIB
5-6       reserved = MISSING
7         discipline = 0 [Meteorological products (grib2/tables/4/0.0.table) ]
8         editionNumber = 2
9-16      totalLength = 491215
======================   SECTION_1 ( length=21, padding=0 )    ======================
1-4       section1Length = 21
5         numberOfSection = 1
6-7       centre = 0 [Absent (grib1/0.table) ]
8-9       subCentre = 0
10        tablesVersion = 4 [Version implemented on 7 November 2007 (grib2/tables/1.0.table) ]
11        localTablesVersion = 0 [Local tables not used  (grib2/tables/4/1.1.table) ]
12        significanceOfReferenceTime = 1 [Start of forecast (grib2/tables/4/1.2.table) ]
13-14     year = 2016
15        month = 12
16        day = 29
17        hour = 0
18        minute = 0
19        second = 0
20        productionStatusOfProcessedData = 0 [Operational products (grib2/tables/4/1.3.table) ]
21        typeOfProcessedData = 1 [Forecast products (grib2/tables/4/1.4.table) ]
======================   SECTION_2 ( length=5, padding=0 )     ======================
1-4       section2Length = 5
5         numberOfSection = 2
======================   SECTION_3 ( length=72, padding=0 )    ======================
1-4       section3Length = 72
5         numberOfSection = 3
6         sourceOfGridDefinition = 0 [Specified in Code table 3.1 (grib2/tables/4/3.0.table) ]
7-10      numberOfDataPoints = 122760
11        numberOfOctectsForNumberOfPoints = 0
12        interpretationOfNumberOfPoints = 0 [There is no appended list (grib2/tables/4/3.11.table) ]
13-14     gridDefinitionTemplateNumber = 0 [Latitude/longitude. Also called equidistant cylindrical, or Plate Carree (grib2/tables/4/3.1.table) ]
15        shapeOfTheEarth = 0 [Earth assumed spherical with radius = 6,367,470.0 m (grib2/tables/4/3.2.table) ]
16        scaleFactorOfRadiusOfSphericalEarth = MISSING
17-20     scaledValueOfRadiusOfSphericalEarth = MISSING
21        scaleFactorOfEarthMajorAxis = MISSING
22-25     scaledValueOfEarthMajorAxis = MISSING
26        scaleFactorOfEarthMinorAxis = MISSING
27-30     scaledValueOfEarthMinorAxis = MISSING
31-34     Ni = 360
35-38     Nj = 341
39-42     basicAngleOfTheInitialProductionDomain = 0
43-46     subdivisionsOfBasicAngle = MISSING
47-50     latitudeOfFirstGridPoint = -5754249
51-54     longitudeOfFirstGridPoint = 94642501
55        resolutionAndComponentFlags = 48 [00110000]
56-59     latitudeOfLastGridPoint = 8182174
60-63     longitudeOfLastGridPoint = 109397491
64-67     iDirectionIncrement = 41100
68-71     jDirectionIncrement = 40989
72        scanningMode = 64 [01000000]
======================   SECTION_4 ( length=34, padding=0 )    ======================
1-4       section4Length = 34
5         numberOfSection = 4
6-7       NV = 0
8-9       productDefinitionTemplateNumber = 0 [Analysis or forecast at a horizontal level or in a horizontal layer at a point in time (grib2/tables/4/4.0.table) ]
10        parameterCategory = 1 [Moisture (grib2/tables/4/4.1.0.table) ]
11        parameterNumber = 8 [Total precipitation  (kg m-2)  (grib2/tables/4/4.2.0.1.table) ]
12        typeOfGeneratingProcess = 2 [Forecast (grib2/tables/4/4.3.table) ]
13        backgroundProcess = 255
14        generatingProcessIdentifier = 128
15-16     hoursAfterDataCutoff = 0
17        minutesAfterDataCutoff = 0
18        indicatorOfUnitOfTimeRange = 0 [Minute (grib2/tables/4/4.4.table) ]
19-22     forecastTime = 180
23        typeOfFirstFixedSurface = 1 [Ground or water surface  (grib2/tables/4/4.5.table) ]
24        scaleFactorOfFirstFixedSurface = 0
25-28     scaledValueOfFirstFixedSurface = 0
29        typeOfSecondFixedSurface = 255 [Missing (grib2/tables/4/4.5.table) ]
30        scaleFactorOfSecondFixedSurface = MISSING
31-34     scaledValueOfSecondFixedSurface = MISSING

Here are output of grib_ls

grib_ls  -p edition,date,gridType,tablesVersion,discipline,parameterCategory,parameterNumber,typeOfLevel,level,shortName,name,units 201612290300_003_003.grb2

edition            date               gridType           tablesVersion      discipline         parameterCategory  parameterNumber    typeOfLevel        level              shortName          name               units
2                  20161229           regular_ll         4                  0                  1                  8                  surface            0                  unknown            unknown            unknown

Appreciating any comments

Regards

Jerry