関数型 (複数の値)¶
定義方法¶
1<Item name="discharge_and_elev" caption="Discharge and Water Elevation time series">
2 <Definition valueType="functional" >
3 <Parameter name="time" valueType="real" caption="Time" />
4 <Value name="discharge" valueType="real" caption="Discharge" />
5 <Value name="elevation" valueType="real" caption="Water Elevation" />
6 </Definition>
7</Item>
条件の表示例¶
読み込み処理の記述方法¶
計算条件・格子生成条件¶
FORTRAN¶
1integer:: ier, discharge_size
2double precision, dimension(:), allocatable:: time_value
3double precision, dimension(:), allocatable:: discharge_value, elevation_value
4
5! サイズを調べる
6call cg_iRIC_Read_FunctionalSize(fid, "discharge", discharge_size, ier)
7! メモリを確保
8allocate(time_value(discharge_size))
9allocate(discharge_value(discharge_size), elevation_value(discharge_size))
10! 確保したメモリに値を読み込む
11call cg_iRIC_Read_FunctionalWithName(fid, "discharge", "time", time_value, ier)
12call cg_iRIC_Read_FunctionalWithName(fid, "discharge", "discharge", discharge_value, ier)
13call cg_iRIC_Read_FunctionalWithName(fid, "discharge", "elevation", elevation_value, ier)
C/C++¶
1int ier, discharge_size;
2std::vector<double> time_value, discharge_value, elevation_value;
3
4// サイズを調べる
5ier = cg_iRIC_Read_FunctionalSize(fid, "discharge", &discharge_size);
6// メモリを確保
7time_value.assign(discharge_size, 0);
8discharge_value.assign(discharge_size, 0);
9elevation_value.assign(discharge_size, 0);
10// 確保したメモリに値を読み込む
11ier = cg_iRIC_Read_FunctionalWithName(fid, "discharge", "time", time_value);
12ier = cg_iRIC_Read_FunctionalWithName(fid, "discharge", "discharge", discharge_value);
13ier = cg_iRIC_Read_FunctionalWithName(fid, "discharge", "elevation", elevation_value);
Python¶
1time_value = cg_iRIC_Read_FunctionalWithName(fid, "discharge", "time")
2discharge_value = cg_iRIC_Read_FunctionalWithName(fid, "discharge", "discharge")
3elevation_value = cg_iRIC_Read_FunctionalWithName(fid, "discharge", "elevation")
境界条件¶
FORTRAN¶
1integer:: ier, discharge_size
2double precision, dimension(:), allocatable:: time_value
3double precision, dimension(:), allocatable:: discharge_value, elevation_value
4
5! サイズを調べる
6call cg_iRIC_Read_BC_FunctionalSize(fid, "discharge", discharge_size, ier)
7! メモリを確保
8allocate(time_value(discharge_size))
9allocate(discharge_value(discharge_size), elevation_value(discharge_size))
10! 確保したメモリに値を読み込む
11call cg_iRIC_Read_BC_FunctionalWithName(fid, "discharge", "time", time_value, ier)
12call cg_iRIC_Read_BC_FunctionalWithName(fid, "discharge", "discharge", discharge_value, ier)
13call cg_iRIC_Read_BC_FunctionalWithName(fid, "discharge", "elevation", elevation_value, ier)
C/C++¶
1int ier, discharge_size;
2std::vector<double> time_value, discharge_value, elevation_value;
3
4// サイズを調べる
5ier = cg_iRIC_Read_BC_FunctionalSize(fid, "discharge", &discharge_size)
6// メモリを確保
7time_value.assign(discharge_size, 0);
8discharge_value.assign(discharge_size, 0);
9elevation_value.assign(discharge_size, 0);
10// 確保したメモリに値を読み込む
11ier = cg_iRIC_Read_BC_FunctionalWithName(fid, "discharge", "time", time_value.data());
12ier = cg_iRIC_Read_BC_FunctionalWithName(fid, "discharge", "discharge", discharge_value.data());
13ier = cg_iRIC_Read_BC_FunctionalWithName(fid, "discharge", "elevation", elevation_value.data());
Python¶
1time_value = cg_iRIC_Read_BC_FunctionalWithName(fid, "discharge", "time")
2discharge_value = cg_iRIC_Read_BC_FunctionalWithName(fid, "discharge", "discharge")
3elevation_value = cg_iRIC_Read_BC_FunctionalWithName(fid, "discharge", "elevation")