kirenbahm / ENP_TOOLS

Scripts used to pre- and post-process data
0 stars 2 forks source link

generateComputedMatlab fails when MSHE_WM.dfs0 is 0KB #42

Closed kirenbahm closed 3 years ago

kirenbahm commented 4 years ago

When the MIKE model quits ungracefully, it creates the file MSHE_WM.dfs0, but that file has zero size.

In the generateComputed script, when INI.USE_RES11 = true, the script checks for existence of MSHE_WM.dfs0, and then attempts to read from it. In the case of an ungraceful MIKE exit, the file will exist but not be readable by generateComputed, thus resulting in an ungraceful exit from generateComputed.

Please fix the generateComputed subscript to check if MSHE_WM.dfs0 exists, AND if it's size is nonzero. Hopefully this will fix the problem.

(You can test this condition by making your own empty MSHE_WM.dfs0 file.)