dry_deposition.F90 69 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888
  1. !#################################################################
  2. !
  3. ! Purpose:
  4. ! --------
  5. !
  6. ! This module contains all subroutines needed for dry deposition calculations.
  7. ! The mean purpose is to perform on a high resolution of 1x1 degree:
  8. !
  9. ! 0. allocate the vd on the model resolution
  10. !
  11. ! 1. read fields needed for further calculations in subroutines:
  12. !
  13. ! 2. calculate the tracer independent friction velocity, aerodynamic
  14. ! and sub-laminar resistance
  15. !
  16. ! 3. calculate fields needed for resistance calculations
  17. !
  18. ! 4. the tracer dependent vd
  19. !
  20. ! 5. coarsen the vd
  21. !
  22. ! 6. apply the coarsened deposition velocities to concentration field rm
  23. !
  24. ! 7. deallocate vd
  25. !
  26. ! Reference:
  27. ! ---------
  28. ! general documentationon ECMWF fields can be found on:
  29. ! http://www.ecmwf.int/research/ifsdocs/PHYSICS/
  30. ! ---------
  31. ! Authors:
  32. ! -------
  33. ! original code by Laurens Ganzeveld and Ad Jeuken (1997)
  34. ! revised and adapted for use in TM5 and use of ECMWF data
  35. ! by F. Dentener and M. Krol (2003)
  36. !
  37. ! 24 Jan 2012 - P. Le Sager - modified for mpi lat-lon domain decomposition
  38. !
  39. !### macro's #####################################################
  40. !
  41. #define TRACEBACK write (gol,'("in ",a," (",a,", line",i5,")")') rname, __FILE__, __LINE__; call goErr
  42. #define IF_NOTOK_RETURN(action) if (status/=0) then; TRACEBACK; action; return; end if
  43. #define IF_ERROR_RETURN(action) if (status> 0) then; TRACEBACK; action; return; end if
  44. !
  45. #include "tm5.inc"
  46. !
  47. !#################################################################
  48. module dry_deposition
  49. use GO , only : gol, goPr, goErr
  50. use dims , only : nregions
  51. use chem_param , only : ntrace
  52. use global_types, only : emis_data
  53. implicit none
  54. ! --- in/out ----------------------
  55. private
  56. public :: Dry_Deposition_Init, Dry_Deposition_Done
  57. public :: dd_surface_fields
  58. public :: vd
  59. public :: vda
  60. ! --- const -----------------------
  61. character(len=*), parameter :: mname = 'dry_deposition'
  62. ! --- var -------------------------
  63. ! vd : final deposition velocities for all species on model resolution.
  64. ! vd_temp : to store the vd temporarily for one specie
  65. type(emis_data),dimension(nregions,ntrace) :: vd
  66. type(emis_data),dimension(nregions) :: vd_temp, vd_temp_global
  67. ! vda : final deposition velocities for all aerosols on model resolution.
  68. type(emis_data), pointer :: vda(:,:)
  69. contains
  70. !
  71. ! Allocate emission data structure "vd",
  72. ! final deposition velocities for all species on model resolution
  73. !
  74. subroutine Dry_Deposition_Init( status )
  75. use dims , only : nregions, iglbsfc
  76. use chem_param, only : ndep
  77. use chem_param, only : nrdep
  78. use meteodata , only : lsmask_dat
  79. use meteodata , only : sr_ecm_dat, sr_ols_dat, ci_dat, sd_dat, swvl1_dat
  80. use meteodata , only : nsss_dat, ewss_dat, u10m_dat, v10m_dat, slhf_dat, sshf_dat
  81. use meteodata , only : src_dat, d2m_dat, t2m_dat, ssr_dat
  82. use meteodata , only : nveg
  83. use meteodata , only : tv_dat, cvl_dat, cvh_dat
  84. use meteodata , only : Set
  85. use tm5_distgrid, only : dgrid, Get_DistGrid
  86. use ParTools, only : isRoot
  87. ! --- in/out ------------------------------------
  88. integer, intent(out) :: status
  89. ! --- const -------------------------------------
  90. character(len=*), parameter :: rname = mname//'/Dry_Deposition_Init'
  91. ! --- local -------------------------------------
  92. integer :: imr,jmr,region,n
  93. integer :: iveg, i1, i2, j1, j2
  94. ! --- begin -------------------------------------
  95. ! deposition velocities ;
  96. ! always allocated, filled with zeros if no tracers are to be deposited:
  97. do region = 1, nregions
  98. CALL GET_DISTGRID( DGRID(region), I_STRT=i1, I_STOP=i2, J_STRT=j1, J_STOP=j2 )
  99. do n=1,ntrace
  100. allocate(vd(region,n)%surf(i1:i2, j1:j2))
  101. vd(region,n)%surf = 0.0
  102. end do
  103. end do
  104. ! deposited tracers ?
  105. if ( ndep > 0 ) then
  106. ! select meteo to be used
  107. call Set( lsmask_dat(iglbsfc), status, used=.true. )
  108. call Set( sr_ecm_dat(iglbsfc), status, used=.true. )
  109. call Set( sr_ols_dat(iglbsfc), status, used=.true. )
  110. call Set( ci_dat(iglbsfc), status, used=.true. )
  111. call Set( sd_dat(iglbsfc), status, used=.true. )
  112. call Set( swvl1_dat(iglbsfc), status, used=.true. )
  113. call Set( ewss_dat(iglbsfc), status, used=.true. )
  114. call Set( nsss_dat(iglbsfc), status, used=.true. )
  115. call Set( u10m_dat(iglbsfc), status, used=.true. )
  116. call Set( v10m_dat(iglbsfc), status, used=.true. )
  117. call Set( slhf_dat(iglbsfc), status, used=.true. )
  118. call Set( sshf_dat(iglbsfc), status, used=.true. )
  119. call Set( src_dat(iglbsfc), status, used=.true. )
  120. call Set( d2m_dat(iglbsfc), status, used=.true. )
  121. call Set( t2m_dat(iglbsfc), status, used=.true. )
  122. call Set( ssr_dat(iglbsfc), status, used=.true. )
  123. call Set( cvl_dat(iglbsfc), status, used=.true. )
  124. call Set( cvh_dat(iglbsfc), status, used=.true. )
  125. do iveg = 1, nveg
  126. call Set( tv_dat(iglbsfc,iveg), status, used=.true. )
  127. end do
  128. ! temporary storage:
  129. do region = 1, nregions
  130. CALL GET_DISTGRID( DGRID(region), I_STRT=i1, I_STOP=i2, &
  131. J_STRT=j1, J_STOP=j2, &
  132. I_WRLD=imr, J_WRLD=jmr )
  133. allocate(vd_temp(region)%surf(i1:i2,j1:j2))
  134. if(isRoot) then
  135. allocate(vd_temp_global(region)%surf(imr,jmr))
  136. else
  137. allocate(vd_temp_global(region)%surf(1,1))
  138. end if
  139. end do
  140. end if ! deposited tracers
  141. ! aerosols ?
  142. if ( nrdep > 0 ) then
  143. allocate( vda(nregions,nrdep) )
  144. do region = 1, nregions
  145. CALL GET_DISTGRID( DGRID(region), I_STRT=i1, I_STOP=i2, J_STRT=j1, J_STOP=j2 )
  146. do n=1,nrdep
  147. allocate(vda(region,n)%surf(i1:i2,j1:j2))
  148. vda(region,n)%surf = 0.0
  149. end do
  150. end do
  151. end if
  152. ! ok
  153. status = 0
  154. end subroutine Dry_Deposition_Init
  155. ! ***
  156. !
  157. ! De-allocate emission data structure "vd",
  158. ! final deposition velocities for all species on model resolution
  159. !
  160. subroutine Dry_Deposition_Done( status )
  161. use dims , only : nregions
  162. use chem_param, only : ndep
  163. use chem_param, only : nrdep
  164. ! --- in/out ------------------------------------
  165. integer, intent(out) :: status
  166. ! --- const -------------------------------------
  167. character(len=*), parameter :: rname = mname//'/Dry_Deposition_Done'
  168. ! --- local -------------------------------------
  169. integer :: region, n
  170. ! --- begin -------------------------------------
  171. ! clear deposition velocities:
  172. do region = 1, nregions
  173. do n=1,ntrace
  174. deallocate(vd(region,n)%surf)
  175. end do
  176. end do
  177. ! clear temporary storage:
  178. if ( ndep > 0 ) then
  179. do region = 1, nregions
  180. deallocate(vd_temp(region)%surf)
  181. deallocate(vd_temp_global(region)%surf)
  182. end do
  183. end if ! deposited tracers
  184. ! aerosols ?
  185. if ( nrdep > 0 ) then
  186. do region = 1, nregions
  187. do n = 1, nrdep
  188. deallocate( vda(region,n)%surf )
  189. end do
  190. end do
  191. deallocate( vda )
  192. end if
  193. ! ok
  194. status = 0
  195. end subroutine Dry_Deposition_Done
  196. !------------------------------------
  197. !
  198. ! Purpose:
  199. ! -------
  200. ! this subroutine reads and prepares all surface fields
  201. !
  202. ! External
  203. ! --------
  204. ! dd_get_3_hourly_surface_fields
  205. ! dd_calc_ustar_raero_rb
  206. ! dd_calc_rstom_rahcan
  207. ! dd_calc_inisurf
  208. ! dd_calc_rs
  209. ! dd_coarsen_vd
  210. !
  211. ! Reference
  212. ! ---------
  213. ! Ganzeveld and Lelieveld (1996) and references therein.
  214. !
  215. !------------------------------------
  216. subroutine dd_surface_fields( status )
  217. use binas , only : vkarman
  218. use dims , only : idate
  219. use dims , only : okdebug
  220. use chem_param , only : names
  221. use chem_param , only : ndep
  222. use chem_param , only : nrdep
  223. use io_save , only : read_scatter_hdf
  224. #ifndef without_photolysis
  225. use photolysis_data, only : phot_dat
  226. #endif
  227. use ParTools, only : isRoot
  228. use dims , only : iglbsfc
  229. use meteodata , only : lsmask_dat
  230. use meteodata , only : sr_ecm_dat, sr_ols_dat, ci_dat, sd_dat, swvl1_dat
  231. use meteodata , only : ewss_dat, nsss_dat, u10m_dat, v10m_dat, slhf_dat, sshf_dat
  232. use meteodata , only : src_dat, d2m_dat, t2m_dat, ssr_dat
  233. use tm5_distgrid, only : dgrid, Get_DistGrid, scatter, gather, dist_arr_stat
  234. ! --- in/out -----------------------------
  235. integer, intent(out) :: status
  236. ! --- const -------------------------------
  237. character(len=*), parameter :: rname = 'dd_surface_fields'
  238. ! --- local ------------------------------
  239. character(len=10) :: c_time
  240. real, dimension(:,:,:), allocatable :: soilph
  241. real, dimension(:,:), allocatable :: lai, lai1
  242. real, dimension(:,:), allocatable :: vgrat_low, vgrat_high
  243. real, dimension(:,:), allocatable :: sstr, wind10m
  244. real, dimension(:,:), allocatable :: ustar_loc,rb,raero
  245. real, dimension(:,:,:), allocatable :: vd11
  246. real, dimension(:,:), allocatable :: vd11a
  247. real, dimension(:,:), allocatable :: rahcan
  248. real, dimension(:,:), allocatable :: rstom
  249. real, dimension(:,:), allocatable :: snow_cover
  250. real, dimension(:,:), allocatable :: wet_skin
  251. real, dimension(:,:), allocatable :: fws
  252. real, dimension(:,:), allocatable :: rh2m
  253. real, dimension(:,:), allocatable :: ddepvel_h2
  254. #ifndef without_photolysis
  255. real, dimension(:,:), allocatable :: ags
  256. #endif
  257. real, dimension(:,:), allocatable :: alpha, bubble, alphae
  258. real, dimension(:,:), allocatable :: ustar_land, ustar_sea, sr_sea
  259. real, dimension(:,:), allocatable :: global_field
  260. integer :: i, nsend, region,itrace
  261. integer :: i1, i2, j1, j2, imr, jmr
  262. ! no deposited tracers or aerosols ? then leave immediately:
  263. if ( ndep+nrdep == 0 ) then
  264. status=0; return
  265. end if
  266. ! From here until the remapping (coarsen), we work on the extra iglbsfc
  267. ! grid, on which the data to read are expected to be.
  268. CALL GET_DISTGRID( DGRID(iglbsfc), I_STRT=i1, I_STOP=i2, J_STRT=j1, J_STOP=j2, I_WRLD=imr, J_WRLD=jmr )
  269. if (isRoot) then
  270. allocate(global_field(imr,jmr))
  271. else
  272. allocate(global_field(1,1))
  273. end if
  274. allocate(soilph (i1:i2, j1:j2,5))
  275. allocate(lai (i1:i2, j1:j2) )
  276. allocate(lai1 (i1:i2, j1:j2) )
  277. allocate(vgrat_low (i1:i2, j1:j2) )
  278. allocate(vgrat_high(i1:i2, j1:j2) )
  279. allocate(sstr (i1:i2, j1:j2) )
  280. allocate(wind10m (i1:i2, j1:j2) )
  281. allocate(ustar_loc (i1:i2, j1:j2) )
  282. allocate(raero (i1:i2, j1:j2) )
  283. allocate(rb (i1:i2, j1:j2) )
  284. allocate(rahcan (i1:i2, j1:j2) )
  285. allocate(rstom (i1:i2, j1:j2) )
  286. allocate(snow_cover(i1:i2, j1:j2) )
  287. allocate(wet_skin (i1:i2, j1:j2) )
  288. allocate(fws (i1:i2, j1:j2) )
  289. allocate(rh2m (i1:i2, j1:j2) )
  290. allocate(ddepvel_h2(i1:i2, j1:j2) )
  291. #ifndef without_photolysis
  292. allocate(ags (i1:i2, j1:j2) )
  293. #endif
  294. allocate(vd11 (i1:i2, j1:j2,ndep))
  295. if ( nrdep > 0 ) allocate(vd11a(i1:i2, j1:j2))
  296. allocate(ustar_land(i1:i2, j1:j2))
  297. allocate(ustar_sea (i1:i2, j1:j2))
  298. allocate(sr_sea (i1:i2, j1:j2))
  299. allocate(alpha (i1:i2, j1:j2))
  300. allocate(bubble (i1:i2, j1:j2))
  301. allocate(alphae (i1:i2, j1:j2))
  302. ! -- for output of time header on debug fields
  303. write(c_time,'(i4,3(i2))') idate(1:4) !CMK corrected
  304. do i=1,10
  305. if (c_time(i:i)==' ') c_time(i:i)='0'
  306. end do
  307. !
  308. ! surface data sets may have the following characteristics
  309. ! 1. instanteneous.
  310. ! The time written in the file is valid from t-1.5 to t+1.5
  311. ! 2. Accumulated.
  312. ! The time written in the file is valid from t to t+3
  313. ! 3. Daily averaged.
  314. ! The time on the file is always 00 hours, and valid until t+24
  315. !
  316. ! *** It is essential to understand this timing when
  317. ! reading and applying these sets.
  318. !
  319. ! fd2mk it has to be decided to 'save' fields like
  320. ! vgrat_low and daily average surface fields
  321. ! for later use, or to read it every 3 hours time step
  322. !
  323. ! Read data
  324. call dd_get_soilph_lai ! non-ECMWF provided data: soilph and lai
  325. IF_NOTOK_RETURN(status=1)
  326. call dd_get_surface_vegetation ! vgrat_low, vgrat_high and lsm
  327. IF_NOTOK_RETURN(status=1)
  328. wind10m = sqrt( u10m_dat(iglbsfc)%data(:,:,1)**2 + v10m_dat(iglbsfc)%data(:,:,1)**2 )
  329. sstr = sqrt( ewss_dat(iglbsfc)%data(:,:,1)**2 + nsss_dat(iglbsfc)%data(:,:,1)**2 )
  330. ! AS: ensure being non-zero
  331. where( sstr .lt. 1.E-10 ) sstr = 1.E-10
  332. call dd_calc_ustar_raero_rb ! raero, ustar_loc, rb
  333. IF_NOTOK_RETURN(status=1)
  334. call dd_calc_rstom_rahcan ! rstom, rahcan
  335. call dd_calc_inisurf ! snow_cover, wet_skin, fws, rh2m, ags
  336. call dd_calc_rs ! vd
  337. IF_NOTOK_RETURN(status=1)
  338. ! coarsen vd to model resolution
  339. #ifndef without_photolysis
  340. call dd_coarsen_vd( vd11, ags, i1, j1, status )
  341. #else
  342. call dd_coarsen_vd( vd11, i1, j1, status )
  343. #endif
  344. IF_NOTOK_RETURN(status=1)
  345. deallocate(soilph)
  346. deallocate(lai)
  347. deallocate(lai1)
  348. deallocate(vgrat_low)
  349. deallocate(vgrat_high)
  350. deallocate(sstr)
  351. deallocate(wind10m)
  352. deallocate(ustar_loc)
  353. deallocate(raero)
  354. deallocate(rb)
  355. deallocate(rahcan)
  356. deallocate(rstom)
  357. deallocate(snow_cover)
  358. deallocate(wet_skin)
  359. deallocate(fws)
  360. deallocate(rh2m)
  361. deallocate(ddepvel_h2)
  362. #ifndef without_photolysis
  363. deallocate(ags)
  364. #endif
  365. deallocate(vd11)
  366. if ( nrdep > 0 ) deallocate( vd11a )
  367. deallocate(alpha)
  368. deallocate(bubble)
  369. deallocate(alphae)
  370. deallocate(ustar_land)
  371. deallocate(ustar_sea)
  372. deallocate(sr_sea)
  373. !FD23012004
  374. deallocate(global_field)
  375. ! PLS #ifdef MPI
  376. ! PLS do region = 1, nregions
  377. ! PLS nsend = im(region)*jm(region)
  378. ! PLS do itrace = 1, ntrace
  379. ! PLS call mpi_bcast(vd(region,itrace)%surf, nsend, my_real, root_k, &
  380. ! PLS com_lev, ierr)
  381. ! PLS end do
  382. ! PLS ! aerosols ?
  383. ! PLS if ( nrdep > 0 ) then
  384. ! PLS do itrace = 1, nrdep
  385. ! PLS call mpi_bcast( vda(region,itrace)%surf, nsend, MY_REAL, root_k, com_lev, ierr )
  386. ! PLS end do
  387. ! PLS end if
  388. ! PLS #ifndef without_photolysis
  389. ! PLS ! send albedo computed in dd_calc_inisurf to all other processors:
  390. ! PLS call mpi_bcast(phot_dat(region)%albedo ,nsend, my_real, root_k, com_lev, ierr)
  391. ! PLS #endif
  392. ! PLS end do
  393. ! PLS if ( myid == root_k .and. okdebug ) then
  394. ! PLS write (gol,'("dd_surface_fields: Deposition velocities broadcasted")') ; call goPr
  395. ! PLS end if
  396. ! PLS #endif
  397. ! ok
  398. status = 0
  399. contains
  400. !---------------------------
  401. !
  402. ! Purpose
  403. ! -------
  404. ! Reads two independent datasets on soils and vegetation not provided by ECMWF
  405. !
  406. ! Reference:
  407. ! ---------
  408. ! Data provided by Laurens Ganzeveld
  409. !
  410. !--------------------------
  411. SUBROUTINE DD_GET_SOILPH_LAI
  412. use global_data, only : inputdir
  413. integer, parameter :: rank2=2
  414. character(len=5),dimension(5) :: name_soil = (/'spec1','spec2','spec3','spec4','spec5'/)
  415. integer :: i,mo,n, st
  416. !
  417. ! -- Reading of input file with LAI data which is derived
  418. ! from the Olson ecosystem database (0.5 X 0.5 degrees), which
  419. ! discerns 46 ecosystems and their characteristics, e.g. LAI.
  420. ! Fields are monthly averaged.
  421. !
  422. mo=idate(2)
  423. call read_scatter_hdf(trim(inputdir)//'/land/lsmlai.hdf', rank2, &
  424. iglbsfc, i1, j1, lai, status, idx=mo ) !lai index
  425. IF_NOTOK_RETURN(status=1)
  426. if ( okdebug ) then
  427. call dist_arr_stat(dgrid(iglbsfc), 'lai', lai, 0, status)
  428. IF_NOTOK_RETURN(status=1)
  429. end if
  430. !
  431. ! -- Reading of input file with soil pH data,which are derived from
  432. ! a 0.5 x 0.5 degree soil pH database, Batjes, 1995
  433. ! over land soilph 1 to 5 should add up to 1.
  434. ! SOILPH(I,J,1) - soil pH <5.5
  435. ! SOILPH(I,J,2) - soil 5.5 <pH <7.3
  436. ! SOILPH(I,J,3) - soil 7.3< pH <8.5
  437. ! SOILPH(I,J,4) - soil 8.5 <pH
  438. ! SOILPH(I,J,5) - soil 4 < pH <8.5
  439. !
  440. do n=1,5
  441. call read_scatter_hdf(trim(inputdir)//'/land/soilph.hdf',rank2, &
  442. iglbsfc, i1, j1, soilph(:,:,n), status, field_name=name_soil(n) )
  443. IF_NOTOK_RETURN(status=1)
  444. end do
  445. if ( okdebug ) write(*,*) 'dd_get_soilph_lai: end'
  446. END SUBROUTINE DD_GET_SOILPH_LAI
  447. !
  448. !
  449. subroutine dd_get_surface_vegetation
  450. !-----------------------------------
  451. ! Purpose
  452. ! -------
  453. ! read ECMWF dataset for vegetation and landmask
  454. !
  455. !------------------------
  456. !
  457. ! routine to read fields that need to be initialised only once
  458. !
  459. use meteodata, only : nveg
  460. use meteodata, only : tv_dat, cvl_dat, cvh_dat
  461. use datetime, only : date2tau, tau2date
  462. !
  463. ! following parameters are directly from Table 7.1
  464. ! www.ecmwf.int/research/ifsdocs/Physics
  465. !
  466. ! cveg is fractional coverage given a certain type of vegetation present
  467. real,dimension(nveg),parameter :: cveg=&
  468. (/0.9, 0.85, 0.9, 0.9, 0.9, &
  469. 0.99, 0.7, 0. , 0.5, 0.9, &
  470. 0.1, 9., 0.6, 9.0, 9.0, &
  471. 0.5, 0.5, 0.9, 0.9, 0.6 /)
  472. !high_low: e.g. high are trees, low schrub
  473. character(len=1),dimension(nveg),parameter :: high_low=&
  474. (/'L','L','H','H','H', &
  475. 'H','L','O','L','L', &
  476. 'L','O','L','O','O', &
  477. 'L','L','H','H','O' /)
  478. !lai_veg assigned lai per type of vegetation. No seasonal cycle
  479. real,dimension(nveg),parameter :: lai_veg=&
  480. (/3.0, 2.0, 5.0, 5.0, 5.0, &
  481. 6.0, 2.0, 0.5, 1.0, 3.0, &
  482. 0.5,-9.0, 4.0,-9.0,-9.0, &
  483. 3.0, 1.5, 5.0, 2.5, 4.0 /)
  484. !evergreen is the vegetation seasonal or evergren
  485. integer,dimension(nveg),parameter :: evergreen =&
  486. (/0,0,1,0,1, &
  487. 0,0,0,0,0, &
  488. 0,0,0,0,0, &
  489. 1,0,0,0,0 /)
  490. character(len=30),dimension(nveg),parameter :: vegtype=(/&
  491. 'Crops and mixed farming ','Short grass ',&
  492. 'Evergreen needle leaf trees ','Deciduous needle leaf trees ',&
  493. 'Evergreen broadleaf trees ','Deciduous broad leaf trees ',&
  494. 'Tall grass ','Desert ',&
  495. 'Tundra ','Irrigated crops ',&
  496. 'Semidesert ','Ice caps and glaciers ',&
  497. 'Bogs and marshes ','Inland water ',&
  498. 'Ocean ','Evergreen shrubs ',&
  499. 'Deciduous shrubs ','Mixed forest/woodland ',&
  500. 'Interrupted forest ','Water and land mixtures '/)
  501. !
  502. ! --
  503. !
  504. integer,dimension(6) :: idater_acc,idater
  505. character(len=2),dimension(nveg),parameter:: tvname=&
  506. (/'01','02','03','04','05', &
  507. '06','07','08','09','10', &
  508. '11','12','13','14','15', &
  509. '16','17','18','19','20' /)
  510. integer :: i,j,nv,itaux
  511. ! ----------------- START
  512. !
  513. ! -- vgrat_low : fractional coverage of low vegetation
  514. ! -- vgrat_high : fractional coverage of high vegetation
  515. ! -- lai1 : lai derived following ECMWF,
  516. ! unfortunately there is no yearly cycle on this product
  517. ! -- fd Note:
  518. ! ewsmx : maximum field capacity could possibly be approximated
  519. ! with the root depth
  520. !
  521. ! ewsmx(:,:)=ewsmx(:,:)+cvl_sfc%data(:,:,1)*tv_sfc(nv)%data(:,:,1)/100.*
  522. ! root_depth(nv)/depth_tessel
  523. ! ewsmx(:,:)=ewsmx(:,:)+cvh_sfc%data(:,:,1)*tv_sfc(nv)%data(:,:,1)/100.*
  524. ! root_depth(nv)/depth_tessel
  525. ! Note that in the ECMWF model a constant value of 0.353 m3/m3 is used
  526. ! depth_tessel = 2.89 ! tessel soil model has four layers,
  527. ! the lowest of four ends at 2.89 m
  528. ! root depth is derived from ECMWF root distribution,
  529. ! and is used to calculate wilting point
  530. ! real,dimension(nveg),parameter :: root_depth=(/&
  531. ! 0.4017,0.3455,0.4223,0.4391,0.4521,0.5479,0.4401,0.0700,0.1850,0.4017,&
  532. ! 0.6737,0.0000,0.4912,0.0000,0.0000,0.5156,0.5156,0.5350,0.5350,0.0000/)
  533. ! -- fd not implemented
  534. vgrat_high = 0.0
  535. vgrat_low = 0.0
  536. lai1 = 0.0
  537. do nv = 1, 20
  538. if ( high_low(nv) == 'L' ) then
  539. vgrat_low = vgrat_low + cvl_dat(iglbsfc)%data(:,:,1) * tv_dat(iglbsfc,nv)%data(:,:,1)/100.0 * cveg(nv)
  540. lai1 = lai1 + cvl_dat(iglbsfc)%data(:,:,1) * tv_dat(iglbsfc,nv)%data(:,:,1)/100.0 * cveg(nv) * lai_veg(nv)
  541. end if
  542. if ( high_low(nv) == 'H' ) then
  543. vgrat_high = vgrat_high + cvh_dat(iglbsfc)%data(:,:,1) * tv_dat(iglbsfc,nv)%data(:,:,1)/100.0 * cveg(nv)
  544. lai1 = lai1 + cvh_dat(iglbsfc)%data(:,:,1) * tv_dat(iglbsfc,nv)%data(:,:,1)/100.0 * cveg(nv) * lai_veg(nv)
  545. end if
  546. end do !nv
  547. if ( okdebug ) then
  548. call dist_arr_stat(dgrid(iglbsfc), 'vgrat_low', vgrat_low , 0, status)
  549. IF_NOTOK_RETURN(status=1)
  550. call dist_arr_stat(dgrid(iglbsfc), 'vgrat_high', vgrat_high, 0, status)
  551. IF_NOTOK_RETURN(status=1)
  552. call dist_arr_stat(dgrid(iglbsfc), 'lai1', lai1 , 0, status)
  553. IF_NOTOK_RETURN(status=1)
  554. write(*,*) 'dd_get_surface_vegetation: end'
  555. end if
  556. end subroutine dd_get_surface_vegetation
  557. !--------------------------------
  558. !
  559. ! Purpose
  560. ! -------
  561. ! Calculate friction velocity (ustar), aerodynamic resistance (raero)
  562. ! and quasi laminar surface resistance (rb),
  563. !
  564. ! Method
  565. ! ------
  566. ! uses the log normal wind profile information stored by ECMWF
  567. ! in 10 meter wind
  568. ! to estimate a local ustar over land
  569. ! uses Charnock equation over sea to estimate ustar
  570. ! aerodynamic resistance is calculated from heat fluxes and ustar
  571. ! using a constant reference height
  572. ! sub laminar resistance from ustar
  573. !
  574. ! External
  575. ! --------
  576. ! dumpfield
  577. !
  578. ! Reference
  579. ! ----------
  580. ! Ge Verver (personal communication, 2003)
  581. !------------------------
  582. subroutine dd_calc_ustar_raero_rb
  583. use binas, only : grav, vKarman
  584. ! Href: constant reference height for calculations of raero
  585. real, parameter :: Href=30.
  586. ! some constants specific to calculation of ustar and raero
  587. real,parameter :: alfa_charnock1 = 0.11
  588. real,parameter :: rhoCp = 1231.0
  589. real,parameter :: rhoLv = 3013000.0
  590. real,parameter :: alfa_charnock2 = 0.018
  591. real,parameter :: v_charnock = 1.5e-5 !(m2/s)
  592. real,parameter :: rz0 = 2.0
  593. real,dimension(:,:),allocatable :: sr_mix
  594. integer :: i, j
  595. real :: buoy, tstv, obuk, ra, y0, yra
  596. real :: xland, sr_land, sr_help
  597. allocate(sr_mix(i1:i2, j1:j2))
  598. do j=j1,j2
  599. do i=i1,i2
  600. xland = lsmask_dat(iglbsfc)%data(i,j,1)/100.
  601. ! SEA:
  602. ! surface roughness from Charnock equation
  603. ! friction velocity from surface stress
  604. !
  605. if(xland < 0.99) then
  606. ustar_sea(i,j)=sqrt(sstr(i,j))
  607. sr_sea(i,j)=alfa_charnock1*v_charnock/ustar_sea(i,j) + &
  608. alfa_charnock2*sstr(i,j)/grav
  609. else
  610. ustar_sea(i,j)=0.0
  611. sr_sea(i,j)=0.0
  612. endif
  613. !
  614. ! LAND
  615. ! calculate the 'local' surface roughness for momentum that
  616. ! is consistent with 10 m wind and the Olsson data base,
  617. ! we assume that the windspeed at 75 m is independent of
  618. ! surface roughness
  619. !
  620. if ( xland > 0. ) then
  621. !>>> TvN
  622. ! Over land, the friction velocity ustar
  623. ! is calculated from the 10 m wind speed, u10.
  624. ! In IFS u10 is a diagnostic variable, calculated to be
  625. ! compatible with "open-terrain" wind speed observations.
  626. ! Over rough or inhomogeneous terrain (z0M > 0.03 m),
  627. ! it is calculated using an aerodynamic roughness
  628. ! length typical for open terrain with grassland (0.03 m)
  629. ! (see IFS cy31r1 documentation, p. 46).
  630. ! In the expressions applied in TM5,
  631. ! the stability profile functions Psi_M have disappeared,
  632. ! and only the logarithmic terms are kept.
  633. ! Apart from this, the expression for ustar was incorrect:
  634. ! 10./sr_land should be 75./sr_land.
  635. ! This has now been corrected.
  636. ! Moreover, over islands and near coast lines,
  637. ! zeros can occur in sr_ols_dat,
  638. ! which have to be removed.
  639. ! However, a lower bound of 1e-2 m = 1 cm
  640. ! seems too high for smooth surfaces,
  641. ! like deserts and ice caps.
  642. ! The minimum positive value in sr_ols_dat
  643. ! is 2.5e-4 m = 0.025 cm,
  644. ! which is obtained in parts of Antarctica.
  645. ! This is likely the result of regridding of
  646. ! a field with minimum value of 0.1 cm
  647. ! from 0.5x0.5 to 1x1 degrees.
  648. ! Please note that with the introduction of CY31R1,
  649. ! the orographic contribution to the aerodynamic roughness length
  650. ! in IFS has been replaced by an explicit specification of stress
  651. ! on model levels due to turbulent orographic form drag,
  652. ! and the climatological variable previously used
  653. ! has been replaced by a prognostic variable.
  654. ! In TM5, the climatological variable is still used,
  655. ! but it would be better to use the prognostic variable instead.
  656. ! Note also that the same calculation
  657. ! is done in diffustion.F90.
  658. !sr_land=max(1e-2,sr_ols_dat(iglbsfc)%data(i,j,1)) ! occurs at Islands, etc.
  659. sr_land=max(1e-3,sr_ols_dat(iglbsfc)%data(i,j,1))
  660. sr_help=min(sr_ecm_dat(iglbsfc)%data(i,j,1),0.03)
  661. !fd ustar_land=vKarman*wind10m(i,j)/alog(10./sr_help)
  662. ! !ustar consistent with 'clipped' large scale roughness
  663. !ustar_land(i,j)=vKarman*wind10m(i,j)/alog(10./sr_help)*&
  664. ! alog(75./sr_help)/alog(10./sr_land)
  665. ustar_land(i,j)=vKarman*wind10m(i,j)/alog(10./sr_help)*&
  666. alog(75./sr_help)/alog(75./sr_land)
  667. ! <<< TvN
  668. else
  669. ustar_land(i,j)=0.0
  670. sr_land=0.
  671. endif
  672. ustar_loc(i,j)=xland*ustar_land(i,j)+(1-xland)*ustar_sea(i,j)
  673. sr_mix(i,j) =xland*sr_land +(1-xland)*sr_sea(i,j)
  674. end do !i
  675. end do !j
  676. !
  677. ! Calculation of quasi laminar resistance of the layer above the surface.
  678. ! E.g. Walcek, Atmos. Environ, 20, pp. 949-964, 1986, and earlier refs.
  679. !
  680. do j=j1,j2
  681. do i=i1,i2
  682. !>>> TvN
  683. ! Instead of the current approach,
  684. ! it is proposed to use the surface roughness length
  685. ! for heat directly as it is calculated prognostically
  686. ! in IFS (GRIB number 245).
  687. !<<< TvN
  688. rb(i,j)=(rz0/(ustar_loc(i,j)*vkarman))
  689. end do
  690. end do
  691. !
  692. ! calculate the aerodynamic resistance
  693. !
  694. ! ra,the aerodynamic resistence in s/m over a layer with height z is
  695. ! the integral from z0 to z of 1/K(z) dz with K(z)=k.u*.z/phi(h)
  696. ! phi(h)=0.74(1-9z/l)**-0.5 for l<0 and 0.74+4.7(z/l) for l>0.
  697. ! by integration we get ra=0.74/(k.u*).(ln(z0/z)+ghi(z0)-ghi(z))
  698. ! ghi(z)=-6.4(z/l) for l>0 and 2.ln(y(z)+1) for l<0 with
  699. ! y(z)=(1-9.z/l)**0.5.
  700. do j=j1,j2
  701. do i=i1,i2
  702. buoy = -sshf_dat(iglbsfc)%data(i,j,1) / rhoCp &
  703. -0.61 * t2m_dat(iglbsfc)%data(i,j,1) * slhf_dat(iglbsfc)%data(i,j,1)/rhoLv
  704. tstv=-buoy/ustar_loc(i,j)
  705. obuk=1e-6
  706. if( abs(tstv) .gt. tiny(tstv) ) then
  707. obuk = ustar_loc(i,j)*ustar_loc(i,j)*t2m_dat(iglbsfc)%data(i,j,1)/(tstv*grav*vKarman)
  708. end if
  709. if( obuk > 0. ) then ! stable conditions
  710. ra = 0.74*( alog(Href/sr_mix(i,j)) + 6.4*(Href-sr_mix(i,j))/obuk )&
  711. / (vKarman*ustar_loc(i,j))
  712. else ! unstable
  713. y0 = sqrt(1.-9.*sr_mix(i,j)/obuk)+1.
  714. yra = sqrt(1.-9.*Href/obuk)+1.
  715. ra = 0.74*(alog(Href/sr_mix(i,j))+2.*(alog(y0)-alog(yra)))/ &
  716. (vKarman*ustar_loc(i,j))
  717. end if
  718. raero(i,j)=max(10.,min(ra,1e10)) !
  719. end do !i
  720. end do !j
  721. if ( okdebug ) then
  722. call dist_arr_stat(dgrid(iglbsfc), 'ustar_loc', ustar_loc, 0, status )
  723. IF_NOTOK_RETURN(status=1)
  724. call dist_arr_stat(dgrid(iglbsfc), 'raero', raero , 0, status )
  725. IF_NOTOK_RETURN(status=1)
  726. call dist_arr_stat(dgrid(iglbsfc), 'rb', rb , 0, status )
  727. IF_NOTOK_RETURN(status=1)
  728. write(*,*) 'end calc_aero_ustar'
  729. end if
  730. deallocate(sr_mix)
  731. end subroutine dd_calc_ustar_raero_rb
  732. !
  733. !
  734. subroutine dd_calc_rstom_rahcan
  735. ! -----------------------------
  736. ! Purpose
  737. ! ---------
  738. ! Calculate water vapour stomatal resistance from the PAR
  739. ! (Photosythetically Active Radiation) which is 0.55 times
  740. ! the net short wave radiation (ssr) at the surface.
  741. ! Calculate rahcan from ustar and lai
  742. !
  743. ! External
  744. ! --------
  745. ! none
  746. !
  747. ! Reference
  748. ! ----------
  749. ! none
  750. !--------------------------------------------------
  751. !
  752. ! -- constants used for the calculation of the stomatal resistance
  753. ! (see ECHAM3 manual)
  754. implicit none
  755. real,parameter :: a=5000.
  756. real,parameter :: b=10.
  757. real,parameter :: c=100.
  758. real,parameter :: vk=0.9
  759. real,parameter :: vlt=1.
  760. !
  761. real, parameter :: foresth=20.
  762. integer :: j, i
  763. real :: vpar, d
  764. real :: canht,laihelp
  765. !
  766. ! -- recalculated rstom for a LAI of 1 (see ECHAM3 manual)
  767. !
  768. do j=j1,j2
  769. do i=i1,i2
  770. !
  771. ! -- calculation of PAR from net short wave radiation
  772. ! -- radiation is corrected for daily cycle
  773. !
  774. rstom(i,j)=1e10 !high resistance during the night
  775. if (ssr_dat(iglbsfc)%data(i,j,1) > 0.) then
  776. vpar=max(1.,0.55*ssr_dat(iglbsfc)%data(i,j,1))
  777. d=(a+b*c)/(c*vpar)
  778. rstom(i,j)=(vk*c)/((b/(d*vpar))*alog((d*exp(vk*vlt)+1.)/(d+1.))-&
  779. alog((d+exp(-vk*vlt))/(d+1.)))
  780. end if !ssr > 0.
  781. end do !i
  782. end do !j
  783. !
  784. ! -- computation of in-canopy aerodynamic resistance from canopy height
  785. ! and the friction velocity and the Leaf Area Index
  786. ! (see Erisman & Van Pul)
  787. !
  788. do j=j1,j2
  789. do i=i1,i2
  790. !
  791. !
  792. ! -- calculation of canopy height CANHT from effective fraction
  793. ! of high vegetation assuming that forest has a canopy height
  794. ! of 20 m (other vegetation 0 m)
  795. !
  796. canht= vgrat_high(i,j)*foresth
  797. ! laihelp: the maximum values derived from ECMWF are more realistic
  798. laihelp=min(lai1(i,j),lai(i,j))
  799. rahcan(i,j)=max(1.e-5,14.*laihelp*canht/ustar_loc(i,j))
  800. end do !j
  801. end do !i
  802. !cmk if ( okdebug ) &
  803. !cmk call dumpfield(0,'rahcan'//c_time//'.hdf',rahcan,'rahcan')
  804. !cmk if ( okdebug ) call dumpfield(0,'rstom'//c_time//'.hdf',rstom,'rstom')
  805. if ( okdebug ) write(*,*) 'dd_calc_rstom_rahcan: end'
  806. !
  807. end subroutine dd_calc_rstom_rahcan
  808. !
  809. !
  810. subroutine dd_calc_inisurf
  811. ! ------------------------
  812. ! Purpose
  813. !---------
  814. ! Calculate some surface fields later needed in the calculation
  815. !
  816. ! External
  817. ! --------
  818. ! none
  819. !
  820. ! Reference
  821. ! ----------
  822. ! none
  823. !--------------------------------------------------
  824. use Binas, only: pi
  825. implicit none
  826. real,parameter :: sncr = 0.015 ! critical snow cover depth
  827. real,parameter :: tstar = 273.
  828. real,parameter :: wlmax = 2.e-4
  829. real,parameter :: ewsmx = 0.323
  830. real,parameter :: ewsmx_sat= 0.472
  831. real,parameter :: wpwp = 0.171
  832. !FD23012004
  833. real,parameter :: eff=0.5 ! parameters needed for sea/bubble formation
  834. real,parameter :: rdrop=0.005 ! cm
  835. real,parameter :: zdrop=10.0 ! cm
  836. real,parameter :: eps=0.6 ! parameter related to bubble formation
  837. real :: qdrop,s,phi,alpha1,vk1,vk2,alpharat ! auxiliary parameters for bubble formation
  838. real :: sr_help ! surface roughnes consistent with 10 m wind.
  839. !FD23012004
  840. !
  841. ! for albedo calculations
  842. real :: snow, freesea, bare, desert
  843. real :: e,es,wcr,wlmx,xland,ahelp,vgr,laihelp
  844. integer :: i,j ! auxiliary variables
  845. ! --- begin ---------------------------------------
  846. do j=j1,j2
  847. do i=i1,i2
  848. xland = lsmask_dat(iglbsfc)%data(i,j,1)/100.0 ! land-sea fraction directly from ECMWF
  849. ! the maximum values derived from ECMWF are more realistic
  850. laihelp=min(lai1(i,j),lai(i,j))
  851. !
  852. ! -- calculation of monthly snow cover fraction sd using
  853. ! constant critical snow depth
  854. ! alternatively this critical snow depth may be chosen as
  855. ! a linear function of ln(sr_ecm)
  856. ! B. v.d. Hurk (2002) suggests 0.015 m (=sncr) for z0<0.25
  857. ! and 1 m for z0>5m and log-linear in between in between.
  858. ! factor 0.9 is introduced to account for the fact that
  859. ! it is unlikely
  860. ! that 'high' vegetation is completely snow covered
  861. !
  862. ! FD25.03.2003
  863. snow_cover(i,j)=min(xland,sd_dat(iglbsfc)%data(i,j,1)/sncr)
  864. !
  865. ! -- calculation of wet skin fraction from the skin reservoir
  866. ! content src (prognostic variable in ECMWF)
  867. ! the vegetation fractions and their attributed LAI,
  868. ! Wlmax which is the maximum amount of water that can be held
  869. ! on one layer of leaves or bare ground, Wlmx is the
  870. ! maximum skin reservoir content
  871. !
  872. if ( xland > 0.0 ) then
  873. ! bare soil fraction small discrepancy when lakes are present
  874. bare=max(0.,1.-vgrat_high(i,j)-vgrat_low(i,j))
  875. wlmx=wlmax*(bare+laihelp)
  876. wet_skin(i,j)=min(1.,src_dat(iglbsfc)%data(i,j,1)/wlmx)
  877. else
  878. wet_skin(i,j)=1.0 !for sea CMK bug 01-07-2003
  879. end if
  880. !
  881. ! -- calculation of water stress factor FWS with Wsmx is the
  882. ! field capacity.
  883. !
  884. ! Field capacity is defined as the maximum amount of water
  885. ! that an column of soil can hold
  886. ! against gravity 24-48 hours after wetting of the soil
  887. ! Wcr is a critical value, Wpwp is the permanent wilting point
  888. ! and Ws is the total amount of water available in the
  889. ! root zone (ECHAM3 manual)
  890. !
  891. fws(i,j)=1e-5
  892. if (xland > 0) then
  893. wcr=0.5*ewsmx_sat
  894. ! used ewsmx_sat instead of ewsmx, is more consistent
  895. ! with values of swvl1
  896. if ( swvl1_dat(iglbsfc)%data(i,j,1) > wpwp &
  897. .and. swvl1_dat(iglbsfc)%data(i,j,1) < wcr ) &
  898. fws(i,j)=(swvl1_dat(iglbsfc)%data(i,j,1)-wpwp)/(wcr-wpwp)
  899. if ( swvl1_dat(iglbsfc)%data(i,j,1) > wcr ) fws(i,j)=1.
  900. end if
  901. !
  902. ! -- Computation of relative humidity (2 m) out of the air and dew
  903. ! temperature at 2 m which is used
  904. !
  905. es=exp(19.59*(t2m_dat(iglbsfc)%data(i,j,1)-tstar)/t2m_dat(iglbsfc)%data(i,j,1))
  906. e=exp(19.59*(1.-tstar/d2m_dat(iglbsfc)%data(i,j,1)))
  907. rh2m(i,j)=e/es
  908. !
  909. !-- Calculation of H2 deposition over arable field
  910. ! Sanderson et al., J. Atmos. Chem. 2000
  911. ! Yonemura et al., JGR 2000
  912. ! units: m/sec
  913. !
  914. ddepvel_h2(i,j) = min(10.e-4, max(1.e-7,(-41.39 * swvl1_dat(iglbsfc)%data(i,j,1) + 16.85) *1e-4))
  915. !
  916. ! calculate albedo (needed for photolysis rates) from
  917. ! different fractions
  918. !
  919. ! vgr: coverage by low and high vegetation
  920. vgr= vgrat_low(i,j)+vgrat_high(i,j)
  921. !
  922. ! -- if high vegetation is present and snow this may alter
  923. ! the effective snow albedo: let high vegetation prevail
  924. snow = snow_cover(i,j)- max(0.0,snow_cover(i,j)+vgrat_high(i,j)-1.0)
  925. bare = max(0.,1.0 - vgr - snow)
  926. ! soils with pH values larger than 7.3
  927. desert = soilph(i,j,3) + soilph(i,j,4)
  928. ! when more desert is present than bare land...
  929. desert = desert - max(0.0,desert-bare)
  930. bare = bare -desert
  931. freesea = max(0.,1.-xland-ci_dat(iglbsfc)%data(i,j,1))
  932. !
  933. #ifndef without_photolysis
  934. !AJS: uv-vis albedo computed from land use;
  935. !AJS: in future, ecmwf field should be used:
  936. !AJS: name : UV visible albedo for direct radiation
  937. !AJS: abbrev : ALUVP ; unit : 0-1
  938. !AJS: code : 15 ; table : 128
  939. ags(i,j) = freesea*0.05 + ci_dat(iglbsfc)%data(i,j,1)*0.70 + &
  940. xland*(desert*0.10+bare*0.05+vgr*0.01+snow*0.70)
  941. ! AS: make sure that it does not exceed 0.7 in cases where
  942. ! sea ice and lsmask are not fully consistent
  943. ags(i,j) = min(0.7,ags(i,j))
  944. #endif
  945. if (freesea>0.01) then !
  946. ! bubble bursting effect,see Hummelshoj, equation 10
  947. ! relationship by Wu (1988), note that Hummelshoj has not
  948. ! considered the cunningham factor which yields a different
  949. ! vb curve, with smaller values for small particles
  950. ! according to LG indeed 10 m windspeed (instead of 1 m windspeed in use in ECHAM5
  951. alpha(i,j)=MIN(1.0,MAX(1.e-10,1.7e-6*wind10m(i,j)**3.75)) ! set maximum!
  952. qdrop=5.*(100.*alpha(i,j)) ! 100 is the flux of bubbles per cm^2/s (see Monohan(1988))
  953. bubble(i,j)=((100.*ustar_sea(i,j))**2.)/(100.*wind10m(i,j)) + &
  954. eff*(2.*pi*rdrop**2.)*(2.*zdrop)*(qdrop/alpha(i,j))
  955. !--- Correction of particle radius for particle growth close to the
  956. ! surface according to Fitzgerald, 1975, the relative humidity over
  957. ! the ocean is restricted to 98% (0.98) due to the salinity
  958. s=MIN(0.98,rh2m(i,j))
  959. !fd23012004 beta(i,j)=EXP((0.00077*s)/(1.009-s)) THIS term was present in ECHAM code !
  960. !; max. value reached for this parameter is 1.04 and is ignored here.
  961. phi=1.058-((0.0155*(s-0.97))/(1.02-s**1.4))
  962. alpha1=1.2*EXP((0.066*s)/(phi-s))
  963. vk1=10.2-23.7*s+14.5*s**2.
  964. vk2=-6.7+15.5*s-9.2*s**2.
  965. alpharat=1.-vk1*(1.-eps)-vk2*(1.-eps**2)
  966. alphae(i,j)=alpharat*alpha1
  967. !--- Over land no correction for large humidity close to the surface:
  968. else ! land surface
  969. alpha(i,j)=0.
  970. bubble(i,j)=0.
  971. alphae(i,j)=1.
  972. endif
  973. end do
  974. end do
  975. if ( okdebug ) write(*,*) 'after dd_cal_inisurf'
  976. end subroutine dd_calc_inisurf
  977. !--------------------
  978. !
  979. ! This subroutine calculates the surface resistance as
  980. ! a function of a series of resistances
  981. !
  982. ! purpose
  983. ! -------
  984. ! determine surface resistance "rsurf" for dry deposition
  985. ! calculations
  986. !
  987. ! external
  988. ! --------
  989. !
  990. ! reference
  991. ! ---------
  992. ! Ganzeveld and Lelieveld (1996) and references therein
  993. !
  994. !------------------------------------------------------------------
  995. !
  996. ! -- resistances and auxiliary variables
  997. !
  998. !------------------------------------------------------------------
  999. subroutine dd_calc_rs
  1000. use binas , only : vKarman, pi
  1001. use chem_param, only : density_ref
  1002. use chem_param, only : ndep, idep
  1003. use chem_param, only : ddep_diffrb, ddep_rsoil, ddep_rwat, ddep_rws
  1004. use chem_param, only : ddep_rsnow , ddep_rmes , ddep_rcut, ddep_diffcf
  1005. use chem_param, only : diffcf_o3
  1006. use chem_param, only : iso2, iso4, inh3, ihno3, ino, ino2, io3, ico
  1007. use chem_param, only : nrdep, lur
  1008. use toolbox , only : coarsen_emission
  1009. use ParTools, only : isRoot
  1010. integer,parameter :: avg_field = 1
  1011. real, parameter :: dynvisc=1.789e-4*2. ! g cm-1 s-1 CHECKED FD OK, there is temp. dependence Perry p. 3-248.
  1012. ! unit is g cm-1 s+1 FD
  1013. ! checked with Seinfeld---> factor 2. came out (diameter ? radius)
  1014. real, parameter :: cl=0.066*1e-4 ! mean free path [cm] (particle size also in cm)
  1015. real, parameter :: bc= 1.38e-16 ! boltzman constant [g cm-2 s-1 K-1] (1.38e-23 J deg-1) =>binas
  1016. real, parameter :: kappa=1. ! shapefactor
  1017. real, parameter :: visc=0.15 ! KINEMATIC molecular viscocity [cm2 s-1]
  1018. ! this is also function of temperature FD
  1019. real :: xland1,xland2,xland3,xland4
  1020. real :: xwat1,xwat2,xsum
  1021. real :: rstomx,rsveg,ra1
  1022. real :: vdland1,vdland2,vdland3,vdland4
  1023. real :: rssoil,rsws,vdwat1,vdwat2
  1024. real :: rssnow,rveg,rleaf,rcanopy
  1025. real :: w10,zrsnhno3,ustarh
  1026. real :: cvsh,cvwh,evgrath,tsoilph
  1027. real :: xland,ts1,laihelp
  1028. real,dimension(:,:), allocatable :: rwatso4
  1029. real,dimension(:,:), allocatable :: rsoilnh3,rsoilso2,rsoilso4
  1030. real,dimension(:,:), allocatable :: rsnowhno3,rsnowso2
  1031. !
  1032. integer :: jt,j,i,jdep, irdep
  1033. character(len=8) :: adum
  1034. real :: zr, vd_land, vd_sea, um, dc, cunning, relax, ust_land, st_land
  1035. real :: sc, vb_land, vi_land, ust_sea, st_sea, re
  1036. real :: vbsea, visea, vkdaccsea, vkd_sea, vkd_land
  1037. real :: densaer
  1038. real, allocatable :: curr_diffrb(:), curr_rsoil(:), curr_rwat(:), curr_rws(:)
  1039. real, allocatable :: curr_rsnow (:), curr_rmes(:) , curr_rcut(:), curr_diffcf(:)
  1040. ! Openmp parameters
  1041. integer :: js, je
  1042. ! --- begin ---------------------------
  1043. !
  1044. ! *** deposition
  1045. !
  1046. if ( ndep > 0 ) then
  1047. allocate(rwatso4 (i1:i2, j1:j2))
  1048. allocate(rsoilnh3 (i1:i2, j1:j2))
  1049. allocate(rsoilso2 (i1:i2, j1:j2))
  1050. allocate(rsoilso4 (i1:i2, j1:j2))
  1051. allocate(rsnowhno3(i1:i2, j1:j2))
  1052. allocate(rsnowso2 (i1:i2, j1:j2))
  1053. allocate( curr_diffrb(ndep) )
  1054. allocate( curr_rsoil (ndep) )
  1055. allocate( curr_rwat (ndep) )
  1056. allocate( curr_rws (ndep) )
  1057. allocate( curr_rsnow (ndep) )
  1058. allocate( curr_rmes (ndep) )
  1059. allocate( curr_rcut (ndep) )
  1060. allocate( curr_diffcf(ndep) )
  1061. !
  1062. ! -- extension with the Wesely scheme, 1989
  1063. ! (Atmospheric Environ.,1989)
  1064. ! in which the resistances of trace gases are estimated from
  1065. ! the reactivity relative to
  1066. ! ozone and the dissolvation relativeto SO2. The deposition process of
  1067. ! these two trace is used as a reference for the estimation.
  1068. !
  1069. ! calculate some tracer specific resistances
  1070. !
  1071. curr_diffrb = ddep_diffrb
  1072. curr_rsoil = ddep_rsoil
  1073. curr_rwat = ddep_rwat
  1074. curr_rws = ddep_rws
  1075. curr_rsnow = ddep_rsnow
  1076. curr_rmes = ddep_rmes
  1077. curr_rcut = ddep_rcut
  1078. curr_diffcf = ddep_diffcf
  1079. !
  1080. do j=j1,j2
  1081. do i=i1,i2
  1082. ustarh=ustar_loc(i,j)
  1083. ! -- calculation of the integrated resistance from the mass size
  1084. ! distribution for rural continental aerosol with an unimodal distr.
  1085. ! with the mean mass radius at about 0.4 um.
  1086. ! (observations by Mehlmann (1986)
  1087. ! as referenced in Warneck, 1988) and the friction velocity.
  1088. ! Polynominal fit!
  1089. ! Over land the surface resistance of bare soil and snow
  1090. ! covered surfaces is calculated
  1091. !
  1092. ! -- following distributions are used:
  1093. ! 1. deposition over land using a rural continental size distribution
  1094. ! i.e. mostly accumulation range aerosol
  1095. ! 2. deposition over water using a marine size distribution
  1096. ! i.e. bimodal distribution with a 30% coarse fraction
  1097. ! fjd this is most relevant when explicit chemistry in seasalt
  1098. ! is considered
  1099. ! 3. deposition over water using rural continental size distribution
  1100. ! the deposition of 'seasalt' sulfate may be calculated using
  1101. ! the relation vd2=0.7*vd1+0.3*vdsssulfate
  1102. !
  1103. ! 1st distribution:
  1104. rsoilso4(i,j) = max( 1., &
  1105. 100./(0.08-0.57*ustarh+1.66*ustarh**2-0.36*ustarh**3) )
  1106. ! 2nd distribution:
  1107. ! rwatso4(i,j) =
  1108. ! max(1.,100./(0.12-0.24*ustarh+5.25*ustarh**2 -1.84*ustarh**3))
  1109. ! 3rd distribution:
  1110. rwatso4(i,j) = max( 1., &
  1111. 100./(0.07-0.1*ustarh+2.1*ustarh**2 -0.20*ustarh**3) )
  1112. !
  1113. ! -- parameterization of snow/ice SO2 resistance as a function of the
  1114. ! snow/ice temperature, based on observations by Dasch and Cadle
  1115. !
  1116. ts1=max(200.,t2m_dat(iglbsfc)%data(i,j,1))
  1117. !
  1118. ! FD25032003 the measurements are not completely consistent;
  1119. ! put a lower
  1120. ! limit of vd=0.10 cm/s for SO2 to avoid excessive accumulation
  1121. ! if snow is melting high uptake
  1122. !
  1123. rsnowso2(i,j)=amin1(max(10.,10.**(-0.09*(ts1-273.)+2.4)),1.e+3)
  1124. ! snow is melting changed (advise Wouter Greull) FD072003
  1125. if ( ts1 > (273.+3.) .and. sshf_dat(iglbsfc)%data(i,j,1) > 10. ) rsnowso2(i,j)=50.
  1126. !
  1127. ! arbitrary attribution of soil resistance to NH3 deposition
  1128. ! acid soils have lowest deposition
  1129. !
  1130. tsoilph=sum(soilph(i,j,1:5))
  1131. rsoilnh3(i,j)=1e10
  1132. if (tsoilph > 0.) &
  1133. rsoilnh3(i,j)= max(25.,soilph(i,j,1)*25. +soilph(i,j,2)*25.&
  1134. +soilph(i,j,3)*200.+soilph(i,j,4)*200.+soilph(i,j,5)*100.)
  1135. !
  1136. ! -- Computation of rsoil for SO2 from soil pH three different
  1137. ! rh classes
  1138. ! The rsoil values for each class are determined out of
  1139. ! regression and the average value of pH of the class.
  1140. ! Concerning rh, a wet, dry and very dry class
  1141. ! is discerned with the threshold value of 60% and 40%
  1142. !
  1143. rsoilso2(i,j)=1e10
  1144. !
  1145. ! -- for rh > 60 %
  1146. !
  1147. if ( tsoilph > 0. ) rsoilso2(i,j)=max(25.,(soilph(i,j,1)*115.+&
  1148. soilph(i,j,2)*65+soilph(i,j,3)*25.+ &
  1149. soilph(i,j,4)*25.+soilph(i,j,5)*70.)/tsoilph+&
  1150. amin1(max(0.,1000.*exp(269.-ts1)),1.e+5))
  1151. ! -- for rh less than 60% and larger than 40 %
  1152. if ( rh2m(i,j) < 0.6 .and. rh2m(i,j) > 0.4) &
  1153. !cmk rsoilso2(i,j)=max(50.,(rsoilso2(i,j)*3.41-85.)+
  1154. !cmk amin1(max(0.,1000.*exp(269.-ts1)),1.e+5))
  1155. rsoilso2(i,j)=max(50.,rsoilso2(i,j)*3.41-85.)+ &
  1156. amin1(max(0.,1000.*exp(269.-ts1)),1.e+5)
  1157. ! -- for rh less than 40 %
  1158. if (rh2m(i,j).le.0.4) &
  1159. !cmk rsoilso2(i,j)=max(50.,amin1(1000.,(rsoilso2(i,j)*3.41-&
  1160. !cmk 85.+((0.4-rh2m(i,j))/0.4)*1.e+5)+&
  1161. rsoilso2(i,j)=max(50.,amin1(1000.,(rsoilso2(i,j)*3.41-85.+ &
  1162. ((0.4-rh2m(i,j))/0.4)*1.e+3)+&
  1163. ! 1e3, see paper Laurens, JGR
  1164. amin1(max(0.,1000.*exp(269.-ts1)),1.e+5)))
  1165. ! -- Temperature correction term for HNO3 above snow surface and ice
  1166. ! (Wesely, 1989), recomputation from K to 0C
  1167. rsnowhno3(i,j)=amin1(max(10.,1000.*exp(269.-ts1)),1.e+5)
  1168. ! snow is melting changed (advise Wouter Greull) FD072003
  1169. if ( ts1 > (273.+3.) .and. sshf_dat(iglbsfc)%data(i,j,1) > 10. ) rsnowhno3(i,j)=50.
  1170. !
  1171. !
  1172. end do !nlon
  1173. end do !nlat
  1174. !
  1175. ! ***
  1176. !
  1177. vd11(:,:,:) = 1e-10
  1178. !CMK rsurf(:,:,:)=1e+5
  1179. !
  1180. ! -- Loop for tracers, all timesteps
  1181. !
  1182. do jdep=1,ndep
  1183. jt = idep(jdep)
  1184. !
  1185. ! -- Only if a value for DIFFCF (diffusivity) is defined, the program
  1186. ! calculates a surface resistance
  1187. !
  1188. if ( curr_diffcf(jdep) > 1e-5 ) then
  1189. !
  1190. do j=j1,j2
  1191. do i=i1,i2
  1192. xland = lsmask_dat(iglbsfc)%data(i,j,1)/100.0
  1193. ! laihelp: the max values derived from ECMWF are more realistic
  1194. laihelp=min(lai(i,j),lai1(i,j))
  1195. ! -- Assigning of values calculated in previous routine
  1196. ! rsnow/rsoil of other components in data statement
  1197. if (jt == iso2) then
  1198. curr_rsnow(jdep)=rsnowso2(i,j)
  1199. curr_rsoil(jdep)=rsoilso2(i,j)
  1200. end if
  1201. if (jt == inh3) curr_rsoil(jdep)=rsoilnh3(i,j)
  1202. if (jt == iso4) then
  1203. ! set snow resistance of so4 equal to soil resistance
  1204. curr_rsnow(jdep)=rsoilso4(i,j)
  1205. curr_rsoil(jdep)=rsoilso4(i,j)
  1206. curr_rwat(jdep)=rwatso4(i,j)
  1207. end if
  1208. !
  1209. if (jt == ihno3) curr_rsnow(jdep)=rsnowhno3(i,j)
  1210. ! -- Computation of stomatal resistance for component X,
  1211. ! correction based on differences in molecular
  1212. ! diffusion of H2O and X and the water
  1213. ! stress is also considered, FWS
  1214. rstomx=curr_diffcf(jdep)*rstom(i,j)/fws(i,j)
  1215. ! -- Calculation of mesophyll resistance of NO
  1216. ! and NO2 as function of
  1217. ! the stomatal resistance of ozone
  1218. if (jt == ino ) curr_rmes(jdep)= 5.*diffcf_o3*rstom(i,j)/fws(i,j)
  1219. if (jt == ino2) curr_rmes(jdep)=0.5*diffcf_o3*rstom(i,j)/fws(i,j)
  1220. rleaf=(1./((1./curr_rcut(jdep))+(1./(rstomx+curr_rmes(jdep)))))
  1221. ! linear upscaling from leaf scale to canopy scale
  1222. ! applying the LAI derived from Olson
  1223. rcanopy=rleaf/max(1e-5,laihelp)
  1224. rveg=(1./((1./(rahcan(i,j)+rb(i,j)*curr_diffrb(jdep)+curr_rsoil(jdep)))+ &
  1225. (1./rcanopy)))
  1226. ! -- Exception for CO: Use Sanderson et al. parameterization
  1227. ! CO dry dep. scaled from H2 dry dep., using soil wetness.
  1228. ! Note: This soil resistance is critical one, so one may
  1229. ! neglect other terms (cuticle, boundary layer, ...)
  1230. if (jt == ico) rveg = 1./(ddepvel_h2(i,j) * 0.6 )
  1231. !-- It can be assumed that HNO3 deposition only depends on ra
  1232. ! so that surface resistance = 0, however definition of
  1233. ! minimal surface resistance in order to avoid
  1234. ! extreme Vd values.
  1235. if (jt == ihno3) rveg=1.
  1236. !-- Computation of surface resistance Rs (s m-1) above land
  1237. ! Vd for surface with vegetation and already incorporated
  1238. ! is the vegetation boudanry layer resistance
  1239. rsveg=rveg+rb(i,j)*curr_diffrb(jdep)
  1240. !-- Sulfate deposition calculation over vegetation according
  1241. ! to the observations by Wesely (1985),
  1242. ! see the Dry Deposition Inferential Model
  1243. if (jt == iso4) then
  1244. !
  1245. ! fd removed the factor stheta
  1246. ! (standard deviation of the wind direction)
  1247. if ( ssr_dat(iglbsfc)%data(i,j,1) > 250 ) then
  1248. rsveg=1./(0.01*ustar_loc(i,j))
  1249. else
  1250. rsveg=1./(0.002*ustar_loc(i,j))
  1251. end if
  1252. !
  1253. ! -- for particle deposition the rb is already
  1254. ! implicitly included
  1255. rssoil=curr_rsoil(jdep)
  1256. !
  1257. ! assumed that the wet skin fraction consists of vegetation
  1258. !
  1259. rsws=rsveg
  1260. rssnow=curr_rsnow(jdep)
  1261. !
  1262. else !jt neq iso4
  1263. !
  1264. !-- Rs for surface with bare soil
  1265. !
  1266. rssoil=curr_rsoil(jdep)+rb(i,j)*curr_diffrb(jdep)
  1267. !
  1268. !-- Wet skin fraction,
  1269. ! It is assumed that the wet skin fraction
  1270. ! mainly consists of vegetation thus laminar
  1271. ! resistance for vegetation may be applied
  1272. !
  1273. rsws=curr_rws(jdep)+rb(i,j)*curr_diffrb(jdep)
  1274. !
  1275. !-- Snow coverage
  1276. !
  1277. rssnow=curr_rsnow(jdep)+rb(i,j)*curr_diffrb(jdep)
  1278. !
  1279. end if
  1280. !
  1281. !-- land surface deposition velocity
  1282. !
  1283. cvsh=snow_cover(i,j) - &
  1284. max(0.0,snow_cover(i,j)+vgrat_high(i,j)-1.0)
  1285. ! fd same assumption as photolysis
  1286. !cmk: need to correct the rsoil resistance here.
  1287. ! fraction will become bare soil, which in the
  1288. ! vegetation deposition calculation
  1289. ! will result in a too low resistance,
  1290. ! since the 'soil' part will be snow covered!
  1291. cvwh=min(xland,wet_skin(i,j) )
  1292. evgrath=min(xland,vgrat_low(i,j)+vgrat_high(i,j))
  1293. ra1=raero(i,j)
  1294. ! snow covered land fraction
  1295. xland1=cvsh
  1296. vdland1=1./(rssnow+ra1)
  1297. ! wet skin covered land fraction (not covered by snow)
  1298. xland2=max(0.,cvwh-xland1)
  1299. vdland2=1./(rsws+ra1)
  1300. ! vegetation covered land fraction
  1301. ! (not covered by snow and wet skin)
  1302. xland3=max(0.,evgrath-xland1-xland2)
  1303. vdland3=1./(rsveg+ra1)
  1304. ! bare soil covered land fraction
  1305. ! (landfraction not covered by snow, wet skin, or vegetation)
  1306. xland4=max(0.,xland-xland1-xland2-xland3)
  1307. vdland4=1./(rssoil+ra1)
  1308. xwat1=min(1-xland,ci_dat(iglbsfc)%data(i,j,1))
  1309. vdwat1=1./(curr_rsnow(jdep)+rb(i,j)*curr_diffrb(jdep)+ra1)
  1310. xwat2 = max(0.,1.-xland-ci_dat(iglbsfc)%data(i,j,1))
  1311. vdwat2=1./(curr_rwat(jdep)+rb(i,j)*curr_diffrb(jdep)+ra1)
  1312. if (jt == iso4) then
  1313. vdwat1=1./(curr_rsnow(jdep)+ra1)
  1314. vdwat2=1./(curr_rwat(jdep)+ra1)
  1315. end if
  1316. xsum=xland1+xland2+xland3+xland4+xwat1+xwat2
  1317. !fd if (xsum.ne.1.) then
  1318. !fd print *,'sum',i,j,xsum,xland,xland1,xland2,'xl3',&
  1319. !fd xland3,xland4,xwat1,xwat2,cvsh,cvwh,evgrath,ci_dat(iglbsfc)%data(i,j,1)
  1320. !fd end if
  1321. !
  1322. !-- Computation of deposition velocity
  1323. !
  1324. vd11(i,j,jdep)=xland1*vdland1+xland2*vdland2+xland3*vdland3+&
  1325. xland4*vdland4+xwat1*vdwat1+xwat2*vdwat2
  1326. end do !End of loop longitude
  1327. end do !End of loop latitude
  1328. adum=names(jt)
  1329. i=len_trim(adum)
  1330. if ( okdebug ) then
  1331. call dist_arr_stat(dgrid(iglbsfc), 'vd'//adum(1:i), vd11(:,:,jdep), 0, status )
  1332. IF_NOTOK_RETURN(status=1)
  1333. end if
  1334. end if ! (curr_diffcf(jdep) > 1e-5)
  1335. !
  1336. end do !End of loop tracer
  1337. deallocate(rwatso4)
  1338. deallocate(rsoilnh3)
  1339. deallocate(rsoilso2)
  1340. deallocate(rsoilso4)
  1341. deallocate(rsnowhno3)
  1342. deallocate(rsnowso2)
  1343. deallocate( curr_diffrb )
  1344. deallocate( curr_rsoil )
  1345. deallocate( curr_rwat )
  1346. deallocate( curr_rws )
  1347. deallocate( curr_rsnow )
  1348. deallocate( curr_rmes )
  1349. deallocate( curr_rcut )
  1350. deallocate( curr_diffcf )
  1351. end if ! ndep > 0
  1352. !
  1353. ! *** aerosols
  1354. !
  1355. if ( nrdep > 0 ) then
  1356. ! look up table for different aerosol radii:
  1357. do irdep = 1, nrdep
  1358. !PLS !$OMP PARALLEL &
  1359. !PLS !$OMP default (none) &
  1360. !PLS !$OMP shared (irdep, lur, wind10m, lsmask_dat, alphae, t2m_dat, &
  1361. !PLS !$OMP ustar_land, raero, ustar_sea, sr_sea, alpha, bubble, &
  1362. !PLS !$OMP vd11a) &
  1363. !PLS !$OMP private (i, j, js, je, zr, vd_land, vd_sea, um, xland, cunning, &
  1364. !PLS !$OMP dc, densaer, relax, sc, ust_land, st_land, vb_land, &
  1365. !PLS !$OMP vkd_land, ust_sea, st_sea, re, vbsea, visea, &
  1366. !PLS !$OMP vkdaccsea, vkd_sea, vi_land)
  1367. ! call my_omp_domain (1, nlat180, js, je)
  1368. do j=j1,j2
  1369. do i=i1,i2
  1370. zr = 2.0e-4 * lur(irdep) ! diameter in cm !
  1371. vd_land=0.
  1372. vd_sea=0.
  1373. um=wind10m(i,j)
  1374. xland = lsmask_dat(iglbsfc)%data(i,j,1)/100.0 ![]fraction
  1375. !--- Cunningham factor:
  1376. cunning=1.+(cl/(alphae(i,j)*zr))*(2.514+0.800*EXP(-0.55*zr/cl))
  1377. !--- Diffusivity:
  1378. dc=(bc* t2m_dat(iglbsfc)%data(i,j,1)*cunning)/(3.*pi*dynvisc*(alphae(i,j)*zr)) ! [cm2/s] FD
  1379. ! Relaxation:
  1380. ! relax represents characteristic relaxation time scale [Seinfeld, p. 319]
  1381. ! [ kg m-3 => g cm-3 ]
  1382. densaer = density_ref ! reference density (e.q. 1800 kg/m3)
  1383. relax=cunning*densaer*1.E-3*((alphae(i,j)*zr)**2. ) &
  1384. /(18.*dynvisc*kappa)
  1385. ! Sedimentation is calculated operator split in the subroutine sedimentation:
  1386. !
  1387. ! sedspeed=(((((alphae(i,j)*zr(i,j)))**2.)* &
  1388. ! densaer(jl,klev,jmod,jrow)*1.E-3*grav*cunning)/(18.*dynvisc)) ! note grav should be in cm
  1389. ! [ kg m-3 => g cm-3 ]
  1390. ! Calculation of schmidt
  1391. sc =visc/dc ![cm2 s-1]/[cm2 s-1] dimensionless
  1392. if (xland.gt.0.01) then
  1393. ! note that in ECHAM there is a difference between vegetaton and snow/bare soil
  1394. ! in TM5 there we assume this is incorporated in the 1x1 fields
  1395. ust_land=ustar_land(i,j)
  1396. !
  1397. ! calculation of stokes numbers
  1398. st_land =max(0.1,(relax*(100.*ust_land)**2.)/visc)
  1399. !--- Calculation of the dry deposition velocity
  1400. ! See paper slinn and slinn, 1980, vd is related to d**2/3
  1401. ! over land, whereas over sea there is accounted for slip
  1402. ! vb_ represents the contribution in vd of the brownian diffusion [cm s-1]
  1403. ! and vi_ represents the impaction [cm s-1]
  1404. !
  1405. vb_land =(1./vkarman)*((ust_land/um)**2)*100.*um*(sc**(-2./3.)) ![cm s-1]
  1406. vi_land =(1./vkarman)*((ust_land/um)**2)*100.*um*(10.**(-3./st_land)) ![cm s-1]
  1407. vkd_land =(vb_land+vi_land)*1e-2 ![m s-1]
  1408. vd_land=1./(raero(i,j)+1./vkd_land)
  1409. ! if (vkd_land.gt.1.) write(*,999) &
  1410. ! 'after vb',i,j,'jtype',jtype,'jmod',jmod,'vb',vb_land,'vi',vi_land,&
  1411. ! 'um10',um,'ust_land',ust_land,'dc',dc,'relax',relax,'schmidt',sc,'stokes',st_land
  1412. endif ! xland.gt.0
  1413. if (xland.lt.0.99) then
  1414. !--- Over sea:
  1415. ! Brownian diffusion for rough elements, see Hummelshoj
  1416. ! re is the reynolds stress:
  1417. ust_sea=ustar_sea(i,j)
  1418. st_sea =max(0.1,(relax*(100.*ust_sea)**2.)/visc)
  1419. re =(100.*ust_sea*100.*sr_sea(i,j))/visc ! [cm/s]*[cm]/[cm2/s]
  1420. vbsea =(1./3.)*100.*ust_sea*((sc**(-0.5))*re**(-0.5))
  1421. visea =100.*ust_sea*10.**(-3./st_sea)
  1422. vkdaccsea =vbsea+visea
  1423. vkd_sea =((1.-alpha(i,j))*vkdaccsea+alpha(i,j)*bubble(i,j))*1e-2 ! [m s-1]
  1424. vd_sea=1./(raero(i,j)+1./vkd_sea) ! [m s-1]
  1425. ! if (vkd_sea.gt.1.) write(*,999) 'sea',i,j,'jtype',jtype,'jmod',jmod,'vb',vbsea,&
  1426. ! 'vi',visea,'vkd_sea',vkd_sea,'alpha*bubble',alpha(i,j)*bubble(i,j),'alpha',alpha(i,j)
  1427. endif ! xland.lt.0.99
  1428. vd11a(i,j)= min(0.1,(1.-xland)*vd_sea + xland*vd_land) ! [m s-1] limit to 10 cm/s
  1429. enddo ! j=1,nlat180
  1430. enddo ! i=1,nlon360
  1431. !$OMP END PARALLEL
  1432. ! gather before coarsening
  1433. call gather( dgrid(iglbsfc), vd11a, global_field, 0, status)
  1434. IF_NOTOK_RETURN(status=1)
  1435. if (isRoot) then
  1436. call coarsen_emission('vd', imr, jmr, global_field, vd_temp_global, avg_field, status)
  1437. IF_NOTOK_RETURN(status=1)
  1438. end if
  1439. ! scatter and store
  1440. do region = 1, nregions
  1441. call scatter( dgrid(region), vd_temp(region)%surf, vd_temp_global(region)%surf, 0, status)
  1442. IF_NOTOK_RETURN(status=1)
  1443. vda(region,irdep)%surf = vd_temp(region)%surf
  1444. end do
  1445. enddo ! irdep
  1446. end if ! nrdep > 0
  1447. !
  1448. ! ***
  1449. !
  1450. if ( okdebug ) write(*,*) 'dd_calc_rs: end'
  1451. end subroutine dd_calc_rs
  1452. end subroutine dd_surface_fields
  1453. ! ***
  1454. #ifndef without_photolysis
  1455. subroutine dd_coarsen_vd( vd11, ags, I1, J1, status )
  1456. #else
  1457. subroutine dd_coarsen_vd( vd11, I1, J1, status )
  1458. #endif
  1459. use dims , only : iglbsfc, okdebug
  1460. use chem_param, only : ndep, idep, vd_ncopy, vd_copy_itarget, vd_copy_isource
  1461. use chem_param, only : ihno4, ih2o2, ino2
  1462. use chem_param, only : names
  1463. use toolbox , only : coarsen_emission
  1464. use toolbox , only : escape_tm
  1465. #ifndef without_photolysis
  1466. use photolysis_data, only : phot_dat
  1467. #endif
  1468. use tm5_distgrid, only : dgrid, Get_DistGrid, gather, scatter
  1469. use ParTools, only : isRoot
  1470. ! --- in/out -------------------------------
  1471. real, intent(inout) :: vd11(I1:,J1:,:)
  1472. #ifndef without_photolysis
  1473. real, intent(inout) :: ags(I1:,J1:)
  1474. #endif
  1475. integer, intent(in) :: i1, j1
  1476. integer, intent(out) :: status
  1477. ! --- const -------------------------------
  1478. character(len=*), parameter :: rname = 'dd_coarsen_vd'
  1479. integer,parameter :: avg_field = 1
  1480. ! --- local -------------------------------
  1481. integer :: i,j, region
  1482. integer :: jt,jdep
  1483. integer :: idno2,idh2o2,idhno4
  1484. !character(len=8) :: adum
  1485. !character(len=2) :: bdum
  1486. real, allocatable :: vdhelp(:,:)
  1487. integer :: i01, i02, j01, j02, imr, jmr
  1488. ! --- begin ------------------------------
  1489. CALL GET_DISTGRID( DGRID(iglbsfc), I_STRT=i01, I_STOP=i02, J_STRT=j01, J_STOP=j02, I_WRLD=imr, J_WRLD=jmr )
  1490. if (isRoot) then
  1491. allocate(vdhelp(imr,jmr))
  1492. else
  1493. allocate(vdhelp(1,1))
  1494. end if
  1495. !
  1496. ! --
  1497. ! Scale the surface resistance of a number of trace gases and aerosols
  1498. ! NOx deposition for all NOx components separately and scaling
  1499. ! of NOx afterwards
  1500. !
  1501. ! *** vd(HNO4) = ( vd(NO2) + vd(H2O2) ) / 2.0
  1502. ! search deposited tracer indices for NO2, H2O2, and HNO4
  1503. idno2 = -1
  1504. idh2o2 = -1
  1505. idhno4 = -1
  1506. ! try to reset ...
  1507. do jdep = 1,ndep
  1508. select case(idep(jdep))
  1509. case(ihno4)
  1510. idhno4 = jdep
  1511. case(ih2o2)
  1512. idh2o2 = jdep
  1513. case(ino2)
  1514. idno2 = jdep
  1515. case default
  1516. end select
  1517. end do
  1518. ! HNO4 present ? then compute its deposition velocity:
  1519. if ( idhno4 > 0 ) then
  1520. ! check ...
  1521. if ( any( (/idno2,idh2o2/) < 0 ) ) then
  1522. write (gol,'("deposition velocity for HNO4 computed from NO2 and H2HO2, but at least one not found:")'); call goErr
  1523. write (gol,'(" idno2, idh2o2 : ",2i4)') idno2, idh2o2; call goErr
  1524. TRACEBACK; status=1; return
  1525. end if
  1526. ! vd(HNO4) = ( vd(NO2) + vd(H2O2) ) / 2.0
  1527. vd11(:,:,idhno4) = ( vd11(:,:,idno2) + vd11(:,:,idh2o2) ) / 2.0
  1528. end if
  1529. ! ***
  1530. do jdep=1,ndep
  1531. jt = idep(jdep)
  1532. call gather( dgrid(iglbsfc), vd11(:,:,jdep), vdhelp, 0, status)
  1533. IF_NOTOK_RETURN(status=1)
  1534. if (isRoot) then
  1535. call coarsen_emission('vd', imr, jmr, vdhelp, vd_temp_global, avg_field, status)
  1536. IF_NOTOK_RETURN(status=1)
  1537. end if
  1538. do region = 1,nregions
  1539. call scatter( dgrid(region), vd_temp(region)%surf, vd_temp_global(region)%surf, 0, status)
  1540. IF_NOTOK_RETURN(status=1)
  1541. vd(region,jt)%surf = vd_temp(region)%surf
  1542. !if ( okdebug ) then
  1543. ! adum=names(jt)
  1544. ! write(bdum,'(i2.2)') region
  1545. ! i=len_trim(adum)
  1546. ! !cmk call dumpfield(0,'vd.hdf',&
  1547. ! !cmk vd(region,jt)%surf(:,:),'vd_'//adum(1:i)//bdum)
  1548. !end if
  1549. end do
  1550. end do !jdep
  1551. ! copy fields:
  1552. do jdep = 1, vd_ncopy
  1553. do region = 1, nregions
  1554. vd(region,vd_copy_itarget(jdep))%surf = vd(region,vd_copy_isource(jdep))%surf
  1555. end do
  1556. end do
  1557. #ifndef without_photolysis
  1558. call gather( dgrid(iglbsfc), ags, vdhelp, 0, status)
  1559. IF_NOTOK_RETURN(status=1)
  1560. if (isRoot) then
  1561. ! coarsen ags for photolysis...(temp in vd_temp)
  1562. call coarsen_emission('ags',imr, jmr, vdhelp, vd_temp_global, avg_field, status)
  1563. IF_NOTOK_RETURN(status=1)
  1564. end if
  1565. do region = 1,nregions
  1566. call scatter( dgrid(region), vd_temp(region)%surf, vd_temp_global(region)%surf, 0, status)
  1567. IF_NOTOK_RETURN(status=1)
  1568. ! store coarsend albedo in photolysis data:
  1569. phot_dat(region)%albedo = vd_temp(region)%surf
  1570. ! update albedo statistics:
  1571. !JEW: phot_dat(region)%ags_av = phot_dat(region)%ags_av + phot_dat(region)%albedo
  1572. !JEW: phot_dat(region)%nalb_av = phot_dat(region)%nalb_av + 1
  1573. end do
  1574. #endif
  1575. ! Done
  1576. deallocate(vdhelp)
  1577. status = 0
  1578. end subroutine dd_coarsen_vd
  1579. END MODULE DRY_DEPOSITION