<p><b>mpetersen@lanl.gov</b> 2012-08-02 09:09:13 -0600 (Thu, 02 Aug 2012)</p><p>Updating matlab script to compute transport through sections.  This now works even if the netcdf file is missing the nTimeSlices dimension.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/tools/transport_sections/load_large_variables_edge.m
===================================================================
--- branches/tools/transport_sections/load_large_variables_edge.m        2012-08-01 22:11:05 UTC (rev 2079)
+++ branches/tools/transport_sections/load_large_variables_edge.m        2012-08-02 15:09:13 UTC (rev 2080)
@@ -34,7 +34,14 @@
 
 [dimname,nVertLevels]= netcdf.inqDim(ncid,netcdf.inqDimID(ncid,'nVertLevels'));
 [dimname,nEdges]= netcdf.inqDim(ncid,netcdf.inqDimID(ncid,'nEdges'));
-[dimname,nTimeSlices]= netcdf.inqDim(ncid,netcdf.inqDimID(ncid,'Time'));
+
+% see if nTimeSlices dimension exists.  If not, set nTimeSlices to 1.
+try 
+  [dimname,nTimeSlices]= netcdf.inqDim(ncid,netcdf.inqDimID(ncid,'Time'));
+catch 
+  nTimeSlices = 1;
+end
+
 nVars = length(var_name);
 nSections = length(nEdgesInSection);
 

Modified: branches/tools/transport_sections/transport_sections.m
===================================================================
--- branches/tools/transport_sections/transport_sections.m        2012-08-01 22:11:05 UTC (rev 2079)
+++ branches/tools/transport_sections/transport_sections.m        2012-08-02 15:09:13 UTC (rev 2080)
@@ -40,22 +40,27 @@
 %
 % and acc_u is only required if the flux is computed by this matlab script.
 
-sim(1).dir = 'x5.NA.75km_15km';
-sim(1).netcdf_file = ['o.x5.NA.75km_15km.0027-01-01_00.00.00_acc_u.nc'];
+sim(1).dir = 'x5.NA.15km/average';
+sim(1).netcdf_file = ['total_avg_o.x5.NA.15km.0012-01-01_00.00.00.nc'];
 
-sim(2).dir = 'x5.NA.75km_15km/LEITH';
-sim(2).netcdf_file = ['o.x5.NA.75km_15km.0027-01-01_00.00.00_acc_u.nc'];
+%sim(1).dir = 'x5.NA.75km_15km';
+%sim(1).netcdf_file = ['o.x5.NA.75km_15km.0027-01-01_00.00.00_acc_u.nc'];
 
-sim(3).dir = 'x1.15km';
-sim(3).netcdf_file = ['o.x1.15km.0018-11-03_00.00.00_acc_u.nc'];
+%sim(2).dir = 'x5.NA.75km_15km/LEITH';
+%sim(2).netcdf_file = ['o.x5.NA.75km_15km.0027-01-01_00.00.00_acc_u.nc'];
 
-sim(4).dir = 'x5.NA.37.5km_7.5km';
-sim(4).netcdf_file = ['o.x5.NA.37.5km_7.5km.0007-01-01_00.00.00_acc_u.nc'];
+%sim(3).dir = 'x1.15km';
+%sim(3).netcdf_file = ['o.x1.15km.0018-11-03_00.00.00_acc_u.nc'];
 
+%sim(4).dir = 'x5.NA.37.5km_7.5km';
+%sim(4).netcdf_file = ['o.x5.NA.37.5km_7.5km.0007-01-01_00.00.00_acc_u.nc'];
+
 %clear sim
 %sim(1).dir='x1.120km';
 %sim(1).netcdf_file = 'output120km.0001-10-22_12:30:00.nc';
 
+
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
 %  Specify section coordinates and text
@@ -218,7 +223,7 @@
        sim(iSim).sectionEdgeIndex, sim(iSim).nEdgesInSection,...
        fid_latex);
   end
-return
+
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   %
   %  Load large variables from netcdf file

</font>
</pre>