more off
pi='/nobackupp1/dmenemen/llc_4320/compressed/';

f1='SSS'; f2='Salt'; bs='562551864';
f1='SST'; f2='Theta'; bs='562551864';
f1='SSU'; f2='U'; bs='561978448';
f1='SSV'; f2='V'; bs='561942588';

po=['/nobackupp2/dmenemen/llc_4320/regions/global/' f1 '/'];

for ts=228096:144:357552
    si=myint2str(ts,10); disp(si)
    fi=[pi si '/' f2 '.' si '.data.shrunk'];
    fo=[po f1 '.' si '.shrunk'];
    unix(['dd count=1 if=' fi ' of=' fo ' bs=' bs]);
end

for ts=357696:144:487152
    si=myint2str(ts,10); disp(si)
    fi=[pi si '/' f2 '.' si '.data.shrunk'];
    fo=[po f1 '.' si '.shrunk'];
    unix(['dd count=1 if=' fi ' of=' fo ' bs=' bs]);
end

for ts=487296:144:616752
    si=myint2str(ts,10); disp(si)
    fi=[pi si '/' f2 '.' si '.data.shrunk'];
    fo=[po f1 '.' si '.shrunk'];
    unix(['dd count=1 if=' fi ' of=' fo ' bs=' bs]);
end

for ts=616896:144:746352
    si=myint2str(ts,10); disp(si)
    fi=[pi si '/' f2 '.' si '.data.shrunk'];
    fo=[po f1 '.' si '.shrunk'];
    unix(['dd count=1 if=' fi ' of=' fo ' bs=' bs]);
end

for ts=746496:144:875952
    si=myint2str(ts,10); disp(si)
    fi=[pi si '/' f2 '.' si '.data.shrunk'];
    fo=[po f1 '.' si '.shrunk'];
    unix(['dd count=1 if=' fi ' of=' fo ' bs=' bs]);
end

for ts=876096:144:1005552
    si=myint2str(ts,10); disp(si)
    fi=[pi si '/' f2 '.' si '.data.shrunk'];
    fo=[po f1 '.' si '.shrunk'];
    unix(['dd count=1 if=' fi ' of=' fo ' bs=' bs]);
end

for ts=1005696:144:1135152
    si=myint2str(ts,10); disp(si)
    fi=[pi si '/' f2 '.' si '.data.shrunk'];
    fo=[po f1 '.' si '.shrunk'];
    unix(['dd count=1 if=' fi ' of=' fo ' bs=' bs]);
end

for ts=1135296:144:1264752
    si=myint2str(ts,10); disp(si)
    fi=[pi si '/' f2 '.' si '.data.shrunk'];
    fo=[po f1 '.' si '.shrunk'];
    unix(['dd count=1 if=' fi ' of=' fo ' bs=' bs]);
end

for ts=1264896:144:1394352
    si=myint2str(ts,10); disp(si)
    fi=[pi si '/' f2 '.' si '.data.shrunk'];
    fo=[po f1 '.' si '.shrunk'];
    unix(['dd count=1 if=' fi ' of=' fo ' bs=' bs]);
end

for ts=1394496:144:1492992
    si=myint2str(ts,10); disp(si)
    fi=[pi si '/' f2 '.' si '.data.shrunk'];
    fo=[po f1 '.' si '.shrunk'];
    unix(['dd count=1 if=' fi ' of=' fo ' bs=' bs]);
end


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% extract SSS, SST, SSU, and SSV surface fields using Bron's routines

cd ~dmenemen/llc_4320/regions/global
mkdir SSS
cd SSS
/home4/bcnelson/MITgcm/extract/v1.09/uncompress4320 -L 1 228096-1492992 Salt &

cd ~dmenemen/llc_4320/regions/global
mkdir SST
cd SST
/home4/bcnelson/MITgcm/extract/v1.09/uncompress4320 -L 1 228096-1492992 Theta &

cd ~dmenemen/llc_4320/regions/global
mkdir SSU
cd SSU
/home4/bcnelson/MITgcm/extract/v1.09/uncompress4320 -L 1 228096-1492992 U &

cd ~dmenemen/llc_4320/regions/global
mkdir SSV
cd SSV
/home4/bcnelson/MITgcm/extract/v1.09/uncompress4320 -L 1 228096-1492992 V &
