Re: dimension reduction trouble

From: Erik Noble <enoble_at_nyahnyahspammersnyahnyah>
Date: Tue, 05 Feb 2008 19:46:50 -0500

Hi. Thank you.
This seems to be working now.
I am not getting an error and my ParintVarSummaries are:

Variable: FNLv925 (subsection)
Type: float
Total Size: 60604 bytes
            15151 values
Number of Dimensions: 2
Dimensions and sizes: [south_north_stag | 109] x [west_east | 139]
Coordinates:
Number Of Attributes: 6
  _FillValue : -999
  FieldType : 104
  MemoryOrder : XYZ
  units : m s-1
  description : V
  stagger : V

Variable: VV (file variable subsection)
Type: float
Total Size: 61160 bytes
            15290 values
Number of Dimensions: 2
Dimensions and sizes: [south_north_stag | 110] x [west_east | 139]
Coordinates:
Number Of Attributes: 5
  FieldType : 104
  MemoryOrder : XYZ
  units : m s-1
  description : V
  stagger : V

I am now receiving a different error, but this should be for another post.
-Erik

On 2/5/08 7:14 PM, "Mary Haley" <haley_at_ucar.edu> wrote:

>
> Erik,
>
> In order to set one subset of a variable equal to a subset of a
> another variable, the subsetted variables have to be exactly the same
> size (the same dimensionality).
>
> I'm guessing that if you do a printVarSummary on these two subsets,
> they will be different:
>
> printVarSummary(FNLv925(ifil,:,:))
> printVarSummary(b->VV(0,4,:,:))
>
>
> For example, if you have a 3D array (x) that is 4 x 2 x 3, and another
> 4D array (y) that is dimensioned 2 x 3 x 2 x 3, then you can do this:
>
> x(0,:,:) = y(0,0,:,:)
> or
> x(1,:,:) = y(0,2,:,:)
>
> etc.
>
> However, you could not do something like this:
>
> x(:,0,:) = y(0,0,:,:)
>
> because "x(:,0,:)" is dimensioned 4 x 3, and y(0,0,:,:) is dimensioned
> 2 x 3.
>
> Please check the two subsets that you are trying to set equal to each
> other, and make sure they are indeed the same dimensionality.
>
> --Mary
>
>
>
> On Tue, 5 Feb 2008, Erik Noble wrote:
>
>> Hello.
>>
>>
>> I am getting an error because I am trying to read a 4d variable into a
>> pre-assigned 3D array.
>>
>> do ifil = 0, (numFILES-1)/4 ; BIG FILES LOOP ; NEW file loop
>> b = addfile(FILES(ifil*4+2)+".nc","r")
>> FNLv925(ifil,:,:) = b->VV(0,4,:,:)
>>
>> In following the NCL basic tutorial, I see that reading-in a 4D
>> variable in such a way "should" reduce its dimensions, right?
>>
>> What function will "squeeze" the 4D variable? Also, where is this
>> covered in the introduction to NCL, so that I can review it?
>>
>> Sincerely,
>> Erik
>>
>> Here is my error:
>>
>> Erik_at_noble:/Volumes/Data_and_Models/ncl_scripts:ncl test_script2.ncl
>> Copyright (C) 1995-2007 - All Rights Reserved
>> University Corporation for Atmospheric Research
>> NCAR Command Language Version 5.0.0
>> The use of this software is governed by a License Agreement.
>> See http://www.ncl.ucar.edu/ for more details.
>>
>> export: Command not found.
>> export: Command not found.
>> export: Command not found.
>> export: Command not found.
>> export: Command not found.
>> export: Command not found.
>> export: Command not found.
>> export: Command not found.
>> export: Command not found.
>> export: Command not found.
>> export: Command not found.
>> export: Command not found.
>> export: Command not found.
>> export: Command not found.
>> export: Command not found.
>> export: Command not found.
>> Bad : modifier in $ ($).
>> fatal:Dimension size mismatch on subscript #1, left-hand and
>> right-hand side dimensions do not match
>> fatal:Execute: Error occurred at or near line 66 in file test_script2.ncl
>>
>> Erik_at_noble:/Volumes/Data_and_Models/ncl_scripts:
>>
>> My Code is attached.
>>
>
Received on Tue Feb 05 2008 - 17:46:50 MST

This archive was generated by hypermail 2.2.0 : Tue Feb 05 2008 - 21:51:45 MST