Hello,
I am trying to create a "BINARY WINDS FILE" from an existing SELAFIN file with the help of Thomas Benson's Matlab routines.
I have first asked for help in the TOMAWAC section, in vain.
Basically, I apply interpolated U and V wind velocities on the grid points and increment the timesteps. See Matlab code below:
load('wnd_export2.mat')
load('xy2_utm58s.xyz')
X=xy2_utm58s(:,1);
Y=xy2_utm58s(:,2);
%
n = telheadr('WACRES');
fid = telheadw(n,'new_wind_file.slf');
for i=1:length(time)
windut=squeeze(wind_u(:,:,i));
windvt=squeeze(wind_v(:,:,i));
Fu = scatteredInterpolant(X,Y,windut(:));
uq = Fu(n.XYZ(:,1),n.XYZ(:,2));
Fv = scatteredInterpolant(X,Y,windvt(:));
vq = Fv(n.XYZ(:,1),n.XYZ(:,2));
n.timestep=int32(i);
n.AT=int32((i-1)*3600);
n.RESULT(:,1)=int32(uq);
n.RESULT(:,2)=int32(vq);
fid = telstepw(n,fid);
end
fclose all;
I can read fine the modified SELAFIN wind file in Bluekenue (the wind evolves in space and time) but Tomawac only recognizes the last time step when I use it as "BINARY WINDS FILE" (with WINDS FILE FORMAT = 3).
Does anyone have ever used Thomas Benson's Matlab routines (or similar) to create wind files ?
Many thanks in advance.
Alexis