In the provided sample, if easch "i" will
have changes in dimension sizes
do i=0,15
filebin=str_sub_str(files(i),"nc","bin")
varfile=addfile(dir+files(i),"r")
varname=getfilevarnames(varfile) ; could change next iteration?
var=varfile->$varname(0)$ ; get the 1st variable on the file
var1=var(:,0,:,:)
print("filebin="+filebin)
fbinrecwrite(dir+filebin,-1,var1$i)
delete(varname) ; anything that could change size/sheap
delete(var)
delete(var1)
end do
On 9/9/10 12:14 PM, Mehmet Coskun wrote:
> How can I allovate deallocate array in do loop, in example , I am
> reading multiple file then writing each variable of file to bin file
> / would like to deallocate and allocate 'var' and 'var1'/ array
>
> do i=0,15
> filebin=str_sub_str(files(i),"nc","bin")
> varfile=addfile(dir+files(i),"r")
> varname=getfilevarnames(varfile)
> var=varfile->$varname(0)$
> var1=var(:,0,:,:)
> print(filebin)
> fbinrecwrite(dir+filebin,-1,var1$i)
> end do
>
>
>
> thank you
>
> mehmet
>
>
>
> _______________________________________________
> 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 Thu Sep 9 11:20:56 2010
This archive was generated by hypermail 2.1.8 : Thu Sep 16 2010 - 11:05:24 MDT