The DHARMA Web Interface is an interactive Drag and Drop (DND) interface that allows the user to create a diagram that visually represents a simulation run. The interface is deployed on client machines using Java Web Start and is written in Java. We have found that the best configuration to run the interface is to use Java 1.4.1 and Web Start 1.0.1. Although, it should work with Web Start 1.2.
Creating a Watershed Diagram
The first step is to place buttons on the screen that represent watershed elements, such as hillslopes or junctions. Each button represents a simulation that runs. Hillslopes uses the WEPP model, while junctions use the SITES model. To add a button to the diagram, just drag the button from the left onto the workarea.
These buttons can be connected in the DND interface by drawing a line from a hillslope to a junction to create a dependency. This is done by clicking on the "Draw Line" button just below the file menu. When this button is depressed, you can draw a dependency or line between buttons by clicking within a few pixels of a button and dragging on top of the button that depends on the first button. Clicking directly on the first button will only bring up a dialog, so be sure to click within a few pixels of it.
Before the SITES model can be executed, all the hillslope simulations that run into the junction must finish. This is handled by the middleware server. All task dependencies are sent to the middleware so that the appropriate scheduling can be done.
To set up a hillslope or a junction, click on the button for the simulation. A dialog should open that allows the user to setup each simulation and provide it with the appropriate files.
The junction button dialog is quite simple. All the user needs to do is click on the "SITES junction" simulation checkbox and then click "Reset Inputs". Now there should be 2 tabs, a Simulation tab and an Output tab. The main tab for the SITES simluation is the Output tab. This is where you will see the results once the simulation has finished.
Clicking on the hillslope button allows the user to supply the files needed to model the hillslope. The user must click the "WEPP simulation" checkbox and then click the "Reset Inputs" button in order for tabs to be created that accept these inputs. Now there should be 4 tabs showing including the Simulation, Climate, Other Files, and Output tabs. On the "Climate" tab, there is a textfield where you can supply the climate file path, or you can use the button next to it to choose the file you want to use. Another option is to fill in the fields for the climate manually. On the "Other Files" tab, you need to provide the slope, the soil, and the management files for the hillslope you are simulating. Each of these 4 files need to be provided to WEPP for the simulation to run:
When these files are added, click "OK." The inputs need to be set for every hillslope in your watershed. Also, for every junction in the watershed, the simluation must be selected and the inputs reset. Once you have constructed a valid watershed and added the appropriate file paths to the WEPP simluations, you are now ready to start the simulation.
Running a Watershed Simulation
To run a job, all the user has to do is select the "Start Job" command, located under the "File" menu. At this point, the user just needs to wait a few minutes according to their connection speed and how big the watershed is. The user can periodically check to see if the job is still running. To do this, just click on the final junction button in the watershed and go to the "Output" tab. From there, you can click on the "Check Job Status" to see if the job is finished, still running, or encountered an error. Eventually, the results will be returned to the textarea on the output tab. From there you can view the results of the watershed simulation as discussed below.
When running a simulation, all the files that the user provided for each hillslope are cached if they don't already exist. As they are being cached, they are formatted to be used by the WEPP model. Once, all the files are cached, tasks are created for all the simulations including SITES. These tasks are scheduled according to their dependencies within the middleware server. This ensures that a junction won't be simulated before all the hillslopes that run into it are finished.
After all the jobs have been created, the middleware server finds a client machine to run the simulation. The server can delegate tasks to multiple clients to run simultaneous WEPP models with regard to dependencies. The results from each task are cached once the simulations are finished. Additional tasks are sent to each client machine as they become idle. Once all tasks have been run the data is merged into a large hydrograph, which is also cached for viewing.
Viewing the Results
Once the simulation has finished, you can use the GUI to display the results. To view the results from a WEPP simulation, click on the hillslope button and then select the "Output" tab. From there, click on the "Check Job Status" button. This should return a collection of links in the textarea on the tab. The collection of links contain various output files from WEPP. To view the hydrograph produced by the WEPP simulation, just click on the link in the textarea labeled general.types.hydrograph. The display should be similar to this hydrograph if the watershed is nontrivial. To view the results from the final SITES simulation, click on the junction button and follow the steps as above to view the hydrograph that was produced.