Re: Change data size of one dimension

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu Feb 28 2013 - 08:52:08 MST

The following is confusing to me:
    "I need to change these 6 values into 20 values
     (no relationship between values)"
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The following is untested

    x(d0,d1,d2,d3,d4,d5,d6,d7)

where, say, d2 is size 6

   undef("make_big")
   function make_big(x, d2big)
   local dimx, rankx, xnew
   begin
    dimx = dimsizes(x)
    rankx= dimsizes(dimx)
    if (rankx.ne.8) then
        print("make_big: rankx="+rankx+": expecting rank=8")
        exit
    end if

    xnew = new ( (/dimx(0),dimx(1), d2big, dim(3) \
                  ,dimx(4),dimx(5),dimx(6),dimx(7)/) \
                  ,typeof(x), getFillValue(x))
    xnew(:,:,0:dimx(2)-1,:,:,:,:,:) = (/ x /)
    return(xnew)
   end

On 2/28/13 8:33 AM, Jiang, Lifen wrote:
> Hello NCL:
>
> My NetCDF file has 8 dimensions. One dimension is thickness of soil layers. It has 6 values (m):
> 0.022, 0.058, 0.154, 0.409, 1.085, 2.872.
>
> Now I need to change these 6 values into 20 values (no relationship between values) but want to leave all other 7 dimensions as they are.
>
> How can I do that very efficiently? (May do it very often later)
>
> Does anyone have the idea? I really appreciate any help!
>
> Lifen
>
>
>
>
>
>
> 2013-02-28
>
>
>
> Jiang, Lifen
>
>
>
> _______________________________________________
> 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 Feb 28 08:52:12 2013

This archive was generated by hypermail 2.1.8 : Thu Feb 28 2013 - 14:47:31 MST