[ncl-talk] Error in co-ordinate subscripting

Rick Brownrigg brownrig at ucar.edu
Tue Feb 10 11:36:13 MST 2015


Hi,

Its a bit hard to tell (for me at least) from the information given.  But
in your expression for calculating speed, are you using only a subrange of
the available lat/lon values;, e..g, with the {lat|-40:10},{lon-10:70}
notation?  If so, it seems that when you attach coordinates to "speed",
they should be the same subranges, of the same dimensions as speed itself.
I'm not sure of the exact notation, but something like:

speed&lat = lat({-40:10})
speed&lon = lon({-10:70})

Hope that helps...
Rick


On Tue, Feb 10, 2015 at 11:01 AM, Melissa Lazenby <M.Lazenby at sussex.ac.uk>
wrote:

>  Hi All
>
> I am trying to draw the magnitude of moisture flux vectors as shaded
> contours and I cant seem to get the scripting correct when calculating the
> magnitude.
> Any advice of the error below would be appreciated.
>
> Error:
> Variable: speed
> Type: float
> Total Size: 7208 bytes
>             1802 values
> Number of Dimensions: 2
> Dimensions and sizes:    [34] x [53]
> Coordinates:
> Number Of Attributes: 1
>   _FillValue :    1e+20
> fatal:Coordinate variables must be the same dimension as their dimension
> fatal:No coordinate variable exists for dimension (lat) in variable (speed)
> fatal:Execute: Error occurred at or near line 123 in file
> Obs_pr_qflux_qfluxmag.ncl
>
>
> Script:
>  u_avg = dim_avg_n_Wrap(u1,0) ;
>  v_avg = dim_avg_n_Wrap(v1,0) ;
>
> u_avg = u_avg/5
> v_avg = v_avg/5
>
> u = u/5
> v = v/5
>
>   speed    = sqrt(u_avg({lat|-40:10},{lon|-10:70})^2+v_avg({lat|-40:10},
> {lon|-10:70})^2)
>
> printVarSummary(speed)
>
>     speed!0 = "lat"
>     speed!1 = "lon"
>     speed&lat = lat
>     speed&lon = lon
>     speed at long_name = "Wind Speed"
>     speed at units     = "m/s"
>
>
> printVarSummary(speed)
>
> Many thanks!
>
> Kindest Regards
> Melissa
>
> _______________________________________________
> ncl-talk mailing list
> 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/20150210/5ed0a82d/attachment.html 


More information about the ncl-talk mailing list