/[MITgcm]/MITgcm_contrib/gael/profilesMatlabProcessing/ianOverlapFix_prior.m
ViewVC logotype

Contents of /MITgcm_contrib/gael/profilesMatlabProcessing/ianOverlapFix_prior.m

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


Revision 1.2 - (show annotations) (download)
Thu May 13 19:54:54 2010 UTC (15 years, 2 months ago) by gforget
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
moving to profiles_process_misc_v1

1 %at the edges of the domain there are stupid values in the overlaps
2 %for the curvilinear grid option (as used by Ian) and we overwrite them
3 %with the neighboring point (actucally inside the domain) long and lat
4
5 %=> overwrites profilesXCincl1PointOverlap* and profilesYCincl1PointOverlap*
6
7 dXC = dir('profilesXCincl1PointOverlap*')
8 dYC = dir('profilesYCincl1PointOverlap*')
9
10 plotthese = 0;
11 for i = 1:size(dXC,1)
12 %for i = 1:1
13 fxc = dXC(i).name
14 fyc = dYC(i).name
15 sx = str2num(fxc(end-13:end-10))
16 sy = str2num(fyc(end-8:end-5))
17
18 fid = fopen(dXC(i).name,'r','b');
19 fXC = fread(fid,'float64');
20 fclose(fid);
21
22 fid = fopen(dYC(i).name,'r','b');
23 fYC = fread(fid,'float64');
24 fclose(fid);
25
26 fXC = reshape(fXC,[sx+2, sy+2]);
27 fXCo = fXC;
28
29 fYC = reshape(fYC,[sx+2, sy+2]);
30 fYCo = fYC;
31
32 if (abs(fXC(2,1) - fXC(2,2)) > 1)
33 fXC(:,1) = fXC(:,2);
34 fYC(:,1) = fYC(:,2);
35 fXC(1,1) = fXC(2,2);
36 fYC(1,1) = fYC(2,2);
37 end
38
39 if (abs(fXC(2,end) - fXC(2,end-1)) > 1)
40 fXC(:,end) = fXC(:,end-1);
41 fYC(:,end) = fYC(:,end-1);
42
43 fXC(1,end) = fXC(2,end-1);
44 fYC(1,end) = fYC(2,end-1);
45 end
46
47 if (abs(fYC(1,2) - fYC(2,2)) > 1)
48 fXC(1,:) = fXC(2,:);
49 fYC(1,:) = fYC(2,:);
50 end
51
52 if (abs(fYC(end,2) - fYC(end-1,2)) > 1)
53 fXC(end,:) = fXC(end-1,:);
54 fYC(end,:) = fYC(end-1,:);
55 end
56
57 if plotthese
58 figure(i);
59 subplot(2,2,1);
60 imagesc(fXCo);
61 subplot(2,2,2);
62 imagesc(fXC);
63 subplot(2,2,3);
64 imagesc(fYCo);
65 subplot(2,2,4);
66 imagesc(fYC);
67 else
68
69 fid = fopen(dXC(i).name,'w','b');
70 fXC = fwrite(fid,fXC,'float64');
71 fclose(fid);
72
73 fid = fopen(dYC(i).name,'w','b');
74 fYC = fwrite(fid,fYC,'float64');
75 fclose(fid);
76 end
77 end
78
79

  ViewVC Help
Powered by ViewVC 1.1.22