| 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 |
|