33 |
nk=length(mygrid.RC);kk=ones(1,nk); |
nk=length(mygrid.RC);kk=ones(1,nk); |
34 |
np=length(MITprofCur.ii);pp=ones(np,1); |
np=length(MITprofCur.ii);pp=ones(np,1); |
35 |
ind2prof=sub2ind(size(atlas.T{1}),MITprofCur.ii*kk,MITprofCur.jj*kk,pp*[1:nk],MITprofCur.imonth*kk); |
ind2prof=sub2ind(size(atlas.T{1}),MITprofCur.ii*kk,MITprofCur.jj*kk,pp*[1:nk],MITprofCur.imonth*kk); |
36 |
Tatlas=atlas.T{1}(ind2prof); Tatlas=interp1(-mygrid.RC',Tatlas',MITprofCur.prof_depth)'; |
|
37 |
Satlas=atlas.S{1}(ind2prof); Satlas=interp1(-mygrid.RC',Satlas',MITprofCur.prof_depth)'; |
I=find(~isnan(ind2prof)); |
38 |
|
Tatlas=ind2prof*NaN;Tatlas(I)=atlas.T{1}(ind2prof(I)); Tatlas(Tatlas==0)=NaN; |
39 |
|
Satlas=ind2prof*NaN;Satlas(I)=atlas.S{1}(ind2prof(I)); Satlas(Satlas==0)=NaN; |
40 |
|
|
41 |
|
warning off |
42 |
|
Tatlas=interp1(-mygrid.RC',Tatlas',MITprofCur.prof_depth)'; |
43 |
|
Satlas=interp1(-mygrid.RC',Satlas',MITprofCur.prof_depth)'; |
44 |
|
warning on |
45 |
|
|
46 |
% record values |
% record values |
47 |
MITprofCur=setfield(MITprofCur,['prof_T_' model],Tatlas'); |
MITprofCur=setfield(MITprofCur,['prof_T_' model],Tatlas'); |