-
Notifications
You must be signed in to change notification settings - Fork 23
/
StabilityCorrection.c
executable file
·122 lines (92 loc) · 3.53 KB
/
StabilityCorrection.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/*
* SUMMARY: StabilityCorrection.c - Calculate the stability correction
* USAGE: Part of DHSVM
*
* AUTHOR: Bart Nijssen and Pascal Storck
* ORG: University of Washington, Department of Civil Engineering
* E-MAIL: nijssen@u.washington.edu, pstorck@u.washington.edu
* ORIG-DATE: Apr-1996
* DESCRIPTION: Calculate the stability correction for exchange of sensible
* heat between the surface and the atmosphere
* DESCRIP-END.
* FUNCTIONS: StabilityCorrection()
* COMMENTS:
* $Id: StabilityCorrection.c,v 1.4 2003/07/01 21:26:25 olivier Exp $
*/
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "settings.h"
#include "massenergy.h"
#include "constants.h"
/*****************************************************************************
Function name: StabilityCorrection()
Purpose : Calculate atmospheric stability correction for non-neutral
conditions
Required :
float Z - Reference height (m)
float d - Displacement height (m)
float TSurf - Surface temperature (C)
float Tair - Air temperature (C)
float Wind - Wind speed (m/s)
float Z0 - Roughness length (m)
Returns :
float Correction - Multiplier for aerodynamic resistance
Modifies : None
Comments :
*****************************************************************************/
float StabilityCorrection(float Z, float d, float TSurf, float Tair,
float Wind, float Z0)
{
float Correction; /* Correction to aerodynamic resistance */
float Ri; /* Richardson's Number */
float RiCr = 0.2; /* Critical Richardson's Number */
float RiLimit; /* Upper limit for Richardson's Number */
Correction = 1.0;
/* Calculate the effect of the atmospheric stability using a Richardson
Number approach */
if (TSurf != Tair) {
/* Non-neutral conditions */
Ri = G * (Tair - TSurf) * (Z - d) /
(((Tair + 273.15) + (TSurf + 273.15)) / 2.0 * Wind * Wind);
RiLimit = (Tair + 273.15) /
(((Tair + 273.15) + (TSurf + 273.15)) / 2.0 * (log((Z - d) / Z0) + 5));
if (Ri > RiLimit)
Ri = RiLimit;
if (Ri > 0.0)
Correction = (1 - Ri / RiCr) * (1 - Ri / RiCr);
else {
if (Ri < -0.5)
Ri = -0.5;
Correction = sqrt(1 - 16 * Ri);
}
}
return Correction;
/* double Eta; *//* intermediate product */
/* calculate the effect of atmospheric stability on aerodynamic resistance
using the method of Choudhury et al., Agric. For. Met., 37, 75-88,
1986 */
/* Eq. A4, Choudhury et al [1986] */
/* Eta = 5.0 * (Z - d) * G * (TSurf - Tair)/
((Tair + 273.15) * Wind*Wind);
if (TSurf < Tair) { */
/* stable conditions */
/* If Eta smaller or equal than -1, the correction increases again
because of the quadratic form of the equation. However, the
correction should monnotonically decrease for increasing
differences between the surface and air temperature. Therefore a
lower bound of -.8 is imposed on Eta (The lower bound of Eta is
not put at -1, because this would result in no sensible heat
exchange at all at the soil surface, which is unrealistic. A lower
bound of -.8 results in a correction of 25, i.e. an increase in the
resistance of 25 times) */
/* if (Eta < -0.8)
Eta = -0.8;
Correction = (1 + Eta)*(1 + Eta);
}
else */
/* unstable conditions */
/* Correction = pow((double) (1 + Eta), (double) 0.75);
} */
/* return Correction; */
}