SCALE-Analysis
Loading...
Searching...
No Matches
Variables
mpi_xarray_spatial_operation Namespace Reference

MPI 並列を用いた水平操作 More...

Variables

str dir1 = "./sampledata/scale-5.4.5/scale-rm/test/tutorial/real/experiment/run/"
 
int PRC_NUM_X = 2
 
int PRC_NUM_Y = 2
 
str ftype = "history"
 
str domainlabel = "_d01"
 
str timelabel = ""
 
str varname1 = "PREC"
 Value (e.g., PREC) 2D (spatial) + time.
 
int var_scaling_const = 3600
 
str var_unit = "(mm/h)"
 
str weight_type = "cell_area"
 
int weight_scaling_const = 1
 
 args = sys.argv
 
 PRC_NUM_X_ANL = int(args[1])
 
 PRC_NUM_Y_ANL = int(args[2])
 
str dir_out = "./fig/"
 
 comm
 
 size
 
 rank
 
 PRC_NUM_X_PER_ANL
 
 PRC_NUM_Y_PER_ANL
 
 fpathlist = get_fpathlist_mpi(dir1,ftype,domainlabel,timelabel,PRC_NUM_X,PRC_NUM_Y,PRC_NUM_X_ANL,PRC_NUM_Y_ANL,size,rank)
 
 ds = get_xrvar(fpathlist)
 
 value_ = np.array(ds[varname1].values)
 
 weight_ = np.ones_like(value_)
 
 weight_sum_ = np.array( np.sum( weight_, axis=(1,2)), 'd')
 
tuple weighted_value_ = ( value_ * weight_ )
 
 weighted_value_sum_ = np.array( np.sum( weighted_value_, axis=(1,2) ), 'd')
 
 weighted_value_sum = np.array(np.zeros(weighted_value_.shape[0]),'d')
 
 weight_sum = np.array(np.zeros(weight_sum_.shape[0]),'d')
 
 op
 
 SUM
 
 root
 
 value_max_ = np.array( np.max( value_, axis=(1,2) ), 'd')
 
 value_min_ = np.array( np.min( value_, axis=(1,2) ), 'd')
 
 value_max = np.array( np.zeros(value_max_.shape[0]), 'd')
 
 value_min = np.array( np.zeros(value_min_.shape[0]), 'd')
 
 MAX
 
 MIN
 
 time1 = ds["time"].values
 
 fig
 
 ax
 
 marker
 

Detailed Description

MPI 並列を用いた水平操作

MPI 並列(MPI Reduce)を用いた二次元変数の水平操作

Author
Tomoro Yanase, Team SCALE

Note
実行例: $ mpirun -n 2 python mpi_xarray_spatial_operation.py 1 2

Variable Documentation

◆ args

args = sys.argv

◆ ax

ax

◆ comm

comm

◆ dir1

str dir1 = "./sampledata/scale-5.4.5/scale-rm/test/tutorial/real/experiment/run/"

◆ dir_out

str dir_out = "./fig/"

◆ domainlabel

str domainlabel = "_d01"

◆ ds

ds = get_xrvar(fpathlist)

◆ fig

fig

◆ fpathlist

◆ ftype

str ftype = "history"

◆ marker

marker

◆ MAX

MAX

◆ MIN

MIN

◆ op

op

◆ PRC_NUM_X

int PRC_NUM_X = 2

◆ PRC_NUM_X_ANL

PRC_NUM_X_ANL = int(args[1])

◆ PRC_NUM_X_PER_ANL

PRC_NUM_X_PER_ANL

◆ PRC_NUM_Y

int PRC_NUM_Y = 2

◆ PRC_NUM_Y_ANL

PRC_NUM_Y_ANL = int(args[2])

◆ PRC_NUM_Y_PER_ANL

PRC_NUM_Y_PER_ANL

◆ rank

rank

◆ root

root

◆ size

size

◆ SUM

SUM

◆ time1

time1 = ds["time"].values

◆ timelabel

str timelabel = ""

◆ value_

value_ = np.array(ds[varname1].values)

◆ value_max

value_max = np.array( np.zeros(value_max_.shape[0]), 'd')

◆ value_max_

value_max_ = np.array( np.max( value_, axis=(1,2) ), 'd')

◆ value_min

value_min = np.array( np.zeros(value_min_.shape[0]), 'd')

◆ value_min_

value_min_ = np.array( np.min( value_, axis=(1,2) ), 'd')

◆ var_scaling_const

var_scaling_const = 3600

◆ var_unit

str var_unit = "(mm/h)"

◆ varname1

str varname1 = "PREC"

Value (e.g., PREC) 2D (spatial) + time.

◆ weight_

int weight_ = np.ones_like(value_)

◆ weight_scaling_const

int weight_scaling_const = 1

◆ weight_sum

weight_sum = np.array(np.zeros(weight_sum_.shape[0]),'d')

◆ weight_sum_

weight_sum_ = np.array( np.sum( weight_, axis=(1,2)), 'd')

◆ weight_type

str weight_type = "cell_area"

◆ weighted_value_

tuple weighted_value_ = ( value_ * weight_ )

◆ weighted_value_sum

weighted_value_sum = np.array(np.zeros(weighted_value_.shape[0]),'d')

◆ weighted_value_sum_

weighted_value_sum_ = np.array( np.sum( weighted_value_, axis=(1,2) ), 'd')