Warning, /verification/1D_ocean_ice_column/matlab_scripts/analyze_adjoint_run_general.m is written in an unsupported language. File is not indexed.
view on githubraw file Latest commit 3c3b2f91 on 2013-01-23 17:10:52 UTC
3c3b2f914f Ian *0001 clear all;%close all;
0002
0003 addpath(pwd)
0004 cdir = pwd;
0005
0006 % the directory with adjoint output
0007 addir = '/net/ross/raid1/ifenty/MITgcm_20130115/MITgcm/verification/1D_ocean_ice_column/temp/mnc_test_0001/'
0008
0009 % how many vertical cells out output
0010 dep_ind = 5;
0011
0012 % the experiment name
0013 exp_name = 'temp'
0014
0015 % boolean for writing the figure to a png file
0016 do_print = 1 ;
0017
0018 % cd([dirRoot rdir '/' addir])
0019 cd(addir)
0020
0021 add = dir('adstate*');
0022 ads = dir('adseaice*');
0023 ade = dir('adexf*');
0024
0025 adseaice = nc_getall(ads(1).name);
0026 adstate = nc_getall(add(1).name);
0027 adexf = nc_getall(ade(1).name);
0028
0029 T = adseaice.T.data;
0030 adheff = permute(adseaice.adheff.data,[ 3 2 1]);
0031 adarea = permute(adseaice.adarea.data,[ 3 2 1]);
0032
0033 adqnet = permute(adstate.adQnet.data,[3 2 1]);
0034 adatemp = permute(adexf.adatemp.data,[3 2 1]);
0035 advwind = permute(adexf.advwind.data,[3 2 1]);
0036 adswdown = permute(adexf.adswdown.data,[3 2 1]);
0037 adT = permute(adstate.adT.data,[4 3 2 1 ]);
0038 adS = permute(adstate.adS.data,[4 3 2 1 ]);
0039
0040 ipt=1;if(size(adheff,1)==5);ipt=3;end;
0041
0042 figure(2);clf;
0043
0044 subplot(423); hold on;
0045 plot(T,squeeze(adarea(ipt,ipt,:)));grid;title('adarea');
0046 tenPercentAboveBelowLeftRight;
0047 nn = find(isnan(squeeze(adarea(ipt,ipt,:)))); plot(T(nn),T(nn).*0,'rx')
0048
0049 subplot(424); hold on;
0050 plot(T,squeeze(adheff(ipt,ipt,:)));axis tight;grid;title('adheff')
0051 tenPercentAboveBelowLeftRight;
0052 nn = find(isnan(squeeze(adheff(ipt,ipt,:)))); plot(T(nn),T(nn).*0,'rx')
0053
0054 subplot(425); hold on;
0055 plot(T,squeeze(adqnet(ipt,ipt,:)));axis tight;grid;title('adqnet');
0056 tenPercentAboveBelowLeftRight;
0057 nn = find(isnan(squeeze(adqnet(ipt,ipt,:)))); plot(T(nn),T(nn).*0,'rx')
0058
0059 subplot(426); hold on;
0060 plot(T,squeeze(advwind(ipt,ipt,:)));axis tight;grid;title('advwind');
0061 tenPercentAboveBelowLeftRight;
0062 nn = find(isnan(squeeze(advwind(ipt,ipt,:)))); plot(T(nn),T(nn).*0,'rx')
0063
0064 subplot(421); hold on;
0065 plot(T,squeeze(adT(ipt,ipt,1:dep_ind,:))');axis tight;grid;title('adT')
0066 tenPercentAboveBelowLeftRight;
0067 nn = find(isnan(squeeze(adT(ipt,ipt,1,:)))); plot(T(nn),T(nn).*0,'rx')
0068 h=legend('l1','l2','l3', 'l4','Location','SouthWest');
0069 set(h,'FontSize',6)
0070
0071 subplot(422); hold on;
0072 plot(T,squeeze(adS(ipt,ipt,1:dep_ind,:))');axis tight;grid;title('adS')
0073 tenPercentAboveBelowLeftRight;
0074
0075 subplot(427); hold on;
0076 plot(T,squeeze(adatemp(ipt,ipt,:)));axis tight;grid;title('adatemp');
0077 tenPercentAboveBelowLeftRight;
0078 nn = find(isnan(squeeze(adatemp(ipt,ipt,:)))); plot(T(nn),T(nn).*0,'rx')
0079
0080 subplot(428); hold on;
0081 plot(T,squeeze(adswdown(ipt,ipt,:)));axis tight;grid;title('adswdown');
0082 tenPercentAboveBelowLeftRight;
0083 nn = find(isnan(squeeze(adswdown(ipt,ipt,:)))); plot(T(nn),T(nn).*0,'rx')
0084
0085 % cd(cdir)
0086
0087 set(gcf,'Position',[350 120 600 1000])
0088
0089 if (do_print)
0090 set(gcf,'PaperPosition',[0 0 8 12])
0091 print('-dpng','-r100',['AdjointAnalysis_' exp_name])
0092 ['printing ' exp_name]
0093 end
0094
0095 %cd(cdir)