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):

  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

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…


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
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
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