
module dummy_types

!  dummy structure definitions, to allow the interfaces below to compile
   type t_network       ; real stuff  ; end type
   type t_flash_results ; real stuff2 ; end type
   type t_ehs           ; real stuff3 ; end type

end module dummy_types

module net_func_branches_interfaces_mod

   use network_types
   use fluid_types
   use eh_mod

   implicit none

   interface


#     define _Iface1_(ProcName,Sint,Eint) \
      module subroutine ProcName(net, ib, irow, spres, epres, rate, func, derv, outlet_fprop, ehs)  ; \
        type(t_network), target, intent(inout) :: net             ; \
        integer                , intent(in   ) :: ib              ; \
        integer                , intent(in   ) :: irow            ; \
        real(8)                , intent(Sint ) :: spres           ; \
        real(8)                , intent(Eint ) :: epres           ; \
        real(8)                , intent(in   ) :: rate            ; \
        logical                , intent(in   ) :: func            ; \
        logical                , intent(in   ) :: derv            ; \
        type(t_flash_results)  , intent(out  ) :: outlet_fprop    ; \
        type(t_ehs)            , intent(inout) :: ehs             ; \
      end subroutine

      _Iface1_(net_func_branches_binjector ,in   ,inout)
      _Iface1_(net_func_branches_bseparator,in   ,inout)
      _Iface1_(net_func_branches_choke     ,inout,inout)
      _Iface1_(net_func_branches_compressor,in   ,inout)
      _Iface1_(net_func_branches_heatex    ,in   ,in   )
      _Iface1_(net_func_branches_injvalve  ,inout,inout)
      _Iface1_(net_func_branches_pump      ,in   ,in   )
      _Iface1_(net_func_branches_recip     ,in   ,inout)
      _Iface1_(net_func_branches_rodpump   ,inout,inout)


#     define _Iface2_(ProcName,Sint,Eint) \
      module subroutine ProcName(net, ib, irow, spres, epres, rate, func, derv, ehs)  ; \
        type(t_network), target, intent(inout) :: net             ; \
        integer                , intent(in   ) :: ib              ; \
        integer                , intent(in   ) :: irow            ; \
        real(8)                , intent(Sint ) :: spres           ; \
        real(8)                , intent(Eint ) :: epres           ; \
        real(8)                , intent(in   ) :: rate            ; \
        logical                , intent(in   ) :: func            ; \
        logical                , intent(in   ) :: derv            ; \
        type(t_ehs)            , intent(inout) :: ehs             ; \
      end subroutine

      _Iface2_(net_func_branches_block    ,in   ,in   )
      _Iface2_(net_func_branches_connector,in   ,inout)
      _Iface2_(net_func_branches_equip    ,in   ,inout)
      _Iface2_(net_func_branches_fcv      ,in   ,inout)
      _Iface2_(net_func_branches_ipr      ,in   ,inout)
      _Iface2_(net_func_branches_nrv      ,in   ,in   )
      _Iface2_(net_func_branches_pcv      ,in   ,in   )
      _Iface2_(net_func_branches_pipe     ,in   ,inout)
!

!  connector

   end interface

end module

