Welcome, Guest
Username: Password: Remember me

TOPIC: created BINARY WINDS FILE only read at last time step (AT)

created BINARY WINDS FILE only read at last time step (AT) 3 years 2 months ago #39045

  • abeudin
  • abeudin's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
Hello,

I am trying to create a "BINARY WINDS FILE" from a existing SELAFIN file (to no start from scratch) with the help of Thomas Benson's Matlab routines.

Basically, I apply interpolated U and V wind velocities on the grid points and increment the timesteps. See simple 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 the new SELAFIN (the wind file) fine in Bluekenue but Tomawac only recognizes the last time step when I use it as "BINARY WINDS FILE" (with WINDS FILE FORMAT = 3).

I am not sure if the Group Tomawac is the most appropriate for this topic as it is more relevant to SELAFIN file characteristics. But in case, a Tomawac user who create its own wind file had come across this issue, I would be very grateful for any guidance.

With best regards,

Alexis
The administrator has disabled public write access.

created BINARY WINDS FILE only read at last time step (AT) 3 years 2 months ago #39046

  • abeudin
  • abeudin's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
Sorry, I should have posted the message in the section "PRE/POST PROCESSING"
The administrator has disabled public write access.

created BINARY WINDS FILE only read at last time step (AT) 3 years 2 months ago #39084

  • Lux
  • Lux's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 96
  • Thank you received: 39
Dear Alexis,

I do not use the module Tomawac, but does the generated Selafin file has the right time (and date?) in BlueKenue?
Moreover I do not use Maltlab but the code seems strange for me:
  • why recomputing time with (i-1)*3600 where you have the table named time? (Is your time step of 1 hour?)
  • why writing in int32 the U and V components? (They are supposed to be float?)

In case you want to try to write the Selafin in Python, I can help you (with PyTelTools).

Best Regards,
Luc
The administrator has disabled public write access.
Moderators: tfouquet

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.