Use this code to get output.nc
cdo -f nc4 copy -sellevel,100000,95000,92500,90000,85000,80000,70000,60000,50000,40000,0 -sellonlatbox,70,140,60,10 -selvar,2t,2d,10u,10v,100u,100v,msl,vis,tcc,tp,u,v,w,t,r,gh input.grib output.nc
Merge the files.
lovechang@lovechang-Lenovo-Product ~/python_scripts/save_c1d/data/testnc $ ls
C1D10291200102912011.nc C1D10291200102915001.nc
lovechang@lovechang-Lenovo-Product ~/python_scripts/save_c1d/data/testnc $ cdo copy *.nc ../test.nc
cdo copy (Warning): Input streams have different parameters!
cdo copy (Abort): Grid size of the input parameters do not match!
NO.1 details of output.nc
lovechang@lovechang-Lenovo-Product ~/python_scripts/save_c1d/data/testnc $ ncdump -h C1D10291200102912011.nc
netcdf C1D10291200102912011 {
dimensions:
lon = 281 ;
lat = 201 ;
lon_2 = 561 ;
lat_2 = 401 ;
lev = 10 ;
time = UNLIMITED ; // (1 currently)
variables:
double lon(lon) ;
lon:standard_name = "longitude" ;
lon:long_name = "longitude" ;
lon:units = "degrees_east" ;
lon:axis = "X" ;
double lat(lat) ;
lat:standard_name = "latitude" ;
lat:long_name = "latitude" ;
lat:units = "degrees_north" ;
lat:axis = "Y" ;
double lon_2(lon_2) ;
lon_2:standard_name = "longitude" ;
lon_2:long_name = "longitude" ;
lon_2:units = "degrees_east" ;
lon_2:axis = "X" ;
double lat_2(lat_2) ;
lat_2:standard_name = "latitude" ;
lat_2:long_name = "latitude" ;
lat_2:units = "degrees_north" ;
lat_2:axis = "Y" ;
double lev(lev) ;
lev:standard_name = "air_pressure" ;
lev:long_name = "pressure" ;
lev:units = "Pa" ;
lev:positive = "down" ;
lev:axis = "Z" ;
double time(time) ;
time:standard_name = "time" ;
time:units = "hours since 2017-10-29 12:00:00" ;
time:calendar = "proleptic_gregorian" ;
time:axis = "T" ;
float gh(time, lev, lat, lon) ;
gh:standard_name = "geopotential_height" ;
gh:long_name = "Geopotential Height" ;
gh:units = "gpm" ;
gh:code = 156 ;
gh:table = 128 ;
float v(time, lev, lat, lon) ;
v:standard_name = "northward_wind" ;
v:long_name = "V component of wind" ;
v:units = "m s**-1" ;
v:code = 132 ;
v:table = 128 ;
float u(time, lev, lat, lon) ;
u:standard_name = "eastward_wind" ;
u:long_name = "U component of wind" ;
u:units = "m s**-1" ;
u:code = 131 ;
u:table = 128 ;
float tcc(time, lat_2, lon_2) ;
tcc:standard_name = "cloud_area_fraction" ;
tcc:long_name = "Total cloud cover" ;
tcc:units = "(0 - 1)" ;
tcc:code = 164 ;
tcc:table = 128 ;
float \2d(time, lat_2, lon_2) ;
\2d:long_name = "2 metre dewpoint temperature" ;
\2d:units = "K" ;
\2d:code = 168 ;
\2d:table = 128 ;
float t(time, lev, lat, lon) ;
t:standard_name = "air_temperature" ;
t:long_name = "Temperature" ;
t:units = "K" ;
t:code = 130 ;
t:table = 128 ;
float w(time, lev, lat, lon) ;
w:standard_name = "lagrangian_tendency_of_air_pressure" ;
w:long_name = "Vertical velocity" ;
w:units = "Pa s**-1" ;
w:code = 135 ;
w:table = 128 ;
float r(time, lev, lat, lon) ;
r:standard_name = "relative_humidity" ;
r:long_name = "Relative humidity" ;
r:units = "%" ;
r:code = 157 ;
r:table = 128 ;
float msl(time, lat_2, lon_2) ;
msl:standard_name = "air_pressure_at_sea_level" ;
msl:long_name = "Mean sea level pressure" ;
msl:units = "Pa" ;
msl:code = 151 ;
msl:table = 128 ;
float \100u(time, lat_2, lon_2) ;
\100u:long_name = "100 metre U wind component" ;
\100u:units = "m s**-1" ;
\100u:code = 246 ;
\100u:table = 228 ;
float \100v(time, lat_2, lon_2) ;
\100v:long_name = "100 metre V wind component" ;
\100v:units = "m s**-1" ;
\100v:code = 247 ;
\100v:table = 228 ;
float \10u(time, lat_2, lon_2) ;
\10u:long_name = "10 metre U wind component" ;
\10u:units = "m s**-1" ;
\10u:code = 165 ;
\10u:table = 128 ;
float \2t(time, lat_2, lon_2) ;
\2t:long_name = "2 metre temperature" ;
\2t:units = "K" ;
\2t:code = 167 ;
\2t:table = 128 ;
float \10v(time, lat_2, lon_2) ;
\10v:long_name = "10 metre V wind component" ;
\10v:units = "m s**-1" ;
\10v:code = 166 ;
\10v:table = 128 ;
float vis(time, lat_2, lon_2) ;
vis:long_name = "Visibility" ;
vis:units = "m" ;
vis:code = 20 ;
vis:table = 3 ;
float tp(time, lat_2, lon_2) ;
tp:long_name = "Total precipitation" ;
tp:units = "m" ;
tp:code = 228 ;
tp:table = 128 ;
// global attributes:
:CDI = "Climate Data Interface version ?? (http://mpimet.mpg.de/cdi)" ;
:Conventions = "CF-1.4" ;
:history = "Mon Oct 30 21:45:40 2017: cdo -f nc4 copy -sellevel,100000,95000,92500,90000,85000,80000,70000,60000,50000,40000,0 -sellonlatbox,70,140,60,10 -selvar,2t,2d,10u,10v,100u,100v,msl,vis,tcc,tp,u,v,w,t,r,gh /home/lovechang/python_scripts/save_c1d/data/2017102912/decompress/C1D10291200102912011 /home/lovechang/python_scripts/save_c1d/data/2017102912/decompress/C1D10291200102912011.nc" ;
:institution = "European Centre for Medium-Range Weather Forecasts" ;
:CDO = "Climate Data Operators version 1.7.0 (http://mpimet.mpg.de/cdo)" ;
}
NO.2 details of output.nc
lovechang@lovechang-Lenovo-Product ~/python_scripts/save_c1d/data/testnc $ ncdump -h C1D10291200102915001.nc
netcdf C1D10291200102915001 {
dimensions:
lon = 281 ;
lat = 201 ;
lon_2 = 561 ;
lat_2 = 401 ;
lev = 10 ;
time = UNLIMITED ; // (1 currently)
variables:
double lon(lon) ;
lon:standard_name = "longitude" ;
lon:long_name = "longitude" ;
lon:units = "degrees_east" ;
lon:axis = "X" ;
double lat(lat) ;
lat:standard_name = "latitude" ;
lat:long_name = "latitude" ;
lat:units = "degrees_north" ;
lat:axis = "Y" ;
double lon_2(lon_2) ;
lon_2:standard_name = "longitude" ;
lon_2:long_name = "longitude" ;
lon_2:units = "degrees_east" ;
lon_2:axis = "X" ;
double lat_2(lat_2) ;
lat_2:standard_name = "latitude" ;
lat_2:long_name = "latitude" ;
lat_2:units = "degrees_north" ;
lat_2:axis = "Y" ;
double lev(lev) ;
lev:standard_name = "air_pressure" ;
lev:long_name = "pressure" ;
lev:units = "Pa" ;
lev:positive = "down" ;
lev:axis = "Z" ;
double time(time) ;
time:standard_name = "time" ;
time:units = "hours since 2017-10-29 12:00:00" ;
time:calendar = "proleptic_gregorian" ;
time:axis = "T" ;
float v(time, lev, lat, lon) ;
v:standard_name = "northward_wind" ;
v:long_name = "V component of wind" ;
v:units = "m s**-1" ;
v:code = 132 ;
v:table = 128 ;
float u(time, lev, lat, lon) ;
u:standard_name = "eastward_wind" ;
u:long_name = "U component of wind" ;
u:units = "m s**-1" ;
u:code = 131 ;
u:table = 128 ;
float r(time, lev, lat, lon) ;
r:standard_name = "relative_humidity" ;
r:long_name = "Relative humidity" ;
r:units = "%" ;
r:code = 157 ;
r:table = 128 ;
float w(time, lev, lat, lon) ;
w:standard_name = "lagrangian_tendency_of_air_pressure" ;
w:long_name = "Vertical velocity" ;
w:units = "Pa s**-1" ;
w:code = 135 ;
w:table = 128 ;
float tp(time, lat_2, lon_2) ;
tp:long_name = "Total precipitation" ;
tp:units = "m" ;
tp:code = 228 ;
tp:table = 128 ;
float gh(time, lev, lat, lon) ;
gh:standard_name = "geopotential_height" ;
gh:long_name = "Geopotential Height" ;
gh:units = "gpm" ;
gh:code = 156 ;
gh:table = 128 ;
float t(time, lev, lat, lon) ;
t:standard_name = "air_temperature" ;
t:long_name = "Temperature" ;
t:units = "K" ;
t:code = 130 ;
t:table = 128 ;
float tcc(time, lat_2, lon_2) ;
tcc:standard_name = "cloud_area_fraction" ;
tcc:long_name = "Total cloud cover" ;
tcc:units = "(0 - 1)" ;
tcc:code = 164 ;
tcc:table = 128 ;
float \2d(time, lat_2, lon_2) ;
\2d:long_name = "2 metre dewpoint temperature" ;
\2d:units = "K" ;
\2d:code = 168 ;
\2d:table = 128 ;
float msl(time, lat_2, lon_2) ;
msl:standard_name = "air_pressure_at_sea_level" ;
msl:long_name = "Mean sea level pressure" ;
msl:units = "Pa" ;
msl:code = 151 ;
msl:table = 128 ;
float \10v(time, lat_2, lon_2) ;
\10v:long_name = "10 metre V wind component" ;
\10v:units = "m s**-1" ;
\10v:code = 166 ;
\10v:table = 128 ;
float \100u(time, lat_2, lon_2) ;
\100u:long_name = "100 metre U wind component" ;
\100u:units = "m s**-1" ;
\100u:code = 246 ;
\100u:table = 228 ;
float \2t(time, lat_2, lon_2) ;
\2t:long_name = "2 metre temperature" ;
\2t:units = "K" ;
\2t:code = 167 ;
\2t:table = 128 ;
float \10u(time, lat_2, lon_2) ;
\10u:long_name = "10 metre U wind component" ;
\10u:units = "m s**-1" ;
\10u:code = 165 ;
\10u:table = 128 ;
float vis(time, lat_2, lon_2) ;
vis:long_name = "Visibility" ;
vis:units = "m" ;
vis:code = 20 ;
vis:table = 3 ;
float \100v(time, lat_2, lon_2) ;
\100v:long_name = "100 metre V wind component" ;
\100v:units = "m s**-1" ;
\100v:code = 247 ;
\100v:table = 228 ;
// global attributes:
:CDI = "Climate Data Interface version ?? (http://mpimet.mpg.de/cdi)" ;
:Conventions = "CF-1.4" ;
:history = "Mon Oct 30 21:45:33 2017: cdo -f nc4 copy -sellevel,100000,95000,92500,90000,85000,80000,70000,60000,50000,40000,0 -sellonlatbox,70,140,60,10 -selvar,2t,2d,10u,10v,100u,100v,msl,vis,tcc,tp,u,v,w,t,r,gh /home/lovechang/python_scripts/save_c1d/data/2017102912/decompress/C1D10291200102915001 /home/lovechang/python_scripts/save_c1d/data/2017102912/decompress/C1D10291200102915001.nc" ;
:institution = "European Centre for Medium-Range Weather Forecasts" ;
:CDO = "Climate Data Operators version 1.7.0 (http://mpimet.mpg.de/cdo)" ;
}