Re: arranging missing values in array

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Tue, 05 Jun 2007 10:51:23 -0600

Hi Deniz,

The following works for your simplified example. Hopefully you can use
it as a good starting point for your problem:

begin
    f = (/(/1,0.15/),(/2,1.5/),(/3,0.8/),(/6,2.4/),(/9,2.0/),(/10,1.8/)/)
    dimt = dimsizes(f)
        
    if (dimt(0).ne.10) then
       f2 = new((/10,2/),typeof(f),-999.)
       f2(:,0) = ispan(1,10,1)
       do gg = 0,dimt(0)-1
         f2(floattointeger(f(gg,0))-1,:) = (/ f(gg,:) /)
       end do
       print(f2)
    end if
end

Good luck,
Adam

deni boz wrote:
> Hi all,
>
> I want to arrange an array containing missing values ,in fact, that are
> not shown in array itself.
>
> For instance, I want to have an array consisting of test results from 1
> to 10 that also shows missing values of any test result. However, the
> form of array is like that
>
> f = (/(/1,0.15/),(/2,1.5/),(/3,0.8/),(/6,2.4/),(/9,2.0/),(/10,1.8/)/)
>
> where results of fourth, fifth, seventh, and eighth are not included in
> the array. I want to assign these values as missing values in the array.
>
> How can I do this?
>
> Any comment will be appreciated. Thanks a lot!
>
> Deniz
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli_at_ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jun 05 2007 - 10:51:23 MDT

This archive was generated by hypermail 2.2.0 : Tue Jun 05 2007 - 16:18:21 MDT