Parent Directory | Revision Log | Revision Graph
Initial checkin of Arnaud's MatLAB diagnostics
1 | % |
2 | % function [TDA] = dry_adiabat(TS); |
3 | % |
4 | % Computes the temperature TDA(p) (in K) following |
5 | % a dry adiabat profile, for a given 1st |
6 | % layer temperature TS (in K) |
7 | % |
8 | |
9 | |
10 | function [TDA] = dry_adiabat(TS); |
11 | |
12 | % Constants |
13 | RGASdry = 287.04; |
14 | RGASvapor = 461.5; |
15 | PREF = 1000; %in mb |
16 | CPdry = 1005; |
17 | GRAVI = 9.81; |
18 | |
19 | % Pressure grid |
20 | P = [987.5:-25:0]; %in mb |
21 | DP = 25; %in mb |
22 | NL = 40; |
23 | |
24 | % Pressure integral |
25 | TDA = NaN * ones(1,NL); |
26 | TDA(1) = TS; |
27 | for l = 1:NL-1; |
28 | %RGAS = RGASvapor * Q(l) + (1-Q(l))*RGASdry ;%if fancy!! |
29 | RGAS = RGASdry; |
30 | t = TDA(l) - 273.15; |
31 | GAMMAs = GRAVI / CPdry; |
32 | DT = - RGAS * TDA(l) * GAMMAs * DP / (GRAVI * P(l)); |
33 | TDA(l+1) = TDA(l) + DT; |
34 | end |
35 | |
36 | |
37 | |
38 | |
39 | |
40 |
ViewVC Help | |
Powered by ViewVC 1.1.22 |