docs: def set_state(self, name, value):
          """Sets the variable ``name`` to a new state ``value``.
  
          :param string name:     name of the state
          :param value:           state variable
          :type value:            :class:`~climlab.domain.field.Field` or *array*
          :raises: :exc:`ValueError`
                                  if state variable ``value`` is not having a domain.
          :raises: :exc:`ValueError`
                                  if shape mismatch between existing domain and
                                  new state variable.
  
          :Example:
  
              Resetting the surface temperature of an EBM to
              :math:`-5 ^{\circ} \\textrm{C}` on all latitues::
  
                  >>> import climlab
                  >>> from climlab import Field
                  >>> import numpy as np
  
                  >>> # setup model
                  >>> model = climlab.EBM(num_lat=36)
  
                  >>> # create new temperature distribution
                  >>> initial = -5 * ones(size(model.lat))
                  >>> model.set_state('Ts', Field(initial, domain=model.domains['Ts']))
  
                  >>> np.squeeze(model.Ts)
                  Field([-5., -5., -5., -5., -5., -5., -5., -5., -5., -5., -5., -5., -5.,
                         -5., -5., -5., -5., -5., -5., -5., -5., -5., -5., -5., -5., -5.,
                         -5., -5., -5., -5., -5., -5., -5., -5., -5., -5.])
  
          """
          if isinstance(value, Field):
              # populate domains dictionary with domains from state variables
              self.domains.update({name: value.domain})
          else:
              try:
                  thisdom = self.state[name].domain
                  domshape = thisdom.shape
              except:
                  raise ValueError('State variable needs a domain.')
              value = np.atleast_1d(value)
              if value.shape == domshape:
                  value = Field(value, domain=thisdom)
              else:
                  raise ValueError('Shape mismatch between existing domain and new state variable.')
          # set the state dictionary
          self.state[name] = value
          for name, value in self.state.items():
          #convert int dtype to float
              if np.issubdtype(self.state[name].dtype, np.dtype('int').type):
                  value = self.state[name].astype(float)
                  self.state[name]=value
          self.__setattr__(name, value)