The temperature profile and heat transfer law in a neutrally and stably stratified planetary boundary layer