output module update

mem leak may be caused by alloc array not being explicitly deallocated
before reuse as intent(out) arg of a subroutine

once they're explicitly deallocated, mem leak is reduced, but still
present; other modules need to be checked