Ulrike,<br><br>The function cdiff works as a horizontal plane differental, not vertical, for qhich it needs equal space grid points. Also when you use it probably you should need to convert the x and y direction into spherical differential arcs as:<br>
<br>'define dy = cdiff(lat*1000.0,y) * 3.1416/180'<br>'define dx = cdiff(lon*1000.0,x) * 3.1416/180'<br>'define dvx = cdiff(vinterp,x)'<br>
'define duy = cdiff(uinterp,y)'<br>'define zeta = ((dvx / (cos(lat*3.1416/180) * dx)) -<br>(duay / dy))/(6.37e6)'<br>'define zeta = (dvx/dx-duy/dy)'<br>
<br>for instance.<br><br><br><br><br><div class="gmail_quote">2008/6/23 Ulrike Wissmeier <<a href="mailto:ulrike@meteo.physik.uni-muenchen.de">ulrike@meteo.physik.uni-muenchen.de</a>>:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Dear all,<br>
in order to compute/plot the vertical gradient of vertical vorticity zeta, I<br>
couldn't use the cdiff-function, as there seem to be problems with<br>
cdiff(Expr,z). In the past (see archive) it was suggested to use "define<br>
dExpr=Expr(z+1)-Expr(z-1)" instead of cdiff, however, that does not work for<br>
my calculated vertical vorticity zeta either:<br>
<br>
grads-script:<br>
'set lon 0 60'<br>
'set lat 0 60'<br>
'set z 0 30''<br>
<br>
'define dx = cdiff(lon*1000.0,x)'<br>
'define dy = cdiff(lat*1000.0,y)'<br>
'define dvx = cdiff(vinterp,x)'<br>
'define duy = cdiff(uinterp,y)'<br>
'define zeta = (dvx/dx-duy/dy)'<br>
<br>
'set z 1 29'<br>
<br>
'define dzetaz = zeta(z+1)-zeta(z-1)'<br>
'define dzhz = zh(z+1)-zh(z-1)'<br>
<br>
'set lon 'lon''<br>
'display dzetaz/dzhz'<br>
<br>
(where zh is the position of the vertical grid points z=1,2,3,...)<br>
<br>
This gives the following error message:<br>
Syntax Error: Invalid Operand<br>
'dzetaz' not a variable or function name<br>
Error ocurred at column 1<br>
DISPLAY error: Invalid expression<br>
Expression = dzetaz/dzhz<br>
<br>
I would be very glad if anyone can help,<br>
thanks in advance,<br>
<font color="#888888">Ulrike<br>
</font></blockquote></div><br>