With a newer version of gfortran that had bounds checking on it noticed that a call to bound in valout used aux_loc before it was assigned. This occurs in the loop that writes out q and before the loop that writes out aux so it did not have the index for bound yet. The bug was triggered when a aux_loc = 0 was used by default and was out of the array bounds.
Simple fix is to get aux_loc in the q loop as well, but is there something we should be concerned about regarding the use of bound there?