wet_deposition.F90 60 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594
  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: holds convective precipitation (CP) and large scale
  16. ! precipitation (LSP) budgets variables.
  17. !
  18. ! has all routines to deal with LSP, since it is done here. CP
  19. ! is done in convection.
  20. !
  21. ! **** THIS VERSION DIFFERS FROM THE BASE IN TWO THRESHOLD VALUES ****
  22. !
  23. ! (1) Scale factor relative to 100% scavenging (of HNO3) for scavenging
  24. ! type = 2 (ie variable factor, using henry solubility) is non-zero and
  25. ! computed if henry coeff > 1 (instead of 10 in base code).
  26. !
  27. ! (2) Wet removal rates: in case of in-cloud scavenging, test on cloud
  28. ! cover has a threshold of 0.02 instead of 0.05
  29. !\\
  30. !\\
  31. ! !INTERFACE:
  32. !
  33. MODULE WET_DEPOSITION
  34. !
  35. ! !USES:
  36. !
  37. use GO, only : gol, goErr, goPr
  38. use dims, only : nregions
  39. use chem_param, only : ntracet
  40. use global_types, only : d3_data
  41. use tm5_distgrid, only : dgrid, Get_DistGrid, reduce, gather
  42. use ParTools, only : isRoot
  43. IMPLICIT NONE
  44. PRIVATE
  45. !
  46. ! !PUBLIC MEMBER FUNCTIONS:
  47. !
  48. public :: Wet_Deposition_Init, Wet_Deposition_Done
  49. public :: calc_cvsfac, calculate_lsp_scav, lspscav
  50. !
  51. ! !PUBLIC DATA MEMBERS:
  52. !
  53. real, public :: cvsfac(ntracet) = 0.0 ! scavenging efficiencies, used in convection
  54. real, public :: cp_scale = 0.5 ! default amount of rain (converted to m/s) with maximum CP removal on 1x1 degree
  55. #ifdef with_budgets
  56. real, dimension(nregions), public :: sum_wetdep ! global wet dep budget for tracer #1 (includes both LSP and CP; meaningful on root only)
  57. type, public :: buddep_data
  58. ! budgets in each column, split vertically...
  59. real,dimension(:,:,:,:),pointer :: lsp ! (i, j, nbud_vg, ntracet) computed here
  60. real,dimension(:,:,:,:),pointer :: cp ! (i, j, nbud_vg, ntracet) computed in convection
  61. end type buddep_data
  62. type(buddep_data), dimension(nregions), target, public :: buddep_dat ! ... for each region
  63. #endif
  64. !
  65. ! !PRIVATE DATA MEMBERS:
  66. !
  67. character(len=*), parameter :: mname = 'wet_deposition'
  68. !
  69. ! Large scale scavenging coefficients [s-1]
  70. type(d3_data),dimension(nregions) :: rloss1 ! 1: incloud completely soluble gas
  71. !>>>TvN
  72. type(d3_data),dimension(nregions) :: rloss1_m7 ! as 1, but with ice as efficient as water
  73. ! now needed for M7 aerosols
  74. !<<<TvN
  75. type(d3_data),dimension(nregions) :: rloss2 ! 2: below cloud completely soluble gas
  76. type(d3_data),dimension(nregions) :: rloss3 ! 3: below cloud bulk aerosol (Whitby distribution)
  77. !
  78. ! rain-out can not be higher than maximum level of convection
  79. ! thus maximum level of convection lmax_conv(=>ntot_ed) is used
  80. !
  81. !
  82. ! used from chem_param:
  83. !
  84. ! nscav : selected species for scavenging
  85. ! nscav_index : index for scavenging:
  86. ! nscav_type : type of scavenging:
  87. ! 0 no scavenging
  88. ! 1 scavenging 100 % solubility assumed
  89. ! 2 scavenging henry solubility assumed
  90. ! 3 scavenging, bulk aerosol removal assumed
  91. ! 4 scavenging, special case for SO2 with aq phase diss.
  92. ! 5-11 scavenging, M7 aerosol removal
  93. !
  94. !----------------------------------------------
  95. ! acidity needed for explicit calculation of reactive removal of SO2.
  96. ! Parameterisation calculates reaction of SO2 with H2O2 and O3.
  97. ! Not yet implemented: for information Frank Dentener ! see routine wetS
  98. ! nacid : selected species for acidity
  99. ! nacid_index : indices of species for acidity : iso4,imsa,ihno3,inh3,inh4
  100. ! nacid_eq : equivalents acid per mole
  101. ! integer,parameter :: nacid=5
  102. ! integer,parameter,dimension(nacid) :: &
  103. ! nacid_index = (/iso4,imsa,ihno3,ino3_a,inh3,inh4/)
  104. ! integer,parameter,dimension(nacid) :: &
  105. ! nacid_eq = (/ 2, 1, 1, 1 , -1, -1/)
  106. !----------------------------------------------
  107. !
  108. ! !REVISION HISTORY:
  109. ! version March 2003, adapted for TM5 MK from KNMI version
  110. ! 29 Feb 2012 - P. Le Sager - adapted for lon-lat MPI domain decomposition
  111. !
  112. ! !REMARKS:
  113. !
  114. !EOP
  115. !------------------------------------------------------------------------
  116. CONTAINS
  117. !--------------------------------------------------------------------------
  118. ! TM5 !
  119. !--------------------------------------------------------------------------
  120. !BOP
  121. !
  122. ! !IROUTINE: WET_DEPOSITION_INIT
  123. !
  124. ! !DESCRIPTION:
  125. !\\
  126. !\\
  127. ! !INTERFACE:
  128. !
  129. SUBROUTINE WET_DEPOSITION_INIT( status )
  130. !
  131. ! !USES:
  132. !
  133. use GO, only : TrcFile, Init, Done, ReadRc
  134. use dims, only : lmax_conv
  135. use global_data, only : rcfile
  136. use meteodata, only : Set, temper_dat, lwc_dat, iwc_dat, cc_dat, lsp_dat
  137. #ifdef with_budgets
  138. use budget_global, only : nbud_vg
  139. #endif
  140. use chem_param, only : ntrace
  141. !
  142. ! !OUTPUT PARAMETERS:
  143. !
  144. integer, intent(out) :: status
  145. !
  146. ! !REVISION HISTORY:
  147. ! 29 Feb 2012 - P. Le Sager - adapted for lon-lat MPI domain decomposition
  148. !
  149. !EOP
  150. !------------------------------------------------------------------------
  151. !BOC
  152. character(len=*), parameter :: rname = mname//'/Wet_Deposition_Init'
  153. integer :: region, imr,jmr,lmr, i1, i2, j1, j2
  154. type(TrcFile) :: rcF
  155. ! --- begin ------------------------------------
  156. ! select meteo to be used
  157. do region = 1, nregions
  158. call Set( temper_dat(region), status, used=.true. )
  159. call Set( lwc_dat(region), status, used=.true. )
  160. call Set( iwc_dat(region), status, used=.true. )
  161. call Set( cc_dat(region), status, used=.true. )
  162. call Set( lsp_dat(region), status, used=.true. )
  163. end do
  164. ! allocate
  165. do region = 1, nregions
  166. lmr = lmax_conv
  167. CALL GET_DISTGRID( DGRID(region), I_STRT=i1, I_STOP=i2, J_STRT=j1, J_STOP=j2 )
  168. allocate(rloss1(region)%d3(i1:i2, j1:j2, lmr))
  169. !>>>TvN
  170. allocate(rloss1_m7(region)%d3(i1:i2, j1:j2, lmr))
  171. !<<<TvN
  172. allocate(rloss2(region)%d3(i1:i2, j1:j2, lmr))
  173. allocate(rloss3(region)%d3(i1:i2, j1:j2, lmr))
  174. end do
  175. ! read settings from rcfile:
  176. ! o scaling factor wet removal (1.-exp(-cp/cp_scale))
  177. ! cp_scale : 0.5
  178. ! (see convection.F90 and wet_deposition.F90)
  179. !
  180. call Init( rcF, rcfile, status )
  181. IF_NOTOK_RETURN(status=1)
  182. call ReadRc( rcF, 'proces.wet_removal.cp_scale', cp_scale, status, default=0.5 )
  183. IF_NOTOK_RETURN(status=1)
  184. call Done( rcF, status )
  185. IF_NOTOK_RETURN(status=1)
  186. write (gol,*) 'maximum removal CP precip on 1x1 at rain rate (mm/hr) :', cp_scale; call goPr
  187. cp_scale = cp_scale/(1e3*3600.) ! to m/s!
  188. ! Calculate removal rates by convective precipitation
  189. ! It was commented before : JEW:called too early, KHENRY must be calculated for some species first
  190. ! Back here, since KHENRY are now calculated before hand with a call to "rates" in sources_sinks_init
  191. call calc_cvsfac
  192. ! budgets
  193. #ifdef with_budgets
  194. do region = 1, nregions
  195. CALL GET_DISTGRID( DGRID(region), I_STRT=i1, I_STOP=i2, J_STRT=j1, J_STOP=j2 )
  196. sum_wetdep(region) = 0.0
  197. allocate( buddep_dat(region)%lsp(i1:i2, j1:j2, nbud_vg, ntracet))
  198. buddep_dat(region)%lsp = 0.0
  199. allocate( buddep_dat(region)%cp (i1:i2, j1:j2, nbud_vg, ntracet))
  200. buddep_dat(region)%cp = 0.0
  201. enddo
  202. #endif
  203. ! ok
  204. status = 0
  205. END SUBROUTINE WET_DEPOSITION_INIT
  206. !EOC
  207. !--------------------------------------------------------------------------
  208. ! TM5 !
  209. !--------------------------------------------------------------------------
  210. !BOP
  211. !
  212. ! !IROUTINE: WET_DEPOSITION_DONE
  213. !
  214. ! !DESCRIPTION: deallocate scavenging coeff. & write wet dep and convection
  215. ! budgets into file.
  216. !\\
  217. !\\
  218. ! !INTERFACE:
  219. !
  220. SUBROUTINE WET_DEPOSITION_DONE( status )
  221. !
  222. ! !USES:
  223. !
  224. use dims, only : nregions, im, jm, lm
  225. use chem_param, only : ntracet
  226. use partools, only : par_reduce_element
  227. #ifdef with_budgets
  228. use budget_global, only : budget_file_global, nbud_vg, budg_dat, nbudg, NHAB
  229. use budget_global, only : budconvg
  230. use file_hdf, only : THdfFile, TSds
  231. use file_hdf, only : Init, Done, WriteAttribute, WriteData, SetDim
  232. use Dims, only : region_name
  233. #endif
  234. !
  235. ! !OUTPUT PARAMETERS:
  236. !
  237. integer, intent(out) :: status
  238. !
  239. ! !REVISION HISTORY:
  240. ! 29 Feb 2012 - P. Le Sager - adapted for lon-lat MPI domain decomposition
  241. !
  242. !EOP
  243. !------------------------------------------------------------------------
  244. !BOC
  245. character(len=*), parameter :: rname = mname//'/Wet_Deposition_Done'
  246. #ifdef with_budgets
  247. type(THdfFile) :: io
  248. type(TSds) :: sds
  249. integer :: i1, i2, j1, j2
  250. integer :: nsend,j,i,n,nzone,nzone_v
  251. real,dimension(:,:,:,:),allocatable :: budget4d
  252. real,dimension(nbudg,nbud_vg,ntracet) :: budwet_cp, budwet_lsp ! for one MPI tile
  253. real,dimension(nbudg,nbud_vg,ntracet) :: budconvg_all, budwet_cp_all, budwet_lsp_all !
  254. #endif
  255. integer :: region,l
  256. ! --- begin ----------------------------------
  257. do region = 1, nregions
  258. deallocate( rloss1(region)%d3 )
  259. !>>>TvN
  260. deallocate( rloss1_m7(region)%d3 )
  261. !<<<TvN
  262. deallocate( rloss2(region)%d3 )
  263. deallocate( rloss3(region)%d3 )
  264. end do
  265. #ifdef with_budgets
  266. if(isRoot) then
  267. call Init(io, budget_file_global, 'write', status)
  268. IF_NOTOK_RETURN(status=1)
  269. call WriteAttribute(io,'sum_wetdep',sum_wetdep,status)
  270. IF_NOTOK_RETURN(status=1)
  271. call WriteAttribute(io,'cvsfac',cvsfac,status)
  272. IF_NOTOK_RETURN(status=1)
  273. endif
  274. budwet_cp = 0.0
  275. budwet_lsp = 0.0
  276. ! =============================== Aggregate and write column-like Wet Dep budgets
  277. REG : do region=1,nregions
  278. !---- horizontally aggregates LSP and CP budgets
  279. CALL GET_DISTGRID( DGRID(region), I_STRT=i1, I_STOP=i2, J_STRT=j1, J_STOP=j2 )
  280. do n=1, ntracet
  281. do l=1, nbud_vg
  282. do j=j1,j2
  283. do i=i1,i2
  284. nzone = budg_dat(region)%nzong(i,j)
  285. budwet_lsp(nzone,l,n) = budwet_lsp(nzone,l,n) + buddep_dat(region)%lsp(i,j,l,n)
  286. budwet_cp(nzone,l,n) = budwet_cp(nzone,l,n) + buddep_dat(region)%cp(i,j,l,n)
  287. end do
  288. end do
  289. end do
  290. end do
  291. !-- write Non-Horizontally-Aggregated-Budgets
  292. if (NHAB) then
  293. ! global array to gather data
  294. if (isRoot)then
  295. allocate(budget4d(im(region), jm(region), nbud_vg, ntracet))
  296. else
  297. allocate(budget4d(1,1,1,1))
  298. end if
  299. ! gather and write column-like wet dep LSP budgets
  300. CALL GATHER( dgrid(region), buddep_dat(region)%lsp, budget4d, 0, status)
  301. if(isRoot) then
  302. call Init(Sds,io, 'buddep_dat_lsp_'//region_name(region),(/im(region),jm(region),nbud_vg,ntracet/), 'real(4)', status)
  303. call SetDim(Sds, 0, 'im_'//region_name(region),'longitude', (/(j, j=1,im(region))/), status)
  304. call SetDim(Sds, 1, 'jm_'//region_name(region),'latitude', (/(j, j=1,jm(region))/), status)
  305. call SetDim(Sds, 2, 'nbud_vg','budget level', (/(j, j=1,nbud_vg)/), status)
  306. call SetDim(Sds, 3, 'ntracet','tracer index', (/(j, j=1,ntracet)/), status)
  307. IF_NOTOK_RETURN(status=1)
  308. call WriteData(Sds, budget4d, status)
  309. IF_NOTOK_RETURN(status=1)
  310. call Done(Sds, status)
  311. IF_NOTOK_RETURN(status=1)
  312. endif
  313. ! gather and write column-like wet dep CP budgets
  314. CALL GATHER( dgrid(region), buddep_dat(region)%cp, budget4d, 0, status)
  315. if(isRoot) then
  316. call Init(Sds,io, 'buddep_dat_cp_'//region_name(region),(/im(region),jm(region),nbud_vg,ntracet/), 'real(4)', status)
  317. call SetDim(Sds, 0, 'im_'//region_name(region),'longitude', (/(j, j=1,im(region))/), status)
  318. call SetDim(Sds, 1, 'jm_'//region_name(region),'latitude', (/(j, j=1,jm(region))/), status)
  319. call SetDim(Sds, 2, 'nbud_vg','budget level', (/(j, j=1,nbud_vg)/), status)
  320. call SetDim(Sds, 3, 'ntracet','tracer index', (/(j, j=1,ntracet)/), status)
  321. call WriteData(Sds, budget4d, status)
  322. IF_NOTOK_RETURN(status=1)
  323. call Done(Sds, status)
  324. IF_NOTOK_RETURN(status=1)
  325. endif
  326. deallocate(budget4d)
  327. endif ! NHAB
  328. enddo REG ! regions
  329. !================== Write horizontally aggregated Wet Dep (& convection) budgets
  330. ! Sum up contribution from each proc into root array
  331. call PAR_REDUCE_ELEMENT( budwet_cp, 'SUM', budwet_cp_all, status )
  332. IF_NOTOK_RETURN(status=1)
  333. call PAR_REDUCE_ELEMENT( budwet_lsp, 'SUM', budwet_lsp_all, status )
  334. IF_NOTOK_RETURN(status=1)
  335. call PAR_REDUCE_ELEMENT( budconvg, 'SUM', budconvg_all, status )
  336. IF_NOTOK_RETURN(status=1)
  337. if (isRoot) then
  338. ! update convection budget
  339. budconvg_all(:,:,:) = budconvg_all(:,:,:) + budwet_cp(:,:,:)
  340. call Init(Sds, io, 'budconv_cp', (/nbudg, nbud_vg, ntracet/), 'real(8)', status)
  341. IF_NOTOK_RETURN(status=1)
  342. call SetDim(Sds, 0, 'nbudg', 'horizontal region', (/(j, j=1,nbudg)/), status)
  343. call SetDim(Sds, 1, 'nbud_vg', 'vertical layer', (/(j, j=1,nbud_vg)/), status)
  344. call SetDim(Sds, 2, 'ntracet', 'tracer index', (/(j, j=1,ntracet)/), status)
  345. IF_NOTOK_RETURN(status=1)
  346. call WriteAttribute(Sds, 'comment', 'Convection budget corrected for cp removal', status)
  347. IF_NOTOK_RETURN(status=1)
  348. call WriteData(Sds, budconvg_all, status)
  349. IF_NOTOK_RETURN(status=1)
  350. call Done(Sds, status)
  351. IF_NOTOK_RETURN(status=1)
  352. call Init(Sds, io, 'budwet_cp', (/nbudg, nbud_vg, ntracet/), 'real(8)', status)
  353. IF_NOTOK_RETURN(status=1)
  354. call SetDim(Sds, 0, 'nbudg', 'horizontal region', (/(j, j=1,nbudg)/), status)
  355. call SetDim(Sds, 1, 'nbud_vg', 'vertical layer', (/(j, j=1,nbud_vg)/), status)
  356. call SetDim(Sds, 2, 'ntracet', 'tracer index', (/(j, j=1,ntracet)/), status)
  357. IF_NOTOK_RETURN(status=1)
  358. call WriteData(Sds, budwet_cp_all, status)
  359. IF_NOTOK_RETURN(status=1)
  360. call Done(Sds, status)
  361. IF_NOTOK_RETURN(status=1)
  362. call Init(Sds, io, 'budwet_lsp', (/nbudg, nbud_vg, ntracet/), 'real(8)', status)
  363. IF_NOTOK_RETURN(status=1)
  364. call SetDim(Sds, 0, 'nbudg', 'horizontal region', (/(j, j=1,nbudg)/), status)
  365. call SetDim(Sds, 1, 'nbud_vg', 'vertical layer', (/(j, j=1,nbud_vg)/), status)
  366. call SetDim(Sds, 2, 'ntracet', 'tracer index', (/(j, j=1,ntracet)/), status)
  367. IF_NOTOK_RETURN(status=1)
  368. call WriteData(Sds, budwet_lsp_all, status)
  369. IF_NOTOK_RETURN(status=1)
  370. call Done(Sds, status)
  371. IF_NOTOK_RETURN(status=1)
  372. call Done(io, status)
  373. IF_NOTOK_RETURN(status=1)
  374. endif
  375. do region = 1, nregions
  376. deallocate( buddep_dat(region)%lsp )
  377. deallocate( buddep_dat(region)%cp )
  378. end do
  379. #endif /* WITH_BUDGET */
  380. ! ok
  381. status = 0
  382. END SUBROUTINE WET_DEPOSITION_DONE
  383. !EOC
  384. !--------------------------------------------------------------------------
  385. ! TM5 !
  386. !--------------------------------------------------------------------------
  387. !BOP
  388. !
  389. ! !IROUTINE: CALC_CVSFAC
  390. !
  391. ! !DESCRIPTION: lookup tables, calculate scale factor for convective scavenging
  392. ! relative to 100% scavenging (of HNO3),
  393. ! assuming constant temperature in convective updraft of 273K.
  394. !
  395. ! Factors for different scavenging types are:
  396. !
  397. ! 0) no/low solubility cvsfac=0
  398. ! 1) high solubility cvsfac=1
  399. ! 2) henry solubility cvsfac=variable
  400. ! 3) bulk aerosol cvsfac=0.99
  401. ! For the moment a value of 0.99 is assumed for bulk aerosol.
  402. ! This is the value for the soluble accumulation mode from Stier et al. (JGR, 2005).
  403. ! and presents an upper boundary for bulk aerosols.
  404. ! (A value ~0.9 would probably make more sense, but this would need to be justified
  405. ! with some quantitative argument.)
  406. ! 4) SO2 dissociation cvsfac=variable depending on T and pH and
  407. ! dissociation of H2SO3<-->HSO3(-)<--->SO3(2-)
  408. ! for convective clouds T=273K and pH=5 is chosen
  409. ! 5-11) M7 modes cvsfac set equal to the scavenging parameters from Stier et al. (2005)
  410. ! for convective in-cloud scavenging
  411. !\\
  412. !\\
  413. ! !INTERFACE:
  414. !
  415. SUBROUTINE CALC_CVSFAC
  416. !
  417. ! !USES:
  418. !
  419. use chem_param, only : nscav, nscav_index, nscav_type
  420. use chem_param, only : henry, ntlow, ntemp
  421. use chem_param, only : names
  422. !
  423. ! !REVISION HISTORY:
  424. !
  425. !EOP
  426. !------------------------------------------------------------------------
  427. !BOC
  428. integer :: iscav,n,k
  429. real :: rtl, heff
  430. cvsfac=0.0
  431. do iscav=1,nscav
  432. n=nscav_index(iscav)
  433. ! skip dummy tracers ..
  434. if ( n < 0 ) cycle
  435. ! fill cvsfac given scavenging type:
  436. select case(nscav_type(iscav))
  437. case(0)
  438. cvsfac(n) = 0.0
  439. !>>>TvN
  440. !case(1,3)
  441. case(1)
  442. !<<< TvN
  443. cvsfac(n) = 1.0
  444. case(2)
  445. rtl=8.3148e-8*273. ! phase factor: ratio of aq. phase conc. to total conc.
  446. ! assuming LWC of 1e-6
  447. k=nint(273.-float(ntlow))
  448. k = min(max(1,k),ntemp)
  449. if ( henry(n,k) > 1. ) then
  450. cvsfac(n) = rtl*henry(n,k)/(1.+rtl*henry(n,k))
  451. else
  452. cvsfac(n) = 0.0
  453. end if
  454. !>>>TvN
  455. case(3)
  456. cvsfac(n) = 0.99
  457. !<<<TvN
  458. case(4)
  459. rtl=8.3148e-8*273. ! phase factor: ratio of aq. phase conc. to total conc.o
  460. ! assuming LWC of 1e-6
  461. k=nint(273.-float(ntlow))
  462. k = min(max(1,k),ntemp)
  463. heff = henry(n,k)*3.2e3 ! 3.2e3 factor is dissociation of SO2 and HSO3- at pH=5
  464. cvsfac(n) = rtl*heff/(1.+rtl*heff)
  465. !>>>TvN
  466. case(5) ! soluble nu
  467. !cvsfac(n) = 1.0
  468. cvsfac(n) = 0.2
  469. case(6) ! soluble ai
  470. !cvsfac(n) = 1.0
  471. cvsfac(n) = 0.6
  472. case(7) ! soluble ac
  473. !cvsfac(n) = 1.0
  474. cvsfac(n) = 0.99
  475. case(8) ! soluble co
  476. !cvsfac(n) = 1.0
  477. cvsfac(n) = 0.99
  478. case(9) ! insoluble ai
  479. !cvsfac(n) = 1.0
  480. cvsfac(n) = 0.2
  481. case(10) ! insoluble ac
  482. !cvsfac(n) = 1.0
  483. cvsfac(n) = 0.4
  484. case(11) ! insoluble co
  485. !cvsfac(n) = 1.0
  486. cvsfac(n) = 0.4
  487. !<<<TvN
  488. case default
  489. cvsfac(n) = 0.0
  490. end select
  491. end do
  492. ! info ...
  493. do n = 1, ntracet
  494. if ( cvsfac(n) > 0.0 ) then
  495. write (gol,'(" calc_cvsfac: Scavenging factor species ",i2,x,a,"; factor : ",e10.3)') &
  496. n, names(n), cvsfac(n); call goPr
  497. end if
  498. end do
  499. END SUBROUTINE CALC_CVSFAC
  500. !EOC
  501. !--------------------------------------------------------------------------
  502. ! TM5 !
  503. !--------------------------------------------------------------------------
  504. !BOP
  505. !
  506. ! !IROUTINE: LSPSCAV
  507. !
  508. ! !DESCRIPTION: Calculation of wet removal by large scale precipitation of
  509. ! soluble tracers
  510. !
  511. ! Remove tracers with previously calculated rainout rate [s-1]
  512. ! separately for in- and below cloud scavenging and only for the
  513. ! cloud covered fraction of the gridcell
  514. !
  515. ! Reference:
  516. ! Langner and Rodhe (1990)
  517. ! Junge (1959)
  518. !\\
  519. !\\
  520. ! !INTERFACE:
  521. !
  522. SUBROUTINE LSPSCAV( region )
  523. !
  524. ! !USES:
  525. !
  526. use binas, only : rgas
  527. use dims, only : im, jm, lm, nchem
  528. use dims, only : tref, lmax_conv, dy
  529. use chem_param, only : ntrace, ntracet, henry, ntlow, ra, ntemp
  530. use chem_param, only : xmhno3 !, ihno3
  531. use chem_param, only : nscav, nscav_index, nscav_type
  532. #ifdef with_m7
  533. use chem_param, only : inus_n, iais_n, iacs_n, icos_n, iaii_n, iaci_n, icoi_n
  534. #endif
  535. use meteodata, only : temper_dat, cc_dat
  536. use global_data, only : mass_dat
  537. #ifdef with_budgets
  538. use budget_global, only : nzon_vg
  539. #endif
  540. !
  541. ! !INPUT PARAMETERS:
  542. !
  543. integer,intent(in) :: region
  544. !
  545. ! !REVISION HISTORY:
  546. !
  547. ! Programmed by Frank Dentener, August 1995;
  548. ! Ad Jeuken, KNMI, November 1998
  549. ! Modifications Bas Henzing, KNMI, 2002
  550. ! Adapted for TM5, Frank Dentener, JRC, 2002
  551. ! Paralel, Maarten Krol, Jul 2003
  552. ! 29 Feb 2012 - P. Le Sager - adapted for lon-lat MPI domain decomposition
  553. !
  554. !EOP
  555. !------------------------------------------------------------------------
  556. !BOC
  557. character(len=*), parameter :: rname = mname//'/LSPSCAV'
  558. real :: dt_lagrangian
  559. ! liquid water content of raining cloud
  560. ! rgas (8.314 J/mol/K) ---> 0.08314 atm/(mol/l)/K
  561. ! (thesis Frank Dentener, p. 31)
  562. ! 1e-6 corresponds to 1 g/m3 dimensionless
  563. real,parameter :: rtl_fac=rgas/1e2*1e-6
  564. ! assumed pH of rainwater
  565. real,parameter :: hplus = 1e-5
  566. ! assumed fraction of in-cloud interstitial aerosol:
  567. real,parameter :: interstitial_fraction = 0.3
  568. ! --- local ------------------------------
  569. real,dimension(:,:,:,:), pointer :: rm
  570. #ifdef slopes
  571. real,dimension(:,:,:,:), pointer :: rxm, rym, rzm
  572. #ifdef secmom
  573. real,dimension(:,:,:,:), pointer :: rxxm, rxym, rxzm, ryym, ryzm, rzzm
  574. #endif
  575. #endif
  576. real,dimension(:,:,:), pointer :: t,cc
  577. real :: rtl,f,f1,f2,vol1,vol2,vol3,ahelp1,ahelp2
  578. real :: incloud,belowcloud,newcov,c_old,corr_diff,fnchem
  579. integer :: n,iscav,i,j,k,itemp,nzone_v, nloc
  580. real :: ztr, dkso2, dkhso3, factor, heff
  581. ! oldcov: cloud cover in layer above, to calculate below-cloud scaveging.
  582. real,dimension(:,:),allocatable :: oldcov
  583. integer :: i1, i2, j1, j2, status
  584. ! for wetdep global budget of tracer #1
  585. real :: g_sum_wet
  586. real, allocatable :: l_sum_wet(:,:)
  587. !
  588. ! --- begin ------------------------------
  589. !
  590. !>>> TvN
  591. ! Tests have been performed at various resolutions
  592. ! using mixing times of 3, 6, 9, 12 and 24 hours.
  593. ! Simulations at 1x1 degrees are best reproduced
  594. ! by increasing the mixing time with 3 hours at 3x2 degrees
  595. ! and with 6 hours at 6x4 degrees.
  596. dt_lagrangian = 3600.0 * 3.0 ! value at 1x1 degrees or higher resolution
  597. if (dy == 2) dt_lagrangian = dt_lagrangian + 3600.0 * 3.0
  598. if (dy == 4) dt_lagrangian = dt_lagrangian + 3600.0 * 6.0
  599. !<<< TvN
  600. CALL GET_DISTGRID( DGRID(region), I_STRT=i1, I_STOP=i2, J_STRT=j1, J_STOP=j2 )
  601. #ifdef with_budgets
  602. allocate(l_sum_wet(i1:i2,j1:j2))
  603. l_sum_wet = 0.0
  604. #endif
  605. rm => mass_dat(region)%rm ! paralel over tracers
  606. #ifdef slopes
  607. rxm => mass_dat(region)%rxm
  608. rym => mass_dat(region)%rym
  609. rzm => mass_dat(region)%rzm
  610. #ifdef secmom
  611. rxxm => mass_dat(region)%rxxm
  612. rxym => mass_dat(region)%rxym
  613. rxzm => mass_dat(region)%rxzm
  614. ryym => mass_dat(region)%ryym
  615. ryzm => mass_dat(region)%ryzm
  616. rzzm => mass_dat(region)%rzzm
  617. #endif
  618. #endif
  619. t => temper_dat(region)%data
  620. cc => cc_dat(region)%data
  621. !$OMP PARALLEL &
  622. !$OMP default (none) &
  623. #if defined (with_budgets)
  624. !$OMP shared (nzon_vg, buddep_dat) &
  625. #endif
  626. !$OMP shared (region, ier, isr, jer, jsr, tracer_loc, henry, &
  627. !$OMP tracer_active, fnchem, rm, rxm, rym, rzm, t, cc, &
  628. !$OMP nchem, rloss1, rloss1_m7, rloss2, rloss3, ra,nscav_type, &
  629. !$OMP nscav_index,tref,im ) &
  630. !$OMP private (i, j, k, n, nloc, iscav, jss, jee, rtl, itemp, &
  631. !$OMP corr_diff, belowcloud, incloud, f, f1, f2, newcov, &
  632. !$OMP vol1, vol2, vol3, c_old, nzone_v, ztr, dkso2, dkhso3, &
  633. !$OMP factor, heff, oldcov, l_sum_wet)
  634. fnchem=real(nchem/(2*tref(region)))
  635. !
  636. allocate(oldcov(i1:i2,j1:j2))
  637. do iscav=1,nscav
  638. !
  639. n=nscav_index(iscav) ! tracer number in global count
  640. nloc = n ! tracer number in local count
  641. oldcov=0.
  642. !
  643. ! assumption no stratiform precipitation above the maximum
  644. ! level of convection
  645. !
  646. do k=lmax_conv,1,-1 ! top to bottom
  647. do j=j1,j2
  648. do i=i1,i2
  649. !
  650. ! calculate, depending on solubility, scale factor relative
  651. ! to 100% scavenging (of HNO3)
  652. !
  653. ! rtl - composite factor of liquid water content, rgas
  654. ! and liquid water content
  655. rtl=rtl_fac*t(i,j,k)
  656. ! multiplaction with Henry constant gives phase factor
  657. itemp=nint(t(i,j,k)-float(ntlow))
  658. itemp = min(max(1,itemp),ntemp) ! corrected CMK dec2004 problems on ECMWF
  659. !
  660. !corr_diff=sqrt(ra(ihno3)/ra(n))
  661. corr_diff=sqrt(xmhno3/ra(n))
  662. !
  663. select case (nscav_type(iscav))
  664. case(0)
  665. incloud = 0.0
  666. belowcloud = 0.0
  667. case(1) ! 100% solubility
  668. !AJS: note that old code used factor rtl ~ 1,
  669. !AJS: computed with huge henry factor ~ 1e7 :
  670. ! rtl = rtl*henry(n,itemp) / ( 1.0 + rtl*henry(n,itemp) ) ! near 1.0
  671. ! incloud = rloss1(reion)%d3(i,j,k) * rtl
  672. incloud = rloss1(region)%d3(i,j,k)
  673. belowcloud = rloss2(region)%d3(i,j,k)*corr_diff
  674. case(2) ! henry solubility assumed
  675. rtl = rtl*henry(n,itemp) / ( 1.0 + rtl*henry(n,itemp) )
  676. incloud = rloss1(region)%d3(i,j,k)*rtl
  677. belowcloud = rloss2(region)%d3(i,j,k)*rtl*corr_diff
  678. case(3) ! bulk aerosol
  679. incloud = rloss1(region)%d3(i,j,k)*(1.0 - interstitial_fraction)
  680. !>>>TvN
  681. ! Alternative would be to make the interstitial fraction for bulk aerosols
  682. ! consistent the values used for the M7 modes,
  683. ! which are taken from Bourgeois and Bey (JGR, 2011)
  684. ! and distinguish between warm, mixed and ice clouds
  685. !<<<TvN
  686. belowcloud = rloss3(region)%d3(i,j,k)
  687. case(4) ! SO2
  688. ztr=(1./t(i,j,k)-1./298)
  689. dkso2 =1.7e-2*exp(2090.*ztr) !so2<=>hso3m+hplus
  690. dkhso3 = 6.6e-8*exp(1510.*ztr) !hso3m<=>so3-- + hplus
  691. factor = 1.0 + dkso2/hplus + (dkso2*dkhso3)/(hplus**2)
  692. heff = factor*henry(n,itemp)
  693. rtl = rtl*heff/ ( 1.0 + rtl*heff )
  694. incloud = rloss1(region)%d3(i,j,k)*rtl !
  695. belowcloud = rloss2(region)%d3(i,j,k)*rtl*corr_diff
  696. !>>>TvN
  697. ! The in-cloud scavenging coefficients are defined as the fraction of the tracer
  698. ! in the cloudy part of the grid box that is embedded in the cloud liquid or ice water,
  699. ! i.e. the non-interstitial part.
  700. ! We distinguish between liquid, mixed and ice stratiform clouds (Stier et al., 2005),
  701. ! depending on the local temperature in the grid cell (Croft et al., ACP, 2010).
  702. ! The in-cloud scavenging coefficients depend on size and composition;
  703. ! revised values for the M7 modes were provided by Bourgeois and Bey (JGR, 2011).
  704. ! For mixed clouds, an alternative method was presented by Zhang et al. (ACP, 2012),
  705. ! which uses a continuous temperature dependency.
  706. ! Note that these in-cloud scavenging coefficients account for both nucleation scavenging
  707. ! and impaction scavenging (Croft et al., ACP, 2009; 2010).
  708. ! Thus, the below-cloud scavenging rates should only account for
  709. ! the impaction scavenging by precipitation coming from clouds above the current level.
  710. !
  711. ! Estimates for below-cloud scavenging coefficients can be derived
  712. ! from Fig. 2 of Dana and Hales (AE, 1975).
  713. ! For estimating these values from the figure, I used aerodynamic radii of
  714. ! 0.007, 0.07, and 0.7 micron as the boundaries of the M7 modes
  715. ! (corresponding to a particle density of about 1800 g/cm^3).
  716. ! As in Stier et al. (2005), we do not distinguish between soluble and insoluble modes.
  717. ! Thus, dry particle radii can be used for estimating the scavenging coefficients from the figure
  718. ! (see also the mode boundaries applied in Fig. 2 in Croft et al., 2009).
  719. ! I thus arrive at the following rough estimates for below-cloud mass scavenging coefficients
  720. ! for the nucleation, aitken, accumulation, and coarse modes: ~0.01, 0.002, 0.01, and 1 mm^-1.
  721. ! These numbers are close to the estimates derived earlier from the same figure
  722. ! by Elisabetta Vignati, which were previously used: 0.005, 0.002, 0.008, and 1 mm^-1.
  723. !
  724. ! However, both sets of estimates based on Dana and Hales are substantially higher
  725. ! than the values presented by Croft et al. (2009).
  726. ! From the curves presented in their Fig. 2 for the standard Marshall-Palmer rain distribution,
  727. ! rough estimates of the mass scavenging coefficients for the four size modes can be obtained.
  728. ! My estimates are 0.002, 0.0002, 0.03, and 0.7 mm^-1.
  729. ! Note that especially the value for the accumulation mode is very sensitive to the
  730. ! actual mean particle size, and hard to estimate from the figure.
  731. ! Since the mean droplet size of the Marshall-Palmer distribution depends on the rain intensity,
  732. ! these estimates are only valid for a rain rate of 1 mm/hr.
  733. ! For simplicity, we assume that the scavenging coefficients derived from the figure at 1 mm/hr
  734. ! can also be applied at other rain intensities.
  735. !
  736. ! In the new implementation particle masses and numbers are scavenged at different rates.
  737. ! Rough estimates of the number scavenging coefficients for the four size modes
  738. ! can be obtained from the same figure in Croft et al.
  739. ! My estimates are 0.02, 0.001, 0.0003, and 0.3 mm^-1.
  740. ! Ideally, the below-cloud mass/number scavenging coefficients should be calculated
  741. ! using look-up tables to describe the dependence on median radius and precipitation rate,
  742. ! e.g. following the formulation/curves presented by Croft et al.
  743. !
  744. case(5) ! soluble nu
  745. !belowcloud=0.1*rloss3(region)%d3(i,j,k) ! 0.1*0.05=0.005 mm^-1
  746. #ifdef with_m7
  747. if (n /= inus_n) then
  748. belowcloud=0.5*rloss3(region)%d3(i,j,k) ! 0.5*0.004 = 0.002 mm^-2
  749. else
  750. #endif
  751. belowcloud=5.*rloss3(region)%d3(i,j,k) ! 5.*0.004 = 0.02 mm^-2
  752. #ifdef with_m7
  753. endif
  754. #endif
  755. !incloud=0.0
  756. incloud=0.06*rloss1_m7(region)%d3(i,j,k)
  757. case(6) ! soluble ai
  758. !belowcloud=0.04*rloss3(region)%d3(i,j,k) ! 0.04*0.05=0.002 mm^-1
  759. #ifdef with_m7
  760. if (n /= iais_n) then
  761. belowcloud=0.05*rloss3(region)%d3(i,j,k) ! 0.05*0.004 = 0.0002 mm^-2
  762. else
  763. #endif
  764. belowcloud=0.25*rloss3(region)%d3(i,j,k) ! 0.25*0.004 = 0.001 mm^-2
  765. #ifdef with_m7
  766. endif
  767. #endif
  768. !incloud=0.0
  769. if (t(i,j,k).gt.273.15) then
  770. incloud=0.25*rloss1_m7(region)%d3(i,j,k)
  771. else
  772. incloud=0.06*rloss1_m7(region)%d3(i,j,k)
  773. endif
  774. case(7) ! soluble ac
  775. !belowcloud=0.16*rloss3(region)%d3(i,j,k) ! 0.16*0.05 = 0.008 mm^-1
  776. #ifdef with_m7
  777. if (n /= iacs_n) then
  778. belowcloud=7.5*rloss3(region)%d3(i,j,k) ! 7.5*0.004 = 0.03 mm^-1
  779. else
  780. #endif
  781. belowcloud=0.075*rloss3(region)%d3(i,j,k) ! 0.075*0.004 = 0.0003 mm^-1
  782. #ifdef with_m7
  783. endif
  784. #endif
  785. !incloud=rloss1(region)%d3(i,j,k)
  786. if (t(i,j,k).gt.273.15) then
  787. incloud=0.85*rloss1_m7(region)%d3(i,j,k)
  788. else
  789. incloud=0.06*rloss1_m7(region)%d3(i,j,k)
  790. endif
  791. case(8) ! soluble co
  792. !belowcloud=20.*rloss3(region)%d3(i,j,k) ! 20*0.05 = 1 mm^-1
  793. #ifdef with_m7
  794. if (n /= icos_n) then
  795. belowcloud=175.*rloss3(region)%d3(i,j,k) ! 175*0.004 = 0.7 mm^-1
  796. else
  797. #endif
  798. belowcloud=75.*rloss3(region)%d3(i,j,k) ! 75*0.004 = 0.3 mm^-1
  799. #ifdef with_m7
  800. endif
  801. #endif
  802. !incloud=rloss1(region)%d3(i,j,k)
  803. if (t(i,j,k).gt.273.15) then
  804. incloud=0.99*rloss1_m7(region)%d3(i,j,k)
  805. else if (t(i,j,k).gt.238.15) then
  806. incloud=0.75*rloss1_m7(region)%d3(i,j,k)
  807. else
  808. incloud=0.06*rloss1_m7(region)%d3(i,j,k)
  809. endif
  810. case(9) ! insoluble ai
  811. !belowcloud = 0.04*rloss3(region)%d3(i,j,k)
  812. #ifdef with_m7
  813. if (n /= iaii_n) then
  814. belowcloud=0.05*rloss3(region)%d3(i,j,k)
  815. else
  816. #endif
  817. belowcloud=0.25*rloss3(region)%d3(i,j,k)
  818. #ifdef with_m7
  819. endif
  820. #endif
  821. !incloud=0.0
  822. if (t(i,j,k).gt.273.15) then
  823. incloud=0.2*rloss1_m7(region)%d3(i,j,k)
  824. else
  825. incloud=0.06*rloss1_m7(region)%d3(i,j,k)
  826. endif
  827. case(10) ! insoluble ac
  828. !belowcloud=0.16*rloss3(region)%d3(i,j,k)
  829. #ifdef with_m7
  830. if (n /= iaci_n) then
  831. belowcloud=7.5*rloss3(region)%d3(i,j,k)
  832. else
  833. #endif
  834. belowcloud=0.075*rloss3(region)%d3(i,j,k)
  835. #ifdef with_m7
  836. endif
  837. #endif
  838. !incloud=0.0
  839. if (t(i,j,k).gt.273.15) then
  840. incloud=0.4*rloss1_m7(region)%d3(i,j,k)
  841. else
  842. incloud=0.06*rloss1_m7(region)%d3(i,j,k)
  843. endif
  844. case(11) ! insoluble co
  845. !belowcloud=20.*rloss3(region)%d3(i,j,k)
  846. #ifdef with_m7
  847. if (n /= icoi_n) then
  848. belowcloud=175.*rloss3(region)%d3(i,j,k)
  849. else
  850. #endif
  851. belowcloud=75.*rloss3(region)%d3(i,j,k)
  852. #ifdef with_m7
  853. endif
  854. #endif
  855. !incloud=0.0
  856. if (t(i,j,k).gt.238.15) then
  857. incloud=0.4*rloss1_m7(region)%d3(i,j,k)
  858. else
  859. incloud=0.06*rloss1_m7(region)%d3(i,j,k)
  860. endif
  861. case default
  862. incloud = 0.0
  863. belowcloud = 0.0
  864. end select
  865. !if(incloud > 1e-4) then
  866. !print *, i,j,k,names(n),rtl, rloss1(region)%d3(i,j,k), rtl_fac
  867. !end if
  868. !
  869. ! f1, f2 are the fractions of the tracermass that remain in the
  870. ! gridbox after scavenging.
  871. !
  872. f1=exp(-dt_lagrangian*incloud)
  873. f2=exp(-dt_lagrangian*belowcloud)
  874. !CMK f1=exp(-fnchem*incloud)
  875. !CMK f2=exp(-fnchem*belowcloud)
  876. !
  877. ! A grid box can be divided into three volumes
  878. ! 1) incloud scavenging (newcov)
  879. ! 2) below cloud scavenging (oldcov-newcov)
  880. ! 3) no in-cloud scavenging and no below cloud
  881. ! scavenging by precipitation (no removal)
  882. !
  883. newcov=cc(i,j,k)
  884. vol1 = newcov
  885. !>>> TvN
  886. ! oldcov denotes the area fraction occupied by precipitating clouds above the current level.
  887. ! It is determined assuming maximum overlap of the cloudy fractions of the layers above (see below).
  888. ! The precipitation rate used for below-cloud scavenging correctly does not include the contribution
  889. ! from the current level.
  890. !<<<TvN
  891. vol2 = max(0.,oldcov(i,j)-newcov)
  892. vol3 = 1.-vol1-vol2
  893. !CMK f=f1*vol1+f2*vol2+vol3
  894. f=(f1*vol1+f2*vol2+vol3)**(fnchem/dt_lagrangian)
  895. c_old=rm(i,j,k,nloc)
  896. rm(i,j,k,nloc)=c_old*f
  897. #ifdef slopes
  898. rxm(i,j,k,nloc)=rxm(i,j,k,nloc)*f
  899. rym(i,j,k,nloc)=rym(i,j,k,nloc)*f
  900. rzm(i,j,k,nloc)=rzm(i,j,k,nloc)*f
  901. #ifdef secmom
  902. rxxm(i,j,k,nloc)=rxxm(i,j,k,nloc)*f
  903. rxym(i,j,k,nloc)=rxym(i,j,k,nloc)*f
  904. rxzm(i,j,k,nloc)=rxzm(i,j,k,nloc)*f
  905. ryym(i,j,k,nloc)=ryym(i,j,k,nloc)*f
  906. ryzm(i,j,k,nloc)=ryzm(i,j,k,nloc)*f
  907. rzzm(i,j,k,nloc)=rzzm(i,j,k,nloc)*f
  908. #endif
  909. #endif
  910. #ifdef with_budgets
  911. ! _____budget
  912. nzone_v = nzon_vg(k)
  913. buddep_dat(region)%lsp(i,j,nzone_v,n)= &
  914. buddep_dat(region)%lsp(i,j,nzone_v,n)+ &
  915. (c_old-rm(i,j,k,nloc))/ra(n)*1000. ! in moles
  916. if ( n == 1 ) l_sum_wet(i,j) = l_sum_wet(i,j) + &
  917. (c_old-rm(i,j,k,nloc)) ! in kg
  918. ! _____budget
  919. #endif
  920. ! oldcov is determined assuming maximum overlap of the fractions of precipitating clouds overhead:
  921. if ( rloss1(region)%d3(i,j,k) > 0.0 ) oldcov(i,j)=max(oldcov(i,j),cc(i,j,k))
  922. end do !i
  923. end do !j
  924. end do !k
  925. end do !iscav
  926. deallocate(oldcov)
  927. !$OMP END PARALLEL
  928. #ifdef with_budgets
  929. call REDUCE( dgrid(region), l_sum_wet, 0, 'SUM', g_sum_wet, status)
  930. IF_NOTOK_RETURN(status=1)
  931. if ( isRoot ) sum_wetdep(region) = sum_wetdep(region) + g_sum_wet
  932. deallocate( l_sum_wet )
  933. #endif
  934. nullify(rm)
  935. #ifdef slopes
  936. nullify(rxm)
  937. nullify(rym)
  938. nullify(rzm)
  939. #ifdef secmom
  940. nullify(rxxm)
  941. nullify(rxym)
  942. nullify(rxzm)
  943. nullify(ryym)
  944. nullify(ryzm)
  945. nullify(rzzm)
  946. #endif
  947. #endif
  948. nullify(t)
  949. nullify(cc)
  950. END SUBROUTINE LSPSCAV
  951. !EOC
  952. !--------------------------------------------------------------------------
  953. ! TM5 !
  954. !--------------------------------------------------------------------------
  955. !BOP
  956. !
  957. ! !IROUTINE: CALCULATE_LSP_SCAV
  958. !
  959. ! !DESCRIPTION:
  960. !
  961. ! Calculate wet removal rates rloss1,rloss2,rloss3 (s-1) for
  962. ! stratiform precipitation from cloud-top to ground,
  963. ! distinguishing between below-cloud and in-cloud scavenging.
  964. !
  965. ! Method:
  966. ! adapted from GJ Roelofs and Lelieveld, JGR, October 1995
  967. !
  968. ! fills array "rloss" should be called once new precipitation fields
  969. ! are available (MK: in trace_after_read)
  970. !\\
  971. !\\
  972. ! !INTERFACE:
  973. !
  974. SUBROUTINE CALCULATE_LSP_SCAV( region )
  975. !
  976. ! !USES:
  977. !
  978. use binas, only : grav, rgas, xmair
  979. use dims, only : im,jm,lm,lmax_conv
  980. use meteodata, only : temper_dat, lwc_dat, iwc_dat, cc_dat
  981. use meteodata, only : lsp_dat
  982. use global_data, only : emis_data
  983. use meteodata, only : phlb_dat
  984. use partools, only : isroot
  985. !
  986. ! !INPUT PARAMETERS:
  987. !
  988. integer, intent(in) :: region
  989. !
  990. ! !REVISION HISTORY:
  991. ! Programmed by: Frank Dentener, IMAU, 1996
  992. ! Ad Jeuken, KNMI, 1998
  993. ! Modification, Bas Henzing, KNMI, 2002.
  994. ! Adapted for TM5, August 2002, Frank Dentener, JRC.
  995. ! And finally for the new version, MK, IMAU, March 2003
  996. ! Parallel, MK Jul 2003
  997. ! 25 Jan 2012 - P. Le Sager - adapted for mpi lat-lon domain decomposition
  998. !
  999. ! !REMARKS:
  1000. !
  1001. !EOP
  1002. !------------------------------------------------------------------------
  1003. !BOC
  1004. integer :: i1, i2, j1, j2
  1005. real,dimension(:,:,:),pointer :: lsp
  1006. real,dimension(:,:,:),pointer :: t, lwc, iwc, cc, phlb
  1007. real,parameter :: max_lwc=2.e-3 ! kg/m3
  1008. !
  1009. ! Microphysical parameters:
  1010. !
  1011. ! rdrad2: square of raindroplet radius (20 microns)
  1012. ! dghno3: in [cm2/s]
  1013. ! dgair: in [cm2/s]
  1014. ! rol: density of water in [kg/m3]
  1015. ! roi: density of ice in [kg/m3]
  1016. !
  1017. real,parameter :: rdrad2 = (2E-5)**2
  1018. real,parameter :: dghno3 = 0.136
  1019. real,parameter :: dgair = 0.133
  1020. real,parameter :: rol = 1000.
  1021. real,parameter :: roi = 917.
  1022. !
  1023. ! quantity used in calculation of Sherwood number
  1024. !
  1025. ! bas henzing: bug repair real,parameter :: znsc=dgair/dghno3**(-3)
  1026. ! bas henzing: should be: znsc=(dgair/dghno3)**(1./3.);
  1027. ! znsc is now defined a real
  1028. !
  1029. real,dimension(:),allocatable :: dzk
  1030. real :: rflx,beta,fac,beta1,beta2,beta3,rlwc,rdrad,rn,ru
  1031. !>>>TvN
  1032. real :: fac_m7, beta1_m7
  1033. !<<<
  1034. real :: press,aird,dgairx,dghno3x
  1035. real :: znre,znsh,znsc,zkg,totw,sfz,sfz_no
  1036. !
  1037. integer :: nfz,i,j,k,l,no_fz
  1038. integer,dimension(:,:),allocatable :: kcltop
  1039. real,dimension(:,:),allocatable :: oldcov,fz
  1040. real,dimension(:,:,:),allocatable :: precip ! precipitation per level (kg/m2/s)
  1041. real,dimension(:,:,:),allocatable :: prf ! precipitation formation rate.
  1042. ! evaporation NOT YET AVAILABLE
  1043. !
  1044. ! how much less efficient is tracer scavenged from ice
  1045. ! cloud droplet compared to water cloud droplet.
  1046. ! This should be tracer dependent.
  1047. !
  1048. real,parameter :: ice_eff=0.2
  1049. real :: inc_rdf
  1050. real,parameter :: scale_heigth= rgas/grav/xmair*1e3 ! about 29.3*T (m)
  1051. ! ---------------- START ------------------------------------------------
  1052. t => temper_dat(region)%data
  1053. lwc => lwc_dat(region)%data !mk: lm, and not lmax_conv
  1054. iwc => iwc_dat(region)%data !mk: lm, and not lmax_conv
  1055. cc => cc_dat(region)%data !mk: lm, and not lmax_conv
  1056. phlb => phlb_dat(region)%data !mk: 1:lm+1
  1057. lsp => lsp_dat(region)%data
  1058. CALL GET_DISTGRID( DGRID(region), I_STRT=i1, I_STOP=i2, J_STRT=j1, J_STOP=j2 )
  1059. allocate( oldcov( i1:i2, j1:j2 ) )
  1060. allocate( fz( i1:i2, j1:j2 ) )
  1061. allocate( precip( i1:i2, j1:j2, lmax_conv) )
  1062. allocate( dzk( lmax_conv) )
  1063. allocate( kcltop( i1:i2, j1:j2 ) )
  1064. allocate( prf( i1:i2, j1:j2, lmax_conv) )
  1065. !
  1066. ! calculate precipitation formation rate prf
  1067. !
  1068. call calfk
  1069. !
  1070. ! initialize cloud top
  1071. !
  1072. kcltop(:,:)=lmax_conv
  1073. !
  1074. ! calculate and rescale precip
  1075. !
  1076. sfz=0.
  1077. nfz=0
  1078. precip(:,:,:)=0.
  1079. !
  1080. do j= j1, j2
  1081. do i= i1, i2
  1082. !
  1083. ! Calculate precipitation intensity at the bottom of each layer
  1084. !
  1085. do k=1,lmax_conv-1
  1086. ! thickness of layer, only correct in troposphere
  1087. dzk(k)=scale_heigth*t(i,j,k)*alog(phlb(i,j,k)/(1.+phlb(i,j,k+1)))
  1088. end do
  1089. !
  1090. do k=lmax_conv-1,1,-1
  1091. precip(i,j,k)=precip(i,j,k+1)+prf(i,j,k)*dzk(k) !precip: kg/m2/s
  1092. end do
  1093. !
  1094. ! Rescale prf and precip such that these are consistent with ground lsp
  1095. ! Note that lsp is defined as the total large-scale precipitation (rain+snow)
  1096. ! produced by the cloud scheme.
  1097. ! prf, precip and lsp thus all account for snow/ice
  1098. !
  1099. no_fz = 0 ! for statistics !CMK was not initialised!
  1100. sfz_no = 0.0
  1101. fz(i,j)=0.
  1102. !cmk if (lsp(i,j) > 1.e-5) then old data came in mm/day
  1103. if (lsp(i,j,1)*1e3*3600.*24. > 1.e-5) then !new data are in m/s
  1104. if (precip(i,j,1) > 0.) then
  1105. fz(i,j)=lsp(i,j,1)*1e3/precip(i,j,1) ! m/s ->kg/m2/s !new unit...
  1106. !cmk fz(i,j)=lsp(i,j,1)/3600./24./precip(i,j,1) ! mm/day->kg/m2/s
  1107. nfz=nfz+1
  1108. ! precipitation statistics
  1109. ! (avoid 'strange' statistics by only few values)
  1110. sfz=sfz+min(10.,fz(i,j))
  1111. else
  1112. ! no precipitation calculated, but ECMWF fields contain rain value
  1113. no_fz=no_fz+1
  1114. sfz_no=sfz_no+lsp(i,j,1)*1e3*86400. ! (in mm/day)
  1115. end if
  1116. else
  1117. precip(i,j,:)=0.
  1118. end if
  1119. do k=1,lmax_conv
  1120. precip(i,j,k)=precip(i,j,k)*fz(i,j)
  1121. prf(i,j,k)=prf(i,j,k)*fz(i,j)
  1122. end do !k
  1123. end do ! i
  1124. end do ! j
  1125. !
  1126. !if(myid == root) then
  1127. ! write(6,*) 'calculate_lsp_scav: region',region
  1128. ! write(6,*) ' rainout: average scale factor for precipitation = ',sfz/nfz
  1129. ! write(6,*) ' rainout: percentage of columns with precipitation = ', &
  1130. ! 100.*nfz/real(im(region)*jm(region)),' %'
  1131. ! if ( no_fz > 0 ) write(6,*) 'rainout: lsp and prf not consistent ', &
  1132. ! no_fz,'average rainfall [mm/day]',sfz_no/no_fz
  1133. !end if
  1134. !
  1135. ! initialise
  1136. !
  1137. oldcov=0.
  1138. ! evap=0.
  1139. rloss1(region)%d3=0.
  1140. !>>>TvN
  1141. rloss1_m7(region)%d3=0.
  1142. !<<<TvN
  1143. rloss2(region)%d3=0.
  1144. rloss3(region)%d3=0.
  1145. !
  1146. do k=lmax_conv-1,1,-1 ! top-down
  1147. do j=j1,j2
  1148. do i=i1,i2
  1149. !
  1150. ! pressure correction for diffusion coefficient
  1151. !
  1152. press = (phlb(i,j,k)+phlb(i,j,k+1))/2.
  1153. dgairx = dgair*1e5/press ! dgair at 1 atmosphere
  1154. dghno3x = dghno3*1e5/press
  1155. beta1=0.
  1156. beta1_m7=0.
  1157. beta2=0.
  1158. beta3=0.
  1159. !
  1160. ! total cloudwater (kg H2O / kg air)
  1161. !
  1162. totw=lwc(i,j,k)+iwc(i,j,k)
  1163. !
  1164. ! no influx set kcltop to low number
  1165. !
  1166. if (precip(i,j,k+1)<=1.e-15) kcltop(i,j)=0
  1167. !
  1168. !==========================================
  1169. ! below-cloud scavenging (beta2 and beta3)
  1170. !==========================================
  1171. !
  1172. ! with evaporation do:
  1173. ! precip(i,j,k+1)=precip(i,j,k+1)-evap(i,j,k))>1E-15
  1174. !
  1175. if( (precip(i,j,k+1)>1e-15) .and. (k<kcltop(i,j)) &
  1176. .and. (oldcov(i,j)>0.) )then
  1177. !
  1178. ! rflx in [mm/hr] !MK? thought precip was in kg/m2/s ??
  1179. ! rlwc in [vol mixing ratio]
  1180. ! rdrad in [cm]
  1181. ! ru in [cm/s] (terminal velocity)
  1182. ! znre = Reynolds number
  1183. ! znsc = (Sherwood number)**(1./3.)
  1184. ! zkg in [cm/s] = dghno3[cm^2/s]/rdrad[cm]
  1185. !
  1186. rflx = precip(i,j,k+1)/oldcov(i,j)*3600.
  1187. rlwc = 72.*rflx**0.88*1.e-9
  1188. rdrad = 0.1*0.3659*rflx**0.21
  1189. !*******************************************
  1190. ! correction by Twan van Noije, Bas Henzing:
  1191. ! ru = 9.58*(1.-exp(-(rdrad*10./0.885)**1.147))
  1192. ! the above equation gives an approximation to the terminal velocity in m/s !!
  1193. ! a conversion factor to cm/s should therefore be included
  1194. ! znre = 20.*rdrad*ru/dgair
  1195. ! with ru in cm/s, the above expression overestimates the Reynolds number by a factor 10
  1196. ! the combined effect of having ru in m/s and the above expression for the Reynolds number
  1197. ! is to underestimate the Reynolds number by a factor 10, resulting in an underestimation
  1198. ! of the Sherwood number and an overestimation of the below-cloud scavenging
  1199. ! Twan van Noije/Bas Henzing, 24-02-2004
  1200. !*******************************************
  1201. ru = 100.*9.58*(1.-exp(-(rdrad*10./0.885)**1.147))
  1202. ! see Seinfeld (1986), p. 632
  1203. znre = 2.*rdrad*ru/dgair
  1204. !WRONG ru = 9.58*(1.-exp(-(rdrad*10./0.885)**1.147))
  1205. !WRONG znre = 20.*rdrad*ru/dgair
  1206. znsc = (dgair/dghno3)**(1./3.)
  1207. znsh = 1.+0.3*(znre**0.5)*znsc
  1208. zkg = dghno3/rdrad*znsh
  1209. beta2 = 3.*zkg*rlwc/rdrad
  1210. !
  1211. ! beta3 for below cloud scavenging of accumulation range aerosol
  1212. ! (Dana and Hales, Atmos. Env. 1976, pp. 45-50
  1213. ! assuming a Whitby aerosol distrbution r=0.034 sigma=2;
  1214. ! mass-mean radius r=0.14 microm;
  1215. ! figure 2 gives a wash-out coefficient of 0.05 mm^-1 (raindepth)
  1216. ! for other sigma and r look-up tables can be generated
  1217. !>>>TvN
  1218. ! A mass washout coefficient of 0.05 mm^-1 in Fig. 2 of Dana and Hales (1975)
  1219. ! would correspond to a geometric mean/median particle radius of 0.14 micron.
  1220. ! At a median radius of 0.034 micron and sigma=2, the value becomes ~0.002 mm^-1.
  1221. ! However, as the aerodynamic radius is used in the plot, these values only apply
  1222. ! to unit-density particles, with a density equal to that of water (1 g/cm^3).
  1223. ! The aerodynamic radius equals the actual radius times
  1224. ! the square root of ratio of the particle density over that for water.
  1225. ! For the bulk inorganic aerosols, the particle density is about 1800 g/cm^3,
  1226. ! so the aerodynamic radius is 1.34 times the actual radius,
  1227. ! and a median aerodynamic radius of ~0.046 micron should be used.
  1228. ! This gives a mass washout coefficient of ~0.004 mm^-1.
  1229. ! Thus, based on the work by Dana and Hales, the value 0.05 mm^-1 seems too low,
  1230. ! and a value ~0.004 mm^-1 would be more appropriate.
  1231. !
  1232. ! mm-1*[mm hr-1] * [hr/s] => [s-1]
  1233. !
  1234. !beta3= 0.05*rflx/3600.
  1235. beta3= 0.004*rflx/3600.
  1236. !
  1237. !<<<TvN
  1238. end if
  1239. !
  1240. ! revaporation ( not implemented yet!, evap put to 0.)
  1241. !
  1242. ! IF ((1.-cc(i,j,k))>1E-20.AND.precip(i,j,k+1)>1E-20) THEN
  1243. ! rev1=max(0.,EVAP(i,j,k)/precip(i,j,k+1))
  1244. ! ! evaporation fraction
  1245. ! rev(i,j,k)=MIN(1.,rev1)
  1246. ! END IF
  1247. !
  1248. !==============================
  1249. ! in cloud scavenging (beta1)
  1250. !==============================
  1251. !
  1252. if (totw>1.e-9.and.prf(i,j,k)>0.and.cc(i,j,k)>0.02) then
  1253. !
  1254. if(k>kcltop(i,j)) kcltop(i,j)=k !set new cloud top
  1255. !
  1256. ! rlwc: convert mass mixing ratios to volume mixing ratios in cloud
  1257. ! aird: air density in kg air / m^3
  1258. ! max_lwc: in kg H2O / m^3
  1259. ! prf: in kg H2O / m3 / s
  1260. ! beta: in [s-1] = [vol mixing ratio]*[cm2/s]*1e-4/[m2]
  1261. ! fac, beta1: in [s-1]
  1262. !
  1263. aird=press/t(i,j,k)/rgas*xmair*1.e-3
  1264. rlwc=(lwc(i,j,k)/rol+iwc(i,j,k)/roi)*aird/cc(i,j,k)
  1265. rlwc=min(max_lwc/rol,rlwc)
  1266. !
  1267. !bas henzing: bug repair: beta=3.*rlwc*(dghno3*1e-4)/rdrad2
  1268. !bas henzing: should be:
  1269. ! beta=(3.*rlwc*(dghno3*1e-4)/(2.*rdrad2))*znsh
  1270. !bas henzing: reference: (Roelofs and Lelieveld, 1995)
  1271. !fd beta=(3.*rlwc*(dghno3*1e-4)/(2.*rdrad2))*znsh
  1272. ! fd 13/08/2002 use old defenition again (pers. comm Henzing)
  1273. beta=3.*rlwc*(dghno3*1e-4)/rdrad2
  1274. !
  1275. inc_rdf=(iwc(i,j,k)/totw)*ice_eff+lwc(i,j,k)/totw
  1276. fac=prf(i,j,k)*inc_rdf/(totw*aird)
  1277. !>>>TvN
  1278. ! In the calculation of fac (and thus fac_m7) currently the grid-cell average prf is used.
  1279. ! Question: shouldn't we use the actual value in the cloudy part, i.e. prf/cc ?
  1280. ! Note that scaling by 1/cc is also applied in the calculation of beta,
  1281. ! and that for the below-cloud scavenging parameters beta2 and beta3
  1282. ! we also use the actual precipitation intensity in the precipitating fraction,
  1283. ! i.e. precip/oldcov.
  1284. !<<<TvN
  1285. !
  1286. !resistance analogy: the slowest determines the overall resistance
  1287. !
  1288. beta1=1./(1./beta+1./fac)
  1289. !
  1290. !>>>TvN
  1291. ! The scavengy efficiency for in-cloud scavenging of M7 aerosols by ice in stratiform clouds
  1292. ! is now reduced by applying a lower scavenging coefficient for mixed and ice clouds
  1293. ! according to Bourgeois and Bey (JGR, 2011).
  1294. fac_m7=prf(i,j,k)/(totw*aird)
  1295. beta1_m7=1./(1./beta+1./fac_m7)
  1296. !<<<TvN
  1297. !
  1298. !if no precipitation formation oldcov remains old value
  1299. !
  1300. oldcov(i,j)=max(oldcov(i,j),cc(i,j,k))
  1301. !
  1302. end if ! in cloud scavenging
  1303. !
  1304. rloss1(region)%d3(i,j,k)=beta1 ! in cloud completely soluble
  1305. !>>>TvN
  1306. rloss1_m7(region)%d3(i,j,k)=beta1_m7 ! as rloss1, but with ice as efficient as liquid water
  1307. !<<<TvN
  1308. rloss2(region)%d3(i,j,k)=beta2 ! below cloud gas
  1309. rloss3(region)%d3(i,j,k)=beta3 ! below cloud aerosol
  1310. end do !i
  1311. end do !j
  1312. end do !k
  1313. !if(myid == root) then
  1314. ! write(*,*) 'calculate_lsp_scav: average rain-out loss rate 1 region', &
  1315. ! region,sum(rloss1(region)%d3)/im(region)/jm(region)/lmax_conv
  1316. ! write(*,*) 'calculate_lsp_scav: average rain-out loss rate 2 region', &
  1317. ! region,sum(rloss2(region)%d3)/im(region)/jm(region)/lmax_conv
  1318. ! write(*,*) 'calculate_lsp_scav: average rain-out loss rate 3 region', &
  1319. ! region,sum(rloss3(region)%d3)/im(region)/jm(region)/lmax_conv
  1320. !end if
  1321. deallocate(oldcov)
  1322. deallocate(fz)
  1323. deallocate(precip)
  1324. deallocate(prf)
  1325. deallocate(dzk)
  1326. deallocate(kcltop)
  1327. nullify(lsp)
  1328. nullify(t)
  1329. nullify(lwc)
  1330. nullify(iwc)
  1331. nullify(cc)
  1332. nullify(phlb)
  1333. contains
  1334. subroutine calfk
  1335. !--------------------------------------------------------------
  1336. ! calculate vertical distribution of large scale precipitation
  1337. !
  1338. ! OUTPUT: prf = precipitation formation rate (kg m-3 s-1)
  1339. !
  1340. ! Written by Ad Jeuken, KNMI, May 1998
  1341. ! Adapted for TM5, MK, march 2003
  1342. !--------------------------------------------------------------
  1343. use toolbox, only: lvlpress
  1344. !
  1345. ! microphysical constants
  1346. real,parameter :: cr1=1.e-4 ! s-1
  1347. real,parameter :: cr2=1.0 ! m2 kg-1
  1348. real,parameter :: qcrs=3.e-4 ! kg/kg
  1349. !bas henzing: replace alfa real,parameter :: alfa=1.77, beta=0.16
  1350. !bas henzing: new value alfa=3.29 (Heymsfield and Donner, 1990)
  1351. real,parameter :: alfa=3.29, beta=0.16
  1352. !bas henzing: replace b1 real,parameter :: b1=100., b2=0.5, Tberg=268.
  1353. !bas henzing: new value b1=300. (Sunquist et al., 1989)
  1354. real,parameter :: b1=300., b2=0.5, Tberg=268.
  1355. !
  1356. real :: plocal,f1,f2,delta_prec,ahelp,rain_frac,c0
  1357. real :: pr0,qcr,qcl,qci,dzk,aird,press
  1358. real :: qup,qdo,rup,rdo,vtup,vtdo,zcc,ccp,ccm
  1359. integer :: iclb,iclt,icldtop,i,j,k,l,l1,l2
  1360. real,dimension(:),allocatable :: zrho,pcl,pci
  1361. !
  1362. allocate(zrho(lmax_conv))
  1363. allocate(pci(lmax_conv))
  1364. allocate(pcl(lmax_conv))
  1365. prf=0.
  1366. do j=j1,j2
  1367. do i=i1,i2
  1368. !
  1369. ! calculate airdensity "zrho" in kg/m3
  1370. !
  1371. do l=1,lmax_conv
  1372. press=(phlb(i,j,l)+phlb(i,j,l+1))/2.
  1373. zrho(l)=press/t(i,j,l)/rgas*xmair*1.e-3
  1374. end do
  1375. !
  1376. iclb=0
  1377. iclt=0
  1378. !
  1379. ! do not consider columns with lsp less than 1.e-5 mm/day
  1380. !
  1381. ! if (lsp(i,j,1)>1.e-5) then
  1382. if ( lsp(i,j,1)*1e3*3600.*24. > 1.e-5 ) then !new data are in m/s
  1383. ! determine cloud base
  1384. k = 1
  1385. do
  1386. if ( cc(i,j,k) >= 0.01 ) exit
  1387. if ( k == lmax_conv ) exit
  1388. k = k + 1
  1389. end do
  1390. iclb = k
  1391. ! determine cloud top
  1392. k = lmax_conv
  1393. do
  1394. if ( cc(i,j,k) >= 0.01 ) exit
  1395. if ( k == 1 ) exit
  1396. k = k-1
  1397. end do
  1398. iclt = k
  1399. ! check for inconsistency in cloud cover fields
  1400. if ( iclb >= iclt ) iclb=iclt
  1401. if ( iclb < 1 ) iclb=1
  1402. !mvw: replace fixed iclb/t=14 by 120 hPa level (about 15km)
  1403. ! if (iclb>14) iclb=14
  1404. ! if (iclt>14) iclt=14
  1405. icldtop=lvlpress(region,12000., 98400.)
  1406. if ( iclb > icldtop ) iclb=icldtop
  1407. if ( iclt > icldtop ) iclt=icldtop
  1408. !
  1409. pr0=0.
  1410. pcl=0.
  1411. pci=0.
  1412. rain_frac=0.00001
  1413. !
  1414. ! start at cloudtop
  1415. do k=iclt,iclb,-1
  1416. zcc=max(0.01,cc(i,j,k))
  1417. !
  1418. ! precipitation formation from ice clouds
  1419. !
  1420. ! pci in kg_H2O / (kg_air sec)
  1421. !
  1422. if ( ( t(i,j,k) < 258.0 ) .and. ( k > 1 ) ) then
  1423. ccp=max(0.01,cc(i,j,k+1))
  1424. ccm=max(0.01,cc(i,j,k-1))
  1425. qup=(iwc(i,j,k)/zcc+iwc(i,j,k+1)/ccp)*0.5
  1426. qdo=(iwc(i,j,k)/zcc+iwc(i,j,k-1)/ccm)*0.5
  1427. rup=(zrho(k)+zrho(k+1))*0.5
  1428. rdo=(zrho(k)+zrho(k-1))*0.5
  1429. vtup=alfa*(rup*qup)**beta
  1430. vtdo=alfa*(rdo*qdo)**beta
  1431. pci(k)=grav*(vtup*qup*rup-vtdo*qdo*rdo)/ &
  1432. (phlb(i,j,k+1)-phlb(i,j,k))
  1433. pci(k)=max(pci(k),0.)
  1434. end if
  1435. !
  1436. ! precipitation formation from liquid clouds
  1437. ! formulation ECMWF
  1438. !
  1439. qcl=lwc(i,j,k)/zcc
  1440. qcl=min(max_lwc/zrho(k),qcl)
  1441. qcl=max(0.001e-3/zrho(k),qcl)
  1442. !
  1443. ! pcl in kg_H2O / (kg_air sec)
  1444. !
  1445. plocal=pr0/rain_frac
  1446. f1=1.+b1*sqrt(plocal)
  1447. f2=1.+b2*sqrt(max(0.,Tberg-t(i,j,k)))
  1448. c0=cr1*f1*f2
  1449. qcr=qcrs/(f1*f2)
  1450. pcl(k)=zcc*c0*qcl*(1.-exp(-(qcl/qcr)**2))
  1451. !
  1452. ! prec at top next layer in kg m-2 s-1
  1453. !
  1454. dzk=29.3*t(i,j,k)*alog(phlb(i,j,k)/(1.+phlb(i,j,k+1)))
  1455. delta_prec=(pcl(k)+pci(k))*zrho(k)*dzk
  1456. ahelp=(zcc*delta_prec+rain_frac*pr0)/(delta_prec+pr0)
  1457. rain_frac=max(rain_frac,ahelp)
  1458. pr0=pr0+(pcl(k)+pci(k))*zrho(k)*dzk
  1459. !
  1460. ! liquid+ice precipitation formation rates in kg m-3 s-1
  1461. !
  1462. prf(i,j,k)= (pcl(k)+pci(k))*zrho(k)
  1463. !
  1464. end do ! k
  1465. end if ! lsp gt 1.e-5
  1466. end do ! i
  1467. end do ! j
  1468. deallocate(zrho)
  1469. deallocate(pci)
  1470. deallocate(pcl)
  1471. !
  1472. end subroutine calfk
  1473. END SUBROUTINE CALCULATE_LSP_SCAV
  1474. !EOC
  1475. END MODULE WET_DEPOSITION