do-loop / ind() ncl question

From: Edward Myers <Edward.Myers_at_nyahnyahspammersnyahnyah>
Date: Wed, 02 May 2007 09:39:53 -0400

Hi,

I have a three-dimensional array, temp(time, z_level, horizontal_node),
that stores ocean temperature as a function of time, vertical level and
the horizontal node of a triangular mesh. I would like to plot the
surface temperature, so I use the water level at each node to determine
which z-coordinate z_level to use (each node can have a different
z_level where the surface is located). Therefore, I have another array,
vsurf(horizontal_node) that tells which z_level that particular node's
water level falls within. Currently, I am doing the following to extract
the surface temperature:

  temp_surf=new(nnodes,"float")
  do jj=0,nnodes-1
    temp_surf(jj)=temp(nn,vsurf(jj),jj)
  end do

nnodes are the number of horizontal grid nodes, and nn is a time index
that is being looped on outside of this statement.

Rather than the do-loop I currently have, is there an easier way of
doing this operation? It seems like the ind() function could potentially
be used, but I wasn't sure... Any ideas would be greatly appreciated!

Thanks,
Ed Myers
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed May 02 2007 - 07:39:53 MDT

This archive was generated by hypermail 2.2.0 : Tue May 08 2007 - 09:54:33 MDT