/[MITgcm]/MITgcm_contrib/arnaud_matlab/moist_adiabat.m
ViewVC logotype

Contents of /MITgcm_contrib/arnaud_matlab/moist_adiabat.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Mon Aug 25 16:00:59 2003 UTC (20 years, 8 months ago) by edhill
Branch: MAIN
CVS Tags: HEAD
Initial checkin of Arnaud's MatLAB diagnostics

1 %
2 % function [TMA] = moist_adiabat(LCL,TLCL);
3 %
4 % Computes the temperature TMA(p) (in K) following
5 % a moist adiabat profile from the LCL where the
6 % temperature is TLCL (in K)
7 %
8
9
10 function [TMA] = moist_adiabat(LCL,TLCL);
11
12 % Constants
13 RGASdry = 287.04;
14 RGASvapor = 461.5;
15 PREF = 1000; %in mb
16 KM = 1000;
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 TMA = NaN * ones(1,NL);
26 TMA(LCL) = TLCL;
27 for l = LCL:NL-1;
28 %RGAS = RGASvapor * Q(l) + (1-Q(l))*RGASdry ;%if fancy!!
29 RGAS = RGASdry;
30 t = TMA(l) - 273.15;
31 GAMMAs1 = 6.4 - 0.12*t + (2.5*1.e-05)*t^3;
32 GAMMAs2 = (-2.4 + .001*(t-5)^2) * (1 - P(l)/PREF);
33 GAMMAs = (GAMMAs1+GAMMAs2) / KM;
34 DT = - RGAS * TMA(l) * GAMMAs * DP / (GRAVI * P(l));
35 TMA(l+1) = TMA(l) + DT;
36 end

  ViewVC Help
Powered by ViewVC 1.1.22