Re: about changing vertical layers of a file

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue Dec 20 2011 - 09:56:23 MST

You can try:

    a = addfile("/home/lshl/raf/aerosol.climatology.nc","w")
    arr = a->black_carbon ; (:,:,:,:)

    ii = (/6,5,4,1,2,3/)
    nii = dimsizes(ii)

;Don't know how to put the above replaced layers in origional file for
variable black_carbon???

   k = 0
   do i=0,nii-1
      k = k+1
      a->black_carbon(:,k,:,:) = (/ arr(:,ii(i),:,:) /)
      print("k="+k+" ii(i)="+ii(i))
   end do

=============

On 12/20/11 3:31 AM, Rashed Mahmood wrote:
> Hi all
> I have a bit strange question. I want to shuffle the vertical layers of
> a variable as I wrote in the program attached herewith.
> However, I not getting how to put the replaced layers back to orgional
> the variable. BTW; several months ago Adam Philips on this forum helped
> me to do similar things but for spatial domains.
> Can anyone have a look on my simple program and help me in this regard.
> (Also attached ncdump for the concerned variable)
> Thanks alot!
> regards
> Rashed
> /Institute of Atmospheric Physics (IAP)/
> /Chinese Academy of Sciences (CAS)/
> /Beijing, China./
>
>
>
> _______________________________________________
> 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 Tue Dec 20 09:56:32 2011

This archive was generated by hypermail 2.1.8 : Wed Dec 21 2011 - 10:44:06 MST