Numerical studies are made on the spatial and temporal profiles of the second harmonic pulse with consideration of both thermal absorption and intensity dependent refractive index for various thermal relaxation times. The two effects deteriorate the second harmonic generation efficiency and also make beam profiles much different from that of the fundamental wave. If the signs of the refractive index gradient differ between the two contributions of different origins, they may counterbalance each other to help reduce deterioration of the second harmonic generation efficiency.