| 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 |  |  | % $Header:  $ | 
| 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('   8=fizhi ; 9=vegtiles ; select one those: ? \n'); | 
| 11 |  |  | kr=input('   6=land ; 7=cpl ; 8=fizhi ; 9,10=somT,S ; select one those: ? \n'); | 
| 12 |  |  | switch kr | 
| 13 |  |  | case 1,  namInp=[namInp,'_nh']; | 
| 14 |  |  | case 2,  namInp=[namInp,'_cd']; | 
| 15 |  |  | case 3,  namInp=[namInp,'_seaice']; | 
| 16 |  |  | case 4,  namInp=[namInp,'_ic']; | 
| 17 |  |  | case 5,  namInp=[namInp,'_ptracers']; | 
| 18 |  |  | case 6,  namInp=[namInp,'_land']; | 
| 19 |  |  | case 7,  namInp=[namInp,'_cpl']; | 
| 20 |  |  | case 8,  namInp=[namInp,'_fizhi']; | 
| 21 |  |  | %case 9,  namInp=[namInp,'_vegtiles']; | 
| 22 |  |  | case 9,  namInp=[namInp,'_somT']; | 
| 23 |  |  | case 10, 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=fname(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 |