def write_path_file(input='_dl_field.inp', dl_field_path='', directory=''):
    '''Write a dl_f_path file'''

    from os import getcwd, path

    path_lib = path.join(dl_field_path, 'lib')
    path_sol = path.join(dl_field_path, 'solvent')
    # YL 07/07/2022: directly generated to the working directory
    path_out = path.join(getcwd(), directory)

    strbuff = \
'''
# Directory paths for DL_FIELD version 4.4 onwards.
# C W Yong, October 2018
# This file must be located where DL_FIELD executable is located.
# The directory must be changed correspondly if you move the file components.
# All directory paths are RELATIVE to DL_FIELD home directory.
# Do not use absolute paths.

# paths
library = {path_lib}
solvent = {path_sol}
output  = {path_out}

# Control file 
# To run example structures mentioned in Chaprter 14,
# comment out the default control file, dl_field.control, and then
# remove the comment for running the example structures.

control = {input}
'''.format(path_lib=path_lib,
           path_sol=path_sol,
           path_out=path_out,
           input=input)

    # write
    with open('dl_f_path', 'w') as fp:
        fp.write(strbuff)
