| 1 |
% This is a script that executes a series of commands for |
| 2 |
% extracting Levitus data, interpolating, and gap-filling |
| 3 |
% according to the mask-file generated by "topo.m". |
| 4 |
% |
| 5 |
% Uses data files: bathymetry.bin pmask.bin |
| 6 |
% Creates data files: lev_clim_*.bin lev_monthly_*.bin |
| 7 |
% Creates arrays: n/a |
| 8 |
% Uses m-scripts: setgrid grid_sphere finegrid gen_hxhy xyrecur_* |
| 9 |
% hfac |
| 10 |
% |
| 11 |
% Created 08/15/99 by adcroft@mit.edu |
| 12 |
% Modified 11/09/99 by adcroft@mit.edu |
| 13 |
% Maintained by adcroft@mit.edu, abiastoch@ucsd.edu |
| 14 |
|
| 15 |
clear all |
| 16 |
format compact |
| 17 |
more off |
| 18 |
|
| 19 |
load FMT |
| 20 |
|
| 21 |
disp('Combining climatological and monthly T'); |
| 22 |
load tc |
| 23 |
load tm |
| 24 |
tc=tc2; |
| 25 |
TM=mean(tm2,4); |
| 26 |
for m=1:12; |
| 27 |
tc(:,:,:,m)=tc2; |
| 28 |
for k=1:size(tm2,3); |
| 29 |
tc(:,:,k,m)=tc(:,:,k,m)+tm2(:,:,k,m)-TM(:,:,k); |
| 30 |
end |
| 31 |
end |
| 32 |
clear tm tm2 TM tc2 k m |
| 33 |
|
| 34 |
disp('Combining climatological and monthly S'); |
| 35 |
load sc |
| 36 |
load sm |
| 37 |
sc=sc2; |
| 38 |
SM=mean(sm2,4); |
| 39 |
for m=1:12; |
| 40 |
sc(:,:,:,m)=sc2; |
| 41 |
for k=1:size(sm2,3); |
| 42 |
sc(:,:,k,m)=sc(:,:,k,m)+sm2(:,:,k,m)-SM(:,:,k); |
| 43 |
end |
| 44 |
end |
| 45 |
clear sm sm2 SM sc2 k m |
| 46 |
|
| 47 |
disp('Correcting annual cycle for linear interpolation') |
| 48 |
tc2=correct_for_linintep(tc); |
| 49 |
sc2=correct_for_linintep(sc); |
| 50 |
|
| 51 |
% interpolate to Jan01 and save initial conditions for T/S |
| 52 |
ti = mean(tc2(:,:,:,[1 end]),4); |
| 53 |
si = mean(sc2(:,:,:,[1 end]),4); |
| 54 |
wrda('lev_t.init',mdsiocompact(ti),1,fmt,Ieee); |
| 55 |
wrda('lev_s.init',mdsiocompact(si),1,fmt,Ieee); |
| 56 |
|
| 57 |
wrda('lev_t.bin',mdsiocompact(tc2),1,fmt,Ieee); |
| 58 |
wrda('lev_s.bin',mdsiocompact(sc2),1,fmt,Ieee); |
| 59 |
wrda('lev_sst.bin',mdsiocompact(squeeze(tc2(:,:,1,:))),1,fmt,Ieee); |
| 60 |
wrda('lev_sss.bin',mdsiocompact(squeeze(sc2(:,:,1,:))),1,fmt,Ieee); |
| 61 |
|
| 62 |
% $$$ load HN |
| 63 |
% $$$ wrda('bathymetry.bin',hn,1,fmt,Ieee); |
| 64 |
% $$$ |
| 65 |
% $$$ load ZN |
| 66 |
% $$$ wrda('shelfice_bath.bin',hnz,1,fmt,Ieee); |
| 67 |
% $$$ wrda('shelfice_topo.bin',zn,1,fmt,Ieee); |
| 68 |
|