def XGB_test(df, year, lat, lon, member):
    t_0 = time.time()
    df_lat = df[(df['lat'] == lat)]
    df_temp = df_lat[(df_lat['lon'] == lon)]
    vari_ls = ['QBOT', 'UBOT', 'VBOT', 'TREFHT', 'FLNS', 'FSNS', 'PRECT', 'PRSN', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec']
    XGBreg = pickle.load(open(((((((('/glade/scratch/zhonghua/ensem_model/' + year) + '/') + 'MX_') + lat) + '_') + lon) + '.dat'), 'rb'))
    df_temp[member] = XGBreg.predict(df_temp[vari_ls])
    df_return = df_temp[['lat', 'lon', 'time', member, 'TREFMXAV_U']]
    df_return[['lat', 'lon']] = df_return[['lat', 'lon']].astype(np.float32)
    elapsed_time = (time.time() - t_0)
    print('It takes elapsed_time', elapsed_time, 'to apply the model')
    return df_return.set_index(['lat', 'lon', 'time'])
def XGB_test(df, year, lat, lon, member):
    t_0 = time.time()
    df_lat = df[(df['lat'] == lat)]
    df_temp = df_lat[(df_lat['lon'] == lon)]
    vari_ls = ['QBOT', 'UBOT', 'VBOT', 'TREFHT', 'FLNS', 'FSNS', 'PRECT', 'PRSN', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec']
    XGBreg = pickle.load(open(((((((('/glade/scratch/zhonghua/ensem_model/' + year) + '/') + 'MX_') + lat) + '_') + lon) + '.dat'), 'rb'))
    df_temp[member] = XGBreg.predict(df_temp[vari_ls])
    df_return = df_temp[['lat', 'lon', 'time', member, 'TREFMXAV_U']]
    df_return[['lat', 'lon']] = df_return[['lat', 'lon']].astype(np.float32)
    elapsed_time = (time.time() - t_0)
    print('It takes elapsed_time', elapsed_time, 'to apply the model')
    return df_return.set_index(['lat', 'lon', 'time'])