Re: Reading a vector of points all at once

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu Oct 20 2011 - 11:31:31 MDT

I think the following will work:

   inear = (/5,87,20,15/)
   jnear = (/10,44,73,20/)
   u = ff->U(inear,jnear)
   printVarSummary(u)

On 10/20/11 7:19 AM, Hahmann, Andrea N. wrote:
> Good morning
>
> I have a not so small list of grid points I would like to read from a NetCDF file. Here is an example (ff is an open file):
>
> begin
> inear = (/5,87,20,15/)
> jnear = (/10,44,73,20/)
>
> u = new(dimsizes(inear),"float")
> do k=0,dimsizes(inear)-1
> u(k) = ff->U(inear(k),jnear(k))
> end do
> end
>
> Can this be rewritten without using the loop over the grid point? A similar loop seems to be slowing my script down and I have a lot of files to read…
>
> Thanks,
> Andrea
>
> ----
> Andrea N. Hahmann
> Senior Scientist
> Wind Energy Division
> Risø DTU
>
> Technical University of Denmark
> Risø National Laboratory for Sustainable Energy
> Frederikborgvej 399, P.O. Box 49
> 4000 Roskilde, Denmark
>
> Direct +45 4677 5471
> Mobil: +45 2133 0550
> ahah@risoe.dtu.dk
> http://www.risoe.dtu.dk
> _______________________________________________
> 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 Thu Oct 20 11:31:38 2011

This archive was generated by hypermail 2.1.8 : Mon Oct 24 2011 - 09:29:35 MDT