Warning, /utils/matlab/Graphix/GraphixLoadGridData.m is written in an unsupported language. File is not indexed.
view on githubraw file Latest commit e5f86a2f on 2005-11-25 06:32:19 UTC
e5f86a2f55 Dani*0001 function [nc,dim,XC,XG,YC,YG,ZC,ZF,RAC,drC,drF,HFacC,...
5bbd0d07c9 Dani*0002 HFacW,HFacS,dxG,dyG,dxC,dyC,AngleCS,AngleSN] = ...
0003 DiagLoadGridData(LoadGridData,grd,gdf,flu,GridSuffix,ZcordFile)
0004
0005 if ismember(flu,{'C','L'}), flu = 'A'; end
0006 if ismember(flu,{'I'} ), flu = 'O'; end
0007 grdfile = [grd,'/GridData',flu,GridSuffix,'.mat'];
0008
0009 % If LoadGridData is turned on, load grid data from the model output files.
0010 % If it is turned off, load it from the data file where saved from a
0011 % previous loading of the raw data. The file name (and path) of this file
0012 % is set in the DiagGenParam file.
0013 if LoadGridData
0014
0015 if isequal(gdf,'MDS')
0016 XC = rdmds([grd,'/','XC' ]);
0017 YC = rdmds([grd,'/','YC' ]);
0018 XG = rdmds([grd,'/','XG' ]);
0019 YG = rdmds([grd,'/','YG' ]);
0020 dxC = rdmds([grd,'/','DXC']);
0021 dyC = rdmds([grd,'/','DYC']);
0022 dxG = rdmds([grd,'/','DXG']);
0023 dyG = rdmds([grd,'/','DYG']);
0024 RAC = rdmds([grd,'/','RAC']);
0025 HFacC = rdmds([grd,'/','hFacC']);
0026 HFacS = rdmds([grd,'/','hFacS']);
0027 HFacW = rdmds([grd,'/','hFacW']);
c578fd6b1e Dani*0028 dim = size(XC); nc = dim(2);
5bbd0d07c9 Dani*0029
0030 % Information for z-axis.
0031 if isequal(ZcordFile,'')
0032 load(['Zcord',flu,GridSuffix,'.mat']);
0033 else
0034 load(ZcordFile);
0035 end
0036
0037 elseif isequal(gdf,'MNC')
2754a09a07 Dani*0038 if isempty(dir([grd,'/grid.*'])), ls([grd,'/grid.*']); end
0039 data = rdmnc([grd,'/grid.*']);
5bbd0d07c9 Dani*0040 dim = size(data.XC); nc = dim(2);
0041 RAC = data.rA;
0042 XC = data.XC(1:6.*nc,1:nc); dxC = data.dxC(1:6.*nc,1:nc);
0043 XG = data.XG(1:6.*nc,1:nc); dxG = data.dxG(1:6.*nc,1:nc);
0044 YC = data.YC(1:6.*nc,1:nc); dyC = data.dyC(1:6.*nc,1:nc);
0045 YG = data.YG(1:6.*nc,1:nc); dyG = data.dyG(1:6.*nc,1:nc);
0046 ZC = data.RC; drC = data.drC;
0047 ZF = data.RF; drF = data.drF;
0048 HFacC = data.HFacC(1:6.*nc,1:nc,:);
0049 HFacW = data.HFacW(1:6.*nc,1:nc,:);
0050 HFacS = data.HFacS(1:6.*nc,1:nc,:);
0051 %AngleCS = data.AngleCS;
0052 %AngleSN = data.AngleSN;
0053 end
0054
0055 [AngleCS,AngleSN] = cubeCalcAngle(YG,RAC,dxG,dyG);
0056
e5f86a2f55 Dani*0057 save(grdfile,'XC','XG','YC','YG','ZC','ZF','RAC','drC','drF',...
5bbd0d07c9 Dani*0058 'HFacC','HFacW','HFacS','dxG','dyG','dxC','dyC','AngleCS',...
0059 'AngleSN','dim','nc');
0060
0061 % If LoadGridData is turned off, load it from the data file where saved
0062 % from a previous loading of the raw data.
0063 else
0064 load(grdfile)
0065 end