calc_dtmax_ed function

Calculate dTmax by the environmental dependent method