Re: Vector subscripting on a file variable

From: Dave Allured <dave.allured_at_nyahnyahspammersnyahnyah>
Date: Tue, 04 Mar 2008 11:08:53 -0700

Dave,

Thanks, this just what I was hoping for.

--Dave

David Brown wrote:
> Hi Dave,
>
> I think the warning against named subscripting has to do with the fact
> that it is usually used to reorder the dimensions of a variable.
> Reordering the
> dimensions of a variable as it is being read from a file can be very
> slow because it can result in huge numbers of small reads scattered
> throughout the file.
>
> Your situation is quite different because you are using vector
> subscripting on the 'slow' dimension. A complete lat /lon slice can most
> likely be read from
> contiguous elements in the file. I'm guessing the performance will be
> nearly the same as if you were reading a fully contiguous chunk using
> regular subscripting.
> If you instead used vector subscripting on the lon dimension, an impact
> on performance would be more likely.
> -dave
>
> On Mar 3, 2008, at 5:43 PM, Dave Allured wrote:
>
>> I would like to read selected records from a file variable. I would
>> like to use vector subscripting to read selected records and ignore
>> other records. Something like:
>>
>> f = addfile ("infile.nc", "r")
>> record_nums = (/ 9, 10, 11, 21, 22, 23 /)
>>
>> data = f->precip(record_nums, :, :) ; time, lat, lon
>>
>> My question is whether using vector subscripting on a large file
>> variable is reasonably efficient. NCL documentation warns against
>> using named subscripting on a file variable, and this seems related.
>>
>> My index array "record_nums" is guaranteed to be monotonic and
>> increasing. Also in this case, the first subscript is the actual
>> Netcdf record dimension. Thank you for any advice.
>>
>> Dave Allured
>> CU/CIRES Climate Diagnostics Center (CDC)
>> http://cires.colorado.edu/science/centers/cdc/
>> NOAA/ESRL/PSD, Climate Analysis Branch (CAB)
>> http://www.cdc.noaa.gov/
>> _______________________________________________
>> 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

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Mar 04 2008 - 11:08:53 MST

This archive was generated by hypermail 2.2.0 : Wed Mar 05 2008 - 00:45:46 MST