#!/usr/bin/env python3
"""Create forcing."""
import logging
import sys
import surfex

if __name__ == '__main__':
    kwargs = surfex.parse_args_create_forcing(sys.argv[1:])
    debug = kwargs.get("debug")

    if debug:
        logging.basicConfig(format='%(asctime)s %(levelname)s %(pathname)s:%(lineno)s %(message)s',
                            level=logging.DEBUG)
    else:
        logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', level=logging.INFO)
    logging.info("************ create_forcing ******************")
    options, var_objs, att_objs = surfex.forcing.set_forcing_config(**kwargs)
    surfex.forcing.run_time_loop(options, var_objs, att_objs)
