source: trunk/MESOSCALE/LMD_MM_MARS/SIMU/RUN/vert_level/levspe.pro

Last change on this file was 613, checked in by aslmd, 13 years ago

UTIL PYTHON: an example script for pp.py (whole ExoMars? report). minor corrections. MESOSCALE : dust storm def files

File size: 2.1 KB
Line 
1pro levspe
2
3
4;
5; TWEAK PARAM
6;
7@param.idl
8
9
10;
11; HARD PARAM
12;
13!p.multi=[0,2,2]
14;!p.multi=[0,1,4]
15
16!p.charthick = 2.0
17!p.thick = 5.0
18!x.thick = 2.0
19!y.thick = 2.0
20
21
22
23set_plot, 'ps'
24device, file='plot.ps' ;, /landscape
25
26tinv=10     ;; intervalle plot
27hache=10.   ;; scale height
28psurf=610.  ;; pression surface -- ne change pas les eta levels
29
30;
31; PRELIM
32;
33param = 'e_vert='+string(nlev,'(I0)')+' ztop='+string(altmax,'(I0)')+' e='+string(epsilon,'(I0)')+' c='+string(elong_cos,'(F4.2)')
34;
35epsilon = epsilon / (nlev-1) / 100.
36;
37exposant = !pi/nlev/elong_cos
38;
39; alpha (plus grand ecart en km) est determine pour que max(altitudes)=altmax
40;
41alpha =  altmax / ( (nlev-1)/2. - sin(2.*exposant*(nlev-1))/4./exposant + epsilon*(nlev-1)^2/2. )
42print, 'alpha (km)', alpha
43;
44x=[findgen(nlev)]
45
46
47;
48; CALC
49;
50ecart = alpha - alpha*cos(exposant*x)^2 + epsilon*alpha*x
51altitudes = alpha*x/2. - alpha*sin(2.*exposant*x)/4./exposant + epsilon*alpha*x^2/2.
52logpressions = alog(psurf) - altitudes/hache
53pressions=exp(logpressions)
54ptop=psurf*exp(-altmax/hache) & print, ptop 
55etas=(pressions-ptop)/(psurf-ptop)
56etas(nlev-1)=0.
57
58
59;
60; PRINT
61;
62print, 'eta levels'
63print, etas
64;
65print, 'pressure'
66pi=etas*(psurf-ptop)+ptop
67print, pi
68print, 'ptop', ptop
69;
70print, 'pseudo-altitude'
71pseudo=10.*alog(610./pi)
72print, 1000.*10.*alog(610./pi)
73
74
75;
76; PLOT
77;
78;plot, x, etas, title='ETA '+param, xtickinterval=tinv
79plot, x, etas, title='ETA LEVELS', xtickinterval=tinv, psym=3
80;!psym=3 & oplot, x, etas
81;!psym=0
82plot, x, pseudo, title='ALTITUDE (km)', xtickinterval=tinv, psym=3
83;!psym=3 & oplot, x, pseudo
84;!psym=0
85plot, x, pi, title='PRESSURE (Pa)', ylog=1, xtickinterval=tinv, psym=3
86;!psym=3 & oplot, x, pi
87;!psym=0
88;
89diff=pseudo - shift(pseudo,-1) & diff=-diff(0:nlev-2)
90;
91;plot, x, ecart, title='ECART (km, L=theor x=calc)', xtickinterval=tinv
92;plot, x, ecart, title='d ALTITUDE (km)', xtickinterval=tinv, psym=1
93plot, x, diff, title='d ALTITUDE (km)', xtickinterval=tinv, psym=3
94;!psym=3 & oplot, x, diff
95;!psym=0
96
97
98;
99; PRINT
100;
101openw, 1, 'levels'
102for i=0, nlev-1 do begin
103        printf, 1, etas(i);,','
104endfor
105close, 1
106
107end
Note: See TracBrowser for help on using the repository browser.