[ncl-talk] Could NCL open GrADS Data Server

Dennis Shea shea at ucar.edu
Sun Aug 13 08:54:42 MDT 2017


oops!

   x = f->$vnames(n)$       ; n=0,1,2,....

====
Also, if some future version of NCL were to introduce a "." as a syntax
operator, there could be issues.

Consider a variable name   foo+8

        x = f->foo+8

Should NCL interpret this as

        x = (f->foo) + 8   ; add 8 to every element foo

With the $ and string syntax, foo+8 would be consider as a unique name

        x = f->$"foo+8"$

Most would program as

       vnam = "foo+8"
       x = f->$vnam$



On Sun, Aug 13, 2017 at 8:32 AM, Dennis Shea <shea at ucar.edu> wrote:

> re: " ... perhaps historically invalid naming in NetCDF 3"
>
> I believe that classic netCDF or, perhaps, the netCDG Users Group (NUG),
> does not allow or recommends against certain characters.
>
> https://www.ncl.ucar.edu/Document/Manuals/language_man.pdf
> page 13
>
>    x = f->$
>
>
> An excellent NCL tutorial is at:
>       https://www.ncl.ucar.edu/Document/Manuals/NCL_User_Guide/
>
>
> On Sun, Aug 13, 2017 at 8:15 AM, Rick Brownrigg <brownrig at ucar.edu> wrote:
>
>> Hi,
>>
>> NCL considers the dotted names as invalid syntax. I'm really not sure why
>> offhand -- perhaps historically invalid naming in NetCDF 3? Maybe an
>> outright bug? I'll check into it.
>>
>> In any case, as a work-around you can use NCL's dynamic variable name
>> substitution feature; e.g.,
>>
>>    stmp = "reports.lat"
>>    lats = f->$stmp$
>>
>> This works for me -- its a bit cumbersome, but it will get you going.
>>
>> Rick
>>
>>
>> On Sat, Aug 12, 2017 at 11:18 PM, Rabah Hachelaf <hachelaf at sca.uqam.ca>
>> wrote:
>>
>>> Hello,
>>>
>>> I can't read values from variables of this opendap server : "
>>> http://monsoondata.org:9090/dods/stn/metar/past48"
>>> here is the variable list :
>>> Variable: vnames
>>> Type: string
>>> Total Size: 112 bytes
>>>             14 values
>>> Number of Dimensions: 1
>>> Dimensions and sizes:   [14]
>>> Coordinates:
>>> (0)     reports.stid
>>> (1)     reports.lon
>>> (2)     reports.lat
>>> (3)     reports.time
>>> (4)     reports.cld
>>> (5)     reports.ds
>>> (6)     reports.filt
>>> (7)     reports.ptype
>>> (8)     reports.slp
>>> (9)     reports.ts
>>> (10)    reports.us
>>> (11)    reports.vis
>>> (12)    reports.vs
>>> (13)    reports.wx
>>>
>>> but when i try from example : tmp=f->reports.ts
>>> i get this error :
>>> Copyright (C) 1995-2017 - All Rights Reserved
>>>  University Corporation for Atmospheric Research
>>>  NCAR Command Language Version 6.4.0
>>>  The use of this software is governed by a License Agreement.
>>>  See http://www.ncl.ucar.edu/ for more details.
>>> fatal:syntax error: line 21 in file get_obs.ncl before or near .
>>> temp=f->reports.
>>> ---------------^
>>>
>>> fatal:Syntax Error in block, block not executed
>>> fatal:error at line 41 in file get_obs.ncl
>>>
>>>
>>> Any help.
>>> Thank you
>>>
>>> Rabah
>>>
>>> 2017-08-12 0:51 GMT-04:00 Rabah Hachelaf <hachelaf at sca.uqam.ca>:
>>>
>>>> Thanks Rick,
>>>>
>>>> My Ncl version is 6.4 with opendap  enabled
>>>>
>>>> Rabah
>>>>
>>>>
>>>> Le vendredi 11 août 2017, Rick Brownrigg <brownrig at ucar.edu> a écrit :
>>>>
>>>>> Hi Rabah,
>>>>>
>>>>> I was able to open this file with an NCL:
>>>>>
>>>>>   f=addfile("http://monsoondata.org:9090/dods/stn/metar/past48","r")
>>>>>
>>>>> The response time took on the order of a minute (this evening), but it
>>>>> did it. Your version NCL has to be OpenDAP enabled for such a network file
>>>>> connection, which is optional to building NCL. Do you know where/how/what
>>>>> your version of NCL was built for?  I unfortunately don't know how to make
>>>>> NCL tell you its configuration :-/
>>>>>
>>>>> Rick
>>>>>
>>>>>
>>>>> On Fri, Aug 11, 2017 at 8:02 PM, Rabah Hachelaf <hachelaf at sca.uqam.ca>
>>>>> wrote:
>>>>>
>>>>>> Hello NCL users,
>>>>>>
>>>>>> NCL can't open file from http://monsoondata.org:90
>>>>>> 90/dods/stn/metar/past48 server and return this error :
>>>>>>
>>>>>> Copyright (C) 1995-2017 - All Rights Reserved
>>>>>>  University Corporation for Atmospheric Research
>>>>>>  NCAR Command Language Version 6.4.0
>>>>>>  The use of this software is governed by a License Agreement.
>>>>>>  See http://www.ncl.ucar.edu/ for more details.
>>>>>> fatal:Could not open (http://monsoondata.org:9090/d
>>>>>> ods/stn/metar/past360)
>>>>>>
>>>>>> However GrADS open files from this server using command "open
>>>>>> http://monsoondata.org:9090/dods/stn/metar/past48"
>>>>>>
>>>>>> Any idea about this issue.
>>>>>>
>>>>>> Thank you
>>>>>> Rabah
>>>>>>
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> ncl-talk mailing list
>>>>>> ncl-talk at ucar.edu
>>>>>> List instructions, subscriber options, unsubscribe:
>>>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>>>
>>>>>>
>>>>>
>>>>
>>>> --
>>>> Envoyé avec Gmail Mobile
>>>>
>>>
>>>
>>>
>>> --
>>> ------------------------------
>>> Cordialement,
>>> Best regards,
>>> Rabah Hachelaf
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170813/a396f488/attachment.html 


More information about the ncl-talk mailing list