Re: Inverting file array order

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon, 30 Jul 2007 09:09:48 -0600

Rosa Maria Nascimento dos Santos wrote:
> Hi,
>
> Does anybody knows how can I invert an array order in a .nc file? Let's
> say I have 1 or more variables that are varying in the vertical
> according to the pressure level such as:
>
> VAR LEVEL
> (0) T 50
> (1) T 950
> (10) T 1000
>
> ... and I want to invert the order of this variable and level in the file,
> such as:
>
> VAR LEVEL
> (0) T 1000
> (1) T 950
> (10) T 50
>
> How can I do that? I Thought first doing a loop to make this, but it
> didn't work well: it changed the level but not the var related to it!
>
> Thanks,
>
> Rosa
>
>
See Subscripting:

http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/

====

If you have an array z(time,lev,lat,lon)

To reverse the order and replace the variable

    z = z(:,::-1,:,:)

To create a new variable

    x = z(:,::-1,:,:)

Good luck
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jul 30 2007 - 09:09:48 MDT

This archive was generated by hypermail 2.2.0 : Wed Aug 01 2007 - 08:50:33 MDT