[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[IDV #NVU-263991]: Error when calculating temperature tendency

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.


  • Subject: [IDV #NVU-263991]: Error when calculating temperature tendency
  • Date: Tue, 31 May 2022 14:27:44 -0600

> Hi,
> 
> I'm trying to calculate this:
> 
> def TEST_LHomega(t, V, omega, theta, theta1, theta2):
> T_over_theta = quo(t, theta)
> dtheta = sub(theta1, theta2)
> p1 = extractPressureFromNWPGrid(theta1)
> p2 = extractPressureFromNWPGrid(theta2)
> dp = sub(p1, p2)
> dthetadp = quo(dtheta,dp)
> 
> return mul(mul(T_over_theta, dthetadp),omega)
> 
> where: t=temperature (K), theta = potential temperature (K), V=true wind
> vector (m/s), omega=vertical pressure velocity (Pa/s).
> 
> The final units should be K/s but I'm getting K*m/(kg*s^2), it seems that
> the units from the omega field are not reported correctly. How can I fix it?
> 
> Thank you,
> 
> Paula
> 

If only the unit of omega field incorrected, you can use the newUnit(..) to set 
the
correct unit. Example: newUnit(grid, "topo", "m")

Yuan

Ticket Details
===================
Ticket ID: NVU-263991
Department: Support IDV
Priority: High
Status: Open
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.