Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#60 closed request (Done)

Support for linking to netCDF 4 libraries

Reported by: m.hadfield Owned by: arango
Priority: minor Milestone: Parallel Input/Output
Component: Parallelism Version: 3.1
Keywords: make, netcdf Cc:

Description

As we know, ROMS will eventually move to using netCDF 4, allowing various enhancements like parallel I/O and compression. In the meantime, I have been experimenting with using netCDF 4 libraries as a direct substitute for netCDF 3 libraries. It turns out that the only change required in ROMS is to add some linker flags to link to the underlying HDF5 and Zlib libraries. For the current versions of netCDF 4 and HDF5 the flags required are:

-lnetcdf -lhdf5_hl -lhdf5 -lz

I suggest the following changes to support this:

  • In makefile, add a variable USE_NETCDF4 (similar to the other USE_* variables).
  • In the platform-specific makefiles, add an "ifdef USE_NETCDF4" block to set the flags.

Files are attached.

In future I expect USE_NETCDF4 will also be used to set preprocessor flags to support netCDF 4 features in the code.

Attachments (2)

makefile (17.1 KB) - added by m.hadfield 14 years ago.
ROMS make file
CYGWIN-g95.mk (3.7 KB) - added by m.hadfield 14 years ago.
Example platform-specific make file

Download all attachments as: .zip

Change History (4)

Changed 14 years ago by m.hadfield

ROMS make file

Changed 14 years ago by m.hadfield

Example platform-specific make file

comment:1 Changed 14 years ago by arango

  • Component changed from Nonlinear to Parallelism
  • Resolution set to Done
  • Status changed from new to closed

Yes, good idea. I compiled ROMS with NetCDF-4 and it runs fine. I added also a macro definition for the location of HDF5 library. HDF5 is usually installed in a different directory.

Notice that for the NetCDF-4 to work, we need to link with both the HDF5 and MPI libraries. The parallel IO for ROMS is now on my priority list. Some changes are needed in ROMS IO structure for the parallel IO.

I also added the linking definitions for the ESMF library.

comment:2 Changed 14 years ago by arango

  • Milestone changed from Release ROMS/TOMS 3.0 to Parallel Input/Output
Note: See TracTickets for help on using tickets.