#------------------------------------------------------------------------------
# check the cubed-sphere grid information files
#------------------------------------------------------------------------------
dpath = os.path.expanduser('~/.pykgm/cs_grid/ne%d_ngq%d/' % (ne,ngq))
if not os.path.exists(dpath+'mvp_coord.npy'):
    from pykgm.share.cs_grid_structure import save_mvp_coord, save_is_uvp
    save_mvp_coord(ne, ngq)
    save_is_uvp(ne, ngq)


#------------------------------------------------------------------------------
# save the index tables as netcdf format
#------------------------------------------------------------------------------
cube = CubePartition(ne, ngq, nproc, rank+1)
cube.save_netcdf(comm)


#------------------------------------------------------------------------------
# create a interact object
#------------------------------------------------------------------------------
interact = InteractBetweenElemsAvg(ne, ngq, comm)
nelems = interact.nelems
nelem = nelems[rank]
ielem2coord = interact.ielem2coord


#------------------------------------------------------------------------------
# generate a test variable
#------------------------------------------------------------------------------