SCALE-Analysis
Loading...
Searching...
No Matches
Variables
mpi_xarray_coarsened_xy 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 = "T2"
 Value (e.g., PREC) 2D (spatial) + time.
 
str varunit1 = "(K)"
 
int varfact1 = 1
 
 varlevels1 = np.linspace(265,305,41)
 
str varcmap1 = "jet"
 
int blct = 1
 
int blcy = 15
 
int blcx = 15
 
 args = sys.argv
 
 PRC_NUM_X_ANL = int(args[1])
 
 PRC_NUM_Y_ANL = int(args[2])
 
str dir_out = "./fig/"
 
str horaxis = "LATLON"
 
bool withmap = True
 
 lonticks = np.arange(80,180+1,10)
 
 latticks = np.arange(10,60+1,10)
 
int slon = 120
 
int elon = 150
 
int slat = 25
 
int elat = 45
 
bool savefig = True
 
 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)
 
 PRC_NUM_ARR0 = check_prcnum_mpi(PRC_NUM_X,PRC_NUM_Y,PRC_NUM_X_ANL,PRC_NUM_Y_ANL,size,rank)
 
 xrvar = get_xrvar(fpathlist)
 
 var2d_avg = get_blcavg(xrvar,varname1,blct,blcy,blcx)
 
 sendbuf = np.array(var2d_avg,"d")
 
 recvbuf = None
 
 root
 
 var2d_avg_combined = combine_var2d_blockavg(sendbuf,recvbuf,PRC_NUM_Y_ANL,PRC_NUM_X_ANL)
 
 time = xrvar.coords["time"]
 
 tsize = len(time)
 
str tlabel = f"{t*blct:04d}-{(t+1)*blct-1:04d}"
 
 lon = xrvar.coords["lon"]
 
 lat = xrvar.coords["lat"]
 
 fig = plt.figure(figsize=(8,5))
 
 ax = fig.add_subplot(111,projection=ccrs.PlateCarree())
 
 color
 
 crs
 
 xlocs
 
 ylocs
 
 figsize
 
 cax = ax.contourf(lon[blcy//2::blcy,blcx//2::blcx],lat[blcy//2::blcy,blcx//2::blcx],varfact1*var2d_avg_combined[t,:,:],levels=varlevels1,cmap=varcmap1)
 
str figtitle = f"mpi_xarray_coarsened_ll_{varname1}_blct{blct:04d}blcy{blcy:04d}blcx{blcx:04d}_t{tlabel}.png"
 
 x = xrvar.coords["x"]
 
 y = xrvar.coords["y"]
 
 cbar = plt.colorbar(cax,ax=ax,fraction=0.02)
 

Detailed Description

MPI 並列を用いた水平粗視化・描画

MPI並列(MPI Gather)を用いた二次元変数の粗視化分布

Author
Tomoro Yanase, Team SCALE

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

Variable Documentation

◆ args

args = sys.argv

◆ ax

ax = fig.add_subplot(111,projection=ccrs.PlateCarree())

◆ blct

int blct = 1

◆ blcx

int blcx = 15

◆ blcy

int blcy = 15

◆ cax

cax = ax.contourf(lon[blcy//2::blcy,blcx//2::blcx],lat[blcy//2::blcy,blcx//2::blcx],varfact1*var2d_avg_combined[t,:,:],levels=varlevels1,cmap=varcmap1)

◆ cbar

cbar = plt.colorbar(cax,ax=ax,fraction=0.02)

◆ color

color

◆ comm

comm

◆ crs

crs

◆ 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"

◆ elat

int elat = 45

◆ elon

int elon = 150

◆ fig

fig = plt.figure(figsize=(8,5))

◆ figsize

figsize

◆ figtitle

str figtitle = f"mpi_xarray_coarsened_ll_{varname1}_blct{blct:04d}blcy{blcy:04d}blcx{blcx:04d}_t{tlabel}.png"

◆ fpathlist

◆ ftype

str ftype = "history"

◆ horaxis

str horaxis = "LATLON"

◆ lat

lat = xrvar.coords["lat"]

◆ latticks

latticks = np.arange(10,60+1,10)

◆ lon

lon = xrvar.coords["lon"]

◆ lonticks

lonticks = np.arange(80,180+1,10)

◆ PRC_NUM_ARR0

PRC_NUM_ARR0 = check_prcnum_mpi(PRC_NUM_X,PRC_NUM_Y,PRC_NUM_X_ANL,PRC_NUM_Y_ANL,size,rank)

◆ 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

◆ recvbuf

recvbuf = None

◆ root

root

◆ savefig

bool savefig = True

◆ sendbuf

sendbuf = np.array(var2d_avg,"d")

◆ size

size

◆ slat

int slat = 25

◆ slon

int slon = 120

◆ time

time = xrvar.coords["time"]

◆ timelabel

str timelabel = ""

◆ tlabel

str tlabel = f"{t*blct:04d}-{(t+1)*blct-1:04d}"

◆ tsize

tsize = len(time)

◆ var2d_avg

var2d_avg = get_blcavg(xrvar,varname1,blct,blcy,blcx)

◆ var2d_avg_combined

var2d_avg_combined = combine_var2d_blockavg(sendbuf,recvbuf,PRC_NUM_Y_ANL,PRC_NUM_X_ANL)

◆ varcmap1

str varcmap1 = "jet"

◆ varfact1

int varfact1 = 1

◆ varlevels1

varlevels1 = np.linspace(265,305,41)

◆ varname1

str varname1 = "T2"

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

◆ varunit1

str varunit1 = "(K)"

◆ withmap

bool withmap = True

◆ x

x = xrvar.coords["x"]

◆ xlocs

xlocs

◆ xrvar

xrvar = get_xrvar(fpathlist)

◆ y

y = xrvar.coords["y"]

◆ ylocs

ylocs