<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Marston,<div class=""><br class=""></div><div class="">the variable name in your netCDF file is <span style="font-family: Calibri; font-size: 15px; background-color: rgb(255, 255, 255);" class="">p100.128 and not </span><span style="font-family: Calibri; font-size: 15px; background-color: rgb(255, 255, 255);" class="">/p100.128</span><span style="font-family: Calibri; font-size: 15px; background-color: rgb(255, 255, 255);" class="">. NCLs error message is exactly telling you what is wrong in line 18.</span></div><div class=""><font face="Calibri" class=""><span style="font-size: 15px; background-color: rgb(255, 255, 255);" class="">Because the test script you send is not the script producing the error I guess that the line</span></font></div><div class=""><font face="Calibri" class=""><span style="font-size: 15px; background-color: rgb(255, 255, 255);" class=""><br class=""></span></font></div><div class=""><span style="font-family: Calibri; font-size: 15px; background-color: rgb(255, 255, 255);" class=""> g = short2flt(a->/p100.128)</span></div><div class=""><font face="Calibri" class=""><span style="font-size: 15px; background-color: rgb(255, 255, 255);" class=""><br class=""></span></font></div><div class=""><font face="Calibri" class=""><span style="font-size: 15px; background-color: rgb(255, 255, 255);" class="">is the problem. Change it to</span></font></div><div class=""><font face="Calibri" class=""><span style="font-size: 15px; background-color: rgb(255, 255, 255);" class=""><br class=""></span></font></div><div class=""><span style="font-family: Calibri; font-size: 15px; background-color: rgb(255, 255, 255);" class=""> g = short2flt(a->p100.128)</span></div><div class=""><font face="Calibri" class=""><span style="font-size: 15px; background-color: rgb(255, 255, 255);" class=""><br class=""></span></font></div><div class=""><font face="Calibri" class=""><span style="font-size: 15px; background-color: rgb(255, 255, 255);" class="">Bye,</span></font></div><div class=""><font face="Calibri" class=""><span style="font-size: 15px; background-color: rgb(255, 255, 255);" class="">Karin</span></font></div><div class=""><font face="Calibri" class=""><span style="font-size: 15px; background-color: rgb(255, 255, 255);" class=""><br class=""></span></font><div><blockquote type="cite" class=""><div class="">Am 30.11.2016 um 14:59 schrieb Marston Johnston <<a href="mailto:marston.johnston@gu.se" class="">marston.johnston@gu.se</a>>:</div><br class="Apple-interchange-newline"><div class="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" class="">
<meta name="Title" content="" class="">
<meta name="Keywords" content="" class="">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)" class="">
<style class=""><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:Calibri;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Calibri;
        color:windowtext;}
span.msoIns
        {mso-style-type:export-only;
        mso-style-name:"";
        text-decoration:underline;
        color:teal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:Calibri;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:595.0pt 842.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style>
<div bgcolor="white" lang="EN-GB" link="#0563C1" vlink="#954F72" class="">
<div class="WordSection1"><p class="MsoNormal"><span style="font-size:11.0pt" class="">Hi,<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> </span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">I writing a small script to read a netcdf4 file that was created by grib_api (version 1.17.0). But despite following the examples given here:
<a href="http://www.ncl.ucar.edu/Applications/netcdf4.shtml" class="">http://www.ncl.ucar.edu/Applications/netcdf4.shtml</a>. At first I thought the “.” in the variable name was causing the problem but in the examples given in the link above, such a file naming type
was given. I’ve tried using $”/p100.128”$, treating it as a group: a=>/p100.128, but to no avail.<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> </span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">I can upload the file for testing.
<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> </span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">****************** script *********************<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">begin<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> idir="/home/ "<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> fil="ICMGGglxc+2007var100.nc"<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> setfileoption("nc", "FileStructure", "Advanced")<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> setfileoption("nc", "Format", "NetCDF4")<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> a = addfile(idir+fil,"r")<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> printVarSummary(a)<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> vNames = getfilevarnames (a)<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> print(vNames)<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> g = short2flt(a->/p100.128)<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> printVarInfo(g,"g")<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">end<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">***************** results ********************<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">[nclcodes]$ ncdump -k /home/ICMGGglxc+2007var100.nc<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">netCDF-4<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">[nclcodes]$<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">ncdump -g /p100.128 /home/ICMGGglxc+2007var100.nc<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">ncdump: /p100.128: No such group<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> </span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">[nclcodes]$ ncdump -h /home/ICMGGglxc+2007var100.nc<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">netcdf ICMGGglxc+2007var100 {<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">dimensions:<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> longitude = 1024 ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> latitude = 512 ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> level = 11 ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> time = UNLIMITED ; // (2920 currently)<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">variables:<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> float longitude(longitude) ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> longitude:standard_name = "longitude" ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> longitude:long_name = "longitude" ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> longitude:units = "degrees_east" ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> longitude:axis = "X" ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> float latitude(latitude) ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> latitude:standard_name = "latitude" ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> latitude:long_name = "latitude" ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> latitude:units = "degrees_north" ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> latitude:axis = "Y" ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> double level(level) ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> level:long_name = "model_level_number" ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> level:axis = "Z" ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> double time(time) ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> time:standard_name = "time" ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> time:long_name = "time" ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> time:units = "hours since 1900-1-1 00:00:00" ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> time:calendar = "standard" ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> time:axis = "T" ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> short p100.128(time, level, latitude, longitude) ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> p100.128:long_name = "Experimental product" ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> p100.128:units = "~" ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> p100.128:grid_type = "gaussian" ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> p100.128:add_offset = 2826.8713701289 ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> p100.128:scale_factor = 0.0914882578243023 ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> p100.128:_FillValue = -32767s ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> p100.128:missing_value = -32767s ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> </span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">// global attributes:<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> :CDI = "Climate Data Interface version 1.7.0 (<a href="http://mpimet.mpg.de/cdi" class="">http://mpimet.mpg.de/cdi</a>)" ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> :history = "Mon Nov 28 23:20:13 2016: cdo -O -v mergetime ICMGGglxc+200701_var100.nc ICMGGglxc+200702_var100.nc ICMGGglxc+200703_var100.nc ICMGGglxc+200704_var100.nc ICMGGglxc+200705_var100.nc
ICMGGglxc+200706_var100.nc ICMGGglxc+200707_var100.nc ICMGGglxc+200708_var100.nc ICMGGglxc+200709_var100.nc ICMGGglxc+200710_var100.nc ICMGGglxc+200711_var100.nc ICMGGglxc+200712_var100.nc ICMGGglxc+2007var100.nc\n2016-11-28 22:01:41 GMT by grib_to_netcdf-1.17.0:
grib_to_netcdf -k 3 -o ICMGGglxc+200712_var100.nc ICMGGglxc+200712_var100.grb" ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> :Conventions = "CF-1.6" ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> :CDO = "Climate Data Operators version 1.7.0 (<a href="http://mpimet.mpg.de/cdo" class="">http://mpimet.mpg.de/cdo</a>)" ;<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">}<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">[nclcodes]$<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> </span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">[nclcodes]$ ncl process_t511.ncl<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">Copyright (C) 1995-2015 - All Rights Reserved<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">University Corporation for Atmospheric Research<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">NCAR Command Language Version 6.3.0<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">The use of this software is governed by a License Agreement.<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">See <a href="http://www.ncl.ucar.edu/" class="">http://www.ncl.ucar.edu/</a> for more details.<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> </span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">Variable: a<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">Type: file<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">File path : /home/ICMGGglxc+2007var100.nc<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> </span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">Number of global attributes : 4<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">Number of dimensions : 4<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">Number of chunk_dimensions : 1<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">Number of variables : 5<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> </span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">Variable: vNames<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">Type: string<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">Total Size: 40 bytes<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> 5 values<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">Number of Dimensions: 1<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">Dimensions and sizes: [5]<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">Coordinates:<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">(0) /longitude<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">(1) /latitude<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">(2) /level<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">(3) /time<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">(4) /p100.128<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">fatal:["Execute.c":132]:variable (/p100.128) is not in file (/home/ICMGGglxc+2007var100.nc)<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">fatal:["Execute.c":6316]:variable (/p100.128) is not in file (a)<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">fatal:["Execute.c":8575]:Execute: Error occurred at or near line 18 in file process_t511.ncl<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class=""> </span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">Cheers,<o:p class=""></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt" class="">/M<o:p class=""></o:p></span></p><p class="MsoNormal"><o:p class=""> </o:p></p>
</div>
</div>
_______________________________________________<br class="">ncl-talk mailing list<br class=""><a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a><br class="">List instructions, subscriber options, unsubscribe:<br class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk<br class=""></div></blockquote></div><br class=""><div apple-content-edited="true" class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""></div></span></div></span></div></span></div></div></div></div></div></div></div></body></html>