# Re: [ferret_users] dynamic computation with variable depths

```Hi Sudheer -

```
Dynamic height only makes sense as an integral between the same two depths everywhere. You would not like the result if the script integrated over deep depths offshore and shallower depths near the coast: there would be huge and meaningless gradients reflecting the different depth ranges of the integral.
```
```
Typically what is done in such cases is to assume "no pressure gradient below the bottom". That is, assume that where a dynamic height surface intersects the bottom (say at the continental rise), it continues under the bottom as a flat surface. In a very simple situation (straight continental rise) you can do this by extrapolating the T and S under the bottom at each level. Then the dynamic height integral will be well-behaved, with zero currents along the bottom slope.
```
```
But if the rise of the bottom is curved, or if there is an island or seamount or ridge, then a simple extrapolation can lead to contradictions: extrapolating different values from different ocean locations will produce spurious gradients. This problem is far more complex and requires careful thought about the individual elements of the bottom topography. I have done it in fortran but don't think it can be done in Ferret.
```
Billy K

On 03/03/2009, at 1:38 AM, Sudheer Joseph wrote:

```
```Dear users,
```
I have the following script for computing the dynamic height, I wanted it to work dynamically, ie. when the computation is done near coast it need to reduce the z0 and integrate from the available depth else there will be big gaps near the coast, how to achieve it , I tried returning the value of z max to impose an if then condition but did not work. any solution?
```regards,
Sudheer
use levitus_climatology
set reg/z=1:1900
let dyn_S=salt
let dyn_T=temp
let dyn_P=z[gz=salinity]
go dynamic_height
fill dyn_ht
go fland

º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤º¤ø,¸¸,ø¤º
Sudheer Joseph
Scientist
Indian National Centre for Ocean Information Services (INCOIS)
Post Box No.21, IDA Jeedimetla P.O. Hyderabad,
Andhra Pradesh, India., Pin - 500 055
Tel : +91-40-23044600(R),  +91-40-23886047(O),
Fax: +91-40-23895011(O) ,
Mob :+91-40-9440832534,
E-mail:sjo@xxxxxxxxxxxxxx; sjo@xxxxxxxxxxxxx;sjo.India@xxxxxxxxx
º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤º¤ø,¸¸,ø¤º
"The ultimate measure of a man is not where he stands
in moments of comfort and convenience, but where he
stands at times of challenge and controversy."
Martin Luther King, Jr.
º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤º¤ø,¸¸,ø¤º

```
```

```