function [field,x,y,z]=hopsgui_jsliceu(filein,jindex,time,var)

%       USAGE: [field,x,y,z]=hopsgui_jsliceu(filein,jindex,time,time)
%
% HOPS_JSLICEV  Returns a matrix containing a vertical slice (field),
%   of thev 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
%		jindex = J index along which slice is taken
%
%  Pedro Velez (UIB), July 1999


y=getnc(filein,'vgrid3',[-1 1 1 2],[-1 1 1 2],1,1,2); %this is just a vector
x=getnc(filein,'vgrid3',[jindex -1 -1 1],[jindex -1 -1 1],1,1,2); %those are 2d matriz with the 
z=getnc(filein,'vgrid3',[jindex -1 -1 3],[jindex -1 -1 3],1,1,2); %vertical grid
field=getnc(filein,var,[time jindex -1 -1 2],[time jindex -1 -1 2],1,1,2);
field(find(field==0))=NaN;

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