[ncl-talk] fatal:No coordinate variable exists for dimension (lat2d) in variable (p)

Dennis Shea shea at ucar.edu
Thu Apr 25 09:51:25 MDT 2019


As noted, your ncl talk questions are being 'stopped' somewhere. NCL has
legendary support. More so than othere tools.

  diri="/home/zmumba/CORDEX/CDO_Out/"
  filename = "month01.nc"
  f = addfile(diri+filename,"r")

  p = f->pr            ; keep meta data
  pr = pr*86400    ; alter values
  pr at units = "..."  ; change to reflect ne values

  printVarSummary(pr)
  printMinMax(pr, 0)

  lat2d    = f->lat             ; (y,x)
  lon2d    = f->lon             ; (y,x)

; Lines below added to effect masking

;; NO!!!   NO!!!  NO!!!  NOT FOR 2D lat/lon
;;p!0   = "lat2d" ; No error message at this and following line.
;;p!1   = "lon2d"

;;;NO!  By netCDF rule coordinate arrays [*&* syntax] must be
*1-dimensional*

;; The following are not legal
;  p&lat2d = lat2d ; fatal:No coordinate variable exists for dimension
(lat2d) in variable (p).
 ; p&lat2d = lat ; fatal:Variable (lat) is undefined.

The are several reserved *attributes* recognized bt NCL for graphics
pirposes
Note the *@* syntax

  p*@*lat2d = lat2d
  p*@*lon2d = lon2d

On Thu, Apr 25, 2019 at 9:31 AM Rick Brownrigg <brownrig at ucar.edu> wrote:

> HI Zilore,
>
> For whatever reason, your posts to this group often end up in our spam
> boxes; its not just you but others whose mail originates from a yahoo.com
> address. I will inquire as to why that's the case, but I don't administer
> the listservs.
>
> As to your specific question, off hand your script looks right in terms of
> creating/attaching a coordinate variable. Are you able to send me your data
> file (you can send it directly to me)?
>
> Rick
>
>
> On Thu, Apr 25, 2019 at 1:11 AM zilore mumba <zmumba at yahoo.com> wrote:
>
>> Hello,
>> Though I rarely get assistance on this forum (which may be a signal that
>> my posts are either unreasonable or unclear or both), I will still request
>> for assistance.
>> I have data on a curvilinear grid. I am able to display my data ok.
>> However I would like to mask out data outside my area of interest. For the
>> masking to work (mask_.4.ncl) I think I need to attach coordinates to my
>> variable, otherwise I get a blank plot.
>> Part if my script is given below, and it works up to the line "lon2d
>> = f->lon" for the case of no masking.
>>
>> I have been fidgeting with the lines that follow the above line, to
>> effect the masking. The errors I get are indicated against the trials I
>> made.
>> Assistance will be appreciated.
>>
>> begin
>>
>>   diri="/home/zmumba/CORDEX/CDO_Out/"
>>   filename = "month01.nc"
>>   f = addfile(diri+filename,"r")
>>
>>   p = f->pr*86400
>>
>>   lat2d    = f->lat             ; (y,x)
>>   lon2d    = f->lon             ; (y,x)
>>
>> ; Lines below added to effect masking
>>   p!0   = "lat2d" ; No error message at this and following line.
>>   p!1   = "lon2d"
>>
>> ;  p&lat2d = lat2d ; fatal:No coordinate variable exists for dimension
>> (lat2d) in variable (p).
>>   p&lat2d = lat ; fatal:Variable (lat) is undefined.
>>
>>   p&lon2d = lon2d ; will obviously give errors as above
>>
>> ; How to formulate the following?
>> ;-------------------------------
>>   p&lat2d at units = "degrees_north"
>>   p&lon2d at units = "degrees_east"
>>   lat2d at long_name = "latitude"
>>   lon2d at long_name = "longitude"
>>
>>
>>
>> _______________________________________________
>> 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/20190425/9e9a14d8/attachment.html>


More information about the ncl-talk mailing list