<p><b>mpetersen@lanl.gov</b> 2012-05-29 14:20:32 -0600 (Tue, 29 May 2012)</p><p>Add read_uTransportSection.m to matlab scripts. This is a small script to read high frequency transport text file produced by matlab.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/tools/transport_sections/README
===================================================================
--- branches/tools/transport_sections/README        2012-05-29 20:18:12 UTC (rev 1944)
+++ branches/tools/transport_sections/README        2012-05-29 20:20:32 UTC (rev 1945)
@@ -14,7 +14,7 @@
where wd is the working directory and dir is the run directory.
Details of the section coordinates and variables may be specified in
-transport_sections.m.
+transport_sections.m.
The data files only need to contain a small number of variables.
You may need to reduce the file size before copying to a local
@@ -25,8 +25,17 @@
dvEdge \
file_in.nc file_out.nc
-This plotting tool has been tested for ocean output files, but should
+The matlab scripts will create a new netcdf file named
+{your_domain}_section_edge_data.nc. To merge this file with an
+existing grid or restart file, use:
+
+ncks -A -v sectionEdgeIndex,sectionEdgeSign,nEdgesInSection,\
+sectionText,sectionAbbreviation,sectionCoord \
+{your_domain}_section_edge_data.nc your_restart_file.nc
+
+These matlab tools have been tested for ocean output files, but should
nearly work for other cores as well. A few lines will need to be
-changed.
+changed.
Mark Petersen, MPAS-Ocean Team, LANL, May 2012
+
Added: branches/tools/transport_sections/read_uTransportSection.m
===================================================================
--- branches/tools/transport_sections/read_uTransportSection.m         (rev 0)
+++ branches/tools/transport_sections/read_uTransportSection.m        2012-05-29 20:20:32 UTC (rev 1945)
@@ -0,0 +1,75 @@
+% read_u_TransportSection
+%
+% Matlab script to plot output of uTransportSection.txt,
+% the high frequency instantanious transport output.
+
+% Mark Petersen, MPAS-Ocean Team, LANL, May 2012
+
+wd = '.';
+filename=[wd '/uTransportSection.txt'];
+
+a= load('uTransportSection.txt');
+nTimeSlices = size(a,1);
+nSections = size(a,2)-1;
+uTransportSection = a(:,2:nSections+1);
+
+% this is not quite working.
+
+%sectionAbbreviation = load(filename);
+% sectionAbbreviation
+%filename=[wd '/sectionAbbreviation.txt'];
+%fid = fopen(filename,'r');
+%for j=1:nSections
+% for k=1:8
+% sectionAbbreviation(j,k) = fscanf(fid,' %c');
+% end
+%
+%end
+%fclose(fid);
+%sectionAbbreviation
+
+sectionAbbreviation = [...
+ 'Drake Pa';...
+ 'Tasm-Ant';...
+ 'Afri-Ant';...
+ 'Antilles';...
+ 'Mona Pas';...
+ 'Wind Pas';...
+ 'FL-Cuba ';...
+ 'FL-Baham';...
+ 'Ind Thru';...
+ 'Agulhas ';...
+ 'Mozam Ch';...
+ 'Bering ';...
+];
+
+subplot(2,1,1)
+plot(uTransportSection)
+axis tight
+grid on
+xlabel('time counter')
+ylabel('transport, Sv')
+title('total flow')
+for j=1:nSections
+ legendText(j) = {[ sectionAbbreviation(j,:) ':' ...
+                 num2str(mean(uTransportSection(:,j)),'%5.2f') ]};
+end
+legend(legendText,'location','NorthEast');
+
+uTransportMinusMean = zeros(size(uTransportSection));
+for j=1:nSections
+ uTransportMinusMean(:,j) = uTransportSection(:,j) - mean(uTransportSection(:,j));
+end
+subplot(2,1,2)
+plot(uTransportMinusMean)
+axis tight
+grid on
+xlabel('time counter')
+ylabel('transport, Sv')
+title('flow variability (total-mean)')
+
+ set(gcf,'PaperPositionMode','auto','color',[.8 1 .8], ...
+         'PaperPosition',[0.25 0.25 8 8])
+
+ subplot('position',[0 .95 1 .05]); axis off
+ text(.005,.7,[ date ]);
</font>
</pre>