| 59 | % What if it is not in year increments?  Need a more sophisticated | % What if it is not in year increments?  Need a more sophisticated | 
| 60 | % treatment of finding Focn.  Should compute monthly mean before.  Test | % treatment of finding Focn.  Should compute monthly mean before.  Test | 
| 61 | % with various sorts of coupled field outputs. | % with various sorts of coupled field outputs. | 
|  |  |  | 
| 62 | for ifield = 1:length(mncfld) | for ifield = 1:length(mncfld) | 
|  | FocnOld = dataFocnOld.(mncfld{ifield}); |  | 
|  | if isequal(mncfld{ifield},'FW') |  | 
|  | FocnOld = DataCorrections(FocnOld,mncfld{ifield},gravity,RAC); |  | 
|  | end |  | 
| 63 | FocnNew = mean(dataCplSelect.([mncfld{ifield},'tave']),3); | FocnNew = mean(dataCplSelect.([mncfld{ifield},'tave']),3); | 
| 64 | FocnNew = DataCorrections(FocnNew,mncfld{ifield},gravity,RAC); | FocnNew = DataCorrections(FocnNew,mncfld{ifield},gravity,RAC); | 
| 65 | if FocnOnly | if FocnOnly | 
| 66 | Focn = FocnNew; | Focn = FocnNew; | 
| 67 | else | else | 
| 68 |  | FocnOld = dataFocnOld.(mncfld{ifield}); | 
| 69 |  | if isequal(mncfld{ifield},'FW') | 
| 70 |  | FocnOld = DataCorrections(FocnOld,mncfld{ifield},gravity,RAC); | 
| 71 |  | end | 
| 72 | Focn = (gWeight*FocnOld + FocnNew)/(gWeight+1); | Focn = (gWeight*FocnOld + FocnNew)/(gWeight+1); | 
| 73 | end | end | 
| 74 | fid=fopen([outDir,'/',FocnRoot,'.',fields{ifield},... | fid=fopen([outDir,'/',FocnRoot,'.',fields{ifield},... |