% This is a script that executes a series of commands for % extracting Levitus data, interpolating, and gap-filling % according to the mask-file generated by "topo.m". % % Uses data files: bathymetry.bin pmask.bin % Creates data files: lev_clim_*.bin lev_monthly_*.bin % Creates arrays: n/a % Uses m-scripts: setgrid grid_sphere finegrid gen_hxhy xyrecur_* % hfac % % Created 08/15/99 by adcroft@mit.edu % Modified 11/09/99 by adcroft@mit.edu % Maintained by adcroft@mit.edu, abiastoch@ucsd.edu clear all format compact more off load FMT disp('Combining climatological and monthly T'); load tc load tm tc=tc2; TM=mean(tm2,4); for m=1:12; tc(:,:,:,m)=tc2; for k=1:size(tm2,3); tc(:,:,k,m)=tc(:,:,k,m)+tm2(:,:,k,m)-TM(:,:,k); end end clear tm tm2 TM tc2 k m disp('Combining climatological and monthly S'); load sc load sm sc=sc2; SM=mean(sm2,4); for m=1:12; sc(:,:,:,m)=sc2; for k=1:size(sm2,3); sc(:,:,k,m)=sc(:,:,k,m)+sm2(:,:,k,m)-SM(:,:,k); end end clear sm sm2 SM sc2 k m disp('Correcting annual cycle for linear interpolation') tc2=correct_for_linintep(tc); sc2=correct_for_linintep(sc); % interpolate to Jan01 and save initial conditions for T/S ti = mean(tc2(:,:,:,[1 end]),4); si = mean(sc2(:,:,:,[1 end]),4); wrda('lev_t.init',mdsiocompact(ti),1,fmt,Ieee); wrda('lev_s.init',mdsiocompact(si),1,fmt,Ieee); wrda('lev_t.bin',mdsiocompact(tc2),1,fmt,Ieee); wrda('lev_s.bin',mdsiocompact(sc2),1,fmt,Ieee); wrda('lev_sst.bin',mdsiocompact(squeeze(tc2(:,:,1,:))),1,fmt,Ieee); wrda('lev_sss.bin',mdsiocompact(squeeze(sc2(:,:,1,:))),1,fmt,Ieee); % $$$ load HN % $$$ wrda('bathymetry.bin',hn,1,fmt,Ieee); % $$$ % $$$ load ZN % $$$ wrda('shelfice_bath.bin',hnz,1,fmt,Ieee); % $$$ wrda('shelfice_topo.bin',zn,1,fmt,Ieee);