/[MITgcm]/MITgcm_contrib/shelfice_remeshing/CLEAN/input/gendata_vero.m
ViewVC logotype

Diff of /MITgcm_contrib/shelfice_remeshing/CLEAN/input/gendata_vero.m

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

revision 1.1 by dgoldberg, Mon Dec 7 17:07:05 2015 UTC revision 1.2 by dgoldberg, Mon Jan 18 10:37:22 2016 UTC
# Line 8  Line 8 
8    
9  % Dimensions of grid  % Dimensions of grid
10  nx=3;  nx=3;
11  ny=200;  ny=400;
12  nz=100;  nz=100;
13  delz = 10;  delz = 10;
14    
15  hfacMin = 0.2;  hfacMin = 0.2;
16    
17  dlat = 0.125/16; dy=dlat;  dlat = 0.125/32; dy=dlat;
18  dlon = 0.125/4; dx=dlon;  dlon = 0.125/4; dx=dlon;
19    
20  %eos = 'linear';  %eos = 'linear';
# Line 142  icetopo = ones(nx,1)*B; Line 142  icetopo = ones(nx,1)*B;
142  icetopo(:,101:end)=0;  icetopo(:,101:end)=0;
143    
144  % use streamice generated thickness  % use streamice generated thickness
145   fid = fopen('h_init.box','r','b'); hinit=fread(fid,[3 200],'real*8'); fclose(fid);   fid = fopen('hinit3.box','r','b'); hinit=fread(fid,[3 400],'real*8'); fclose(fid);
146  %hinit(:,1:5)=550;  %hinit(:,1:5)=550;
147  % load hinit  % load hinit
148  icetopo = -917/1028*hinit;  icetopo = -917/1028*hinit;
149    
150          for i =1:3
151           for j=1:400
152         if icetopo(i,j)<-990
153            icetopo(i,j)=-990;
154    
155        end
156    end
157    end
158  % adjust topo so that no hfac is smaller than hfacMin  % adjust topo so that no hfac is smaller than hfacMin
159    
160  for ix=1:nx  for ix=1:nx
161    for iy=1:ny    for iy=1:ny
162      k=max(find(abs(zg)<abs(icetopo(ix,iy))));      k=max(find(abs(zg)<abs(icetopo(ix,iy))));
163        %    
164      if(~isempty(k))      if(~isempty(k))
165    %
166    %
167      hfacTemp = (icetopo(ix,iy) - (-zg(k+1)))/delz;      hfacTemp = (icetopo(ix,iy) - (-zg(k+1)))/delz;
168        %    
169      if (hfacTemp < hfacMin)      if (hfacTemp < hfacMin)
170          if (hfacTemp < hfacMin/2)          if (hfacTemp < hfacMin/2)
171              hfacTemp = 0;              hfacTemp = 0;
# Line 177  for ix=1:nx Line 184  for ix=1:nx
184            
185    end    end
186  end  end
187          for i =1:3
188           for j=1:400
189         if icetopo(i,j)<-990
190            icetopo(i,j)=-990;
191    
192        end
193    end
194    end
195  % phi anomaly (relative to hydrostatic with rho_const) at icetopo  % phi anomaly (relative to hydrostatic with rho_const) at icetopo
196    
197  phi0surf = zeros(nx,ny);  phi0surf = zeros(nx,ny);
# Line 207  mass = phi0surf / gravity - rhoConst * i Line 221  mass = phi0surf / gravity - rhoConst * i
221  %use streamicegenerated thickness  %use streamicegenerated thickness
222    
223  %mass = hinit * 917;  %mass = hinit * 917;
224  icetopo(:,1)=-750;  %icetopo(:,1)=-1000;
225  fid = fopen('shelftopo.pig.bin','w','b'); fwrite(fid,icetopo,'real*8'); fclose(fid);  fid = fopen('shelftopo.pig.bin','w','b'); fwrite(fid,icetopo,'real*8'); fclose(fid);
226  fid = fopen('shelficemassinit.bin','w','b'); fwrite(fid,mass,'real*8'); fclose(fid);  fid = fopen('shelficemassinit.bin','w','b'); fwrite(fid,mass,'real*8'); fclose(fid);
227  fid = fopen('pload.pig.jmd95z','w','b'); fwrite(fid,phi0surf,'real*8'); fclose(fid);  fid = fopen('pload.pig.jmd95z','w','b'); fwrite(fid,phi0surf,'real*8'); fclose(fid);
# Line 244  for ix=1:nx Line 258  for ix=1:nx
258  end  end
259    
260    
261   icetopo2(:,1)=-750;   icetopo2(:,1)=-1000;
262  fid = fopen('shelftopo.round.bin','w','b'); fwrite(fid,icetopo2,'real*8'); fclose(fid);  fid = fopen('shelftopo.round.bin','w','b'); fwrite(fid,icetopo2,'real*8'); fclose(fid);
263  fid = fopen('etainit.round.bin','w','b'); fwrite(fid,etainit,'real*8'); fclose(fid);  fid = fopen('etainit.round.bin','w','b'); fwrite(fid,etainit,'real*8'); fclose(fid);

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

  ViewVC Help
Powered by ViewVC 1.1.22