[ncl-talk] Problem with assigning coordinate

Rick Brownrigg brownrig at ucar.edu
Sat Mar 7 21:31:31 MST 2020


Hi,

Offhand, it looks like you are constructing the coordinate arrays properly.
I notice you calculate the lat coordinate array with this statement:

    lat=fspan(-67,67,268)

Are you certain the length of this array lines up with the corresponding
dimension of the variable QR?

HTH...Rick


On Sat, Mar 7, 2020 at 10:58 AM Ipsita Putatunda via ncl-talk <
ncl-talk at ucar.edu> wrote:

> 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
> _______________________________________________
> 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/20200307/3a446a5f/attachment.html>


More information about the ncl-talk mailing list