/[MITgcm]/MITgcm_contrib/high_res_cube/matlab-topology-generator/driver.m
ViewVC logotype

Annotation of /MITgcm_contrib/high_res_cube/matlab-topology-generator/driver.m

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


Revision 1.4 - (hide annotations) (download)
Fri Mar 26 15:19:36 2004 UTC (21 years, 3 months ago) by edhill
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +0 -0 lines
FILE REMOVED
 o removing files (as requested by CNH) to fix the recent CVS repository
   corruption (the dead-files-returning problem)

1 cnh 1.1 % Create exch2 communication map and schedule for a cube sphere grid with
2     % constant tile size tnx x tny.
3    
4     % Use red-green-blue shorthand for cube index space specification
5     % In this notation cube faces are laid out as shown below
6     %
7     %
8     % f5(nr,ng) f6(nb,ng)
9     % f3(ng,nb) f4(nr,nb)
10     % f1(nb,nr) f2(nb,nr)
11     %
12 cnh 1.2 %nr=64; nb=32; ng=128;
13 cnh 1.1 %nr=576; nb=576; ng=576;
14     %nr=672; nb=672; ng=672;
15     nr=32; nb=32; ng=32;
16     %nr=510; nb=510; ng=510;
17     %nr=30; nb=30; ng=30;
18    
19     % Choose tile subgrid sizes for each face.
20     % nr,nb,ng must be integer multiples of tnx and tny.
21 cnh 1.2 %tnx=85;tny=85;
22 cnh 1.1 %tnx=10;tny=10;
23     %tnx=16;tny=16;
24     tnx=16;tny=32;
25 cnh 1.2 %tnx=32;tny=32;
26     %tnx=32;tny=8;
27 cnh 1.1 %tnx=192;tny=64;
28 cnh 1.3 tnx=8;tny=4;
29 cnh 1.1
30     % Make list of domains. Assume MITgcm standard cube layout, three color path labeling and
31     % global indexing convention.
32     clear domain ndomains domain_nx domain_ny
33     [ndomains,domain,domain_nx,domain_ny] = exch2_setup_cs6_domains(nr,nb,ng);
34    
35     % Now create basic tile definitions for each domain with their offsets within the domain
36     % tn[xy] :: tile extents in x and y
37     % tbase[xy] :: offset of tile local coords from domain coords
38     % :: tdom[xy] = tlocal[xy] + tbase[xy]
39     % t[xy]globallo :: global composite domain coordinate associated with
40     % :: tlocal[xy]=(1,1)
41     % mydomain :: domain number the tile belongs to
42     % tileid :: identifier number for tile
43     % tx :: tile x coordinate within domain tiling
44     % ty :: tile y coordinate within domain tiling
45     clear tile
46     [tile,ntiles,ierr,domain]= ...
47     exch2_setup_cs6_tiles(tnx,tny,domain,ndomains);
48    
49     % Set neighbor domains for each tile
50     [tile] = exch2_setup_cs6_get_neighbor_domains(tile, domain, ntiles);
51    
52     % Let try and figure out what points I send my edges to. We do this by a search procedure
53     % rather than a functional relationship. The search procedure visits each edge of each tile
54     % in turn. For internal edges (edges that don't cross a domain boundary) the index range at
55     % +/-1 in the normal direction to the edge is searched for. This identifies all the tiles that % border this tile.
56     [tile] = exch2_setup_cs6_get_internal_neighbor_tiles( tile, domain, ntiles);
57     [tile] = exch2_setup_cs6_get_internal_neighbor_index_ranges(tile, domain, ntiles);
58    
59     [tile] = exch2_setup_cs6_get_external_neighbor_tiles( tile, domain, ntiles);
60 cnh 1.3
61     % Draw a picture of the full domain and its tiles in the standard cube layout
62     % exch2_setup_cs6_plot(domain, tile, tnx, tny);
63    
64     % Squeeze the blank tiles out
65     [tile, domain] = exch2_setup_squeeze_blanks(domain, tile, tnx, tny);
66 cnh 1.1
67     % Write attributes for a tile
68 cnh 1.2 exch2_setup_cs6_print( domain, tile, tnx, tny, 1)

  ViewVC Help
Powered by ViewVC 1.1.22