/[MITgcm]/MITgcm_contrib/gael/matlab_class/gcmfaces_exch/exch_Z_llc.m
ViewVC logotype

Annotation of /MITgcm_contrib/gael/matlab_class/gcmfaces_exch/exch_Z_llc.m

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


Revision 1.1 - (hide annotations) (download)
Fri Sep 14 03:39:51 2012 UTC (12 years, 10 months ago) by gforget
Branch: MAIN
CVS Tags: checkpoint65x, checkpoint65r, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, HEAD
- added vorticity point exchanges : @gcmfaces/exch_Z.m, gcmfaces_exch/exch_Z_ll.m,
  gcmfaces_exch/exch_Z_cube.m, gcmfaces_exch/exch_Z_llc.m (largely contributed by M.Buckley).
- gcmfaces_exch/exch_T_N_ll.m : extend assumtion on periodicity to global_ocean.90x40x15

1 gforget 1.1 function [FLD]=exch_Z_llc(fld);
2     %[FLD]=exch_Z_llc(fld);
3     %adds vorticity points (to north and east of center points) for
4     %lat-lon cap grid
5    
6     gcmfaces_global;
7    
8     %missing corners : assume symmetry of the grid (that may be completly wrong!)
9     global exch_Z_assume_sym;
10     if isempty(exch_Z_assume_sym);
11     exch_Z_assume_sym=0;
12     end;
13    
14     %determine vertical and/or time dimensions
15     n3=max(size(fld.f1,3),1); n4=max(size(fld.f1,4),1);
16    
17     %initialize FLD
18     FLD=gcmfaces;
19     for iF=1:mygrid.nFaces
20     [n1,n2]=size(mygrid.XC{iF});
21     FLD{iF}=NaN*zeros([n1+1 n2+1 n3 n4]);
22     end;
23    
24     for k3=1:n3; for k4=1:n4;
25    
26     for iF=1:mygrid.nFaces
27     FLD{iF}(1:end-1,1:end-1,k3,k4)=fld{iF}(:,:,k3,k4);
28     end
29    
30     %overlap in i+1
31     FLD.f1(end,1:end-1,k3,k4)=fld.f2(1,:,k3,k4);
32     FLD.f2(end,2:end,k3,k4)=flipud(fld.f4(:,1,k3,k4));
33     FLD.f3(end,1:end-1,k3,k4)=fld.f4(1,:,k3,k4);
34     FLD.f4(end,2:end,k3,k4)=NaN;
35     FLD.f5(end,1:end-1,k3,k4)=NaN;
36    
37     %overlap in j+1
38     FLD.f1(2:end,end,k3,k4)=fliplr(fld.f3(1,:,k3,k4));
39     FLD.f2(1:end-1,end,k3,k4)=fld.f3(:,1,k3,k4);
40     FLD.f3(2:end,end,k3,k4)=fliplr(fld.f5(1,:,k3,k4));
41     FLD.f4(1:end-1,end,k3,k4)=fld.f5(:,1,k3,k4);
42     FLD.f5(2:end,end,k3,k4)=fliplr(fld.f1(1,:,k3,k4));
43    
44     %missing corners : use the average value (from the 3 or 2 neighbours)
45     zzC(1)=(fld.f1(1,end,k3,k4)+fld.f3(1,end,k3,k4)+fld.f5(1,end,k3,k4))/3;
46     zzC(2)=(fld.f2(end,1,k3,k4)+fld.f4(end,1,k3,k4))/2;
47    
48     %missing corners : assume symmetry of the grid (that may be completly wrong!)
49     if exch_Z_assume_sym;
50     zzC(1)=fld.f4(1,1,k3,k4);
51     zzC(2)=fld.f1(1,1,k3,k4);
52     warning('exch_Z_llc filled 2 missing corners assuming uncertain symmetries!');
53     end
54    
55     %- 1rst = N.W corner of face 1
56     FLD.f1(1,end,k3,k4)=zzC(1);
57     FLD.f3(1,end,k3,k4)=zzC(1);
58     FLD.f5(1,end,k3,k4)=zzC(1);
59     %- 2nd = S.E corner of face 2
60     FLD.f2(end,1,k3,k4)=zzC(2);
61     FLD.f4(end,1,k3,k4)=zzC(2);
62    
63     end;
64     end;
65    
66     1;
67    

  ViewVC Help
Powered by ViewVC 1.1.22