[ncl-talk] Error in co-ordinate subscripting

Melissa Lazenby M.Lazenby at sussex.ac.uk
Tue Feb 10 11:01:25 MST 2015


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150210/c4ad4677/attachment.html 


More information about the ncl-talk mailing list