def write_epw(self):
        """ Section 8 - Writing new EPW file
        """
        epw_prec = self.epw_precision  # precision of epw file input

        for iJ in range(len(self.UCMData)):
            # [iJ+self.simTime.timeInitial-8] = increments along every weather timestep in epw
            # [6 to 21]                       = column data of epw
            self.epwinput[iJ+self.simTime.timeInitial-8][6] = "{0:.{1}f}".format(
                self.UCMData[iJ].canTemp - 273.15, epw_prec)  # dry bulb temperature  [?C]
            # dew point temperature [?C]
            self.epwinput[iJ+self.simTime.timeInitial -
                          8][7] = "{0:.{1}f}".format(self.UCMData[iJ].Tdp, epw_prec)
            # relative humidity     [%]
            self.epwinput[iJ+self.simTime.timeInitial -
                          8][8] = "{0:.{1}f}".format(self.UCMData[iJ].canRHum, epw_prec)
            self.epwinput[iJ+self.simTime.timeInitial-8][21] = "{0:.{1}f}".format(
                self.WeatherData[iJ].wind, epw_prec)        # wind speed [m/s]

        # Writing new EPW file
        epw_new_id = open(self.newPathName, "w")

        for i in range(8):
            new_epw_line = '{}\n'.format(reduce(lambda x, y: x+","+y, self._header[i]))
            epw_new_id.write(new_epw_line)

        for i in range(len(self.epwinput)):
            printme = ""
            for ei in range(34):
                printme += "{}".format(self.epwinput[i][ei]) + ','
            printme = printme + "{}".format(self.epwinput[i][ei])
            new_epw_line = "{0}\n".format(printme)
            epw_new_id.write(new_epw_line)

        epw_new_id.close()

        print("New climate file '{}' is generated at {}.".format(
            self.destinationFileName, self.destinationDir))
Section 8 - Writing new EPW file