djlampert / PyHSPF

Python extensions to the Hydrological Simulation Program in Fortran (HSPF), including classes for gathering input data, building input files, performing simulations, postprocessing results, calibrating hydrology process parameters, and forecasting climate and land use change effects on water resources
Other
83 stars 51 forks source link

unable to open message file #4

Closed mengfeimu closed 6 years ago

mengfeimu commented 6 years ago

It seems WDMUtil runs into some problems. When I run examples/test/test01.py, the error shows:

unable to open message file

I copied hspfmsg.wdm to another folder, but it didn't work. Do you have any idea what's the reason behind this? By the way, I installed the pyhspf 0.2.4 from PyPI few days ago. Thanks!

mengfeimu commented 6 years ago

I temporally solved this problem by set messagepath to the hspfmsg.wdm in BASINS software folder:

messagepath = 'C:/BASINS41/bin/Plugins/BASINS/hspfmsg.wdm'
wdm = WDMUtil(verbose = True, messagepath = messagepath)

I tried to copy BASINS/hspfmsg.wdm into pyhspf/core/ and replace the original hspfmsg.wdm, but it didn't work.

This is a temporal solution for the problem. Hope anyone can find the reason behind the problem.

mishranurag commented 6 years ago

I use SARA Time Series Utility for all WMD related tasks. WDMUtil is not supported anymore.

djlampert commented 6 years ago

The problem is not the message file in the core directory, but is usually related to the length of the absolute path exceeding 64 characters, which is hard-coded into the program. We have added some documentation to help point this out. You can work around the limit by providing the path the hspfmsf.wdm. I would use the version that exists with this build of hspf.