/[MITgcm]/MITgcm_contrib/enderton/PeriodicCoupling/CalcOcnForcingFields.m
ViewVC logotype

Diff of /MITgcm_contrib/enderton/PeriodicCoupling/CalcOcnForcingFields.m

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

revision 1.1 by enderton, Wed Oct 5 02:27:21 2005 UTC revision 1.3 by enderton, Tue Oct 18 16:07:15 2005 UTC
# Line 14  mkdir(outDir); Line 14  mkdir(outDir);
14  %                                 Load Data                               %  %                                 Load Data                               %
15  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16    
17  % datacpl = rdmnc(cplFiles,'iter','HFtave','TXtave',...  datacpl = rdmnc(cplFiles,'iter','HFtave','TXtave',...
18  %                          'TYtave','FWtave','SICtave');                           'TYtave','FWtave','SICtave');
19  % datagrd = rdmnc(gridFiles,'rA','XG','YG','XC','YC');  datagrd = rdmnc(gridFiles,'rA','XG','YG','XC','YC');
20  % RAC = datagrd.rA;  RAC = datagrd.rA;
21  % XC = datagrd.XC; XG = datagrd.XG(1:size(RAC,1),1:size(RAC,2));  XC = datagrd.XC; XG = datagrd.XG(1:size(RAC,1),1:size(RAC,2));
22  % YC = datagrd.YC; YG = datagrd.YG(1:size(RAC,1),1:size(RAC,2));  YC = datagrd.YC; YG = datagrd.YG(1:size(RAC,1),1:size(RAC,2));
23  % save('DataPerCpl.mat','datacpl','RAC','XG','YG','XC','YC');  %save('DataPerCpl.mat','datacpl','RAC','XG','YG','XC','YC');
24  load('DataPerCpl.mat');  %load('DataPerCpl.mat');
25    
26    
27  % If a new focn is to be calculated, the old Focn must be loaded.  % If a new focn is to be calculated, the old Focn must be loaded.
# Line 59  end Line 59  end
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});  
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},...
# Line 171  function CorrectedData = ... Line 173  function CorrectedData = ...
173      else      else
174          CorrectedData = DataToCorrect;          CorrectedData = DataToCorrect;
175      end      end
           
176            

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.22