Takuya Miyashita
This site
Web
Start:
*setrun.py Memorandums [#m87b0cbc]
#contents
特に重要な変数を書き出してみる.~
~
**clawdata [#ec21a730]
-clawdata.lower (list of float)~
計算領域の端点の設定.~
clawdata.lower[0] は西端の x (または lon), ~
clawdata.lower[1] は南端の y (または lat). ~
~
-clawdata.upper (list of float)~
計算領域の端点の設定.~
clawdata.upper[0] は東端の x (または lon), ~
clawdata.upper[1] は北端の y (または lat). ~
~
-clawdata.num_cells (list of int)~
~
-clawdata.capa_index (int)
直交座標系か緯度経度かで異なる.~
example を見ると直交座標系のときは 0 で緯度経度の時は 2.~
amrdata.aux_type も参照.~
~
-clawdata.bc_lower, clawdata.bc_upper~
境界条件の設定.~
名前とリストが意味するものはそれぞれ以下の通り.
#codeprettify{{
# Choice of BCs at xlower and xupper:
# 0 => user specified (must modify bcN.f to use this op...
# 1 => extrapolation (non-reflecting outflow)
# 2 => periodic (must specify this at both boundaries)
# 3 => solid wall for systems where q(2) is normal velo...
clawdata.bc_lower[0] = 'extrap' # Western, x-direction
clawdata.bc_upper[0] = 'extrap' # Eastern, x-direction
clawdata.bc_lower[1] = 'extrap' # Southern, y-direction
clawdata.bc_upper[1] = 'extrap' # Northern, y-direction
}}
入力値は数値でもテキストでもOKで,以下のように対応してい...
1 <-> "extrap"
2 <-> "periodic"
3 <-> "wall"
~
-clawdata.t0 (float)~
計算開始時の時刻設定.~
基本的には 0.0 で良いが,storm-surge の計算でハリケーン上...
ike の examples を参照.~
~
-clawdata.tfinal (float)~
計算終了時刻.ただし,下にある clawdata.output_times の方...
リストで指定した clawdata.output_times の最後の出力時刻が...
~
-clawdata.output_t0 (boolean)~
True なら計算開始時のファイルを出力する.~
~
-clawdata.num_output_times (int)~
計算開始から計算終了までに出力を行う回数.~
計算時間を指定した値で等分割した間隔で出力される.
#codeprettify{{
# Output nout frames at equally spaced times up to tfinal:
clawdata.num_output_times = 36
}}
~
~
-clawdata.output_times (list of float)~
出力の回数を指定するのではなく,出力する時間をリストで指...
等間隔でなくても良い.
#codeprettify{{
# Specify a list of output times.
clawdata.output_times = [0.5, 1.0, 2.0]
}}
~
~
-clawdata.output_step_interval (int)~
出力の回数や時刻を指定するのではなく,出力するステップ数...
AMR では相性がよろしくなくあまり使わないような気がする(de...
#codeprettify{{
# Output every iout timesteps with a total of ntot time s...
clawdata.output_step_interval = 1
}}
~
上記の3つの変数
clawdata.num_output_times (int)
clawdata.output_times (list of float)
clawdata.output_step_interval (int)
はいずれか一つを指定すればよい.重複しないように.~
~
-clawdata.dt_variable~
#codeprettify{{
clawdata.dt_variable = True # variable time steps used ba...
}}
~
-clawdata.dt_initial~
~
-clawdata.dt_max~
~
-clawdata.cfl_desired~
~
-clawdata.cfl_max~
~
-clawdata.steps_max~
~
~
**amrdata [#q824883c]
-amrdata.amr_levels_max~
分割するレベルの数.Level 1 を一番粗いレベルとして,Level...
~
-amrdata.refinement_ratios_x~
Level k から Level k+1 となる時の, x 方向のメッシュサイ...
したがって,Level 1 から 4 まである場合は 3要素のリストに...
\( \frac{\Delta x_{2}}{\Delta x_{1}}, ~ \frac{\Delta x_{3...
~
-amrdata.refinement_ratios_y~
上に同じで,y 方向のレベル間のメッシュサイズ比. \( \frac...
~
-amrdata.refinement_ratios_t~
上に同じで,\( \frac{\Delta t_{k+1}}{\Delta t_{k}} \)のこ...
クーラン数を考慮すると,一般的には上の2変数と同一の値にす...
~
例えば 2430m → 810m → 270m → 90m という分割をしたい場合は...
#codeprettify{{
# ---------------
# AMR parameters:
# ---------------
amrdata = rundata.amrdata
# max number of refinement levels:
amrdata.amr_levels_max = 4
# List of refinement ratios at each level (length at leas...
amrdata.refinement_ratios_x = [3,3,3]
amrdata.refinement_ratios_y = [3,3,3]
amrdata.refinement_ratios_t = [3,3,3]
}}
~
-amrdata.aux_type
リストの要素の数は clawdata.num_aux の値と一致している必...
#codeprettify{{
# Specify type of each aux variable in amrdata.auxtype.
# This must be a list of length maux, each element of whi...
# 'center', 'capacity', 'xleft', or 'yleft' (see docu...
amrdata.aux_type = ['center','center','yleft'] # if x,y-c...
#amrdata.aux_type = ['center','capacity','yleft'] # if lo...
}}
~
~
**geo_data [#u625663a]
-geo_data.coodinate_system~
座標系の指定.X,Y で計算するか lon, lat で計算するか.~
ここを変更する場合は併せてコリオリの設定を変更する必要が...
#codeprettify(lang-python){{
geo_data.coodinate_system = 1 # for Cartesian x-y in meters
geo_data.coodinate_system = 2 # for latitude-longitude on...
}}
~
~
**topo_data [#tfa16dc1]
-topo_data.topofiles (list of lists)
#codeprettify(lang-python){{
# topotype: format style
# fname: filename of the topography
topo_data.topofiles.append([topotype, minlevel, maxlevel,...
}}
topotype=2 は header 6行,7行目から (my*mx)行 1列で配列し...
topotype=3 は header 6行,7行目から my行 mx列.~
1は古い形式らしく,4は NetCDF.~
dtopo の topotype も同じ.~
~
~
**dtopo_data [#vec3d296]
-dtopo_data.dtopofiles (list of lists)
#codeprettify{{
# topotype: format style
# fname: filename of the topography
dtopo_data.dtopofiles.append([topotype, minlevel, maxleve...
}}
~
-dtopo_data.dt_max_dtopo (float)~
dtopo の input をしている間の dt の最大値.通常の clawdat...
dtopo によって地形が変化している間,時間刻みの最大は dtop...
#codeprettify{{
dtopo_data.dt_max_dtopo = 0.5
}}
~
~
**region [#ddf48699]
topo を複数入力してそれぞれの範囲内で解像度の制限をかけた...
#codeprettify{{
# ---------------
# Regions:
# ---------------
regions = rundata.regiondata.regions
# to specify regions of refinement append lines of th...
# [minlevel,maxlevel,t1,t2,x1,x2,y1,y2]
## Level 1
regions.append([1, 1, clawdata.t0, clawdata.tfinal, c...
## Level 2+
topo_file = topotools.Topography('topofile.asc', topo...
regions.append([1, 2, clawdata.t0, clawdata.tfinal, t...
}}
~
~
**gauge [#j008f956]
時系列データ出力地点指定.~
setrun.py の中で地点指定をすると,数が増えたり変更のとき...
事前に地点を入れた外部ファイルを用意しておいて,そのファ...
#codeprettify{{
# ---------------
# Gauges:
# ---------------
gauges = rundata.gaugedata.gauges
# for gauges append lines of the form [gaugeno, x, y...
dat = np.genfromtxt('gaugesetfile.txt', delimiter=','...
[gauges.append(dat[i]) for i in range(0,dat.shape[0])]
}}
~
~
**fgmax [#xdf37bc2]
topo ファイルごとに fgmax (fixed_grid max) を出したければ.
#codeprettify{{
fgmax_files = rundata.fgmax_data.fgmax_files
# == fgmax.data values ==
# Domain 1
topo_file = topotools.Topography('topofile.asc', topo...
fg = fgmax_tools.FGmaxGrid()
fg.point_style = 2 # uniform rectangular x-y grid
fg.dx = topo_file.delta[0] # desired resolutio...
fg.x1 = topo_file.x[0]
fg.x2 = topo_file.x[-1]
fg.y1 = topo_file.y[0]
fg.y2 = topo_file.y[-1]
fg.min_level_check = 1 # which levels to monitor max on
fg.arrival_tol = 1.0e-1
fg.tstart_max = 0.0 # just before wave arrives
fg.tend_max = 1.e10 # when to stop monitoring max ...
fg.dt_check = 1.0 # how often to update max values
fg.interp_method = 0 # 0 ==> pw const in cells, rec...
rundata.fgmax_data.fgmax_grids.append(fg) # written ...
rundata.fgmax_data.num_fgmax_val = 5
}}
~
~
**fixed_grids [#ucc9d435]
v5.9.0 からは非推奨になった.
特定の領域だけAMRを使わずに,ずっと同じ解像度で解いてしま...
#codeprettify{{
# == setfixedgrids.data values ==
fixedgrids = rundata.fixed_grid_data.fixedgrids
# for fixed grids append lines of the form
# [t1,t2,noutput,x1,x2,y1,y2,xpoints,ypoints,\
# ioutarrivaltimes,ioutsurfacemax]
topo_file = topotools.Topography(os.path.join(topodir...
fixedgrids.append([0.0, 21600.0, 361, topo_file.x[0],...
topo_file = topotools.Topography(os.path.join(topodir...
fixedgrids.append([0.0, 21600.0, 361, topo_file.x[0],...
}}
この場合では t1,t2,noutput がそれぞれ 0.0, 21600.0,361 と...
ファイル出力間隔が 60 秒,計 361 回(0〜6 時間)の出力に...
当然ながら計算負荷も上がるし, AMR のパッチ出力より容量が...
ioutsurfacemax を 1 にすると最大水位の列が出力されるよう...
~
~
**fgout [#r1a3ee71]
#codeprettify{{
topo_file = topotools.Topography(os.path.join(topodir...
fgout = fgout_tools.FGoutGrid()
fgout.fgno = 3
fgout.output_format = 'ascii'
fgout.x1 = topo_file.x[0]
fgout.x2 = topo_file.x[-1]
fgout.y1 = topo_file.y[0]
fgout.y2 = topo_file.y[-1]
fgout.nx = topo_file.Z.shape[1]
fgout.ny = topo_file.Z.shape[0]
fgout.tstart = 3600.0*5.0
fgout.tend = clawdata.tfinal
fgout.nout = int((fgout.tend - fgout.tstart)/3600.0) ...
fgout_grids.append(fgout)
}}
End:
*setrun.py Memorandums [#m87b0cbc]
#contents
特に重要な変数を書き出してみる.~
~
**clawdata [#ec21a730]
-clawdata.lower (list of float)~
計算領域の端点の設定.~
clawdata.lower[0] は西端の x (または lon), ~
clawdata.lower[1] は南端の y (または lat). ~
~
-clawdata.upper (list of float)~
計算領域の端点の設定.~
clawdata.upper[0] は東端の x (または lon), ~
clawdata.upper[1] は北端の y (または lat). ~
~
-clawdata.num_cells (list of int)~
~
-clawdata.capa_index (int)
直交座標系か緯度経度かで異なる.~
example を見ると直交座標系のときは 0 で緯度経度の時は 2.~
amrdata.aux_type も参照.~
~
-clawdata.bc_lower, clawdata.bc_upper~
境界条件の設定.~
名前とリストが意味するものはそれぞれ以下の通り.
#codeprettify{{
# Choice of BCs at xlower and xupper:
# 0 => user specified (must modify bcN.f to use this op...
# 1 => extrapolation (non-reflecting outflow)
# 2 => periodic (must specify this at both boundaries)
# 3 => solid wall for systems where q(2) is normal velo...
clawdata.bc_lower[0] = 'extrap' # Western, x-direction
clawdata.bc_upper[0] = 'extrap' # Eastern, x-direction
clawdata.bc_lower[1] = 'extrap' # Southern, y-direction
clawdata.bc_upper[1] = 'extrap' # Northern, y-direction
}}
入力値は数値でもテキストでもOKで,以下のように対応してい...
1 <-> "extrap"
2 <-> "periodic"
3 <-> "wall"
~
-clawdata.t0 (float)~
計算開始時の時刻設定.~
基本的には 0.0 で良いが,storm-surge の計算でハリケーン上...
ike の examples を参照.~
~
-clawdata.tfinal (float)~
計算終了時刻.ただし,下にある clawdata.output_times の方...
リストで指定した clawdata.output_times の最後の出力時刻が...
~
-clawdata.output_t0 (boolean)~
True なら計算開始時のファイルを出力する.~
~
-clawdata.num_output_times (int)~
計算開始から計算終了までに出力を行う回数.~
計算時間を指定した値で等分割した間隔で出力される.
#codeprettify{{
# Output nout frames at equally spaced times up to tfinal:
clawdata.num_output_times = 36
}}
~
~
-clawdata.output_times (list of float)~
出力の回数を指定するのではなく,出力する時間をリストで指...
等間隔でなくても良い.
#codeprettify{{
# Specify a list of output times.
clawdata.output_times = [0.5, 1.0, 2.0]
}}
~
~
-clawdata.output_step_interval (int)~
出力の回数や時刻を指定するのではなく,出力するステップ数...
AMR では相性がよろしくなくあまり使わないような気がする(de...
#codeprettify{{
# Output every iout timesteps with a total of ntot time s...
clawdata.output_step_interval = 1
}}
~
上記の3つの変数
clawdata.num_output_times (int)
clawdata.output_times (list of float)
clawdata.output_step_interval (int)
はいずれか一つを指定すればよい.重複しないように.~
~
-clawdata.dt_variable~
#codeprettify{{
clawdata.dt_variable = True # variable time steps used ba...
}}
~
-clawdata.dt_initial~
~
-clawdata.dt_max~
~
-clawdata.cfl_desired~
~
-clawdata.cfl_max~
~
-clawdata.steps_max~
~
~
**amrdata [#q824883c]
-amrdata.amr_levels_max~
分割するレベルの数.Level 1 を一番粗いレベルとして,Level...
~
-amrdata.refinement_ratios_x~
Level k から Level k+1 となる時の, x 方向のメッシュサイ...
したがって,Level 1 から 4 まである場合は 3要素のリストに...
\( \frac{\Delta x_{2}}{\Delta x_{1}}, ~ \frac{\Delta x_{3...
~
-amrdata.refinement_ratios_y~
上に同じで,y 方向のレベル間のメッシュサイズ比. \( \frac...
~
-amrdata.refinement_ratios_t~
上に同じで,\( \frac{\Delta t_{k+1}}{\Delta t_{k}} \)のこ...
クーラン数を考慮すると,一般的には上の2変数と同一の値にす...
~
例えば 2430m → 810m → 270m → 90m という分割をしたい場合は...
#codeprettify{{
# ---------------
# AMR parameters:
# ---------------
amrdata = rundata.amrdata
# max number of refinement levels:
amrdata.amr_levels_max = 4
# List of refinement ratios at each level (length at leas...
amrdata.refinement_ratios_x = [3,3,3]
amrdata.refinement_ratios_y = [3,3,3]
amrdata.refinement_ratios_t = [3,3,3]
}}
~
-amrdata.aux_type
リストの要素の数は clawdata.num_aux の値と一致している必...
#codeprettify{{
# Specify type of each aux variable in amrdata.auxtype.
# This must be a list of length maux, each element of whi...
# 'center', 'capacity', 'xleft', or 'yleft' (see docu...
amrdata.aux_type = ['center','center','yleft'] # if x,y-c...
#amrdata.aux_type = ['center','capacity','yleft'] # if lo...
}}
~
~
**geo_data [#u625663a]
-geo_data.coodinate_system~
座標系の指定.X,Y で計算するか lon, lat で計算するか.~
ここを変更する場合は併せてコリオリの設定を変更する必要が...
#codeprettify(lang-python){{
geo_data.coodinate_system = 1 # for Cartesian x-y in meters
geo_data.coodinate_system = 2 # for latitude-longitude on...
}}
~
~
**topo_data [#tfa16dc1]
-topo_data.topofiles (list of lists)
#codeprettify(lang-python){{
# topotype: format style
# fname: filename of the topography
topo_data.topofiles.append([topotype, minlevel, maxlevel,...
}}
topotype=2 は header 6行,7行目から (my*mx)行 1列で配列し...
topotype=3 は header 6行,7行目から my行 mx列.~
1は古い形式らしく,4は NetCDF.~
dtopo の topotype も同じ.~
~
~
**dtopo_data [#vec3d296]
-dtopo_data.dtopofiles (list of lists)
#codeprettify{{
# topotype: format style
# fname: filename of the topography
dtopo_data.dtopofiles.append([topotype, minlevel, maxleve...
}}
~
-dtopo_data.dt_max_dtopo (float)~
dtopo の input をしている間の dt の最大値.通常の clawdat...
dtopo によって地形が変化している間,時間刻みの最大は dtop...
#codeprettify{{
dtopo_data.dt_max_dtopo = 0.5
}}
~
~
**region [#ddf48699]
topo を複数入力してそれぞれの範囲内で解像度の制限をかけた...
#codeprettify{{
# ---------------
# Regions:
# ---------------
regions = rundata.regiondata.regions
# to specify regions of refinement append lines of th...
# [minlevel,maxlevel,t1,t2,x1,x2,y1,y2]
## Level 1
regions.append([1, 1, clawdata.t0, clawdata.tfinal, c...
## Level 2+
topo_file = topotools.Topography('topofile.asc', topo...
regions.append([1, 2, clawdata.t0, clawdata.tfinal, t...
}}
~
~
**gauge [#j008f956]
時系列データ出力地点指定.~
setrun.py の中で地点指定をすると,数が増えたり変更のとき...
事前に地点を入れた外部ファイルを用意しておいて,そのファ...
#codeprettify{{
# ---------------
# Gauges:
# ---------------
gauges = rundata.gaugedata.gauges
# for gauges append lines of the form [gaugeno, x, y...
dat = np.genfromtxt('gaugesetfile.txt', delimiter=','...
[gauges.append(dat[i]) for i in range(0,dat.shape[0])]
}}
~
~
**fgmax [#xdf37bc2]
topo ファイルごとに fgmax (fixed_grid max) を出したければ.
#codeprettify{{
fgmax_files = rundata.fgmax_data.fgmax_files
# == fgmax.data values ==
# Domain 1
topo_file = topotools.Topography('topofile.asc', topo...
fg = fgmax_tools.FGmaxGrid()
fg.point_style = 2 # uniform rectangular x-y grid
fg.dx = topo_file.delta[0] # desired resolutio...
fg.x1 = topo_file.x[0]
fg.x2 = topo_file.x[-1]
fg.y1 = topo_file.y[0]
fg.y2 = topo_file.y[-1]
fg.min_level_check = 1 # which levels to monitor max on
fg.arrival_tol = 1.0e-1
fg.tstart_max = 0.0 # just before wave arrives
fg.tend_max = 1.e10 # when to stop monitoring max ...
fg.dt_check = 1.0 # how often to update max values
fg.interp_method = 0 # 0 ==> pw const in cells, rec...
rundata.fgmax_data.fgmax_grids.append(fg) # written ...
rundata.fgmax_data.num_fgmax_val = 5
}}
~
~
**fixed_grids [#ucc9d435]
v5.9.0 からは非推奨になった.
特定の領域だけAMRを使わずに,ずっと同じ解像度で解いてしま...
#codeprettify{{
# == setfixedgrids.data values ==
fixedgrids = rundata.fixed_grid_data.fixedgrids
# for fixed grids append lines of the form
# [t1,t2,noutput,x1,x2,y1,y2,xpoints,ypoints,\
# ioutarrivaltimes,ioutsurfacemax]
topo_file = topotools.Topography(os.path.join(topodir...
fixedgrids.append([0.0, 21600.0, 361, topo_file.x[0],...
topo_file = topotools.Topography(os.path.join(topodir...
fixedgrids.append([0.0, 21600.0, 361, topo_file.x[0],...
}}
この場合では t1,t2,noutput がそれぞれ 0.0, 21600.0,361 と...
ファイル出力間隔が 60 秒,計 361 回(0〜6 時間)の出力に...
当然ながら計算負荷も上がるし, AMR のパッチ出力より容量が...
ioutsurfacemax を 1 にすると最大水位の列が出力されるよう...
~
~
**fgout [#r1a3ee71]
#codeprettify{{
topo_file = topotools.Topography(os.path.join(topodir...
fgout = fgout_tools.FGoutGrid()
fgout.fgno = 3
fgout.output_format = 'ascii'
fgout.x1 = topo_file.x[0]
fgout.x2 = topo_file.x[-1]
fgout.y1 = topo_file.y[0]
fgout.y2 = topo_file.y[-1]
fgout.nx = topo_file.Z.shape[1]
fgout.ny = topo_file.Z.shape[0]
fgout.tstart = 3600.0*5.0
fgout.tend = clawdata.tfinal
fgout.nout = int((fgout.tend - fgout.tstart)/3600.0) ...
fgout_grids.append(fgout)
}}
Page:
Edit with a page name which already exists