/[MITgcm]/MITgcm_contrib/high_res_cube/matlab-grid-generator/conf_dx.m
ViewVC logotype

Annotation of /MITgcm_contrib/high_res_cube/matlab-grid-generator/conf_dx.m

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


Revision 1.1.1.1 - (hide annotations) (download) (vendor branch)
Tue Nov 11 18:08:08 2003 UTC (21 years, 8 months ago) by cnh
Branch: MAIN, initial
CVS Tags: baseline, HEAD
Changes since 1.1: +0 -0 lines
Checking in work done with Dimitri on high-resolution cube gridding and parallel 
communications. 
   o code is in a contrib experiment for now so we can continue collaborating
     on it. However most code is general and will be moved into main branch once 
     it is fully hardened.
   o There are README files in the contrib root and in the subdirectories that
     explain the contents

1 cnh 1.1 function [dxg] = conf_d(qq);
2     % calculate dx along edge of conformal cube (used for re-scaling coordinate)
3    
4     nx=prod(size(qq));
5     nxf=2*(nx-1)+1;
6     q(1:2:nxf)=qq;
7     q(2:2:nxf-1)=(q(1:2:nxf-1)+q(2:2:nxf))/2;
8    
9     j=1:nx-1;jm1=j-1;jm1(1)=nx-1;
10     J=1:nx;Jm1=J-1;Jm1(1)=nx-1;
11     J=j;
12    
13     % Generate gridded face using pure conformal mapping
14     [lx,ly]=ndgrid( q, q ); % Local grid coordinate
15     [lX,lY,lZ]=map_xy2xyz(lx,ly); % 3D coordinates on unit sphere
16    
17     % Symmetrize
18     %lX=(lX-lX(end:-1:1,:))/2; lX=(lX+lX(:,end:-1:1))/2;
19     %lY=(lY+lY(end:-1:1,:))/2; lY=(lY-lY(:,end:-1:1))/2;
20     %lZ=(lZ+lZ(end:-1:1,:))/2; lZ=(lZ+lZ(:,end:-1:1))/2;
21    
22     % Use "vector" data type
23     XG=lX(1:2:end,1:2:end);YG=lY(1:2:end,1:2:end);ZG=lZ(1:2:end,1:2:end);
24     Vertices=coord2vector(XG,YG,ZG);
25     dxg=angle_between_vectors(Vertices(j,J,:),Vertices(j+1,J,:));

  ViewVC Help
Powered by ViewVC 1.1.22