NetCDF output for GeoClaw

51 views
Skip to first unread message

Randall J. LeVeque

unread,
Apr 14, 2011, 1:53:21 AM4/14/11
to Developers of Clawpack
Thanks to Josh Jacobs, there is now an option to output NetCDF files
rather than ASCII files from GeoClaw. So far this is only in
branches/4.6.x. This will be extended to AMRClaw more generally and also
to classic Clawpack in the future.

Instead of the usual files fort.tXXXX and fort.qXXXX in the output
directory, there will generate one set of files fort.qXXXX.nc that are
about 25% the size the fort.qXXXX files would be.

To output from Fortran in NetCDF format, adjust the Makefile to replace
$(GEOLIB)/valout_geo.f \
by
$(GEOLIB)/valout_nc_geo.f \
and add the Fortran flags
FFLAGS ?=-I/usr/include -lnetcdf -lnetcdff

This assumes that the NetCDF libraries are installed and that the file
/usr/include/netcdf.inc
exists, see below.

The Python plotting tools have also been modified to support reading
in NetCDF files. Simply set
plotdata.format = "netcdf"
in the setplot function to use this, assuming the required Python
modules are installed.

There are also files in 4.6.x/util to do the conversion of both the Makefile
and the setplot.py file automatically. Josh provided both Python and
bash+perl script versions: update_nc_param.bash and update_nc_param.py


NetCDF INSTALLATION:

You may first have to install NetCDF for both Fortran and Python.
On Ubuntu things should work (famous last words) if you install the
following packages (in addition to gfortran, NumPy and SciPy):

python-netcdf
python-scientific
libnetcdf4
libbetcdf-dev

Please report difficulties (or success)

- Randy

Reply all
Reply to author
Forward
0 new messages