def convective_adjustment_direct(p, T, c, lapserate=<NUM_LIT>):
<EOL>alpha = const.Rd / const.g * lapserate / <NUM_LIT> <EOL>L = p.size<EOL>pextended = np.insert(p,<NUM_LIT:0>,const.ps)  <EOL>Pi = np.cumprod((p / pextended[:-<NUM_LIT:1>])**alpha)  <EOL>beta = <NUM_LIT:1.>/Pi<EOL>theta = T * beta<EOL>q = Pi * c<EOL>n_k = np.zeros(L, dtype=np.int8)<EOL>theta_k = np.zeros_like(p)<EOL>s_k = np.zeros_like(p)<EOL>t_k = np.zeros_like(p)<EOL>thetaadj = Akmaev_adjustment_multidim(theta, q, beta, n_k,<EOL>theta_k, s_k, t_k)<EOL>T = thetaadj * Pi<EOL>return T<EOL>
Convective Adjustment to a specified lapse rate.

    Input argument lapserate gives the lapse rate expressed in degrees K per km
    (positive means temperature increasing downward).

    Default lapse rate is 6.5 K / km.

    Returns the adjusted Column temperature.
    inputs:
    p is pressure in hPa
    T is temperature in K
    c is heat capacity in in J / m**2 / K

    Implements the conservative adjustment algorithm from Akmaev (1991) MWR