You should reach a steady state in the NEMD simulation and then tally the heat flux.
Instead of just dumping your unedited script, please read (and follow) the forum rules: you edit your post by quoting the input file and deleting the unnecessary commands, including the commented-out fixes. Other users provide answers on a volunteering base, so please do your part by making it easy to read your script.