You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 18, 2018. It is now read-only.
placed within a subdirectory with a name such as ``mnc_output_`` (by default, NetCDF tries to append, rather than overwrite, existing files,
655
664
so a unique output directory is helpful for each separate run).
656
665
666
+
667
+
The MNC output files are all in the “self-describing” NetCDF format and
668
+
can thus be browsed and/or plotted using tools such as:
669
+
670
+
- `ncdump <https://www.unidata.ucar.edu/software/netcdf/netcdf-4/newdocs/netcdf/ncdump.html>`_ is a utility which is typically included with every NetCDF
671
+
install, and converts the NetCDF binaries into formatted ASCII text files.
672
+
673
+
- `ncview <http://meteora.ucsd.edu/~pierce/ncview_home_page.html>`_ is a very convenient and quick way to plot NetCDF
674
+
data and it runs on most platforms. `Panoply <https://www.giss.nasa.gov/tools/panoply/>`_ is a similar alternative.
675
+
676
+
- Matlab, GrADS, IDL and other common post-processing environments provide
677
+
built-in NetCDF interfaces.
678
+
679
+
657
680
Looking at the output
658
681
---------------------
659
682
660
-
The traditional or ``mdsio`` model data are written according to a
661
-
“meta/data” file format. Each variable is associated with two files with
662
-
suffix names ``.data`` and ``.meta``. The ``.data`` file contains the
663
-
data written in binary form (big endian by default). The ``.meta`` file
664
-
is a “header” file that contains information about the size and the
665
-
structure of the ``.data`` file. This way of organizing the output is
666
-
particularly useful when running multi-processors calculations. The repository
667
-
version of the model includes a few Matlab utilities to read output
668
-
files written in this format. The Matlab scripts are located in the
683
+
MATLAB
684
+
~~~~~~
685
+
686
+
MDSIO output
687
+
############
688
+
689
+
The repository includes a few Matlab utilities to read output
690
+
files written in the ``mdsio`` format. The Matlab scripts are located in the
669
691
directory ``utils/matlab`` under the root tree. The script ``rdmds.m``
670
692
reads the data. Look at the comments inside the script to see how to use
671
693
it.
@@ -686,20 +708,44 @@ Some examples of reading and visualizing some output in Matlab:
686
708
>> eta=rdmds('Eta',[0:10:100]);
687
709
>> for n=1:11; imagesc(eta(:,:,n)');axis ij;colorbar;pause(.5);end
688
710
711
+
712
+
NetCDF
713
+
######
714
+
689
715
Similar scripts for netCDF output (``rdmnc.m``) are available and they
690
716
are described in Section [sec:pkg:mnc].
691
717
692
-
The MNC output files are all in the “self-describing” NetCDF format and
693
-
can thus be browsed and/or plotted using tools such as:
694
718
695
-
- `ncdump <https://www.unidata.ucar.edu/software/netcdf/netcdf-4/newdocs/netcdf/ncdump.html>`_ is a utility which is typically included with every NetCDF
696
-
install, and converts the NetCDF binaries into formatted ASCII text files.
719
+
Python
720
+
~~~~~~
697
721
698
-
- `ncview <http://meteora.ucsd.edu/~pierce/ncview_home_page.html>`_ is a very convenient and quick way to plot NetCDF
699
-
data and it runs on most platforms. `Panoply <https://www.giss.nasa.gov/tools/panoply/>`_ is similar alternative.
722
+
MDSIO output
723
+
############
700
724
701
-
- Matlab, GrADS, IDL and other common post-processing environments provide
702
-
built-in NetCDF interfaces.
725
+
The repository includes Python scripts for reading the ``mdsio`` format under ``utils/python``. The following example shows how to load in some data:
726
+
727
+
::
728
+
729
+
# python
730
+
import mds
731
+
732
+
Eta = mds.rdmds('Eta', itrs=10)
733
+
734
+
The docstring for ``mds.rdmds`` contains much more detail about using this function and the options that it takes.
735
+
736
+
NetCDF output
737
+
#############
738
+
739
+
The NetCDF output is currently produced with one file per processor. This means the individual tiles need to be stitched together to create a single NetCDF file that spans the model domain. The script ``gluemncbig.py`` in the ``utils/python`` folder can do this efficiently from the command line.
740
+
741
+
The following example shows how to use the `xarray package <http://xarray.pydata.org/>`_ to read the resulting NetCDF file into python:
0 commit comments