module CHookHeight use CVoidEventHandlerCollection implicit none real :: HookHeight = 0 public type(VoidEventHandlerCollection) :: OnHookHeightChange private :: HookHeight contains subroutine Set_HookHeight(v) implicit none real , intent(in) :: v #ifdef ExcludeExtraChanges if(HookHeight == v) return #endif HookHeight = v #ifdef deb print*, 'HookHeight=', HookHeight #endif call OnHookHeightChange%RunAll() end subroutine real function Get_HookHeight() implicit none Get_HookHeight = HookHeight end function subroutine Subscribe_HookHeight() use CHookVariables, only: OnHookHeight => OnHookHeightChange implicit none call OnHookHeight%Add(Set_HookHeight) end subroutine end module CHookHeight