Project: Flooding

Develop C/C++ code to simulate and vizualize (animate?) rising sea-level.

You could assume that the amount of the rise is specified by the user on the command line, but this is not absolutely necessary and depends on your interface (for example, maybe you want to do it so that every time you press "+" water rises by 1m).

Coding water: The level of the sea is assumed to be 0. Often grid terrains code water as NODATA. Depending on where you download your grid from, your grid may contain water coded as zero or-sub-zero (see below).


A good grid to use is brunsdem.asc (brunswick area), which you’ll find with the other grids here.

Another good one is the elevation dataset for Maine coast (Portland area), which you’ll find in a directory called Portland_DEM_1161/, and inside it is the ascii file and also a document explaining how the data was obtained. It was built from several layers of data put together, with the goal of modeling Tsunami effects and flooding, which is exactly what you are doing in this project! This is the most accurate, up-to-date dataset available of Maine.

The dataset is quite large, 10,00 rows and 10,000 columns, approximately 100 million elements. If you try to download it, be aware that it’s 1.1GB. Please do NOT check it in the svn folder, as it will probably crash it.

If you look at it (with less|more, don;t open it in an editor because it will likely crash it) You’ll also notice that it contains actual below-zero water elevation!! (that’s why its called an integrated elevation-bathymetry model). So for this set you’ll need to consider water anything with sub-zero elevation. What exactly you consider water should be easily defined at the top of your code, for example I would write the code in terms of a generic function int isWater(float elevation) { return (elevation == -9999) //return (elevation < 0); }

Submitting your work

Make a folder called flooding in your svn folder on microwave, and update it with your work.