Reading a vector of points all at once

From: Hahmann, Andrea N. <ahah_at_nyahnyahspammersnyahnyah>
Date: Thu Oct 20 2011 - 07:19:37 MDT

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
Received on Thu Oct 20 11:25:30 2011

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