Re: Expand the the array in NetCDF file

From: Michael Notaro <mnotaro_at_nyahnyahspammersnyahnyah>
Date: Mon, 07 May 2007 15:18:03 -0500

If you have var(147,111) and want (148,112), how about this?

a = addfile("file.nc","r")
var = a->var
newvar=new((/148,112/),float)
newvar=0.
newvar(0:146,0:109)=var
b = addfile("filenew.nc","c")
b->var=newvar

Mike

On May 7, 2007, at 3:12 PM, Mary Haley wrote:

>
> I'm afraid there's no automatic way to do this in NCL. Does anybody
> out there know if you can do something like this with the netCDF
> operators?
>
> --Mary
>
> On Fri, 4 May 2007, Xiaoming Hu wrote:
>
>> Dear all
>>
>> I am wondering if there is a easy way to expand all the arrays in
>> NetCDF by 1? I mean currently the dimension of the arrays is
>> 147*111, I want to increase the dimension to 148*112. It is fine
>> to put 0 to the expanded grid cells, I mean for last column and
>> last row in the new NetCDF file.
>>
>> Thanks a lot
>>
>> Xiaoming
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk_at_ucar.edu
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon May 07 2007 - 14:18:03 MDT

This archive was generated by hypermail 2.2.0 : Tue May 08 2007 - 09:54:33 MDT