[ncl-talk] Problem with assigning coordinate

Ipsita Putatunda ipsita.putatunda at gmail.com
Sat Mar 7 10:58:04 MST 2020


Dear NCL users,
Getting warning message while trying to plot the variable.

"Warning: Data either does not contain a valid latitude coordinate array or
doesn't contain one at all."
My script is as follows:
load "/usr/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "/usr/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
 begin
   netCDF=True
   plot=True
 diri="./"
;==============================================================
 fn1="3A-DAY.20161231.V06A.HDF5"
 printVarSummary(fn1)
 lev=fspan(0.25,20,80)
 lon=fspan(-180,180,720)
 lat=fspan(-67,67,268)
 lat at long_name = "latitude"
 lon at long_name = "longitude"
 lat at units = "degrees_north"
 lon at units = "degrees_east"
;-------------------------------------------------------------------
 f= addfile(fn1, "r")
 ;g=f->Grid
 QR1 = "/Grid/LHCndMean"
 QR=f->$QR1$
 QR!0="nlayer"
 QR!1="nlon"
 QR!2="nlat"
 QR&nlayer=lev
 QR&nlon=lon
 QR&nlat=lat
 QR&nlat at units="degrees_north"
 QR&nlon at units="degrees_east"
 printVarSummary(QR&nlat)
 printVarSummary(QR&nlon)
;-------------------------------------------------------------------
 wks   = gsn_open_wks ("png","QR")
 gsn_define_colormap(wks,"rainbow")

res                  = True
res at gsnMaximize      = True
res at cnFillOn         = True
res at cnLinesOn        = False
res at cnLineLabelsOn   = False
res at gsnSpreadColors  = True
res at gsnAddCyclic     = False
  res at mpMinLatF = min(QR&nlat)
  res at mpMaxLatF = max(QR&nlat)
  res at mpMinLonF = min(QR&nlon)
  res at mpMaxLonF = max(QR&nlon)
plot = gsn_csm_contour_map(wks,QR(0,:,:),res)
 end


Any help in this issue will be appreciated.
Thanks in advance,
Ipsita
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200307/d9f802f3/attachment.html>


More information about the ncl-talk mailing list