def _climlab_to_rrtm(field):
<EOL>try:<EOL><INDENT>field = field[..., ::-<NUM_LIT:1>]<EOL><DEDENT>except:<EOL><INDENT>if np.isscalar(field):<EOL><INDENT>return field<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT><DEDENT>shape = field.shape<EOL>if len(shape)==<NUM_LIT:1>:  <EOL><INDENT>return field[np.newaxis, ...]<EOL><DEDENT>elif len(shape)==<NUM_LIT:2>:  <EOL><INDENT>return field<EOL><DEDENT>elif len(shape) > <NUM_LIT:2>:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>
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