Functional¶
Definition¶
1<Item name="discharge" caption="Discharge time series">
2 <Definition valueType="functional" >
3 <Parameter valueType="real" caption="Time" />
4 <Value valueType="real" caption="Discharge" />
5 </Definition>
6</Item>
Example of widget¶
Example code to read data¶
Calculation condition, Grid generating condition¶
FORTRAN¶
1integer:: ier, discharge_size
2double precision, dimension(:), allocatable:: discharge_time, discharge_value
3
4! Read size
5call cg_iRIC_Read_FunctionalSize(fid, "discharge", discharge_size, ier)
6! Allocate memory
7allocate(discharge_time(discharge_size))
8allocate(discharge_value(discharge_size))
9! Load values into the allocated memory
10call cg_iRIC_Read_Functional(fid, "discharge", discharge_time, discharge_value, ier)
C/C++¶
1integer:: ier, discharge_size
2std::vector<double> discharge_time, discharge_value;
3
4// Read size
5ier = cg_iRIC_Read_FunctionalSize(fid, "discharge", &discharge_size)
6// Allocate memory
7discharge_time.assign(discharge_size, 0);
8discharge_value.assign(discharge_size, 0);
9// Load values into the allocated memory
10ier = cg_iRIC_Read_Functional(fid, "discharge", discharge_time.data(), discharge_value.data())
Python¶
1discharge_time, discharge_value = cg_iRIC_Read_Functional(fid, "discharge")
Boundary condition¶
FORTRAN¶
1integer:: ier, discharge_size
2double precision, dimension(:), allocatable:: discharge_time, discharge_value
3
4! Read size
5call cg_iRIC_Read_BC_FunctionalSize(fid, "inflow", 1, "discharge", discharge_size, ier)
6! Allocate memory
7allocate(discharge_time(discharge_size))
8allocate(discharge_value(discharge_size))
9! Load values into the allocated memory
10call cg_iRIC_Read_BC_Functional(fid, "inflow", 1, "discharge", discharge_time, discharge_value, ier)
C/C++¶
1integer:: ier, discharge_size
2std::vector<double> discharge_time, discharge_value;
3
4// Read size
5ier = cg_iRIC_Read_BC_FunctionalSize(fid, "inflow", 1, "discharge", &discharge_size)
6// Allocate memory
7discharge_time.assign(discharge_size, 0);
8discharge_value.assign(discharge_size, 0);
9// Load values into the allocated memory
10ier = cg_iRIC_Read_BC_Functional(fid, "inflow", 1, "discharge", discharge_time.data(), discharge_value.data());
Python¶
1discharge_time, discharge_value = cg_iRIC_Read_BC_Functional(fid, "inflow", 1, "discharge")