emission_nox.F90 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120
  1. !
  2. #define TRACEBACK write (gol,'("in ",a," (",a,i6,")")') rname, __FILE__, __LINE__ ; call goErr
  3. #define IF_NOTOK_RETURN(action) if (status/=0) then; TRACEBACK; action; return; end if
  4. #define IF_ERROR_RETURN(action) if (status> 0) then; TRACEBACK; action; return; end if
  5. !
  6. #include "tm5.inc"
  7. !
  8. !-----------------------------------------------------------------------------
  9. ! TM5 !
  10. !-----------------------------------------------------------------------------
  11. !BOP
  12. !
  13. ! !MODULE: EMISSION_NOX
  14. !
  15. ! !DESCRIPTION: hold data and methods for NOx emissions.
  16. ! -----------------
  17. ! AR5 emissions
  18. ! -----------------
  19. ! For each month, arrays emis_nox_2d/3d have to be filled.
  20. ! It follows the following settins:
  21. ! - take emiss_ene/dom/ind/wst/agr/awb/slv/tra/shp/
  22. ! /air/forestfire/grassfire from AR5 data sets (NO GFED!!)
  23. ! - use natural emissions from MACC data sets
  24. ! (emiss_nat/soil/bio/oc)
  25. ! - vertical distribution is done via emission_vdist_by_sector
  26. ! (emission_data.F90)
  27. ! - lightning is done online (eminox_lightning)
  28. !\\
  29. !\\
  30. ! !INTERFACE:
  31. !
  32. MODULE EMISSION_NOX
  33. !
  34. ! !USES:
  35. !
  36. use GO, only : gol, goErr, goPr, goBug
  37. use tm5_distgrid, only : dgrid, get_distgrid, scatter, gather
  38. use dims, only : nregions, idate, dy, okdebug
  39. use global_types, only : emis_data, d3_data
  40. use emission_read, only : used_providers, has_emis
  41. IMPLICIT NONE
  42. PRIVATE
  43. !
  44. ! !PUBLIC MEMBER FUNCTIONS:
  45. !
  46. public :: Emission_NOx_Init
  47. public :: Emission_NOx_Done
  48. public :: Emission_NOx_Declare
  49. public :: Emission_NOx_bb_daily_cycle
  50. #ifndef without_convection
  51. public :: lightningNOX
  52. #endif
  53. public :: nox_emis_3d, nox_emis_3d_bb_app
  54. public :: eminox_lightning
  55. !
  56. ! !DATA MEMBERS:
  57. !
  58. character(len=*), parameter :: mname = 'emission_nox'
  59. type(d3_data), dimension(nregions), target :: nox_emis_3d, nox_emis_3d_bb, nox_emis_3d_bb_app
  60. type(d3_data), dimension(nregions), target :: eminox_lightning
  61. integer :: nox_2dsec, nox_3dsec
  62. real :: fscalelig ! scaling used in lightning NOX production to get 5.98 Tg for 2006
  63. !
  64. ! !REVISION HISTORY:
  65. ! 1 Oct 2010 - Achim Strunk - overhaul for AR5
  66. ! 1 Dec 2011 - Narcisa Banda - added EDGAR 4
  67. ! 27 Jun 2012 - P. Le Sager - adapted for lon-lat MPI domain decomposition
  68. !
  69. ! !REMARKS:
  70. ! NOx emissions are added directly in chemistry, instead of apart from it.
  71. !
  72. !EOP
  73. !------------------------------------------------------------------------
  74. CONTAINS
  75. !--------------------------------------------------------------------------
  76. ! TM5 !
  77. !--------------------------------------------------------------------------
  78. !BOP
  79. !
  80. ! !IROUTINE: EMISSION_NOX_INIT
  81. !
  82. ! !DESCRIPTION: allocate memory
  83. !\\
  84. !\\
  85. ! !INTERFACE:
  86. !
  87. subroutine Emission_NOx_Init( status )
  88. !
  89. ! !USES:
  90. !
  91. use dims, only : lm
  92. use emission_read, only : providers_def, numb_providers, ed42_nsect_nox
  93. use emission_data, only : LAR5BMB
  94. use emission_read, only : n_ar5_ant_sec, n_ar5_shp_sec, n_ar5_air_sec, n_ar5_bmb_sec
  95. use emission_read, only : ar5_cat_ant, ar5_cat_shp, ar5_cat_air, ar5_cat_bmb
  96. #ifndef without_convection
  97. use meteodata, only : set, gph_dat, temper_dat, cp_dat
  98. use emission_data, only : use_tiedkte
  99. #endif
  100. !
  101. ! !OUTPUT PARAMETERS:
  102. !
  103. integer, intent(out) :: status
  104. !
  105. ! !REVISION HISTORY:
  106. ! 1 Oct 2010 - Achim Strunk - adapted for AR5
  107. ! 27 Jun 2012 - Ph. Le Sager - adapted for lon-lat MPI domain decomposition
  108. ! 10 Jul 2013 - Ph. Le Sager - init lightning when no inventory is selected
  109. !
  110. !EOP
  111. !------------------------------------------------------------------------
  112. !BOC
  113. character(len=*), parameter :: rname = mname//'/Emission_NOx_Init'
  114. integer :: region, i1, j1, i2, j2
  115. integer :: imr, jmr, lmr, lsec, lprov
  116. ! --- begin --------------------------------------
  117. status = 0
  118. #ifndef without_convection
  119. ! Meteo used for LightningNOx
  120. do region=1,nregions
  121. call Set( temper_dat(region), status, used=.true. )
  122. call Set( gph_dat(region), status, used=.true. )
  123. call Set( cp_dat(region), status, used=.true. )
  124. enddo
  125. !
  126. ! Scaling parameter for LiNOx
  127. !
  128. ! Set to get 5.98 Tg N with 2006 EI met fields. This is resolution
  129. ! and met fields dependent. The factor has been estimated for:
  130. ! - @3x2 and 34 levels, Tiedkte : fscalelig=13.715
  131. ! - @1x1 and 34 levels, Tiedkte : fscalelig=17.051
  132. ! - @3x2 and 34 levels, EI conv : fscalelig=13.715*0.786
  133. ! - @1x1 and 34 levels, EI conv : fscalelig=17.051*0.649
  134. !
  135. if (use_tiedkte) then ! convective fluxes computed from T/rh/wind (Tiedkte)
  136. fscalelig=13.715 ! 3x2-34L, Tiedkte scheme
  137. if (dy == 1) fscalelig=17.051 ! 1x1-34L, Tiedkte scheme
  138. else
  139. fscalelig=10.78 ! 3x2-34L, EI convective fluxes
  140. if (dy == 1) fscalelig=11.066 ! 1x1-34L, EI convective fluxes
  141. endif
  142. #endif
  143. ! allocate information arrays (2d and 3d)
  144. do region=1,nregions
  145. CALL GET_DISTGRID( dgrid(region), I_STRT=i1, I_STOP=i2, J_STRT=j1, J_STOP=j2 )
  146. lmr = lm(region)
  147. allocate(eminox_lightning(region)%d3(i1:i2,j1:j2,lmr) )
  148. eminox_lightning(region)%d3=0.
  149. enddo
  150. ! Check if any inventory is used
  151. if(.not. has_emis) return
  152. ! nb of sectors
  153. nox_2dsec = 0
  154. nox_3dsec = 0
  155. do lprov = 1, numb_providers
  156. if (count(used_providers.eq.providers_def(lprov)%name)/=0) then
  157. if (trim(providers_def(lprov)%name) .eq. 'AR5') then
  158. ! nb of available sectors in AR5 depends on category
  159. nox_2dsec = nox_2dsec + n_ar5_ant_sec*count('NO'.eq.ar5_cat_ant) + &
  160. n_ar5_shp_sec*count('NO'.eq.ar5_cat_shp)
  161. if (LAR5BMB) nox_2dsec = nox_2dsec + n_ar5_bmb_sec*count('NO'.eq.ar5_cat_bmb)
  162. nox_3dsec = nox_3dsec + n_ar5_air_sec*count('NO'.eq.ar5_cat_air)
  163. ! nox_2dsec = nox_2dsec + providers_def(lprov)%nsect2d
  164. ! nox_3dsec = nox_3dsec + count('NO'.eq.ar5_cat_air)
  165. elseif (trim(providers_def(lprov)%name) .eq. 'ED42') then
  166. nox_2dsec = nox_2dsec + ed42_nsect_nox
  167. ! no 3d sectors in EDGAR 4.2
  168. else
  169. nox_2dsec = nox_2dsec + providers_def(lprov)%nsect2d
  170. nox_3dsec = nox_3dsec + providers_def(lprov)%nsect3d
  171. endif
  172. endif
  173. enddo
  174. ! allocate information arrays (2d and 3d)
  175. do region=1,nregions
  176. CALL GET_DISTGRID( dgrid(region), I_STRT=i1, I_STOP=i2, J_STRT=j1, J_STOP=j2 )
  177. lmr = lm(region)
  178. allocate( nox_emis_3d (region)%d3(i1:i2,j1:j2,lmr) )
  179. allocate( nox_emis_3d_bb (region)%d3(i1:i2,j1:j2,lmr) )
  180. allocate( nox_emis_3d_bb_app(region)%d3(i1:i2,j1:j2,lmr) )
  181. enddo
  182. status = 0
  183. END SUBROUTINE EMISSION_NOX_INIT
  184. !EOC
  185. !--------------------------------------------------------------------------
  186. ! TM5 !
  187. !--------------------------------------------------------------------------
  188. !BOP
  189. !
  190. ! !IROUTINE: EMISSION_NOX_DONE
  191. !
  192. ! !DESCRIPTION: Free memory
  193. !\\
  194. !\\
  195. ! !INTERFACE:
  196. !
  197. SUBROUTINE EMISSION_NOX_DONE( status )
  198. !
  199. ! !OUTPUT PARAMETERS:
  200. !
  201. integer, intent(out) :: status
  202. !
  203. ! !REVISION HISTORY:
  204. ! 1 Oct 2010 - Achim Strunk - adapted for AR5
  205. !
  206. !EOP
  207. !------------------------------------------------------------------------
  208. !BOC
  209. character(len=*), parameter :: rname = mname//'/Emission_NOx_Done'
  210. integer :: region, lsec
  211. ! --- begin ---------------------------------
  212. status = 0
  213. if(.not. has_emis) return
  214. do region = 1, nregions
  215. deallocate( nox_emis_3d (region)%d3 )
  216. deallocate( nox_emis_3d_bb (region)%d3 )
  217. deallocate( nox_emis_3d_bb_app(region)%d3 )
  218. deallocate( eminox_lightning (region)%d3 )
  219. end do
  220. status = 0
  221. END SUBROUTINE EMISSION_NOX_DONE
  222. !EOC
  223. !--------------------------------------------------------------------------
  224. ! TM5 !
  225. !--------------------------------------------------------------------------
  226. !BOP
  227. !
  228. ! !IROUTINE: EMISSION_NOX_DECLARE
  229. !
  230. ! !DESCRIPTION: Opens, reads and evaluates input files (per month).
  231. ! Provides emissions on 2d/3d-arrays which are then added
  232. ! in the chemistry routine (no *apply !).
  233. ! Vertically distribute the 2D dataset according to sector.
  234. !\\
  235. !\\
  236. ! !INTERFACE:
  237. !
  238. SUBROUTINE EMISSION_NOX_DECLARE( status )
  239. !
  240. ! !USES:
  241. !
  242. use toolbox, only : coarsen_emission
  243. use partools, only : isRoot, par_broadcast
  244. use dims, only : im, jm, lm, nlon360, nlat180, iglbsfc
  245. use dims, only : newsrun, idate, sec_month
  246. use chem_param, only : xmn, xmno2, xmno
  247. use emission_data, only : msg_emis, emission_vdist_by_sector, LAR5BMB
  248. ! ---------------- AR5 - EDGAR 4 - ETC. --------------------
  249. use emission_data, only : emis_input_year_nox, emis_input_year_nat
  250. use emission_data, only : emis_input_dir_mac, emis_input_dir_ed4
  251. use emission_data, only : emis_input_dir_retro, emis_input_dir_gfed
  252. use emission_read, only : emission_ar5_regrid_aircraft
  253. use emission_read, only : emission_cmip6_ReadSector
  254. use emission_read, only : emission_cmip6bmb_ReadSector
  255. use emission_read, only : emission_ar5_ReadSector, emission_macc_ReadSector
  256. use emission_read, only : emission_ed4_ReadSector, emission_gfed_ReadSector
  257. use emission_read, only : emission_retro_ReadSector
  258. use emission_read, only : sectors_def, numb_sectors
  259. use emission_read, only : ar5_dim_3ddata
  260. use emission_read, only : ed42_nox_sectors
  261. !
  262. ! !OUTPUT PARAMETERS:
  263. !
  264. integer, intent(out) :: status
  265. !
  266. ! !REVISION HISTORY:
  267. ! 1 Oct 2010 - Achim Strunk - adapted for AR5
  268. ! 1 Dec 2011 - Narcisa Banda - added EDGAR 4
  269. ! 27 Jun 2012 - Ph. Le Sager - adapted for lon-lat MPI domain decomposition
  270. ! 25 Feb 2014 - Jason Williams - separate array for BMB so that burning daily cycle can be applied
  271. !
  272. ! !REMARKS:
  273. ! (1) Because we do not use an apply method, the vertical distribution
  274. ! is done here. However this is a bug, since this is time dependent.
  275. ! Possible solution: do vert dist in chemistry like the BMB cycle,
  276. ! or in the more general BMB cycle routine.
  277. !
  278. !
  279. !EOP
  280. !------------------------------------------------------------------------
  281. !BOC
  282. character(len=*), parameter :: rname = mname//'/emission_nox_declare'
  283. integer :: region, hasData
  284. integer,parameter :: add_field=0
  285. integer,parameter :: amonth=2
  286. integer :: imr, jmr, lmr, lsec, i1, i2, j1, j2
  287. ! AR5 temporary arrays
  288. real, dimension(:,:,:), allocatable :: field3d !, field3d2
  289. type(d3_data), dimension(nregions), target :: emis3d, work, work3d
  290. type(emis_data), dimension(nregions), target :: emis2d, wrk2D
  291. ! defensive
  292. integer :: seccount2d, seccount3d
  293. ! --- begin -----------------------------------------
  294. status = 0
  295. if(.not. has_emis) return
  296. write(gol,'(" EMISS-INFO ------------- read NOx emissions -------------")'); call goPr
  297. ! reset emissions, allocate work array
  298. do region = 1, nregions
  299. nox_emis_3d(region)%d3 = 0.0 ; nox_emis_3d_bb(region)%d3 = 0.0
  300. CALL GET_DISTGRID( dgrid(region), I_STRT=i1, I_STOP=i2, J_STRT=j1, J_STOP=j2 )
  301. lmr = lm(region)
  302. allocate( work3d(region)%d3 (i1:i2,j1:j2, ar5_dim_3ddata) ) ; work3d(region)%d3 = 0.0
  303. allocate( emis3d(region)%d3 (i1:i2,j1:j2, lmr ) ) ; emis3d(region)%d3 = 0.0
  304. allocate( emis2d(region)%surf(i1:i2,j1:j2) ) ; emis2d(region)%surf = 0.0
  305. end do
  306. ! global arrays for coarsening
  307. do region = 1, nregions
  308. if (isRoot)then
  309. allocate(work(region)%d3(im(region),jm(region),ar5_dim_3ddata))
  310. else
  311. allocate(work(region)%d3(1,1,1))
  312. end if
  313. enddo
  314. do region = 1, nregions
  315. wrk2D(region)%surf => work(region)%d3(:,:,1)
  316. end do
  317. ! --------------------------------
  318. ! do a loop over available sectors
  319. ! --------------------------------
  320. ! count 2d and 3d sectors
  321. seccount2d = 0
  322. seccount3d = 0
  323. ! always allocate here 3d data set (for 2d sectors it will be filled in first layer only)
  324. if (isRoot) then
  325. allocate( field3d( nlon360, nlat180, ar5_dim_3ddata ) ) ; field3d = 0.0
  326. else
  327. allocate( field3d( 1, 1, 1 ) )
  328. end if
  329. sec: do lsec = 1, numb_sectors
  330. if (count(used_providers.eq.sectors_def(lsec)%prov).eq.0) cycle
  331. if ((trim(sectors_def(lsec)%prov).eq.'ED42') .and. (count(ed42_nox_sectors.eq.sectors_def(lsec)%name) .eq. 0)) cycle
  332. if (associated(sectors_def(lsec)%species)) then ! AR5 check
  333. if (count('NO'.eq.sectors_def(lsec)%species).eq.0) cycle
  334. if ((trim(sectors_def(lsec)%catname) .eq. 'biomassburning').and.(.not.LAR5BMB)) cycle
  335. endif
  336. if( sectors_def(lsec)%f3d ) then
  337. seccount3d = seccount3d + 1
  338. else
  339. seccount2d = seccount2d + 1
  340. end if
  341. field3d = 0.0
  342. #ifdef with_online_nox
  343. ! skip natural nox in case it is calculated online
  344. if( trim(sectors_def(lsec)%namecat == 'natural') ) then
  345. write (gol,'(80("-"))'); call goPr
  346. write (gol,'("INFO: skipping sector `",a,"` due to `with_online_nox` ")') trim(sectors_def(lsec)%name); call goPr
  347. cycle
  348. end if
  349. #endif
  350. root: if (isRoot) then ! READ
  351. select case( trim(sectors_def(lsec)%prov) )
  352. case( 'CMIP6' )
  353. call emission_cmip6_ReadSector( 'NOx', emis_input_year_nox, idate(2), lsec, field3d, status )
  354. IF_NOTOK_RETURN(status=1;deallocate(field3d))
  355. ! convert from (kg NO2)/s to (kg N)/s
  356. field3d = field3d * xmn / xmno2
  357. case( 'CMIP6BMB' )
  358. call emission_cmip6bmb_ReadSector( 'NOx', emis_input_year_nox, idate(2), lsec, field3d, status )
  359. IF_NOTOK_RETURN(status=1;deallocate(field3d))
  360. ! convert from (kg NO)/s to (kg N)/s
  361. ! http://www.falw.vu/~gwerf/GFED/GFED4/ancill/GFED4_Emission_Factors.txt
  362. field3d = field3d * xmn / xmno
  363. case( 'AR5' )
  364. ! AR5 emissions included NO and NO2 aircraft emissions, but they are duplicates. So
  365. ! only take into account one of the sets. (in TM5: NO, skip NO2).
  366. ! Screen out solvent sector for NO,
  367. ! because it is zero in the RCPs
  368. ! and not present in the historical files.
  369. if (trim(sectors_def(lsec)%name) .ne. 'emiss_slv') then
  370. call emission_ar5_ReadSector( 'NO', emis_input_year_nox, idate(2), lsec, field3d, status )
  371. IF_NOTOK_RETURN(status=1)
  372. ! convert from (kg NO)/s to (kg N)/s
  373. field3d = field3d * xmn / xmno
  374. endif
  375. case( 'MACC' )
  376. ! screen out sectors w/o NOx (bio, oc, nat)
  377. if ( (trim(sectors_def(lsec)%name) .eq. 'emiss_soil' ) .or. &
  378. (trim(sectors_def(lsec)%name) .eq. 'emiss_anthro') .or. &
  379. (trim(sectors_def(lsec)%name) .eq. 'emiss_air' ) ) then
  380. if (trim(sectors_def(lsec)%catname) .eq. 'natural') then
  381. call emission_macc_ReadSector( emis_input_dir_mac, 'NO', emis_input_year_nat, idate(2), &
  382. '0.5x0.5_kg.nc', sectors_def(lsec)%name, 'kg NO / s', field3d, status )
  383. IF_NOTOK_RETURN(status=1)
  384. else
  385. call emission_macc_ReadSector( emis_input_dir_mac, 'NO', emis_input_year_nox, idate(2), &
  386. '0.5x0.5_kg.nc', sectors_def(lsec)%name, 'kg NO / s', field3d, status )
  387. IF_NOTOK_RETURN(status=1)
  388. endif
  389. ! convert from (kg NO)/s to (kg N)/s
  390. field3d = field3d * xmn / xmno
  391. endif
  392. case( 'ED41' )
  393. select case(trim(sectors_def(lsec)%name))
  394. case ('1A3a','1A3b_c_e','1A3d_SHIP','1A3d1')
  395. ! anthropogenic sources
  396. call emission_ed4_ReadSector( emis_input_dir_ed4, 'NOx','nox', emis_input_year_nox, idate(2), &
  397. lsec, trim(sectors_def(lsec)%prov), 'kg / s', field3d, status )
  398. IF_NOTOK_RETURN(status=1;deallocate(field3d))
  399. end select
  400. case( 'ED42' )
  401. ! biomass burning (GFED/RETRO/AR5BMB) and transport (ED41) are excluded through ED42_NOX_SECTORS definition
  402. call emission_ed4_ReadSector( emis_input_dir_ed4, 'NOx', 'nox', emis_input_year_nox, idate(2), &
  403. lsec, trim(sectors_def(lsec)%prov), 'kg / s', field3d, status )
  404. IF_NOTOK_RETURN(status=1)
  405. case('GFEDv3')
  406. call emission_gfed_ReadSector( emis_input_dir_gfed, 'nox', emis_input_year_nox, idate(2), &
  407. sectors_def(lsec)%name, 'kg NO2 / s', field3d(:,:,1), status )
  408. IF_NOTOK_RETURN(status=1)
  409. ! convert from (kg NO2)/s to (kg N)/s
  410. field3d = field3d * xmn / xmno2
  411. case('RETRO')
  412. call emission_retro_ReadSector( emis_input_dir_retro, 'NOX', emis_input_year_nox, idate(2), &
  413. sectors_def(lsec)%name, 'kg / s', field3d(:,:,1), status )
  414. IF_NOTOK_RETURN(status=1)
  415. ! in the file kg(species)/m2/s - what does this mean?? by the numbers I assume kg NO2
  416. ! convert from (kg NO2)/s to (kg N)/s
  417. field3d = field3d * xmn / xmno2
  418. case('MEGAN')
  419. !
  420. ! use soil emissions from MACC
  421. !
  422. case('DUMMY')
  423. case default
  424. write(gol,*) "Error in building list of providers USED_PROVIDERS"; call goErr
  425. status=1; TRACEBACK; return
  426. end select
  427. ! verbose
  428. if(sum(field3d) < 100.*TINY(1.0) ) then
  429. if (okdebug) then
  430. write(gol,'("EMISS-INFO - no NOx emissions found for ",a," ",a," for month ",i2 )') &
  431. trim(sectors_def(lsec)%prov), sectors_def(lsec)%name, idate(2) ; call goPr
  432. endif
  433. hasData=0
  434. else
  435. if (okdebug) then
  436. write(gol,'("EMISS-INFO - found NOx emissions for ",a," ",a," for month ",i2 )') &
  437. trim(sectors_def(lsec)%prov), sectors_def(lsec)%name, idate(2) ; call goPr
  438. endif
  439. ! scale from kg/s to kg/month
  440. field3d = field3d * sec_month ! kg / month
  441. hasData=1
  442. endif
  443. end if root
  444. call Par_broadcast(hasData, status)
  445. IF_NOTOK_RETURN(status=1)
  446. if (hasData == 0) cycle sec
  447. ! reset temporary arrays
  448. do region = 1, nregions
  449. emis3d(region)%d3 = 0.0
  450. work3d(region)%d3 = 0.0
  451. emis2d(region)%surf = 0.0
  452. end do
  453. ! distinguish 2d/3d sectors
  454. if( sectors_def(lsec)%f3d ) then
  455. ! ---------------------------
  456. ! 3d data (AIRCRAFT)
  457. ! ---------------------------
  458. if (isRoot) then
  459. ! write some numbers
  460. call msg_emis( amonth, trim(sectors_def(lsec)%prov), sectors_def(lsec)%name, 'NOx', xmn, sum(field3d) )
  461. ! distribute to work arrays in regions
  462. call Coarsen_Emission( 'NOX '//trim(sectors_def(lsec)%name), nlon360, nlat180, ar5_dim_3ddata, &
  463. field3d, work, add_field, status )
  464. IF_NOTOK_RETURN(status=1)
  465. end if
  466. ! scatter, sum up on target array
  467. do region = 1, nregions
  468. call scatter(dgrid(region), work3d(region)%d3, work(region)%d3, 0, status)
  469. IF_NOTOK_RETURN( status=1 )
  470. CALL GET_DISTGRID( dgrid(region), I_STRT=i1, J_STRT=j1)
  471. ! aircraft data: regrid vertically to model layers
  472. call emission_ar5_regrid_aircraft( region, i1, j1, work3d(region)%d3, emis3d(region)%d3, status )
  473. IF_NOTOK_RETURN( status=1 )
  474. nox_emis_3d(region)%d3 = nox_emis_3d(region)%d3 + emis3d(region)%d3
  475. end do
  476. else ! ar5_sector is 2d
  477. ! ---------------------------
  478. ! 2d data (Anthropogenic, Ships, Biomassburning, ...)
  479. ! ---------------------------
  480. if (isRoot) then ! print total & regrid
  481. call msg_emis( amonth, trim(sectors_def(lsec)%prov), sectors_def(lsec)%name, 'NOx', xmn, sum(field3d(:,:,1)) )
  482. call coarsen_emission( 'NOx '//sectors_def(lsec)%name, nlon360, nlat180, field3d(:,:,1), &
  483. wrk2D, add_field, status )
  484. IF_NOTOK_RETURN(status=1)
  485. end if
  486. ! scatter, distribute vertically according to sector, and sum up on target array
  487. do region = 1, nregions
  488. call scatter(dgrid(region), emis2d(region)%surf, work(region)%d3(:,:,1), 0, status)
  489. IF_NOTOK_RETURN(status=1)
  490. call emission_vdist_by_sector( sectors_def(lsec)%vdisttype, 'NOx', region, emis2d(region), emis3d(region), status )
  491. IF_NOTOK_RETURN(status=1)
  492. if ( trim(sectors_def(lsec)%catname) .eq. 'biomassburning') then
  493. nox_emis_3d_bb(region)%d3 = nox_emis_3d_bb(region)%d3 + emis3d(region)%d3
  494. else
  495. nox_emis_3d(region)%d3 = nox_emis_3d(region)%d3 + emis3d(region)%d3
  496. endif
  497. end do
  498. end if ! sectors_def
  499. end do sec ! sectors
  500. deallocate( field3d )
  501. do region = 1, nregions
  502. if (associated(wrk2D(region)%surf)) nullify(wrk2D(region)%surf)
  503. deallocate( emis3d(region)%d3, emis2d(region)%surf )
  504. deallocate( work(region)%d3 )
  505. deallocate( work3d(region)%d3 )
  506. end do
  507. ! check sectors found
  508. if( seccount2d /= nox_2dsec ) then
  509. write(gol,'(80("-"))') ; call goPr
  510. write(gol,'("ERROR: 2d sectors do not equal total number:",i4," /= ",i4," !")') seccount2d, nox_2dsec ; call goErr
  511. write(gol,'(80("-"))') ; call goPr
  512. status=1; return
  513. end if
  514. if( seccount3d /= nox_3dsec ) then
  515. write(gol,'(80("-"))') ; call goPr
  516. write(gol,'("ERROR: 3d sectors do not equal total number:",i4," /= ",i4," !")') seccount3d, nox_3dsec ; call goErr
  517. write(gol,'(80("-"))') ; call goPr
  518. status=1; return
  519. end if
  520. ! ok
  521. status = 0
  522. END SUBROUTINE EMISSION_NOX_DECLARE
  523. !EOC
  524. !--------------------------------------------------------------------------
  525. ! TM5 !
  526. !--------------------------------------------------------------------------
  527. !BOP
  528. !
  529. ! !IROUTINE: EMISSION_NOX_BB_DAILY_CYCLE
  530. !
  531. ! !DESCRIPTION: Impose daily burning cycle to BMB NOx emissions for current
  532. ! time step.
  533. !\\
  534. !\\
  535. ! !INTERFACE:
  536. !
  537. SUBROUTINE EMISSION_NOX_BB_DAILY_CYCLE( status )
  538. !
  539. ! !USES:
  540. !
  541. use dims, only : itaur, nsrce, tref, lm
  542. use dims, only : dx, xref, xbeg, yref, ybeg, ndyn_max
  543. use partools, only : myid
  544. use emission_data, only : emis_bb_trop_cycle, bb_cycle
  545. use datetime, only : tau2date
  546. !
  547. ! !OUTPUT PARAMETERS:
  548. !
  549. integer, intent(out) :: status
  550. !
  551. ! !REVISION HISTORY:
  552. ! 23 Jan 2014 - Jason Williams - V0
  553. !
  554. !EOP
  555. !------------------------------------------------------------------------
  556. !BOC
  557. character(len=*), parameter :: rname = mname//'/emission_nox_bb_daily_cycle'
  558. integer :: i,j,l,region, lmr, itim, ntim
  559. integer :: i1, i2, j1, j2, ipos, sec_in_day
  560. integer, dimension(6) :: idater
  561. real :: dtime, dtime2, xlon, xlat
  562. !
  563. REG: do region = 1, nregions
  564. !
  565. ! Re-initialize the bb NOx array
  566. !
  567. nox_emis_3d_bb_app(region)%d3 = 0.0
  568. call tau2date(itaur(region),idater)
  569. dtime = float(nsrce)/(2*tref(region)) ! emissions are added in two steps...XYZECCEZYX.
  570. dtime2 = float(ndyn_max)/(2*tref(region))
  571. ntim = 86400/nint(dtime2) ! number of timesteps in 24 hours.
  572. sec_in_day = idater(4)*3600 + idater(5)*60 + idater(6) ! elapsed seconds this day
  573. itim = sec_in_day/nint(dtime2)+1 ! time interval
  574. if(okdebug) then
  575. write(gol,*)'emission_nox_bb_daily_cycle in region ',region,' at date: ',idater, ' with time step:', dtime,' on ',myid
  576. call goPr
  577. end if
  578. CALL GET_DISTGRID( dgrid(region), I_STRT=i1, I_STOP=i2, J_STRT=j1, J_STOP=j2 )
  579. lmr = lm(region)
  580. if( emis_bb_trop_cycle) then
  581. do l=1,lmr
  582. do j=j1,j2
  583. do i=i1,i2
  584. xlat = ybeg(region) + (j-0.5)*dy/yref(region)
  585. if (xlat .gt. -20 .and. xlat .lt. 20) then
  586. ! apply emission cycle in tropics only
  587. ! itim = 1 and lon = -180 --->position 1
  588. ! itim = ntim ant lon = -180 --->position ntim, etc.
  589. ! itim = 1 and lon = 0 ---->position ntim/2
  590. xlon = xbeg(region) + (i-0.5)*dx/xref(region)
  591. ipos = 1 + mod(int((xlon+180.)*ntim/360.) + (itim-1),ntim) !position in array depending on time and lon.
  592. nox_emis_3d_bb_app(region)%d3(i,j,l) = nox_emis_3d_bb(region)%d3(i,j,l)*bb_cycle(region)%scalef(ipos)
  593. else
  594. nox_emis_3d_bb_app(region)%d3(i,j,l) = nox_emis_3d_bb(region)%d3(i,j,l)
  595. endif
  596. enddo
  597. enddo
  598. enddo
  599. else
  600. nox_emis_3d_bb_app(region)%d3 = nox_emis_3d_bb(region)%d3
  601. endif
  602. end do REG
  603. if(okdebug) then
  604. write(gol,*) 'end of emission_nox_bb_daily_cycle'; call goPr
  605. end if
  606. status=0
  607. END SUBROUTINE EMISSION_NOX_BB_DAILY_CYCLE
  608. #ifndef without_convection
  609. !--------------------------------------------------------------------------
  610. ! TM5 !
  611. !--------------------------------------------------------------------------
  612. !BOP
  613. !
  614. ! !IROUTINE: lightningNOx
  615. !
  616. ! !DESCRIPTION: Calculates NOx emissions from lightning as input for
  617. ! photochemistry module. NOx lightning is calculated using a linear
  618. ! relationship between lightning flashes and convective precipitation
  619. !
  620. ! * total annual production is approximately 5 Tg(N)/yr
  621. ! * marine lightning is ten times less active
  622. ! * fraction of cloud-to-ground over total flashes is determined by
  623. ! 4th order polynomial fit of the cold cloud thickness (Price and
  624. ! Rind, GRL 1993).
  625. ! * NOx production per IC and CG flash is according to Price et al,
  626. ! JGR, 1997.
  627. ! * vertical NOx profile is an approximation of the 'outflow' profile
  628. ! adopted from Pickering et al., JGR 1998.
  629. !
  630. ! Calculate distribution of lightning using cloudtop heights
  631. ! of deep convection, cloud cover and convective precipitation
  632. !
  633. ! Reference: E. Meijer, KNMI.
  634. ! Physics and Chemistry of the earth, Manuscript ST6.03-4
  635. !\\
  636. !\\
  637. ! !INTERFACE:
  638. !
  639. SUBROUTINE LIGHTNINGNOX(region, I1, J1, emilig, status)
  640. !
  641. ! !USES:
  642. !
  643. USE dims, only : im,jm,lm,ybeg,yref
  644. use Dims, only : CheckShape
  645. USE Binas, only : Avog
  646. use chem_param, only : xmn
  647. use partools, only : isRoot, par_reduce
  648. USE toolbox, only : ltropo, lvlpress
  649. USE meteodata, only : m_dat, phlb_dat
  650. use meteodata, only : temper_dat, gph_dat, cp_dat
  651. USE global_data, only : region_dat, conv_dat
  652. USE emission_data, only : plandr
  653. !
  654. ! !INPUT PARAMETERS:
  655. !
  656. integer, intent(in) :: region, i1, j1
  657. !
  658. ! !OUTPUT PARAMETERS:
  659. !
  660. real, intent(out) :: emilig(i1:,j1:,:) ! lighting emissions (kg N/s)
  661. integer, intent(out) :: status
  662. !
  663. ! !REVISION HISTORY:
  664. ! ? ??? 2001 - Ernst Meijer - Set up
  665. ! ? ??? 2002 - Olivie, van Weele - Revisions
  666. ! ? Jul 2002 - Frank Dentener - adapted for TM5
  667. ! ? Jan 2003 - Maarten krol - adapted for NEW TM5
  668. ! 1 Oct 2010 - Achim Strunk - protex
  669. ! 27 Jun 2012 - P. Le Sager - adapted for lon-lat MPI domain decomposition
  670. ! 21 Aug 2013 - Ph. Le Sager - update fscalelig for 1x1
  671. !
  672. ! !REMARKS:
  673. !
  674. !EOP
  675. !------------------------------------------------------------------------
  676. !BOC
  677. character(len=*), parameter :: rname = mname//'/lightningNOx'
  678. real, dimension(:,:,:), pointer :: phlb ! pressure (Pa) (1:lm+1)
  679. real, dimension(:,:,:), pointer :: m ! air mass (kg)
  680. real, dimension(:,:,:), pointer :: gph ! height (incl. oro)
  681. integer,dimension(:,:), pointer :: lutop ! cloud_top
  682. integer,dimension(:,:), pointer :: lubottom ! cloud base
  683. real,dimension(:), pointer :: dxyp ! area (m)
  684. real,dimension(:,:,:), pointer :: t ! temperature (K)
  685. real,dimension(:,:,:), pointer :: cp ! convective precipitation (mm/day)
  686. real,dimension(:,:), pointer :: plandregion ! landfraction (0-1)
  687. !
  688. real,dimension(:),allocatable :: gphx,tx
  689. real :: top ! cloudtop (km)
  690. real :: cldd ! cold cloud extension (km) (0 deg - tep)
  691. integer :: ibase ! base of cloud layer
  692. integer :: itropo ! tropopuase layer
  693. integer :: itop ! top of cloud layer
  694. integer :: itmin15 ! layer with the t=-15 isotherm
  695. integer :: itmin24 ! layer with the t=-24 isotherm
  696. integer :: it0 ! layer with the t= 0 isotherm
  697. !
  698. real :: cpc ! convective precipitation => (m s^-1)
  699. !
  700. real :: fl ! flash rate (1/s)
  701. real :: cg ! cloud-to-ground flashe rate (1/s)
  702. real :: ic ! intra-cloud flash rate (1/s)
  703. real :: pnocg,pnoic ! molecules NO produced per CG, IC flash
  704. ! DIAGNOSTIC variables
  705. real :: flashglob ! global flash frequency (1/s)
  706. real :: flashtrop ! tropical flash frequency (1/s)
  707. real :: ic_flashglob ! global flash frequency (1/s)
  708. real :: ic_flashtrop ! tropical flash frequency (1/s)
  709. real :: noxltrop ! tropical NOxL (kg/s)
  710. !
  711. logical :: cld ! flag for initialisation and cloud
  712. !
  713. integer :: i,j,l,ll,nlay,i2,j2
  714. real :: dsum
  715. real :: airmass
  716. integer :: level_pblh
  717. real :: xlat, dlat, tot_emilig
  718. logical :: lightning_output = .false. ! switch for diagnostic output
  719. logical :: lightning_output_2 = .false.
  720. ! for buggy MPI (see comment in budget_global.F90 for details)
  721. real :: flashglob_all, ic_flashglob_all, flashtrop_all, ic_flashtrop_all, noxltrop_all, tot_emilig_all
  722. ! --- begin --------------------------------
  723. CALL GET_DISTGRID( dgrid(region), I_STOP=i2, J_STOP=j2 )
  724. call CheckShape( (/i2-i1+1,j2-j1+1,lm(region)/), shape(emilig), status )
  725. IF_NOTOK_RETURN(status=1)
  726. m => m_dat (region)%data
  727. phlb => phlb_dat (region)%data
  728. cp => cp_dat (region)%data
  729. plandregion => plandr (region)%surf
  730. dxyp => region_dat (region)%dxyp
  731. lubottom => conv_dat (region)%cloud_base
  732. lutop => conv_dat (region)%cloud_top
  733. t => temper_dat (region)%data
  734. gph => gph_dat (region)%data
  735. !
  736. !
  737. allocate(gphx(0:lm(region))) ! note now from 0-->lm
  738. allocate(tx(lm(region)))
  739. !
  740. ! FD region coordinates are needed for determining statistics in tropics
  741. ! (-30 N,30N) and for excluding polar lightning (75N, 75 S) the emissions
  742. ! in parent regions containing a zoom are only set to zero after budget
  743. ! calculations using zoomed
  744. !
  745. ! Initialising statistics
  746. !
  747. flashglob = 0.
  748. flashtrop = 0.
  749. ic_flashglob = 0.
  750. ic_flashtrop = 0.
  751. noxltrop = 0.
  752. !
  753. ! initialising lightning emission
  754. !
  755. emilig(:,:,:) = 0. ! (im,jm,lm)
  756. dlat = dy/yref(region)
  757. !
  758. do j=j1,j2
  759. xlat = float(ybeg(region)) + j*dlat ! southern edge of gridbox
  760. if(xlat < -75.0 .or. (xlat+dlat) > 75.0) cycle ! exclude poles....
  761. do i=i1,i2
  762. !
  763. fl = 0.
  764. cldd = 0.
  765. cg = 0.
  766. ic = 0.
  767. !
  768. ibase = 0
  769. itop = 0
  770. itmin24 = 0
  771. itmin15 = 0
  772. it0 = 0
  773. !
  774. cld = .false.
  775. !
  776. cpc = cp(i,j,1)
  777. !old data cpc = cp(i,j,1) / 1000./86400. ! mm/day => m/s
  778. !
  779. if (cpc.gt.0.) then
  780. tx(:)=t(i,j,:)
  781. gphx(0:lm(region))=gph(i,j,1:lm(region)+1) !note the bounds
  782. ibase = lubottom(i,j)
  783. itop = lutop(i,j)
  784. itropo = ltropo(region,tx,gphx,lm(region))
  785. if (ibase.ne.0.and.itop.ne.0) then
  786. do l = itop, ibase, -1
  787. if (tx(l).le.249.15) itmin24=l
  788. if (tx(l).le.258.15) itmin15=l
  789. if (tx(l).le.273.15) it0 = l
  790. enddo !l
  791. top = (gphx(itop)+gphx(itop-1))/2000. ! cloud top (km)
  792. if (itmin24.ne.0.and.top.gt.5) then
  793. cld = .true. ! IF CLOUD REGIONS, IT IS A DEEP CLOUD
  794. if (itop.gt.itropo) itop = itropo
  795. if (it0 .gt.itropo) it0 = itropo
  796. endif ! itmin24
  797. endif !ibase ne 0
  798. !
  799. if (cld) then
  800. !fd top = (gphx(itop)+gphx(itop-1))/2000. ! cloud top (km)
  801. cldd= top - (gphx(it0)+gphx(it0-1))/2000. ! cold top (km)
  802. fl = fscalelig *4.e6 * cpc * dxyp(j)*1.e-12
  803. fl = (0.9*plandregion(i,j) + 0.1) * fl
  804. if (cldd.ge.5.5) then
  805. cg = fl / (.021*cldd**4-.648*cldd**3+7.493*cldd**2-36.54*cldd+64.09)
  806. ic = fl - cg
  807. else
  808. ! changed from [0.;fl] to [fl; fl-cg] (TvN, PLS, 22-04-2013)
  809. ! this increases the LiNOx by ~8.2 TgN/yr
  810. cg = fl
  811. ic = fl-cg
  812. endif !cldd
  813. ! Price et al. (JGR, 1997) assumed that cloud-ground flashed
  814. ! are 10 times more efficient in producing NOx than intraground flashes.
  815. ! They proposed a production efficiency of 6.7e26 and 6.7e25 molecules NO
  816. ! per CG and IC flash, respectively.
  817. ! These values were also adopted by Pickering et al. (JGR, 1998).
  818. ! Ridley et al. (Atm. Env., 2005) argued that the production efficiency
  819. ! is similar for both types, and Ott et al. (JGR, 2010)
  820. ! later come to a similar conclusion.
  821. !
  822. ! changed pnocg factor from 6.7e9 to 6.7e8 (TvN, PLS, 22-04-2013),
  823. ! the value used for pnoic
  824. !
  825. ! The new value of 6.7e25 molecules NO per flash corresponds
  826. ! to about 112 mol NO per flash, which is lower than current estimates.
  827. ! Ott et al. find a mean of 500 mol per flash,
  828. ! while Finney et al. (ACP, 2016) use 250 mol per flash in their model.
  829. ! Assuming these estimates to be realistic,
  830. ! this implies that the resolution dependent scale factor fscalelig
  831. ! can be written as the product of two factors:
  832. ! - a resolution independent factor that increases the production efficiency
  833. ! to more realistic value.
  834. ! Assuming a production efficiency between 250 and 500 mol per flash,
  835. ! this factor is in the range 2.2 to 4.5.
  836. ! - a resolution dependent factor that scales the flash rates.
  837. ! Currently we use an target total NOx production of 6.0 Tg N/yr,
  838. ! using meteorology for the reference year 2006.
  839. ! When ERA-Interim is used (also for the convective fluxes)
  840. ! this results in a scale factor of about 11 (see above).
  841. ! Then the scale factor for the flash rate is in the range 2.5 to 5.
  842. !
  843. ! Reducing the target (e.g to 3.0 TgN/yr),
  844. ! the scale factor for the flash rate would be reduced by proportionally.
  845. !
  846. ! The estimated range for the global NOx production from lightning
  847. ! based on the review by Schumann and Huntrieser (ACP, 2007)
  848. ! is 5 +- 3 Tg N/yr (or 2 to 8 Tg N/yr).
  849. !
  850. pnocg = 1e17*6.7e8*cg *xmn*1e-3/Avog
  851. pnoic = 1e17*6.7e8*ic *xmn*1e-3/Avog
  852. ! DISTRIBUTION of LNOx over the COLUMN
  853. !
  854. ! assume all IC-LNOx and 70% of CG-LNOx betweem t=-15 and cloudtop;
  855. ! assume 10% of CG-LNOx between EARTH SURFACE and t=-15
  856. ! assume 20% of CG-LNOx in BOUNDARY LAYER
  857. !
  858. ! To avoid dependency on the vertical resolution :
  859. ! - surface emission in lowest layers : boundary layer height;
  860. ! - LNOx within one of these three regions is distributed proportional to the mass of each layer.
  861. ! distributing all IC LNOx and 70% of CG LNOx BETWEEN t=-15 and CLOUDTOP
  862. dsum = 0.7*pnocg+pnoic
  863. ! determining nlay
  864. itop = min(itop,itropo-1)
  865. nlay = itop - itmin15
  866. if (nlay.le.0) then
  867. itmin15=itop-1
  868. nlay = 1
  869. if (lightning_output_2) write(6,*) 'WARNING noxlight_cvp: itmin15>=itropo: ',i,j,itropo,itmin15
  870. endif !nlay le 0
  871. ! distributing according to airmass
  872. airmass = 0.
  873. do l=itmin15+1,itop
  874. airmass = airmass + m(i,j,l)
  875. enddo
  876. do l=itmin15+1,itop
  877. emilig(i,j,l) = dsum*m(i,j,l)/airmass
  878. enddo
  879. ! distributing 10% of CG LNOx between EARTH SURFACE and t=-15
  880. dsum = 0.1 * pnocg
  881. ! distributing according to air mass
  882. airmass = 0.
  883. do l=1,itmin15
  884. airmass = airmass + m(i,j,l)
  885. enddo
  886. do l=1,itmin15
  887. emilig(i,j,l) = emilig(i,j,l) + dsum*m(i,j,l)/airmass
  888. enddo
  889. ! distributing 20% of CG LNOx between ground pressure and 0.8*ground pressure
  890. dsum = 0.2 * pnocg
  891. level_pblh = lvlpress(region,0.8*phlb(i,j,1),phlb(i,j,1))
  892. ! distributing according to airmass
  893. airmass = 0.
  894. do l=1,level_pblh
  895. airmass = airmass + m(i,j,l)
  896. enddo
  897. do l=1,level_pblh
  898. emilig(i,j,l) = emilig(i,j,l) + dsum*m(i,j,l)/airmass
  899. enddo
  900. if (lightning_output) then ! CALCULATE GLOBAL/TROPICAL flash, NOxL rates
  901. flashglob = flashglob + fl
  902. ic_flashglob = ic_flashglob + ic
  903. select case(nint(xlat)) ! xlat is the southern edge of box j....
  904. case(-30:29)
  905. flashtrop = flashtrop + fl
  906. ic_flashtrop = ic_flashtrop + ic
  907. do l = 1, lm(region)
  908. noxltrop = noxltrop + emilig(i,j,l)
  909. enddo
  910. case default
  911. end select
  912. endif ! lightning_output
  913. endif !cld = .true.
  914. endif !cpc.gt.0.
  915. enddo !i
  916. enddo !j
  917. if (lightning_output) then
  918. call par_reduce( flashglob , 'sum', flashglob_all , status )
  919. call par_reduce( ic_flashglob , 'sum', ic_flashglob_all , status )
  920. call par_reduce( flashtrop , 'sum', flashtrop_all , status )
  921. call par_reduce( ic_flashtrop , 'sum', ic_flashtrop_all , status )
  922. call par_reduce( noxltrop , 'sum', noxltrop_all , status )
  923. tot_emilig = sum(emilig)
  924. call par_reduce( tot_emilig, 'sum', tot_emilig_all, status )
  925. if (isRoot) then
  926. write(gol,*) 'EMISS-INFO - global lightning frequency = ',flashglob_all,' s-1' ; call goPr
  927. write(gol,*) 'EMISS-INFO - ic global lightning frequency = ',ic_flashglob_all,' s-1' ; call goPr
  928. write(gol,*) 'EMISS-INFO - tropical lightning frequency = ',flashtrop_all,' s-1' ; call goPr
  929. write(gol,*) 'EMISS-INFO - ic tropical lightning frequency= ',ic_flashtrop_all,' s-1' ; call goPr
  930. write(gol,*) 'EMISS-INFO - global lightning emission : ',tot_emilig_all*1.e-9*365.*86400.,' Tg[N]/a' ; call goPr
  931. write(gol,*) 'EMISS-INFO - tropical lightning emission : ',noxltrop_all*1.e-9*365.*86400.,' Tg[N]/a' ; call goPr
  932. end if
  933. endif
  934. nullify(m)
  935. nullify(phlb)
  936. nullify(gph)
  937. nullify(cp)
  938. nullify(plandregion)
  939. nullify(lubottom)
  940. nullify(lutop)
  941. nullify(dxyp)
  942. nullify(t)
  943. deallocate(gphx)
  944. deallocate(tx)
  945. status=0
  946. END SUBROUTINE LIGHTNINGNOX
  947. #endif
  948. END MODULE EMISSION_NOX