/[MITgcm]/MITgcm_contrib/eh3/llc/ecco-godae/code/driver_topology-generator.m
ViewVC logotype

Contents of /MITgcm_contrib/eh3/llc/ecco-godae/code/driver_topology-generator.m

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


Revision 1.1 - (show annotations) (download)
Wed Aug 23 21:07:50 2006 UTC (18 years, 11 months ago) by edhill
Branch: MAIN
CVS Tags: HEAD
initial ci of bathy

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 %nr=64; nb=32; ng=128;
13 %nr=576; nb=576; ng=576;
14 %nr=672; nb=672; ng=672;
15 nr=60; nb=60; ng=30;
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 %tnx=85;tny=85;
22 %tnx=10;tny=10;
23 %tnx=16;tny=16;
24 tnx=16;tny=32;
25 %tnx=32;tny=32;
26 %tnx=32;tny=8;
27 %tnx=192;tny=64;
28 tnx=8;tny=4;
29 tnx=15;tny=10;
30
31 nr = 360; ng = 90; nb = 90; tnx=90;tny=90;
32
33 % Make list of domains. Assume MITgcm standard cube layout, three
34 % color path labeling and global indexing convention.
35 clear domain ndomains domain_nx domain_ny
36 [ndomains,domain,domain_nx,domain_ny] = exch2_setup_cs6_domains(nr,nb,ng);
37
38 % Now create basic tile definitions for each domain with their
39 % offsets within the domain
40 % tn[xy] :: tile extents in x and y
41 % tbase[xy] :: offset of tile local coords from domain coords
42 % :: tdom[xy] = tlocal[xy] + tbase[xy]
43 % t[xy]globallo :: global composite domain coordinate associated with
44 % :: tlocal[xy]=(1,1)
45 % mydomain :: domain number the tile belongs to
46 % tileid :: identifier number for tile
47 % tx :: tile x coordinate within domain tiling
48 % ty :: tile y coordinate within domain tiling
49 clear tile
50 [tile,ntiles,ierr,domain]= ...
51 exch2_setup_cs6_tiles(tnx,tny,domain,ndomains);
52
53 % Set neighbor domains for each tile
54 [tile] = exch2_setup_cs6_get_neighbor_domains(tile, domain, ntiles);
55
56 % Let try and figure out what points I send my edges to. We do this by
57 % a search procedure rather than a functional relationship. The search
58 % procedure visits each edge of each tile in turn. For internal edges
59 % (edges that don't cross a domain boundary) the index range at +/-1
60 % in the normal direction to the edge is searched for. This identifies
61 % all the tiles that border this tile.
62 [tile] = exch2_setup_cs6_get_internal_neighbor_tiles( tile, domain, ntiles);
63 [tile] = exch2_setup_cs6_get_internal_neighbor_index_ranges(tile, domain, ntiles);
64
65 [tile] = exch2_setup_cs6_get_external_neighbor_tiles( tile, domain, ntiles);
66
67 % Draw a picture of the full domain and its tiles in the standard cube
68 % layout
69 exch2_setup_cs6_plot(domain, tile, tnx, tny);
70
71 % Squeeze the blank tiles out
72 [tile, domain] = exch2_setup_squeeze_blanks(domain, tile, tnx, tny);
73
74 % Write attributes for a tile
75 exch2_setup_cs6_print( domain, tile, tnx, tny, 1)

  ViewVC Help
Powered by ViewVC 1.1.22