[Dart-dev] DART/branches Revision: 11144

dart at ucar.edu dart at ucar.edu
Wed Feb 22 21:18:01 MST 2017


thoar at ucar.edu
2017-02-22 21:18:00 -0700 (Wed, 22 Feb 2017)
161
These functions no longer use the third-part netCDF tools.
restored GetNCindices capability to check the 'copy' 
dimension - needed for obs_space netCDF files.




Modified: DART/branches/rma_trunk/diagnostics/matlab/two_experiments_evolution.m
===================================================================
--- DART/branches/rma_trunk/diagnostics/matlab/two_experiments_evolution.m	2017-02-23 00:48:35 UTC (rev 11143)
+++ DART/branches/rma_trunk/diagnostics/matlab/two_experiments_evolution.m	2017-02-23 04:18:00 UTC (rev 11144)
@@ -191,28 +191,19 @@
 end
 
 for i = 1:nexp
-
    varexist(filenames{i}, {priornames{:}, postenames{:}, 'time', 'time_bounds'})
 
-
-   commondata{i}.ncopies   = nc_dim_exists(filenames{i}, 'copy');
-   commondata{i}.nobstypes = nc_dim_exists(filenames{i}, 'obstypes');
-   commondata{i}.nregions  = nc_dim_exists(filenames{i}, 'region');
-   commondata{i}.times     = nc_varget(filenames{i},'time');
-   commondata{i}.time_bnds = nc_varget(filenames{i},'time_bounds');
-   commondata{i}.copyindex = get_copy_index(filenames{i},copystring);
-
-   commondata{i}.lonlim1   = nc_read_att(filenames{i},nc_global,'lonlim1');
-   commondata{i}.lonlim2   = nc_read_att(filenames{i},nc_global,'lonlim2');
-   commondata{i}.latlim1   = nc_read_att(filenames{i}, nc_global,'latlim1');
-   commondata{i}.latlim2   = nc_read_att(filenames{i}, nc_global,'latlim2');
-
-   commondata{i}.region_names = nc_varget(filenames{i},'region_names');
-
-   if (commondata{i}.nregions == 1 && (size(commondata{i}.region_names,2) == 1) )
-      commondata{i}.region_names = deblank(commondata{i}.region_names');
-   end
-
+   commondata{i}.region_names = ncread(filenames{i},'region_names')';
+   commondata{i}.times        = ncread(filenames{i}, 'time');
+   commondata{i}.time_bnds    = ncread(filenames{i}, 'time_bounds');
+   commondata{i}.copyindex    = get_copy_index(filenames{i},copystring);
+   commondata{i}.ncopies      = nc_dim_info(filenames{i}, 'copy');
+   commondata{i}.nobstypes    = nc_dim_info(filenames{i}, 'obstypes');
+   commondata{i}.nregions     = nc_dim_info(filenames{i}, 'region');
+   commondata{i}.lonlim1      = nc_read_att(filenames{i}, '/','lonlim1');
+   commondata{i}.lonlim2      = nc_read_att(filenames{i}, '/','lonlim2');
+   commondata{i}.latlim1      = nc_read_att(filenames{i}, '/','latlim1');
+   commondata{i}.latlim2      = nc_read_att(filenames{i}, '/','latlim2');
 end
 
 % error checking - compare everything to the first experiment
@@ -266,23 +257,23 @@
 plotdat.copystring    = copystring;
 plotdat.region        = regionindex;
 plotdat.levelindex    = levelindex;
-plotdat.bincenters    = nc_varget(fname,'time');
-plotdat.binedges      = nc_varget(fname,'time_bounds');
-plotdat.mlevel        = local_nc_varget(fname,'mlevel');
-plotdat.plevel        = local_nc_varget(fname,'plevel');
-plotdat.plevel_edges  = local_nc_varget(fname,'plevel_edges');
-plotdat.hlevel        = local_nc_varget(fname,'hlevel');
-plotdat.hlevel_edges  = local_nc_varget(fname,'hlevel_edges');
-plotdat.ncopies       = nc_dim_exists(fname,'copy');
+plotdat.bincenters    = ncread(fname,'time');
+plotdat.binedges      = ncread(fname,'time_bounds');
+plotdat.mlevel        = local_ncread(fname,'mlevel');
+plotdat.plevel        = local_ncread(fname,'plevel');
+plotdat.plevel_edges  = local_ncread(fname,'plevel_edges');
+plotdat.hlevel        = local_ncread(fname,'hlevel');
+plotdat.hlevel_edges  = local_ncread(fname,'hlevel_edges');
+plotdat.ncopies       = nc_dim_info(fname,'copy');
 
-dimensionality        = nc_read_att(fname, nc_global, 'LocationRank');
-plotdat.biasconv      = nc_read_att(fname, nc_global, 'bias_convention');
-plotdat.binseparation = nc_read_att(fname, nc_global, 'bin_separation');
-plotdat.binwidth      = nc_read_att(fname, nc_global, 'bin_width');
-plotdat.lonlim1       = nc_read_att(fname, nc_global, 'lonlim1');
-plotdat.lonlim2       = nc_read_att(fname, nc_global, 'lonlim2');
-plotdat.latlim1       = nc_read_att(fname, nc_global, 'latlim1');
-plotdat.latlim2       = nc_read_att(fname, nc_global, 'latlim2');
+dimensionality        = nc_read_att(fname, '/', 'LocationRank');
+plotdat.biasconv      = nc_read_att(fname, '/', 'bias_convention');
+plotdat.binseparation = nc_read_att(fname, '/', 'bin_separation');
+plotdat.binwidth      = nc_read_att(fname, '/', 'bin_width');
+plotdat.lonlim1       = nc_read_att(fname, '/', 'lonlim1');
+plotdat.lonlim2       = nc_read_att(fname, '/', 'lonlim2');
+plotdat.latlim1       = nc_read_att(fname, '/', 'latlim1');
+plotdat.latlim2       = nc_read_att(fname, '/', 'latlim2');
 
 % Coordinate between time types and dates
 
@@ -328,25 +319,27 @@
 if ( dimensionality == 1 ) % observations on a unit circle, no level
    plotdat.level = 1;
    plotdat.level_units = [];
-elseif ( strfind(dimnames{3},'surface') > 0 )
+elseif ( strfind(dimnames{2},'surface') > 0 )
    plotdat.level       = 1;
    plotdat.level_units = 'surface';
    plotdat.level_edges = [];
-elseif ( strfind(dimnames{3},'undef') > 0 )
+elseif ( strfind(dimnames{2},'undef') > 0 )
    plotdat.level       = 1;
    plotdat.level_units = 'undefined';
    plotdat.level_edges = [];
 else
-   plotdat.level       = nc_varget(fname, dimnames{3});
-   plotdat.level_units = nc_read_att(fname, dimnames{3}, 'units');


More information about the Dart-dev mailing list