/[MITgcm]/MITgcm/verification/offline_exf_seaice/input/gendata.m
ViewVC logotype

Diff of /MITgcm/verification/offline_exf_seaice/input/gendata.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.2 by gforget, Thu Dec 27 14:10:03 2012 UTC revision 1.3 by jmc, Wed Jan 9 22:10:20 2013 UTC
# Line 1  Line 1 
1    
2  kwr=1;  kwr=1;
3  nx=80; ny=42; nr=3; nt=2;  nx=80; ny=42; nr=3; nt=1;
4    
5  xc=[1:nx]; xc=xc-mean(xc);  xc=[1:nx]; xc=xc-mean(xc);
6  yc=[1:ny]-.5;  yc=[1:ny]-.5;
# Line 74  end Line 74  end
74  %end  %end
75  %------------------------------------------------------  %------------------------------------------------------
76    
77  namf='edge100.bin'; w0=1.;  namf='ice0_area.bin'; iceC0=1.;
78  var=w0*ones(nx,ny);  iceConc=iceC0*ones(nx,ny); iceConc(:,1)=0;
79  var(:,2)=0*var(:,end);  iceConc(:,2)=0.00*iceC0;
80  var(:,3)=0.01*var(:,end-1);  iceConc(:,3)=0.10*iceC0;
81  var(:,4)=0.1*var(:,end-2);  iceConc(:,end)  =0.00*iceC0;
82  var(:,end)=0*var(:,end);  iceConc(:,end-1)=0.01*iceC0;
83  var(:,end-1)=0.01*var(:,end-1);  if kwr > 0,
 var(:,end-2)=0.1*var(:,end-2);  
 if kwr >0,  
84   fprintf('write to file: %s\n',namf);   fprintf('write to file: %s\n',namf);
85   fid=fopen(namf,'w','b'); fwrite(fid,var,'real*8'); fclose(fid);   fid=fopen(namf,'w','b'); fwrite(fid,iceConc,'real*8'); fclose(fid);
86  end  end
87    
88  namf='edge+20.bin'; w0=0.2;  namf='ice0_heff.bin'; iceH0=0.2;
89  var=w0*ones(nx,ny);  iceVol=iceConc*iceH0;
90  var(:,2)=0*var(:,end);  if kwr > 0,
 var(:,3)=0.01*var(:,end-1);  
 var(:,4)=0.1*var(:,end-2);  
 var(:,end)=0*var(:,end);  
 var(:,end-1)=0.01*var(:,end-1);  
 var(:,end-2)=0.1*var(:,end-2);  
 if kwr >0,  
91   fprintf('write to file: %s\n',namf);   fprintf('write to file: %s\n',namf);
92   fid=fopen(namf,'w','b'); fwrite(fid,var,'real*8'); fclose(fid);   fid=fopen(namf,'w','b'); fwrite(fid,iceVol,'real*8'); fclose(fid);
93  end  end
94    
95  %------------------------------------------------------  %------------------------------------------------------
96    
   
97  dsw0=100;  dsw0=100;
98  namf=['dsw_',int2str(dsw0),'.bin'];  namf=['dsw_',int2str(dsw0),'.bin'];
99  fld=dsw0*ones(nx,ny,nt);  fld=dsw0*ones(nx,ny,nt);
# Line 111  if kwr > 0, Line 102  if kwr > 0,
102   fid=fopen(namf,'w','b'); fwrite(fid,fld,'real*8'); fclose(fid);   fid=fopen(namf,'w','b'); fwrite(fid,fld,'real*8'); fclose(fid);
103  end  end
104    
105  dlw0=250;  dlw0=250;
106  namf=['dlw_',int2str(dlw0),'.bin'];  namf=['dlw_',int2str(dlw0),'.bin'];
107  fld=dlw0*ones(nx,ny,nt);  fld=dlw0*ones(nx,ny,nt);
108  if kwr > 0,  if kwr > 0,
# Line 151  namf='socn.bin'; Line 142  namf='socn.bin';
142  %end;  %end;
143    
144  muTf = 5.4e-2;  muTf = 5.4e-2;
145  tfreeze=-muTf*sCst;  tfreeze=-muTf*sCst;
146  fprintf('T-freeze = %10.6f\n',tfreeze);  fprintf('T-freeze = %10.6f\n',tfreeze);
147  to_y=(yc-2)/ny;  %- parabolic profile in Y, max @ j=4, min @ j=ny, amplitude=1.K
148    to_y=(yc-3.5)/(ny-4);
149  to_y=tfreeze+0.5-to_y.*to_y;  to_y=tfreeze+0.5-to_y.*to_y;
150      mnV=min(to_y); MxV=max(to_y); Avr=mean(to_y(2:end));
151      fprintf(' SST* av,mn,Mx: %9.6f , %9.6f , %9.6f , %9.6f\n',Avr,mnV,MxV,MxV-mnV);
152  to=repmat(to_y,[nx 1 nt]);  to=repmat(to_y,[nx 1 nt]);
153  namf='tocn.bin';  namf='tocn.bin';
154  if kwr > 0,  if kwr > 0,
# Line 203  dewPt=-cvapor_exp./log(dewPt); Line 197  dewPt=-cvapor_exp./log(dewPt);
197  figure(2);clf;  figure(2);clf;
198  subplot(211)  subplot(211)
199  plot(xc,ta_x-cel2K,'r-'); hold on;  plot(xc,ta_x-cel2K,'r-'); hold on;
200  plot(xc,dewPt-cel2K,'b-');  plot(xc,dewPt-cel2K,'b-');
201  plot(xc,tfreeze*ones(nx,1),'k-');  plot(xc,tfreeze*ones(nx,1),'k-');
202  hold off;  hold off;
203  AA=axis; axis([-nx/2 nx/2 AA(3:4)]);  AA=axis; axis([-nx/2 nx/2 AA(3:4)]);
204  legend('ta','dew');  legend('ta','dew');
# Line 212  grid Line 206  grid
206  title(['del-Temp-X= ',int2str(dtx),' ; RH= ',int2str(rh),' ; Air Temp (^oC)']);  title(['del-Temp-X= ',int2str(dtx),' ; RH= ',int2str(rh),' ; Air Temp (^oC)']);
207  subplot(212)  subplot(212)
208  plot(yc,to_y,'b-'); hold on;  plot(yc,to_y,'b-'); hold on;
209  plot(yc,tfreeze*ones(ny,1),'k-');  plot(yc,tfreeze*ones(ny,1),'k-');
210  hold off;  hold off;
211  AA=axis; axis([0 ny AA(3:4)]);  AA=axis; axis([0 ny AA(3:4)]);
212  grid  grid
213  title('Ocean Temp ^oC');  title('Ocean Temp ^oC');
214    
215    %--
216    
217    figure(3);clf;
218    subplot(311)
219    var=iceConc; ccB=[-1 12]/10;
220    imagesc(xc,yc,var'); set(gca,'YDir','normal');
221    caxis(ccB);
222    %change_colmap(-1);
223    colorbar;
224    title('Ice Concentration in Channel');
225    
226    subplot(312)
227    var=iceVol; ccB=[-1 12]/50;
228    imagesc(xc,yc,var'); set(gca,'YDir','normal');
229    caxis(ccB);
230    %change_colmap(-1);
231    colorbar;
232    title('Effective ice thickness in Channel');
233    
234    subplot(313)
235    var=iceConc(1,:);
236    %plot(yc,var,'b-x'); hold on;
237    semilogy(yc,var,'b-x'); hold on;
238    var=iceVol(1,:);
239    %plot(yc,var,'r-x'); hold off;
240    semilogy(yc,var,'r-x'); hold on;
241    AA=axis; axis([0 ny [0 2]*iceC0]);
242    grid
243    legend('iceC','hEff','Location','South');
244    title('Initial ice in Channel : y-section');
245    %--

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.22