Skip to content
Snippets Groups Projects
Commit ef1b2559 authored by POLCHER Jan's avatar POLCHER Jan :bicyclist_tone4:
Browse files

Optimize the size of the hydro data box read for each domain. Reduces a little...

Optimize the size of the hydro data box read for each domain. Reduces a little the computational time of weight calculation.
parent 7a84dba9
No related branches found
No related tags found
No related merge requests found
......@@ -18,13 +18,14 @@ INFO, DEBUG, ERROR = log_master.info, log_master.debug, log_world.error
INFO_ALL, DEBUG_ALL = log_world.info, log_world.debug
#
def getbox(ncdf, corners) :
halo=0.1
ii=[np.argmin(abs(ncdf.variables["nav_lon"][0,:]-(np.min(corners[0][:])-halo))),
np.argmin(abs(ncdf.variables["nav_lon"][0,:]-(np.max(corners[0][:])+halo)))]
jj=[np.argmin(abs(ncdf.variables["nav_lat"][:,0]-(np.min(corners[1][:])-halo))),
np.argmin(abs(ncdf.variables["nav_lat"][:,0]-(np.max(corners[1][:])+halo)))]
# Add a few points to tbe box to make sure to cover everything
halo_pts=2
ii=[np.argmin(abs(ncdf.variables["nav_lon"][0,:]-np.min(corners[0][:]))),
np.argmin(abs(ncdf.variables["nav_lon"][0,:]-np.max(corners[0][:])))]
jj=[np.argmin(abs(ncdf.variables["nav_lat"][:,0]-np.min(corners[1][:]))),
np.argmin(abs(ncdf.variables["nav_lat"][:,0]-np.max(corners[1][:])))]
return min(ii), max(ii), min(jj), max(jj)
return min(ii)-halo_pts, max(ii)+halo_pts, min(jj)-halo_pts, max(jj)+halo_pts
#
# Get the corners for a regular lat/lon grid
#
......
......@@ -3,7 +3,7 @@
#PBS -N BuildHTUs_IP
#
#PBS -j oe
#PBS -l nodes=1:ppn=48
#PBS -l nodes=1:ppn=64
#PBS -l walltime=128:00:00
#PBS -l mem=160gb
#PBS -l vmem=160gb
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment