def dump_system_json(self, filepath=None, modular=False, **kwargs):
<EOL>dict_obj = deepcopy(self.system)<EOL>if modular is True:<EOL><INDENT>try:<EOL><INDENT>if self.molecules:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>except AttributeError:<EOL><INDENT>raise _NotAModularSystem(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>dict_obj = {}<EOL>for molecule in self.molecules:<EOL><INDENT>mol_ = self.molecules[molecule]<EOL>dict_obj[molecule] = mol_.mol<EOL><DEDENT><DEDENT>if filepath is None:<EOL><INDENT>filepath = '<STR_LIT:/>'.join((os.getcwd(), str(self.system_id)))<EOL><DEDENT>self._Output.dump2json(dict_obj, filepath, default=to_list, **kwargs)<EOL>
Dump a :class:`MolecularSystem` to a JSON dictionary.

The dumped JSON dictionary, with :class:`MolecularSystem`, can then be
loaded through a JSON loader and then through :func:`load_system()`
to retrieve a :class:`MolecularSystem`.

Kwargs are passed to :func:`pywindow.io_tools.Output.dump2json()`.

Parameters
----------
filepath : :class:`str`
   The filepath for the dumped file. If :class:`None`, the file is
   dumped localy with :attr:`system_id` as filename.
   (defualt=None)

modular : :class:`bool`
    If False, dump the :class:`MolecularSystem` as in
    :attr:`MolecularSystem.system`, if True, dump the
    :class:`MolecularSystem` as catenated :class:Molecule objects
    from :attr:`MolecularSystem.molecules`

Returns
-------
None : :class:`NoneType`