[ncl-talk] dimension error in gsn_csm.ncl

Mary Haley haley at ucar.edu
Mon Nov 7 21:20:42 MST 2016


Your problem is evident in the u.cross.ncl.error output.

If you look at the printVarSummary output of uu1, which is the variable you
are trying to plot, you will see it does not have any coordinate arrays:

Variable: uu1
Type: float
Total Size: 118244 bytes
            29561 values
Number of Dimensions: 2
Dimensions and sizes:   [41] x [721]
Coordinates:
Number Of Attributes: 1
  _FillValue :  9.96921e+36

If you look at how "uu1" is created:

    uu1 = u(it,:,:,ml)

then you need to look at at "u", which also doesn't have coordinate arrays:

Variable: u
Type: float
Total Size: 6134025744 bytes
            1533506436 values
Number of Dimensions: 4
Dimensions and sizes: [36] x [41] x [721] x [1441]
Coordinates:
Number Of Attributes: 1
  _FillValue : 9.96921e+36

You can finally trace "u" to this line:

    u  = doubletofloat(a->u)
When you use conversion routines like "doubletofloat", this strips off all
the metadata. You need to add, after the above line:

  copy_VarMeta(a->u,u)

which copies all the metadata from "u" on the file, to the local "u"
variable. This will then cause the metadata to be propagated to uu1.

--Mary


On Mon, Nov 7, 2016 at 10:40 AM, Gurer, Kemal at ARB <kemal.gurer at arb.ca.gov>
wrote:

> Dear all,
>
>
>
> I am trying to plot several cross sections from “u.nc” netcdf file that I
> created using “u_mpas_to_latlon.ncl” file (attached) using “u.cross.ncl”
> ncl file that I adapted from narr_6.ncl file. The error output of the ncl
> file and the ncdump information of “u.nc” file are also attached. I
> created the u-variable with (time, lev, lat, lon) dimensions, but I am
> passing the u-variable to the plot routine at constant time steps, so the
> first dimension of the variable is “lev”. Yet, the gsn_csm.ncl file
> complains that “the first dimension of the input data must have a
> coordinate variable called ‘lev.’”. Could you help me to identify where I
> am doing wrong? What changes do I need to make in “u.cross.ncl” file and/or
> in “u_mpas_lat_lon.ncl” file during the creation of u.nc file?
>
>
>
> I appreciate any help. Thank you.
>
>
>
> Kemal.
>
>
>
> _______________________________________________
> 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/20161107/887e3c7f/attachment-0001.html 


More information about the ncl-talk mailing list