Commit ded89f24 authored by Dany Dumont's avatar Dany Dumont
Browse files

datO > dat0 dans sdm (variable provenant de wind.mat)

parent cb069dfb
......@@ -45,7 +45,8 @@ function [data] = sdm(modelID,startdate,enddate,lat1,lon1)
%% Path for input files
datadir = '/Users/dany/Documents/MATLAB/sdm/data';
%datadir = '/Users/dany/Documents/MATLAB/sdm/data';
datadir = '/home/dumoda01/matlab/sdm/data';
if ~exist(datadir,'dir')
disp(' Error : the specified input directory does not exist.')
disp(' Please specify an existing directory that contains')
......@@ -120,8 +121,8 @@ switch modelID
return
end
nstart = find(datO <= startdate);
nend = find(datO <= enddate);
nstart = find(dat0 <= startdate);
nend = find(dat0 <= enddate);
nstart = nstart(end);
nend = nend(end);
......@@ -309,14 +310,14 @@ switch modelID
if ~isempty(I)
[~,~,~,Ut(:,i,j)] = t_tide(UE(:,i,j),int);
else
Ut(:,i,j) = nan.*ones(length(dat),1);
Ut(:,i,j) = nan.*ones(length(dat0),1);
end
end
end
% Ageostrophic currents
[datO,LON,LAT,ug,vg] = geos(dat,wlev,lon,lat);
[dat0,LON,LAT,ug,vg] = geos(dat0,wlev,lon,lat);
Ug = ug + sqrt(-1)*vg;
Uag = UE - Ug - Ut;
......@@ -355,8 +356,8 @@ switch modelID
uE0 = real(UE0);
vE0 = imag(UE0);
nstart = find(datO <= startdate); % date1 est la date de debut de derive du spot
nend = find(datO <= enddate); % date2 est la date de fin de derive du spot (voir tr_compare)
nstart = find(dat0 <= startdate); % date1 est la date de debut de derive du spot
nend = find(dat0 <= enddate); % date2 est la date de fin de derive du spot (voir tr_compare)
tic
for n = nstart:nend-1
......@@ -406,7 +407,7 @@ switch modelID
end
time = datO(nstart:nend);
time = dat0(nstart:nend);
[lon,lat,~] = xpyp2ll(iii,k,'gsl5km');
if numel(time) ~= numel(lat)
......@@ -443,14 +444,14 @@ switch modelID
if ~isempty(I)
[~,~,~,Ut(:,i,j)] = t_tide(UE(:,i,j),int);
else
Ut(:,i,j) = nan.*ones(length(dat),1);
Ut(:,i,j) = nan.*ones(length(dat0),1);
end
end
end
% ageostrophic currents
[datO,LON,LAT,ug,vg] = geos(dat,wlev,lon,lat);
[dat0,LON,LAT,ug,vg] = geos(dat0,wlev,lon,lat);
Ug = ug + sqrt(-1)*vg;
Uag = UE - Ug - Ut;
......@@ -514,8 +515,8 @@ switch modelID
uE0 = real(UE0);
vE0 = imag(UE0);
nstart = find(datO <= startdate);
nend = find(datO <= enddate);
nstart = find(dat0 <= startdate);
nend = find(dat0 <= enddate);
tic
for n = nstart:nend-1
......@@ -565,7 +566,7 @@ switch modelID
end
time = datO(nstart:nend);
time = dat0(nstart:nend);
[lon,lat,~] = xpyp2ll(iii,k,'gsl5km');
if numel(time) ~= numel(lat)
......@@ -606,14 +607,14 @@ switch modelID
if ~isempty(I)
[~,~,~,Ut(:,i,j)] = t_tide(UE(:,i,j),int);
else
Ut(:,i,j) = nan.*ones(length(dat),1);
Ut(:,i,j) = nan.*ones(length(dat0),1);
end
end
end
% Ageostrophic currents
[datO,LON,LAT,ug,vg] = geos(dat,wlev,lon,lat);
[dat0,LON,LAT,ug,vg] = geos(dat0,wlev,lon,lat);
Ug = ug + sqrt(-1).*vg;
Uag = UE - Ug - Ut;
......@@ -677,8 +678,8 @@ switch modelID
uE0 = real(UE0);
vE0 = imag(UE0);
nstart = find(datO <= startdate);
nend = find(datO <= enddate);
nstart = find(dat0 <= startdate);
nend = find(dat0 <= enddate);
tic
for n = nstart:nend-1
......@@ -718,7 +719,7 @@ switch modelID
end
time = datO(nstart:nend);
time = dat0(nstart:nend);
[lon,lat,~] = xpyp2ll(iii,k,'gsl5km');
if numel(time) ~= numel(lat)
......@@ -759,14 +760,14 @@ switch modelID
if ~isempty(I)
[~,~,~,Ut(:,i,j)] = t_tide(Uc(:,i,j),int);
else
Ut(:,i,j) = nan.*ones(length(dat),1);
Ut(:,i,j) = nan.*ones(length(dat0),1);
end
end
end
% ageostrophic currents
[datO,LON,LAT,ug,vg] = geos(dat,wlev,lon,lat);
[dat0,LON,LAT,ug,vg] = geos(dat0,wlev,lon,lat);
Ug = ug + sqrt(-1).*vg;
Uag = UE - Ug - Ut;
......@@ -828,8 +829,8 @@ switch modelID
uE0 = real(UE0);
vE0 = imag(UE0);
nstart = find(datO <= startdate);
nend = find(datO <= enddate);
nstart = find(dat0 <= startdate);
nend = find(dat0 <= enddate);
tic
for n = nstart:nend-1
......@@ -888,7 +889,7 @@ switch modelID
end
time = datO(nstart:nend);
time = dat0(nstart:nend);
[lon,lat,~] = xpyp2ll(iii,k,'gsl5km');
if numel(time) ~= numel(lat)
......@@ -900,4 +901,4 @@ switch modelID
data = [time,lon,lat];
end
end
\ No newline at end of file
end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment