# Re: On the the derivation with NCL

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Sat, 21 Jul 2007 06:48:28 -0600 (MDT)

> I am trying to compute something like the following with NCL
>
> dq/dt + V.grad(q) + omega.dq/dp
>
> Where
>
> "d/dt" and "d/dp" are partial derivative
> "omega" is the vertical velocity
> "V" is the horizontal wind
> "q" is the quantity to derive
> "grad(q)" is the horizontal gradient of q
>
> There is a way to do it quickly with NCL?
> ---------------------------------

I'm not sure what you mean by "quickly".
Is there a ready made function for the equation of continuity ... no.

What type of grid is it? global [ regular or gaussian]
regional?

q(time,lev,lat,lon), omega(time,lev,lat,lon)
u(time,lev,lat,lon), v(time,lev,lat,lon)
p(lev)
time(time)

dqdt = center_finite_diff(q(lev|:,lat|:,lon|:,time|:),t,False,0)
dqdp = center_finite_diff(q(time|:,lat|:,lon|:,lev|:),p,False,0)

global gaussiam grid:
q_grad_lon = q ; create arrays to hold output, same size and type as input
; this procedure will overwrite

====