function [field,x,y,z]=hopsgui_isliceu(filein,iindex,time,var)

%       USAGE: [field,x,y,z]=hopsgui_isliceu(filein,jindex,time,time)
%
% HOPS_JSLICEU  Returns a matrix containing a vertical slice (field),
%   of the u componetn o the velocity and the  position (y,z) at a 
%   specified jindex and time step from an HOPS output (PE) file. 
%
%   In case of a non-oblique domain iindex represent a fixed longitude
% inputs: 	
% 		filein -- the .nc file
% 		time -- time of teh simulatio
%		var -- string with the variable name
%		iindex = J index along which slice is taken
%
%  Pedro Velez (UIB), July 1999

x=getnc(filein,'vgrid3',[1 -1 1 1],[1 -1 1 1],1,1,2);
y=getnc(filein,'vgrid3',[-1 iindex -1 2],[-1 iindex -1 2],1,1,2);
z=getnc(filein,'vgrid3',[-1 iindex -1 3],[-1 iindex -1 3],1,1,2);
field=getnc(filein,var,[time -1 iindex -1 1],[time -1 iindex -1 1],1,1,2);
field(find(field==0))=NaN;

%The array is temp(tlat, tlon, outlev)
%The array is x,y,z(tlat, tlon, outlev)

%x(iindex) is the longitude of the latitudinal section in case of a 
%non oblique domain

