The solution to this problem is obtained by treating the pipe as a heat exchanger and calculating the overall heat transfer coefficient and mean temperature driving force.  The external heat transfer coefficient will be a function of weather conditions (i.e., wind speed, solar radiation, precipitation).  Refer to Perry's Chemical Engineers' Handbook (Chapter 5) for appropriate correlations to use.