1 |
jmc |
1.1 |
%- matlab script to write 1 global pickup file from a set of tiled pickup files |
2 |
|
|
% to start, type: >> rdwrpick |
3 |
|
|
|
4 |
jmc |
1.3 |
% $Header: /u/gcmpack/MITgcm_contrib/jmc_script/rdwrpick.m,v 1.2 2017/02/10 20:05:34 jmc Exp $ |
5 |
jmc |
1.1 |
% $Name: $ |
6 |
|
|
|
7 |
|
|
namInp='pickup'; |
8 |
|
|
|
9 |
|
|
fprintf(' suffix for pickup file: 0=std ; 1=nh ; 2=cd ; 3=seaice ; 4=ice ; 5=pTrs\n'); |
10 |
jmc |
1.3 |
kr=input(' 6=dic ; 7=land ; 8=cpl ; 9=fizhi ; 10,11=somT,S ; select one those: ?\n'); |
11 |
jmc |
1.1 |
switch kr |
12 |
|
|
case 1, namInp=[namInp,'_nh']; |
13 |
|
|
case 2, namInp=[namInp,'_cd']; |
14 |
|
|
case 3, namInp=[namInp,'_seaice']; |
15 |
|
|
case 4, namInp=[namInp,'_ic']; |
16 |
|
|
case 5, namInp=[namInp,'_ptracers']; |
17 |
jmc |
1.2 |
case 6, namInp=[namInp,'_dic']; |
18 |
|
|
case 7, namInp=[namInp,'_land']; |
19 |
|
|
case 8, namInp=[namInp,'_cpl']; |
20 |
|
|
case 9, namInp=[namInp,'_fizhi']; |
21 |
jmc |
1.1 |
%case 9, namInp=[namInp,'_vegtiles']; |
22 |
jmc |
1.2 |
case 10, namInp=[namInp,'_somT']; |
23 |
|
|
case 11, namInp=[namInp,'_somS']; |
24 |
jmc |
1.1 |
end |
25 |
jmc |
1.2 |
|
26 |
jmc |
1.1 |
nit=input([' put together all partial ',namInp, ... |
27 |
|
|
' files : input n_iter = ? (-1,-2:ckptA,B) \n']); |
28 |
|
|
|
29 |
|
|
if nit < 0, |
30 |
|
|
if nit == -1, namfil=[namInp,'.ckptA']; |
31 |
|
|
else namfil=[namInp,'.ckptB']; |
32 |
|
|
end |
33 |
|
|
else |
34 |
jmc |
1.2 |
namfil=sprintf('%s.%10.10i',namInp,nit); |
35 |
jmc |
1.1 |
end |
36 |
|
|
%----------- |
37 |
jmc |
1.2 |
%u,gu,gum v,gv,gvm, t,gt,gtm, s,gs,gsm, eta |
38 |
jmc |
1.1 |
|
39 |
|
|
fprintf(['read files: ',namfil,'* \n \n']); |
40 |
jmc |
1.2 |
va=rdmds(namfil); |
41 |
jmc |
1.1 |
%fprintf(' read full size : %i %i %i \n \n',size(va)); |
42 |
|
|
fprintf(' read full size :'); fprintf(' %i',size(va)); fprintf('\n\n'); |
43 |
|
|
|
44 |
|
|
wrfile=[namfil,'.Uni.data']; |
45 |
|
|
fid=fopen(wrfile,'w','b'); |
46 |
|
|
fwrite(fid,va,'real*8'); |
47 |
|
|
fclose(fid); |
48 |
|
|
|
49 |
|
|
fprintf([' ==> write file: ',wrfile,'\n']); |
50 |
|
|
|
51 |
|
|
return |