Re: does not have an associated coordinate variable

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Aug 08 2012 - 08:41:22 MDT

Dear Phani,

In order to use coordinate subscripting:

   y = newolr(:,{12.063:12.063},{40.064:40.064})

your "newolr" array must have coordinate arrays attached to it.

You've only *named* the dimensions of newolr with:

   newolr!0 = "time"
   newolr!1 = "lat"
   newolr!2 = "lon"

You still need to assign coordinate arrays, however.

Instead of doing the above 3 lines, you can try an unadvertised function:

   copy_VarCoords_n(olr,newolr,(/0,2,3/))

This will copy over the dimension names *and* coordinate arrays of dimensions 0, 2, 3 of olr, to the dimensions of newolr.

If you don't appear to have this function, or if it doesn't seem to work, then I've attached the code for it. You will then need to add this line:

load "./copy_VarCoords_n.ncl"

after:

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"

--Mary

On Aug 8, 2012, at 1:15 AM, R Phani wrote:

> Hi NCL users,
>
> I was trying to extract the data over an area for the calculation of wgt_areaave_Wrap and coming across with this error.
>
> -------------------------------------------------------------------------------
> fatal:Dimension (lon) of (newolr) does not have an associated coordinate variable
> fatal:Execute: Error occurred at or near line 50 in file test_read.ncl
> -------------------------------------------------------------------------------
>
> How to go away with this error?
>
> Below is the mesg. and the attached is the ncl script with file uploaded.
>
> Regards,
> Phani.
>
> ===========================================
> Copyright (C) 1995-2009 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 5.1.1
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
>
>
> Variable: olr
> Type: float
> Total Size: 887685120 bytes
> 221921280 values
> Number of Dimensions: 4
> Dimensions and sizes: [time | 3612] x [toa | 1] x [latitude | 192] x [longitude | 320]
> Coordinates:
> time: [ 0..3611]
> toa: [ 0.. 0]
> latitude: [39.92..-19.863]
> longitude: [40.064..139.911]
> Number Of Attributes: 10
> long_name : Upward long wave radiation flux
> units : W/m**2
> _FillValue : 2e+20
> source : GRIB data
> name : ULWRF
> title : Upward long wave radiation flux
> date : 11/02/99
> time : 00:00
> valid_min : 74
> valid_max : 391
>
>
> Variable: time
> Type: double
> Total Size: 28896 bytes
> 3612 values
> Number of Dimensions: 1
> Dimensions and sizes: [time | 3612]
> Coordinates:
> time: [ 0..3611]
> Number Of Attributes: 2
> units : days since 1999-02-11 00:00:00
> calendar : standard
>
>
> Variable: lat
> Type: float
> Total Size: 768 bytes
> 192 values
> Number of Dimensions: 1
> Dimensions and sizes: [latitude | 192]
> Coordinates:
> latitude: [39.92..-19.863]
> Number Of Attributes: 3
> long_name : latitude
> units : degrees_north
> standard_name : latitude
>
>
> Variable: lon
> Type: float
> Total Size: 1280 bytes
> 320 values
> Number of Dimensions: 1
> Dimensions and sizes: [longitude | 320]
> Coordinates:
> longitude: [40.064..139.911]
> Number Of Attributes: 3
> long_name : longitude
> units : degrees_east
> standard_name : longitude
> fatal:Dimension (lon) of (newolr) does not have an associated coordinate variable
> fatal:Execute: Error occurred at or near line 50 in file test_read.ncl
>
> ===============================================================<test_read.ncl>_______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Wed Aug 8 08:41:36 2012

This archive was generated by hypermail 2.1.8 : Wed Aug 15 2012 - 08:12:08 MDT