Re: units assign error

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon Feb 14 2011 - 11:04:56 MST

Where did you assign values to the "lat" and "lon" variables?????
All you did was create arrays that are initialized as default
(_FillValues) values. When you rin into errors please us "print"
or "printVarSummary" to look at the contents of you variables.

Please use something like fspan

   lat = fspan(latS,latN,nlat)
   lat!0 = "lat"
   lat@units = "degrees_north"
   lat&lat = lat
   print(lat)

Also, in this case you do *not* need preallocate space via 'new'

On 02/14/2011 10:49 AM, Ioana Colfescu wrote:
> Hi,
>
> I try to assign dimensions/coordinates to the variables I read from a binary. My code is :
>
> nlat = 46
> nlon = 128
> nrec=1560
> ts = new((/nrec,nlat,nlon/),float)
> time=new((/nrec/),float)
> lat=new((/nlat/),float)
> lon=new((/nlon/),float)
> path = ("/data/oldfarm2/colfi/cam3.1.p2/CCSM/IEt42_test1/temp/ts_anom.dat")
>
> do ir=0,1559
> rec=ir
> ts(ir,:,:)=fbindirread(path,rec,(/nlat,nlon/),"float")
> end do
> ts!0="time"
>
> ts!1="lat"
> ts!2="lon"
> ts&time=time
> ts&lon=lon
> ts&lat=lat
> ; ts&lat@units="degrees_north"
> ; ts&lon@units="degrees_east"
>
> I get the following error :
>
>
> (0) check_for_y_lat_coord: Warning: Data either does not contain a valid latitude coordinate array or doesn't contain one at all.
> (0) A valid latitude coordinate array should have a 'units' attribute equal to one of the following values:
> (0) 'degrees_north' 'degrees-north' 'degree_north' 'degrees north' 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg north'
> (0) check_for_lon_coord: Warning: Data either does not contain a valid longitude coordinate array or doesn't contain one at all.
> (0) A valid longitude coordinate array should have a 'units' attribute equal to one of the following values:
> (0) 'degrees_east' 'degrees-east' 'degree_east' 'degrees east' 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east'
> /data/oldfarm2/colfi/cam3.1.p2/CCSM/IEt42_test1/scripts[259]
>
>
> And if I assign the units I still get an error another one but still an error. Could someone please tell me what should I do about it ?
>
> Thank you,
>
> Ioana
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
======================================================
Dennis J. Shea                  tel: 303-497-1361    |
P.O. Box 3000                   fax: 303-497-1333    |
Climate Analysis Section                             |
Climate & Global Dynamics Div.                       |
National Center for Atmospheric Research             |
Boulder, CO  80307                                   |
USA                        email: shea 'at' ucar.edu |
======================================================
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Feb 14 11:05:01 2011

This archive was generated by hypermail 2.1.8 : Tue Feb 15 2011 - 09:43:19 MST