/[MITgcm]/MITgcm_contrib/enderton/Diagnostics/DiagLoad.m
ViewVC logotype

Diff of /MITgcm_contrib/enderton/Diagnostics/DiagLoad.m

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

revision 1.9 by molod, Tue Jul 5 18:57:48 2005 UTC revision 1.10 by enderton, Wed Aug 10 20:00:35 2005 UTC
# Line 108  elseif ismember(fln,aimparameters) Line 108  elseif ismember(fln,aimparameters)
108                ddf,gdf,avg,slc,pst,LoadGridData,GridSuffix,ZcordFile,Vector,FieldName);                ddf,gdf,avg,slc,pst,LoadGridData,GridSuffix,ZcordFile,Vector,FieldName);
109    
110  % Load coupled fields.  Like AIM, the data is all stuffed into one file  % Load coupled fields.  Like AIM, the data is all stuffed into one file
111  % called either 'cplFld.*' (MDS) or 'cpl_tave.*' (MNC).  Variables within  % called either 'cplFldtave.*' (MDS) or 'cpl_tave.*' (MNC).  Variables within
112  % the MDS files given in 'DiagGenParam', accessed directly with MNC.  TX  % the MDS files given in 'DiagGenParam', accessed directly with MNC.  TX
113  % and TY (stress on ocean) must be converted to lat-lon grid.  % and TY (stress on ocean) must be converted to lat-lon grid.
114  elseif ismember(fln,cplparameters)  elseif ismember(fln,cplparameters)
# Line 189  elseif ismember(fln,{'U','V','uVel','vVe Line 189  elseif ismember(fln,{'U','V','uVel','vVe
189      V = DiagAverage(V,fln,avg,months,ddf,Dim);      V = DiagAverage(V,fln,avg,months,ddf,Dim);
190          [XC,XG,YC,YG,Ylat,ZC,ZG,RAC,drC,drF,HFacC,HFacW,HFacS,dxG,dyG,dxC,dyC] = ...          [XC,XG,YC,YG,Ylat,ZC,ZG,RAC,drC,drF,HFacC,HFacW,HFacS,dxG,dyG,dxC,dyC] = ...
191          DiagLoadGridData(LoadGridData,grd,gdf,flu,GridSuffix,ZcordFile);          DiagLoadGridData(LoadGridData,grd,gdf,flu,GridSuffix,ZcordFile);
192          [U,V]=uvcube2latlon(XC,YC,U,V,XL,YL);          %[U,V]=uvcube2latlon(XC,YC,U,V,XL,YL);
193      if ismember(fln,{'U','uVel','fizhi_U'})      if ismember(fln,{'U','uVel','fizhi_U'})
194          data = U;          data = U;
195      elseif ismember(fln,{'V','vVel','fizhi_V'})      elseif ismember(fln,{'V','vVel','fizhi_V'})
# Line 311  elseif isequal(fln,'KEpri') Line 311  elseif isequal(fln,'KEpri')
311      UU = DiagLoad_Local('UU'  ,dat,dad,grd,itr,ddf,filesuffix,mnchandle);      UU = DiagLoad_Local('UU'  ,dat,dad,grd,itr,ddf,filesuffix,mnchandle);
312      VV = DiagLoad_Local('VV'  ,dat,dad,grd,itr,ddf,filesuffix,mnchandle);      VV = DiagLoad_Local('VV'  ,dat,dad,grd,itr,ddf,filesuffix,mnchandle);
313      if isequal(ddf,'MNC')      if isequal(ddf,'MNC')
314          U  = .5*(  U(2:end,:,:,:) +  U(1:end-1,:,:,:) );          U = U(1:end-1,:,:,:); UU = UU(1:end-1,:,:,:);
315          V  = .5*(  V(:,2:end,:,:) +  V(:,1:end-1,:,:) );          V = V(:,1:end-1,:,:); VV = VV(:,1:end-1,:,:);
         %UU = .5*( UU(2:end,:,:,:) + UU(1:end-1,:,:,:) );  % UU and VV might be incorrect.  
         %VV = .5*( VV(:,2:end,:,:) + VV(:,1:end-1,:,:) );  
316      end      end
317      U = DiagAverage(U,fln,avg,months,ddf,Dim);      U  = DiagAverage(U ,fln,avg,months,ddf,Dim);
318      V = DiagAverage(V,fln,avg,months,ddf,Dim);      V  = DiagAverage(V ,fln,avg,months,ddf,Dim);
319      UU = DiagAverage(UU,fln,avg,months,ddf,Dim);      UU = DiagAverage(UU,fln,avg,months,ddf,Dim);
320      VV = DiagAverage(VV,fln,avg,months,ddf,Dim);      VV = DiagAverage(VV,fln,avg,months,ddf,Dim);
321      data = sqrt(abs((U.*U + V.*V) - (UU + VV)));      data = sqrt(abs((U.*U + V.*V) - (UU + VV)));
# Line 409  end Line 407  end
407  % Thus is merely a local function that calls the load data functions  % Thus is merely a local function that calls the load data functions
408  % according to the DataFormat for the data specified by dfm.  % according to the DataFormat for the data specified by dfm.
409  function data = DiagLoad_Local(fln,dat,dad,grd,itr,dfm,filesuffix,mnchandle)  function data = DiagLoad_Local(fln,dat,dad,grd,itr,dfm,filesuffix,mnchandle)
       
410          if isequal(dfm,'MDS')          if isequal(dfm,'MDS')
411          data = rdmds([dad,'/',fln,filesuffix],itr);          data = rdmds([dad,'/',fln,filesuffix],itr);
412          elseif isequal(dfm,'MNC')          elseif isequal(dfm,'MNC')
413          iter = rdmnc_mod([dad,mnchandle],'T');          data = rdmnc_mod2([dad,mnchandle],[fln,filesuffix],'iter','T',itr);
414          iter = iter.T;          if ~isequal(itr,data.iter'), error('Missing iterations in data!'); end
         [dummy,indecies] = ismember(itr,iter);  
         data = rdmnc_mod([dad,mnchandle],[fln,filesuffix],'T',indecies);  
         iter = data.T;  
         if ~isequal(itr,iter'), error('Missing iterations in data!'); end  
415          eval(['data = data.',fln,filesuffix,';']);          eval(['data = data.',fln,filesuffix,';']);
416          else          else
417          error(['Unrecognized data type:  ',dfm]);          error(['Unrecognized data type:  ',dfm]);

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.22