% This is a matlab script that generates the input data % variable x resolution % Initialize... clear if 0 load IBCAO_2km.mat LON=LON-90; aaa=find(LON>180); LON(aaa)=LON(aaa)-360; XC=[2:1451];YC=[1451:2900]; LON=LON(XC,YC); LAT=LAT(XC,YC); IBCAO=IBCAO(XC,YC); end prec='real*8'; ieee='b'; % Dimensions of grid nx=200; ny=1; nz=100; % Nominal depth of model (meters) H=500.0; % Horizontal resolution (m) % dx iswitch=80; dx=zeros(nx,1); for i=1:nx dx(i) = 35 + 16*tanh((iswitch-i)/50); xG(i)=sum(dx(1:i)); end Lx=sum(dx(:)) sum(dx(51:end)) plot(dx) %dy = Lx/nx writebin('dx.bin',dx,1,prec); break % dlon re = 6378137.0d0; slat=70.4; dlon2dx=re*2*pi*cosd(slat)/360; dx2dlon=1./dlon2dx; dlon=zeros(nx,1); lonG=zeros(nx+1,1); lonC=zeros(nx,1); lonG(nx+1)=-50.6; for i=nx:-1:1 dlon(i)=dx(i).*dx2dlon; lonG(i)=lonG(i+1)-dlon(i); lonC(i)=0.5*lonG(i+1)+0.5*lonG(i); end latC(1)=70.42; dlat=dlon./8; for i=1:nx-1 latC(i+1)=latC(i)-dlat(i); end latC=latC'; Llon=sum(dlon(:)); writebin('dlon.bin',dlon,1,prec); break % Interpolate bathymetry to my gridC %[tri,w]=interp_TS(lonC,latC,LON,LAT); % z = IBCAO(:).'; % ibcao_store_2d = sum(z(tri) .* w,2); % ibcao_store_2d(nx)=0.0; % writebin('bathy_store_2D.ibcao',ibcao_jks_2d,1,prec); bathy=-500*ones(200,1); bathy(nx)=0; writebin('bathy_store_2D.500',bathy,1,prec); % ICEFRONT depth and circum files frontdepth=zeros(nx,ny); frontdepth(nx-1)=bathy(nx-1); frontlength=zeros(nx,ny); frontlength(nx-1)=1./dx(nx-1); writebin('frontdepth.bin',frontdepth,1,prec); writebin('frontlength.bin',frontlength,1,prec);