To build a coupling toolkit for linking together EH models, one assumption was that these models would be possibly large, legacy Fortran codes. Rather than try to wrap some handler around them, the idea was to insert some send and receive subroutines which would get data in and out of the model, performing a minimum amount of modification to the code. The less code modification required, the more likely the owner of a given model would be willing to use the toolkit.
The work of transforming data between two grids is contained in a separate program called the coupler. We decided to build a small specialized socket library to implement communication between programs, and a free-standing grid interpolation program. The socket approach allows for maximum flexibility, and allows for easy extensions to remote computing applications.
On the assumption that inetrpolation would take place on rectangular grids, we decided that the coupler should be generic, so that multiple instances of the coupler might be used in a single simulation. The coupler learns what data it has to manage and what the grid sizes are from command line arguments and from handshaking done during initialization with the coupling library. However, where grids are not rectangular, extensions to the coupler code would be needed.
The particular case we undertook linked the MM5 mesoscale meteorology model with a subset of the CASC2D hydrology model. This architecture is diagrammed above. While the second coupler shown above is possible in principle we did not in fact have occasion to use more than a single coupler instance to date.
back to Environmental Hydrology Workbench home page