Skip to content

Latest commit

 

History

History
56 lines (43 loc) · 1.8 KB

03_01_08_example_func.rst

File metadata and controls

56 lines (43 loc) · 1.8 KB

Functional

<Item name="discharge" caption="Discharge time series">
  <Definition valueType="functional" >
    <Parameter valueType="real" caption="Time" />
    <Value valueType="real" caption="Discharge" />
  </Definition>
</Item>
images/widget_example_func.png

Widget example of a functional type condition

integer:: ier, discharge_size
double precision, dimension(:), allocatable:: discharge_time, discharge_value

! Read size
call cg_iric_read_functionalsize(fid, "discharge", discharge_size, ier)
! Allocate memory
allocate(discharge_time(discharge_size))
allocate(discharge_value(discharge_size))
! Load values into the allocated memory
call cg_iric_read_functional(fid, "discharge", discharge_time, discharge_value, ier)
integer:: ier, discharge_size
double precision, dimension(:), allocatable:: discharge_time, discharge_value

! Read size
call cg_iric_read_bc_functionalsize(fid, "inflow", 1, "discharge", discharge_size, ier)
! Allocate memory
allocate(discharge_time(discharge_size))
allocate(discharge_value(discharge_size))
! Load values into the allocated memory
call cg_iric_read_bc_functional(fid, "inflow", 1, "discharge", discharge_time, discharge_value, ier)