code: def add_diagnostic(self, name, value=None):
          
          self._diag_vars.append(name)
          self.__setattr__(name, value)
docs: Create a new diagnostic variable called ``name`` for this process
          and initialize it with the given ``value``.
  
          Quantity is accessible in two ways:
  
              * as a process attribute, i.e. ``proc.name``
              * as a member of the diagnostics dictionary,
                i.e. ``proc.diagnostics['name']``
  
          Use attribute method to set values, e.g.
          ```proc.name = value ```
  
          :param str name:        name of diagnostic quantity to be initialized
          :param array value:     initial value for quantity [default: None]
  
          :Example:
  
              Add a diagnostic CO2 variable to an energy balance model::
  
                  >>> import climlab
                  >>> model = climlab.EBM()
  
                  >>> # initialize CO2 variable with value 280 ppm
                  >>> model.add_diagnostic('CO2',280.)
  
                  >>> # access variable directly or through diagnostic dictionary
                  >>> model.CO2
                  280
                  >>> model.diagnostics.keys()
                  ['ASR', 'CO2', 'net_radiation', 'icelat', 'OLR', 'albedo']