Blame | Last modification | View Log | Download | RSS feed
% -------------------------------------------------------------------------% Load files% -------------------------------------------------------------------------% Base directory and filenamebase = '/net/rossby/lhome/sprenger/PV_Inversion_Tool/real/inp/';folder = base;filename = 'H20060116_18';disp([folder filename])% First image (otherwise first image is not correctly written)figname = [base '/test.eps'];close;fh=figure('Units','pixels','Position',[100 100 900 900])set(gcf, 'PaperPosition', [2 1 15 10]);print('-depsc2','-r0',figname);% Load variables from file (on model levels)m_th = cdf_loadV(folder,filename,'TH');m_pv = cdf_loadV(folder,filename,'PV');m_fl = cdf_loadV(folder,filename,'PV_FILT');m_an = cdf_loadV(folder,filename,'PV_ANOM');% Specify the plot domainlonmin =-100;lonmax = -20;latmin = 10;latmax = 80;% Region for smoothinglon1=-75;lon2=-50;lat1= 30;lat2=55;lev1=2000;lev2=10000;% Plotting parametersplotting=cellstr([ 'ew'; 'ns'; '2d'; 'pv'; 'an'; 'fl' ]);%plotting=cellstr([ 'ew'; 'pv'; 'an'; 'fl' ]);% -------------------------------------------------------------------------% PV (HORIZONTAL)% -------------------------------------------------------------------------if ( any(strcmp('2d',plotting)) & any(strcmp('pv',plotting)) )disp('2D PV');% Loop over all levelsfor ilev=1:m_th.nz% Create a new figureclose;fh=figure('Units','pixels','Position',[100 100 900 900])% Set the geographical projectionm_proj('Equidistant Cylindrical','long',[lonmin lonmax],'lat',[latmin latmax]);% Scale the plotting field for color mapfld=squeeze(m_pv.var(ilev,:,:));c_map = scale_col([-.5,-.2,0.,.2,.5,1.,1.5,2.,3.,4.,6.,8.,10.],fld);% Plot PVlat=m_pv.ymin + (0:m_pv.ny-1) * m_pv.dy;lon=m_pv.xmin + (0:m_pv.nx-1) * m_pv.dx;[C,h]=m_contourf(lon,lat,c_map.data,c_map.xtick);for icnt = 1: length(h)set( h(icnt), 'EdgeColor', 'none' )end% Add color barcolormap('default');ctb(['/home/sprenger/ECFC_STE_Forecast/ctb_isen'],c_map.xtick,1);caxis(c_map.caxis);q=colorbar('hori');set(q,'xtick',c_map.xtick,'XTickLabel',c_map.label);% Add the grid and the coast lines to the plotm_grid;m_coast('linewidth',1,'color','k');title(num2str(m_th.aklay(ilev)));% Add region of smoothingif ( (m_th.aklay(ilev) > lev1) & (m_th.aklay(ilev) < lev2) )m_line([lon1 lon1],[lat1 lat2],'color','k','linewidth',2);m_line([lon1 lon2],[lat2 lat2],'color','k','linewidth',2);m_line([lon2 lon2],[lat2 lat1],'color','k','linewidth',2);m_line([lon1 lon2],[lat1 lat1],'color','k','linewidth',2);end% Save figurepre='';if ( m_th.aklay(ilev) < 10 )pre='0';endif ( m_th.aklay(ilev) < 100 )pre=[pre '0' ];endif ( m_th.aklay(ilev) < 1000 )pre=[pre '0' ];endif ( m_th.aklay(ilev) < 10000 )pre=[pre '0' ];endfigname = [ base '/pv_2d_' filename '_' pre num2str(m_th.aklay(ilev)) '.eps' ];set(gcf, 'PaperPosition', [2 1 15 10]);print('-depsc2','-r0',figname);% End loop over all levelsendend% -------------------------------------------------------------------------% PV_FILT (HORIZONTAL)% -------------------------------------------------------------------------if ( any(strcmp('2d',plotting)) & any(strcmp('fl',plotting)) )disp('2D FL');% Loop over all levelsfor ilev=1:m_th.nz% Create a new figureclose;fh=figure('Units','pixels','Position',[100 100 900 900])% Set the geographical projectionm_proj('Equidistant Cylindrical','long',[lonmin lonmax],'lat',[latmin latmax]);% Scale the plotting field for color mapfld=squeeze(m_fl.var(ilev,:,:));c_map = scale_col([-.5,-.2,0.,.2,.5,1.,1.5,2.,3.,4.,6.,8.,10.],fld);% Plot PVlat=m_pv.ymin + (0:m_pv.ny-1) * m_pv.dy;lon=m_pv.xmin + (0:m_pv.nx-1) * m_pv.dx;[C,h]=m_contourf(lon,lat,c_map.data,c_map.xtick);for icnt = 1: length(h)set( h(icnt), 'EdgeColor', 'none' )end% Add color barcolormap('default');ctb(['/home/sprenger/ECFC_STE_Forecast/ctb_isen'],c_map.xtick,1);caxis(c_map.caxis);q=colorbar('hori');set(q,'xtick',c_map.xtick,'XTickLabel',c_map.label);% Add the grid and the coast lines to the plotm_grid;m_coast('linewidth',1,'color','k');title(num2str(m_th.aklay(ilev)));% Add region for smootrhingif ( (m_th.aklay(ilev) > lev1) & (m_th.aklay(ilev) < lev2) )m_line([lon1 lon1],[lat1 lat2],'color','k','linewidth',2);m_line([lon1 lon2],[lat2 lat2],'color','k','linewidth',2);m_line([lon2 lon2],[lat2 lat1],'color','k','linewidth',2);m_line([lon1 lon2],[lat1 lat1],'color','k','linewidth',2);end% Save figurepre='';if ( m_th.aklay(ilev) < 10 )pre='0';endif ( m_th.aklay(ilev) < 100 )pre=[pre '0' ];endif ( m_th.aklay(ilev) < 1000 )pre=[pre '0' ];endif ( m_th.aklay(ilev) < 10000 )pre=[pre '0' ];endfigname = [ base '/fl_2d_' filename '_' pre num2str(m_th.aklay(ilev)) '.eps' ];set(gcf, 'PaperPosition', [2 1 15 10]);print('-depsc2','-r0',figname);% End loop over all levelsendend% -------------------------------------------------------------------------% PV_ANOM (HORIZONTAL)% -------------------------------------------------------------------------if ( any(strcmp('2d',plotting)) & any(strcmp('an',plotting)) )disp('2D AN');% Loop over all levelsfor ilev=1:m_th.nz% Create a new figureclose;fh=figure('Units','pixels','Position',[100 100 900 900])% Set the geographical projectionm_proj('Equidistant Cylindrical','long',[lonmin lonmax],'lat',[latmin latmax]);% Scale the plotting field for color mapfld=squeeze(m_an.var(ilev,:,:));c_map = scale_col([-.5,-.2,0.,.2,.5,1.,1.5,2.,3.,4.,6.,8.,10.],fld);% Plot PVlat=m_pv.ymin + (0:m_pv.ny-1) * m_pv.dy;lon=m_pv.xmin + (0:m_pv.nx-1) * m_pv.dx;[C,h]=m_contourf(lon,lat,c_map.data,c_map.xtick);for icnt = 1: length(h)set( h(icnt), 'EdgeColor', 'none' )end% Add color barcolormap('default');ctb(['/home/sprenger/ECFC_STE_Forecast/ctb_isen'],c_map.xtick,1);caxis(c_map.caxis);q=colorbar('hori');set(q,'xtick',c_map.xtick,'XTickLabel',c_map.label);% Add the grid and the coast lines to the plotm_grid;m_coast('linewidth',1,'color','k');title(num2str(m_th.aklay(ilev)));% Add region for smootrhingif ( (m_th.aklay(ilev) > lev1) & (m_th.aklay(ilev) < lev2) )m_line([lon1 lon1],[lat1 lat2],'color','k','linewidth',2);m_line([lon1 lon2],[lat2 lat2],'color','k','linewidth',2);m_line([lon2 lon2],[lat2 lat1],'color','k','linewidth',2);m_line([lon1 lon2],[lat1 lat1],'color','k','linewidth',2);end% Save figurepre='';if ( m_th.aklay(ilev) < 10 )pre='0';endif ( m_th.aklay(ilev) < 100 )pre=[pre '0' ];endif ( m_th.aklay(ilev) < 1000 )pre=[pre '0' ];endif ( m_th.aklay(ilev) < 10000 )pre=[pre '0' ];endfigname = [ base '/an_2d_' filename '_' pre num2str(m_th.aklay(ilev)) '.eps' ];set(gcf, 'PaperPosition', [2 1 15 10]);print('-depsc2','-r0',figname);% End loop over all levelsendend% -------------------------------------------------------------------------% PV (VERTICAL EAST/WEST)% -------------------------------------------------------------------------if ( any(strcmp('ew',plotting)) & any(strcmp('pv',plotting)) )disp('EW PV');% Loop over all levelsfor lat=latmin:latmax% Get the y index of the latitude in the gridilat=floor((lat-m_pv.ymin)/(m_pv.dy)+1);% Create a new figureclose;fh=figure('Units','pixels','Position',[100 100 900 900])% Scale the plotting field for color mapfld=squeeze(m_pv.var(:,ilat,:));c_map = scale_col([-.5,-.2,0.,.2,.5,1.,1.5,2.,3.,4.,6.,8.,10.],fld);% Plot PVlon=m_pv.xmin + (0:m_pv.nx-1) * m_pv.dx;lev=m_pv.aklay;mask=(lon>=lonmin) & (lon<=lonmax);[C,h]=contourf(lon(mask),lev,c_map.data(:,mask),c_map.xtick);for icnt = 1: length(h)set( h(icnt), 'EdgeColor', 'none' )end% Add color barcolormap('default');ctb(['/home/sprenger/ECFC_STE_Forecast/ctb_isen'],c_map.xtick,1);caxis(c_map.caxis);q=colorbar('hori');set(q,'xtick',c_map.xtick,'XTickLabel',c_map.label);% Add the grid and the coast lines to the plottitle([ 'Latitude = ' num2str(lat) ]);% Add region for smootrhingif ( (lat > lat1) & (lat < lat2) )line([lon1 lon2],[lev1 lev1],'color','k','linewidth',2);line([lon2 lon2],[lev1 lev2],'color','k','linewidth',2);line([lon2 lon1],[lev2 lev2],'color','k','linewidth',2);line([lon1 lon1],[lev2 lev1],'color','k','linewidth',2);end% Save figureif ( lat < 0 )pre='s'elsepre='n'endif ( abs(lat) < 10 )pre=[ pre '0'];endfigname = [ base '/pv_ew_' filename '_' pre num2str(abs(lat)) '.eps' ];set(gcf, 'PaperPosition', [2 1 15 10]);print('-depsc2','-r0',figname);% End loop over all levelsendend% -------------------------------------------------------------------------% PV_FILT (VERTICAL EAST/WEST)% -------------------------------------------------------------------------if ( any(strcmp('ew',plotting)) & any(strcmp('fl',plotting)) )disp('EW FL');% Loop over all levelsfor lat=latmin:latmax% Get the y index of the latitude in the gridilat=floor((lat-m_pv.ymin)/(m_pv.dy)+1);% Create a new figureclose;fh=figure('Units','pixels','Position',[100 100 900 900])% Scale the plotting field for color mapfld=squeeze(m_fl.var(:,ilat,:));c_map = scale_col([-.5,-.2,0.,.2,.5,1.,1.5,2.,3.,4.,6.,8.,10.],fld);% Plot PV_FILTlon=m_pv.xmin + (0:m_pv.nx-1) * m_pv.dx;lev=m_pv.aklay;mask=(lon>=lonmin) & (lon<=lonmax);[C,h]=contourf(lon(mask),lev,c_map.data(:,mask),c_map.xtick);for icnt = 1: length(h)set( h(icnt), 'EdgeColor', 'none' )end% Add color barcolormap('default');ctb(['/home/sprenger/ECFC_STE_Forecast/ctb_isen'],c_map.xtick,1);caxis(c_map.caxis);q=colorbar('hori');set(q,'xtick',c_map.xtick,'XTickLabel',c_map.label);% Add the grid and the coast lines to the plottitle([ 'Latitude = ' num2str(lat) ]);% Add region for smootrhingif ( (lat > lat1) & (lat < lat2) )line([lon1 lon2],[lev1 lev1],'color','k','linewidth',2);line([lon2 lon2],[lev1 lev2],'color','k','linewidth',2);line([lon2 lon1],[lev2 lev2],'color','k','linewidth',2);line([lon1 lon1],[lev2 lev1],'color','k','linewidth',2);end% Save figureif ( lat < 0 )pre='s'elsepre='n'endif ( abs(lat) < 10 )pre=[ pre '0'];endfigname = [ base '/fl_ew_' filename '_' pre num2str(abs(lat)) '.eps' ];set(gcf, 'PaperPosition', [2 1 15 10]);print('-depsc2','-r0',figname);% End loop over all levelsendend% -------------------------------------------------------------------------% PV_ANOM (VERTICAL EAST/WEST)% -------------------------------------------------------------------------if ( any(strcmp('ew',plotting)) & any(strcmp('an',plotting)) )disp('EW AN');% Loop over all levelsfor lat=latmin:latmax% Get the y index of the latitude in the gridilat=floor((lat-m_pv.ymin)/(m_pv.dy)+1);% Create a new figureclose;fh=figure('Units','pixels','Position',[100 100 900 900])% Scale the plotting field for color mapfld=squeeze(m_an.var(:,ilat,:));c_map = scale_col([-.5,-.2,0.,.2,.5,1.,1.5,2.,3.,4.,6.,8.,10.],fld);% Plot PV_FILTlon=m_pv.xmin + (0:m_pv.nx-1) * m_pv.dx;lev=m_pv.aklay;mask=(lon>=lonmin) & (lon<=lonmax);[C,h]=contourf(lon(mask),lev,c_map.data(:,mask),c_map.xtick);for icnt = 1: length(h)set( h(icnt), 'EdgeColor', 'none' )end% Add color barcolormap('default');ctb(['/home/sprenger/ECFC_STE_Forecast/ctb_isen'],c_map.xtick,1);caxis(c_map.caxis);q=colorbar('hori');set(q,'xtick',c_map.xtick,'XTickLabel',c_map.label);% Add the grid and the coast lines to the plottitle([ 'Latitude = ' num2str(lat) ]);% Add region for smootrhingif ( (lat > lat1) & (lat < lat2) )line([lon1 lon2],[lev1 lev1],'color','k','linewidth',2);line([lon2 lon2],[lev1 lev2],'color','k','linewidth',2);line([lon2 lon1],[lev2 lev2],'color','k','linewidth',2);line([lon1 lon1],[lev2 lev1],'color','k','linewidth',2);end% Save figureif ( lat < 0 )pre='s'elsepre='n'endif ( abs(lat) < 10 )pre=[ pre '0'];endfigname = [ base '/an_ew_' filename '_' pre num2str(abs(lat)) '.eps' ];set(gcf, 'PaperPosition', [2 1 15 10]);print('-depsc2','-r0',figname);% End loop over all levelsendend% -------------------------------------------------------------------------% PV (VERTICAL NORTH/SOUTH)% -------------------------------------------------------------------------if ( any(strcmp('ns',plotting)) & any(strcmp('pv',plotting)) )disp('NS PV');% Loop over all levelsfor lon=lonmin:lonmax% Get the y index of the latitude in the gridilon=floor((lon-m_pv.xmin)/(m_pv.dx)+1);% Create a new figureclose;fh=figure('Units','pixels','Position',[100 100 900 900])% Scale the plotting field for color mapfld=squeeze(m_pv.var(:,:,ilon));c_map = scale_col([-.5,-.2,0.,.2,.5,1.,1.5,2.,3.,4.,6.,8.,10.],fld);% Plot PVlat=m_pv.ymin + (0:m_pv.ny-1) * m_pv.dy;lev=m_pv.aklay;mask=(lat>=latmin) & (lat<=latmax);[C,h]=contourf(lat(mask),lev,c_map.data(:,mask),c_map.xtick);for icnt = 1: length(h)set( h(icnt), 'EdgeColor', 'none' )end% Add color barcolormap('default');ctb(['/home/sprenger/ECFC_STE_Forecast/ctb_isen'],c_map.xtick,1);caxis(c_map.caxis);q=colorbar('hori');set(q,'xtick',c_map.xtick,'XTickLabel',c_map.label);% Add the grid and the coast lines to the plottitle([ 'Longitude = ' num2str(lon) ]);% Add region for smootrhingif ( (lon > lon1) & (lon < lon2) )line([lat1 lat2],[lev1 lev1],'color','k','linewidth',2);line([lat2 lat2],[lev1 lev2],'color','k','linewidth',2);line([lat2 lat1],[lev2 lev2],'color','k','linewidth',2);line([lat1 lat1],[lev2 lev1],'color','k','linewidth',2);end% Save figureif ( lon < 0 )pre='w'elsepre='e'endif ( abs(lon) < 10 )pre=[ pre '00'];elseif ( abs(lon) < 100 )pre=[ pre '0'];endfigname = [ base '/pv_ns_' filename '_' pre num2str(abs(lon)) '.eps' ];set(gcf, 'PaperPosition', [2 1 15 10]);print('-depsc2','-r0',figname);% End loop over all levelsendend% -------------------------------------------------------------------------% PV_FILT (VERTICAL NORTH/SOUTH)% -------------------------------------------------------------------------if ( any(strcmp('ns',plotting)) & any(strcmp('fl',plotting)) )disp('NS FL');% Loop over all levelsfor lon=lonmin:lonmax% Get the y index of the latitude in the gridilon=floor((lon-m_pv.xmin)/(m_pv.dx)+1);% Create a new figureclose;fh=figure('Units','pixels','Position',[100 100 900 900])% Scale the plotting field for color mapfld=squeeze(m_fl.var(:,:,ilon));c_map = scale_col([-.5,-.2,0.,.2,.5,1.,1.5,2.,3.,4.,6.,8.,10.],fld);% Plot PVlat=m_pv.ymin + (0:m_pv.ny-1) * m_pv.dy;lev=m_pv.aklay;mask=(lat>=latmin) & (lat<=latmax);[C,h]=contourf(lat(mask),lev,c_map.data(:,mask),c_map.xtick);for icnt = 1: length(h)set( h(icnt), 'EdgeColor', 'none' )end% Add color barcolormap('default');ctb(['/home/sprenger/ECFC_STE_Forecast/ctb_isen'],c_map.xtick,1);caxis(c_map.caxis);q=colorbar('hori');set(q,'xtick',c_map.xtick,'XTickLabel',c_map.label);% Add the grid and the coast lines to the plottitle([ 'Longitude = ' num2str(lon) ]);% Add region for smootrhingif ( (lon > lon1) & (lon < lon2) )line([lat1 lat2],[lev1 lev1],'color','k','linewidth',2);line([lat2 lat2],[lev1 lev2],'color','k','linewidth',2);line([lat2 lat1],[lev2 lev2],'color','k','linewidth',2);line([lat1 lat1],[lev2 lev1],'color','k','linewidth',2);end% Save figureif ( lon < 0 )pre='w'elsepre='e'endif ( abs(lon) < 10 )pre=[ pre '00'];elseif ( abs(lon) < 100 )pre=[ pre '0'];endfigname = [ base '/fl_ns_' filename '_' pre num2str(abs(lon)) '.eps' ];set(gcf, 'PaperPosition', [2 1 15 10]);print('-depsc2','-r0',figname);% End loop over all levelsendend% -------------------------------------------------------------------------% PV_ANOM (VERTICAL NORTH/SOUTH)% -------------------------------------------------------------------------if ( any(strcmp('ns',plotting)) & any(strcmp('an',plotting)) )disp('NS AN');% Loop over all levelsfor lon=lonmin:lonmax% Get the y index of the latitude in the gridilon=floor((lon-m_pv.xmin)/(m_pv.dx)+1);% Create a new figureclose;fh=figure('Units','pixels','Position',[100 100 900 900])% Scale the plotting field for color mapfld=squeeze(m_an.var(:,:,ilon));c_map = scale_col([-.5,-.2,0.,.2,.5,1.,1.5,2.,3.,4.,6.,8.,10.],fld);% Plot PVlat=m_pv.ymin + (0:m_pv.ny-1) * m_pv.dy;lev=m_pv.aklay;mask=(lat>=latmin) & (lat<=latmax);[C,h]=contourf(lat(mask),lev,c_map.data(:,mask),c_map.xtick);for icnt = 1: length(h)set( h(icnt), 'EdgeColor', 'none' )end% Add color barcolormap('default');ctb(['/home/sprenger/ECFC_STE_Forecast/ctb_isen'],c_map.xtick,1);caxis(c_map.caxis);q=colorbar('hori');set(q,'xtick',c_map.xtick,'XTickLabel',c_map.label);% Add the grid and the coast lines to the plottitle([ 'Longitude = ' num2str(lon) ]);% Add region for smootrhingif ( (lon > lon1) & (lon < lon2) )line([lat1 lat2],[lev1 lev1],'color','k','linewidth',2);line([lat2 lat2],[lev1 lev2],'color','k','linewidth',2);line([lat2 lat1],[lev2 lev2],'color','k','linewidth',2);line([lat1 lat1],[lev2 lev1],'color','k','linewidth',2);end% Save figureif ( lon < 0 )pre='w'elsepre='e'endif ( abs(lon) < 10 )pre=[ pre '00'];elseif ( abs(lon) < 100 )pre=[ pre '0'];endfigname = [ base '/an_ns_' filename '_' pre num2str(abs(lon)) '.eps' ];set(gcf, 'PaperPosition', [2 1 15 10]);print('-depsc2','-r0',figname);% End loop over all levelsendend