<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Yes. NCL does <b>not</b> recognize the hybrid coefficients. <b>IMHO: It is a bug.</b></div><div><br></div><div><b>wgrib2</b> does 'see' the 92 interface coefficients.</div><div><br></div><div><b>%></b> <span style="color:rgb(0,0,255)"><b>wgrib2</b></span> <span style="color:rgb(0,0,255)"><b>-hybrid</b></span> e20c_an_temp_r360x180_ml_199410.grib | less</div><div><br></div><div>The following are the (<b>hyai, hybi</b>) values:</div><div><br></div><div>1:0:<b>Hybrid levels=92 </b>1=( 0.000000, 2.000040) 2=( 3.980832, 7.387186) 3=(12.908319,21.413612) 4=(33.952858,51.746601) 5=(76.167656,108.715561) 6=(150.986023,204.637451) 7=(271.356506,352.824493) 8=(450.685791,566.519226) 9=(701.813354,857.945801) 10=(1036.166504,1237.585449) 11=(1463.163940,1713.709595) 12=(1989.874390,2292.155518) 13=(2620.898438,2976.302246) 14=(3358.425781,3767.196045) 15=(4202.416504,4663.776367) 16=(5150.859863,5663.156250) 17=(6199.839355,6759.727051) 18=(7341.469727,7942.926270) 19=(8564.624023,9208.305664) 20=(9873.560547,10558.881836) 21=(11262.484375,11982.662109) 22=(12713.897461,13453.225586) 23=(14192.009766,14922.685547) 24=(15638.053711,16329.560547) 25=(16990.623047,17613.281250) 26=(18191.029297,18716.968750) 27=(19184.544922,19587.513672) 28=(19919.796875,20175.394531) 29=(20348.916016,20434.158203) 30=(20426.218750,20319.011719) 31=(20107.031250,19785.357422) 32=(19348.775391,18798.822266) 33=(18141.296875,17385.595703) 34=(16544.585938,15633.566406) 35=(14665.645508,13653.219727) 36=(12608.383789,11543.166992) 37=(10471.310547,9405.222656) 38=(8356.252930,7335.164551) 39=(6353.920898,5422.802734) 40=(4550.215820,3743.464355) 41=(3010.146973,2356.202637) 42=(1784.854614,1297.656128) 43=(895.193542,576.314148) 44=(336.772369,162.043427) 45=(54.208336, 6.575628) 46=( 0.003160, 0.000000) 47=( 0.000000, 0.000000) 48=( 0.000000, 0.000000) 49=( 0.000000, 0.000000) 50=( 0.000000, 0.000000) 51=( 0.000000, 0.000000) 52=( 0.000000, 0.000000) 53=( 0.000000, 0.000000) 54=( 0.000000, 0.000000) 55=( 0.000000, 0.000000) 56=( 0.000000, 0.000000) 57=( 0.000000, 0.000000) 58=( 0.000000, 0.000000) 59=( 0.000000, 0.000000) 60=( 0.000000, 0.000000) 61=( 0.000000, 0.000000) 62=( 0.000000, 0.000000) 63=( 0.000000, 0.000000) 64=( 0.000000, 0.000014) 65=( 0.000055, 0.000131) 66=( 0.000279, 0.000548) 67=( 0.001000, 0.001701) 68=( 0.002765, 0.004267) 69=( 0.006322, 0.009035) 70=( 0.012508, 0.016860) 71=( 0.022189, 0.028610) 72=( 0.036227, 0.045146) 73=( 0.055474, 0.067316) 74=( 0.080777, 0.095964) 75=( 0.112979, 0.131935) 76=( 0.152934, 0.176091) 77=( 0.201520, 0.229315) 78=( 0.259554, 0.291993) 79=( 0.326329, 0.362203) 80=( 0.399205, 0.436906) 81=( 0.475016, 0.513280) 82=( 0.551458, 0.589317) 83=( 0.626559, 0.662934) 84=( 0.698224, 0.732224) 85=( 0.764679, 0.795385) 86=( 0.824185, 0.850950) 87=( 0.875518, 0.897767) 88=( 0.917651, 0.935157) 89=( 0.950274, 0.963007) 90=( 0.973466, 0.982238) 91=( 0.989153, 0.994204) 92=( 0.997630, 1.000000)</div><div><br></div><div>The mid-layer coefficients (91) are calculated as the mid-points and are calculated.<br></div><div>====<br></div><div>Still, something seems odd. My local CDO version<br></div><div><br></div><div><b>%> cdo -V</b><br><b>Climate Data Operators version <span style="color:rgb(0,0,255)">1.7.2</span> </b>(<a href="http://mpimet.mpg.de/cdo" target="_blank">http://mpimet.mpg.de/cdo</a>)</div><div><br></div><div><b>%>cdo</b> -f nc copy e20c_an_temp_r360x180_ml_199410.grib <a href="http://e20c_temp_199410.nc" target="_blank">e20c_temp_199410.nc</a><br><br><span style="color:rgb(255,0,0)"><b>cdo copy: Open failed on >e20c_an_temp_r360x180_ml_199410.grib<<br>Unsupported file type</b></span></div><div><span style="color:rgb(255,0,0)"><span style="color:rgb(0,0,0)">====</span><b><br></b></span></div><div><span style="color:rgb(255,0,0)"><span style="color:rgb(0,0,0)">CDO Versions <b>1.9.3 </b>and<b> 1.9.4</b> <span style="color:rgb(0,0,255)"><b>do recognize</b></span> the hybrid coefficients</span><b>. <br></b></span></div><div><span style="color:rgb(255,0,0)"><b><br></b></span></div><div><span style="color:rgb(255,0,0)"><font color="#000000">====</font></span></div><div><span style="color:rgb(255,0,0)"><font color="#000000">The issue with GRIB is that it is a moving target.</font></span></div><div><span style="color:rgb(255,0,0)"><font color="#000000"><br></font></span></div><div><span style="color:rgb(255,0,0)"><font color="#000000">D<br></font></span></div><div><span style="color:rgb(255,0,0)"><b><font color="#000000"></font></b></span></div><div><span style="color:rgb(255,0,0)"><b><font color="#000000"></font><br></b></span></div></div></div></div></div></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 12, 2019 at 7:29 AM De Vries Andries <<a href="mailto:andries.devries@env.ethz.ch" target="_blank">andries.devries@env.ethz.ch</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Dennis,<br>
<br>
Thank you very much. The newer version of NCL helps indeed, hadn't thought of that simple solution. However, still I miss a few coordinate variables that I can read in the netcdf file, but not in the original grib file; the hyam and hybm variabels. Please, see the print statement of the netcdf file below. Any idea why and what can help?<br>
<br>
Cheers,<br>
Andries<br>
<br>
Variable: b2<br>
Type: file<br>
filename: e20c_an_temp_r360x180_ml_199410<br>
path: ../ERA20C-MOD/NC/<a href="http://e20c_an_temp_r360x180_ml_199410.nc" rel="noreferrer" target="_blank">e20c_an_temp_r360x180_ml_199410.nc</a><br>
file global attributes:<br>
CDI : Climate Data Interface version 1.9.5 (<a href="http://mpimet.mpg.de/cdi" rel="noreferrer" target="_blank">http://mpimet.mpg.de/cdi</a>)<br>
Conventions : CF-1.6<br>
history : Thu Feb 14 11:02:46 2019: cdo -f nc copy /atmosdyn/devriesa/DATA/ERA20C/e20c_an_temp_r360x180_ml_199410.grib /atmosdyn/devriesa/DATA/ERA20C-MOD/NC/<a href="http://e20c_an_temp_r360x180_ml_199410.nc" rel="noreferrer" target="_blank">e20c_an_temp_r360x180_ml_199410.nc</a><br>
institution : European Centre for Medium-Range Weather Forecasts<br>
CDO : Climate Data Operators version 1.9.5 (<a href="http://mpimet.mpg.de/cdo" rel="noreferrer" target="_blank">http://mpimet.mpg.de/cdo</a>)<br>
dimensions:<br>
time = 124 // unlimited<br>
lon = 360<br>
lat = 181<br>
lev = 91<br>
nhyi = 92<br>
nhym = 91<br>
variables:<br>
double time ( time )<br>
standard_name : time<br>
units : hours since 1994-10-1 00:00:00<br>
calendar : proleptic_gregorian<br>
axis : T<br>
<br>
double lon ( lon )<br>
standard_name : longitude<br>
long_name : longitude<br>
units : degrees_east<br>
axis : X<br>
<br>
double lat ( lat )<br>
standard_name : latitude<br>
long_name : latitude<br>
units : degrees_north<br>
axis : Y<br>
<br>
double lev ( lev )<br>
standard_name : hybrid_sigma_pressure<br>
long_name : hybrid level at layer midpoints<br>
formula : hyam hybm (mlev=hyam+hybm*aps)<br>
formula_terms : ap: hyam b: hybm ps: aps<br>
units : level<br>
positive : down<br>
<br>
double hyai ( nhyi )<br>
long_name : hybrid A coefficient at layer interfaces<br>
units : Pa<br>
<br>
double hybi ( nhyi )<br>
long_name : hybrid B coefficient at layer interfaces<br>
units : 1<br>
<br>
double hyam ( nhym )<br>
long_name : hybrid A coefficient at layer midpoints<br>
units : Pa<br>
<br>
double hybm ( nhym )<br>
long_name : hybrid B coefficient at layer midpoints<br>
units : 1<br>
<br>
float t ( time, lev, lat, lon )<br>
standard_name : air_temperature<br>
long_name : Temperature<br>
units : K<br>
param : 0.0.0<br>
<br>
________________________________________<br>
From: Dennis Shea [<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>]<br>
Sent: 12 March 2019 13:09<br>
To: De Vries Andries<br>
Cc: <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
Subject: Re: [ncl-talk] reading in ERA-20C grib file with data on model/hybrid levels<br>
<br>
I am using NCL 6.5.0. I have no problem reading the grib file.<br>
<br>
%> ncl<br>
<br>
NCAR Command Language Version 6.5.0<br>
<br>
ncl 0> f = addfile("e20c_an_temp_r360x180_ml_199410.grib","r")<br>
ncl 1> print(f)<br>
ncl 2> t = f->TMP_P0_L105_GLL0<br>
printVarSummary(t)<br>
ncl 3> printVarSummary(t)<br>
<br>
Variable: t<br>
Type: float<br>
Total Size: 2941061760 bytes<br>
735265440 values<br>
Number of Dimensions: 4<br>
Dimensions and sizes: [initial_time0_hours | 124] x [lv_HYBL0 | 91] x [lat_0 | 181] x [lon_0 | 360]<br>
Coordinates:<br>
initial_time0_hours: [1707120..1707858]<br>
lv_HYBL0: [ 1..91]<br>
lat_0: [90..-90]<br>
lon_0: [ 0..359]<br>
Number Of Attributes: 11<br>
center : European Center for Medium-Range Weather Forecasts<br>
production_status : Operational products<br>
long_name : Temperature<br>
units : K<br>
_FillValue : 1e+20<br>
grid_type : Latitude/longitude<br>
parameter_discipline_and_category : Meteorological products, Temperature<br>
parameter_template_discipline_category_number : ( 0, 0, 0, 0 )<br>
level_type : Hybrid level<br>
forecast_time : 0<br>
forecast_time_units : hours<br>
<br>
ncl 4> printMinMax(t,0)<br>
(0) Temperature (K) : min=170.211 max=313.993<br>
<br>
On Tue, Mar 12, 2019 at 5:30 AM De Vries Andries <<a href="mailto:andries.devries@env.ethz.ch" target="_blank">andries.devries@env.ethz.ch</a><mailto:<a href="mailto:andries.devries@env.ethz.ch" target="_blank">andries.devries@env.ethz.ch</a>>> wrote:<br>
Dear NCL Team & Users,<br>
<br>
I have an issue with reading in ERA-20C grib files from ECMWF that contain data on model levels. No matter if it is data on a regular (1x1 degree grid) or a gaussian grid (N80), I can not read the variables within the file, see for example the first print statements below.<br>
<br>
When I convert the grib file to netcdf format, using the tool cdo {cdo -f nc copy {infile} {outfile}}, there is no problem; I can read in the netcdf file and variables without any problem, see the second print statement below. Ideally, however, I would like to use NCL to read in the grib files without converting them first to netcdf format. Any idea how to achieve this?<br>
<br>
Two side comments (1) I can read in ERA-20C grib files with data on pressure levels, surface, or isentropic levels without any problem problem; there is no need to convert them to netcdf format, and (2) Also, I can read in ERA-Interim grib files with data on model levels without any problems that are downloaded in the same manner & format as the ERA-20C data.<br>
<br>
@NCL TEAM; I copied an example ERA-20C file in grib and netcdf format with temperature on model levels for the year 199410 to <a href="http://ftp.cgd.ucar.edu" rel="noreferrer" target="_blank">ftp.cgd.ucar.edu</a><<a href="http://ftp.cgd.ucar.edu" rel="noreferrer" target="_blank">http://ftp.cgd.ucar.edu</a>><br>
<br>
Kind regards,<br>
Andries<br>
<br>
-----------------------------------------------------------------------------------------------------------------------------------------------------------------<br>
READING IN ERA-20C GRIB FILE WITH DATA ON MODEL LEVELS; CANNOT READ VARIABLES<br>
-----------------------------------------------------------------------------------------------------------------------------------------------------------------<br>
<br>
Copyright (C) 1995-2015 - All Rights Reserved<br>
University Corporation for Atmospheric Research<br>
NCAR Command Language Version 6.3.0<br>
The use of this software is governed by a License Agreement.<br>
See <a href="http://www.ncl.ucar.edu/" rel="noreferrer" target="_blank">http://www.ncl.ucar.edu/</a> for more details.<br>
ncl 0> a=addfile("e20c_an_temp_r360x180_ml_199410.grib","r")<br>
<br>
ncl 1> print(a)<br>
<br>
print(a)<br>
<br>
Variable: a<br>
Type: file<br>
filename: (null)<br>
path: e20c_an_temp_r360x180_ml_199410.grib<br>
file global attributes:<br>
dimensions:<br>
variables:<br>
<br>
-----------------------------------------------------------------------------------------------------------------------------------------------------------------<br>
READING IN ERA-20C NETCDF FILE WITH DATA ON MODEL LEVELS; READS VARIABLES<br>
-----------------------------------------------------------------------------------------------------------------------------------------------------------------<br>
<br>
Copyright (C) 1995-2015 - All Rights Reserved<br>
University Corporation for Atmospheric Research<br>
NCAR Command Language Version 6.3.0<br>
The use of this software is governed by a License Agreement.<br>
See <a href="http://www.ncl.ucar.edu/" rel="noreferrer" target="_blank">http://www.ncl.ucar.edu/</a> for more details.<br>
<br>
ncl 0> a=addfile("<a href="http://e20c_an_temp_r360x180_ml_199410.nc" rel="noreferrer" target="_blank">e20c_an_temp_r360x180_ml_199410.nc</a><<a href="http://e20c_an_temp_r360x180_ml_199410.nc" rel="noreferrer" target="_blank">http://e20c_an_temp_r360x180_ml_199410.nc</a>>","r")<br>
<br>
ncl 1> print(a)<br>
<br>
Variable: a<br>
Type: file<br>
filename: e20c_an_temp_r360x180_ml_199410<br>
path: <a href="http://e20c_an_temp_r360x180_ml_199410.nc" rel="noreferrer" target="_blank">e20c_an_temp_r360x180_ml_199410.nc</a><<a href="http://e20c_an_temp_r360x180_ml_199410.nc" rel="noreferrer" target="_blank">http://e20c_an_temp_r360x180_ml_199410.nc</a>><br>
file global attributes:<br>
CDI : Climate Data Interface version 1.9.5 (<a href="http://mpimet.mpg.de/cdi" rel="noreferrer" target="_blank">http://mpimet.mpg.de/cdi</a>)<br>
Conventions : CF-1.6<br>
history : Thu Feb 14 11:02:46 2019: cdo -f nc copy /atmosdyn/devriesa/DATA/ERA20C/e20c_an_temp_r360x180_ml_199410.grib /atmosdyn/devriesa/DATA/ERA20C-MOD/NC/<a href="http://e20c_an_temp_r360x180_ml_199410.nc" rel="noreferrer" target="_blank">e20c_an_temp_r360x180_ml_199410.nc</a><<a href="http://e20c_an_temp_r360x180_ml_199410.nc" rel="noreferrer" target="_blank">http://e20c_an_temp_r360x180_ml_199410.nc</a>><br>
institution : European Centre for Medium-Range Weather Forecasts<br>
CDO : Climate Data Operators version 1.9.5 (<a href="http://mpimet.mpg.de/cdo" rel="noreferrer" target="_blank">http://mpimet.mpg.de/cdo</a>)<br>
dimensions:<br>
time = 124 // unlimited<br>
lon = 360<br>
lat = 181<br>
lev = 91<br>
nhyi = 92<br>
nhym = 91<br>
variables:<br>
double time ( time )<br>
standard_name : time<br>
units : hours since 1994-10-1 00:00:00<br>
calendar : proleptic_gregorian<br>
axis : T<br>
<br>
double lon ( lon )<br>
standard_name : longitude<br>
long_name : longitude<br>
units : degrees_east<br>
axis : X<br>
<br>
double lat ( lat )<br>
standard_name : latitude<br>
long_name : latitude<br>
units : degrees_north<br>
axis : Y<br>
<br>
double lev ( lev )<br>
standard_name : hybrid_sigma_pressure<br>
long_name : hybrid level at layer midpoints<br>
formula : hyam hybm (mlev=hyam+hybm*aps)<br>
formula_terms : ap: hyam b: hybm ps: aps<br>
units : level<br>
positive : down<br>
<br>
double hyai ( nhyi )<br>
long_name : hybrid A coefficient at layer interfaces<br>
units : Pa<br>
<br>
double hybi ( nhyi )<br>
long_name : hybrid B coefficient at layer interfaces<br>
units : 1<br>
<br>
double hyam ( nhym )<br>
long_name : hybrid A coefficient at layer midpoints<br>
units : Pa<br>
<br>
double hybm ( nhym )<br>
long_name : hybrid B coefficient at layer midpoints<br>
units : 1<br>
<br>
float t ( time, lev, lat, lon )<br>
standard_name : air_temperature<br>
long_name : Temperature<br>
units : K<br>
param : 0.0.0<br>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><mailto:<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div>