## psb_spasb -- Sparse matrix assembly routine

    call psb_spasb(a, desc_a, info, afmt, upd, dupl, mold)

Type:
  Synchronous.
On Entry
desc_a
  the communication descriptor.
  Scope:local.
  Type:required.
  Intent: in.
  Specified as: a structured data of type descdata`psb_desc_type`.
afmt
  the storage format for the sparse matrix.
  Scope: local.
  Type: optional.
  Intent: in.
  Specified as: an array of characters. Defalt: 'CSR'.
upd
  Provide for updates to the matrix coefficients.
  Scope: global.
  Type: optional.
  Intent: in.
  Specified as: integer, possible values: `psb_upd_srch_`, `psb_upd_perm_`
dupl
  How to handle duplicate coefficients.
  Scope: global.
  Type: optional.
  Intent: in.
  Specified as: integer, possible values: `psb_dupl_ovwrt_`, `psb_dupl_add_`, `psb_dupl_err_`.
mold
  The desired dynamic type for the internal matrix storage.
  Scope: local.
  Type: optional.
  Intent: in.
  Specified as: an object of a class derived from spbasedata`psb_T_base_sparse_mat`.

On Return
a
  the matrix to be assembled.
  Scope:local
  Type:required
  Intent: inout.
  Specified as: a structured data of type spdata`psb_Tspmat_type`.
info
  Error code.
  Scope: local
  Type: required
  Intent: out.
  An integer value; 0 means no error has been detected.

Notes

1. On entry to this routine the descriptor must be in the assembled state, i.e. `psb_cdasb` must already have been called.
2. The sparse matrix may be in either the build or update state;
3. Duplicate entries are detected and handled in both build and update state, with the exception of the error action that is only taken in the build state, i.e. on the first assembly;
4. If the update choice is `psb_upd_perm_`, then subsequent calls to `psb_spins` to update the matrix must be arranged in such a way as to produce exactly the same sequence of coefficient values as encountered at the first assembly;
5. The output storage format need not be the same on all processes;
6. On exit from this routine the matrix is in the assembled state, and thus is suitable for the computational routines.