/[MITgcm]/MITgcm_contrib/jmc_script/rdwrpick.m
ViewVC logotype

Contents of /MITgcm_contrib/jmc_script/rdwrpick.m

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


Revision 1.3 - (show annotations) (download)
Fri Feb 10 20:21:02 2017 UTC (7 years, 1 month ago) by jmc
Branch: MAIN
CVS Tags: testing_tag01, HEAD
Changes since 1.2: +2 -2 lines
fix typo

1 %- matlab script to write 1 global pickup file from a set of tiled pickup files
2 % to start, type: >> rdwrpick
3
4 % $Header: /u/gcmpack/MITgcm_contrib/jmc_script/rdwrpick.m,v 1.2 2017/02/10 20:05:34 jmc Exp $
5 % $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 kr=input(' 6=dic ; 7=land ; 8=cpl ; 9=fizhi ; 10,11=somT,S ; select one those: ?\n');
11 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 case 6, namInp=[namInp,'_dic'];
18 case 7, namInp=[namInp,'_land'];
19 case 8, namInp=[namInp,'_cpl'];
20 case 9, namInp=[namInp,'_fizhi'];
21 %case 9, namInp=[namInp,'_vegtiles'];
22 case 10, namInp=[namInp,'_somT'];
23 case 11, namInp=[namInp,'_somS'];
24 end
25
26 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 namfil=sprintf('%s.%10.10i',namInp,nit);
35 end
36 %-----------
37 %u,gu,gum v,gv,gvm, t,gt,gtm, s,gs,gsm, eta
38
39 fprintf(['read files: ',namfil,'* \n \n']);
40 va=rdmds(namfil);
41 %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

  ViewVC Help
Powered by ViewVC 1.1.22