code: def _climlab_to_cam3(self, field):
          '''Prepare field with proper dimension order.
          CAM3 code expects 3D arrays with (KM, JM, 1)
          and 2D arrays with (JM, 1).
  
          climlab grid dimensions are any of:
              - (KM,)
              - (JM, KM)
              - (JM, IM, KM)
  
          (longitude dimension IM not yet implemented here).'''
          if np.isscalar(field):
              return field
          #  Check to see if column vector needs to be replicated over latitude
          elif self.JM > 1:
              if (field.shape == (self.KM,)):
                  return np.tile(field[...,np.newaxis], self.JM)
              else:
                  return np.squeeze(np.transpose(field))[..., np.newaxis]
          else:  #  1D vertical model
              return field[..., np.newaxis, np.newaxisf _climlab_to_cam3(self, field):
          '''Prepare field with proper dimension order.
          CAM3 code expects 3D arrays with (KM, JM, 1)
          and 2D arrays with (JM, 1).
  
          climlab grid dimensions are any of:
              - (KM,)
              - (JM, KM)
              - (JM, IM, KM)
  
          (longitude dimension IM not yet implemented here).'''
          if np.isscalar(field):
              return field
          #  Check to see if column vector needs to be replicated over latitude
          elif self.JM > 1:
              if (field.shape == (self.KM,)):
                  return np.tile(field[...,np.newaxis], self.JM)
              else:
                  return np.squeeze(np.transpose(field))[..., np.newaxis]
          else:  #  1D vertical model
              return field[..., np.newaxis, np.newaxis]
docs: Prepare field with proper dimension order.
          CAM3 code expects 3D arrays with (KM, JM, 1)
          and 2D arrays with (JM, 1).
  
          climlab grid dimensions are any of:
              - (KM,)
              - (JM, KM)
              - (JM, IM, KM)
  
          (longitude dimension IM not yet implemented here).