Friday, January 8, 2010

Run HEC-1 on Ubuntu Linux using WINE and DOSBOX

For years I have run HEC-1 under Windows XP by extracting the HEC-1 installation package files to C:\HECEXE and C:\HECEXE\SUP as explained in the INSTALL.WPD file found in the installation package. Basically, I put the zip files HEC1EXE and COEDEXE in the HECEXE directory and the rest of the zip files in the SUP sub-directory. Then I put my data files in HECEXE while I am working with them so I won't have to worry about paths.

But now I am running Windows Vista. I thought I had been running HEC-1 under Vista, but apparently not. The HEC web site says HEC-1 Extended Memory version (for 2000 time steps) wont' run under Vista. Then again, they also say it won't run under XP, which I know isn't always true.

Update 2001-01-30: I learned from the Eng-Tips forum that hec1.exe will run under 64-bit Windows even if some of its support files like the installer, COED, and MENU1 won't. Therefore it works to download the installer, rename its extension to zip, and extract only hec1.exe from it.

Since "the show must go on", I thought I would try running under Linux the HEC-1 file I'm preparing for Laveen Elementary School in Phoenix. I have an old computer that was becoming a nightmare with Windows 98, so we put Ubuntu on it rather painlessly. I wanted to run the HEC-1 file on that computer.

I took the data file home and installed WINE and DosBox. As it turned out for me (being a complete Linux novice), I was able to run the MENU1 program and COED under DosBox, but I had to run HEC-1.EXE using WINE, probably because it is an extended memory version.

So here's what I did:

1. Install WINE and DosBox from the Ubuntu Applications > Add/Remove... menu.

2. Open the WINE C:\ drive using Applications > WINE > Browse C:\ Drive. Note where it resides in your Linux account. Mine was at /home//.wine/drive_c

3. Make a hecexe folder and a hecexe/sup folder under the c_drive. Install (unzip) all the HEC-1 files to their proper directories.

4. Open DOSBox using Applications > Games > DOSBox Emulator. You should get a Z:/> dos prompt.

5. Type mount c ~/.wine/drive_c to "mount" C: at the WINE C: drive directory. (The tilde "~" represents your /home/ directory) You should then be able to type these DOS commands to get MENU1 to run.


C:
cd hecexe
menu1


6. As I said, you can use COED and view your output within MENU1, but you can't run the extended memory version of HEC-1 with DOSBox out of the box. So Now exit MENU1 and DOSBox (if necessary to return control to Ubuntu Linux). Go to hec1.exe in the Linux file browser. Right click the file and select to open with WINE.

7. HEC1.EXE will prompt you for the input, output, and dss (optional) file names. Type them as requested. I typed school.dat, school.out, and empty for the dss file.

8. Repeat 6 and 7 as necessary.

Improvements gladly accepted.

No comments: