Back to home page

MITgcm

 
 

    


Warning, /verification/seaice_obcs/input/compare_lab_sea.m is written in an unsupported language. File is not indexed.

view on githubraw file Latest commit adb13907 on 2012-12-19 02:48:52 UTC
3b88786c4e Dimi*0001 % Compare MITgcm/verification/seaice_obcs
                0002 % results to ../lab_sea/input.salt_plume
                0003 
                0004 % preamble
adb13907c3 Dimi*0005 %cd MITgcm/verification/seaice_obcs/input
                0006 nx=20; ny=16; nz=18; nt=10; ix=8:17; iy=4:11;
3b88786c4e Dimi*0007 p1='../../lab_sea/tr_run.salt_plume/';
                0008 p2='../run/';
                0009 
                0010 % compare U/V/T/S
                0011 for f={'T','S','U','V'}
                0012     J=0;
                0013     fn=[p1 f{1} '.' myint2str(nt,10) '.data'];
                0014     tmp=readbin(fn,[nx ny nz]); tmp1=tmp(ix,iy,:);
                0015     fn=[p2 f{1} '.' myint2str(nt,10) '.data'];
                0016     tmp2=readbin(fn,[length(ix) length(iy) nz]);
                0017     for k=1:nz
                0018         clf, subplot(311), mypcolor(tmp1(:,:,k)'); thincolorbar
                0019         title(['lab sea ' f{1} ', level ' int2str(k)]);
                0020         subplot(312), mypcolor(tmp2(:,:,k)'); thincolorbar
                0021         title(['seaice obcs ' f{1} ', level ' int2str(k)]);
                0022         tmp3=tmp2(:,:,k)-tmp1(:,:,k);
                0023         subplot(313), mypcolor(tmp3'); thincolorbar
adb13907c3 Dimi*0024         title('difference'), pause(.2)
3b88786c4e Dimi*0025         J=J+sum(sum(tmp3(2:(end-1),2:(end-1)).^2));
                0026     end
                0027     disp([f{1} ': ' num2str(J)])
                0028 end
                0029 
                0030 % compare sea ice
                0031 for f={'UICE','VICE','AREA','HSNOW','HSALT','HEFF'}
                0032   J=0;
                0033   for t=0:nt
                0034     fn=[p1 f{1} '.' myint2str(t,10) '.data'];
                0035     tmp=readbin(fn,[nx ny]); tmp1=tmp(ix,iy,:);
                0036     fn=[p2 f{1} '.' myint2str(t,10) '.data'];
                0037     tmp2=readbin(fn,[length(ix) length(iy)]);
                0038     clf, subplot(311), mypcolor(tmp1'); cx=caxis; thincolorbar
                0039     title(['lab sea ' f{1} ', time step ' int2str(t)]);
                0040     subplot(312), mypcolor(tmp2'); caxis(cx), thincolorbar
                0041     title(['seaice obcs ' f{1} ', time step ' int2str(t)]);
                0042     tmp3=tmp2-tmp1;
                0043     subplot(313), mypcolor(tmp3'); thincolorbar
adb13907c3 Dimi*0044     title('difference'), pause(.2)
3b88786c4e Dimi*0045     J=J+sum(sum(tmp3(2:(end-1),2:(end-1)).^2));
                0046   end
                0047   disp([f{1} ': ' num2str(J)])
                0048 end