/[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.8 - (hide annotations) (download)
Wed Jun 15 17:08:04 2011 UTC (15 years, 4 months ago) by gforget
Branch: MAIN
Changes since 1.7: +1 -1 lines
-  replace mydir with gcmfaces_dir and MITprof_dir accordingly.

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

  ViewVC Help
Powered by ViewVC 1.1.22