function [x_out,y_out]=netcdf_ecco_GenericgridPolarPlaneCoords(x_in,y_in,pole_sign); %pole_sign==1 -> north %pole_sign==-1 -> south if pole_sign==-1|pole_sign==+1 if ~isempty(find(pole_sign*y_in(:)<=0)) fprintf('polarcoords is ill-defined for this combination of tile and hemisphere combination \n => stop \n'); return; end x_out=zeros(size(x_in)); y_out=x_out; x_out(:)=(90-pole_sign*y_in(:)).*cos(pole_sign*x_in(:)*pi/180); y_out(:)=(90-pole_sign*y_in(:)).*sin(pole_sign*x_in(:)*pi/180); else x_out=x_in; y_out=y_in; end%if pole_sign==-1|pole_sign==+1