[Dart-dev] DART/branches Revision: 11076

dart at ucar.edu dart at ucar.edu
Thu Feb 9 14:09:42 MST 2017


thoar at ucar.edu
2017-02-09 14:09:41 -0700 (Thu, 09 Feb 2017)
767
So : plot_total_err.m, plot_ens_mean_time_series.m, and plot_ens_time_series.m
work for lorenz_63 (and probably quite a few others).

The get_hyperslab.m function now has the ability to squeeze out singleton dimensions
by providing a variable,value pair of input arguments:
'squeeze','true' ... eg:

bob = get_hyperslab('fname',filename, 'varname','state', 'squeeze','true');

The native Matlab ncread() function returns the variables in their natural shape -
>> bob = ncread(truth_file,'state');
>> size(bob) ans = 3     1   200

The corresponding ncdump is :
   time = 200 ;
   member = 1 ;
   location = 3 ;
   double state(time, member, location) ;

This is 'reversed' from the mexnc/snctools behavior - so must be diligent about
dimension ordering conversions.




Modified: DART/branches/rma_single_file/matlab/CheckModel.m
===================================================================
--- DART/branches/rma_single_file/matlab/CheckModel.m	2017-02-09 21:08:20 UTC (rev 11075)
+++ DART/branches/rma_single_file/matlab/CheckModel.m	2017-02-09 21:09:41 UTC (rev 11076)
@@ -251,12 +251,12 @@
 % Check for the existence of the named dimension and return it
 % if it exists. If it does not, error out with a useful message.
 
-info = nc_info(fname);
+info = ncinfo(fname);
 n    = length(dimname);
 x    = [];
-for i = 1:length(info.Dimension),
-   if ( strncmp(info.Dimension(i).Name, dimname, n) > 0 )
-      x = info.Dimension(i).Length;
+for i = 1:length(info.Dimensions),
+   if ( strncmp(info.Dimensions(i).Name, dimname, n) > 0 )
+      x = info.Dimensions(i).Length;
       break
    end
 end

Modified: DART/branches/rma_single_file/matlab/CheckModelCompatibility.m
===================================================================
--- DART/branches/rma_single_file/matlab/CheckModelCompatibility.m	2017-02-09 21:08:20 UTC (rev 11075)
+++ DART/branches/rma_single_file/matlab/CheckModelCompatibility.m	2017-02-09 21:09:41 UTC (rev 11076)
@@ -222,12 +222,12 @@
 %% Check for the existence of the named dimension and return it
 % if it exists. If it does not, error out with a useful message.
 
-info = nc_info(fname);
+info = ncinfo(fname);
 n    = length(dimname);
 x    = [];
-for i = 1:length(info.Dimension),
-   if ( strncmp(info.Dimension(i).Name, dimname, n) > 0 )
-      x = info.Dimension(i).Length;
+for i = 1:length(info.Dimensions),
+   if ( strncmp(info.Dimensions(i).Name, dimname, n) > 0 )
+      x = info.Dimensions(i).Length;
       break
    end
 end

Modified: DART/branches/rma_single_file/matlab/GetNCindices.m
===================================================================
--- DART/branches/rma_single_file/matlab/GetNCindices.m	2017-02-09 21:08:20 UTC (rev 11075)
+++ DART/branches/rma_single_file/matlab/GetNCindices.m	2017-02-09 21:09:41 UTC (rev 11076)
@@ -39,10 +39,10 @@
 %
 %      if ( strcmp(lower(vname),'ps') ==1 ) %  PS(time, member, lat, lon)
 %         start = [  1 NaN pinfo.latindex pinfo.lonindex];
-%         count = [ -1 NaN pinfo.latindex pinfo.lonindex];
+%         count = [Inf NaN pinfo.latindex pinfo.lonindex];
 %      else % U(time, member, lev, lat, lon)
 %         start = [  1 NaN pinfo.levelindex pinfo.latindex pinfo.lonindex ];
-%         count = [ -1 NaN pinfo.levelindex pinfo.latindex pinfo.lonindex ];
+%         count = [Inf NaN pinfo.levelindex pinfo.latindex pinfo.lonindex ];
 %      end
 switch lower(whichfile)
     case 'prior'
@@ -62,26 +62,26 @@
 % If the structure has subsetting information, we will ultimately use it.
 % Otherwise, use the whole extent.
 
-lat1        = 0; latN        = -1;
-lon1        = 0; lonN        = -1;
-time1       = 0; timeN       = -1;
-member1     = 0; memberN     = -1;
-level1      = 0; levelN      = -1;
-state1      = 0; stateN      = -1;
-region1     = 0; regionN     = -1;
-cell1       = 0; cellN       = -1;
-column1     = 0; columnN     = -1;
-pft1        = 0; pftN        = -1;
-rankbin1    = 0; rankbinN    = -1;
-bounds1     = 0; boundsN     = -1;
-obstypes1   = 0; obstypesN   = -1;
+lat1        = 1; latN        = Inf;
+lon1        = 1; lonN        = Inf;
+time1       = 1; timeN       = Inf;
+member1     = 1; memberN     = Inf;
+level1      = 1; levelN      = Inf;
+state1      = 1; stateN      = Inf;
+region1     = 1; regionN     = Inf;
+cell1       = 1; cellN       = Inf;
+column1     = 1; columnN     = Inf;
+pft1        = 1; pftN        = Inf;
+rankbin1    = 1; rankbinN    = Inf;
+bounds1     = 1; boundsN     = Inf;
+obstypes1   = 1; obstypesN   = Inf;
 
 if (isfield(pinfo,'timeindex'))
-   time1 = pinfo.timeindex - 1;
+   time1 = pinfo.timeindex;
    timeN = 1;
 end
 if (isfield(pinfo,'tindex1'))
-   time1 = pinfo.tindex1 - 1;
+   time1 = pinfo.tindex1;
 end


More information about the Dart-dev mailing list