[ncl-talk] Coordinate variables must be the same dimension as their dimension
Amadou Coulibaly
mpapin24 at gmail.com
Tue Mar 8 15:33:46 MST 2016
Hello Mary,
Thank you so much. It has worked.
Best
On 7 March 2016 at 19:00, Mary Haley <haley at ucar.edu> wrote:
> You are reading lat and lon off *all* files, which I don't think is what
> you want.
>
> If your lat/lon are the same across all files, then instead of doing this:
>
> lat = f[:]->lat
> lon = f[:]->lon
>
> Try this:
>
> lat = f[0]->lat
> lon = f[0]->lon
>
> This will read lat/lon off the first file in the list.
>
> Really, though, since you are reading u and v, and since they have lat/lon
> coordinate arrays attached to them, you can just use those, instead of
> reading lat/lon separately. For example:
>
> wind_dir&lat = u&lat
> wind_dir&lon = u&lon
>
> --Mary
>
>
> On Fri, Mar 4, 2016 at 4:00 PM, Amadou Coulibaly <mpapin24 at gmail.com>
> wrote:
>
>> Dear NCL users,
>>
>> I am getting some errors messages that I don't understand them. I am
>> using wind speed/direction from CFSR data to do a plot, but below are
>> errors occurring:
>>
>> fatal:Coordinate variables must be the same dimension as their dimension
>> fatal:No coordinate variable exists for dimension (lat) in variable
>> (wind_dir)
>> fatal:["Execute.c":8578]:Execute: Error occurred at or near line 59 in
>> file monthly_lsb_test2.ncl
>>
>> So I tried to print out lat/lon and u:
>> Variable: lon
>> Type: float
>> Total Size: 15840 bytes
>> 3960 values
>> Number of Dimensions: 1
>> Dimensions and sizes: [lon | 3960]
>> Coordinates:
>> lon: [-5.. 5]
>> Number Of Attributes: 4
>> name : lon
>> long_name : longitude
>> units : degree_east
>> valid_range : ( -5, 5 )
>>
>> Variable: lat
>> Type: float
>> Total Size: 9120 bytes
>> 2280 values
>> Number of Dimensions: 1
>> Dimensions and sizes: [lat | 2280]
>> Coordinates:
>> lat: [8.8985..3.2784]
>> Number Of Attributes: 4
>> name : lat
>> long_name : latitude
>> units : degree_north
>> valid_range : ( 3.2784, 8.8985 )
>>
>> Variable: u
>> Type: float
>> Total Size: 36636864 bytes
>> 9159216 values
>> Number of Dimensions: 3
>> Dimensions and sizes: [time | 14608] x [lat | 19] x [lon | 33]
>> Coordinates:
>> time: [ 1..87643]
>> lat: [8.8985..3.2784]
>> lon: [-5.. 5]
>> Number Of Attributes: 5
>> standard_name : eastward_wind
>> product_description : 1-hour Forecast
>> units : m s-1
>> level : Specified height above ground - value: 10 m
>> _FillValue : 3.4e+38
>>
>> I realized that the dimension sizes of lat/lon are different in u. I have [lat
>> | 2280], [lon | 3960], but in u I have [time | 14608] x [lat | 19] x
>> [lon | 33].
>>
>> What is wrong with my code? Please find attached my script
>>
>> Best
>>
>> --
>> * COULIBALY AMADOU *
>> PhD Student on West African Climate System (WACS)
>> FUTA - Federal University of Technology of Akure, Nigeria
>>
>> *Visiting Student - *
>> *University of Cologne, Germany**Institute of Geophysics and Meteorology*
>> Pohligstr. 3 / Office 3.102
>> D-50969 Köln
>>
>> *Project*: WASCAL (West African Science Service Centre on Climate Change
>> and Adapted Land Use)
>> Phone:(+234) 812 965 3659 /(+223) 90 08 26 71 /(+226) 64 57 37 27 /+49
>> 15218352574
>>
>> E-mail: mpapin24 at gmail.com / coulibalya68 at yahoo.com
>>
>> "*The time is always right to do right": Nelson Mandela*
>>
>> *"Character is like a tree and reputation like a shadow. The shadow is
>> what we think of it; the tree is the real thing" : Abraham Lincoln*
>>
>> *"Do what you can, with what you have, where you are" Theodore Roosevelt*
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
--
* COULIBALY AMADOU *
PhD Student on West African Climate System (WACS)
FUTA - Federal University of Technology of Akure, Nigeria
*Visiting Student - *
*University of Cologne, Germany**Institute of Geophysics and Meteorology*
Pohligstr. 3 / Office 3.102
D-50969 Köln
*Project*: WASCAL (West African Science Service Centre on Climate Change
and Adapted Land Use)
Phone:(+234) 812 965 3659 /(+223) 90 08 26 71 /(+226) 64 57 37 27 /+49
15218352574
E-mail: mpapin24 at gmail.com / coulibalya68 at yahoo.com
"*The time is always right to do right": Nelson Mandela*
*"Character is like a tree and reputation like a shadow. The shadow is
what we think of it; the tree is the real thing" : Abraham Lincoln*
*"Do what you can, with what you have, where you are" Theodore Roosevelt*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160308/70ebbb2e/attachment.html
More information about the ncl-talk
mailing list