/[MITgcm]/MITgcm_contrib/gael/matlab_class/sample_analysis/plot_one_field.m
ViewVC logotype

Annotation of /MITgcm_contrib/gael/matlab_class/sample_analysis/plot_one_field.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (hide annotations) (download)
Thu Feb 18 01:10:13 2010 UTC (16 years, 8 months ago) by gforget
Branch: MAIN
Changes since 1.2: +1 -1 lines
guiding the user to change path names

1 gforget 1.1
2     %%%%%%%%%%%%%%%%%
3     %load parameters:
4     %%%%%%%%%%%%%%%%%
5     choiceV3orV4='v4'
6    
7 gforget 1.2 if ~isempty(choiceV3orV4)&isempty(whos('mygrid'));
8 gforget 1.1 gcmfaces_path;
9 gforget 1.3 dir0=[mydir 'matlab_class_material/'];
10 gforget 1.2 dirGrid=[dir0 'GRID' choiceV3orV4 '/'];
11     dirIn=[dir0 'SAMPLE' choiceV3orV4 '/'];
12     if strcmp(choiceV3orV4,'v4'); nF=5; else; nF=1; end;
13     global mygrid; mygrid=[]; grid_load(dirGrid,nF);
14 gforget 1.1 end;
15    
16     %%%%%%%%%%%
17     %get field:
18     %%%%%%%%%%%
19 gforget 1.2 nameFld='DDtheta'; tt=0; if strcmp(choiceV3orV4,'v4'); kk=30; else; kk=14; end; cc=[-2 8];
20     fld=rdmds2gcmfaces([dirIn nameFld],tt,nF);
21 gforget 1.1 fld=fld(:,:,kk); msk=mygrid.hFacC(:,:,kk); fld(find(msk==0))=NaN;
22    
23     %%%%%%%%%%%%
24     %plot field:
25     %%%%%%%%%%%%
26     figure; set(gcf,'Units','Normalized','Position',[0.1 0.3 0.4 0.6]);
27     [X,Y,FLD]=convert2pcol(mygrid.XC,mygrid.YC,fld);
28     pcolor(X,Y,FLD); axis([-180 180 -90 90]); shading flat; caxis(cc); colorbar;
29    
30     figure; set(gcf,'Units','Normalized','Position',[0.5 0.3 0.4 0.6]);
31     FLD=convert2array(fld);
32     imagescnan(FLD','nancolor',[1 1 1]*0.8); axis xy; caxis(cc); colorbar;
33    
34 gforget 1.2 if nF==5;
35 gforget 1.1 figure; set(gcf,'Units','Normalized','Position',[0.3 0.1 0.4 0.6]);
36     subplot(3,3,7); imagescnan(fld{1}','nancolor',[1 1 1]*0.8); axis xy; caxis(cc);
37     subplot(3,3,8); imagescnan(fld{2}','nancolor',[1 1 1]*0.8); axis xy; caxis(cc);
38     subplot(3,3,5); imagescnan(fld{3}','nancolor',[1 1 1]*0.8); axis xy; caxis(cc);
39     subplot(3,3,6); imagescnan(fld{4}','nancolor',[1 1 1]*0.8); axis xy; caxis(cc);
40     subplot(3,3,3); imagescnan(fld{5}','nancolor',[1 1 1]*0.8); axis xy; caxis(cc);
41 gforget 1.2 end;
42 gforget 1.1

  ViewVC Help
Powered by ViewVC 1.1.22