Back to home page

MITgcm

 
 

    


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

view on githubraw file Latest commit b2b17f3a on 2018-02-27 21:53:48 UTC
e8dedbdd06 Alis*0001 x=rdmds('XC');x=x(:,1)/1e3;     % X coordinate (km)
                0002 y=rdmds('YC');y=y(1,:)/1e3;     % Y coordinate (km)
                0003 t0=rdmds('T',0);                % Initial T
                0004 dz=144*rdmds('hFacC');          % Level thicknesses
                0005 D=sum(dz,3);                    % Total water depth
                0006 D=max(D,.001);                  % avoid division by zero later
                0007 freq=100;                       % Output frequency
                0008 
                0009 figure(1)                       % Create a figure window
                0010 pos=get(gcf,'Position');        % Set aspect ratio and size of image
                0011 set(gcf,'Position',[pos(1:2) 320*[1 .75]]);
                0012 set(gcf,'Color',[1 1 1]);       % White background for movie
                0013 mov=avifile('dome.avi');        % Name of AVI movie file
                0014 mov.Quality=100; mov.Fps=10;    % Quality and frames per second
                0015 
                0016 [t,nits]=rdmds('T',Inf);        % Read last snap-shot
                0017 nits=120*freq;
                0018 
                0019 m=t; m(find(m~=0))=1;           % Create a mask
                0020 k=max(sum(m,3),1);              % Index of bottom level
                0021 [i,j]=ndgrid(1:length(x),1:length(y));  % I,J indices
                0022 ijk=sub2ind(size(t),i,j,k);     % I,J,K indices of bottom level
                0023 
                0024 
                0025 for iter=freq:freq:nits;
                0026  s=rdmds('S',iter);             % Read snap-shot
                0027 
                0028  subplot(211)
                0029  pcolor(x,y, sq(s(ijk))' );     % Plot tracer at ocean bottom
                0030  shading flat
                0031  caxis([1 2])
                0032  colorbar
                0033  title('Tracer concentration on bottom')
                0034 
                0035  subplot(212)
                0036  pcolor(x,y, sq( sum(s.*dz,3)./D )' );  % Plot tracer inventory
                0037  shading flat
                0038  caxis([1 1.6])
                0039  colorbar
                0040  title('Tracer inventory (vertical average)')
                0041 
                0042  drawnow
                0043  frame=getframe(gcf); mov=addframe(mov,frame);  % Add to movie
                0044 end
                0045 
                0046 mov=close(mov);                 % Finish writing the movie