def _climlab_to_rrtm(field):
    '''Prepare field with proper dimension order.
    RRTM code expects arrays with (ncol, nlay)
    and with pressure decreasing from surface at element 0

    climlab grid dimensions are any of:
        - (num_lev,) --> (1, num_lev)
        - (num_lat, num_lev)  --> (num_lat, num_lev)
        - (num_lat, num_lon, num_lev)  -->  (num_lat*num_lon, num_lev)

        But lat-lon grids not yet supported here!

    Case single column
    '''
    # Make this work just with 1D (KM,) arrays
    #  (KM,)  -->  (1, nlay)
    try:
        #  Flip along the last axis to reverse the pressure order
        field = field[..., ::-1]
    except:
        if np.isscalar(field):
            return field
        else:
            raise ValueError('field must be array_like or scalar.')
    shape = field.shape
    if len(shape)==1:  #  (num_lev)
        #  Need to append an extra dimension for singleton horizontal ncol
        return field[np.newaxis, ...]
    elif len(shape)==2:  # (num_lat, num_lev)
        return field
    elif len(shape) > 2:
        raise ValueError('lat-lon grids not yet supported here.')
Prepare field with proper dimension order.
    RRTM code expects arrays with (ncol, nlay)
    and with pressure decreasing from surface at element 0

    climlab grid dimensions are any of:
        - (num_lev,) --> (1, num_lev)
        - (num_lat, num_lev)  --> (num_lat, num_lev)
        - (num_lat, num_lon, num_lev)  -->  (num_lat*num_lon, num_lev)

        But lat-lon grids not yet supported here!

    Case single column