# Re: repeat loop over depth axis

```Hello Shankar,
I am not quite sure what goes wrong when you try the repeat
command over depth.  It always helps if you can quote the
Ferret commands that are  not working as you would expect.
So, I hope I am not missing the point of your question.

You can do a repeat on a depth axis.  This should work:

cancel mode verify

If I understand what is in your cdf file, the depthedges are
the cell edges of the variable DEPTH.  If this is also true
for the variables that you are integrating, then since @DIN
uses the sizes of the grid boxes in creating the sum, you don't
need to do anything special to take DEPTHEDGES into account.

The transformation @NGD would allow you to see the lowest
value of a variable, e.g.

use levitus_climatology
set region/y=0/x=150:180
set view lower;  plot  salt[z=@ngd]

Hope this helps; if your question is different than what I've talked

Ansley Manke

Shankar Doraiswamy wrote:

> Hello,
>
> How do I get the repeat command to loop over the depth axis (as, say,
> in a FORTRAN do loop)?
>
> I am using the SODA data, which give U and V as functions of (x,y,z,t)
> and sea level (eta) as a function of (x,y,t).  I want to define the
> vertical velocity w as a function of (x,y,z,t) for some calculations.
>
> To do this, I computed w at the surface (using eta, U, and V), but am
> not able to use the repeat loop over depth (k index) to integrate
> (using @din) the horizontal divergence field.  Since I need w at
> several depths, I do not want to freeze the lower limit of the
> integral.
>
> A related question concerning the computation of w ...
>
> The SODA data also include a depth attribute called depthedges.  The
> last value of this atribute charts the bottom topography.  Is it
> possible to use this attribute in ferret?  I need it to compute the w
> field. (As before, I also need to be able to "repeat" over depth to
> compute the integral using @din.)
>
> From the SODA netCDF file ...
>
> dimensions:
>
>         DEPTH = 20 ;
>         DEPTHedges = 21 ;
>
> variables:
>
>         double DEPTH(DEPTH) ;
>                 DEPTH:units = "meters" ;
>                 DEPTH:positive = "down" ;
>                 DEPTH:point_spacing = "uneven" ;
>                 DEPTH:edges = "DEPTHedges" ;
>
>         double DEPTHedges(DEPTHedges) ;
>                 DEPTHedges:edges = " " ;
>
> data:
>
>  DEPTH = 7.5, 22.5, 37.5, 52.5, 67.5, 82.5, 97.5, 112.5, 127.5, 142.5,
> 157.5, 190.61, 276.27, 443.79, 714.46, 1099.46, 1598.79, 2201.3, 2885.6,
> 3622.5 ;
>
>  DEPTHedges = 0, 15, 30, 45, 60, 75, 90, 105, 120, 135, 150, 174.055,
> 233.44, 360.03, 579.125, 906.96, 1349.125, 1900.045, 2543.45, 3254.05,
> 3990.95 ;
>
> Regards, Shankar.
>
> D. Shankar                           Ph. (O): [91](832) 22 6253 * 4312/4400
> Physical Oceanography Division,                         22 1322 * 4312/4400
> National Institute of Oceanography,      (R): [91](832) 23 8208
> Dona Paula,                          Fax    : [91](832) 22 3340/9102
> Goa 403 004,                         email  : shankar@darya.nio.org
> India.                                        shankar@csnio.ren.nic.in

--
Ansley Manke  Pacific Marine Environmental Laboratory  Seattle WA  (206)526-6246

```