sources_sinks__test.F90 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. !### macro's #####################################################
  2. !
  3. #define TRACEBACK write (gol,'("in ",a," (",a,", line",i5,")")') rname, __FILE__, __LINE__; call goErr
  4. #define IF_NOTOK_RETURN(action) if (status/=0) then; TRACEBACK; action; return; end if
  5. #define IF_ERROR_RETURN(action) if (status> 0) then; TRACEBACK; action; return; end if
  6. !
  7. #include "tm5.inc"
  8. !
  9. !#################################################################
  10. module sources_sinks
  11. use GO, only : gol, goPr, goErr
  12. implicit none
  13. private
  14. public :: Sources_sinks_Init, Sources_sinks_Done ! Init and Done methods
  15. public :: Ss_monthly_update ! monthly initialization (photolysis,..)
  16. public :: ss_after_read_meteo_update ! Update SS after met fields are updated. Called from modelIntegration/Proces_update
  17. public :: sources_sinks_apply ! apply source : always called
  18. ! --- const --------------------------------------
  19. character(len=*), parameter :: mname = 'sources_sinks'
  20. contains
  21. ! ================================================================
  22. subroutine Sources_Sinks_Init( status )
  23. ! --- in/out --------------------------------
  24. integer, intent(out) :: status
  25. ! --- const ------------------------------
  26. character(len=*), parameter :: rname = mname//'/Sources_Sinks_Init'
  27. ! --- begin --------------------------------
  28. ! nothing to be init
  29. ! ok
  30. status = 0
  31. end subroutine Sources_Sinks_Init
  32. ! ***
  33. subroutine Sources_Sinks_Done( status )
  34. ! --- in/out --------------------------------
  35. integer, intent(out) :: status
  36. ! --- const ------------------------------
  37. character(len=*), parameter :: rname = mname//'/Sources_Sinks_Done'
  38. ! --- begin --------------------------------
  39. ! nothing to be done
  40. ! ok
  41. status = 0
  42. end subroutine Sources_Sinks_Done
  43. ! ================================================================
  44. !
  45. ! purpose
  46. ! -------
  47. ! initialise data needed for chemistry,
  48. ! e.g. read emissions and boundary conditions
  49. ! provides a way to input tracer specific values.
  50. !
  51. ! Called from tm5/TM5_Model_run, at run start and at beginning of each
  52. ! month.
  53. !
  54. !
  55. !---------------------------------------------------------------------
  56. subroutine ss_monthly_update( status )
  57. use datetime, only : calc_sm
  58. use dims, only : mlen, sec_month, sec_year, sec_day
  59. use dims, only : okdebug
  60. ! --- in/out --------------------------
  61. integer, intent(out) :: status
  62. ! --- local --------------------------
  63. character(len=*), parameter :: rname = mname//'/Ss_monthly_update'
  64. ! --- begin ---------------------------
  65. write (gol,'(a,": update time parameters for new month ...")') rname; call goPr
  66. call calc_sm( mlen, sec_day,sec_month,sec_year )
  67. if ( okdebug ) then
  68. write (gol,*) 'seconds in a day, month and year',sec_day,sec_month,sec_year; call goPr
  69. end if
  70. ! ok
  71. status = 0
  72. end subroutine ss_monthly_update
  73. !---------------------------------------------------------------------
  74. !
  75. ! subroutine that is called after reading new met fields
  76. ! (clouds, surface winds, etc.)
  77. ! In this routine, sources and sinks processes that depend on these data are updated.
  78. ! Routine is called from modelIntegration/Proces_Update
  79. !
  80. !---------------------------------------------------------------------
  81. subroutine ss_after_read_meteo_update( status )
  82. ! --- in/out ---------------------------------
  83. integer, intent(out) :: status
  84. ! --- const ---------------------------------
  85. character(len=*), parameter :: rname = 'trace_after_read'
  86. ! --- begin ---------------------------------
  87. ! nothing to be done
  88. ! ok
  89. status = 0
  90. end subroutine ss_after_read_meteo_update
  91. !---------------------------------------------------------------------
  92. !
  93. ! sources_sinks_apply
  94. !
  95. !
  96. ! purpose
  97. ! -------
  98. ! this subroutine changes the tracer mass and its slopes
  99. ! by chemical sources
  100. !
  101. ! interface
  102. ! ---------
  103. ! call source1
  104. !
  105. ! method
  106. ! ------
  107. !
  108. !
  109. !
  110. ! reference
  111. ! --------
  112. ! see above
  113. !
  114. !---------------------------------------------------------------------
  115. subroutine Sources_sinks_apply( region, tr, status )
  116. use GO , only : TDate
  117. ! --- in/out ---------------------------------
  118. integer, intent(in) :: region
  119. type(TDate), intent(in) :: tr(2) ! time range
  120. integer, intent(out) :: status
  121. ! --- const ---------------------------------------
  122. character(len=*), parameter :: rname = mname//'/Source1'
  123. ! --- begin ----------------------------------
  124. ! ok
  125. status = 0
  126. end subroutine Sources_sinks_apply
  127. end module sources_sinks