A variational method is developed to estimate the aerodynamic roughness len
gth and roughness scaling length for temperature based on wind and temperat
ure measurements conducted routinely at an observational network. The probl
em is formulated to find optimal estimates of roughness lengths for momentu
m and heat transfer through a minimization of a cost function with respect
to these two roughness lengths that measures the errors between observed an
d predicted wind and temperature profiles. The method has been applied to d
ata collected in two experimental campaigns. Some results are compared with
other methods used to compute the aerodynamic roughness length. The variat
ional computations show that the aerodynamic roughness lengths agree well w
ith the estimated z(0m) in the experimental campaigns. The roughness scalin
g lengths for temperature z(0t) are in most cases one order of magnitude sm
aller than z(0m). It was found that the variations of z(0m) and z(0t) durin
g the course of a day are not likely to follow a simple functional relation
ship, especially during the daytime, during which both z(0m) and z(0t) are
highly oscillatory. The error test shows that z(0m) and z(0t) generated fro
m the variational method are not very sensitive to measurement errors.