dry_deposition.F90 70 KB

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