Back to home page

MITgcm

 
 

    


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

view on githubraw file Latest commit 57e94980 on 2020-01-16 01:12:06 UTC
88ce344b0b Jean*0001 
                0002 % reduce the size of the domain by removing "land points"
                0003 %- new domain = j=8:30 of old domain (j=1:31)
                0004 %  here we apply this size reduction to input files.
                0005 
                0006 %- old size:
                0007 dim1=[120 31 29];
                0008 %- new size: 
                0009 dim2=dim1;
                0010 dim2(2)=length([8:30]);
                0011 
                0012 b0=rdda('bathyPol.bin',dim1(1:2),1,'real*4','b');
                0013 b1=b0(:,[8:30]);
                0014 size(b1)
                0015 fid=fopen('bathyPolR.bin','w','b');
                0016 fwrite(fid,b1,'real*4'); fclose(fid);
                0017 
                0018 t0=rdda('thetaPol.bin',dim1,1,'real*4','b');
                0019 t1=t0(:,[8:30],:);
                0020 size(t1)
                0021 fid=fopen('thetaPolR.bin','w','b');
                0022 fwrite(fid,t1,'real*4'); fclose(fid);
                0023 
                0024 return
                0025 
                0026 %- make some plots to check:
                0027 figure(1);clf;
                0028 subplot(211)
                0029 imagesc(b0');set(gca,'YDir','normal');colorbar;
                0030 subplot(212)
                0031 imagesc(b1');set(gca,'YDir','normal');colorbar;
                0032 
                0033 figure(2);clf;
                0034 subplot(211)
                0035 imagesc(t0(:,:,1)');set(gca,'YDir','normal');colorbar;
                0036 subplot(212)
                0037 imagesc(t1(:,:,1)');set(gca,'YDir','normal');colorbar;
                0038