make_wind from meteo model

Discussion about analysis, visualization, and collaboration tools and techniques

Moderators: arango, robertson

Post Reply
Message
Author
mistral
Posts: 23
Joined: Wed Jan 16, 2008 11:17 pm
Location: Privat

make_wind from meteo model

#1 Unread post by mistral »

Hello everyone
is some time I try to solve a problem.
I have an output of a meteorological model,
and I have interpolated from a grid of 500m grid spacing.
dimensions

meteo :
GLAT 115x50
GLON 115x50

Roms: the name and size lat and lon

lat_rho 576x480

lon_rho 576x480

I started in this way, but I get several errors

grdfile = '500m.nc';
infile = 'wrf.nc';
ncload(infile);
ncload(grdfile);
lon = nc_varget(infile,'GLON');
lat = nc_varget(infile,'GLAT');
lon1 = nc_varget(grdfile,'lon_rho');
lat1 = nc_varget(grdfile,'lat_rho');
U = nc_varget(infile,'U10');
V = nc_varget(infile,'V10');
time = nc_varget(infile,'Times');
angolo = nc_varget(grdfile,'angle');
for it = 1:length(Times)
v_slice = squeeze(V10(:,:,:));
u_slice = squeeze(U10(:,:,:));
w = complex(u_slice,v_slice);
w_ = griddata(GLON,GLAT,w,lon1,lat1);
w_rot = w_ .* exp(-sqrt(-1)*angolo);
Uwind(:,:,:) = real(w_rot);
Vwind(:,:,:) = imag(w_rot);
clear u_slice v_slice w*
end

that will not get errors but if plots (>>pcolor(Uwind)), I get as result a blank grid (grid only)
(I attach the image of the plot uwind)
and more NaN (for simple command >>Uwind)

but if I enter the time variable declared :

>> for it = 1:length(Times)
v_slice = squeeze(V10(it,:,:));
u_slice = squeeze(U10(it,:,:));
w = complex(u_slice,v_slice);
w_ = griddata(GLON,GLAT,w,lon1,lat1);
w_rot = w_ .* exp(-sqrt(-1)*angolo);
Uwind(it,:,:) = real(w_rot);
Vwind(it,:,:) = imag(w_rot);
clear u_slice v_slice w*
end
??? Error using ==> griddata at 50
When Z is a vector, X and Y must also be vectors.


I'm very confused
is my first two models attempt to interpolate...
I hope in your help greatly!


and
Attachments
grid(uwind).jpg

Post Reply