source: trunk/MESOSCALE_DEV/PLOT/RESERVE/slope.inc @ 207

Last change on this file since 207 was 85, checked in by aslmd, 14 years ago

LMD_MM_MARS et LMD_LES_MARS: ajout des routines IDL pour tracer les sorties --> voir mesoscale/PLOT

File size: 2.3 KB
Line 
1;
2; horizontal coordinates (meters)
3;
4rad=3397000.
5deg_m=2*rad*!pi/360.
6dlon=deg_m*cos(lat*!pi/180)
7dlat=deg_m
8x=(lon-min(lon))*dlon
9y=(lat-min(lat))*dlat
10;print, x/1000.
11;print, y/1000.
12
13;;----------------------------
14;; methode directe
15;;----------------------------
16;; var is a 2D field
17;; must be HGT_M
18grad, hx, var*1000., x, y, 1
19grad, hy, var*1000., x, y, 2
20;hx=hx*100. ;pente en %
21
22;;-------------------------------
23;; methode "confiance en geogrid"
24;;-------------------------------
25        ;varid=ncdf_varid(cdfid,'MAPFAC_M')
26        ;       ncdf_varget, cdfid, varid, msf
27
28
29varid=ncdf_varid(cdfid,'SLPX')
30        ncdf_varget, cdfid, varid, hxwrf
31varid=ncdf_varid(cdfid,'SLPY')
32        ncdf_varget, cdfid, varid, hywrf
33
34;print, 100.*mean(abs(hx-hxwrf*1000.)/hx)
35;print, 100.*mean(abs(hy-hywrf*1000.)/hy)
36
37hx=hxwrf*1000.
38hy=hywrf*1000.
39
40
41
42;; SLOPE ANGLE vs HORIZONTAL
43;;---------------------------   
44theta=atan(sqrt(hx^2+hy^2))
45theta=180.*theta/!pi
46var=round(theta)
47title='Slope angle (deg)'
48format='(I0)'
49pal=16
50
51;goto, squeeze
52;; SLOPE ORIENTATION
53;;--------------------
54;; cas où hx < 0
55        psi=-!pi/2 - atan(hy/hx)
56;; cas où hx > 0
57        w=where(hx ge 0)
58        psi[w]=psi[w]-!pi
59;; SOUTH 0 & WEST 90
60        psi=2*!pi+psi
61        psi=180.*psi/!pi
62;; NORTH 0 & EAST 90 (as MONTECARLO & PARAM)
63psi=(180.+psi) MOD 360
64
65var=round(psi)
66title='Slope orientation (deg)'
67format='(I0)'
68pal=6
69;;
70squeeze:
71
72
73;
74; latitude
75;
76varid=ncdf_varid(cdfid,'XLAT_M')
77        ncdf_varget, cdfid, varid, latyeah
78
79
80;
81; SCATTERED FLUX RATIO
82;
83
84nx=n_elements(latyeah(*,0))
85ny=n_elements(latyeah(0,*))
86
87ratio_s=dblarr(nx,ny)
88ratio_d=dblarr(nx,ny)
89
90count=0
91
92for i=0,nx-1 do begin
93for j=0,ny-1 do begin
94
95        param_slope, $
96                ls=set_ls, $            ; < input *
97                lct=set_lct, $          ; < input *
98                lat=latyeah(i,j), $     ; < input *
99                tau=set_tau, $          ; < input *
100                spz=theta(i,j), $       ; < input *
101                spa=psi(i,j), $         ; < input *
102                r_s=tmps, $     ; > output
103                r_d=tmpd        ; > output
104
105        ;count=count+1
106        ;print, count, tmps, tmpd
107
108        ratio_s(i,j)=tmps
109        ratio_d(i,j)=tmpd
110
111endfor
112endfor
113
114pal=0   
115format='(I0)'
116var=ratio_s*100. & title='Ratio S/S0 (%)'
117
118;var=ratio_d*100. & title='Ratio Fdir/Fdir0 (%)'
119
120title='Ls='+string(set_ls,'(I0)')+' LT='+string(set_lct,'(I0)')+' tau='+string(set_tau,'(F3.1)')
121minfield_init=30.
122maxfield_init=170.
123
124var=round(var)
Note: See TracBrowser for help on using the repository browser.