genVreal.m 868 Bytes
%% Open

nx=3585;
ny=65;

home = pwd;

if strcmp(fgetMachin, 'mingan')
    path2Sim = '/share/work/duqk0001/run/2DAh/Ro0.003';
elseif strcmp(fgetMachin, 'mac')
    path2Sim = '/Users/Administrator/Documents/uqar/Leads/result/data/varRoEqAh_v2/Ro0.003';
else
   error('Wrong location in genVreal.m ') 
end

cd(path2Sim)

dynDiag = rdmds('dynDiag', Inf);
U = squeeze(dynDiag(:,1,:,1));
V = squeeze(dynDiag(:,1,:,2));  
W = squeeze(dynDiag(:,1,:,3));

Vmean = mean(V(floor(nx/2),:));

V2Write = resizem(V, [nx ny]);
U2Write = resizem(U,[nx ny]);
cd(home)

%% Write
%fid=fopen('Vini.bin','w','b'); fwrite(fid,V2Write,'real*4'); fclose(fid);

%V
fileID = fopen('Vini.txt','w');

fprintf(fileID,[repmat('%6.5f ',1,nx) '\n'],fliplr(V2Write));
fclose(fileID);

% U
fileID = fopen('Uini.txt','w');

fprintf(fileID,[repmat('%6.5f ',1,nx) '\n'],fliplr(U2Write));
fclose(fileID);