The software bazaar

The software bazaar

As Eric Raymond would say : The software cathedral has failed and the future belongs to the bazaar. To follow his wisdom we provide here the source code of programs for generating, reading and manipulating data in the ALMA data exchange format written by the land-surface modelling community. Everybody is encouraged to contribute : A small bug report is often more useful than 10000 lines of code too complex to be used by anybody ! The source codes should also serve as examples for generating code which deals with data in the ALMA exchange format.

We hope that the list below will expand in the month to comes with tools/programs contributed by the users of the ALMA format.

General netCDF handling routines

Time manipulation
A small program to manipulate the time axis in a netCDF file (Source code available here).
Regular grids
The GDT convention allows to store non-rectilinear grids. This generality is not always needed and not supported by all software packages. Thus it may be useful in some cases to restrict the generality of the coordinates in the file. ncregular does this if possible.
Sign convention
This programs allows to change the sign convention of a file (to be written).
Changing units of files
The units chosen for the ALMA data exchange format are not the most widely used. We thus provide here a code to change the units of Kg/m^2s into mm/d or vice versa (to be written).
Converting from ASCII files to netCDF
A number of programs already exist which transform forcing data for land-surface schemes into netCDF files which comply with the ALMA conventions. The following examples are available for the moment : For data sets which can be downloaded via FTP, the netCDF file as well as the code which generated it are provided.
Some graphical tools to look at netCDF files from GLASS experiments

Using netCDF in our Land-surface scheme

Land-Surface scheme drivers
Quality check program
This program verifies that the netCDF file corresponds to the ALMA standard by verifying the units, sign convention and range of values of all variable. The documentaiton and source code is available here .
Quality check program
This set of programs will verify the energy and water balance in a set of output files conforming with the ALMA convention. It was written for the PILPS-2e experiment but should be usable for other experiments. The code is written in C.
A library to write and read netCDF files directly from your model
This F90 library provides simple subroutines to write efficiently data out of your model or read and write restart files. The IPSL implementation of the PILPS_4c coupler provides an example of its application.
Solar incident angle calculation
Calculate the solar zenith angle and the direction from the information of the point (longitude and latitude) and the time (UTC). (to be written)
Some sample code lines which allow to make your programs more flexible :