This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
David, The quo(ldf(thta),ldf(pres)) would be giving d(thta) of layer / d(pres) of layer That would be d(thta)/dp. The ldf(pres) would be a constant for the calculation of 100mb given your 2 levels +/-50mb. The two mul() terms would be d/dx (omega_bar) and d/dx (thta_bar). The assumption there is that using LAV() where the 2 levels are +50 and -50 are providing a layer average, rather than just using the quantity at the level, eg using lav(thta@100:200) instead of thta@150. Since the dp is a layer, using the horizontal gradient in the layer instead of at the midpoint level is probably for consistency. Steve Chiswell On Mon, 2004-10-25 at 15:24, David Ovens wrote: > On Mon, Oct 25, 2004 at 03:19:56PM -0600, Steve Chiswell wrote: > > David, > > > > LDF(s) will give you the layer difference where > > you specify GLEVEL=level1:level2, and as > > appropriate GVCORD=pres. This is the > > equivalent of SUB(s1@level1,s2@level2). > > If your vertical layer "delta-p" is reasonably small, > > then you would be approaching D()/DP. > > > > Steve Chiswell > > Steve, > > Can you take a look at this PERL code snippet and see if you agree > with it? What I don't understand is the decision to use LAV() on > OMEG and THTA; otherwise, it looks like it is giving an approximate > D()/DP as you suggest, right? > > for( $level = 150; $level <= 950; $level += 50 ) { > $level1=$level-50; > $level2=$level+50; > > open TMP, ">/tmp/addfields$$"; > print TMP <<END; > gdfile = 9303${time}_eta.gem > gdout = 9303${time}_eta.add.gem > gdattim = $fhr > glevel = $level1:$level2 > gvcord = pres > gfunc = mul(mul(quo(ldf(thta),ldf(pres)),ddx(lav(omeg))),ddx(lav(thta))) > grdnam = tiltt1\@$level > r > > gfunc = mul(mul(quo(ldf(thta),ldf(pres)),ddy(lav(omeg))),ddy(lav(thta))) > grdnam = tiltt2\@$level > r > > END > > close TMP; > system "gddiag </tmp/addfields$$"; > > David