<div dir="ltr"><div>Maybe:<br><br></div> var = "<span style="font-family:calibri;font-size:15px;background-color:rgb(255,255,255)">/p100.128" ;<br></span><div><div> <span style="font-family:calibri;font-size:15px;background-color:rgb(255,255,255)">a->$var$<br><br></span></div><div><span style="font-family:calibri;font-size:15px;background-color:rgb(255,255,255)"><span style="font-family:calibri;font-size:15px;background-color:rgb(255,255,255)"><br></span> </span></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 30, 2016 at 7:24 AM, Marston Johnston <span dir="ltr"><<a href="mailto:shejo284@gmail.com" target="_blank">shejo284@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="white" link="#0563C1" vlink="#954F72" lang="EN-GB"><div class="m_-4397739947350889805WordSection1"><p class="MsoNormal"><span style="font-size:11.0pt">Hi Karin,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt">I have tried that and it did not work. I forgot to write that I tested that iteration as well.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt">fatal:syntax error: line 15 in file process_t511.ncl before or near .128<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt"> g = a->p100.128<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt">----------------^<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt">fatal:Syntax Error in block, block not executed<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt">fatal:error at line 17 in file process_t511.ncl<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt">I’m going to try using cdo to rename the variable to remove the “.” And test again.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt">But the link should be updated to remove this example where the variable name contains a “.”.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt">/M<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p><div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal"><b><span style="color:black">From: </span></b><span style="color:black"><<a href="mailto:ncl-talk-bounces@ucar.edu" target="_blank">ncl-talk-bounces@ucar.edu</a>> on behalf of Karin Meier-Fleischer <<a href="mailto:meier-fleischer@dkrz.de" target="_blank">meier-fleischer@dkrz.de</a>><br><b>Date: </b>Wednesday, 30 November 2016 at 15:18<br><b>To: </b>Marston Johnston <<a href="mailto:marston.johnston@gu.se" target="_blank">marston.johnston@gu.se</a>><br><b>Cc: </b>"ncl-talk [ncl-talk]" <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>><br><b>Subject: </b>Re: [ncl-talk] error reading netcdf4 file</span><span style="color:black"><u></u><u></u></span></p></div><div><div class="h5"><div><p class="MsoNormal"><span style="font-family:"Times New Roman""><u></u> <u></u></span></p></div><p class="MsoNormal">Hi Marston,<u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">the variable name in your netCDF file is <span style="font-size:11.5pt;background:white">p100.128 and not /p100.128. NCLs error message is exactly telling you what is wrong in line 18.</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-size:11.5pt;background:white">Because the test script you send is not the script producing the error I guess that the line</span><u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><span style="font-size:11.5pt;background:white"> g = short2flt(a->/p100.128)</span><u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><span style="font-size:11.5pt;background:white">is the problem. Change it to</span><u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><span style="font-size:11.5pt;background:white"> g = short2flt(a->p100.128)</span><u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><span style="font-size:11.5pt;background:white">Bye,</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-size:11.5pt;background:white">Karin</span><u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p><div><blockquote style="margin-top:5.0pt;margin-bottom:5.0pt"><div><p class="MsoNormal">Am 30.11.2016 um 14:59 schrieb Marston Johnston <<a href="mailto:marston.johnston@gu.se" target="_blank">marston.johnston@gu.se</a>>:<u></u><u></u></p></div><p class="MsoNormal"><u></u> <u></u></p><div><div><p class="MsoNormal"><span style="font-size:11.0pt">Hi,</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">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" target="_blank">http://www.ncl.ucar.edu/<wbr>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.</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">I can upload the file for testing. </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">****************** script *********************</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/shea_util.ncl"</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">begin</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> idir="/home/ "</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> fil="ICMGGglxc+<a href="http://2007var100.nc" target="_blank">2007var100.nc</a>"</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> setfileoption("nc", "FileStructure", "Advanced")</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> setfileoption("nc", "Format", "NetCDF4")</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> a = addfile(idir+fil,"r")</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> printVarSummary(a)</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> vNames = getfilevarnames (a)</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> print(vNames)</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> g = short2flt(a->/p100.128)</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> printVarInfo(g,"g")</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">end</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">***************** results ********************</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">[nclcodes]$ ncdump -k /home/ICMGGglxc+<a href="http://2007var100.nc" target="_blank">2007var100.nc</a></span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">netCDF-4</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">[nclcodes]$</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">ncdump -g /p100.128 /home/ICMGGglxc+<a href="http://2007var100.nc" target="_blank">2007var100.nc</a></span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">ncdump: /p100.128: No such group</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">[nclcodes]$ ncdump -h /home/ICMGGglxc+<a href="http://2007var100.nc" target="_blank">2007var100.nc</a></span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">netcdf ICMGGglxc+2007var100 {</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">dimensions:</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> longitude = 1024 ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> latitude = 512 ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> level = 11 ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> time = UNLIMITED ; // (2920 currently)</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">variables:</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> float longitude(longitude) ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> <wbr> longitude:standard_name = "longitude" ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> <wbr> longitude:long_name = "longitude" ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> <wbr> longitude:units = "degrees_east" ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> <wbr> longitude:axis = "X" ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> float latitude(latitude) ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> <wbr> latitude:standard_name = "latitude" ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> <wbr> latitude:long_name = "latitude" ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> <wbr> latitude:units = "degrees_north" ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> <wbr> latitude:axis = "Y" ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> double level(level) ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> <wbr> level:long_name = "model_level_number" ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> <wbr> level:axis = "Z" ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> double time(time) ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> <wbr> time:standard_name = "time" ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> <wbr> time:long_name = "time" ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> <wbr> time:units = "hours since 1900-1-1 00:00:00" ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> <wbr> time:calendar = "standard" ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> <wbr> time:axis = "T" ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> short p100.128(time, level, latitude, longitude) ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> <wbr> p100.128:long_name = "Experimental product" ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> <wbr> p100.128:units = "~" ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> <wbr> p100.128:grid_type = "gaussian" ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> <wbr> p100.128:add_offset = 2826.8713701289 ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> <wbr> p100.128:scale_factor = 0.0914882578243023 ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> <wbr> p100.128:_FillValue = -32767s ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> <wbr> p100.128:missing_value = -32767s ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">// global attributes:</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> <wbr> :CDI = "Climate Data Interface version 1.7.0 (<a href="http://mpimet.mpg.de/cdi" target="_blank">http://mpimet.mpg.de/cdi</a>)" ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> <wbr> :history = "Mon Nov 28 23:20:13 2016: cdo -O -v mergetime ICMGGglxc+<a href="http://200701_var100.nc" target="_blank">200701_var100.nc</a> ICMGGglxc+<a href="http://200702_var100.nc" target="_blank">200702_var100.nc</a> ICMGGglxc+<a href="http://200703_var100.nc" target="_blank">200703_var100.nc</a> ICMGGglxc+<a href="http://200704_var100.nc" target="_blank">200704_var100.nc</a> ICMGGglxc+<a href="http://200705_var100.nc" target="_blank">200705_var100.nc</a> ICMGGglxc+<a href="http://200706_var100.nc" target="_blank">200706_var100.nc</a> ICMGGglxc+<a href="http://200707_var100.nc" target="_blank">200707_var100.nc</a> ICMGGglxc+<a href="http://200708_var100.nc" target="_blank">200708_var100.nc</a> ICMGGglxc+<a href="http://200709_var100.nc" target="_blank">200709_var100.nc</a> ICMGGglxc+<a href="http://200710_var100.nc" target="_blank">200710_var100.nc</a> ICMGGglxc+<a href="http://200711_var100.nc" target="_blank">200711_var100.nc</a> ICMGGglxc+<a href="http://200712_var100.nc" target="_blank">200712_var100.nc</a> ICMGGglxc+<a href="http://2007var100.nc" target="_blank">2007var100.nc</a>\n2016-<wbr>11-28 22:01:41 GMT by grib_to_netcdf-1.17.0: grib_to_netcdf -k 3 -o ICMGGglxc+<a href="http://200712_var100.nc" target="_blank">200712_var100.nc</a> ICMGGglxc+200712_var100.grb" ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> <wbr> :Conventions = "CF-1.6" ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> <wbr> :CDO = "Climate Data Operators version 1.7.0 (<a href="http://mpimet.mpg.de/cdo" target="_blank">http://mpimet.mpg.de/cdo</a>)" ;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">}</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">[nclcodes]$</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">[nclcodes]$ ncl process_t511.ncl</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">Copyright (C) 1995-2015 - All Rights Reserved</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">University Corporation for Atmospheric Research</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">NCAR Command Language Version 6.3.0</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">The use of this software is governed by a License Agreement.</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">See <a href="http://www.ncl.ucar.edu/" target="_blank">http://www.ncl.ucar.edu/</a> for more details.</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">Variable: a</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">Type: file</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">File path : /home/ICMGGglxc+<a href="http://2007var100.nc" target="_blank">2007var100.nc</a></span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">Number of global attributes : 4</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">Number of dimensions : 4</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">Number of chunk_dimensions : 1</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">Number of variables : 5</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">Variable: vNames</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">Type: string</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">Total Size: 40 bytes</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> 5 values</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">Number of Dimensions: 1</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">Dimensions and sizes: [5]</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">Coordinates:</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">(0) /longitude</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">(1) /latitude</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">(2) /level</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">(3) /time</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">(4) /p100.128</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">fatal:["Execute.c":132]:<wbr>variable (/p100.128) is not in file (/home/ICMGGglxc+<a href="http://2007var100.nc" target="_blank">2007var100.nc</a><wbr>)</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">fatal:["Execute.c":6316]:<wbr>variable (/p100.128) is not in file (a)</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">fatal:["Execute.c":8575]:<wbr>Execute: Error occurred at or near line 18 in file process_t511.ncl</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">Cheers,</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">/M</span><u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p></div><p class="MsoNormal"><span style="font-family:"Times New Roman"">______________________________<wbr>_________________<br>ncl-talk mailing list<br><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" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><u></u><u></u></span></p></div></blockquote></div><p class="MsoNormal"><span style="font-family:"Times New Roman""><u></u> <u></u></span></p><div><div><div><div><div><div><div><div><div><p class="MsoNormal"><span style="font-family:Helvetica;color:black"><u></u> <u></u></span></p></div></div></div></div></div></div></div></div></div></div><p class="MsoNormal"><span style="font-family:"Times New Roman"">______________________________<wbr>_________________ ncl-talk mailing list <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a> List instructions, subscriber options, unsubscribe: <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a> <u></u><u></u></span></p></div></div></div></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">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/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>