Re: Can get1Dindex find repeat values?

From: Bridget Thrasher <bthrasher_at_nyahnyahspammersnyahnyah>
Date: Mon Apr 19 2010 - 16:35:48 MDT

Nope. I already checked that. It definitely does not like repeat values:

ncl 0> arr1 = (/1,2,3,4,1,2,3,4/)
ncl 1> arr2 = (/1,2,3,4,5,6,7,8/)
ncl 2> arr3 = (/2,4/)
ncl 3>
ncl 4> load "$NCARG_ROOT/lib/ncarg/
nclscripts/csm/contributed.ncl"
ncl 5> ii1 = get1Dindex(arr1,arr3)
fatal:Dimension sizes on right hand side of assignment do not match
dimension sizes of left hand side
fatal:Execute: Error occurred at or near line 1083 in file
$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl
fatal:Execute: Error occurred at or near line 5

ncl 6> ii2 = get1Dindex(arr2,arr3)
ncl 7> print(ii2)

Variable: ii2
Type: integer
Total Size: 8 bytes

            2 values
Number of Dimensions: 1
Dimensions and sizes: [2]
Coordinates:
Number Of Attributes: 1
  _FillValue : -999
(0) 1
(1) 3

Is there another way to do it?

On Mon, Apr 19, 2010 at 3:17 PM, Dennis Shea <shea@ucar.edu> wrote:

> To me it looks like "ii" was previously defined. Try
>
> delete(ii)
>
> or, for debugging,
>
> if (isvar("ii")) the
> print("variable ii exists")
> delete(ii)
> else
> print("I have no idea why you would get that message")
> end if
>
>
>
>
> On 04/19/2010 03:48 PM, Bridget Thrasher wrote:
>
>> I am getting an error when using the get1Dindex function, and I'm not
>> sure why:
>>
>> These lines of code:
>>
>> printVarSummary(doy20cf)
>> printVarSummary(doybuff)
>> ii = get1Dindex(doy20cf,doybuff)
>>
>>
>> Give me this:
>>
>> Variable: doy20cf
>> Type: integer
>> Total Size: 14612 bytes
>> 3653 values
>> Number of Dimensions: 1
>> Dimensions and sizes: [3653]
>> Coordinates:
>>
>> Variable: doybuff
>> Type: integer
>> Total Size: 124 bytes
>> 31 values
>> Number of Dimensions: 1
>> Dimensions and sizes: [31]
>> Coordinates:
>>
>> fatal:Dimension sizes on right hand side of assignment do not match
>> dimension sizes of left hand side
>> fatal:Execute: Error occurred at or near line 1083 in file
>> $NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl
>> fatal:Execute: Error occurred at or near line 140 in file BCDaily.ncl
>>
>>
>> There are repeat values in doy20cf (0-364 repeated many times), so that
>> get1Dindex should find the 31 numbers of interest (doybuff)
>> approximately 10 times each. Could that be causing the problem?
>>
>> -Bridget
>>
>>
>> --
>> Bridget Thrasher, PhD
>> Postdoctoral Researcher
>> Climate Central
>> www.climatecentral.org <http://www.climatecentral.org>
>>
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>
>
> --
> ======================================================
> Dennis J. Shea tel: 303-497-1361 |
> P.O. Box 3000 fax: 303-497-1333 |
> Climate Analysis Section |
> Climate & Global Dynamics Div. |
> National Center for Atmospheric Research |
> Boulder, CO 80307 |
> USA email: shea 'at' ucar.edu |
> ======================================================
>

-- 
Bridget Thrasher, PhD
Postdoctoral Researcher
Climate Central
www.climatecentral.org

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Apr 19 16:36:11 2010

This archive was generated by hypermail 2.1.8 : Fri Apr 23 2010 - 14:40:07 MDT