While there is quite some matlab support for viewing POM-generated netcdf data, this requires a lot of knowledge of the data itslef to employ. For a quick, easy-to-use interface for viewing POM files, ncview comes to mind.
Paraview will also do the job, but you will have to slice the 3D data manually.
In order to build and install ncview, you will neede yet another copy of hdf5 and netcdf, this time compiled with netcdf 4 support and built with the same compiler you plan to build ncview with.
You will need the latest version of hdf5 and netcdf 4.1.3; you can find the links in previous posts in this blog.
What you will need to do prior to building hdf5 is install the zlib library, also build it manually, also with the same compiler as all the other stuff.
There IS a trick to it to make it all work - you need to install all of these into a same folder. Yes, I know they're supposed to be linkable, but it doesn't work. There is actually an explanation online to why is that so, and why the --with- tags don't work in ./configure for this case, you can look for it if you're curious.
I have chosen to dump everything into /usr/local/hdf5ncdf, you can use any folder you like and it doesn't have to be in /usr/local/, just put everything in the same one.
Build zlib like this:
./configure --prefix=/usr/local/hdf5ncdf
make
make check
make install
Then you build HDF5, specifying the location of the zlib library:
FC=gfortran CC=gcc CXX=g++ ./configure --with-zlib=/usr/local/hdf5ncdf -- prefix=/usr/local/hdf5ncdf --enable-fortran --enable-f77 --enable-f90
make
make check
make install
After HDF5 is done, build netcdf, specifying the location of the HDF5, zlib, and (if built into HDF5) the szip header files and libraries in the CPPFLAGS and LDFLAGS environment variables.
export CPPFLAGS="-I/usr/local/hdf5ncdf/include"
export LDFLAGS="-L/usr/local/hdf5ncdf/lib"
FC=gfortran CC=gcc CXX=g++ ./configure --prefix=/usr/local/hdf5ncdf --enable-fortran --enable-parallel --disable-shared --enable-f77 --enable-f90 --enable-netcdf-4
make
make check
make install
All of this done, you should have a working copy of netcdf 4.1.3 with netcdf-4 suport and zlib support, all built for gfortran, gcc and g++. Note that if you're using different compilers, you should invoke them instead of these three!
Installing ncview itself
What the ncview install data won't tell you, but thankfully the compiler in ubuntu will, is that you require the following libraries prior to a successful ncview installation:
- Athena Widgets = XAW packages for ubuntu
- libpng development packages
Go ahead and pick these up from the repositories. Note that I was using a KDE plasma desktop and sucked them off the kubuntu repos, but the ubuntu ones should be identical.
Here is how you should run the configure script once you installed the libraries. Note (and adjust) the correct paths to your own netcdf / hdf5 installations:
sudo ./configure --with-netcdf_incdir=/usr/local/hdf5ncdf/include/ --with-netcdf_libname=/usr/local/hdf5ncdf/lib/ --with-netcdf_libdir=/usr/local/hdf5ncdf/bin/ --with-nc-config=/usr/local/hdf5ncdf/bin/nc-config
In my kubuntu, I need to run ncview from console, e.g. like this:
ncview /home/fireice/Documents/POM_materials/pom2k/pon2k.nc