Re: does not have an associated coordinate variable

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Aug 08 2012 - 17:07:10 MDT

The error is telling you exactly what the problem is:

    lat = lat1

The variable "lat" already exists, because of previous code. You are now trying to assign "lat1" to it, which is a different size.

I'm not sure why you have that line. Can't you just do:

; lat = lat1
    wgty = cos(0.01745329*lat1)

If you still have a question about lag regression, please post a new ncl-talk question. People will otherwise see the old subject and think you are still asking about coordinate variables.

--Mary

On Aug 8, 2012, at 12:41 PM, R Phani wrote:

> Dear Mary,
>
> Thank you for your kind suggestion and it worked. Now, going further in to my calculation I am getting an error which I am not able to sort out. I want to redefine the latitudes for the lag regression. Is there a way to get around?
>
> regards,
> Phani.
> --------------------
> fatal:Dimension sizes of left hand side and right hand side of assignment do not match
> fatal:Execute: Error occurred at or near line 121 in file anom_test.ncl
> --------------------
>
>
>
> ----- Original Message -----
> From: "Mary Haley" <haley@ucar.edu>
> To: "R Phani" <rphani@tropmet.res.in>
> Cc: "NCL" <ncl-talk@ucar.edu>
> Sent: Wednesday, August 8, 2012 8:11:22 PM
> Subject: Re: does not have an associated coordinate variable
>
> 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
>
> <anom_test.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 17:07:23 2012

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