|
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 |
|
MPI 並列を用いた水平操作
MPI 並列(MPI Reduce)を用いた二次元変数の水平操作
- Author
- Tomoro Yanase, Team SCALE
- Note
- 実行例: $ mpirun -n 2 python mpi_xarray_spatial_operation.py 1 2