/[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.4 by jmc, Fri Mar 7 22:30:26 2014 UTC
# Line 1  Line 1 
1    
2  kwr=1;  kwr=1; kprt=0;
3  nx=80; ny=42; nr=3; nt=2;  kwr=0; kprt=0;
4    nx=80; ny=42; nr=3; nt=1;
5    
6  xc=[1:nx]; xc=xc-mean(xc);  xc=[1:nx]; xc=xc-mean(xc);
7  yc=[1:ny]-.5;  yc=[1:ny]-.5;
# Line 74  end Line 75  end
75  %end  %end
76  %------------------------------------------------------  %------------------------------------------------------
77    
78  namf='edge100.bin'; w0=1.;  namf='ice0_area.bin'; iceC0=1.;
79  var=w0*ones(nx,ny);  iceConc=iceC0*ones(nx,ny); iceConc(:,1)=0;
80  var(:,2)=0*var(:,end);  iceConc(:,2)=0.00*iceC0;
81  var(:,3)=0.01*var(:,end-1);  iceConc(:,3)=0.10*iceC0;
82  var(:,4)=0.1*var(:,end-2);  iceConc(:,end)  =0.00*iceC0;
83  var(:,end)=0*var(:,end);  iceConc(:,end-1)=0.01*iceC0;
84  var(:,end-1)=0.01*var(:,end-1);  if kwr > 0,
 var(:,end-2)=0.1*var(:,end-2);  
 if kwr >0,  
85   fprintf('write to file: %s\n',namf);   fprintf('write to file: %s\n',namf);
86   fid=fopen(namf,'w','b'); fwrite(fid,var,'real*8'); fclose(fid);   fid=fopen(namf,'w','b'); fwrite(fid,iceConc,'real*8'); fclose(fid);
87  end  end
88    
89  namf='edge+20.bin'; w0=0.2;  namf='ice0_heff.bin'; iceH0=0.2;
90  var=w0*ones(nx,ny);  iceVol=iceConc*iceH0;
91  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,  
92   fprintf('write to file: %s\n',namf);   fprintf('write to file: %s\n',namf);
93   fid=fopen(namf,'w','b'); fwrite(fid,var,'real*8'); fclose(fid);   fid=fopen(namf,'w','b'); fwrite(fid,iceVol,'real*8'); fclose(fid);
94  end  end
95    
96  %------------------------------------------------------  %------------------------------------------------------
97    
   
98  dsw0=100;  dsw0=100;
99  namf=['dsw_',int2str(dsw0),'.bin'];  namf=['dsw_',int2str(dsw0),'.bin'];
100  fld=dsw0*ones(nx,ny,nt);  fld=dsw0*ones(nx,ny,nt);
# Line 111  if kwr > 0, Line 103  if kwr > 0,
103   fid=fopen(namf,'w','b'); fwrite(fid,fld,'real*8'); fclose(fid);   fid=fopen(namf,'w','b'); fwrite(fid,fld,'real*8'); fclose(fid);
104  end  end
105    
106  dlw0=250;  dlw0=250;
107  namf=['dlw_',int2str(dlw0),'.bin'];  namf=['dlw_',int2str(dlw0),'.bin'];
108  fld=dlw0*ones(nx,ny,nt);  fld=dlw0*ones(nx,ny,nt);
109  if kwr > 0,  if kwr > 0,
# Line 151  namf='socn.bin'; Line 143  namf='socn.bin';
143  %end;  %end;
144    
145  muTf = 5.4e-2;  muTf = 5.4e-2;
146  tfreeze=-muTf*sCst;  tfreeze=-muTf*sCst;
147  fprintf('T-freeze = %10.6f\n',tfreeze);  fprintf('T-freeze = %10.6f\n',tfreeze);
148  to_y=(yc-2)/ny;  %- parabolic profile in Y, max @ j=4, min @ j=ny, amplitude=1.K
149    to_y=(yc-3.5)/(ny-4);
150  to_y=tfreeze+0.5-to_y.*to_y;  to_y=tfreeze+0.5-to_y.*to_y;
151      mnV=min(to_y); MxV=max(to_y); Avr=mean(to_y(2:end));
152      fprintf(' SST* av,mn,Mx: %9.6f , %9.6f , %9.6f , %9.6f\n',Avr,mnV,MxV,MxV-mnV);
153  to=repmat(to_y,[nx 1 nt]);  to=repmat(to_y,[nx 1 nt]);
154  namf='tocn.bin';  namf='tocn.bin';
155  if kwr > 0,  if kwr > 0,
# Line 201  dewPt=(qa_x*atmrho)/cvapor_fac; Line 196  dewPt=(qa_x*atmrho)/cvapor_fac;
196  dewPt=-cvapor_exp./log(dewPt);  dewPt=-cvapor_exp./log(dewPt);
197    
198  figure(2);clf;  figure(2);clf;
199  subplot(211)  subplot(311)
200  plot(xc,ta_x-cel2K,'r-'); hold on;  P(1)=plot(xc,ta_x-cel2K,'r-'); hold on;
201  plot(xc,dewPt-cel2K,'b-');  P(2)=plot(xc,dewPt-cel2K,'b-');
202  plot(xc,tfreeze*ones(nx,1),'k-');  P(3)=plot(xc,tfreeze*ones(nx,1),'k-');
203  hold off;  set(P,'LineWidth',1);
204  AA=axis; axis([-nx/2 nx/2 AA(3:4)]);  hold off; AA=axis;
205    axis([-nx/2 nx/2 AA(3:4)]);
206  legend('ta','dew');  legend('ta','dew');
207  grid  grid
208  title(['del-Temp-X= ',int2str(dtx),' ; RH= ',int2str(rh),' ; Air Temp (^oC)']);  xlabel('X')
209  subplot(212)  title(['Air Temp (^oC): del-Temp-X = ',int2str(dtx),' , RH= ',int2str(rh)]);
210  plot(yc,to_y,'b-'); hold on;  subplot(312)
211  plot(yc,tfreeze*ones(ny,1),'k-');  P(1)=plot(yc,to_y,'b-'); hold on;
212  hold off;  P(2)=plot(yc,tfreeze*ones(ny,1),'k-');
213  AA=axis; axis([0 ny AA(3:4)]);  set(P,'LineWidth',1);
214    hold off; AA=axis;
215    L=line([1 1],AA(3:4)); set(L,'LineWidth',2.,'Color',[0 0 0]);
216    axis([0 ny AA(3:4)]);
217  grid  grid
218    xlabel('Y')
219  title('Ocean Temp ^oC');  title('Ocean Temp ^oC');
220    
221    subplot(313)
222    var=iceConc(1,:);
223    P(1)=semilogy(yc,var,'b-x'); hold on;
224    %plot(yc,var,'b-x'); hold on;
225    var=iceVol(1,:);
226    P(2)=semilogy(yc,var,'r-x');
227    %plot(yc,var,'r-x');
228    set(P,'LineWidth',1);
229    hold off; AA=axis;
230    L=line([1 1],AA(3:4)); set(L,'LineWidth',2.,'Color',[0 0 0]);
231    axis([0 ny [0 2]*iceC0]);
232    grid
233    xlabel('Y')
234    legend('iceC','hEff','Location','South');
235    title('Initial ice in Channel : y-section');
236    %-----
237    if kprt == 1, f=2;
238     namfig=sprintf('forcing_%2.2i',f);
239     fprintf([' print fig= %2i to file: ',namfig,' '],f);
240     set(f,'PaperOrientation','portrait')
241    %set(f,'PaperPosition',[0.25 1.5 6. 8.]);
242     set(f,'PaperPosition',[0.25 1.5 5.25 7.]);
243     print(f,'-depsc2',namfig); fprintf('\n');
244    end
245    %-----
246    
247    figure(3);clf;
248    subplot(311)
249    var=iceConc; ccB=[-1 12]/10;
250    imagesc(xc,yc,var'); set(gca,'YDir','normal');
251    caxis(ccB);
252    %change_colmap(-1);
253    colorbar;
254    title('Ice Concentration in Channel');
255    
256    subplot(312)
257    var=iceVol; ccB=[-1 12]/50;
258    imagesc(xc,yc,var'); set(gca,'YDir','normal');
259    caxis(ccB);
260    %change_colmap(-1);
261    colorbar;
262    title('Effective ice thickness in Channel');
263    
264    subplot(313)
265    var=iceConc(1,:);
266    %plot(yc,var,'b-x'); hold on;
267    semilogy(yc,var,'b-x'); hold on;
268    var=iceVol(1,:);
269    %plot(yc,var,'r-x'); hold off;
270    semilogy(yc,var,'r-x'); hold on;
271    AA=axis; axis([0 ny [0 2]*iceC0]);
272    grid
273    legend('iceC','hEff','Location','South');
274    title('Initial ice in Channel : y-section');
275    %-----
276    
277    return

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

  ViewVC Help
Powered by ViewVC 1.1.22