def standard_parameter_writer(filename, pid, params=None):
    """
    Standard parameter writer.

    The standard parameter writer writes a file containing
    1 line per parameter with the parameter value.

    All values will be written in IEEE double precision: {:.14e}.

    That means:

        3.000000000000000e-01

        2.300000000000000e-01

        1.440000000000000e+01

        3.000000000000000e-01

        ...

    Parameters
    ----------
    filename : string
        Output filename with parameter values
    pid : int
        Output file will be filename.pid
    params : iterable
        Parameter values

        If standard_parameter_writer is called with two arguments, then the second argument will be params.

    Returns
    -------
    None
        No return value but output file written: filename.pid

    Examples
    --------
    >>> randst = np.random.RandomState()
    >>> pid = str(randst.randint(2147483647))
    >>> params = sample_parameter(pis, pmin, pmax, pmask)
    >>> standard_parameter_writer(paramfile, pid, params)


    History
    -------
    Written,  Matthias Cuntz, Jan 2020
    Modified, Matthias Cuntz, Jan 2020 - call with 2 or 3 arguments, i.e. pid given or not
    """
    if params is None:
        ofile = filename
        iparams = pid
    else:
        ofile = filename + '.' + str(pid)
        iparams = params
    f = open(ofile, 'w')
    for pp in iparams:
        dstr = '{:.14e}'.format(pp)
        print(dstr, file=f)
    f.close()
    return
