--- MITgcm_contrib/enderton/Diagnostics/DiagLoad.m 2005/07/05 18:57:48 1.9 +++ MITgcm_contrib/enderton/Diagnostics/DiagLoad.m 2005/08/10 20:00:35 1.10 @@ -108,7 +108,7 @@ ddf,gdf,avg,slc,pst,LoadGridData,GridSuffix,ZcordFile,Vector,FieldName); % Load coupled fields. Like AIM, the data is all stuffed into one file -% called either 'cplFld.*' (MDS) or 'cpl_tave.*' (MNC). Variables within +% called either 'cplFldtave.*' (MDS) or 'cpl_tave.*' (MNC). Variables within % the MDS files given in 'DiagGenParam', accessed directly with MNC. TX % and TY (stress on ocean) must be converted to lat-lon grid. elseif ismember(fln,cplparameters) @@ -189,7 +189,7 @@ V = DiagAverage(V,fln,avg,months,ddf,Dim); [XC,XG,YC,YG,Ylat,ZC,ZG,RAC,drC,drF,HFacC,HFacW,HFacS,dxG,dyG,dxC,dyC] = ... DiagLoadGridData(LoadGridData,grd,gdf,flu,GridSuffix,ZcordFile); - [U,V]=uvcube2latlon(XC,YC,U,V,XL,YL); + %[U,V]=uvcube2latlon(XC,YC,U,V,XL,YL); if ismember(fln,{'U','uVel','fizhi_U'}) data = U; elseif ismember(fln,{'V','vVel','fizhi_V'}) @@ -311,13 +311,11 @@ UU = DiagLoad_Local('UU' ,dat,dad,grd,itr,ddf,filesuffix,mnchandle); VV = DiagLoad_Local('VV' ,dat,dad,grd,itr,ddf,filesuffix,mnchandle); if isequal(ddf,'MNC') - U = .5*( U(2:end,:,:,:) + U(1:end-1,:,:,:) ); - V = .5*( V(:,2:end,:,:) + V(:,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,:,:) ); + U = U(1:end-1,:,:,:); UU = UU(1:end-1,:,:,:); + V = V(:,1:end-1,:,:); VV = VV(:,1:end-1,:,:); end - U = DiagAverage(U,fln,avg,months,ddf,Dim); - V = DiagAverage(V,fln,avg,months,ddf,Dim); + U = DiagAverage(U ,fln,avg,months,ddf,Dim); + V = DiagAverage(V ,fln,avg,months,ddf,Dim); UU = DiagAverage(UU,fln,avg,months,ddf,Dim); VV = DiagAverage(VV,fln,avg,months,ddf,Dim); data = sqrt(abs((U.*U + V.*V) - (UU + VV))); @@ -409,16 +407,11 @@ % Thus is merely a local function that calls the load data functions % according to the DataFormat for the data specified by dfm. function data = DiagLoad_Local(fln,dat,dad,grd,itr,dfm,filesuffix,mnchandle) - if isequal(dfm,'MDS') data = rdmds([dad,'/',fln,filesuffix],itr); elseif isequal(dfm,'MNC') - iter = rdmnc_mod([dad,mnchandle],'T'); - iter = iter.T; - [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 + data = rdmnc_mod2([dad,mnchandle],[fln,filesuffix],'iter','T',itr); + if ~isequal(itr,data.iter'), error('Missing iterations in data!'); end eval(['data = data.',fln,filesuffix,';']); else error(['Unrecognized data type: ',dfm]);