/[MITgcm]/MITgcm_contrib/gael/matlab_class/gcmfaces_IO/interp2nctiles.m
ViewVC logotype

Contents of /MITgcm_contrib/gael/matlab_class/gcmfaces_IO/interp2nctiles.m

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


Revision 1.1 - (show annotations) (download)
Wed Mar 16 15:02:48 2016 UTC (9 years, 3 months ago) by gforget
Branch: MAIN
CVS Tags: checkpoint65x, checkpoint65v, checkpoint65w, checkpoint65u, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, HEAD
+ process2UEVN.m (new): computes eastward/northward vector components
  and output result to 'diags_post_tmp/' (the binary results can then
  be converted to nctiles using process2nctiles.m after adding
  new definitions in available_diagnostics.log).
+ process2interp.m (new): interpolates fields in 'nctiles/' that at
  grid cell centers and output result to 'diags_interp_tmp/' (the
  binary results can then be converted to nctiles using process2nctiles.m
  through interp2nctiles.m)
+ interp2nctiles.m (new): creates netcdf files from interpolated
  fields that were created by process2interp. This routine overrides
  mygrid with mygrid_latlon after storing the reference grid in mygrid_orig.

1 function []=interp2nctiles(indFiles);
2 % INTERP2CNTILES creates netcdf files from interpolated
3 % fields that were created by process2interp. The
4 % input vector process2interp specifies the file subset
5 % to be processed (1:length(listInterp) by default).
6 %
7 % note: this routine overrides mygrid with mygrid_latlon
8 % after storing the reference grid in mygrid_orig
9
10 gcmfaces_global; global mygrid_orig;
11
12 dirModel='./';
13 if isempty(mygrid_orig);
14 grid_load; mygrid_orig=mygrid;
15 cd(dirModel);
16 end;
17
18 lon=[-179.75:0.5:179.75]; lat=[-89.75:0.5:89.75];
19 [lat,lon] = meshgrid(lat,lon);
20
21 mygrid_latlon.nFaces=1;
22 mygrid_latlon.dirGrid='none';
23 mygrid_latlon.fileFormat='straight';
24 mygrid_latlon.ioSize=size(lon);
25 mygrid_latlon.XC=gcmfaces({lon});
26 mygrid_latlon.YC=gcmfaces({lat});
27 mygrid_latlon.RC=mygrid.RC;
28 mygrid_latlon.RF=mygrid.RF;
29 mygrid_latlon.DRC=mygrid.DRC;
30 mygrid_latlon.DRF=mygrid.DRF;
31 mygrid_latlon.mskC=1+0*repmat(mygrid_latlon.XC,[1 1 length(mygrid.RC)]);
32 mygrid_latlon.RAC=[];
33 mygrid_latlon.gcm2facesFast=0;
34 mygrid_latlon.facesExpand=[];
35
36 [listInterp,listNot]=process2interp;
37 if isempty(who('indFiles'));
38 indFiles=[1:length(listInterp)];
39 end;
40
41 mygrid=mygrid_latlon;
42 for ii=indFiles;
43 tic; process2nctiles(dirModel,listInterp{ii},[]);
44 fprintf(['DONE: ' listInterp{ii} ' (in ' num2str(toc) 's)\n']);
45 end;
46 mygrid=mygrid_orig;
47

  ViewVC Help
Powered by ViewVC 1.1.22