/[MITgcm]/MITgcm/utils/matlab/mnc_assembly.m
ViewVC logotype

Diff of /MITgcm/utils/matlab/mnc_assembly.m

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

revision 1.1 by edhill, Tue Feb 1 15:55:52 2005 UTC revision 1.2 by mlosch, Wed Feb 2 10:39:38 2005 UTC
# Line 97  while frdone == 0 Line 97  while frdone == 0
97    all_ncf(n).bj             = fnc.bj(1);    all_ncf(n).bj             = fnc.bj(1);
98    all_ncf(n).sNx            = fnc.sNx(1);    all_ncf(n).sNx            = fnc.sNx(1);
99    all_ncf(n).sNy            = fnc.sNy(1);    all_ncf(n).sNy            = fnc.sNy(1);
100      all_ncf(n).Nx             = fnc.Nx(1);
101      all_ncf(n).Ny             = fnc.Ny(1);
102    all_ncf(n).Z              = fnc.Z(1);    all_ncf(n).Z              = fnc.Z(1);
103    
104    if exch == 2    if exch == 2
# Line 131  end Line 133  end
133    
134  %  check for consistent sNx,sNy  %  check for consistent sNx,sNy
135  if (prod(double([all_ncf.sNx] == all_ncf(1).sNx)) ~= 1) ...  if (prod(double([all_ncf.sNx] == all_ncf(1).sNx)) ~= 1) ...
136        || (prod(double([all_ncf.sNy] == all_ncf(1).sNy)) ~= 1)        | (prod(double([all_ncf.sNy] == all_ncf(1).sNy)) ~= 1)
137    disp('Error: the "sNx,sNy" values for all the tiles are not');    disp('Error: the "sNx,sNy" values for all the tiles are not');
138    disp('   uniform.  Future versions of this function will be');    disp('   uniform.  Future versions of this function will be');
139    disp('   able to handle non-uniform grid sizes but this');    disp('   able to handle non-uniform grid sizes but this');
# Line 272  if all_ncf(1).exch == 1 Line 274  if all_ncf(1).exch == 1
274    
275    %  exch "1":    %  exch "1":
276        
277    bi_max = max([all_ncf.bi]);  % $$$   bi_max = max([all_ncf.bi]);
278    bj_max = max([all_ncf.bj]);  % $$$   bj_max = max([all_ncf.bj]);
279    Xmax = bi_max * all_ncf(1).sNx;  % $$$   Xmax = bi_max * all_ncf(1).sNx;
280    Ymax = bj_max * all_ncf(1).sNy;  % $$$   Ymax = bj_max * all_ncf(1).sNy;
281        Xmax = all_ncf(1).Nx;
282      Ymax = all_ncf(1).Ny;
283      % at this point I have to make some assumptions about the domain
284      % decomposition
285      bi_max = Xmax/all_ncf(1).sNx;
286      bj_max = Ymax/all_ncf(1).sNy;
287      itile = 0;
288      for bj=1:bj_max
289        for bi=1:bi_max
290          itile = itile+1;
291          all_ncf(itile).bi=bi;
292          all_ncf(itile).bj=bj;
293        end
294      end
295    
296    horzdim = struct('names',{},'lens',{});    horzdim = struct('names',{},'lens',{});
297    horzdim(1).names = { 'X' };  horzdim(1).lens = { Xmax     };    horzdim(1).names = { 'X' };  horzdim(1).lens = { Xmax     };
298    horzdim(2).names = {'Xp1'};  horzdim(2).lens = { Xmax + 1 };    horzdim(2).names = {'Xp1'};  horzdim(2).lens = { Xmax + 1 };
# Line 328  if all_ncf(1).exch == 1 Line 344  if all_ncf(1).exch == 1
344      disp(sprintf('  Copying variable:   %s',myvars(ivar).name))      disp(sprintf('  Copying variable:   %s',myvars(ivar).name))
345      for itile = 1:length(all_ncf)      for itile = 1:length(all_ncf)
346    
347        if (myvars(ivar).has_horiz == 1) || (itile == 1)        if (myvars(ivar).has_horiz == 1) | (itile == 1)
348                    
349          clear nct;          clear nct;
350          nct = all_ncf(itile).nc{1};          nct = all_ncf(itile).nc{1};
# Line 410  elseif all_ncf(1).exch == 2 Line 426  elseif all_ncf(1).exch == 2
426      comm = [ comm sprintf('''%s''',myvars(ivar).dim_names{id}) ];      comm = [ comm sprintf('''%s''',myvars(ivar).dim_names{id}) ];
427      for id = 2:length(myvars(ivar).dim_names)      for id = 2:length(myvars(ivar).dim_names)
428        dname = myvars(ivar).dim_names{id};        dname = myvars(ivar).dim_names{id};
429        if (dname(1) == 'Y') && (myvars(ivar).has_horiz == 1)        if (dname(1) == 'Y') & (myvars(ivar).has_horiz == 1)
430          comm = [ comm sprintf(',''%s''','iface') ];          comm = [ comm sprintf(',''%s''','iface') ];
431        end        end
432        comm = [ comm sprintf(',''%s''',dname) ];        comm = [ comm sprintf(',''%s''',dname) ];
# Line 434  elseif all_ncf(1).exch == 2 Line 450  elseif all_ncf(1).exch == 2
450      disp(sprintf('  Copying variable:   %s',myvars(ivar).name))      disp(sprintf('  Copying variable:   %s',myvars(ivar).name))
451      for itile = 1:length(all_ncf)      for itile = 1:length(all_ncf)
452    
453        if (myvars(ivar).has_horiz == 1) || (itile == 1)        if (myvars(ivar).has_horiz == 1) | (itile == 1)
454                    
455          clear nct;          clear nct;
456          nct = all_ncf(itile).nc{1};          nct = all_ncf(itile).nc{1};

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.22