MODFLOW-USGS / mt3d-usgs

MT3D-USGS Repository
23 stars 12 forks source link

Initialize velocity component array #46

Closed mwtoews closed 5 years ago

mwtoews commented 5 years ago

With gfortran, the velocity component array was left uninitialized, sometimes with NaNs (or not). This creates an issue where models sometimes hit a floating point exception and crash (or not), about 50% of the time. For example, p09 in flopy3_MT3DMS_examples.ipynb sometimes crashes mt3dms. This bug behaved similarly in mt3d-usgs.

langevin-usgs commented 5 years ago

@mwtoews thanks so much for digging in and finding this bug. The erratic nature of that uninitialized variable was frustrating. @emorway-usgs, it would probably be a good idea to do some more checking with some of the intel tools to find if any other uninitialized variables are being used anywhere in the program.

emorway-usgs commented 5 years ago

This fix offered in this pull request has been referenced by https://github.com/modflowpy/flopy/issues/466