Re: warning:Dimension (0) has not been defined

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Jul 23 2012 - 14:48:37 MDT

On Jul 23, 2012, at 11:02 AM, Laura Fowler wrote:

> Hi:
> I am not understanding why the function dim_avg_n_Wrap gives me the warning:
> warning:Dimension (0) has not been defined
>
> In my ncl script, I have:
> tempP_avgTime = dim_avg_n_Wrap(tempP,0)
>
> where tempP is defined as
>
> Variable: tempP
> Type: double
> Total Size: 365708736 bytes
> 45713592 values
> Number of Dimensions: 3
> Dimensions and sizes: [36] x [X | 31] x [dim0 | 40962]
> Coordinates:
> X: [1000..15]
> Number Of Attributes: 1
> _FillValue : 9.969209968386869e+36

Laura,

The dim_avg_n_Wrap function could be improved so it doesn't issue this warning,
but what's happening is that dimension 0, which is the leftmost dimension, doesn't
have a dimension name:

> Dimensions and sizes: [36] x [X | 31] x [dim0 | 40962]

Dimension #1 is called "X", and dimension #2 is called "dim0".

One of the purposes of using "dim_avg_n_Wrap" is explicitly to copy over dimension
names, attributes, and coordinate arrays, so you can get rid of the warning by
setting (before you call dim_avg_n_Wrap):

  tempP!0 = "time"

Furthermore, if the second dimension is levels, and the third dimension is the # of cells,
then you might want to use "better" names:

  tempP!1 = "lev" ; rather than "X"
  tempP!2 = "cells" ; rather than "dim0"

--Mary

>
> 36 is time, 31 is the number of levels and 40962 is the number of cells.
> tempP is an array on fixed pressure levels that was itself obtained with
> the function
> tempP(iFile,:,:) = transpose(int2p_n_Wrap(pres,temp,pFixed,linlog,1))
>
> Since I later plan to do longer time averages, I would like to
> understand this warning first.
> Thanks,
>
> Laura
>
> --
>
> !----------------------------------------------------
> Laura D. Fowler
> Mesoscale and Microscale Meteorology Division (MMM)
> National Center for Atmospheric Research
> P.O. Box 3000, Boulder CO 80307-3000
>
> e-mail: laura@ucar.edu
> phone : 303-497-1628
>
> !----------------------------------------------------
>
> _______________________________________________
> 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 Mon Jul 23 14:48:45 2012

This archive was generated by hypermail 2.1.8 : Tue Jul 24 2012 - 09:48:26 MDT