Commit 6d5a9fe
committed
Clarify rh_from_tdew variable naming, comments and references
In rh_from_tdew the intermediate named `e` was computed from the air
temperature (so it was actually the saturation vapor pressure) and `es`
from the dew point (the actual vapor pressure) -- swapped relative to the
usual convention, which led #2734 to read it as an inverted formula. The
returned values are correct and unchanged (100 * es/e with the swapped
names equals 100 * e/es with conventional ones); this computes `e` from
the dew point and `es` from the air temperature so the source matches the
convention, and fixes the matching derivation comment in tdew_from_rh.
Also adds a Notes section and the Alduchov & Eskridge (1996) reference for
the Magnus form, plus a physical-bounds regression test (saturation when
dew point == air temperature, RH below 100% and monotonic in the dew point
otherwise) so the direction cannot silently invert.
Addresses #2734.1 parent a53e022 commit 6d5a9fe
3 files changed
Lines changed: 44 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
| |||
67 | 72 | | |
68 | 73 | | |
69 | 74 | | |
| 75 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
366 | 376 | | |
367 | 377 | | |
368 | 378 | | |
369 | 379 | | |
370 | 380 | | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
371 | 384 | | |
372 | 385 | | |
373 | | - | |
374 | | - | |
375 | | - | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
376 | 391 | | |
377 | | - | |
378 | | - | |
| 392 | + | |
| 393 | + | |
379 | 394 | | |
380 | 395 | | |
381 | 396 | | |
| |||
406 | 421 | | |
407 | 422 | | |
408 | 423 | | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
414 | 428 | | |
415 | 429 | | |
416 | | - | |
| 430 | + | |
417 | 431 | | |
418 | | - | |
419 | | - | |
420 | 432 | | |
421 | 433 | | |
422 | 434 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
178 | 191 | | |
179 | 192 | | |
180 | 193 | | |
| |||
0 commit comments