1 | pro out_geo, $ |
---|
2 | field1=charvar, $ |
---|
3 | field2=charvar2, $ |
---|
4 | domain=domain, $ |
---|
5 | path=path |
---|
6 | |
---|
7 | ;---------------------------------------------------------------; |
---|
8 | ; ; |
---|
9 | ; Use: ; |
---|
10 | ; out_geo, 'HGT_M' (or) out_geo, 'TOPO' ; |
---|
11 | ; out_geo, 'THERMAL_INERTIA' (or) out_geo, 'TI' ; |
---|
12 | ; out_geo, 'ALBEDO_GCM' (or) out_geo, 'ALBEDO' ; |
---|
13 | ; out_geo, 'GHT' ; |
---|
14 | ; ; |
---|
15 | ; -- nested domain ; |
---|
16 | ; out_geo, 'HGT_M', domain='d02' ; |
---|
17 | ; ; |
---|
18 | ; Options: ; |
---|
19 | ; - domain: default is 'd01', ; |
---|
20 | ; but can be 'd02', 'd03', etc ... ; |
---|
21 | ; - path: where the geo_em files are ; |
---|
22 | ; '/my_root/my_folder/' ; |
---|
23 | ; ; |
---|
24 | ; A. Spiga, April 2007 - July 2007 - September 2007 ; |
---|
25 | ; ; |
---|
26 | ;---------------------------------------------------------------; |
---|
27 | |
---|
28 | |
---|
29 | |
---|
30 | |
---|
31 | ;---------------------- |
---|
32 | ; set parameters |
---|
33 | ;---------------------- |
---|
34 | |
---|
35 | colors=32 |
---|
36 | format='(F6.2)' |
---|
37 | minfield_init=0. |
---|
38 | maxfield_init=0. |
---|
39 | |
---|
40 | default_path='./' |
---|
41 | if (n_elements(path) eq 0) then path=default_path |
---|
42 | if (n_elements(domain) eq 0) then domain='d01' |
---|
43 | file=path+'/geo_em.'+domain+'.nc' |
---|
44 | |
---|
45 | |
---|
46 | |
---|
47 | ;---------------------- |
---|
48 | ; equivalent inputs |
---|
49 | ;---------------------- |
---|
50 | case charvar of |
---|
51 | 'HGT_M': |
---|
52 | 'TOPO': charvar='HGT_M' |
---|
53 | 'THERMAL_INERTIA': |
---|
54 | 'TI': charvar='THERMAL_INERTIA' |
---|
55 | 'ALBEDO_GCM': |
---|
56 | 'ALBEDO': charvar='ALBEDO_GCM' |
---|
57 | 'GHT': |
---|
58 | else: |
---|
59 | endcase |
---|
60 | if (n_elements(charvar2) ne 0) then begin |
---|
61 | case charvar2 of |
---|
62 | 'HGT_M': |
---|
63 | 'TOPO': charvar2='HGT_M' |
---|
64 | 'THERMAL_INERTIA': |
---|
65 | 'TI': charvar2='THERMAL_INERTIA' |
---|
66 | 'ALBEDO_GCM': |
---|
67 | 'ALBEDO': charvar2='ALBEDO_GCM' |
---|
68 | 'GHT': |
---|
69 | else: |
---|
70 | endcase |
---|
71 | endif |
---|
72 | |
---|
73 | |
---|
74 | ;---------------------- |
---|
75 | ; set graphics |
---|
76 | ;---------------------- |
---|
77 | |
---|
78 | set_plot, 'ps' |
---|
79 | device, file='geo_em.'+domain+'_'+charvar+'.ps', /color |
---|
80 | ;set_plot, 'x' |
---|
81 | |
---|
82 | case charvar of |
---|
83 | 'HGT_M': pal=33 ;16 ;4 |
---|
84 | 'THERMAL_INERTIA': pal=3 |
---|
85 | 'ALBEDO_GCM': pal=0 |
---|
86 | 'GHT': pal=33 |
---|
87 | else: |
---|
88 | endcase |
---|
89 | |
---|
90 | |
---|
91 | |
---|
92 | !p.charthick = 2.0 |
---|
93 | !p.thick = 3.0 |
---|
94 | !x.thick = 2.0 |
---|
95 | !y.thick = 2.0 |
---|
96 | |
---|
97 | case charvar of |
---|
98 | 'HGT_M': title='Altimetry (km)' |
---|
99 | 'THERMAL_INERTIA': title='Thermal inertia (!NJ!N.m!U-2!N.s!U-1/2!N.K!U-1!N)' |
---|
100 | 'ALBEDO_GCM': title='Albedo LW (%)' |
---|
101 | 'GHT': title='Geopotential height (m)' |
---|
102 | else: title='' |
---|
103 | endcase |
---|
104 | |
---|
105 | |
---|
106 | ;------------------------------- |
---|
107 | ; open file and read variables |
---|
108 | ;------------------------------- |
---|
109 | cdfid = ncdf_open(file) |
---|
110 | |
---|
111 | ; field |
---|
112 | print, charvar |
---|
113 | varid=ncdf_varid(cdfid,charvar) |
---|
114 | ncdf_varget, cdfid, varid, var |
---|
115 | ; lon |
---|
116 | varid=ncdf_varid(cdfid,'XLONG_M') |
---|
117 | ncdf_varget, cdfid, varid, lon |
---|
118 | lon=reform(lon[*,0]) |
---|
119 | ; lat |
---|
120 | varid=ncdf_varid(cdfid,'XLAT_M') |
---|
121 | ncdf_varget, cdfid, varid, lat |
---|
122 | lat=reform(lat[0,*]) |
---|
123 | |
---|
124 | if (n_elements(charvar2) ne 0) then begin |
---|
125 | print, charvar2 |
---|
126 | varid=ncdf_varid(cdfid,charvar2) |
---|
127 | ncdf_varget, cdfid, varid, overcontour |
---|
128 | endif else begin |
---|
129 | overcontour=0. |
---|
130 | endelse |
---|
131 | |
---|
132 | |
---|
133 | ;------------------------------- |
---|
134 | ; calculation on variables |
---|
135 | ;------------------------------- |
---|
136 | case charvar of |
---|
137 | 'HGT_M': var=var/1000 |
---|
138 | 'THERMAL_INERTIA': |
---|
139 | 'ALBEDO_GCM': var=var*100 |
---|
140 | 'GHT': |
---|
141 | else: |
---|
142 | endcase |
---|
143 | |
---|
144 | |
---|
145 | |
---|
146 | ;--------- |
---|
147 | ; plot ! |
---|
148 | ;--------- |
---|
149 | |
---|
150 | minfield=min(var) |
---|
151 | maxfield=max(var) |
---|
152 | print, 'mM', minfield, maxfield |
---|
153 | |
---|
154 | what_I_plot=var |
---|
155 | |
---|
156 | |
---|
157 | map_set, -90, 0, /azimuthal, limit=[-90,-180,-60,180] |
---|
158 | map_latlon, $ |
---|
159 | what_I_plot, $ ; 2D field |
---|
160 | lon, $ ; 1D latitude |
---|
161 | lat ; 1D longitude |
---|
162 | |
---|
163 | |
---|
164 | map_latlon, $ |
---|
165 | what_I_plot, $ ; 2D field |
---|
166 | lon, $ ; 1D latitude |
---|
167 | lat, $ ; 1D longitude |
---|
168 | minfield=minfield_init, $ ; minimum value of plotted field (=0: calculate) |
---|
169 | maxfield=maxfield_init, $ ; maximum value of plotted field (=0: calculate) |
---|
170 | overcontour=overcontour, $ ; another 2D field to overplot with contour lines (=0: no) |
---|
171 | ; overvector_x=overvector_x, $ ; wind vector - x component (=0: no) |
---|
172 | ; overvector_y=overvector_y, $ ; wind vector - y component (=0: no) |
---|
173 | ct=pal, $ ; color table (33-rainbow is default) |
---|
174 | colors=colors, $ ; number of colors/levels (32 is default) |
---|
175 | title=title, $ ; title of the plot ('' is default) |
---|
176 | format=format ; format of colorbar annotations ('(F6.2)' is default) |
---|
177 | |
---|
178 | |
---|
179 | device, /close |
---|
180 | |
---|
181 | end |
---|