/[MITgcm]/MITgcm_contrib/gael/profilesMatlabProcessing/netcdf_ecco_GenericgridPolarPlaneCoords.m
ViewVC logotype

Annotation of /MITgcm_contrib/gael/profilesMatlabProcessing/netcdf_ecco_GenericgridPolarPlaneCoords.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Fri Jun 15 05:39:42 2007 UTC (18 years, 1 month ago) by gforget
Branch: MAIN
matlab scripts to process pkg/profiles netcdf input files.

1 gforget 1.1 function [x_out,y_out]=netcdf_ecco_GenericgridPolarPlaneCoords(x_in,y_in,pole_sign);
2    
3     %pole_sign==1 -> north
4     %pole_sign==-1 -> south
5    
6     if pole_sign==-1|pole_sign==+1
7    
8     if ~isempty(find(pole_sign*y_in(:)<=0))
9     fprintf('polarcoords is ill-defined for this combination of tile and hemisphere combination \n => stop \n');
10     return;
11     end
12    
13     x_out=zeros(size(x_in)); y_out=x_out;
14    
15     x_out(:)=(90-pole_sign*y_in(:)).*cos(pole_sign*x_in(:)*pi/180);
16     y_out(:)=(90-pole_sign*y_in(:)).*sin(pole_sign*x_in(:)*pi/180);
17    
18     else
19    
20     x_out=x_in; y_out=y_in;
21    
22     end%if pole_sign==-1|pole_sign==+1
23    
24    

  ViewVC Help
Powered by ViewVC 1.1.22