Commit 35dcbb9c authored by Anthony's avatar Anthony
Browse files

Actualization of the main files : RoutingPreProc and WeightsOnly

parent a2891cfc
......@@ -51,37 +51,37 @@ rank=comm.Get_rank()
part = PA.partition(gg.ni, gg.nj, gg.land, comm, nbcore, szhalo, rank)
#
modelgrid=MG.ModelGrid(part.ihstart+gg.igstart,part.nih,part.jhstart+gg.jgstart,part.njh)
#
INFO("Longitude interval on proc "+str(rank)+" = "+str(modelgrid.box_land[0][0])+" : "+str(modelgrid.box_land[0][1]))
INFO("Latitude interval on proc "+str(rank)+" = "+str(modelgrid.box_land[1][0])+" : "+str(modelgrid.box_land[1][1]))
#
hydrogrid=HG.HydroGrid(modelgrid.box_land)
hydrogrid=HG.HydroGrid(modelgrid.box_land, wfile)
#
# Computes weights of overlap of modelgrid and hydrogrid
#
w = RPP.compweights(wfile, part, modelgrid, hydrogrid)
#
#
#
nbpt = len(w.index)
nbvmax = part.domainmax(max(w.hpts))
print("nbpt : ", nbpt)
print("nbvmax : ", nbvmax)
print("nbasmax : ", nbasmax)
INFO("nbpt : {0}".format(nbpt))
INFO("nbvmax : {0}".format(nbvmax))
INFO("nbasmax : {0}".format(nbasmax))
#
# Extract hydo data from file
#
INFO("hydrodata")
INFO("=================== HYDRODATA ====================")
hydrodata = HG.HydroData(hydrogrid.ncfile, hydrogrid.box, w.index)
INFO("initiatmgrid")
INFO("=================== INITATMGRID ====================")
IF.initatmgrid(rank, nbcore, nbpt, modelgrid)
INFO("hoverlap")
INFO("=================== HOVERLAP ====================")
hoverlap = IF.HydroOverlap(nbpt, nbvmax, w.hpts, w.index, w.area, w.lon, w.lat, part, modelgrid, hydrodata)
#
# Do some memory management and synchronize procs.
#
del w
gc.collect()
comm.Barrier()
......
......@@ -47,15 +47,23 @@ rank=comm.Get_rank()
# Region of grid to be treated
#
part = PA.partition(gg.ni, gg.nj, gg.land, comm, nbcore, szhalo, rank)
INFO("rank:{0}-nbland:{1}".format(part.rank, part.nbland))
#
with open("./Weight_proc_{0}.txt".format(part.rank), "a") as foo:
foo.write("Start Weights on rank: {0}\n".format(part.rank))
#
modelgrid=MG.ModelGrid(part.ihstart+gg.igstart,part.nih,part.jhstart+gg.jgstart,part.njh)
INFO("Longitude interval on proc "+str(rank)+" = "+str(modelgrid.box_land[0][0])+" : "+str(modelgrid.box_land[0][1]))
INFO("Latitude interval on proc "+str(rank)+" = "+str(modelgrid.box_land[1][0])+" : "+str(modelgrid.box_land[1][1]))
#
hydrogrid=HG.HydroGrid(modelgrid.box_land)
hydrogrid=HG.HydroGrid(modelgrid.box_land, wfile)
#
# Computes weights of overlap of modelgrid and hydrogrid
#
with open("./Weight_proc_{0}.txt".format(part.rank), "a") as foo:
foo.write("Proc {0}: size core : {1}\n".format(part.rank, len(part.landcorelist)))
w = RPP.compweights(wfile, part, modelgrid, hydrogrid)
#
#
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment