del = 0.5
latStrt = 38.5
latLast = 11.0
N = toint((latStrt-latLast)/del +1)
lat = fspan(latStrt,latLast,N)
lonStrt = 66.0
lonLast = 105.5
lon = fspan(lonStrt,lonLast,N)
latlon = toint(lat*100000) + toint(lon*10)
latlons = tostring(latlon) ; strint
print(lat+" "+lon+" "+latlon+" "+latlons)
latlonc = tochar(latlons) ; characters
print(latlonc)
latloncx= latlonc(:,0:6) ; no null char:x
print(latloncx)
On 06/02/2011 12:15 PM, Debasish wrote:
> Dear NCL users,
>
> I have latitudes and longitudes for N station. I would like to create a array of names of the N stations using lat and lon.
>
> For example:
>
> lat = (/38.5, 38, 37.5, 37, 36.5, 36, 35.5, 35, 34.5.............................12, 11.5, 11/) ; N dimensional float
> lon=(/66.5, 67, 67.5, 68, 68.5, 69, 69.5, 70, 70.5,.............................99.5, 100, 100.5/); N dimensional float
>
> NAME = new(N, character)
>
> where NAME(0) = 3850665 ; (lat*100000)+(lon*10)
> NAME(1)= 3800670
> :
> :
> so on
>
> How do I create this type of character array in NCL?
>
> Thanks
>
> Debasish
>
>
> _______________________________________________
> 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-talkReceived on Thu Jun 2 13:34:33 2011
This archive was generated by hypermail 2.1.8 : Thu Jun 09 2011 - 14:56:48 MDT