| 1 | % cd ~/mitgcm/bbl/MITgcm | % cd MITgcm | 
| 2 | lon=0:.48:11.6; lat=-70:.16:-67.7; dpt=72:144:3600; | lon=0:.48:11.6; lat=-70:.16:-67.7; dpt=72:144:3600; | 
| 3 | Depth=readbin('run/Depth.data',[25 15]); | Depth=readbin('run/Depth.data',[25 15]); | 
|  | colormap(cmap), cx=[29.99 30.1]; |  | 
| 4 |  |  | 
| 5 | % find bottom | % find bottom | 
| 6 | kbot=ones(25,15); | kbot=ones(25,15); | 
| 9 | kbot(find(s1(:,:,k)>0))=k; | kbot(find(s1(:,:,k)>0))=k; | 
| 10 | end | end | 
| 11 |  |  | 
|  | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |  | 
| 12 | % compare baseline, downslope, and bbl | % compare baseline, downslope, and bbl | 
| 13 | colormap(cmap), cx=[29.99 30.1]; | colormap(cmap), cx=[29.99 30.1]; | 
| 14 | s1=zeros(25,15,25); s2=s1; s3=s1; | s1=zeros(25,15,25); s2=s1; s3=s1; | 
| 19 | clf, subplot(311) | clf, subplot(311) | 
| 20 | mypcolor(lat,-dpt/1e3,squeeze(s1(10,:,:))'); caxis(cx), thincolorbar | mypcolor(lat,-dpt/1e3,squeeze(s1(10,:,:))'); caxis(cx), thincolorbar | 
| 21 | title(['baseline salinity section on day ' int2str(ts*1200/60/60/24)]) | title(['baseline salinity section on day ' int2str(ts*1200/60/60/24)]) | 
| 22 | hold on, plot(lat,-Depth(10,:)/1e3,'r.-'), ylabel('depth (km)') | ylabel('depth (km)') | 
| 23 | subplot(312) | subplot(312) | 
| 24 | mypcolor(lat,-dpt/1e3,squeeze(s2(10,:,:))'); caxis(cx), thincolorbar | mypcolor(lat,-dpt/1e3,squeeze(s2(10,:,:))'); caxis(cx), thincolorbar | 
| 25 | title(['downslope salinity section on day ' int2str(ts*1200/60/60/24)]) | title(['downslope salinity section on day ' int2str(ts*1200/60/60/24)]) | 
| 26 | hold on, plot(lat,-Depth(10,:)/1e3,'r.-'), ylabel('depth (km)') | ylabel('depth (km)') | 
| 27 | subplot(313) | subplot(313) | 
| 28 | mypcolor(lat,-dpt/1e3,squeeze(s3(10,:,:))'); caxis(cx), thincolorbar | mypcolor(lat,-dpt/1e3,squeeze(s3(10,:,:))'); caxis(cx), thincolorbar | 
| 29 | title(['bbl salinity section on day ' int2str(ts*1200/60/60/24)]) | title(['bbl salinity section on day ' int2str(ts*1200/60/60/24)]) | 
| 30 | hold on, plot(lat,-Depth(10,:)/1e3,'r.-'), ylabel('depth (km)') | ylabel('depth (km)'), xlabel('latitude (deg)') | 
| 31 | xlabel('latitude (deg)'), pause(.5) | pause(.1) | 
| 32 | end | end | 
| 33 |  |  | 
|  | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |  | 
| 34 | % look at some diagnostics from bbl integration | % look at some diagnostics from bbl integration | 
| 35 |  | colormap(cmap), cx=[29.998 30.03]; | 
| 36 | for ts=216:216:7200 | for ts=216:216:7200 | 
| 37 |  | clf | 
| 38 |  | subplot(321) | 
| 39 | s1=35+readbin(['run.bbl/SALTanom.' myint2str(ts,10) '.data'],[25 15 25]); | s1=35+readbin(['run.bbl/SALTanom.' myint2str(ts,10) '.data'],[25 15 25]); | 
| 40 | clf, subplot(321), mypcolor(lat,-dpt/1e3,squeeze(s1(10,:,:))'); caxis(cx), thincolorbar | mypcolor(lat,-dpt/1e3,squeeze(s1(10,:,:))'); caxis(cx), thincolorbar | 
| 41 | title(['salinity section on day ' int2str(ts*1200/60/60/24)]) | title(['salinity section on day ' int2str(ts*1200/60/60/24)]) | 
| 42 |  | subplot(322) | 
| 43 | s2=kbot; for i=1:25, for j=1:15, s2(i,j)=s1(i,j,kbot(i,j)); end, end | s2=kbot; for i=1:25, for j=1:15, s2(i,j)=s1(i,j,kbot(i,j)); end, end | 
| 44 | subplot(322), mypcolor(s2'); caxis(cx), thincolorbar | mypcolor(s2'); caxis(cx), thincolorbar | 
| 45 | title('salinity of bottom grid box') | title('salinity of bottom grid box') | 
| 46 |  | subplot(323) | 
| 47 |  | eta=readbin(['run.bbl/BBLeta.' myint2str(ts,10) '.data'],[25 15]); | 
| 48 |  | mypcolor(eta'); caxis([0 144]), thincolorbar | 
| 49 |  | title('bbl thickness') | 
| 50 |  | subplot(324) | 
| 51 | s3=readbin(['run.bbl/BBLsalt.' myint2str(ts,10) '.data'],[25 15]); | s3=readbin(['run.bbl/BBLsalt.' myint2str(ts,10) '.data'],[25 15]); | 
| 52 | subplot(323), mypcolor(s3'); caxis(cx), thincolorbar | mypcolor(s3'); caxis(cx), thincolorbar | 
| 53 | title('salinity of bbl') | title('salinity of bbl') | 
| 54 | subplot(324), mypcolor(s3'-s2'); thincolorbar | subplot(325) | 
|  | title('bbl salinity minus bottom salinity') |  | 
|  | tendS=readbin(['run.bbl/BBLtendS.' myint2str(ts,10) '.data'],[25 15]); |  | 
|  | subplot(325), mypcolor(tendS'); caxis([-1 1]*3e-9), thincolorbar |  | 
|  | title('bottom salinity tendency due to bbl'), pause(.1) |  | 
|  | end |  | 
|  |  |  | 
|  | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |  | 
|  | % check that tendency integrates to zero |  | 
|  | RAC=readbin('run.bbl/RAC.data',[25 15]); |  | 
|  | hFacC=readbin('run.bbl/hFacC.data',[25 15 25]); |  | 
|  | for i=1:25 |  | 
|  | for j=1:15 |  | 
|  | RAC(i,j)=RAC(i,j)*hFacC(i,j,kbot(i,j)); |  | 
|  | end |  | 
|  | end |  | 
|  | for ts=216:216:7200 |  | 
|  | eta=readbin(['run.bbl/BBLeta.' myint2str(ts,10) '.data'],[25 15]); |  | 
| 55 | tendS=readbin(['run.bbl/BBLtendS.' myint2str(ts,10) '.data'],[25 15]); | tendS=readbin(['run.bbl/BBLtendS.' myint2str(ts,10) '.data'],[25 15]); | 
| 56 | tmp=RAC.*tendS; | mypcolor(tendS'); caxis([-1 1]*3e-9), thincolorbar | 
| 57 | disp([ts sum(tmp(:))]), pause(1) | title('bottom salinity tendency due to bbl') | 
| 58 |  | subplot(326) | 
| 59 |  | mypcolor(s3'-s2'); thincolorbar | 
| 60 |  | title('bbl salinity minus bottom salinity'), pause | 
| 61 | end | end |