緯度経度格子系(
LatLon grid)を定義するブロック.
変数一覧
| Key |
Data type |
Description |
Default value |
| dir |
path |
Parent directory of the paths of the files below |
'' |
| name |
character |
Name of grid system |
('source' or 'target') |
| nx |
integer |
Num. of grids in the longitudinal direction |
|
| ny |
integer |
Num. of grids in the latitudinal direction |
|
| west |
real |
Western edge of the grid system |
|
| east |
real |
Eastern edge of the grid system |
|
| south |
real |
Southern edge of the grid system |
|
| north |
real |
Northern edge of the grid system |
|
| is_south_to_north |
logical |
Vertical axis is south to north |
.true. |
| f_lon_bound |
file |
Input file of bounds of longit. |
'', dble, 1, little |
| f_lat_bound |
file |
Input file of bounds of latit. |
'', dble, 1, little |
| coord_unit |
character |
Unit of coords. recorded in f_lon_bound or f_lat_bound |
degree |
| idx_bgn |
integer |
Initial number of index that was set automatically |
1 |
| fin_grdidx |
file |
Input file of indices of the grids |
'', int4, 1, little |
| fin_grdara |
file |
Input file of areas of the grids |
'', dble, 1, little |
| fin_grdwgt |
file |
Input file of weights of the grids |
'', dble, 1, little |
| in_grid_sz |
integers |
Size of input grid data |
nx, ny |
| in_grid_lb |
integers |
Lower bounds of grid data to read |
1, 1 |
| in_grid_ub |
integers |
Upper bounds of grid data to read |
nx, ny |
| in_unit_ara |
character |
Unit of input data of area |
m2 |
| idx_miss |
integer |
Missing value of index of grid |
-9999 |
| ara_miss |
real |
Missing value of area of grid |
-1E20 |
| wgt_miss |
real |
Missing value of weight of grid |
-1E20 |
dir
各ファイルの親ディレクトリ.
ファイルのパスが相対パスで指定されたとき,その親ディレクトリは直前の
dirで指定されたディレクトリとなる.
デフォルト値は空文字列で,カレントディレクトリ(プログラムを実行したディレクトリ)に相当する.
この値はパスなので,シングルクォートまたはダブルクォートで囲む.
[基本情報]
name
格子系の名前.任意に設定できる.
ログファイルや標準出力に書き出されるメッセージで,格子系の名前がここで設定された値になる.
内挿テーブル等の出力データには影響しない.
デフォルト値は格子系が送信側のときは
'source',受信側のときは
'target'.
nx, ny [必須]
格子の数.
それぞれ経度方向,緯度方向の数を示す.
例えば全球
0.5°解像度であれば
(nx,ny) = (720,360)となる.
west, east, south, north [準必須]
格子系の領域.
格子線の間隔が等間隔のとき,その経緯度の入力ファイルを省略することができる.
逆に格子線の間隔が非等間隔のとき,これらの値は不要である.
is_south_to_north
格子系の緯度方向の正方向が南から北であるとき
trueとする(デフォルト値は
true).
Trueのとき,配列データは緯度方向の次元において番号が小さい方が南,大きい方が北として認識される.出力においても同様.
Falseのときはその逆.
f_lon_bound, f_lat_bound [準必須]
格子線の経度と緯度の入力ファイル.
T85のように格子線が非等間隔のとき,その座標をファイルで与える必要がある.
いずれも座標の1次元配列で,長さはそれぞれ
nx+1, ny+1である.
単位は
coord_unitで指定する.
※長さがそれぞれ
nx, nyでない理由
全球について定義された格子系(全球格子系)であれば,経度方向の格子の数が
nxのとき,同方向の格子線の数も
nxであるが,領域について定義された格子系(領域格子系; 例えば日本を含む領域として西端120°E,東端150°E,南端20°N,北端50°N)の場合,経度方向の格子線の数は
nx+1となる.
このように格子系の定義される範囲によって入力データの長さを変えなければならないとなると混乱の元になるため,経度方向の格子線の数は
nx+1としている.
全球格子系の場合は西端(=東端)を配列の先頭と末尾に置く.
T85であれば,格子線の経度は
[359.2968750, 0.7031250, 2.1093750, ..., 356.4843750, 357.8906250, 359.2968750]
となる.最も西側の格子は lon=359.2968750, lon=0.7031250 で挟まれたもの,最も東側の格子は lon=357.8906250, lon=359.2968750 で挟まれたものである.
なお緯度方向は経度方向と異なり座標が循環していないので,格子線の数は全球格子系も領域格子系も
ny+1である.
coord_unit
座標データの単位.
度のときは
'degree',ラジアンのときは
'radian'とする.
[格子データ]
idx_bgn
自動で割り振られる格子番号の最初の値.
格子番号ファイルを
fin_grdidxで指定しない場合,格子番号が自動的に与えられる.その値は通常1から始まり
nx×
nyで終わるが,その始まりの値を
idx_bgnで指定することができる.
fin_grdidx
格子番号の入力ファイル.
格子番号を明示的に指定できる.
これを指定しなかった場合,格子番号は内部で自動的に設定される.
fin_grdara
格子の面積の入力ファイル.格子の面積は内部で計算されるが,それとは別に「重みづけされた格子の面積」としてこれを与えることができる.このとき各格子の重み
\(w\)は
$$ w = S_w / S_o $$
で得られる.ここで
\(S_w\)は
fin_grdaraで与えられた面積,
\(S_o\)は内部で格子の形状から計算された面積である.
この重みは内挿テーブルの内挿係数を計算する際に参照され,内挿係数
\(coef\)は
$$ coef = w S_i / S_o $$
で計算される(この格子の面積を分母として内挿係数を計算する場合).ここで
\(S_i\)は重複部分の面積.
なお,次に述べる/{fin_grdwgt}と同時に指定することはできない.
fin_grdwgt
格子の重みの入力ファイル.
fin_grdaraを与えて計算した重みと同様,内挿テーブルの内挿係数を計算する際に参照される.
なお,/{fin_grdara}と同時に指定することはできない.
in_grid_sz, in_grid_lb, in_grid_ub
格子データの一部のみを読み込む際に用いる.
格子データの全体の大きさと読み込む領域を与える.
各キーが対応する値は次のとおりである.
in_grid_sz: 入力ファイルの大きさ
in_grid_lb: 読み込む領域の始点
in_grid_ub: 読み込む領域の終点
それぞれ2つの整数をカンマで区切って与える.1つ目は経度方向,2つ目は緯度方向に該当する.
格子データの入力ファイルから一部のみを読み込む場合としては,例えば入力ファイルに全球の格子データが記録されており,そのうち一部の領域のみについて内挿テーブルを作成したい場合などが考えられる.
以下に例を示す.
大きさ0.5°の緯度経度格子で,日本周辺の領域(経度120°~150°, 緯度50°~20°)について内挿テーブルを作成したいが,格子データが該当領域ではなく全球のものしかない.
このとき全球の格子データの大きさは(720,360)で,そのうち目的の領域は(601:660,81:140)であるから,次のように指定することになる.
in_grid_sz: 720, 360
in_grid_lb: 601, 81
in_grid_ub: 660, 140
idx_miss
格子の番号の欠損値.
陸域モデルの海洋格子や海洋モデルの陸面格子など,格子系で定義されない格子の番号にこの値を与えると欠損格子とみなされ,内挿テーブルに含まれなくなる.
ara_miss
格子の面積の欠損値.
wgt_miss
格子の重みの欠損値.
変数の組み合わせについて
変数は必須のもの,いずれかを指定する必要があるもの,同時に指定できないものなどがある.
経度方向の格子数および格子線の数
格子数
nxは必須.
格子線の座標については次の2通りの指定方法がある.
(1)
f_lon_boundを指定し,(
west, east)をいずれも指定しない
(2) (
west, east)の両方を指定し,
f_lon_boundを指定しない(等間隔の場合のみ可能)
緯度方向の格子数および格子線の数
格子数
nyは必須.
格子線の座標については次の2通りの指定方法がある.
(1)
f_lat_boundを指定し,(
south, north)をいずれも指定しない
(2) (
south, north)の両方を指定し,
f_lat_boundを指定しない(等間隔の場合のみ可能)
座標の単位
[a]
coord_unitは[b]
f_lon_bound, f_lat_boundの単位を指定するための変数なので,[b]を使わない場合は指定できない.
格子番号の欠損値
[a]
idx_missは[b]
fin_grdidxに含まれる欠損値を指定するための変数なので,[b]を使わない場合は指定できない.
格子番号の自動割り振りと明示的な入力
idx_bgnは格子番号の自動割り振りに関する設定なので,/{fin_grdidx}と同時に指定することはできない.
格子データの大きさ・読み込む領域の設定
in_grid_sz,
in_grid_lb,
in_grid_ubは入力として与える格子データの大きさや読み込む領域を指定するものであるため,当然格子データを入力として与えない場合は指定できない.
ブロック 「grid_system_polygon」
多角形格子系(
Polygon grid)を定義するブロック.
| Key |
Data type |
Description |
Default value |
| dir |
path |
Parent directory of the paths of the files below |
'' |
| name |
character |
Name of grid system |
('source' or 'target') |
| np |
integer |
Max. Num. of vertices of each polygon |
|
| nij |
integer |
Num. of grids |
|
| f_lon_vertex |
file |
Longit. of the vertices |
'', dble, 1, little |
| f_lat_vertex |
file |
Latit. of the vertices |
'', dble, 1, little |
| f_x_vertex |
file |
X coord. of the vertices |
'', dble, 1, little |
| f_y_vertex |
file |
Y coord. of the vertices |
'', dble, 1, little |
| f_z_vertex |
file |
Z coord. of the vertices |
'', dble, 1, little |
| coord_unit |
character |
Unit of the coordinates |
(It depends) |
| coord_miss |
real |
Missing value of the coordinates |
-1E20 |
| f_arctyp |
file |
Input file of the type of the sides of grids |
'', int4, 1, little |
| arc_parallel |
logical |
If or not deal with the side with the vertices that have same latitude as the small arc |
.false. |
| idx_bgn |
integer |
Initial number of index that was set automatically |
1 |
| fin_grdidx |
file |
Input file of the indices of the grids |
'', int4, 1, little |
| fin_grdara |
file |
Input file of the areas of the grids |
'', dble, 1, little |
| fin_grdwgt |
file |
Input file of the weights of the grids |
'', dble, 1, little |
| in_grid_sz |
integers |
Size of input grid data |
np, nij |
| in_grid_lb |
integers |
Lower bounds of grid data to read |
1, 1 |
| in_grid_ub |
integers |
Upper bounds of grid data to read |
np, nij |
| idx_miss |
integer |
Missing value of index of grid |
-9999 |
| ara_miss |
real |
Missing value of area of grid |
-1E20 |
| wgt_miss |
real |
Missing value of weight of grid |
-1E20 |
dir
各ファイルの親ディレクトリ.
ファイルのパスが相対パスで指定されたとき,その親ディレクトリは直前の
dirで指定されたディレクトリとなる.
デフォルト値は空文字列で,カレントディレクトリ(プログラムを実行したディレクトリ)に相当する.
この値はパスなので,シングルクォートまたはダブルクォートで囲む.
[基本情報]
name
格子系の名前.任意に設定できる.
ログファイルや標準出力に書き出されるメッセージで,格子系の名前がここで設定された値になる.
内挿テーブル等の出力データには影響しない.
デフォルト値は格子系が送信側のときは
'source',受信側のときは
'target'.
np [必須]
格子の頂点の個数の最大値.
nij [必須]
格子の数.
f_lon_vertex, f_lat_vertex [準必須]
格子の頂点の座標.座標を球面座標系で与える場合に用いる.
f_lon_vertexで経度,
f_lat_vertexで緯度を与える.
f_x_vertex, f_y_vertex, f_z_vertex [準必須]
格子の頂点の座標.座標を三次元直交座標系で与える場合に用いる.
f_x_vertexで
x座標,
f_y_vertexで
y座標,
f_z_vertexで
z座標を与える.
経度
\(\lambda\)・緯度
\(\phi\)との対応は以下のとおり.
原点は回転楕円体の中心とする.
z座標: 南から北に向かう方向を正方向とする.
x座標:
\((\lambda,\phi) = (0,0)\)における
\(x\)座標を
\(1\)とする.
y座標:
\((\lambda,\phi) = (\pi/2,0)\)における
\(y\)座標を
\(1\)とする.
coord_unit
座標の単位.
座標を球面座標系で与える場合は
'degree'か
'radian'を与える.それぞれ度,ラジアンに対応.デフォルト値は
'degree'.
座標を三次元直交座標系で与える場合は
'm'か
'km'を与える.それぞれメートル,キロメートルに対応.デフォルト値は
'm'.
f_arctyp, arc_parallel
格子線のタイプの情報.
格子線とは格子の頂点を結ぶ球面上の線である.本ツールでは格子線を
2つにタイプに分類している.ひとつは大円弧,すなわち原点を通る平面と球面との交線の一部である.もうひとつは小円弧,すなわち水平な平面と球面との交線の一部である.
多角形格子系に分類される格子系では,格子線は大円弧であることが多いが,例えば海洋モデル
COCOや衛星観測データ
MODISのように,大円弧と小円弧が混在する場合もある.また緯度経度格子系を多角形格子系とみなして与える場合も,東西方向の格子線は全て小円弧,南北方向の格子線は全て大円弧となる.
デフォルトでは全ての格子線を大円弧として扱うが,
f_arctypでファイルを指定して格子線のタイプを与えるか,
arc_parallelを指定することで,格子線のタイプをユーザー側で制御することができる.
・
f_arctypで与える場合
整数でタイプを指定する.
大円弧を
1,小円弧を
2とする.
配列形状は,格子の座標データと対応して長さ
nijの
1次元配列とする.
・
arc_parallelを指定する場合
.true.のとき,格子線の端点の緯度が同じときにはその格子線を小円弧として扱う.
先に例に挙げた
COCOや
MODISを含むほとんどのケースはこちらで対応でき,この場合わざわざファイルを用意する必要は無い.
idx_bgn
自動で割り振られる格子番号の最初の値.
格子番号ファイルを
fin_grdidxで指定しない場合,格子番号が自動的に与えられる.その値は通常1から始まり
nijで終わるが,その始まりの値を
idx_bgnで指定することができる.
[格子データ]
fin_grdidx
格子の番号の入力ファイル.
格子の番号を明示的に指定できる.
これを指定しなかった場合,格子の番号は内部で自動的に設定される.
fin_grdara, fin_grdwgt
ブロック「grid_system_latlon」の
fin_grdara, fin_grdwgtの項を参照.
in_grid_sz, in_grid_lb, in_grid_ub
格子データの一部のみを読み込む際に用いる.
各キーが対応する値は次のとおりである.
in_grid_sz: 入力ファイルの大きさ
in_grid_lb: 読み込む領域の始点
in_grid_ub: 読み込む領域の終点
それぞれ2つの整数をカンマで区切って与える.1つ目は頂点の個数,2つ目は格子の数に該当する.
[欠損値]
idx_miss
格子の番号の欠損値.
陸域モデルの海洋格子や海洋モデルの陸面格子など,格子系で定義されない格子の番号にこの値を与えると欠損格子とみなされ,内挿テーブルに含まれなくなる.
ara_miss
格子の面積の欠損値.
wgt_miss
格子の重みの欠損値.
出力のラスター格子系(
Raster grid)を定義するブロック.
変数一覧
| Key |
Data type |
Description |
Default value |
| nx |
integer |
Num. of rasters in longitudinal direction |
|
| ny |
integer |
Num. of rasters in latitudinal direction |
|
| west |
real |
Western edge of the grid system |
|
| east |
real |
Eastern edge of the grid system |
|
| south |
real |
Southern edge of the grid system |
|
| north |
real |
Northern edge of the grid system |
|
| is_south_to_north |
logical |
Vertical axis is south to north |
.true. |
[基本情報]
nx, ny [必須]
ラスターの数.
それぞれ経度方向,緯度方向の数を示す.
例えば全球
1分(1/60°)解像度であれば
(nx,ny) = (21600,10800)となる.
west, east, south, north [必須]
格子系の領域.
単位は度.
緯度経度格子系 (
grid_system_latlon) とは異なり,ラスターの線は等間隔に限られるため,格子線の座標データは指定できない.
出力データのファイルや閾値を設定するブロック.
変数一覧
| Key |
Data type |
Description |
Default value |
| ratio_min |
real |
Lower bound of intersection ratio |
0.5 |
| ratio_max |
real |
Upper bound of intersection ratio |
1.0 |
| include_min |
logical |
Whether or not to include `ratio_min` in the range of valid intersection ratio |
true |
| include_max |
logical |
Whether or not to include `ratio_max` in the range of valid intersection ratio |
true |
| dir |
path |
Parent directory of the paths of the files below |
'' |
| f_area_sum |
file |
Intersection area of pixels |
'', dble, 1, little |
| f_ratio_sum |
file |
Intersection ratio of pixels |
'', dble, 1, little |
| f_mask |
file |
Mask of raster map |
'', int4, 1, little |
| f_idx |
file |
Index of pixels |
'', int4, 1, little |
ratio_min, ratio_max, include_min, include_max
include_minと
include_maxが
trueのとき,重複面積率が[
ratio_min,
ratio_max]の範囲にあるピクセルは有効,つまり元の格子系(の欠損格子を除いた部分)と重複しているとみなされる.
include_minがfalseならば下限は (
ratio_min となり,同様に
include_maxがfalseならば上限は
ratio_max) となる.
オプションを設定するブロック.
| Key |
Data type |
Description |
Default value |
| old_files |
character |
Action if output file already exists ['stop'|'remove'|'overwrite'] |
stop |
| dir_intermediates |
path |
Output directory of the intermediates |
Directory of the report file |
| remove_intermediates |
logical |
Whether remove the intermediates or not |
.false. |
| earth_shape |
character |
Shape of the earth ['sphere'|'ellips'] |
sphere |
| earth_r |
real |
Equatorial radius of the earth (m) |
6371000.79* |
| earth_e2 |
real |
Square of the eccentricity of the earth |
0.0 |
old_files
出力ファイルとして指定したファイルが既に存在していた場合の動作を指定する.
stop : エラー文を出力してプログラムを停止する.誤って既存のデータを消去したり上書きしたりするのを防ぐ,最も安全なモード.
remove : 既存のファイルを消去する.
overwrite: 既存のファイルを消去せず上書きする.基本的に利用しない.
dir_intermediates
中間ファイルの出力ディレクトリ.
デフォルト値はレポートファイル(設定ファイルの頭で
path_reportで指定したもの)のディレクトリ.
remove_intermediates
Trueのとき,中間ファイルを削除する.
earth_shape
地球の形状.デフォルト値は
'sphere'.
shpere: 完全球として扱う
ellips: 回転楕円体として扱う
earth_r
地球の赤道半径.
earth_shape = 'sphere'のとき,デフォルト値は
6371000.79 mである.これは
WGS84測地系で定義された回転楕円体と体積が概ね等しくなるような値である.
earth_shape = 'ellips'のとき,デフォルト値は同測地系に従って
6378137.00 mを取る.
earth_e2
地球楕円体の離心率の平方.
earth_shape = 'sphere'のときは
0以外の値を取り得ないので指定できない.
earth_shape = 'ellips'のとき,デフォルト値は
WGS84測地系に従って
0.00669437999014を取る.