wet_deposition.F90 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. !
  2. #define TRACEBACK write (gol,'("in ",a," (",a,", line",i5,")")') rname, __FILE__, __LINE__; call goErr
  3. #define IF_NOTOK_RETURN(action) if (status/=0) then; TRACEBACK; action; return; end if
  4. #define IF_ERROR_RETURN(action) if (status> 0) then; TRACEBACK; action; return; end if
  5. !
  6. #include "tm5.inc"
  7. !
  8. !-----------------------------------------------------------------------------
  9. ! TM5 !
  10. !-----------------------------------------------------------------------------
  11. !BOP
  12. !
  13. ! !MODULE: WET_DEPOSITION
  14. !
  15. ! !DESCRIPTION: ** DUMMY ** but holds convective precipitation (CP) and large scale
  16. ! precipitation (LSP) budgets variables.
  17. !
  18. !\\
  19. !\\
  20. ! !INTERFACE:
  21. !
  22. MODULE WET_DEPOSITION
  23. !
  24. ! !USES:
  25. !
  26. use GO, only : gol, goErr, goPr
  27. use dims, only : nregions
  28. use chem_param, only : ntracet
  29. use tm5_distgrid, only : dgrid, Get_DistGrid
  30. IMPLICIT NONE
  31. PRIVATE
  32. !
  33. ! !PUBLIC MEMBER FUNCTIONS:
  34. !
  35. public :: Wet_Deposition_Init, Wet_Deposition_Done
  36. public :: calc_cvsfac, calculate_lsp_scav, lspscav
  37. !
  38. ! !PUBLIC DATA MEMBERS:
  39. !
  40. real, public :: cvsfac(ntracet) = 0.0 ! scavenging efficiencies, used in convection
  41. real, public :: cp_scale = 0.5 ! default amount of rain (converted to m/s) with maximum CP removal on 1x1 degree
  42. #ifdef with_budgets
  43. real, dimension(nregions), public :: sum_wetdep ! global wet dep budget for tracer #1 (includes both LSP and CP; meaningful on root only)
  44. type, public :: buddep_data
  45. ! budgets in each column, split vertically...
  46. real,dimension(:,:,:,:),pointer :: lsp ! (i, j, nbud_vg, ntracet) computed here
  47. real,dimension(:,:,:,:),pointer :: cp ! (i, j, nbud_vg, ntracet) computed in convection
  48. end type buddep_data
  49. type(buddep_data), dimension(nregions), target, public :: buddep_dat ! ... for each region
  50. #endif
  51. !
  52. ! !PRIVATE DATA MEMBERS:
  53. !
  54. character(len=*), parameter :: mname = 'wet_deposition'
  55. !
  56. !
  57. ! !REVISION HISTORY:
  58. ! version March 2003, adapted for TM5 MK from KNMI version
  59. ! 29 Feb 2012 - P. Le Sager - adapted for lon-lat MPI domain decomposition
  60. !
  61. ! !REMARKS:
  62. !
  63. !EOP
  64. !------------------------------------------------------------------------
  65. CONTAINS
  66. !--------------------------------------------------------------------------
  67. ! TM5 !
  68. !--------------------------------------------------------------------------
  69. !BOP
  70. !
  71. ! !IROUTINE: WET_DEPOSITION_INIT
  72. !
  73. ! !DESCRIPTION:
  74. !\\
  75. !\\
  76. ! !INTERFACE:
  77. !
  78. SUBROUTINE WET_DEPOSITION_INIT( status )
  79. !
  80. ! !USES:
  81. !
  82. #ifdef with_budgets
  83. use budget_global, only : nbud_vg
  84. #endif
  85. !
  86. ! !OUTPUT PARAMETERS:
  87. !
  88. integer, intent(out) :: status
  89. !
  90. ! !REVISION HISTORY:
  91. ! 29 Feb 2012 - P. Le Sager - adapted for lon-lat MPI domain decomposition
  92. !
  93. !EOP
  94. !------------------------------------------------------------------------
  95. !BOC
  96. character(len=*), parameter :: rname = mname//'/Wet_Deposition_Init'
  97. integer :: region, i1, i2, j1, j2
  98. ! --- begin ------------------------------------
  99. write (gol,*) 'maximum removal CP precip on 1x1 at rain rate (mm/hr) :', cp_scale; call goPr
  100. cp_scale = cp_scale/(1e3*3600.) ! to m/s!
  101. ! budgets
  102. #ifdef with_budgets
  103. do region = 1, nregions
  104. CALL GET_DISTGRID( DGRID(region), I_STRT=i1, I_STOP=i2, J_STRT=j1, J_STOP=j2 )
  105. sum_wetdep(region) = 0.0
  106. allocate( buddep_dat(region)%lsp(i1:i2, j1:j2, nbud_vg, ntracet))
  107. buddep_dat(region)%lsp = 0.0
  108. allocate( buddep_dat(region)%cp (i1:i2, j1:j2, nbud_vg, ntracet))
  109. buddep_dat(region)%cp = 0.0
  110. enddo
  111. #endif
  112. ! ok
  113. status = 0
  114. END SUBROUTINE WET_DEPOSITION_INIT
  115. !EOC
  116. !--------------------------------------------------------------------------
  117. ! TM5 !
  118. !--------------------------------------------------------------------------
  119. !BOP
  120. !
  121. ! !IROUTINE: WET_DEPOSITION_DONE
  122. !
  123. ! !DESCRIPTION: deallocate scavenging coeff. & write wet dep and convection
  124. ! budgets into file.
  125. !\\
  126. !\\
  127. ! !INTERFACE:
  128. !
  129. SUBROUTINE WET_DEPOSITION_DONE( status )
  130. !
  131. ! !USES:
  132. !
  133. use dims, only : nregions
  134. !
  135. ! !OUTPUT PARAMETERS:
  136. !
  137. integer, intent(out) :: status
  138. !
  139. ! !REVISION HISTORY:
  140. ! 29 Feb 2012 - P. Le Sager - adapted for lon-lat MPI domain decomposition
  141. !
  142. !EOP
  143. !------------------------------------------------------------------------
  144. !BOC
  145. character(len=*), parameter :: rname = mname//'/Wet_Deposition_Done'
  146. integer :: region
  147. ! --- begin ----------------------------------
  148. #ifdef with_budgets
  149. do region = 1, nregions
  150. deallocate( buddep_dat(region)%lsp )
  151. deallocate( buddep_dat(region)%cp )
  152. end do
  153. #endif /* WITH_BUDGET */
  154. ! ok
  155. status = 0
  156. END SUBROUTINE WET_DEPOSITION_DONE
  157. !EOC
  158. !--------------------------------------------------------------------------
  159. ! TM5 !
  160. !--------------------------------------------------------------------------
  161. !BOP
  162. !
  163. ! !IROUTINE: CALC_CVSFAC
  164. !
  165. ! !DESCRIPTION: dummy
  166. !
  167. !\\
  168. !\\
  169. ! !INTERFACE:
  170. !
  171. SUBROUTINE CALC_CVSFAC
  172. END SUBROUTINE CALC_CVSFAC
  173. !EOC
  174. !--------------------------------------------------------------------------
  175. ! TM5 !
  176. !--------------------------------------------------------------------------
  177. !BOP
  178. !
  179. ! !IROUTINE: LSPSCAV
  180. !
  181. ! !DESCRIPTION: dummy
  182. !
  183. !\\
  184. !\\
  185. ! !INTERFACE:
  186. !
  187. SUBROUTINE LSPSCAV( region )
  188. !
  189. ! !INPUT PARAMETERS:
  190. !
  191. integer,intent(in) :: region
  192. !
  193. ! !REVISION HISTORY:
  194. !
  195. !
  196. !EOP
  197. !------------------------------------------------------------------------
  198. !BOC
  199. END SUBROUTINE LSPSCAV
  200. !EOC
  201. !--------------------------------------------------------------------------
  202. ! TM5 !
  203. !--------------------------------------------------------------------------
  204. !BOP
  205. !
  206. ! !IROUTINE: CALCULATE_LSP_SCAV
  207. !
  208. ! !DESCRIPTION: dummy
  209. !
  210. !\\
  211. !\\
  212. ! !INTERFACE:
  213. !
  214. SUBROUTINE CALCULATE_LSP_SCAV( region )
  215. !
  216. ! !INPUT PARAMETERS:
  217. !
  218. integer, intent(in) :: region
  219. !
  220. ! !REVISION HISTORY:
  221. !
  222. !
  223. ! !REMARKS:
  224. !
  225. !EOP
  226. !------------------------------------------------------------------------
  227. !BOC
  228. END SUBROUTINE CALCULATE_LSP_SCAV
  229. !EOC
  230. END MODULE WET_DEPOSITION