NetCDF, udunits, and CPP for macintosh


NetCDF Library for Macintosh
NetCDF (network Common Data Format) is a scientific cross-platform array-oriented binary data format developed at Unidata. It allows to store both data and metadata (that is, descriptive information, like units, comments, history tags etc.) in a single file, which greatly facilitates using the data sets. The library provides API to read, write and modify NetCDF data sets for both C and FORTRAN. For more information, terms of usage, and full documentation please visit Unidata NetCDF page

From this page you can download Macintosh version of this library, for both PowerPC and 68K, and two MPW tools working with NetCDF files (they are a part of source distribution). The MPW libraries and tools were built with MrC v.4.1 and SC v.8.8.4 for PowerPC and 68K respectively; FORTRAN library was built for Absoft FORTRAN: I tested it with ABSOFT f77 v.4.4, but I suppose it should work with later versions, too. Metrowerks libraries were compiled with CodeWarrior Pro 2. I do not know if they work with later versions of the environment: most likely they do not, so you will have to download source code and rebuild them. Please let me know if (when) you find any Mac-specific bugs.

Feb 2, 2002 : new release of the library source code. Note that the changes are only in scripts, Makefiles, and checking tools; library itself did not change.

  • Fixed bugs in MPW scripts and Mac-specific Makefiles that resulted in errors when pathname to MPW or library contained spaces (big thanks to Roy Mendelssohn for finding this bug).
  • FORTRAN library now builds automatically if f77 compiler is present.
  • Tools for checking of old NetCDF interface calls, for both FORTRAN and C are built and executed by checking script.

For detailed information read mac-specific realease notes

Download:

udunits library
udunits is a unit conversion library developed at Unidata. It allows you to convert units, check for units compatibility, etc. It also includes a command line tool for data conversion. For more information, please visit udunits web page

The MPW libraries and tools were built with MrC v.4.1 and SC v.8.8.4 for PowerPC and 68K respectively; FORTRAN library was built for Absoft FORTRAN (f77 v.4.4). Metrowerks libraries were compiled with CodeWarrior Pro 2. Please let me know if (when) you find any Mac-specific bugs.

Read mac-specific release notes.

Download:

CPP preprocessor
It is rather common practice among big FORTRAN projects to use C preprocessor to handle the code. While most UNIX FORTRAN compilers allow to do it effortlessly, on a Mac it is not so easy. The problem is that FORTRAN compiler I am using (ABSOFT v.4.4) does not have an option to preprocess source code, while standard MPW preprocessors (SC, MRC, and SCpre) assume that source code is in C language, and handle it accordingly. It means that they do not preserve leading spaces, complain on strings in single quotaion marks, etc. Therefore to compile the NetCDF test of FORTRAN library I built a preprocessing tool which handles FORTRAN code gracefully, using Marting Minow source code with slight modifications. I guess it is a useful tool by itself, so feel free to donload it. Note that I did not test it extensively, so do not expect it to be free of bugs.