def coarsetofine(coarse,fine,x,y):
""" input = x is on coarse / output = y is on fine """
# these are function outside the object Grid
# because it works on two different grids ...
for k in range(coarse.nbcoarsetofine):
if coarse.flag=='peak':
t0 = time()
coarse.subdom.split(x,y)
t1 = time()
coarse.time['split']+=t1-t0
coarse.ncalls['split']+=1
else:
t0 = time()
interpolate(fine.msk,coarse.msk,x,fine.nh,y)
t1 = time()
fine.time['interpolate']+=t1-t0
fine.ncalls['interpolate']+=1
if coarse.nh<=2:
fine.halo.fill(y)
t0 = time()
fine.time['halo']+=t0-t1
fine.ncalls['halo']+=1
# else there is enough points in the halo to skip filling!
# MPI.COMM_WORLD.Barrier()
评论列表
文章目录