Simulation Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CLog2.f90 3.3 KiB

1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. module CLog2
  2. use CIActionReference
  3. implicit none
  4. public
  5. interface Log_2
  6. module procedure :: Log2Log1, Log2Log2, Log2Log3, Log2Log4, Log2Log5
  7. end interface
  8. procedure (ActionString), pointer :: Log2MsgPtr
  9. procedure (ActionStringInt), pointer :: Log2MsgIntPtr
  10. procedure (ActionStringFloat), pointer :: Log2MsgFloatPtr
  11. procedure (ActionStringDouble), pointer :: Log2MsgDoublePtr
  12. procedure (ActionStringBool), pointer :: Log2MsgBoolPtr
  13. contains
  14. subroutine Log2Log1(message)
  15. implicit none
  16. character(len=*), intent(in) :: message
  17. #ifdef Log2
  18. if(associated(Log2MsgPtr)) call Log2MsgPtr(message)
  19. #endif
  20. end subroutine
  21. subroutine Log2Log2(message, value)
  22. implicit none
  23. character(len=*), intent(in) :: message
  24. integer, intent(in) :: value
  25. #ifdef Log2
  26. if(associated(Log2MsgIntPtr)) call Log2MsgIntPtr(message, value)
  27. #endif
  28. end subroutine
  29. subroutine Log2Log3(message, value)
  30. implicit none
  31. character(len=*), intent(in) :: message
  32. real, intent(in) :: value
  33. #ifdef Log2
  34. if(associated(Log2MsgFloatPtr)) call Log2MsgFloatPtr(message, value)
  35. #endif
  36. end subroutine
  37. subroutine Log2Log4(message, value)
  38. implicit none
  39. character(len=*), intent(in) :: message
  40. real(8), intent(in) :: value
  41. #ifdef Log2
  42. if(associated(Log2MsgDoublePtr)) call Log2MsgDoublePtr(message, value)
  43. #endif
  44. end subroutine
  45. subroutine Log2Log5(message, value)
  46. implicit none
  47. character(len=*), intent(in) :: message
  48. logical, intent(in) :: value
  49. #ifdef Log2
  50. if(associated(Log2MsgBoolPtr)) call Log2MsgBoolPtr(message, value)
  51. #endif
  52. end subroutine
  53. subroutine SubscribeLog2Message(a)
  54. !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog2Message
  55. !DEC$ ATTRIBUTES ALIAS: 'SubscribeLog2Message' :: SubscribeLog2Message
  56. implicit none
  57. procedure (ActionString) :: a
  58. Log2MsgPtr => a
  59. end subroutine
  60. subroutine SubscribeLog2MsgInt(a)
  61. !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog2MsgInt
  62. !DEC$ ATTRIBUTES ALIAS: 'SubscribeLog2MsgInt' :: SubscribeLog2MsgInt
  63. implicit none
  64. procedure (ActionStringInt) :: a
  65. Log2MsgIntPtr => a
  66. end subroutine
  67. subroutine SubscribeLog2MsgFloat(a)
  68. !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog2MsgFloat
  69. !DEC$ ATTRIBUTES ALIAS: 'SubscribeLog2MsgFloat' :: SubscribeLog2MsgFloat
  70. implicit none
  71. procedure (ActionStringFloat) :: a
  72. Log2MsgFloatPtr => a
  73. end subroutine
  74. subroutine SubscribeLog2MsgDouble(a)
  75. !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog2MsgDouble
  76. !DEC$ ATTRIBUTES ALIAS: 'SubscribeLog2MsgDouble' :: SubscribeLog2MsgDouble
  77. implicit none
  78. procedure (ActionStringDouble) :: a
  79. Log2MsgDoublePtr => a
  80. end subroutine
  81. subroutine SubscribeLog2MsgBool(a)
  82. !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog2MsgBool
  83. !DEC$ ATTRIBUTES ALIAS: 'SubscribeLog2MsgBool' :: SubscribeLog2MsgBool
  84. implicit none
  85. procedure (ActionStringBool) :: a
  86. Log2MsgBoolPtr => a
  87. end subroutine
  88. end module CLog2