In the following code i get the error: "VAR_EXISTS: Named variable already exists."# Loop through all the variables in the input files
for var_name in in_cdf1:

    # Create an empty variable in the output CDF file
    out_cdf[var_name] = []

    # Check if the data type is datetime
    if 'cdf_time_tt2000' in str(in_cdf1[var_name].type()):

        # Convert datetime values to CDF timestamp format
        var_data_1 = in_cdf1[var_name][:]
        var_data_2 = in_cdf2[var_name][:]
        var_data_1_num = cdflib.cdfepoch.encode(tt2000=var_data_1)
        var_data_2_num = cdflib.cdfepoch.encode(tt2000=var_data_2)

        # Concatenate the data from the input files for this variable
        merged_var_data = np.append(var_data_1_num, var_data_2_num)

        # Create a new variable with the same name and CDF Time_TT2000 data type
        out_cdf.new(var_name, merged_var_data, type='cdf_time_tt2000')

    else:

        # Concatenate the data from the input files for this variable
        var_data_1 = in_cdf1[var_name][:]
        var_data_2 = in_cdf2[var_name][:]
        merged_var_data = np.concatenate([var_data_1, var_data_2])

        # Create a copy of the original variable with the same name and data type
        out_cdf.new(var_name, in_cdf1[var_name][:])
        out_cdf[var_name][:] = merged_var_data

        # Remove the variables from the input files that were merged
        del in_cdf1[var_name]
        del in_cdf2[var_name]

