def METHOD_NAME(param_file,cfdict,lev=0):
    """Recursive function that writes ILAMB configuration file
    from dictionary in cmec.json.
    Each nested dictionary is treated as a new sub section (h1, h2,
    or a data source)
    Parameters
    ----------
    param_file: str
        open parameter file to write to
    cfdict: str
        dictionary with the configuration file contents
    lev: int
        counter that keeps track of the heading level
    """
    head = {0: "h1: ", 1: "h2: ", 2: ""}
    for key in cfdict:
        if isinstance(cfdict[key], str):
            param_file.write("{0} = \"{1}\"\n".format(key, cfdict[key]))
        elif isinstance(cfdict[key], (int,float,bool)):
            param_file.write("{0} = {1}\n".format(key, cfdict[key]))
        elif isinstance(cfdict[key], dict):
            param_file.write("[{0}{1}]\n".format(head[lev],key))
            METHOD_NAME(param_file,cfdict[key],lev=lev+1)
    return