Subversion Repositories pvinversion.ecmwf

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 michaesp 1
% -------------------------------------------------------------------------
2
% Load files
3
% -------------------------------------------------------------------------
4
 
5
% Base directory and filename
6
base = '/net/rossby/lhome/sprenger/PV_Inversion_Tool/';
7
folder   = base;
8
filename = 'Z1_20060115_18';
9
disp([folder filename])
10
 
11
% First image (otherwise first image is not correctly written)
12
figname = [base '/test.eps'];
13
close;
14
fh=figure('Units','pixels','Position',[100 100 900 900])
15
set(gcf, 'PaperPosition', [2 1 15 10]);
16
print('-depsc2','-r0',figname);
17
 
18
% Load variables from file (on model levels)
19
z_th = cdf_loadV(folder,filename,'TH');
20
z_uu = cdf_loadV(folder,filename,'U');
21
z_vv = cdf_loadV(folder,filename,'V');
22
 
23
% -------------------------------------------------------------------------
24
% Lower boundary condition for potential temperature
25
% -------------------------------------------------------------------------
26
 
27
ilev=1;
28
 
29
% Create a new figure
30
close;
31
fh=figure('Units','pixels','Position',[100 100 900 900])
32
 
33
% Set projection
34
load coast
35
h=axesm('MapProjection','eqdcylin');
36
setm(gca,'FLatLimit',[z_th.latmin z_th.latmax],'FLonLimit',[z_th.lonmin z_th.lonmax]);
37
h=plotm(lat,long);
38
gridm;
39
 
40
% Scale the plotting field for color map
41
fld=squeeze(z_th.var(ilev,:,:));
42
c_map = scale_col(230:5:310,fld);
43
 
44
% Plot TH
45
lat=z_th.ymin + (0:z_th.ny-1) * z_th.dy;
46
lon=z_th.xmin + (0:z_th.nx-1) * z_th.dx;
47
[C,h]=contourfm(lat,lon,c_map.data,c_map.xtick);
48
for icnt = 1: length(h)
49
  set( h(icnt), 'EdgeColor', 'none' )
50
end
51
 
52
% Add color bar
53
colormap('default');
54
ctb(['/home/sprenger/ECFC_STE_Forecast/ctb_isen'],c_map.xtick,2);
55
caxis(c_map.caxis);
56
q=colorbar('vert');
57
set(q,'ytick',c_map.xtick,'YTickLabel',c_map.label);
58
 
59
% Add the grid and the coast lines to the plot
60
title([ 'Lower Boundary Condition : Potential Temperature @' num2str(z_th.aklay(ilev)) ' m ASL' ]);
61
 
62
% Save figure
63
figname = [ base '/bound_lower_th_' filename '.eps' ];
64
set(gcf, 'PaperPosition', [2 1 15 10]);
65
print('-depsc2','-r0',figname);
66
 
67
% -------------------------------------------------------------------------
68
% Upper boundary condition for potential temperature
69
% -------------------------------------------------------------------------
70
 
71
ilev=z_th.nz;
72
 
73
% Create a new figure
74
close;
75
fh=figure('Units','pixels','Position',[100 100 900 900])
76
 
77
% Set projection
78
load coast
79
h=axesm('MapProjection','eqdcylin');
80
setm(gca,'FLatLimit',[z_th.latmin z_th.latmax],'FLonLimit',[z_th.lonmin z_th.lonmax]);
81
h=plotm(lat,long);
82
gridm;
83
 
84
% Scale the plotting field for color map
85
fld=squeeze(z_th.var(ilev,:,:));
86
c_map = scale_col(450:10:550,fld);
87
 
88
% Plot TH
89
lat=z_th.ymin + (0:z_th.ny-1) * z_th.dy;
90
lon=z_th.xmin + (0:z_th.nx-1) * z_th.dx;
91
[C,h]=contourfm(lat,lon,c_map.data,c_map.xtick);
92
for icnt = 1: length(h)
93
  set( h(icnt), 'EdgeColor', 'none' )
94
end
95
 
96
% Add color bar
97
colormap('default');
98
ctb(['/home/sprenger/ECFC_STE_Forecast/ctb_isen'],c_map.xtick,2);
99
caxis(c_map.caxis);
100
q=colorbar('vert');
101
set(q,'ytick',c_map.xtick,'YTickLabel',c_map.label);
102
 
103
% Add the grid and the coast lines to the plot
104
title([ 'Upper Boundary Condition : Potential Temperature @ ' num2str(z_th.aklay(ilev)) ' m ASL' ]);
105
 
106
% Save figure
107
figname = [ base '/bound_upper_th_' filename '.eps' ];
108
set(gcf, 'PaperPosition', [2 1 15 10]);
109
print('-depsc2','-r0',figname);
110
 
111
 
112
% -------------------------------------------------------------------------
113
% Southern lateral boundary condition for zonal wind
114
% -------------------------------------------------------------------------
115
 
116
ilev=1;
117
 
118
% Create a new figure
119
close;
120
fh=figure('Units','pixels','Position',[100 100 900 900])
121
 
122
% Scale the plotting field for color map
123
fld=squeeze(z_uu.var(:,ilev,:));
124
c_map = scale_col(-50:10:50,fld);
125
 
126
% Plot
127
lev=z_uu.aklev/10000;
128
lon=z_uu.xmin + (0:z_uu.nx-1) * z_uu.dx;
129
[C,h]=contourf(lon,lev,c_map.data,c_map.xtick);
130
for icnt = 1: length(h)
131
  set( h(icnt), 'EdgeColor', 'none' )
132
end
133
 
134
% Add color bar
135
colormap('default');
136
ctb(['/home/sprenger/ECFC_STE_Forecast/ctb_isen'],c_map.xtick,2);
137
caxis(c_map.caxis);
138
q=colorbar('vert');
139
set(q,'ytick',c_map.xtick,'YTickLabel',c_map.label);
140
 
141
% Add the grid and the coast lines to the plot
142
title([ 'Southern lateral Boundary Condition : Zonal Wind @ ' num2str(z_uu.ymin) '^\circ N' ]);
143
xlabel('Longitude');
144
ylabel('Height [km]');
145
 
146
% Save figure
147
figname = [ base '/bound_south_uu_' filename '.eps' ];
148
set(gcf, 'PaperPosition', [2 1 15 10]);
149
print('-depsc2','-r0',figname);
150
 
151
 
152
% -------------------------------------------------------------------------
153
% Northern lateral boundary condition for zonal wind
154
% -------------------------------------------------------------------------
155
 
156
ilev=z_uu.ny;
157
 
158
% Create a new figure
159
close;
160
fh=figure('Units','pixels','Position',[100 100 900 900])
161
 
162
% Scale the plotting field for color map
163
fld=squeeze(z_uu.var(:,ilev,:));
164
c_map = scale_col(-50:10:50,fld);
165
 
166
% Plot
167
lev=z_uu.aklev/10000;
168
lon=z_uu.xmin + (0:z_uu.nx-1) * z_uu.dx;
169
[C,h]=contourf(lon,lev,c_map.data,c_map.xtick);
170
for icnt = 1: length(h)
171
  set( h(icnt), 'EdgeColor', 'none' )
172
end
173
 
174
% Add color bar
175
colormap('default');
176
ctb(['/home/sprenger/ECFC_STE_Forecast/ctb_isen'],c_map.xtick,2);
177
caxis(c_map.caxis);
178
q=colorbar('vert');
179
set(q,'ytick',c_map.xtick,'YTickLabel',c_map.label);
180
 
181
% Add the grid and the coast lines to the plot
182
title([ 'Northern lateral Boundary Condition : Zonal Wind @ ' num2str(z_uu.ymax) '^\circ N' ]);
183
xlabel('Longitude');
184
ylabel('Height [km]');
185
 
186
% Save figure
187
figname = [ base '/bound_north_uu_' filename '.eps' ];
188
set(gcf, 'PaperPosition', [2 1 15 10]);
189
print('-depsc2','-r0',figname);
190
 
191
% -------------------------------------------------------------------------
192
% Western lateral boundary condition for meridional wind
193
% -------------------------------------------------------------------------
194
 
195
ilev=1;
196
 
197
% Create a new figure
198
close;
199
fh=figure('Units','pixels','Position',[100 100 900 900])
200
 
201
% Scale the plotting field for color map
202
fld=squeeze(z_vv.var(:,:,ilev));
203
c_map = scale_col(-50:10:50,fld);
204
 
205
% Plot
206
lev=z_vv.aklev/10000;
207
lat=z_vv.ymin + (0:z_vv.ny-1) * z_vv.dy;
208
[C,h]=contourf(lat,lev,c_map.data,c_map.xtick);
209
for icnt = 1: length(h)
210
  set( h(icnt), 'EdgeColor', 'none' )
211
end
212
 
213
% Add color bar
214
colormap('default');
215
ctb(['/home/sprenger/ECFC_STE_Forecast/ctb_isen'],c_map.xtick,2);
216
caxis(c_map.caxis);
217
q=colorbar('vert');
218
set(q,'ytick',c_map.xtick,'YTickLabel',c_map.label);
219
 
220
% Add the grid and the coast lines to the plot
221
title([ 'Western lateral Boundary Condition : Meridional Wind @ ' num2str(z_vv.xmin) '^\circ E' ]);
222
xlabel('Latitude');
223
ylabel('Height [km]');
224
 
225
% Save figure
226
figname = [ base '/bound_west_vv_' filename '.eps' ];
227
set(gcf, 'PaperPosition', [2 1 15 10]);
228
print('-depsc2','-r0',figname);
229
 
230
% -------------------------------------------------------------------------
231
% Eastern lateral boundary condition for meridional wind
232
% -------------------------------------------------------------------------
233
 
234
ilev=z_vv.nx;
235
 
236
% Create a new figure
237
close;
238
fh=figure('Units','pixels','Position',[100 100 900 900])
239
 
240
% Scale the plotting field for color map
241
fld=squeeze(z_vv.var(:,:,ilev));
242
c_map = scale_col(-50:10:50,fld);
243
 
244
% Plot
245
lev=z_vv.aklev/10000;
246
lat=z_vv.ymin + (0:z_vv.ny-1) * z_vv.dy;
247
[C,h]=contourf(lat,lev,c_map.data,c_map.xtick);
248
for icnt = 1: length(h)
249
  set( h(icnt), 'EdgeColor', 'none' )
250
end
251
 
252
% Add color bar
253
colormap('default');
254
ctb(['/home/sprenger/ECFC_STE_Forecast/ctb_isen'],c_map.xtick,2);
255
caxis(c_map.caxis);
256
q=colorbar('vert');
257
set(q,'ytick',c_map.xtick,'YTickLabel',c_map.label);
258
 
259
% Add the grid and the coast lines to the plot
260
title([ 'Eastern lateral Boundary Condition : Meridional Wind @ ' num2str(z_vv.xmax) '^\circ E' ]);
261
xlabel('Latitude');
262
ylabel('Height [km]');
263
 
264
% Save figure
265
figname = [ base '/bound_east_vv_' filename '.eps' ];
266
set(gcf, 'PaperPosition', [2 1 15 10]);
267
print('-depsc2','-r0',figname);