Re: Array dimension reduction

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue, 11 Dec 2007 13:33:23 -0700 (MST)

On Tue, 11 Dec 2007 jimmyc_at_iastate.edu wrote:

> All-
> I am running the wrf regional climate model and I am trying to create monthly
> average wind speed and wind vectors at 850 hPa.
>
> I am using the wrf_PressureLevel1.ncl script with some modifications. I am
> trying to do this:
> savg = dim_avg(sped(level,:,:,:)) ; this works
> ss = savg(0,:,:) ; this does not work error=number of subscripts do not
> match
>
> ss is a 2d variable and savg is a 3d variable. The Array Dimension Reduction
> page says that is you specify the first element, then the array size reduces
> by 1. What is the simplest way to take a 3d array and make it 2d (for the
> rightmost 2 dimensions)?

Hi James,

If ss is indeed a 2D array, then setting it equal to savg(0,:,:)
should work (if you had done savg(0:0,:,:) this wouldn't work because
this is a 3D array with "1" as the leftmost dimension).

Can you email me the following:

    printVarSummary(savg)
    printVarSummary(ss)

This might give some more clues as to what's going on. It's also
possible the error message is referring to a different line number.

--Mary

> --
> James Correia, Jr. PhD.
> Email: jimmyc @ iastate.edu
> Email: jimmyc42 @ gmail.com
> Web: http://bruce.agron.iastate.edu/jimmyc/
> *********************************************
>
> "Wisdom. Strength. Courage. Generosity. Each of us are born with one of
> these. We must find the other three inside of us."
> from "Into the West"
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Dec 11 2007 - 13:33:23 MST

This archive was generated by hypermail 2.2.0 : Tue Dec 11 2007 - 14:19:22 MST